diff --git a/docs/flaky-tests.md b/docs/flaky-tests.md index 6c6e7517..5e0df97d 100644 --- a/docs/flaky-tests.md +++ b/docs/flaky-tests.md @@ -5,12 +5,12 @@ title: Handling Flaky Tests ## Skipping Tests -In some cases having a story of a component is useful for development purposes, but might be acceptable not to be covered by visual regression tests such as an animated GIF that cannot accurately be covered with a single screenshot. In those cases you can opt out by using `add.skip()`: +In some cases having a story of a component is useful for development purposes, but might be acceptable not to be covered by visual regression tests such as an animated GIF that cannot accurately be covered with a single screenshot. In those cases you can opt out by passing setting `skip: true` in the `loki` parameter: ```js storiesOf('MyComponent', module) .add('enabled story', () => ) - .lokiSkip('skipped story', () => ); + .add('skipped story', () => , { loki: { skip: true } }); ``` ## Asynchronous Stories diff --git a/examples/react/.loki/reference/chrome_a4_CSF_404_Error.png b/examples/react/.loki/reference/chrome_a4_CSF_404_Error.png new file mode 100644 index 00000000..ed693f3d Binary files /dev/null and b/examples/react/.loki/reference/chrome_a4_CSF_404_Error.png differ diff --git a/examples/react/.loki/reference/chrome_a4_CSF_TODO.png b/examples/react/.loki/reference/chrome_a4_CSF_TODO.png new file mode 100644 index 00000000..4beb4118 Binary files /dev/null and b/examples/react/.loki/reference/chrome_a4_CSF_TODO.png differ diff --git a/examples/react/.loki/reference/chrome_iphone7_CSF_404_Error.png b/examples/react/.loki/reference/chrome_iphone7_CSF_404_Error.png new file mode 100644 index 00000000..48a26802 Binary files /dev/null and b/examples/react/.loki/reference/chrome_iphone7_CSF_404_Error.png differ diff --git a/examples/react/.loki/reference/chrome_iphone7_CSF_TODO.png b/examples/react/.loki/reference/chrome_iphone7_CSF_TODO.png new file mode 100644 index 00000000..e4a37ee7 Binary files /dev/null and b/examples/react/.loki/reference/chrome_iphone7_CSF_TODO.png differ diff --git a/examples/react/.loki/reference/chrome_laptop_CSF_404_Error.png b/examples/react/.loki/reference/chrome_laptop_CSF_404_Error.png new file mode 100644 index 00000000..ed693f3d Binary files /dev/null and b/examples/react/.loki/reference/chrome_laptop_CSF_404_Error.png differ diff --git a/examples/react/.loki/reference/chrome_laptop_CSF_TODO.png b/examples/react/.loki/reference/chrome_laptop_CSF_TODO.png new file mode 100644 index 00000000..4beb4118 Binary files /dev/null and b/examples/react/.loki/reference/chrome_laptop_CSF_TODO.png differ diff --git a/examples/react/src/stories/csf.stories.js b/examples/react/src/stories/csf.stories.js new file mode 100644 index 00000000..cc681abc --- /dev/null +++ b/examples/react/src/stories/csf.stories.js @@ -0,0 +1,31 @@ +import React from 'react'; + +import { storiesOf } from '@storybook/react'; +import { linkTo } from '@storybook/addon-links'; + +const Box = ({ color }) => ( +
+); + +export default { + component: Box, + title: 'CSF', +}; + +export const Error404 = () => ; + +Error404.story = { + name: '404 Error', +}; + +export const TODO = () => ; + +TODO.story = { + name: '@TODO', +}; + +export const Skipped = () => ; + +Skipped.story = { + parameters: { loki: { skip: true } }, +}; diff --git a/examples/react/src/stories/index.stories.js b/examples/react/src/stories/index.stories.js index de96f557..abd92ad7 100644 --- a/examples/react/src/stories/index.stories.js +++ b/examples/react/src/stories/index.stories.js @@ -17,9 +17,11 @@ import FetchComponent from '../FetchComponent'; import ZeroHeightWithPadding from '../ZeroHeightWithPadding'; import Hover from '../Hover'; -storiesOf('Welcome', module).lokiSkip('to Storybook', () => ( - -)); +storiesOf('Welcome', module) + .lokiSkip('to Storybook', () => ) + .add('skipped', () => , { + loki: { skip: true }, + }); storiesOf('Text', module).add('with external font', () => ( Hello CursiveText diff --git a/fixtures/storybook-dynamic/iframe.html b/fixtures/storybook-dynamic/iframe.html index 7cc270b3..681f4e69 100644 --- a/fixtures/storybook-dynamic/iframe.html +++ b/fixtures/storybook-dynamic/iframe.html @@ -1,22 +1,74 @@ +Storybook

No Preview

Sorry, but you either have no stories or none are selected somehow.

  • Please check the Storybook config.
  • Try reloading the page.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

\ No newline at end of file diff --git a/fixtures/storybook-dynamic/main.cf4424013badd87a0545.bundle.js b/fixtures/storybook-dynamic/main.cf4424013badd87a0545.bundle.js new file mode 100644 index 00000000..340b5c56 --- /dev/null +++ b/fixtures/storybook-dynamic/main.cf4424013badd87a0545.bundle.js @@ -0,0 +1,816 @@ +(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["main"],{ + +/***/ "../../packages/browser/src/add-loki-session-marker.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/browser/src/add-loki-session-marker.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +const addLokiSessionMarker = window => { + window.document.querySelector(':root').setAttribute('loki-test', true); + /* eslint-disable no-underscore-dangle, no-param-reassign */ + window._isLokiTest = true; +}; + +module.exports = addLokiSessionMarker; + + +/***/ }), + +/***/ "../../packages/browser/src/await-loki-ready.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/browser/src/await-loki-ready.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +const awaitLokiReady = window => + window.loki && window.loki.awaitReady && window.loki.awaitReady(); + +module.exports = awaitLokiReady; + + +/***/ }), + +/***/ "../../packages/browser/src/configure-storybook.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/browser/src/configure-storybook.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* global window */ +const { + decorateStorybook, + registerPendingPromise, + resetPendingPromises, + awaitReady, +} = __webpack_require__(/*! @loki/integration-core */ "../../packages/integration-core/src/index.js"); + +function createConfigurator(storybook) { + return function configureStorybook() { + if (typeof window === 'object') { + if (!window.loki) { + window.loki = {}; + } + window.loki.getStorybook = decorateStorybook(storybook); + window.loki.registerPendingPromise = registerPendingPromise; + window.loki.resetPendingPromises = resetPendingPromises; + window.loki.awaitReady = awaitReady; + } + }; +} + +module.exports = createConfigurator; + + +/***/ }), + +/***/ "../../packages/browser/src/disable-animations.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/browser/src/disable-animations.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* eslint no-param-reassign: ["error", { "props": false }] */ + +const disableAnimations = window => { + const DISABLE_CSS_ANIMATIONS_STYLE = ` + *, :before, :after { + -webkit-transition: none !important; + transition: none !important; + -webkit-animation: none !important; + animation: none !important; + will-change: auto !important; + } + `; + + let currentFrame = 1; + const frameDuration = 16; + const maxFrames = 1000; + let resolveRAF; + let resolveRAFTimer; + const callbacks = []; + + // Speed up with 10x, but beware stepping too fast might cause + // react-motion to pause them instead. + const now = () => currentFrame * 10 * frameDuration; + + // In the case of multiple concurrent animations we want to + // advance them together just like rAF would. + const scheduleFrame = () => { + setTimeout(() => { + currentFrame++; + callbacks.splice(0).forEach(c => c(now())); + + // Assume no new invocations for 50ms means we've ended + resolveRAFTimer = setTimeout(() => { + resolveRAF(); + resolveRAF = null; + resolveRAFTimer = null; + }, 50); + }, 0); + + // Defer screenshotting until animations has ended/stabilized + if (!resolveRAF) { + window.loki.registerPendingPromise( + new Promise(resolve => { + resolveRAF = resolve; + }) + ); + } + + if (resolveRAFTimer) { + clearTimeout(resolveRAFTimer); + resolveRAFTimer = null; + } + }; + + // Monkey patch rAF to resolve immediately. This makes JS + // based animations run until the end within a few milliseconds. + // In case they run infinitely or more than 1000 frames/16 "seconds", + // we just force them to a pause. + window.requestAnimationFrame = callback => { + // Avoid infinite loop by only allowing 1000 frames + if (currentFrame < maxFrames) { + callbacks.push(callback); + if (callbacks.length === 1) { + scheduleFrame(); + } + } + return -1; + }; + + // For implementations of JS transitions that don't use the rAF + // timestamp callback argument, we need to monkey patch `performance.now` + // too. Potentially need to include `Date.now` in the future. + window.performance.now = now; + + // Disable CSS animations/transitions by forcing style. + // Potentially not effective enough if `!important` is used + // elsewhere in the story stylesheet/inline CSS. + window.document.addEventListener('DOMContentLoaded', () => { + const styleElement = window.document.createElement('style'); + window.document.documentElement.appendChild(styleElement); + styleElement.sheet.insertRule(DISABLE_CSS_ANIMATIONS_STYLE); + }); +}; + +module.exports = disableAnimations; + + +/***/ }), + +/***/ "../../packages/browser/src/disable-pointer-events.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/browser/src/disable-pointer-events.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +const disablePointerEvents = window => { + const DISABLE_POINTER_EVENTS_STYLE = ` + * { + pointer-events: none !important; + } + `; + + // Disable pointer events to avoid having hover styles + // for elements at the 0 by 0 position. + window.document.addEventListener('DOMContentLoaded', () => { + const styleElement = window.document.createElement('style'); + window.document.documentElement.appendChild(styleElement); + styleElement.sheet.insertRule(DISABLE_POINTER_EVENTS_STYLE); + }); +}; + +module.exports = disablePointerEvents; + + +/***/ }), + +/***/ "../../packages/browser/src/get-selector-box-size.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/browser/src/get-selector-box-size.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +const getSelectorBoxSize = (window, selector) => { + const isNotWrapperElement = (element, index, array) => { + const isWrapper = array.some(node => + node === element ? false : element.contains(node) + ); + return !isWrapper; + }; + + const isVisisble = element => { + const style = window.getComputedStyle(element); + + return !( + style.visibility === 'hidden' || + style.display === 'none' || + style.opacity === '0' || + ((style.width === '0px' || style.height === '0px') && + style.padding === '0px') + ); + }; + + const elements = Array.from(window.document.querySelectorAll(selector)) + .filter(isVisisble) + .filter(isNotWrapperElement); + + if (elements.length === 0) { + throw new Error('No visible elements found'); + } + + const getBoundingClientRect = element => element.getBoundingClientRect(); + + const boxSizeUnion = (domRect, { x, y, width, height }) => { + if (!domRect) { + return { x, y, width, height }; + } + + const xMin = Math.min(domRect.x, x); + const yMin = Math.min(domRect.y, y); + + const xMax = Math.max(domRect.x + domRect.width, x + width); + const yMax = Math.max(domRect.y + domRect.height, y + height); + + return { + x: xMin, + y: yMin, + width: xMax - xMin, + height: yMax - yMin, + }; + }; + + return elements.map(getBoundingClientRect).reduce(boxSizeUnion); +}; + +module.exports = getSelectorBoxSize; + + +/***/ }), + +/***/ "../../packages/browser/src/get-stories.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/browser/src/get-stories.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +const getStories = window => { + const getStorybook = window.loki && window.loki.getStorybook; + if (!getStorybook) { + throw new Error( + "Loki addon not registered. Add `import 'loki/configure-react'` to your .storybook/preview.js file." + ); + } + return getStorybook().map(component => ({ + id: component.id, + kind: component.kind, + story: component.story, + })); +}; + +module.exports = getStories; + + +/***/ }), + +/***/ "../../packages/browser/src/index.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/browser/src/index.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +const addLokiSessionMarker = __webpack_require__(/*! ./add-loki-session-marker */ "../../packages/browser/src/add-loki-session-marker.js"); +const awaitLokiReady = __webpack_require__(/*! ./await-loki-ready */ "../../packages/browser/src/await-loki-ready.js"); +const createStorybookConfigurator = __webpack_require__(/*! ./configure-storybook */ "../../packages/browser/src/configure-storybook.js"); +const disableAnimations = __webpack_require__(/*! ./disable-animations */ "../../packages/browser/src/disable-animations.js"); +const disablePointerEvents = __webpack_require__(/*! ./disable-pointer-events */ "../../packages/browser/src/disable-pointer-events.js"); +const getSelectorBoxSize = __webpack_require__(/*! ./get-selector-box-size */ "../../packages/browser/src/get-selector-box-size.js"); +const getStories = __webpack_require__(/*! ./get-stories */ "../../packages/browser/src/get-stories.js"); + +module.exports = { + addLokiSessionMarker, + awaitLokiReady, + createStorybookConfigurator, + disableAnimations, + disablePointerEvents, + getSelectorBoxSize, + getStories, +}; + + +/***/ }), + +/***/ "../../packages/integration-core/src/decorate-storybook.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/integration-core/src/decorate-storybook.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* eslint object-shorthand: 0, prefer-arrow-callback: 0, no-var: 0, no-console: 0 */ +// Diverge from regular rules here to not mess with UglifyJS + +const readyStateManager = __webpack_require__(/*! ./ready-state-manager */ "../../packages/integration-core/src/ready-state-manager.js"); + +let warnedSkipDeprecation = false; +let warnedAsyncDeprecation = false; + +function decorateStorybook(storybook) { + const originalStoriesOf = storybook.storiesOf; + + function wrapWithSkipStory(add, kind, isDeprecatedCall) { + return function skipStory(story, storyFn, parameters = {}) { + if (isDeprecatedCall && !warnedSkipDeprecation) { + warnedSkipDeprecation = true; + console.warn( + '[DEPRECATED] `.add.skip(...)` is deprecated. Please use `.lokiSkip(...)` instead.' + ); + } + + return add(story, storyFn, { + ...parameters, + loki: { + ...(parameters.loki || {}), + skip: true, + }, + }); + }; + } + + function wrapWithAsyncStory(add, isDeprecatedCall) { + return function skipStory(story, storyFn, parameters) { + if (isDeprecatedCall && !warnedAsyncDeprecation) { + warnedAsyncDeprecation = true; + console.warn( + '[DEPRECATED] `.add.async(...)` is deprecated. Please use `.lokiAsync(...)` instead.' + ); + } + + return add( + story, + function render(context) { + var resolveAsyncStory = null; + readyStateManager.resetPendingPromises(); + readyStateManager.registerPendingPromise( + new Promise(function(resolve) { + resolveAsyncStory = resolve; + }) + ); + + const done = function() { + if (resolveAsyncStory) { + resolveAsyncStory(); + } + resolveAsyncStory = null; + }; + + return storyFn(Object.assign({ done: done }, context)); + }, + parameters + ); + }; + } + + function storiesOf(kind, module) { + const stories = originalStoriesOf(kind, module); + stories.add.skip = wrapWithSkipStory(stories.add.bind(stories), kind, true); + stories.add.async = wrapWithAsyncStory(stories.add.bind(stories), true); + stories.add.async.skip = wrapWithSkipStory(stories.add.async, kind, true); + stories.add.skip.async = wrapWithAsyncStory(stories.add.skip, true); + + return stories; + } + + // Monkey patch storiesOf to be able to add async/skip methods + const descriptor = Object.getOwnPropertyDescriptor(storybook, 'storiesOf'); + if (descriptor.writable) { + /* eslint no-param-reassign: ["error", { "props": false }] */ + storybook.storiesOf = storiesOf; + } else if (descriptor.configurable) { + // In recent versions of storybook object this isn't writeable, probably due to babel transpilation changes + Object.defineProperty(storybook, 'storiesOf', { + configurable: true, + enumerable: true, + get: function() { + return storiesOf; + }, + }); + } + + storybook.setAddon({ + lokiSkip: function(...args) { + return wrapWithSkipStory(this.add.bind(this), this.kind)(...args); + }, + lokiAsync: function(...args) { + return wrapWithAsyncStory(this.add.bind(this))(...args); + }, + lokiAsyncSkip: function(...args) { + return wrapWithSkipStory( + wrapWithAsyncStory(this.add.bind(this)), + this.kind + )(...args); + }, + }); + + function getStorybook() { + return storybook + .raw() + .filter( + ({ parameters }) => + !parameters || !parameters.loki || !parameters.loki.skip + ); + } + + return getStorybook; +} + +module.exports = decorateStorybook; + + +/***/ }), + +/***/ "../../packages/integration-core/src/index.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/integration-core/src/index.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +const decorateStorybook = __webpack_require__(/*! ./decorate-storybook */ "../../packages/integration-core/src/decorate-storybook.js"); +const readyStateManager = __webpack_require__(/*! ./ready-state-manager */ "../../packages/integration-core/src/ready-state-manager.js"); + +module.exports = Object.assign( + { + decorateStorybook, + }, + readyStateManager +); + + +/***/ }), + +/***/ "../../packages/integration-core/src/ready-state-manager.js": +/*!********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/integration-core/src/ready-state-manager.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* eslint prefer-arrow-callback: 0, no-var: 0, object-shorthand: 0 */ +// Diverge from rules for UglifyJS + +var pendingPromises = []; + +function registerPendingPromise(promise) { + pendingPromises.push(promise); +} + +function resetPendingPromises() { + pendingPromises = []; +} + +function awaitReady() { + return Promise.all(pendingPromises.splice(0)).then(function() { + if (pendingPromises.length) { + return awaitReady(); + } + return true; + }); +} + +module.exports = { + registerPendingPromise: registerPendingPromise, + resetPendingPromises: resetPendingPromises, + awaitReady: awaitReady, +}; + + +/***/ }), + +/***/ "../../packages/integration-react/src/configure-storybook-react.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/integration-react/src/configure-storybook-react.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +const storybook = __webpack_require__(/*! @storybook/react */ "../../node_modules/@storybook/react/dist/client/index.js"); +const { createStorybookConfigurator } = __webpack_require__(/*! @loki/browser */ "../../packages/browser/src/index.js"); + +module.exports = createStorybookConfigurator(storybook); + + +/***/ }), + +/***/ "../../packages/integration-react/src/index.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/integration-react/src/index.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +const configureStorybookReact = __webpack_require__(/*! ./configure-storybook-react */ "../../packages/integration-react/src/configure-storybook-react.js"); + +module.exports = configureStorybookReact; + + +/***/ }), + +/***/ "../../packages/loki/configure-react.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/packages/loki/configure-react.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! @loki/integration-react */ "../../packages/integration-react/src/index.js")(); + + +/***/ }), + +/***/ "./.storybook/generated-entry.js": +/*!***************************************!*\ + !*** ./.storybook/generated-entry.js ***! + \***************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var _storybook_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @storybook/react */ "./node_modules/@storybook/react/dist/client/index.js"); +/* harmony import */ var _storybook_react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_storybook_react__WEBPACK_IMPORTED_MODULE_0__); + +module._StorybookPreserveDecorators = true; +Object(_storybook_react__WEBPACK_IMPORTED_MODULE_0__["configure"])([__webpack_require__("./src sync recursive ^\\.\\/(?:(?:(?!\\.)(?:(?:(?!(?:|\\/)\\.).)*?)\\/)?(?!\\.)(?=.)[^\\/]*?\\.stories\\.js\\/?)$")], module); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/webpack/buildin/harmony-module.js */ "./node_modules/webpack/buildin/harmony-module.js")(module))) + +/***/ }), + +/***/ "./.storybook/preview.js": +/*!*******************************!*\ + !*** ./.storybook/preview.js ***! + \*******************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var loki_configure_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! loki/configure-react */ "../../packages/loki/configure-react.js"); +/* harmony import */ var loki_configure_react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(loki_configure_react__WEBPACK_IMPORTED_MODULE_0__); + + +/***/ }), + +/***/ "./src sync recursive ^\\.\\/(?:(?:(?!\\.)(?:(?:(?!(?:|\\/)\\.).)*?)\\/)?(?!\\.)(?=.)[^\\/]*?\\.stories\\.js\\/?)$": +/*!****************************************************************************************************!*\ + !*** ./src sync ^\.\/(?:(?:(?!\.)(?:(?:(?!(?:|\/)\.).)*?)\/)?(?!\.)(?=.)[^\/]*?\.stories\.js\/?)$ ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var map = { + "./stories/0-Welcome.stories.js": "./src/stories/0-Welcome.stories.js", + "./stories/1-Button.stories.js": "./src/stories/1-Button.stories.js" +}; + + +function webpackContext(req) { + var id = webpackContextResolve(req); + return __webpack_require__(id); +} +function webpackContextResolve(req) { + if(!__webpack_require__.o(map, req)) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } + return map[req]; +} +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = "./src sync recursive ^\\.\\/(?:(?:(?!\\.)(?:(?:(?!(?:|\\/)\\.).)*?)\\/)?(?!\\.)(?=.)[^\\/]*?\\.stories\\.js\\/?)$"; + +/***/ }), + +/***/ "./src/stories/0-Welcome.stories.js": +/*!******************************************!*\ + !*** ./src/stories/0-Welcome.stories.js ***! + \******************************************/ +/*! exports provided: default, ToStorybook */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ToStorybook", function() { return ToStorybook; }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _storybook_addon_links__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @storybook/addon-links */ "./node_modules/@storybook/addon-links/dist/index.js"); +/* harmony import */ var _storybook_addon_links__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_storybook_addon_links__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @storybook/react/demo */ "./node_modules/@storybook/react/demo.js"); +/* harmony import */ var _storybook_react_demo__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__); +var _jsxFileName = "/Users/joel.arvidsson/Code/loki/examples/react/src/stories/0-Welcome.stories.js"; + + + +/* harmony default export */ __webpack_exports__["default"] = ({ + title: 'Welcome', + component: _storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__["Welcome"] +}); +const ToStorybook = () => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__["Welcome"], { + showApp: Object(_storybook_addon_links__WEBPACK_IMPORTED_MODULE_1__["linkTo"])('Button'), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 10, + columnNumber: 34 + } +}); +ToStorybook.displayName = "ToStorybook"; +ToStorybook.story = { + name: 'to Storybook' +}; +ToStorybook.__docgenInfo = { + "description": "", + "methods": [], + "displayName": "ToStorybook" +}; + +if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { + STORYBOOK_REACT_CLASSES["src/stories/0-Welcome.stories.js"] = { + name: "ToStorybook", + docgenInfo: ToStorybook.__docgenInfo, + path: "src/stories/0-Welcome.stories.js" + }; +} + +/***/ }), + +/***/ "./src/stories/1-Button.stories.js": +/*!*****************************************!*\ + !*** ./src/stories/1-Button.stories.js ***! + \*****************************************/ +/*! exports provided: default, Text, Emoji */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Text", function() { return Text; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emoji", function() { return Emoji; }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @storybook/addon-actions */ "../../node_modules/@storybook/addon-actions/dist/index.js"); +/* harmony import */ var _storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @storybook/react/demo */ "./node_modules/@storybook/react/demo.js"); +/* harmony import */ var _storybook_react_demo__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__); +var _jsxFileName = "/Users/joel.arvidsson/Code/loki/examples/react/src/stories/1-Button.stories.js"; + + + +/* harmony default export */ __webpack_exports__["default"] = ({ + title: 'Button', + component: _storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__["Button"] +}); +const Text = () => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__["Button"], { + onClick: Object(_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__["action"])('clicked'), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 10, + columnNumber: 27 + } +}, "Hello Button"); +Text.displayName = "Text"; +const Emoji = () => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__["Button"], { + onClick: Object(_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__["action"])('clicked'), + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 13, + columnNumber: 3 + } +}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { + role: "img", + "aria-label": "so cool", + __self: undefined, + __source: { + fileName: _jsxFileName, + lineNumber: 14, + columnNumber: 5 + } +}, "\uD83D\uDE00 \uD83D\uDE0E \uD83D\uDC4D \uD83D\uDCAF")); +Emoji.displayName = "Emoji"; +Text.__docgenInfo = { + "description": "", + "methods": [], + "displayName": "Text" +}; + +if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { + STORYBOOK_REACT_CLASSES["src/stories/1-Button.stories.js"] = { + name: "Text", + docgenInfo: Text.__docgenInfo, + path: "src/stories/1-Button.stories.js" + }; +} + +Emoji.__docgenInfo = { + "description": "", + "methods": [], + "displayName": "Emoji" +}; + +if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { + STORYBOOK_REACT_CLASSES["src/stories/1-Button.stories.js"] = { + name: "Emoji", + docgenInfo: Emoji.__docgenInfo, + path: "src/stories/1-Button.stories.js" + }; +} + +/***/ }), + +/***/ 0: +/*!*******************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/preview.js ./.storybook/generated-entry.js /Users/joel.arvidsson/Code/loki/node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true ***! + \*******************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! /Users/joel.arvidsson/Code/loki/examples/react/node_modules/@storybook/core/dist/server/common/polyfills.js */"./node_modules/@storybook/core/dist/server/common/polyfills.js"); +__webpack_require__(/*! /Users/joel.arvidsson/Code/loki/examples/react/node_modules/@storybook/core/dist/server/preview/globals.js */"./node_modules/@storybook/core/dist/server/preview/globals.js"); +__webpack_require__(/*! /Users/joel.arvidsson/Code/loki/examples/react/.storybook/preview.js */"./.storybook/preview.js"); +__webpack_require__(/*! /Users/joel.arvidsson/Code/loki/examples/react/.storybook/generated-entry.js */"./.storybook/generated-entry.js"); +module.exports = __webpack_require__(/*! /Users/joel.arvidsson/Code/loki/node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true */"../../node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true"); + + +/***/ }), + +/***/ 1: +/*!********************************!*\ + !*** ./util.inspect (ignored) ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), + +/***/ 2: +/*!********************************!*\ + !*** ./util.inspect (ignored) ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), + +/***/ 3: +/*!********************************!*\ + !*** ./util.inspect (ignored) ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), + +/***/ 4: +/*!********************************!*\ + !*** ./util.inspect (ignored) ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }), + +/***/ 5: +/*!********************************!*\ + !*** ./util.inspect (ignored) ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* (ignored) */ + +/***/ }) + +},[[0,"runtime~main","vendors~main"]]]); +//# sourceMappingURL=main.cf4424013badd87a0545.bundle.js.map \ No newline at end of file diff --git a/fixtures/storybook-dynamic/runtime~main.cf4424013badd87a0545.bundle.js b/fixtures/storybook-dynamic/runtime~main.cf4424013badd87a0545.bundle.js new file mode 100644 index 00000000..1a25f582 --- /dev/null +++ b/fixtures/storybook-dynamic/runtime~main.cf4424013badd87a0545.bundle.js @@ -0,0 +1,864 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // install a JSONP callback for chunk loading +/******/ function webpackJsonpCallback(data) { +/******/ var chunkIds = data[0]; +/******/ var moreModules = data[1]; +/******/ var executeModules = data[2]; +/******/ +/******/ // add "moreModules" to the modules object, +/******/ // then flag all "chunkIds" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0, resolves = []; +/******/ for(;i < chunkIds.length; i++) { +/******/ chunkId = chunkIds[i]; +/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ resolves.push(installedChunks[chunkId][0]); +/******/ } +/******/ installedChunks[chunkId] = 0; +/******/ } +/******/ for(moduleId in moreModules) { +/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { +/******/ modules[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if(parentJsonpFunction) parentJsonpFunction(data); +/******/ +/******/ while(resolves.length) { +/******/ resolves.shift()(); +/******/ } +/******/ +/******/ // add entry modules from loaded chunk to deferred list +/******/ deferredModules.push.apply(deferredModules, executeModules || []); +/******/ +/******/ // run deferred modules when all chunks ready +/******/ return checkDeferredModules(); +/******/ }; +/******/ function checkDeferredModules() { +/******/ var result; +/******/ for(var i = 0; i < deferredModules.length; i++) { +/******/ var deferredModule = deferredModules[i]; +/******/ var fulfilled = true; +/******/ for(var j = 1; j < deferredModule.length; j++) { +/******/ var depId = deferredModule[j]; +/******/ if(installedChunks[depId] !== 0) fulfilled = false; +/******/ } +/******/ if(fulfilled) { +/******/ deferredModules.splice(i--, 1); +/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]); +/******/ } +/******/ } +/******/ +/******/ return result; +/******/ } +/******/ function hotDisposeChunk(chunkId) { +/******/ delete installedChunks[chunkId]; +/******/ } +/******/ var parentHotUpdateCallback = window["webpackHotUpdate"]; +/******/ window["webpackHotUpdate"] = // eslint-disable-next-line no-unused-vars +/******/ function webpackHotUpdateCallback(chunkId, moreModules) { +/******/ hotAddUpdateChunk(chunkId, moreModules); +/******/ if (parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); +/******/ } ; +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotDownloadUpdateChunk(chunkId) { +/******/ var script = document.createElement("script"); +/******/ script.charset = "utf-8"; +/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; +/******/ if (null) script.crossOrigin = null; +/******/ document.head.appendChild(script); +/******/ } +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotDownloadManifest(requestTimeout) { +/******/ requestTimeout = requestTimeout || 10000; +/******/ return new Promise(function(resolve, reject) { +/******/ if (typeof XMLHttpRequest === "undefined") { +/******/ return reject(new Error("No browser support")); +/******/ } +/******/ try { +/******/ var request = new XMLHttpRequest(); +/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; +/******/ request.open("GET", requestPath, true); +/******/ request.timeout = requestTimeout; +/******/ request.send(null); +/******/ } catch (err) { +/******/ return reject(err); +/******/ } +/******/ request.onreadystatechange = function() { +/******/ if (request.readyState !== 4) return; +/******/ if (request.status === 0) { +/******/ // timeout +/******/ reject( +/******/ new Error("Manifest request to " + requestPath + " timed out.") +/******/ ); +/******/ } else if (request.status === 404) { +/******/ // no update available +/******/ resolve(); +/******/ } else if (request.status !== 200 && request.status !== 304) { +/******/ // other failure +/******/ reject(new Error("Manifest request to " + requestPath + " failed.")); +/******/ } else { +/******/ // success +/******/ try { +/******/ var update = JSON.parse(request.responseText); +/******/ } catch (e) { +/******/ reject(e); +/******/ return; +/******/ } +/******/ resolve(update); +/******/ } +/******/ }; +/******/ }); +/******/ } +/******/ +/******/ var hotApplyOnUpdate = true; +/******/ // eslint-disable-next-line no-unused-vars +/******/ var hotCurrentHash = "cf4424013badd87a0545"; +/******/ var hotRequestTimeout = 10000; +/******/ var hotCurrentModuleData = {}; +/******/ var hotCurrentChildModule; +/******/ // eslint-disable-next-line no-unused-vars +/******/ var hotCurrentParents = []; +/******/ // eslint-disable-next-line no-unused-vars +/******/ var hotCurrentParentsTemp = []; +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotCreateRequire(moduleId) { +/******/ var me = installedModules[moduleId]; +/******/ if (!me) return __webpack_require__; +/******/ var fn = function(request) { +/******/ if (me.hot.active) { +/******/ if (installedModules[request]) { +/******/ if (installedModules[request].parents.indexOf(moduleId) === -1) { +/******/ installedModules[request].parents.push(moduleId); +/******/ } +/******/ } else { +/******/ hotCurrentParents = [moduleId]; +/******/ hotCurrentChildModule = request; +/******/ } +/******/ if (me.children.indexOf(request) === -1) { +/******/ me.children.push(request); +/******/ } +/******/ } else { +/******/ console.warn( +/******/ "[HMR] unexpected require(" + +/******/ request + +/******/ ") from disposed module " + +/******/ moduleId +/******/ ); +/******/ hotCurrentParents = []; +/******/ } +/******/ return __webpack_require__(request); +/******/ }; +/******/ var ObjectFactory = function ObjectFactory(name) { +/******/ return { +/******/ configurable: true, +/******/ enumerable: true, +/******/ get: function() { +/******/ return __webpack_require__[name]; +/******/ }, +/******/ set: function(value) { +/******/ __webpack_require__[name] = value; +/******/ } +/******/ }; +/******/ }; +/******/ for (var name in __webpack_require__) { +/******/ if ( +/******/ Object.prototype.hasOwnProperty.call(__webpack_require__, name) && +/******/ name !== "e" && +/******/ name !== "t" +/******/ ) { +/******/ Object.defineProperty(fn, name, ObjectFactory(name)); +/******/ } +/******/ } +/******/ fn.e = function(chunkId) { +/******/ if (hotStatus === "ready") hotSetStatus("prepare"); +/******/ hotChunksLoading++; +/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) { +/******/ finishChunkLoading(); +/******/ throw err; +/******/ }); +/******/ +/******/ function finishChunkLoading() { +/******/ hotChunksLoading--; +/******/ if (hotStatus === "prepare") { +/******/ if (!hotWaitingFilesMap[chunkId]) { +/******/ hotEnsureUpdateChunk(chunkId); +/******/ } +/******/ if (hotChunksLoading === 0 && hotWaitingFiles === 0) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ fn.t = function(value, mode) { +/******/ if (mode & 1) value = fn(value); +/******/ return __webpack_require__.t(value, mode & ~1); +/******/ }; +/******/ return fn; +/******/ } +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotCreateModule(moduleId) { +/******/ var hot = { +/******/ // private stuff +/******/ _acceptedDependencies: {}, +/******/ _declinedDependencies: {}, +/******/ _selfAccepted: false, +/******/ _selfDeclined: false, +/******/ _disposeHandlers: [], +/******/ _main: hotCurrentChildModule !== moduleId, +/******/ +/******/ // Module API +/******/ active: true, +/******/ accept: function(dep, callback) { +/******/ if (dep === undefined) hot._selfAccepted = true; +/******/ else if (typeof dep === "function") hot._selfAccepted = dep; +/******/ else if (typeof dep === "object") +/******/ for (var i = 0; i < dep.length; i++) +/******/ hot._acceptedDependencies[dep[i]] = callback || function() {}; +/******/ else hot._acceptedDependencies[dep] = callback || function() {}; +/******/ }, +/******/ decline: function(dep) { +/******/ if (dep === undefined) hot._selfDeclined = true; +/******/ else if (typeof dep === "object") +/******/ for (var i = 0; i < dep.length; i++) +/******/ hot._declinedDependencies[dep[i]] = true; +/******/ else hot._declinedDependencies[dep] = true; +/******/ }, +/******/ dispose: function(callback) { +/******/ hot._disposeHandlers.push(callback); +/******/ }, +/******/ addDisposeHandler: function(callback) { +/******/ hot._disposeHandlers.push(callback); +/******/ }, +/******/ removeDisposeHandler: function(callback) { +/******/ var idx = hot._disposeHandlers.indexOf(callback); +/******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1); +/******/ }, +/******/ +/******/ // Management API +/******/ check: hotCheck, +/******/ apply: hotApply, +/******/ status: function(l) { +/******/ if (!l) return hotStatus; +/******/ hotStatusHandlers.push(l); +/******/ }, +/******/ addStatusHandler: function(l) { +/******/ hotStatusHandlers.push(l); +/******/ }, +/******/ removeStatusHandler: function(l) { +/******/ var idx = hotStatusHandlers.indexOf(l); +/******/ if (idx >= 0) hotStatusHandlers.splice(idx, 1); +/******/ }, +/******/ +/******/ //inherit from previous dispose call +/******/ data: hotCurrentModuleData[moduleId] +/******/ }; +/******/ hotCurrentChildModule = undefined; +/******/ return hot; +/******/ } +/******/ +/******/ var hotStatusHandlers = []; +/******/ var hotStatus = "idle"; +/******/ +/******/ function hotSetStatus(newStatus) { +/******/ hotStatus = newStatus; +/******/ for (var i = 0; i < hotStatusHandlers.length; i++) +/******/ hotStatusHandlers[i].call(null, newStatus); +/******/ } +/******/ +/******/ // while downloading +/******/ var hotWaitingFiles = 0; +/******/ var hotChunksLoading = 0; +/******/ var hotWaitingFilesMap = {}; +/******/ var hotRequestedFilesMap = {}; +/******/ var hotAvailableFilesMap = {}; +/******/ var hotDeferred; +/******/ +/******/ // The update info +/******/ var hotUpdate, hotUpdateNewHash; +/******/ +/******/ function toModuleId(id) { +/******/ var isNumber = +id + "" === id; +/******/ return isNumber ? +id : id; +/******/ } +/******/ +/******/ function hotCheck(apply) { +/******/ if (hotStatus !== "idle") { +/******/ throw new Error("check() is only allowed in idle status"); +/******/ } +/******/ hotApplyOnUpdate = apply; +/******/ hotSetStatus("check"); +/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) { +/******/ if (!update) { +/******/ hotSetStatus("idle"); +/******/ return null; +/******/ } +/******/ hotRequestedFilesMap = {}; +/******/ hotWaitingFilesMap = {}; +/******/ hotAvailableFilesMap = update.c; +/******/ hotUpdateNewHash = update.h; +/******/ +/******/ hotSetStatus("prepare"); +/******/ var promise = new Promise(function(resolve, reject) { +/******/ hotDeferred = { +/******/ resolve: resolve, +/******/ reject: reject +/******/ }; +/******/ }); +/******/ hotUpdate = {}; +/******/ for(var chunkId in installedChunks) +/******/ // eslint-disable-next-line no-lone-blocks +/******/ { +/******/ /*globals chunkId */ +/******/ hotEnsureUpdateChunk(chunkId); +/******/ } +/******/ if ( +/******/ hotStatus === "prepare" && +/******/ hotChunksLoading === 0 && +/******/ hotWaitingFiles === 0 +/******/ ) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ return promise; +/******/ }); +/******/ } +/******/ +/******/ // eslint-disable-next-line no-unused-vars +/******/ function hotAddUpdateChunk(chunkId, moreModules) { +/******/ if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) +/******/ return; +/******/ hotRequestedFilesMap[chunkId] = false; +/******/ for (var moduleId in moreModules) { +/******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { +/******/ hotUpdate[moduleId] = moreModules[moduleId]; +/******/ } +/******/ } +/******/ if (--hotWaitingFiles === 0 && hotChunksLoading === 0) { +/******/ hotUpdateDownloaded(); +/******/ } +/******/ } +/******/ +/******/ function hotEnsureUpdateChunk(chunkId) { +/******/ if (!hotAvailableFilesMap[chunkId]) { +/******/ hotWaitingFilesMap[chunkId] = true; +/******/ } else { +/******/ hotRequestedFilesMap[chunkId] = true; +/******/ hotWaitingFiles++; +/******/ hotDownloadUpdateChunk(chunkId); +/******/ } +/******/ } +/******/ +/******/ function hotUpdateDownloaded() { +/******/ hotSetStatus("ready"); +/******/ var deferred = hotDeferred; +/******/ hotDeferred = null; +/******/ if (!deferred) return; +/******/ if (hotApplyOnUpdate) { +/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to +/******/ // avoid triggering uncaught exception warning in Chrome. +/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 +/******/ Promise.resolve() +/******/ .then(function() { +/******/ return hotApply(hotApplyOnUpdate); +/******/ }) +/******/ .then( +/******/ function(result) { +/******/ deferred.resolve(result); +/******/ }, +/******/ function(err) { +/******/ deferred.reject(err); +/******/ } +/******/ ); +/******/ } else { +/******/ var outdatedModules = []; +/******/ for (var id in hotUpdate) { +/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { +/******/ outdatedModules.push(toModuleId(id)); +/******/ } +/******/ } +/******/ deferred.resolve(outdatedModules); +/******/ } +/******/ } +/******/ +/******/ function hotApply(options) { +/******/ if (hotStatus !== "ready") +/******/ throw new Error("apply() is only allowed in ready status"); +/******/ options = options || {}; +/******/ +/******/ var cb; +/******/ var i; +/******/ var j; +/******/ var module; +/******/ var moduleId; +/******/ +/******/ function getAffectedStuff(updateModuleId) { +/******/ var outdatedModules = [updateModuleId]; +/******/ var outdatedDependencies = {}; +/******/ +/******/ var queue = outdatedModules.map(function(id) { +/******/ return { +/******/ chain: [id], +/******/ id: id +/******/ }; +/******/ }); +/******/ while (queue.length > 0) { +/******/ var queueItem = queue.pop(); +/******/ var moduleId = queueItem.id; +/******/ var chain = queueItem.chain; +/******/ module = installedModules[moduleId]; +/******/ if (!module || module.hot._selfAccepted) continue; +/******/ if (module.hot._selfDeclined) { +/******/ return { +/******/ type: "self-declined", +/******/ chain: chain, +/******/ moduleId: moduleId +/******/ }; +/******/ } +/******/ if (module.hot._main) { +/******/ return { +/******/ type: "unaccepted", +/******/ chain: chain, +/******/ moduleId: moduleId +/******/ }; +/******/ } +/******/ for (var i = 0; i < module.parents.length; i++) { +/******/ var parentId = module.parents[i]; +/******/ var parent = installedModules[parentId]; +/******/ if (!parent) continue; +/******/ if (parent.hot._declinedDependencies[moduleId]) { +/******/ return { +/******/ type: "declined", +/******/ chain: chain.concat([parentId]), +/******/ moduleId: moduleId, +/******/ parentId: parentId +/******/ }; +/******/ } +/******/ if (outdatedModules.indexOf(parentId) !== -1) continue; +/******/ if (parent.hot._acceptedDependencies[moduleId]) { +/******/ if (!outdatedDependencies[parentId]) +/******/ outdatedDependencies[parentId] = []; +/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); +/******/ continue; +/******/ } +/******/ delete outdatedDependencies[parentId]; +/******/ outdatedModules.push(parentId); +/******/ queue.push({ +/******/ chain: chain.concat([parentId]), +/******/ id: parentId +/******/ }); +/******/ } +/******/ } +/******/ +/******/ return { +/******/ type: "accepted", +/******/ moduleId: updateModuleId, +/******/ outdatedModules: outdatedModules, +/******/ outdatedDependencies: outdatedDependencies +/******/ }; +/******/ } +/******/ +/******/ function addAllToSet(a, b) { +/******/ for (var i = 0; i < b.length; i++) { +/******/ var item = b[i]; +/******/ if (a.indexOf(item) === -1) a.push(item); +/******/ } +/******/ } +/******/ +/******/ // at begin all updates modules are outdated +/******/ // the "outdated" status can propagate to parents if they don't accept the children +/******/ var outdatedDependencies = {}; +/******/ var outdatedModules = []; +/******/ var appliedUpdate = {}; +/******/ +/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() { +/******/ console.warn( +/******/ "[HMR] unexpected require(" + result.moduleId + ") to disposed module" +/******/ ); +/******/ }; +/******/ +/******/ for (var id in hotUpdate) { +/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) { +/******/ moduleId = toModuleId(id); +/******/ /** @type {TODO} */ +/******/ var result; +/******/ if (hotUpdate[id]) { +/******/ result = getAffectedStuff(moduleId); +/******/ } else { +/******/ result = { +/******/ type: "disposed", +/******/ moduleId: id +/******/ }; +/******/ } +/******/ /** @type {Error|false} */ +/******/ var abortError = false; +/******/ var doApply = false; +/******/ var doDispose = false; +/******/ var chainInfo = ""; +/******/ if (result.chain) { +/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); +/******/ } +/******/ switch (result.type) { +/******/ case "self-declined": +/******/ if (options.onDeclined) options.onDeclined(result); +/******/ if (!options.ignoreDeclined) +/******/ abortError = new Error( +/******/ "Aborted because of self decline: " + +/******/ result.moduleId + +/******/ chainInfo +/******/ ); +/******/ break; +/******/ case "declined": +/******/ if (options.onDeclined) options.onDeclined(result); +/******/ if (!options.ignoreDeclined) +/******/ abortError = new Error( +/******/ "Aborted because of declined dependency: " + +/******/ result.moduleId + +/******/ " in " + +/******/ result.parentId + +/******/ chainInfo +/******/ ); +/******/ break; +/******/ case "unaccepted": +/******/ if (options.onUnaccepted) options.onUnaccepted(result); +/******/ if (!options.ignoreUnaccepted) +/******/ abortError = new Error( +/******/ "Aborted because " + moduleId + " is not accepted" + chainInfo +/******/ ); +/******/ break; +/******/ case "accepted": +/******/ if (options.onAccepted) options.onAccepted(result); +/******/ doApply = true; +/******/ break; +/******/ case "disposed": +/******/ if (options.onDisposed) options.onDisposed(result); +/******/ doDispose = true; +/******/ break; +/******/ default: +/******/ throw new Error("Unexception type " + result.type); +/******/ } +/******/ if (abortError) { +/******/ hotSetStatus("abort"); +/******/ return Promise.reject(abortError); +/******/ } +/******/ if (doApply) { +/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; +/******/ addAllToSet(outdatedModules, result.outdatedModules); +/******/ for (moduleId in result.outdatedDependencies) { +/******/ if ( +/******/ Object.prototype.hasOwnProperty.call( +/******/ result.outdatedDependencies, +/******/ moduleId +/******/ ) +/******/ ) { +/******/ if (!outdatedDependencies[moduleId]) +/******/ outdatedDependencies[moduleId] = []; +/******/ addAllToSet( +/******/ outdatedDependencies[moduleId], +/******/ result.outdatedDependencies[moduleId] +/******/ ); +/******/ } +/******/ } +/******/ } +/******/ if (doDispose) { +/******/ addAllToSet(outdatedModules, [result.moduleId]); +/******/ appliedUpdate[moduleId] = warnUnexpectedRequire; +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Store self accepted outdated modules to require them later by the module system +/******/ var outdatedSelfAcceptedModules = []; +/******/ for (i = 0; i < outdatedModules.length; i++) { +/******/ moduleId = outdatedModules[i]; +/******/ if ( +/******/ installedModules[moduleId] && +/******/ installedModules[moduleId].hot._selfAccepted && +/******/ // removed self-accepted modules should not be required +/******/ appliedUpdate[moduleId] !== warnUnexpectedRequire +/******/ ) { +/******/ outdatedSelfAcceptedModules.push({ +/******/ module: moduleId, +/******/ errorHandler: installedModules[moduleId].hot._selfAccepted +/******/ }); +/******/ } +/******/ } +/******/ +/******/ // Now in "dispose" phase +/******/ hotSetStatus("dispose"); +/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { +/******/ if (hotAvailableFilesMap[chunkId] === false) { +/******/ hotDisposeChunk(chunkId); +/******/ } +/******/ }); +/******/ +/******/ var idx; +/******/ var queue = outdatedModules.slice(); +/******/ while (queue.length > 0) { +/******/ moduleId = queue.pop(); +/******/ module = installedModules[moduleId]; +/******/ if (!module) continue; +/******/ +/******/ var data = {}; +/******/ +/******/ // Call dispose handlers +/******/ var disposeHandlers = module.hot._disposeHandlers; +/******/ for (j = 0; j < disposeHandlers.length; j++) { +/******/ cb = disposeHandlers[j]; +/******/ cb(data); +/******/ } +/******/ hotCurrentModuleData[moduleId] = data; +/******/ +/******/ // disable module (this disables requires from this module) +/******/ module.hot.active = false; +/******/ +/******/ // remove module from cache +/******/ delete installedModules[moduleId]; +/******/ +/******/ // when disposing there is no need to call dispose handler +/******/ delete outdatedDependencies[moduleId]; +/******/ +/******/ // remove "parents" references from all children +/******/ for (j = 0; j < module.children.length; j++) { +/******/ var child = installedModules[module.children[j]]; +/******/ if (!child) continue; +/******/ idx = child.parents.indexOf(moduleId); +/******/ if (idx >= 0) { +/******/ child.parents.splice(idx, 1); +/******/ } +/******/ } +/******/ } +/******/ +/******/ // remove outdated dependency from module children +/******/ var dependency; +/******/ var moduleOutdatedDependencies; +/******/ for (moduleId in outdatedDependencies) { +/******/ if ( +/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) +/******/ ) { +/******/ module = installedModules[moduleId]; +/******/ if (module) { +/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; +/******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) { +/******/ dependency = moduleOutdatedDependencies[j]; +/******/ idx = module.children.indexOf(dependency); +/******/ if (idx >= 0) module.children.splice(idx, 1); +/******/ } +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Now in "apply" phase +/******/ hotSetStatus("apply"); +/******/ +/******/ hotCurrentHash = hotUpdateNewHash; +/******/ +/******/ // insert new code +/******/ for (moduleId in appliedUpdate) { +/******/ if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { +/******/ modules[moduleId] = appliedUpdate[moduleId]; +/******/ } +/******/ } +/******/ +/******/ // call accept handlers +/******/ var error = null; +/******/ for (moduleId in outdatedDependencies) { +/******/ if ( +/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId) +/******/ ) { +/******/ module = installedModules[moduleId]; +/******/ if (module) { +/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; +/******/ var callbacks = []; +/******/ for (i = 0; i < moduleOutdatedDependencies.length; i++) { +/******/ dependency = moduleOutdatedDependencies[i]; +/******/ cb = module.hot._acceptedDependencies[dependency]; +/******/ if (cb) { +/******/ if (callbacks.indexOf(cb) !== -1) continue; +/******/ callbacks.push(cb); +/******/ } +/******/ } +/******/ for (i = 0; i < callbacks.length; i++) { +/******/ cb = callbacks[i]; +/******/ try { +/******/ cb(moduleOutdatedDependencies); +/******/ } catch (err) { +/******/ if (options.onErrored) { +/******/ options.onErrored({ +/******/ type: "accept-errored", +/******/ moduleId: moduleId, +/******/ dependencyId: moduleOutdatedDependencies[i], +/******/ error: err +/******/ }); +/******/ } +/******/ if (!options.ignoreErrored) { +/******/ if (!error) error = err; +/******/ } +/******/ } +/******/ } +/******/ } +/******/ } +/******/ } +/******/ +/******/ // Load self accepted modules +/******/ for (i = 0; i < outdatedSelfAcceptedModules.length; i++) { +/******/ var item = outdatedSelfAcceptedModules[i]; +/******/ moduleId = item.module; +/******/ hotCurrentParents = [moduleId]; +/******/ try { +/******/ __webpack_require__(moduleId); +/******/ } catch (err) { +/******/ if (typeof item.errorHandler === "function") { +/******/ try { +/******/ item.errorHandler(err); +/******/ } catch (err2) { +/******/ if (options.onErrored) { +/******/ options.onErrored({ +/******/ type: "self-accept-error-handler-errored", +/******/ moduleId: moduleId, +/******/ error: err2, +/******/ originalError: err +/******/ }); +/******/ } +/******/ if (!options.ignoreErrored) { +/******/ if (!error) error = err2; +/******/ } +/******/ if (!error) error = err; +/******/ } +/******/ } else { +/******/ if (options.onErrored) { +/******/ options.onErrored({ +/******/ type: "self-accept-errored", +/******/ moduleId: moduleId, +/******/ error: err +/******/ }); +/******/ } +/******/ if (!options.ignoreErrored) { +/******/ if (!error) error = err; +/******/ } +/******/ } +/******/ } +/******/ } +/******/ +/******/ // handle errors in accept handlers and self accepted module load +/******/ if (error) { +/******/ hotSetStatus("fail"); +/******/ return Promise.reject(error); +/******/ } +/******/ +/******/ hotSetStatus("idle"); +/******/ return new Promise(function(resolve) { +/******/ resolve(outdatedModules); +/******/ }); +/******/ } +/******/ +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // Promise = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ "runtime~main": 0 +/******/ }; +/******/ +/******/ var deferredModules = []; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {}, +/******/ hot: hotCreateModule(moduleId), +/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp), +/******/ children: [] +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // __webpack_hash__ +/******/ __webpack_require__.h = function() { return hotCurrentHash; }; +/******/ +/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || []; +/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray); +/******/ jsonpArray.push = webpackJsonpCallback; +/******/ jsonpArray = jsonpArray.slice(); +/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]); +/******/ var parentJsonpFunction = oldJsonpFunction; +/******/ +/******/ +/******/ // run deferred modules from other chunks +/******/ checkDeferredModules(); +/******/ }) +/************************************************************************/ +/******/ ([]); +//# sourceMappingURL=runtime~main.cf4424013badd87a0545.bundle.js.map \ No newline at end of file diff --git a/fixtures/storybook-dynamic/static/preview.bundle.js b/fixtures/storybook-dynamic/static/preview.bundle.js deleted file mode 100644 index dbffb549..00000000 --- a/fixtures/storybook-dynamic/static/preview.bundle.js +++ /dev/null @@ -1,53272 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ function hotDisposeChunk(chunkId) { -/******/ delete installedChunks[chunkId]; -/******/ } -/******/ var parentHotUpdateCallback = this["webpackHotUpdate"]; -/******/ this["webpackHotUpdate"] = -/******/ function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars -/******/ hotAddUpdateChunk(chunkId, moreModules); -/******/ if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); -/******/ } ; -/******/ -/******/ function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars -/******/ var head = document.getElementsByTagName("head")[0]; -/******/ var script = document.createElement("script"); -/******/ script.type = "text/javascript"; -/******/ script.charset = "utf-8"; -/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; -/******/ head.appendChild(script); -/******/ } -/******/ -/******/ function hotDownloadManifest(requestTimeout) { // eslint-disable-line no-unused-vars -/******/ requestTimeout = requestTimeout || 10000; -/******/ return new Promise(function(resolve, reject) { -/******/ if(typeof XMLHttpRequest === "undefined") -/******/ return reject(new Error("No browser support")); -/******/ try { -/******/ var request = new XMLHttpRequest(); -/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; -/******/ request.open("GET", requestPath, true); -/******/ request.timeout = requestTimeout; -/******/ request.send(null); -/******/ } catch(err) { -/******/ return reject(err); -/******/ } -/******/ request.onreadystatechange = function() { -/******/ if(request.readyState !== 4) return; -/******/ if(request.status === 0) { -/******/ // timeout -/******/ reject(new Error("Manifest request to " + requestPath + " timed out.")); -/******/ } else if(request.status === 404) { -/******/ // no update available -/******/ resolve(); -/******/ } else if(request.status !== 200 && request.status !== 304) { -/******/ // other failure -/******/ reject(new Error("Manifest request to " + requestPath + " failed.")); -/******/ } else { -/******/ // success -/******/ try { -/******/ var update = JSON.parse(request.responseText); -/******/ } catch(e) { -/******/ reject(e); -/******/ return; -/******/ } -/******/ resolve(update); -/******/ } -/******/ }; -/******/ }); -/******/ } -/******/ -/******/ -/******/ -/******/ var hotApplyOnUpdate = true; -/******/ var hotCurrentHash = "f11f4bc301ae18b3e942"; // eslint-disable-line no-unused-vars -/******/ var hotRequestTimeout = 10000; -/******/ var hotCurrentModuleData = {}; -/******/ var hotCurrentChildModule; // eslint-disable-line no-unused-vars -/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars -/******/ var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars -/******/ -/******/ function hotCreateRequire(moduleId) { // eslint-disable-line no-unused-vars -/******/ var me = installedModules[moduleId]; -/******/ if(!me) return __webpack_require__; -/******/ var fn = function(request) { -/******/ if(me.hot.active) { -/******/ if(installedModules[request]) { -/******/ if(installedModules[request].parents.indexOf(moduleId) < 0) -/******/ installedModules[request].parents.push(moduleId); -/******/ } else { -/******/ hotCurrentParents = [moduleId]; -/******/ hotCurrentChildModule = request; -/******/ } -/******/ if(me.children.indexOf(request) < 0) -/******/ me.children.push(request); -/******/ } else { -/******/ console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); -/******/ hotCurrentParents = []; -/******/ } -/******/ return __webpack_require__(request); -/******/ }; -/******/ var ObjectFactory = function ObjectFactory(name) { -/******/ return { -/******/ configurable: true, -/******/ enumerable: true, -/******/ get: function() { -/******/ return __webpack_require__[name]; -/******/ }, -/******/ set: function(value) { -/******/ __webpack_require__[name] = value; -/******/ } -/******/ }; -/******/ }; -/******/ for(var name in __webpack_require__) { -/******/ if(Object.prototype.hasOwnProperty.call(__webpack_require__, name) && name !== "e") { -/******/ Object.defineProperty(fn, name, ObjectFactory(name)); -/******/ } -/******/ } -/******/ fn.e = function(chunkId) { -/******/ if(hotStatus === "ready") -/******/ hotSetStatus("prepare"); -/******/ hotChunksLoading++; -/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) { -/******/ finishChunkLoading(); -/******/ throw err; -/******/ }); -/******/ -/******/ function finishChunkLoading() { -/******/ hotChunksLoading--; -/******/ if(hotStatus === "prepare") { -/******/ if(!hotWaitingFilesMap[chunkId]) { -/******/ hotEnsureUpdateChunk(chunkId); -/******/ } -/******/ if(hotChunksLoading === 0 && hotWaitingFiles === 0) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ } -/******/ } -/******/ }; -/******/ return fn; -/******/ } -/******/ -/******/ function hotCreateModule(moduleId) { // eslint-disable-line no-unused-vars -/******/ var hot = { -/******/ // private stuff -/******/ _acceptedDependencies: {}, -/******/ _declinedDependencies: {}, -/******/ _selfAccepted: false, -/******/ _selfDeclined: false, -/******/ _disposeHandlers: [], -/******/ _main: hotCurrentChildModule !== moduleId, -/******/ -/******/ // Module API -/******/ active: true, -/******/ accept: function(dep, callback) { -/******/ if(typeof dep === "undefined") -/******/ hot._selfAccepted = true; -/******/ else if(typeof dep === "function") -/******/ hot._selfAccepted = dep; -/******/ else if(typeof dep === "object") -/******/ for(var i = 0; i < dep.length; i++) -/******/ hot._acceptedDependencies[dep[i]] = callback || function() {}; -/******/ else -/******/ hot._acceptedDependencies[dep] = callback || function() {}; -/******/ }, -/******/ decline: function(dep) { -/******/ if(typeof dep === "undefined") -/******/ hot._selfDeclined = true; -/******/ else if(typeof dep === "object") -/******/ for(var i = 0; i < dep.length; i++) -/******/ hot._declinedDependencies[dep[i]] = true; -/******/ else -/******/ hot._declinedDependencies[dep] = true; -/******/ }, -/******/ dispose: function(callback) { -/******/ hot._disposeHandlers.push(callback); -/******/ }, -/******/ addDisposeHandler: function(callback) { -/******/ hot._disposeHandlers.push(callback); -/******/ }, -/******/ removeDisposeHandler: function(callback) { -/******/ var idx = hot._disposeHandlers.indexOf(callback); -/******/ if(idx >= 0) hot._disposeHandlers.splice(idx, 1); -/******/ }, -/******/ -/******/ // Management API -/******/ check: hotCheck, -/******/ apply: hotApply, -/******/ status: function(l) { -/******/ if(!l) return hotStatus; -/******/ hotStatusHandlers.push(l); -/******/ }, -/******/ addStatusHandler: function(l) { -/******/ hotStatusHandlers.push(l); -/******/ }, -/******/ removeStatusHandler: function(l) { -/******/ var idx = hotStatusHandlers.indexOf(l); -/******/ if(idx >= 0) hotStatusHandlers.splice(idx, 1); -/******/ }, -/******/ -/******/ //inherit from previous dispose call -/******/ data: hotCurrentModuleData[moduleId] -/******/ }; -/******/ hotCurrentChildModule = undefined; -/******/ return hot; -/******/ } -/******/ -/******/ var hotStatusHandlers = []; -/******/ var hotStatus = "idle"; -/******/ -/******/ function hotSetStatus(newStatus) { -/******/ hotStatus = newStatus; -/******/ for(var i = 0; i < hotStatusHandlers.length; i++) -/******/ hotStatusHandlers[i].call(null, newStatus); -/******/ } -/******/ -/******/ // while downloading -/******/ var hotWaitingFiles = 0; -/******/ var hotChunksLoading = 0; -/******/ var hotWaitingFilesMap = {}; -/******/ var hotRequestedFilesMap = {}; -/******/ var hotAvailableFilesMap = {}; -/******/ var hotDeferred; -/******/ -/******/ // The update info -/******/ var hotUpdate, hotUpdateNewHash; -/******/ -/******/ function toModuleId(id) { -/******/ var isNumber = (+id) + "" === id; -/******/ return isNumber ? +id : id; -/******/ } -/******/ -/******/ function hotCheck(apply) { -/******/ if(hotStatus !== "idle") throw new Error("check() is only allowed in idle status"); -/******/ hotApplyOnUpdate = apply; -/******/ hotSetStatus("check"); -/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) { -/******/ if(!update) { -/******/ hotSetStatus("idle"); -/******/ return null; -/******/ } -/******/ hotRequestedFilesMap = {}; -/******/ hotWaitingFilesMap = {}; -/******/ hotAvailableFilesMap = update.c; -/******/ hotUpdateNewHash = update.h; -/******/ -/******/ hotSetStatus("prepare"); -/******/ var promise = new Promise(function(resolve, reject) { -/******/ hotDeferred = { -/******/ resolve: resolve, -/******/ reject: reject -/******/ }; -/******/ }); -/******/ hotUpdate = {}; -/******/ var chunkId = 1; -/******/ { // eslint-disable-line no-lone-blocks -/******/ /*globals chunkId */ -/******/ hotEnsureUpdateChunk(chunkId); -/******/ } -/******/ if(hotStatus === "prepare" && hotChunksLoading === 0 && hotWaitingFiles === 0) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ return promise; -/******/ }); -/******/ } -/******/ -/******/ function hotAddUpdateChunk(chunkId, moreModules) { // eslint-disable-line no-unused-vars -/******/ if(!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) -/******/ return; -/******/ hotRequestedFilesMap[chunkId] = false; -/******/ for(var moduleId in moreModules) { -/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { -/******/ hotUpdate[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(--hotWaitingFiles === 0 && hotChunksLoading === 0) { -/******/ hotUpdateDownloaded(); -/******/ } -/******/ } -/******/ -/******/ function hotEnsureUpdateChunk(chunkId) { -/******/ if(!hotAvailableFilesMap[chunkId]) { -/******/ hotWaitingFilesMap[chunkId] = true; -/******/ } else { -/******/ hotRequestedFilesMap[chunkId] = true; -/******/ hotWaitingFiles++; -/******/ hotDownloadUpdateChunk(chunkId); -/******/ } -/******/ } -/******/ -/******/ function hotUpdateDownloaded() { -/******/ hotSetStatus("ready"); -/******/ var deferred = hotDeferred; -/******/ hotDeferred = null; -/******/ if(!deferred) return; -/******/ if(hotApplyOnUpdate) { -/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to -/******/ // avoid triggering uncaught exception warning in Chrome. -/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 -/******/ Promise.resolve().then(function() { -/******/ return hotApply(hotApplyOnUpdate); -/******/ }).then( -/******/ function(result) { -/******/ deferred.resolve(result); -/******/ }, -/******/ function(err) { -/******/ deferred.reject(err); -/******/ } -/******/ ); -/******/ } else { -/******/ var outdatedModules = []; -/******/ for(var id in hotUpdate) { -/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) { -/******/ outdatedModules.push(toModuleId(id)); -/******/ } -/******/ } -/******/ deferred.resolve(outdatedModules); -/******/ } -/******/ } -/******/ -/******/ function hotApply(options) { -/******/ if(hotStatus !== "ready") throw new Error("apply() is only allowed in ready status"); -/******/ options = options || {}; -/******/ -/******/ var cb; -/******/ var i; -/******/ var j; -/******/ var module; -/******/ var moduleId; -/******/ -/******/ function getAffectedStuff(updateModuleId) { -/******/ var outdatedModules = [updateModuleId]; -/******/ var outdatedDependencies = {}; -/******/ -/******/ var queue = outdatedModules.slice().map(function(id) { -/******/ return { -/******/ chain: [id], -/******/ id: id -/******/ }; -/******/ }); -/******/ while(queue.length > 0) { -/******/ var queueItem = queue.pop(); -/******/ var moduleId = queueItem.id; -/******/ var chain = queueItem.chain; -/******/ module = installedModules[moduleId]; -/******/ if(!module || module.hot._selfAccepted) -/******/ continue; -/******/ if(module.hot._selfDeclined) { -/******/ return { -/******/ type: "self-declined", -/******/ chain: chain, -/******/ moduleId: moduleId -/******/ }; -/******/ } -/******/ if(module.hot._main) { -/******/ return { -/******/ type: "unaccepted", -/******/ chain: chain, -/******/ moduleId: moduleId -/******/ }; -/******/ } -/******/ for(var i = 0; i < module.parents.length; i++) { -/******/ var parentId = module.parents[i]; -/******/ var parent = installedModules[parentId]; -/******/ if(!parent) continue; -/******/ if(parent.hot._declinedDependencies[moduleId]) { -/******/ return { -/******/ type: "declined", -/******/ chain: chain.concat([parentId]), -/******/ moduleId: moduleId, -/******/ parentId: parentId -/******/ }; -/******/ } -/******/ if(outdatedModules.indexOf(parentId) >= 0) continue; -/******/ if(parent.hot._acceptedDependencies[moduleId]) { -/******/ if(!outdatedDependencies[parentId]) -/******/ outdatedDependencies[parentId] = []; -/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); -/******/ continue; -/******/ } -/******/ delete outdatedDependencies[parentId]; -/******/ outdatedModules.push(parentId); -/******/ queue.push({ -/******/ chain: chain.concat([parentId]), -/******/ id: parentId -/******/ }); -/******/ } -/******/ } -/******/ -/******/ return { -/******/ type: "accepted", -/******/ moduleId: updateModuleId, -/******/ outdatedModules: outdatedModules, -/******/ outdatedDependencies: outdatedDependencies -/******/ }; -/******/ } -/******/ -/******/ function addAllToSet(a, b) { -/******/ for(var i = 0; i < b.length; i++) { -/******/ var item = b[i]; -/******/ if(a.indexOf(item) < 0) -/******/ a.push(item); -/******/ } -/******/ } -/******/ -/******/ // at begin all updates modules are outdated -/******/ // the "outdated" status can propagate to parents if they don't accept the children -/******/ var outdatedDependencies = {}; -/******/ var outdatedModules = []; -/******/ var appliedUpdate = {}; -/******/ -/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() { -/******/ console.warn("[HMR] unexpected require(" + result.moduleId + ") to disposed module"); -/******/ }; -/******/ -/******/ for(var id in hotUpdate) { -/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) { -/******/ moduleId = toModuleId(id); -/******/ var result; -/******/ if(hotUpdate[id]) { -/******/ result = getAffectedStuff(moduleId); -/******/ } else { -/******/ result = { -/******/ type: "disposed", -/******/ moduleId: id -/******/ }; -/******/ } -/******/ var abortError = false; -/******/ var doApply = false; -/******/ var doDispose = false; -/******/ var chainInfo = ""; -/******/ if(result.chain) { -/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); -/******/ } -/******/ switch(result.type) { -/******/ case "self-declined": -/******/ if(options.onDeclined) -/******/ options.onDeclined(result); -/******/ if(!options.ignoreDeclined) -/******/ abortError = new Error("Aborted because of self decline: " + result.moduleId + chainInfo); -/******/ break; -/******/ case "declined": -/******/ if(options.onDeclined) -/******/ options.onDeclined(result); -/******/ if(!options.ignoreDeclined) -/******/ abortError = new Error("Aborted because of declined dependency: " + result.moduleId + " in " + result.parentId + chainInfo); -/******/ break; -/******/ case "unaccepted": -/******/ if(options.onUnaccepted) -/******/ options.onUnaccepted(result); -/******/ if(!options.ignoreUnaccepted) -/******/ abortError = new Error("Aborted because " + moduleId + " is not accepted" + chainInfo); -/******/ break; -/******/ case "accepted": -/******/ if(options.onAccepted) -/******/ options.onAccepted(result); -/******/ doApply = true; -/******/ break; -/******/ case "disposed": -/******/ if(options.onDisposed) -/******/ options.onDisposed(result); -/******/ doDispose = true; -/******/ break; -/******/ default: -/******/ throw new Error("Unexception type " + result.type); -/******/ } -/******/ if(abortError) { -/******/ hotSetStatus("abort"); -/******/ return Promise.reject(abortError); -/******/ } -/******/ if(doApply) { -/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; -/******/ addAllToSet(outdatedModules, result.outdatedModules); -/******/ for(moduleId in result.outdatedDependencies) { -/******/ if(Object.prototype.hasOwnProperty.call(result.outdatedDependencies, moduleId)) { -/******/ if(!outdatedDependencies[moduleId]) -/******/ outdatedDependencies[moduleId] = []; -/******/ addAllToSet(outdatedDependencies[moduleId], result.outdatedDependencies[moduleId]); -/******/ } -/******/ } -/******/ } -/******/ if(doDispose) { -/******/ addAllToSet(outdatedModules, [result.moduleId]); -/******/ appliedUpdate[moduleId] = warnUnexpectedRequire; -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Store self accepted outdated modules to require them later by the module system -/******/ var outdatedSelfAcceptedModules = []; -/******/ for(i = 0; i < outdatedModules.length; i++) { -/******/ moduleId = outdatedModules[i]; -/******/ if(installedModules[moduleId] && installedModules[moduleId].hot._selfAccepted) -/******/ outdatedSelfAcceptedModules.push({ -/******/ module: moduleId, -/******/ errorHandler: installedModules[moduleId].hot._selfAccepted -/******/ }); -/******/ } -/******/ -/******/ // Now in "dispose" phase -/******/ hotSetStatus("dispose"); -/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { -/******/ if(hotAvailableFilesMap[chunkId] === false) { -/******/ hotDisposeChunk(chunkId); -/******/ } -/******/ }); -/******/ -/******/ var idx; -/******/ var queue = outdatedModules.slice(); -/******/ while(queue.length > 0) { -/******/ moduleId = queue.pop(); -/******/ module = installedModules[moduleId]; -/******/ if(!module) continue; -/******/ -/******/ var data = {}; -/******/ -/******/ // Call dispose handlers -/******/ var disposeHandlers = module.hot._disposeHandlers; -/******/ for(j = 0; j < disposeHandlers.length; j++) { -/******/ cb = disposeHandlers[j]; -/******/ cb(data); -/******/ } -/******/ hotCurrentModuleData[moduleId] = data; -/******/ -/******/ // disable module (this disables requires from this module) -/******/ module.hot.active = false; -/******/ -/******/ // remove module from cache -/******/ delete installedModules[moduleId]; -/******/ -/******/ // when disposing there is no need to call dispose handler -/******/ delete outdatedDependencies[moduleId]; -/******/ -/******/ // remove "parents" references from all children -/******/ for(j = 0; j < module.children.length; j++) { -/******/ var child = installedModules[module.children[j]]; -/******/ if(!child) continue; -/******/ idx = child.parents.indexOf(moduleId); -/******/ if(idx >= 0) { -/******/ child.parents.splice(idx, 1); -/******/ } -/******/ } -/******/ } -/******/ -/******/ // remove outdated dependency from module children -/******/ var dependency; -/******/ var moduleOutdatedDependencies; -/******/ for(moduleId in outdatedDependencies) { -/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) { -/******/ module = installedModules[moduleId]; -/******/ if(module) { -/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; -/******/ for(j = 0; j < moduleOutdatedDependencies.length; j++) { -/******/ dependency = moduleOutdatedDependencies[j]; -/******/ idx = module.children.indexOf(dependency); -/******/ if(idx >= 0) module.children.splice(idx, 1); -/******/ } -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Not in "apply" phase -/******/ hotSetStatus("apply"); -/******/ -/******/ hotCurrentHash = hotUpdateNewHash; -/******/ -/******/ // insert new code -/******/ for(moduleId in appliedUpdate) { -/******/ if(Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { -/******/ modules[moduleId] = appliedUpdate[moduleId]; -/******/ } -/******/ } -/******/ -/******/ // call accept handlers -/******/ var error = null; -/******/ for(moduleId in outdatedDependencies) { -/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) { -/******/ module = installedModules[moduleId]; -/******/ if(module) { -/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; -/******/ var callbacks = []; -/******/ for(i = 0; i < moduleOutdatedDependencies.length; i++) { -/******/ dependency = moduleOutdatedDependencies[i]; -/******/ cb = module.hot._acceptedDependencies[dependency]; -/******/ if(cb) { -/******/ if(callbacks.indexOf(cb) >= 0) continue; -/******/ callbacks.push(cb); -/******/ } -/******/ } -/******/ for(i = 0; i < callbacks.length; i++) { -/******/ cb = callbacks[i]; -/******/ try { -/******/ cb(moduleOutdatedDependencies); -/******/ } catch(err) { -/******/ if(options.onErrored) { -/******/ options.onErrored({ -/******/ type: "accept-errored", -/******/ moduleId: moduleId, -/******/ dependencyId: moduleOutdatedDependencies[i], -/******/ error: err -/******/ }); -/******/ } -/******/ if(!options.ignoreErrored) { -/******/ if(!error) -/******/ error = err; -/******/ } -/******/ } -/******/ } -/******/ } -/******/ } -/******/ } -/******/ -/******/ // Load self accepted modules -/******/ for(i = 0; i < outdatedSelfAcceptedModules.length; i++) { -/******/ var item = outdatedSelfAcceptedModules[i]; -/******/ moduleId = item.module; -/******/ hotCurrentParents = [moduleId]; -/******/ try { -/******/ __webpack_require__(moduleId); -/******/ } catch(err) { -/******/ if(typeof item.errorHandler === "function") { -/******/ try { -/******/ item.errorHandler(err); -/******/ } catch(err2) { -/******/ if(options.onErrored) { -/******/ options.onErrored({ -/******/ type: "self-accept-error-handler-errored", -/******/ moduleId: moduleId, -/******/ error: err2, -/******/ orginalError: err, // TODO remove in webpack 4 -/******/ originalError: err -/******/ }); -/******/ } -/******/ if(!options.ignoreErrored) { -/******/ if(!error) -/******/ error = err2; -/******/ } -/******/ if(!error) -/******/ error = err; -/******/ } -/******/ } else { -/******/ if(options.onErrored) { -/******/ options.onErrored({ -/******/ type: "self-accept-errored", -/******/ moduleId: moduleId, -/******/ error: err -/******/ }); -/******/ } -/******/ if(!options.ignoreErrored) { -/******/ if(!error) -/******/ error = err; -/******/ } -/******/ } -/******/ } -/******/ } -/******/ -/******/ // handle errors in accept handlers and self accepted module load -/******/ if(error) { -/******/ hotSetStatus("fail"); -/******/ return Promise.reject(error); -/******/ } -/******/ -/******/ hotSetStatus("idle"); -/******/ return new Promise(function(resolve) { -/******/ resolve(outdatedModules); -/******/ }); -/******/ } -/******/ -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {}, -/******/ hot: hotCreateModule(moduleId), -/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp), -/******/ children: [] -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = "/"; -/******/ -/******/ // __webpack_hash__ -/******/ __webpack_require__.h = function() { return hotCurrentHash; }; -/******/ -/******/ // Load entry module and return exports -/******/ return hotCreateRequire(792)(__webpack_require__.s = 792); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(42); - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * 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(format) {}; - -if (true) { - validateFormat = function validateFormat(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; - if (format === undefined) { - error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error(format.replace(/%s/g, function () { - return args[argIndex++]; - })); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -} - -module.exports = invariant; - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyFunction = __webpack_require__(20); - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = emptyFunction; - -if (true) { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(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) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - 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)); - } - }; -} - -module.exports = warning; - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -if (true) { - var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && - Symbol.for && - Symbol.for('react.element')) || - 0xeac7; - - var isValidElement = function(object) { - return typeof object === 'object' && - object !== null && - object.$$typeof === REACT_ELEMENT_TYPE; - }; - - // By explicitly using `prop-types` you are opting into new development behavior. - // http://fb.me/prop-types-in-prod - var throwOnDirectAccess = true; - module.exports = __webpack_require__(149)(isValidElement, throwOnDirectAccess); -} else { - // By explicitly using `prop-types` you are opting into new production behavior. - // http://fb.me/prop-types-in-prod - module.exports = require('./factoryWithThrowingShims')(); -} - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - -/** - * WARNING: DO NOT manually require this module. - * This is a replacement for `invariant(...)` used by the error code system - * and will _only_ be required by the corresponding babel pass. - * It always throws. - */ - -function reactProdInvariant(code) { - var argCount = arguments.length - 1; - - var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code; - - for (var argIdx = 0; argIdx < argCount; argIdx++) { - message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]); - } - - message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; - - var error = new Error(message); - error.name = 'Invariant Violation'; - error.framesToPop = 1; // we don't care about reactProdInvariant's own frame - - throw error; -} - -module.exports = reactProdInvariant; - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -exports.default = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -}; - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _defineProperty = __webpack_require__(153); - -var _defineProperty2 = _interopRequireDefault(_defineProperty); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - (0, _defineProperty2.default)(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* -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; - } -} - -module.exports = 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; -}; - - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _assign = __webpack_require__(107); - -var _assign2 = _interopRequireDefault(_assign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var DOMProperty = __webpack_require__(33); -var ReactDOMComponentFlags = __webpack_require__(181); - -var invariant = __webpack_require__(1); - -var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; -var Flags = ReactDOMComponentFlags; - -var internalInstanceKey = '__reactInternalInstance$' + Math.random().toString(36).slice(2); - -/** - * Check if a given node should be cached. - */ -function shouldPrecacheNode(node, nodeID) { - return node.nodeType === 1 && node.getAttribute(ATTR_NAME) === String(nodeID) || node.nodeType === 8 && node.nodeValue === ' react-text: ' + nodeID + ' ' || node.nodeType === 8 && node.nodeValue === ' react-empty: ' + nodeID + ' '; -} - -/** - * Drill down (through composites and empty components) until we get a host or - * host text component. - * - * This is pretty polymorphic but unavoidable with the current structure we have - * for `_renderedChildren`. - */ -function getRenderedHostOrTextFromComponent(component) { - var rendered; - while (rendered = component._renderedComponent) { - component = rendered; - } - return component; -} - -/** - * Populate `_hostNode` on the rendered host/text component with the given - * DOM node. The passed `inst` can be a composite. - */ -function precacheNode(inst, node) { - var hostInst = getRenderedHostOrTextFromComponent(inst); - hostInst._hostNode = node; - node[internalInstanceKey] = hostInst; -} - -function uncacheNode(inst) { - var node = inst._hostNode; - if (node) { - delete node[internalInstanceKey]; - inst._hostNode = null; - } -} - -/** - * Populate `_hostNode` on each child of `inst`, assuming that the children - * match up with the DOM (element) children of `node`. - * - * We cache entire levels at once to avoid an n^2 problem where we access the - * children of a node sequentially and have to walk from the start to our target - * node every time. - * - * Since we update `_renderedChildren` and the actual DOM at (slightly) - * different times, we could race here and see a newer `_renderedChildren` than - * the DOM nodes we see. To avoid this, ReactMultiChild calls - * `prepareToManageChildren` before we change `_renderedChildren`, at which - * time the container's child nodes are always cached (until it unmounts). - */ -function precacheChildNodes(inst, node) { - if (inst._flags & Flags.hasCachedChildNodes) { - return; - } - var children = inst._renderedChildren; - var childNode = node.firstChild; - outer: for (var name in children) { - if (!children.hasOwnProperty(name)) { - continue; - } - var childInst = children[name]; - var childID = getRenderedHostOrTextFromComponent(childInst)._domID; - if (childID === 0) { - // We're currently unmounting this child in ReactMultiChild; skip it. - continue; - } - // We assume the child nodes are in the same order as the child instances. - for (; childNode !== null; childNode = childNode.nextSibling) { - if (shouldPrecacheNode(childNode, childID)) { - precacheNode(childInst, childNode); - continue outer; - } - } - // We reached the end of the DOM children without finding an ID match. - true ? true ? invariant(false, 'Unable to find element with ID %s.', childID) : _prodInvariant('32', childID) : void 0; - } - inst._flags |= Flags.hasCachedChildNodes; -} - -/** - * Given a DOM node, return the closest ReactDOMComponent or - * ReactDOMTextComponent instance ancestor. - */ -function getClosestInstanceFromNode(node) { - if (node[internalInstanceKey]) { - return node[internalInstanceKey]; - } - - // Walk up the tree until we find an ancestor whose instance we have cached. - var parents = []; - while (!node[internalInstanceKey]) { - parents.push(node); - 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 closest; - var inst; - for (; node && (inst = node[internalInstanceKey]); node = parents.pop()) { - closest = inst; - if (parents.length) { - precacheChildNodes(inst, node); - } - } - - return closest; -} - -/** - * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent - * instance, or null if the node was not rendered by this React. - */ -function getInstanceFromNode(node) { - var inst = getClosestInstanceFromNode(node); - if (inst != null && inst._hostNode === node) { - return inst; - } else { - return null; - } -} - -/** - * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding - * DOM node. - */ -function getNodeFromInstance(inst) { - // Without this first invariant, passing a non-DOM-component triggers the next - // invariant for a missing parent, which is super confusing. - !(inst._hostNode !== undefined) ? true ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0; - - if (inst._hostNode) { - return inst._hostNode; - } - - // Walk up the tree until we find an ancestor whose DOM node we have cached. - var parents = []; - while (!inst._hostNode) { - parents.push(inst); - !inst._hostParent ? true ? invariant(false, 'React DOM tree root should always have a node reference.') : _prodInvariant('34') : void 0; - inst = inst._hostParent; - } - - // Now parents contains each ancestor that does *not* have a cached native - // node, and `inst` is the deepest ancestor that does. - for (; parents.length; inst = parents.pop()) { - precacheChildNodes(inst, inst._hostNode); - } - - return inst._hostNode; -} - -var ReactDOMComponentTree = { - getClosestInstanceFromNode: getClosestInstanceFromNode, - getInstanceFromNode: getInstanceFromNode, - getNodeFromInstance: getNodeFromInstance, - precacheChildNodes: precacheChildNodes, - precacheNode: precacheNode, - uncacheNode: uncacheNode -}; - -module.exports = ReactDOMComponentTree; - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -var core = module.exports = { version: '2.5.1' }; -if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self; -}; - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _setPrototypeOf = __webpack_require__(289); - -var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf); - -var _create = __webpack_require__(293); - -var _create2 = _interopRequireDefault(_create); - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass))); - } - - subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass; -}; - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); - -/** - * Simple, lightweight module assisting with the detection and context of - * Worker. Helps avoid circular dependencies and allows code to reason about - * whether or not they are in a Worker, even if they never include the main - * `ReactWorker` dependency. - */ -var ExecutionEnvironment = { - - canUseDOM: canUseDOM, - - canUseWorkers: typeof Worker !== 'undefined', - - canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), - - canUseViewport: canUseDOM && !!window.screen, - - isInWorker: !canUseDOM // For now, this is true - might change in the future. - -}; - -module.exports = ExecutionEnvironment; - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -var store = __webpack_require__(99)('wks'); -var uid = __webpack_require__(73); -var Symbol = __webpack_require__(16).Symbol; -var USE_SYMBOL = typeof Symbol == 'function'; - -var $exports = module.exports = function (name) { - return store[name] || (store[name] = - USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); -}; - -$exports.store = store; - - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(16); -var core = __webpack_require__(10); -var ctx = __webpack_require__(34); -var hide = __webpack_require__(35); -var PROTOTYPE = 'prototype'; - -var $export = function (type, name, source) { - var IS_FORCED = type & $export.F; - var IS_GLOBAL = type & $export.G; - var IS_STATIC = type & $export.S; - var IS_PROTO = type & $export.P; - var IS_BIND = type & $export.B; - var IS_WRAP = type & $export.W; - var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); - var expProto = exports[PROTOTYPE]; - var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]; - var key, own, out; - if (IS_GLOBAL) source = name; - for (key in source) { - // contains in native - own = !IS_FORCED && target && target[key] !== undefined; - if (own && key in exports) continue; - // export native or passed - out = own ? target[key] : source[key]; - // prevent global pollution for namespaces - exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] - // bind timers to global for call from export context - : IS_BIND && own ? ctx(out, global) - // wrap global constructors for prevent change them in library - : IS_WRAP && target[key] == out ? (function (C) { - var F = function (a, b, c) { - if (this instanceof C) { - switch (arguments.length) { - case 0: return new C(); - case 1: return new C(a); - case 2: return new C(a, b); - } return new C(a, b, c); - } return C.apply(this, arguments); - }; - F[PROTOTYPE] = C[PROTOTYPE]; - return F; - // make static versions for prototype methods - })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // export proto methods to core.%CONSTRUCTOR%.methods.%NAME% - if (IS_PROTO) { - (exports.virtual || (exports.virtual = {}))[key] = out; - // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME% - if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out); - } - } -}; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -$export.U = 64; // safe -$export.R = 128; // real proto method for `library` -module.exports = $export; - - -/***/ }), -/* 16 */ -/***/ (function(module, exports) { - -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self - // eslint-disable-next-line no-new-func - : Function('return this')(); -if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef - - -/***/ }), -/* 17 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2016-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(43); - -var ReactCurrentOwner = __webpack_require__(23); - -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -function isNative(fn) { - // Based on isNative() from Lodash - var funcToString = Function.prototype.toString; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var reIsNative = RegExp('^' + funcToString - // Take an example native function source for comparison - .call(hasOwnProperty - // Strip regex characters so we can use it for regex - ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&' - // Remove hasOwnProperty from the template to make it generic - ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); - try { - var source = funcToString.call(fn); - return reIsNative.test(source); - } catch (err) { - return false; - } -} - -var canUseCollections = -// Array.from -typeof Array.from === 'function' && -// Map -typeof Map === 'function' && isNative(Map) && -// Map.prototype.keys -Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) && -// Set -typeof Set === 'function' && isNative(Set) && -// Set.prototype.keys -Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys); - -var setItem; -var getItem; -var removeItem; -var getItemIDs; -var addRoot; -var removeRoot; -var getRootIDs; - -if (canUseCollections) { - var itemMap = new Map(); - var rootIDSet = new Set(); - - setItem = function (id, item) { - itemMap.set(id, item); - }; - getItem = function (id) { - return itemMap.get(id); - }; - removeItem = function (id) { - itemMap['delete'](id); - }; - getItemIDs = function () { - return Array.from(itemMap.keys()); - }; - - addRoot = function (id) { - rootIDSet.add(id); - }; - removeRoot = function (id) { - rootIDSet['delete'](id); - }; - getRootIDs = function () { - return Array.from(rootIDSet.keys()); - }; -} else { - var itemByKey = {}; - var rootByKey = {}; - - // Use non-numeric keys to prevent V8 performance issues: - // https://github.com/facebook/react/pull/7232 - var getKeyFromID = function (id) { - return '.' + id; - }; - var getIDFromKey = function (key) { - return parseInt(key.substr(1), 10); - }; - - setItem = function (id, item) { - var key = getKeyFromID(id); - itemByKey[key] = item; - }; - getItem = function (id) { - var key = getKeyFromID(id); - return itemByKey[key]; - }; - removeItem = function (id) { - var key = getKeyFromID(id); - delete itemByKey[key]; - }; - getItemIDs = function () { - return Object.keys(itemByKey).map(getIDFromKey); - }; - - addRoot = function (id) { - var key = getKeyFromID(id); - rootByKey[key] = true; - }; - removeRoot = function (id) { - var key = getKeyFromID(id); - delete rootByKey[key]; - }; - getRootIDs = function () { - return Object.keys(rootByKey).map(getIDFromKey); - }; -} - -var unmountedIDs = []; - -function purgeDeep(id) { - var item = getItem(id); - if (item) { - var childIDs = item.childIDs; - - removeItem(id); - childIDs.forEach(purgeDeep); - } -} - -function describeComponentFrame(name, source, ownerName) { - return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); -} - -function getDisplayName(element) { - if (element == null) { - return '#empty'; - } else if (typeof element === 'string' || typeof element === 'number') { - return '#text'; - } else if (typeof element.type === 'string') { - return element.type; - } else { - return element.type.displayName || element.type.name || 'Unknown'; - } -} - -function describeID(id) { - var name = ReactComponentTreeHook.getDisplayName(id); - var element = ReactComponentTreeHook.getElement(id); - var ownerID = ReactComponentTreeHook.getOwnerID(id); - var ownerName; - if (ownerID) { - ownerName = ReactComponentTreeHook.getDisplayName(ownerID); - } - true ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0; - return describeComponentFrame(name, element && element._source, ownerName); -} - -var ReactComponentTreeHook = { - onSetChildren: function (id, nextChildIDs) { - var item = getItem(id); - !item ? true ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; - item.childIDs = nextChildIDs; - - for (var i = 0; i < nextChildIDs.length; i++) { - var nextChildID = nextChildIDs[i]; - var nextChild = getItem(nextChildID); - !nextChild ? true ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0; - !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? true ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0; - !nextChild.isMounted ? true ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; - if (nextChild.parentID == null) { - nextChild.parentID = id; - // TODO: This shouldn't be necessary but mounting a new root during in - // componentWillMount currently causes not-yet-mounted components to - // be purged from our tree data so their parent id is missing. - } - !(nextChild.parentID === id) ? true ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0; - } - }, - onBeforeMountComponent: function (id, element, parentID) { - var item = { - element: element, - parentID: parentID, - text: null, - childIDs: [], - isMounted: false, - updateCount: 0 - }; - setItem(id, item); - }, - onBeforeUpdateComponent: function (id, element) { - var item = getItem(id); - if (!item || !item.isMounted) { - // We may end up here as a result of setState() in componentWillUnmount(). - // In this case, ignore the element. - return; - } - item.element = element; - }, - onMountComponent: function (id) { - var item = getItem(id); - !item ? true ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; - item.isMounted = true; - var isRoot = item.parentID === 0; - if (isRoot) { - addRoot(id); - } - }, - onUpdateComponent: function (id) { - var item = getItem(id); - if (!item || !item.isMounted) { - // We may end up here as a result of setState() in componentWillUnmount(). - // In this case, ignore the element. - return; - } - item.updateCount++; - }, - onUnmountComponent: function (id) { - var item = getItem(id); - if (item) { - // We need to check if it exists. - // `item` might not exist if it is inside an error boundary, and a sibling - // error boundary child threw while mounting. Then this instance never - // got a chance to mount, but it still gets an unmounting event during - // the error boundary cleanup. - item.isMounted = false; - var isRoot = item.parentID === 0; - if (isRoot) { - removeRoot(id); - } - } - unmountedIDs.push(id); - }, - purgeUnmountedComponents: function () { - if (ReactComponentTreeHook._preventPurging) { - // Should only be used for testing. - return; - } - - for (var i = 0; i < unmountedIDs.length; i++) { - var id = unmountedIDs[i]; - purgeDeep(id); - } - unmountedIDs.length = 0; - }, - isMounted: function (id) { - var item = getItem(id); - return item ? item.isMounted : false; - }, - getCurrentStackAddendum: function (topElement) { - var info = ''; - if (topElement) { - var name = getDisplayName(topElement); - var owner = topElement._owner; - info += describeComponentFrame(name, topElement._source, owner && owner.getName()); - } - - var currentOwner = ReactCurrentOwner.current; - var id = currentOwner && currentOwner._debugID; - - info += ReactComponentTreeHook.getStackAddendumByID(id); - return info; - }, - getStackAddendumByID: function (id) { - var info = ''; - while (id) { - info += describeID(id); - id = ReactComponentTreeHook.getParentID(id); - } - return info; - }, - getChildIDs: function (id) { - var item = getItem(id); - return item ? item.childIDs : []; - }, - getDisplayName: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (!element) { - return null; - } - return getDisplayName(element); - }, - getElement: function (id) { - var item = getItem(id); - return item ? item.element : null; - }, - getOwnerID: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (!element || !element._owner) { - return null; - } - return element._owner._debugID; - }, - getParentID: function (id) { - var item = getItem(id); - return item ? item.parentID : null; - }, - getSource: function (id) { - var item = getItem(id); - var element = item ? item.element : null; - var source = element != null ? element._source : null; - return source; - }, - getText: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (typeof element === 'string') { - return element; - } else if (typeof element === 'number') { - return '' + element; - } else { - return null; - } - }, - getUpdateCount: function (id) { - var item = getItem(id); - return item ? item.updateCount : 0; - }, - - - getRootIDs: getRootIDs, - getRegisteredIDs: getItemIDs, - - pushNonStandardWarningStack: function (isCreatingElement, currentSource) { - if (typeof console.reactStack !== 'function') { - return; - } - - var stack = []; - var currentOwner = ReactCurrentOwner.current; - var id = currentOwner && currentOwner._debugID; - - try { - if (isCreatingElement) { - stack.push({ - name: id ? ReactComponentTreeHook.getDisplayName(id) : null, - fileName: currentSource ? currentSource.fileName : null, - lineNumber: currentSource ? currentSource.lineNumber : null - }); - } - - while (id) { - var element = ReactComponentTreeHook.getElement(id); - var parentID = ReactComponentTreeHook.getParentID(id); - var ownerID = ReactComponentTreeHook.getOwnerID(id); - var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null; - var source = element && element._source; - stack.push({ - name: ownerName, - fileName: source ? source.fileName : null, - lineNumber: source ? source.lineNumber : null - }); - id = parentID; - } - } catch (err) { - // Internal state is messed up. - // Stop building the stack (it's just a nice to have). - } - - console.reactStack(stack); - }, - popNonStandardWarningStack: function () { - if (typeof console.reactStackEnd !== 'function') { - return; - } - console.reactStackEnd(); - } -}; - -module.exports = ReactComponentTreeHook; - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(276), __esModule: true }; - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2016-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -// Trust the developer to only use ReactInstrumentation with a __DEV__ check - -var debugTool = null; - -if (true) { - var ReactDebugTool = __webpack_require__(396); - debugTool = ReactDebugTool; -} - -module.exports = { debugTool: debugTool }; - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -function makeEmptyFunction(arg) { - return function () { - return arg; - }; -} - -/** - * This function accepts and discards inputs; it has no side effects. This is - * primarily useful idiomatically for overridable function endpoints which - * always need to be callable, since JS lacks a null-call idiom ala Cocoa. - */ -var emptyFunction = function emptyFunction() {}; - -emptyFunction.thatReturns = makeEmptyFunction; -emptyFunction.thatReturnsFalse = makeEmptyFunction(false); -emptyFunction.thatReturnsTrue = makeEmptyFunction(true); -emptyFunction.thatReturnsNull = makeEmptyFunction(null); -emptyFunction.thatReturnsThis = function () { - return this; -}; -emptyFunction.thatReturnsArgument = function (arg) { - return arg; -}; - -module.exports = emptyFunction; - -/***/ }), -/* 21 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _iterator = __webpack_require__(278); - -var _iterator2 = _interopRequireDefault(_iterator); - -var _symbol = __webpack_require__(282); - -var _symbol2 = _interopRequireDefault(_symbol); - -var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) { - return typeof obj === "undefined" ? "undefined" : _typeof(obj); -} : function (obj) { - return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj); -}; - -/***/ }), -/* 22 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 23 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -/** - * 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 -}; - -module.exports = ReactCurrentOwner; - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(25); -var IE8_DOM_DEFINE = __webpack_require__(152); -var toPrimitive = __webpack_require__(102); -var dP = Object.defineProperty; - -exports.f = __webpack_require__(27) ? Object.defineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) try { - return dP(O, P, Attributes); - } catch (e) { /* empty */ } - if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); - if ('value' in Attributes) O[P] = Attributes.value; - return O; -}; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(28); -module.exports = function (it) { - if (!isObject(it)) throw TypeError(it + ' is not an object!'); - return it; -}; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4), - _assign = __webpack_require__(7); - -var CallbackQueue = __webpack_require__(185); -var PooledClass = __webpack_require__(38); -var ReactFeatureFlags = __webpack_require__(186); -var ReactReconciler = __webpack_require__(51); -var Transaction = __webpack_require__(80); - -var invariant = __webpack_require__(1); - -var dirtyComponents = []; -var updateBatchNumber = 0; -var asapCallbackQueue = CallbackQueue.getPooled(); -var asapEnqueued = false; - -var batchingStrategy = null; - -function ensureInjected() { - !(ReactUpdates.ReactReconcileTransaction && batchingStrategy) ? true ? invariant(false, 'ReactUpdates: must inject a reconcile transaction class and batching strategy') : _prodInvariant('123') : void 0; -} - -var NESTED_UPDATES = { - initialize: function () { - this.dirtyComponentsLength = dirtyComponents.length; - }, - close: function () { - if (this.dirtyComponentsLength !== dirtyComponents.length) { - // Additional updates were enqueued by componentDidUpdate handlers or - // similar; before our own UPDATE_QUEUEING wrapper closes, we want to run - // these new updates so that if A's componentDidUpdate calls setState on - // B, B will update before the callback A's updater provided when calling - // setState. - dirtyComponents.splice(0, this.dirtyComponentsLength); - flushBatchedUpdates(); - } else { - dirtyComponents.length = 0; - } - } -}; - -var UPDATE_QUEUEING = { - initialize: function () { - this.callbackQueue.reset(); - }, - close: function () { - this.callbackQueue.notifyAll(); - } -}; - -var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; - -function ReactUpdatesFlushTransaction() { - this.reinitializeTransaction(); - this.dirtyComponentsLength = null; - this.callbackQueue = CallbackQueue.getPooled(); - this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( - /* useCreateElement */true); -} - -_assign(ReactUpdatesFlushTransaction.prototype, Transaction, { - getTransactionWrappers: function () { - return TRANSACTION_WRAPPERS; - }, - - destructor: function () { - this.dirtyComponentsLength = null; - CallbackQueue.release(this.callbackQueue); - this.callbackQueue = null; - ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); - this.reconcileTransaction = null; - }, - - perform: function (method, scope, a) { - // Essentially calls `this.reconcileTransaction.perform(method, scope, a)` - // with this transaction's wrappers around it. - return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); - } -}); - -PooledClass.addPoolingTo(ReactUpdatesFlushTransaction); - -function batchedUpdates(callback, a, b, c, d, e) { - ensureInjected(); - return batchingStrategy.batchedUpdates(callback, a, b, c, d, e); -} - -/** - * Array comparator for ReactComponents by mount ordering. - * - * @param {ReactComponent} c1 first component you're comparing - * @param {ReactComponent} c2 second component you're comparing - * @return {number} Return value usable by Array.prototype.sort(). - */ -function mountOrderComparator(c1, c2) { - return c1._mountOrder - c2._mountOrder; -} - -function runBatchedUpdates(transaction) { - var len = transaction.dirtyComponentsLength; - !(len === dirtyComponents.length) ? true ? invariant(false, 'Expected flush transaction\'s stored dirty-components length (%s) to match dirty-components array length (%s).', len, dirtyComponents.length) : _prodInvariant('124', len, dirtyComponents.length) : void 0; - - // Since reconciling a component higher in the owner hierarchy usually (not - // always -- see shouldComponentUpdate()) will reconcile children, reconcile - // them before their children by sorting the array. - dirtyComponents.sort(mountOrderComparator); - - // Any updates enqueued while reconciling must be performed after this entire - // batch. Otherwise, if dirtyComponents is [A, B] where A has children B and - // C, B could update twice in a single batch if C's render enqueues an update - // to B (since B would have already updated, we should skip it, and the only - // way we can know to do so is by checking the batch counter). - updateBatchNumber++; - - for (var i = 0; i < len; i++) { - // If a component is unmounted before pending changes apply, it will still - // be here, but we assume that it has cleared its _pendingCallbacks and - // that performUpdateIfNecessary is a noop. - var component = dirtyComponents[i]; - - // If performUpdateIfNecessary happens to enqueue any new updates, we - // shouldn't execute the callbacks until the next render happens, so - // stash the callbacks first - var callbacks = component._pendingCallbacks; - component._pendingCallbacks = null; - - var markerName; - if (ReactFeatureFlags.logTopLevelRenders) { - var namedComponent = component; - // Duck type TopLevelWrapper. This is probably always true. - if (component._currentElement.type.isReactTopLevelWrapper) { - namedComponent = component._renderedComponent; - } - markerName = 'React update: ' + namedComponent.getName(); - console.time(markerName); - } - - ReactReconciler.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); - - if (markerName) { - console.timeEnd(markerName); - } - - if (callbacks) { - for (var j = 0; j < callbacks.length; j++) { - transaction.callbackQueue.enqueue(callbacks[j], component.getPublicInstance()); - } - } - } -} - -var flushBatchedUpdates = function () { - // ReactUpdatesFlushTransaction's wrappers will clear the dirtyComponents - // array and perform any updates enqueued by mount-ready handlers (i.e., - // componentDidUpdate) but we need to check here too in order to catch - // updates enqueued by setState callbacks and asap calls. - while (dirtyComponents.length || asapEnqueued) { - if (dirtyComponents.length) { - var transaction = ReactUpdatesFlushTransaction.getPooled(); - transaction.perform(runBatchedUpdates, null, transaction); - ReactUpdatesFlushTransaction.release(transaction); - } - - if (asapEnqueued) { - asapEnqueued = false; - var queue = asapCallbackQueue; - asapCallbackQueue = CallbackQueue.getPooled(); - queue.notifyAll(); - CallbackQueue.release(queue); - } - } -}; - -/** - * Mark a component as needing a rerender, adding an optional callback to a - * list of functions which will be executed once the rerender occurs. - */ -function enqueueUpdate(component) { - ensureInjected(); - - // Various parts of our code (such as ReactCompositeComponent's - // _renderValidatedComponent) assume that calls to render aren't nested; - // verify that that's the case. (This is called by each top-level update - // function, like setState, forceUpdate, etc.; creation and - // destruction of top-level components is guarded in ReactMount.) - - if (!batchingStrategy.isBatchingUpdates) { - batchingStrategy.batchedUpdates(enqueueUpdate, component); - return; - } - - dirtyComponents.push(component); - if (component._updateBatchNumber == null) { - component._updateBatchNumber = updateBatchNumber + 1; - } -} - -/** - * Enqueue a callback to be run at the end of the current batching cycle. Throws - * if no updates are currently being performed. - */ -function asap(callback, context) { - invariant(batchingStrategy.isBatchingUpdates, "ReactUpdates.asap: Can't enqueue an asap callback in a context where" + 'updates are not being batched.'); - asapCallbackQueue.enqueue(callback, context); - asapEnqueued = true; -} - -var ReactUpdatesInjection = { - injectReconcileTransaction: function (ReconcileTransaction) { - !ReconcileTransaction ? true ? invariant(false, 'ReactUpdates: must provide a reconcile transaction class') : _prodInvariant('126') : void 0; - ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; - }, - - injectBatchingStrategy: function (_batchingStrategy) { - !_batchingStrategy ? true ? invariant(false, 'ReactUpdates: must provide a batching strategy') : _prodInvariant('127') : void 0; - !(typeof _batchingStrategy.batchedUpdates === 'function') ? true ? invariant(false, 'ReactUpdates: must provide a batchedUpdates() function') : _prodInvariant('128') : void 0; - !(typeof _batchingStrategy.isBatchingUpdates === 'boolean') ? true ? invariant(false, 'ReactUpdates: must provide an isBatchingUpdates boolean attribute') : _prodInvariant('129') : void 0; - batchingStrategy = _batchingStrategy; - } -}; - -var ReactUpdates = { - /** - * React references `ReactReconcileTransaction` using this property in order - * to allow dependency injection. - * - * @internal - */ - ReactReconcileTransaction: null, - - batchedUpdates: batchedUpdates, - enqueueUpdate: enqueueUpdate, - flushBatchedUpdates: flushBatchedUpdates, - injection: ReactUpdatesInjection, - asap: asap -}; - -module.exports = ReactUpdates; - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -// Thank's IE8 for his funny defineProperty -module.exports = !__webpack_require__(41)(function () { - return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var PooledClass = __webpack_require__(38); - -var emptyFunction = __webpack_require__(20); -var warning = __webpack_require__(2); - -var didWarnForAddedNewProperty = false; -var isProxySupported = typeof Proxy === 'function'; - -var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances']; - -/** - * @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: emptyFunction.thatReturnsNull, - eventPhase: null, - bubbles: null, - cancelable: null, - timeStamp: function (event) { - return event.timeStamp || Date.now(); - }, - defaultPrevented: null, - isTrusted: null -}; - -/** - * Synthetic events are dispatched by event plugins, typically in response to a - * top-level event delegation handler. - * - * These systems should generally use pooling to reduce the frequency of garbage - * collection. The system should check `isPersistent` to determine whether the - * event should be released into the pool after being dispatched. Users that - * need a persisted event should invoke `persist`. - * - * Synthetic events (and subclasses) implement the DOM Level 3 Events API by - * normalizing browser quirks. Subclasses do not necessarily have to implement a - * DOM interface; custom application-specific events can also subclass this. - * - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {*} targetInst Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @param {DOMEventTarget} nativeEventTarget Target node. - */ -function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { - if (true) { - // these have a getter/setter for warnings - delete this.nativeEvent; - delete this.preventDefault; - delete this.stopPropagation; - } - - this.dispatchConfig = dispatchConfig; - this._targetInst = targetInst; - this.nativeEvent = nativeEvent; - - var Interface = this.constructor.Interface; - for (var propName in Interface) { - if (!Interface.hasOwnProperty(propName)) { - continue; - } - if (true) { - 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 = emptyFunction.thatReturnsTrue; - } else { - this.isDefaultPrevented = emptyFunction.thatReturnsFalse; - } - this.isPropagationStopped = emptyFunction.thatReturnsFalse; - return this; -} - -_assign(SyntheticEvent.prototype, { - preventDefault: function () { - this.defaultPrevented = true; - var event = this.nativeEvent; - if (!event) { - return; - } - - if (event.preventDefault) { - event.preventDefault(); - // eslint-disable-next-line valid-typeof - } else if (typeof event.returnValue !== 'unknown') { - event.returnValue = false; - } - this.isDefaultPrevented = emptyFunction.thatReturnsTrue; - }, - - stopPropagation: function () { - var event = this.nativeEvent; - if (!event) { - return; - } - - if (event.stopPropagation) { - event.stopPropagation(); - // eslint-disable-next-line valid-typeof - } 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 = emptyFunction.thatReturnsTrue; - }, - - /** - * We release all dispatched `SyntheticEvent`s after each event loop, adding - * them back into the pool. This allows a way to hold onto a reference that - * won't be added back into the pool. - */ - persist: function () { - this.isPersistent = emptyFunction.thatReturnsTrue; - }, - - /** - * Checks if this event should be released back into the pool. - * - * @return {boolean} True if this should not be released, false otherwise. - */ - isPersistent: emptyFunction.thatReturnsFalse, - - /** - * `PooledClass` looks for `destructor` on each instance it releases. - */ - destructor: function () { - var Interface = this.constructor.Interface; - for (var propName in Interface) { - if (true) { - Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); - } else { - this[propName] = null; - } - } - for (var i = 0; i < shouldBeReleasedProperties.length; i++) { - this[shouldBeReleasedProperties[i]] = null; - } - if (true) { - Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null)); - Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction)); - Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction)); - } - } -}); - -SyntheticEvent.Interface = EventInterface; - -/** - * Helper to reduce boilerplate when creating subclasses. - * - * @param {function} Class - * @param {?object} Interface - */ -SyntheticEvent.augmentClass = function (Class, Interface) { - var Super = this; - - var E = function () {}; - E.prototype = Super.prototype; - var prototype = new E(); - - _assign(prototype, Class.prototype); - Class.prototype = prototype; - Class.prototype.constructor = Class; - - Class.Interface = _assign({}, Super.Interface, Interface); - Class.augmentClass = Super.augmentClass; - - PooledClass.addPoolingTo(Class, PooledClass.fourArgumentPooler); -}; - -/** Proxying after everything set on SyntheticEvent - * to resolve Proxy issue on some WebKit browsers - * in which some Event properties are set to undefined (GH#10010) - */ -if (true) { - if (isProxySupported) { - /*eslint-disable no-func-assign */ - SyntheticEvent = new Proxy(SyntheticEvent, { - construct: function (target, args) { - return this.apply(target, Object.create(target.prototype), args); - }, - apply: function (constructor, that, args) { - return new Proxy(constructor.apply(that, args), { - set: function (target, prop, value) { - if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) { - true ? warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0; - didWarnForAddedNewProperty = true; - } - target[prop] = value; - return true; - } - }); - } - }); - /*eslint-enable no-func-assign */ - } -} - -PooledClass.addPoolingTo(SyntheticEvent, PooledClass.fourArgumentPooler); - -module.exports = SyntheticEvent; - -/** - * Helper to nullify syntheticEvent instance properties when destructing - * - * @param {object} SyntheticEvent - * @param {String} propName - * @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) { - var warningCondition = false; - true ? warning(warningCondition, "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) : void 0; - } -} - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -var _themes = __webpack_require__(163); - -var themes = _interopRequireWildcard(_themes); - -var _base = __webpack_require__(314); - -var _base2 = _interopRequireDefault(_base); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var styles = Object.keys(themes).reduce(function (styles, themeName) { - styles[themeName] = (0, _base2.default)(themes[themeName]); - return styles; -}, {}); - -var createStyles = function createStyles(key, theme) { - // console.debug(styles, theme, styles[theme]) - if (typeof theme === 'string') { - return styles[theme][key]; - } else if ((typeof theme === 'undefined' ? 'undefined' : (0, _typeof3.default)(theme)) === 'object') { - return (0, _base2.default)(theme)[key]; - } - // Default styles - return styles['chromeLight'][key]; -}; - -exports.default = createStyles; - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var keys = __webpack_require__(341); -var foreach = __webpack_require__(343); -var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; - -var toStr = Object.prototype.toString; - -var isFunction = function (fn) { - return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; -}; - -var arePropertyDescriptorsSupported = function () { - var obj = {}; - try { - Object.defineProperty(obj, 'x', { enumerable: false, value: obj }); - /* eslint-disable no-unused-vars, no-restricted-syntax */ - for (var _ in obj) { return false; } - /* eslint-enable no-unused-vars, no-restricted-syntax */ - return obj.x === obj; - } catch (e) { /* this is IE 8. */ - return false; - } -}; -var supportsDescriptors = Object.defineProperty && arePropertyDescriptorsSupported(); - -var defineProperty = function (object, name, value, predicate) { - if (name in object && (!isFunction(predicate) || !predicate())) { - return; - } - if (supportsDescriptors) { - Object.defineProperty(object, name, { - configurable: true, - enumerable: false, - value: value, - writable: true - }); - } else { - object[name] = value; - } -}; - -var defineProperties = function (object, map) { - var predicates = arguments.length > 2 ? arguments[2] : {}; - var props = keys(map); - if (hasSymbols) { - props = props.concat(Object.getOwnPropertySymbols(map)); - } - foreach(props, function (name) { - defineProperty(object, name, map[name], predicates[name]); - }); -}; - -defineProperties.supportsDescriptors = !!supportsDescriptors; - -module.exports = defineProperties; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var implementation = __webpack_require__(346); - -module.exports = Function.prototype.bind || implementation; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -function checkMask(value, bitmask) { - return (value & bitmask) === bitmask; -} - -var DOMPropertyInjection = { - /** - * Mapping from normalized, camelcased property names to a configuration that - * specifies how the associated DOM property should be accessed or rendered. - */ - MUST_USE_PROPERTY: 0x1, - HAS_BOOLEAN_VALUE: 0x4, - HAS_NUMERIC_VALUE: 0x8, - HAS_POSITIVE_NUMERIC_VALUE: 0x10 | 0x8, - HAS_OVERLOADED_BOOLEAN_VALUE: 0x20, - - /** - * Inject some specialized knowledge about the DOM. This takes a config object - * with the following properties: - * - * isCustomAttribute: function that given an attribute name will return true - * if it can be inserted into the DOM verbatim. Useful for data-* or aria-* - * attributes where it's impossible to enumerate all of the possible - * attribute names, - * - * Properties: object mapping DOM property name to one of the - * DOMPropertyInjection constants or null. If your attribute isn't in here, - * it won't get written to the DOM. - * - * DOMAttributeNames: object mapping React attribute name to the DOM - * attribute name. Attribute names not specified use the **lowercase** - * normalized name. - * - * DOMAttributeNamespaces: object mapping React attribute name to the DOM - * attribute namespace URL. (Attribute names not specified use no namespace.) - * - * DOMPropertyNames: similar to DOMAttributeNames but for DOM properties. - * Property names not specified use the normalized name. - * - * DOMMutationMethods: Properties that require special mutation methods. If - * `value` is undefined, the mutation method should unset the property. - * - * @param {object} domPropertyConfig the config as described above. - */ - injectDOMPropertyConfig: function (domPropertyConfig) { - var Injection = DOMPropertyInjection; - var Properties = domPropertyConfig.Properties || {}; - var DOMAttributeNamespaces = domPropertyConfig.DOMAttributeNamespaces || {}; - var DOMAttributeNames = domPropertyConfig.DOMAttributeNames || {}; - var DOMPropertyNames = domPropertyConfig.DOMPropertyNames || {}; - var DOMMutationMethods = domPropertyConfig.DOMMutationMethods || {}; - - if (domPropertyConfig.isCustomAttribute) { - DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute); - } - - for (var propName in Properties) { - !!DOMProperty.properties.hasOwnProperty(propName) ? true ? invariant(false, 'injectDOMPropertyConfig(...): You\'re trying to inject DOM property \'%s\' which has already been injected. You may be accidentally injecting the same DOM property config twice, or you may be injecting two configs that have conflicting property names.', propName) : _prodInvariant('48', propName) : void 0; - - var lowerCased = propName.toLowerCase(); - var propConfig = Properties[propName]; - - var propertyInfo = { - attributeName: lowerCased, - attributeNamespace: null, - propertyName: propName, - mutationMethod: null, - - mustUseProperty: checkMask(propConfig, Injection.MUST_USE_PROPERTY), - hasBooleanValue: checkMask(propConfig, Injection.HAS_BOOLEAN_VALUE), - hasNumericValue: checkMask(propConfig, Injection.HAS_NUMERIC_VALUE), - hasPositiveNumericValue: checkMask(propConfig, Injection.HAS_POSITIVE_NUMERIC_VALUE), - hasOverloadedBooleanValue: checkMask(propConfig, Injection.HAS_OVERLOADED_BOOLEAN_VALUE) - }; - !(propertyInfo.hasBooleanValue + propertyInfo.hasNumericValue + propertyInfo.hasOverloadedBooleanValue <= 1) ? true ? invariant(false, 'DOMProperty: Value can be one of boolean, overloaded boolean, or numeric value, but not a combination: %s', propName) : _prodInvariant('50', propName) : void 0; - - if (true) { - DOMProperty.getPossibleStandardName[lowerCased] = propName; - } - - if (DOMAttributeNames.hasOwnProperty(propName)) { - var attributeName = DOMAttributeNames[propName]; - propertyInfo.attributeName = attributeName; - if (true) { - DOMProperty.getPossibleStandardName[attributeName] = propName; - } - } - - if (DOMAttributeNamespaces.hasOwnProperty(propName)) { - propertyInfo.attributeNamespace = DOMAttributeNamespaces[propName]; - } - - if (DOMPropertyNames.hasOwnProperty(propName)) { - propertyInfo.propertyName = DOMPropertyNames[propName]; - } - - if (DOMMutationMethods.hasOwnProperty(propName)) { - propertyInfo.mutationMethod = DOMMutationMethods[propName]; - } - - DOMProperty.properties[propName] = propertyInfo; - } - } -}; - -/* 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 */ - -/** - * DOMProperty exports lookup objects that can be used like functions: - * - * > DOMProperty.isValid['id'] - * true - * > DOMProperty.isValid['foobar'] - * undefined - * - * Although this may be confusing, it performs better in general. - * - * @see http://jsperf.com/key-exists - * @see http://jsperf.com/key-missing - */ -var DOMProperty = { - ID_ATTRIBUTE_NAME: 'data-reactid', - ROOT_ATTRIBUTE_NAME: 'data-reactroot', - - ATTRIBUTE_NAME_START_CHAR: ATTRIBUTE_NAME_START_CHAR, - ATTRIBUTE_NAME_CHAR: ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040', - - /** - * Map from property "standard name" to an object with info about how to set - * the property in the DOM. Each object contains: - * - * attributeName: - * Used when rendering markup or with `*Attribute()`. - * attributeNamespace - * propertyName: - * Used on DOM node instances. (This includes properties that mutate due to - * external factors.) - * mutationMethod: - * If non-null, used instead of the property or `setAttribute()` after - * initial render. - * mustUseProperty: - * Whether the property must be accessed and mutated as an object property. - * hasBooleanValue: - * Whether the property should be removed when set to a falsey value. - * hasNumericValue: - * Whether the property must be numeric or parse as a numeric and should be - * removed when set to a falsey value. - * hasPositiveNumericValue: - * Whether the property must be positive numeric or parse as a positive - * numeric and should be removed when set to a falsey value. - * hasOverloadedBooleanValue: - * Whether the property can be used as a flag as well as with a value. - * Removed when strictly equal to false; present without a value when - * strictly equal to true; present with a value otherwise. - */ - properties: {}, - - /** - * Mapping from lowercase property names to the properly cased version, used - * to warn in the case of missing properties. Available only in __DEV__. - * - * autofocus is predefined, because adding it to the property whitelist - * causes unintended side effects. - * - * @type {Object} - */ - getPossibleStandardName: true ? { autofocus: 'autoFocus' } : null, - - /** - * All of the isCustomAttribute() functions that have been injected. - */ - _isCustomAttributeFunctions: [], - - /** - * Checks whether a property name is a custom attribute. - * @method - */ - isCustomAttribute: function (attributeName) { - for (var i = 0; i < DOMProperty._isCustomAttributeFunctions.length; i++) { - var isCustomAttributeFn = DOMProperty._isCustomAttributeFunctions[i]; - if (isCustomAttributeFn(attributeName)) { - return true; - } - } - return false; - }, - - injection: DOMPropertyInjection -}; - -module.exports = DOMProperty; - -/***/ }), -/* 34 */ -/***/ (function(module, exports, __webpack_require__) { - -// optional / simple context binding -var aFunction = __webpack_require__(67); -module.exports = function (fn, that, length) { - aFunction(fn); - if (that === undefined) return fn; - switch (length) { - case 1: return function (a) { - return fn.call(that, a); - }; - case 2: return function (a, b) { - return fn.call(that, a, b); - }; - case 3: return function (a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function (/* ...args */) { - return fn.apply(that, arguments); - }; -}; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(24); -var createDesc = __webpack_require__(58); -module.exports = __webpack_require__(27) ? function (object, key, value) { - return dP.f(object, key, createDesc(1, value)); -} : function (object, key, value) { - object[key] = value; - return object; -}; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var ReactCurrentOwner = __webpack_require__(23); - -var warning = __webpack_require__(2); -var canDefineProperty = __webpack_require__(71); -var hasOwnProperty = Object.prototype.hasOwnProperty; - -var REACT_ELEMENT_TYPE = __webpack_require__(145); - -var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true -}; - -var specialPropKeyWarningShown, specialPropRefWarningShown; - -function hasValidRef(config) { - if (true) { - 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 (true) { - 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; - true ? warning(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) : void 0; - } - }; - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); -} - -function defineRefPropWarningGetter(props, displayName) { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - true ? warning(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) : void 0; - } - }; - 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 allow 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 - }; - - if (true) { - // 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. - if (canDefineProperty) { - 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 - }); - } else { - element._store.validated = false; - element._self = self; - element._source = 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://facebook.github.io/react/docs/top-level-api.html#react.createelement - */ -ReactElement.createElement = function (type, config, children) { - var propName; - - // 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 (true) { - 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 (true) { - if (key || ref) { - if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { - 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://facebook.github.io/react/docs/top-level-api.html#react.createfactory - */ -ReactElement.createFactory = function (type) { - var factory = ReactElement.createElement.bind(null, type); - // Expose the type on the factory and the prototype so that it can be - // easily accessed on elements. E.g. `.type === Foo`. - // This should not be named `constructor` since this may not be the function - // that created the element, and it may not even be a constructor. - // Legacy hook TODO: Warn if this is accessed - factory.type = type; - return factory; -}; - -ReactElement.cloneAndReplaceKey = function (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://facebook.github.io/react/docs/top-level-api.html#react.cloneelement - */ -ReactElement.cloneElement = function (element, config, children) { - var propName; - - // 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; - 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://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a valid component. - * @final - */ -ReactElement.isValidElement = function (object) { - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; -}; - -module.exports = ReactElement; - -/***/ }), -/* 37 */ -/***/ (function(module, exports) { - -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function (it, key) { - return hasOwnProperty.call(it, key); -}; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -/** - * Static poolers. Several custom versions for each potential number of - * arguments. A completely generic pooler is easy to implement, but would - * require accessing the `arguments` object. In each of these, `this` refers to - * the Class itself, not an instance. If any others are needed, simply add them - * here, or in their own files. - */ -var oneArgumentPooler = function (copyFieldsFrom) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, copyFieldsFrom); - return instance; - } else { - return new Klass(copyFieldsFrom); - } -}; - -var twoArgumentPooler = function (a1, a2) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2); - return instance; - } else { - return new Klass(a1, a2); - } -}; - -var threeArgumentPooler = function (a1, a2, a3) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3); - return instance; - } else { - return new Klass(a1, a2, a3); - } -}; - -var fourArgumentPooler = function (a1, a2, a3, a4) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3, a4); - return instance; - } else { - return new Klass(a1, a2, a3, a4); - } -}; - -var standardReleaser = function (instance) { - var Klass = this; - !(instance instanceof Klass) ? true ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; - instance.destructor(); - if (Klass.instancePool.length < Klass.poolSize) { - Klass.instancePool.push(instance); - } -}; - -var DEFAULT_POOL_SIZE = 10; -var DEFAULT_POOLER = oneArgumentPooler; - -/** - * Augments `CopyConstructor` to be a poolable class, augmenting only the class - * itself (statically) not adding any prototypical fields. Any CopyConstructor - * you give this may have a `poolSize` property, and will look for a - * prototypical `destructor` on instances. - * - * @param {Function} CopyConstructor Constructor that can be used to reset. - * @param {Function} pooler Customizable pooler. - */ -var addPoolingTo = function (CopyConstructor, pooler) { - // Casting as any so that flow ignores the actual implementation and trusts - // it to match the type we declared - var NewKlass = CopyConstructor; - NewKlass.instancePool = []; - NewKlass.getPooled = pooler || DEFAULT_POOLER; - if (!NewKlass.poolSize) { - NewKlass.poolSize = DEFAULT_POOL_SIZE; - } - NewKlass.release = standardReleaser; - return NewKlass; -}; - -var PooledClass = { - addPoolingTo: addPoolingTo, - oneArgumentPooler: oneArgumentPooler, - twoArgumentPooler: twoArgumentPooler, - threeArgumentPooler: threeArgumentPooler, - fourArgumentPooler: fourArgumentPooler -}; - -module.exports = PooledClass; - -/***/ }), -/* 39 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(834); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9UZW1wbGF0ZVRhZy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7cUJBRW9CLGU7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9UZW1wbGF0ZVRhZydcbiJdfQ== - -/***/ }), -/* 40 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__trimResultTransformer__ = __webpack_require__(835); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__trimResultTransformer__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90cmltUmVzdWx0VHJhbnNmb3JtZXIvaW5kZXguanMiXSwibmFtZXMiOlsiZGVmYXVsdCJdLCJtYXBwaW5ncyI6IkFBQUE7O3FCQUVvQix5QjtxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcidcbiJdfQ== - -/***/ }), -/* 41 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return !!exec(); - } catch (e) { - return true; - } -}; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var ReactBaseClasses = __webpack_require__(143); -var ReactChildren = __webpack_require__(250); -var ReactDOMFactories = __webpack_require__(254); -var ReactElement = __webpack_require__(36); -var ReactPropTypes = __webpack_require__(258); -var ReactVersion = __webpack_require__(260); - -var createReactClass = __webpack_require__(261); -var onlyChild = __webpack_require__(263); - -var createElement = ReactElement.createElement; -var createFactory = ReactElement.createFactory; -var cloneElement = ReactElement.cloneElement; - -if (true) { - var lowPriorityWarning = __webpack_require__(95); - var canDefineProperty = __webpack_require__(71); - var ReactElementValidator = __webpack_require__(147); - var didWarnPropTypesDeprecated = false; - createElement = ReactElementValidator.createElement; - createFactory = ReactElementValidator.createFactory; - cloneElement = ReactElementValidator.cloneElement; -} - -var __spread = _assign; -var createMixin = function (mixin) { - return mixin; -}; - -if (true) { - var warnedForSpread = false; - var warnedForCreateMixin = false; - __spread = function () { - lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.'); - warnedForSpread = true; - return _assign.apply(null, arguments); - }; - - createMixin = function (mixin) { - lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.'); - warnedForCreateMixin = true; - return mixin; - }; -} - -var React = { - // Modern - - Children: { - map: ReactChildren.map, - forEach: ReactChildren.forEach, - count: ReactChildren.count, - toArray: ReactChildren.toArray, - only: onlyChild - }, - - Component: ReactBaseClasses.Component, - PureComponent: ReactBaseClasses.PureComponent, - - createElement: createElement, - cloneElement: cloneElement, - isValidElement: ReactElement.isValidElement, - - // Classic - - PropTypes: ReactPropTypes, - createClass: createReactClass, - createFactory: createFactory, - createMixin: createMixin, - - // This looks DOM specific but these are actually isomorphic helpers - // since they are just generating DOM strings. - DOM: ReactDOMFactories, - - version: ReactVersion, - - // Deprecated hook for JSX spread, don't use this for anything. - __spread: __spread -}; - -if (true) { - var warnedForCreateClass = false; - if (canDefineProperty) { - Object.defineProperty(React, 'PropTypes', { - get: function () { - lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs'); - didWarnPropTypesDeprecated = true; - return ReactPropTypes; - } - }); - - Object.defineProperty(React, 'createClass', { - get: function () { - lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class'); - warnedForCreateClass = true; - return createReactClass; - } - }); - } - - // React.DOM factories are deprecated. Wrap these methods so that - // invocations of the React.DOM namespace and alert users to switch - // to the `react-dom-factories` package. - React.DOM = {}; - var warnedForFactories = false; - Object.keys(ReactDOMFactories).forEach(function (factory) { - React.DOM[factory] = function () { - if (!warnedForFactories) { - lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory); - warnedForFactories = true; - } - return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments); - }; - }); -} - -module.exports = React; - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - -/** - * WARNING: DO NOT manually require this module. - * This is a replacement for `invariant(...)` used by the error code system - * and will _only_ be required by the corresponding babel pass. - * It always throws. - */ - -function reactProdInvariant(code) { - var argCount = arguments.length - 1; - - var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code; - - for (var argIdx = 0; argIdx < argCount; argIdx++) { - message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]); - } - - message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; - - var error = new Error(message); - error.name = 'Invariant Violation'; - error.framesToPop = 1; // we don't care about reactProdInvariant's own frame - - throw error; -} - -module.exports = reactProdInvariant; - -/***/ }), -/* 44 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(264), __esModule: true }; - -/***/ }), -/* 46 */ -/***/ (function(module, exports, __webpack_require__) { - -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(133); -var defined = __webpack_require__(96); -module.exports = function (it) { - return IObject(defined(it)); -}; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _from = __webpack_require__(135); - -var _from2 = _interopRequireDefault(_from); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } else { - return (0, _from2.default)(arr); - } -}; - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -module.exports = {}; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -exports.default = function (obj, keys) { - var target = {}; - - for (var i in obj) { - if (keys.indexOf(i) >= 0) continue; - if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; - target[i] = obj[i]; - } - - return target; -}; - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(363); - - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactRef = __webpack_require__(394); -var ReactInstrumentation = __webpack_require__(19); - -var warning = __webpack_require__(2); - -/** - * Helper to call ReactRef.attachRefs with this composite component, split out - * to avoid allocations in the transaction mount-ready queue. - */ -function attachRefs() { - ReactRef.attachRefs(this, this._currentElement); -} - -var ReactReconciler = { - /** - * Initializes the component, renders markup, and registers event listeners. - * - * @param {ReactComponent} internalInstance - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @param {?object} the containing host component instance - * @param {?object} info about the host container - * @return {?string} Rendered markup to be inserted into the DOM. - * @final - * @internal - */ - mountComponent: function (internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) // 0 in production and for roots - { - if (true) { - if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID); - } - } - var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID); - if (internalInstance._currentElement && internalInstance._currentElement.ref != null) { - transaction.getReactMountReady().enqueue(attachRefs, internalInstance); - } - if (true) { - if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID); - } - } - return markup; - }, - - /** - * Returns a value that can be passed to - * ReactComponentEnvironment.replaceNodeWithMarkup. - */ - getHostNode: function (internalInstance) { - return internalInstance.getHostNode(); - }, - - /** - * Releases any resources allocated by `mountComponent`. - * - * @final - * @internal - */ - unmountComponent: function (internalInstance, safely) { - if (true) { - if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID); - } - } - ReactRef.detachRefs(internalInstance, internalInstance._currentElement); - internalInstance.unmountComponent(safely); - if (true) { - if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID); - } - } - }, - - /** - * Update a component using a new element. - * - * @param {ReactComponent} internalInstance - * @param {ReactElement} nextElement - * @param {ReactReconcileTransaction} transaction - * @param {object} context - * @internal - */ - receiveComponent: function (internalInstance, nextElement, transaction, context) { - var prevElement = internalInstance._currentElement; - - if (nextElement === prevElement && context === internalInstance._context) { - // Since elements are immutable after the owner is rendered, - // we can do a cheap identity compare here to determine if this is a - // superfluous reconcile. It's possible for state to be mutable but such - // change should trigger an update of the owner which would recreate - // the element. We explicitly check for the existence of an owner since - // it's possible for an element created outside a composite to be - // deeply mutated and reused. - - // TODO: Bailing out early is just a perf optimization right? - // TODO: Removing the return statement should affect correctness? - return; - } - - if (true) { - if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); - } - } - - var refsChanged = ReactRef.shouldUpdateRefs(prevElement, nextElement); - - if (refsChanged) { - ReactRef.detachRefs(internalInstance, prevElement); - } - - internalInstance.receiveComponent(nextElement, transaction, context); - - if (refsChanged && internalInstance._currentElement && internalInstance._currentElement.ref != null) { - transaction.getReactMountReady().enqueue(attachRefs, internalInstance); - } - - if (true) { - if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); - } - } - }, - - /** - * Flush any dirty changes in a component. - * - * @param {ReactComponent} internalInstance - * @param {ReactReconcileTransaction} transaction - * @internal - */ - performUpdateIfNecessary: function (internalInstance, transaction, updateBatchNumber) { - if (internalInstance._updateBatchNumber !== updateBatchNumber) { - // The component's enqueued batch number should always be the current - // batch or the following one. - true ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0; - return; - } - if (true) { - if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement); - } - } - internalInstance.performUpdateIfNecessary(transaction); - if (true) { - if (internalInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); - } - } - } -}; - -module.exports = ReactReconciler; - -/***/ }), -/* 52 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMNamespaces = __webpack_require__(117); -var setInnerHTML = __webpack_require__(82); - -var createMicrosoftUnsafeLocalFunction = __webpack_require__(118); -var setTextContent = __webpack_require__(190); - -var ELEMENT_NODE_TYPE = 1; -var DOCUMENT_FRAGMENT_NODE_TYPE = 11; - -/** - * In IE (8-11) and Edge, appending nodes with no children is dramatically - * faster than appending a full subtree, so we essentially queue up the - * .appendChild calls here and apply them so each node is added to its parent - * before any children are added. - * - * In other browsers, doing so is slower or neutral compared to the other order - * (in Firefox, twice as slow) so we only do this inversion in IE. - * - * See https://github.com/spicyj/innerhtml-vs-createelement-vs-clonenode. - */ -var enableLazy = typeof document !== 'undefined' && typeof document.documentMode === 'number' || typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && /\bEdge\/\d/.test(navigator.userAgent); - -function insertTreeChildren(tree) { - if (!enableLazy) { - return; - } - var node = tree.node; - var children = tree.children; - if (children.length) { - for (var i = 0; i < children.length; i++) { - insertTreeBefore(node, children[i], null); - } - } else if (tree.html != null) { - setInnerHTML(node, tree.html); - } else if (tree.text != null) { - setTextContent(node, tree.text); - } -} - -var insertTreeBefore = createMicrosoftUnsafeLocalFunction(function (parentNode, tree, referenceNode) { - // DocumentFragments aren't actually part of the DOM after insertion so - // appending children won't update the DOM. We need to ensure the fragment - // is properly populated first, breaking out of our lazy approach for just - // this level. Also, some plugins (like Flash Player) will read - // nodes immediately upon insertion into the DOM, so - // must also be populated prior to insertion into the DOM. - if (tree.node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE || tree.node.nodeType === ELEMENT_NODE_TYPE && tree.node.nodeName.toLowerCase() === 'object' && (tree.node.namespaceURI == null || tree.node.namespaceURI === DOMNamespaces.html)) { - insertTreeChildren(tree); - parentNode.insertBefore(tree.node, referenceNode); - } else { - parentNode.insertBefore(tree.node, referenceNode); - insertTreeChildren(tree); - } -}); - -function replaceChildWithTree(oldNode, newTree) { - oldNode.parentNode.replaceChild(newTree.node, oldNode); - insertTreeChildren(newTree); -} - -function queueChild(parentTree, childTree) { - if (enableLazy) { - parentTree.children.push(childTree); - } else { - parentTree.node.appendChild(childTree.node); - } -} - -function queueHTML(tree, html) { - if (enableLazy) { - tree.html = html; - } else { - setInnerHTML(tree.node, html); - } -} - -function queueText(tree, text) { - if (enableLazy) { - tree.text = text; - } else { - setTextContent(tree.node, text); - } -} - -function toString() { - return this.node.nodeName; -} - -function DOMLazyTree(node) { - return { - node: node, - children: [], - html: null, - text: null, - toString: toString - }; -} - -DOMLazyTree.insertTreeBefore = insertTreeBefore; -DOMLazyTree.replaceChildWithTree = replaceChildWithTree; -DOMLazyTree.queueChild = queueChild; -DOMLazyTree.queueHTML = queueHTML; -DOMLazyTree.queueText = queueText; - -module.exports = DOMLazyTree; - -/***/ }), -/* 53 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.13 ToObject(argument) -var defined = __webpack_require__(96); -module.exports = function (it) { - return Object(defined(it)); -}; - - -/***/ }), -/* 54 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $at = __webpack_require__(272)(true); - -// 21.1.3.27 String.prototype[@@iterator]() -__webpack_require__(136)(String, 'String', function (iterated) { - this._t = String(iterated); // target - this._i = 0; // next index -// 21.1.5.2.1 %StringIteratorPrototype%.next() -}, function () { - var O = this._t; - var index = this._i; - var point; - if (index >= O.length) return { value: undefined, done: true }; - point = $at(O, index); - this._i += point.length; - return { value: point, done: false }; -}); - - -/***/ }), -/* 55 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AddonStore = undefined; - -var _keys = __webpack_require__(45); - -var _keys2 = _interopRequireDefault(_keys); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var AddonStore = exports.AddonStore = function () { - function AddonStore() { - (0, _classCallCheck3.default)(this, AddonStore); - - this.loaders = {}; - this.panels = {}; - this.channel = null; - this.preview = null; - this.database = null; - } - - (0, _createClass3.default)(AddonStore, [{ - key: 'getChannel', - value: function getChannel() { - // this.channel should get overwritten by setChannel if package versions are - // correct and AddonStore is a proper singleton. If not, throw. - if (!this.channel) { - throw new Error('Accessing nonexistent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel'); - } - return this.channel; - } - }, { - key: 'setChannel', - value: function setChannel(channel) { - this.channel = channel; - } - }, { - key: 'getPreview', - value: function getPreview() { - return this.preview; - } - }, { - key: 'setPreview', - value: function setPreview(preview) { - this.preview = preview; - } - }, { - key: 'getDatabase', - value: function getDatabase() { - return this.database; - } - }, { - key: 'setDatabase', - value: function setDatabase(database) { - this.database = database; - } - }, { - key: 'getPanels', - value: function getPanels() { - return this.panels; - } - }, { - key: 'addPanel', - value: function addPanel(name, panel) { - this.panels[name] = panel; - } - }, { - key: 'register', - value: function register(name, loader) { - this.loaders[name] = loader; - } - }, { - key: 'loadAddons', - value: function loadAddons(api) { - var _this = this; - - (0, _keys2.default)(this.loaders).map(function (name) { - return _this.loaders[name]; - }).forEach(function (loader) { - return loader(api); - }); - } - }]); - return AddonStore; -}(); - -exports.default = new AddonStore(); - -/***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(151); -var enumBugKeys = __webpack_require__(100); - -module.exports = Object.keys || function keys(O) { - return $keys(O, enumBugKeys); -}; - - -/***/ }), -/* 57 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = function (it) { - return toString.call(it).slice(8, -1); -}; - - -/***/ }), -/* 58 */ -/***/ (function(module, exports) { - -module.exports = function (bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value: value - }; -}; - - -/***/ }), -/* 59 */ -/***/ (function(module, exports, __webpack_require__) { - -var bind = __webpack_require__(32); - -module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var EventPluginHub = __webpack_require__(61); -var EventPluginUtils = __webpack_require__(111); - -var accumulateInto = __webpack_require__(182); -var forEachAccumulated = __webpack_require__(183); -var warning = __webpack_require__(2); - -var getListener = EventPluginHub.getListener; - -/** - * Some event types have a notion of different registration names for different - * "phases" of propagation. This finds listeners by a given phase. - */ -function listenerAtPhase(inst, event, propagationPhase) { - var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; - return getListener(inst, registrationName); -} - -/** - * Tags a `SyntheticEvent` with dispatched listeners. Creating this function - * here, allows us to not have to bind or create functions for each event. - * Mutating the event's members allows us to not have to create a wrapping - * "dispatch" object that pairs the event with the listener. - */ -function accumulateDirectionalDispatches(inst, phase, event) { - if (true) { - true ? warning(inst, '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) { - EventPluginUtils.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); - } -} - -/** - * Same as `accumulateTwoPhaseDispatchesSingle`, but skips over the targetID. - */ -function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - var targetInst = event._targetInst; - var parentInst = targetInst ? EventPluginUtils.getParentInstance(targetInst) : null; - EventPluginUtils.traverseTwoPhase(parentInst, 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 (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 accumulateTwoPhaseDispatchesSkipTarget(events) { - forEachAccumulated(events, accumulateTwoPhaseDispatchesSingleSkipTarget); -} - -function accumulateEnterLeaveDispatches(leave, enter, from, to) { - EventPluginUtils.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); -} - -function accumulateDirectDispatches(events) { - forEachAccumulated(events, accumulateDirectDispatchesSingle); -} - -/** - * A small set of propagation patterns, each of which will accept a small amount - * of information, and generate a set of "dispatch ready event objects" - which - * are sets of events that have already been annotated with a set of dispatched - * listener functions/ids. The API is designed this way to discourage these - * propagation strategies from actually executing the dispatches, since we - * always want to collect the entire set of dispatches before executing event a - * single one. - * - * @constructor EventPropagators - */ -var EventPropagators = { - accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, - accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, - accumulateDirectDispatches: accumulateDirectDispatches, - accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches -}; - -module.exports = EventPropagators; - -/***/ }), -/* 61 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var EventPluginRegistry = __webpack_require__(79); -var EventPluginUtils = __webpack_require__(111); -var ReactErrorUtils = __webpack_require__(112); - -var accumulateInto = __webpack_require__(182); -var forEachAccumulated = __webpack_require__(183); -var invariant = __webpack_require__(1); - -/** - * Internal store for event listeners - */ -var listenerBank = {}; - -/** - * Internal queue of events that have accumulated their dispatches and are - * waiting to have their dispatches executed. - */ -var eventQueue = null; - -/** - * Dispatches an event and releases it back into the pool, unless persistent. - * - * @param {?object} event Synthetic event to be dispatched. - * @param {boolean} simulated If the event is simulated (changes exn behavior) - * @private - */ -var executeDispatchesAndRelease = function (event, simulated) { - if (event) { - EventPluginUtils.executeDispatchesInOrder(event, simulated); - - if (!event.isPersistent()) { - event.constructor.release(event); - } - } -}; -var executeDispatchesAndReleaseSimulated = function (e) { - return executeDispatchesAndRelease(e, true); -}; -var executeDispatchesAndReleaseTopLevel = function (e) { - return executeDispatchesAndRelease(e, false); -}; - -var getDictionaryKey = function (inst) { - // Prevents V8 performance issue: - // https://github.com/facebook/react/pull/7232 - return '.' + inst._rootNodeID; -}; - -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 - */ -var EventPluginHub = { - /** - * Methods for injecting dependencies. - */ - injection: { - /** - * @param {array} InjectedEventPluginOrder - * @public - */ - injectEventPluginOrder: EventPluginRegistry.injectEventPluginOrder, - - /** - * @param {object} injectedNamesToPlugins Map from names to plugin modules. - */ - injectEventPluginsByName: EventPluginRegistry.injectEventPluginsByName - }, - - /** - * Stores `listener` at `listenerBank[registrationName][key]`. Is idempotent. - * - * @param {object} inst The instance, which is the source of events. - * @param {string} registrationName Name of listener (e.g. `onClick`). - * @param {function} listener The callback to store. - */ - putListener: function (inst, registrationName, listener) { - !(typeof listener === 'function') ? true ? invariant(false, 'Expected %s listener to be a function, instead got type %s', registrationName, typeof listener) : _prodInvariant('94', registrationName, typeof listener) : void 0; - - var key = getDictionaryKey(inst); - var bankForRegistrationName = listenerBank[registrationName] || (listenerBank[registrationName] = {}); - bankForRegistrationName[key] = listener; - - var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; - if (PluginModule && PluginModule.didPutListener) { - PluginModule.didPutListener(inst, registrationName, listener); - } - }, - - /** - * @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. - */ - getListener: function (inst, registrationName) { - // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not - // live here; needs to be moved to a better place soon - var bankForRegistrationName = listenerBank[registrationName]; - if (shouldPreventMouseEvent(registrationName, inst._currentElement.type, inst._currentElement.props)) { - return null; - } - var key = getDictionaryKey(inst); - return bankForRegistrationName && bankForRegistrationName[key]; - }, - - /** - * Deletes a listener from the registration bank. - * - * @param {object} inst The instance, which is the source of events. - * @param {string} registrationName Name of listener (e.g. `onClick`). - */ - deleteListener: function (inst, registrationName) { - var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; - if (PluginModule && PluginModule.willDeleteListener) { - PluginModule.willDeleteListener(inst, registrationName); - } - - var bankForRegistrationName = listenerBank[registrationName]; - // TODO: This should never be null -- when is it? - if (bankForRegistrationName) { - var key = getDictionaryKey(inst); - delete bankForRegistrationName[key]; - } - }, - - /** - * Deletes all listeners for the DOM element with the supplied ID. - * - * @param {object} inst The instance, which is the source of events. - */ - deleteAllListeners: function (inst) { - var key = getDictionaryKey(inst); - for (var registrationName in listenerBank) { - if (!listenerBank.hasOwnProperty(registrationName)) { - continue; - } - - if (!listenerBank[registrationName][key]) { - continue; - } - - var PluginModule = EventPluginRegistry.registrationNameModules[registrationName]; - if (PluginModule && PluginModule.willDeleteListener) { - PluginModule.willDeleteListener(inst, registrationName); - } - - delete listenerBank[registrationName][key]; - } - }, - - /** - * Allows registered plugins an opportunity to extract events from top-level - * native browser events. - * - * @return {*} An accumulation of synthetic events. - * @internal - */ - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var events; - var plugins = EventPluginRegistry.plugins; - 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; - }, - - /** - * Enqueues a synthetic event that should be dispatched when - * `processEventQueue` is invoked. - * - * @param {*} events An accumulation of synthetic events. - * @internal - */ - enqueueEvents: function (events) { - if (events) { - eventQueue = accumulateInto(eventQueue, events); - } - }, - - /** - * Dispatches all synthetic events on the event queue. - * - * @internal - */ - processEventQueue: function (simulated) { - // 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 (simulated) { - forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseSimulated); - } else { - forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel); - } - !!eventQueue ? true ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : _prodInvariant('95') : void 0; - // This would be a good time to rethrow if any of the event handlers threw. - ReactErrorUtils.rethrowCaughtError(); - }, - - /** - * These are needed for tests only. Do not use! - */ - __purge: function () { - listenerBank = {}; - }, - - __getListenerBank: function () { - return listenerBank; - } -}; - -module.exports = EventPluginHub; - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticEvent = __webpack_require__(29); - -var getEventTarget = __webpack_require__(113); - -/** - * @interface UIEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var UIEventInterface = { - view: function (event) { - if (event.view) { - return event.view; - } - - var target = getEventTarget(event); - if (target.window === target) { - // target is a window object - return target; - } - - var doc = target.ownerDocument; - // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. - if (doc) { - return doc.defaultView || doc.parentWindow; - } else { - return window; - } - }, - detail: function (event) { - return event.detail || 0; - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent.augmentClass(SyntheticUIEvent, UIEventInterface); - -module.exports = SyntheticUIEvent; - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * `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. - */ - -// TODO: Replace this with ES6: var ReactInstanceMap = new Map(); - -var ReactInstanceMap = { - /** - * 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. - */ - remove: function (key) { - key._reactInternalInstance = undefined; - }, - - get: function (key) { - return key._reactInternalInstance; - }, - - has: function (key) { - return key._reactInternalInstance !== undefined; - }, - - set: function (key, value) { - key._reactInternalInstance = value; - } -}; - -module.exports = ReactInstanceMap; - -/***/ }), -/* 64 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isPrefixedValue; -var regex = /-webkit-|-moz-|-ms-/; - -function isPrefixedValue(value) { - return typeof value === 'string' && regex.test(value); -} -module.exports = exports['default']; - -/***/ }), -/* 65 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__inlineArrayTransformer__ = __webpack_require__(839); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__inlineArrayTransformer__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmxpbmVBcnJheVRyYW5zZm9ybWVyL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0IsMEI7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9pbmxpbmVBcnJheVRyYW5zZm9ybWVyJ1xuIl19 - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _manager = __webpack_require__(249); - -Object.defineProperty(exports, 'register', { - enumerable: true, - get: function get() { - return _manager.register; - } -}); - -var _preview = __webpack_require__(327); - -Object.defineProperty(exports, 'action', { - enumerable: true, - get: function get() { - return _preview.action; - } -}); -Object.defineProperty(exports, 'decorateAction', { - enumerable: true, - get: function get() { - return _preview.decorateAction; - } -}); -// addons, panels and events get unique names using a prefix -var ADDON_ID = exports.ADDON_ID = 'storybook/actions'; -var PANEL_ID = exports.PANEL_ID = ADDON_ID + '/actions-panel'; -var EVENT_ID = exports.EVENT_ID = ADDON_ID + '/action-event'; - -/***/ }), -/* 67 */ -/***/ (function(module, exports) { - -module.exports = function (it) { - if (typeof it != 'function') throw TypeError(it + ' is not a function!'); - return it; -}; - - -/***/ }), -/* 68 */ -/***/ (function(module, exports, __webpack_require__) { - -var def = __webpack_require__(24).f; -var has = __webpack_require__(37); -var TAG = __webpack_require__(14)('toStringTag'); - -module.exports = function (it, tag, stat) { - if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); -}; - - -/***/ }), -/* 69 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(280); -var global = __webpack_require__(16); -var hide = __webpack_require__(35); -var Iterators = __webpack_require__(48); -var TO_STRING_TAG = __webpack_require__(14)('toStringTag'); - -var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + - 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + - 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' + - 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' + - 'TextTrackList,TouchList').split(','); - -for (var i = 0; i < DOMIterables.length; i++) { - var NAME = DOMIterables[i]; - var Collection = global[NAME]; - var proto = Collection && Collection.prototype; - if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); - Iterators[NAME] = Iterators.Array; -} - - -/***/ }), -/* 70 */, -/* 71 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var canDefineProperty = false; -if (true) { - try { - // $FlowFixMe https://github.com/facebook/flow/issues/285 - Object.defineProperty({}, 'x', { get: function () {} }); - canDefineProperty = true; - } catch (x) { - // IE will fail on defineProperty - } -} - -module.exports = canDefineProperty; - -/***/ }), -/* 72 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyObject = {}; - -if (true) { - Object.freeze(emptyObject); -} - -module.exports = emptyObject; - -/***/ }), -/* 73 */ -/***/ (function(module, exports) { - -var id = 0; -var px = Math.random(); -module.exports = function (key) { - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; - - -/***/ }), -/* 74 */ -/***/ (function(module, exports) { - -module.exports = true; - - -/***/ }), -/* 75 */ -/***/ (function(module, exports) { - -exports.f = {}.propertyIsEnumerable; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _createStyles = __webpack_require__(30); - -var _createStyles2 = _interopRequireDefault(_createStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A view for object property names. - * - * If the property name is enumerable (in Object.keys(object)), - * the property name will be rendered normally. - * - * If the property name is not enumerable (`Object.prototype.propertyIsEnumerable()`), - * the property name will be dimmed to show the difference. - */ -var ObjectName = function ObjectName(_ref, _ref2) { - var name = _ref.name, - dimmed = _ref.dimmed, - styles = _ref.styles; - var theme = _ref2.theme; - - var themeStyles = (0, _createStyles2.default)('ObjectName', theme); - var appliedStyles = (0, _extends3.default)({}, themeStyles.base, dimmed ? themeStyles['dimmed'] : {}, styles); - - return _react2.default.createElement( - 'span', - { style: appliedStyles }, - name - ); -}; - -ObjectName.propTypes = { - /** Property name */ - name: _propTypes2.default.string, - /** Should property name be dimmed */ - dimmed: _propTypes2.default.bool -}; - -ObjectName.defaultProps = { - dimmed: false -}; - -ObjectName.contextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]) -}; - -exports.default = ObjectName; - -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _createStyles = __webpack_require__(30); - -var _createStyles2 = _interopRequireDefault(_createStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * A short description of the object values. - * Can be used to render tree node in ObjectInspector - * or render objects in TableInspector. - */ -var ObjectValue = function ObjectValue(_ref, _ref2) { - var object = _ref.object, - styles = _ref.styles; - var theme = _ref2.theme; - - var themeStyles = (0, _createStyles2.default)('ObjectValue', theme); - - var mkStyle = function mkStyle(key) { - return (0, _extends3.default)({}, themeStyles[key], styles); - }; - - switch (typeof object === 'undefined' ? 'undefined' : (0, _typeof3.default)(object)) { - case 'number': - return _react2.default.createElement( - 'span', - { style: mkStyle('objectValueNumber') }, - object - ); - case 'string': - return _react2.default.createElement( - 'span', - { style: mkStyle('objectValueString') }, - '"', - object, - '"' - ); - case 'boolean': - return _react2.default.createElement( - 'span', - { style: mkStyle('objectValueBoolean') }, - String(object) - ); - case 'undefined': - return _react2.default.createElement( - 'span', - { style: mkStyle('objectValueUndefined') }, - 'undefined' - ); - case 'object': - if (object === null) { - return _react2.default.createElement( - 'span', - { style: mkStyle('objectValueNull') }, - 'null' - ); - } - if (object instanceof Date) { - return _react2.default.createElement( - 'span', - null, - object.toString() - ); - } - if (object instanceof RegExp) { - return _react2.default.createElement( - 'span', - { style: mkStyle('objectValueRegExp') }, - object.toString() - ); - } - if (Array.isArray(object)) { - return _react2.default.createElement( - 'span', - null, - 'Array[' + object.length + ']' - ); - } - return _react2.default.createElement( - 'span', - null, - object.constructor.name - ); - case 'function': - return _react2.default.createElement( - 'span', - null, - _react2.default.createElement( - 'span', - { style: mkStyle('objectValueFunctionKeyword') }, - 'function' - ), - _react2.default.createElement( - 'span', - { style: mkStyle('objectValueFunctionName') }, - '\xA0', - object.name, - '()' - ) - ); - case 'symbol': - return _react2.default.createElement( - 'span', - { style: mkStyle('objectValueSymbol') }, - object.toString() - ); - default: - return _react2.default.createElement('span', null); - } -}; - -ObjectValue.propTypes = { - /** the object to describe */ - object: _propTypes2.default.any -}; - -ObjectValue.contextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]) -}; - -exports.default = ObjectValue; - -/***/ }), -/* 78 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var fnToStr = Function.prototype.toString; - -var constructorRegex = /^\s*class /; -var isES6ClassFn = function isES6ClassFn(value) { - try { - var fnStr = fnToStr.call(value); - var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); - var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); - var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); - return constructorRegex.test(spaceStripped); - } catch (e) { - return false; // not a function - } -}; - -var tryFunctionObject = function tryFunctionObject(value) { - try { - if (isES6ClassFn(value)) { return false; } - fnToStr.call(value); - return true; - } catch (e) { - return false; - } -}; -var toStr = Object.prototype.toString; -var fnClass = '[object Function]'; -var genClass = '[object GeneratorFunction]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isCallable(value) { - if (!value) { return false; } - if (typeof value !== 'function' && typeof value !== 'object') { return false; } - if (hasToStringTag) { return tryFunctionObject(value); } - if (isES6ClassFn(value)) { return false; } - var strClass = toStr.call(value); - return strClass === fnClass || strClass === genClass; -}; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -/** - * 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) ? true ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : _prodInvariant('96', pluginName) : void 0; - if (EventPluginRegistry.plugins[pluginIndex]) { - continue; - } - !pluginModule.extractEvents ? true ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : _prodInvariant('97', pluginName) : void 0; - EventPluginRegistry.plugins[pluginIndex] = pluginModule; - var publishedEvents = pluginModule.eventTypes; - for (var eventName in publishedEvents) { - !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? true ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : _prodInvariant('98', 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) { - !!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName) ? true ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : _prodInvariant('99', eventName) : void 0; - EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; - - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - if (phasedRegistrationNames) { - for (var phaseName in phasedRegistrationNames) { - if (phasedRegistrationNames.hasOwnProperty(phaseName)) { - var phasedRegistrationName = phasedRegistrationNames[phaseName]; - publishRegistrationName(phasedRegistrationName, pluginModule, eventName); - } - } - return true; - } else if (dispatchConfig.registrationName) { - publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName); - return true; - } - return false; -} - -/** - * Publishes a registration name that is used to identify dispatched events and - * can be used with `EventPluginHub.putListener` to register listeners. - * - * @param {string} registrationName Registration name to add. - * @param {object} PluginModule Plugin publishing the event. - * @private - */ -function publishRegistrationName(registrationName, pluginModule, eventName) { - !!EventPluginRegistry.registrationNameModules[registrationName] ? true ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : _prodInvariant('100', registrationName) : void 0; - EventPluginRegistry.registrationNameModules[registrationName] = pluginModule; - EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; - - if (true) { - var lowerCasedName = registrationName.toLowerCase(); - EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName; - - if (registrationName === 'onDoubleClick') { - EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName; - } - } -} - -/** - * Registers plugins so that they can extract and dispatch events. - * - * @see {EventPluginHub} - */ -var EventPluginRegistry = { - /** - * Ordered list of injected plugins. - */ - plugins: [], - - /** - * Mapping from event name to dispatch config - */ - eventNameDispatchConfigs: {}, - - /** - * Mapping from registration name to plugin module - */ - registrationNameModules: {}, - - /** - * Mapping from registration name to event name - */ - registrationNameDependencies: {}, - - /** - * Mapping from lowercase registration names to the properly cased version, - * used to warn in the case of missing event handlers. Available - * only in __DEV__. - * @type {Object} - */ - possibleRegistrationNames: true ? {} : null, - // Trust the developer to only use possibleRegistrationNames in __DEV__ - - /** - * Injects an ordering of plugins (by plugin name). This allows the ordering - * to be decoupled from injection of the actual plugins so that ordering is - * always deterministic regardless of packaging, on-the-fly injection, etc. - * - * @param {array} InjectedEventPluginOrder - * @internal - * @see {EventPluginHub.injection.injectEventPluginOrder} - */ - injectEventPluginOrder: function (injectedEventPluginOrder) { - !!eventPluginOrder ? true ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : _prodInvariant('101') : 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} - */ - injectEventPluginsByName: function (injectedNamesToPlugins) { - var isOrderingDirty = false; - for (var pluginName in injectedNamesToPlugins) { - if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) { - continue; - } - var pluginModule = injectedNamesToPlugins[pluginName]; - if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) { - !!namesToPlugins[pluginName] ? true ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : _prodInvariant('102', pluginName) : void 0; - namesToPlugins[pluginName] = pluginModule; - isOrderingDirty = true; - } - } - if (isOrderingDirty) { - recomputePluginOrdering(); - } - }, - - /** - * Looks up the plugin for the supplied event. - * - * @param {object} event A synthetic event. - * @return {?object} The plugin that created the supplied event. - * @internal - */ - getPluginModuleForEvent: function (event) { - var dispatchConfig = event.dispatchConfig; - if (dispatchConfig.registrationName) { - return EventPluginRegistry.registrationNameModules[dispatchConfig.registrationName] || null; - } - if (dispatchConfig.phasedRegistrationNames !== undefined) { - // pulling phasedRegistrationNames out of dispatchConfig helps Flow see - // that it is not undefined. - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - - for (var phase in phasedRegistrationNames) { - if (!phasedRegistrationNames.hasOwnProperty(phase)) { - continue; - } - var pluginModule = EventPluginRegistry.registrationNameModules[phasedRegistrationNames[phase]]; - if (pluginModule) { - return pluginModule; - } - } - } - return null; - }, - - /** - * Exposed for unit testing. - * @private - */ - _resetEventPlugins: function () { - eventPluginOrder = null; - for (var pluginName in namesToPlugins) { - if (namesToPlugins.hasOwnProperty(pluginName)) { - delete namesToPlugins[pluginName]; - } - } - EventPluginRegistry.plugins.length = 0; - - var eventNameDispatchConfigs = EventPluginRegistry.eventNameDispatchConfigs; - for (var eventName in eventNameDispatchConfigs) { - if (eventNameDispatchConfigs.hasOwnProperty(eventName)) { - delete eventNameDispatchConfigs[eventName]; - } - } - - var registrationNameModules = EventPluginRegistry.registrationNameModules; - for (var registrationName in registrationNameModules) { - if (registrationNameModules.hasOwnProperty(registrationName)) { - delete registrationNameModules[registrationName]; - } - } - - if (true) { - var possibleRegistrationNames = EventPluginRegistry.possibleRegistrationNames; - for (var lowerCasedName in possibleRegistrationNames) { - if (possibleRegistrationNames.hasOwnProperty(lowerCasedName)) { - delete possibleRegistrationNames[lowerCasedName]; - } - } - } - } -}; - -module.exports = EventPluginRegistry; - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -var OBSERVED_ERROR = {}; - -/** - * `Transaction` creates a black box that is able to wrap any method such that - * certain invariants are maintained before and after the method is invoked - * (Even if an exception is thrown while invoking the wrapped method). Whoever - * instantiates a transaction can provide enforcers of the invariants at - * creation time. The `Transaction` class itself will supply one additional - * automatic invariant for you - the invariant that any transaction instance - * should not be run while it is already being run. You would typically create a - * single instance of a `Transaction` for reuse multiple times, that potentially - * is used to wrap several different methods. Wrappers are extremely simple - - * they only require implementing two methods. - * - *
- *                       wrappers (injected at creation time)
- *                                      +        +
- *                                      |        |
- *                    +-----------------|--------|--------------+
- *                    |                 v        |              |
- *                    |      +---------------+   |              |
- *                    |   +--|    wrapper1   |---|----+         |
- *                    |   |  +---------------+   v    |         |
- *                    |   |          +-------------+  |         |
- *                    |   |     +----|   wrapper2  |--------+   |
- *                    |   |     |    +-------------+  |     |   |
- *                    |   |     |                     |     |   |
- *                    |   v     v                     v     v   | wrapper
- *                    | +---+ +---+   +---------+   +---+ +---+ | invariants
- * perform(anyMethod) | |   | |   |   |         |   |   | |   | | maintained
- * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
- *                    | |   | |   |   |         |   |   | |   | |
- *                    | |   | |   |   |         |   |   | |   | |
- *                    | |   | |   |   |         |   |   | |   | |
- *                    | +---+ +---+   +---------+   +---+ +---+ |
- *                    |  initialize                    close    |
- *                    +-----------------------------------------+
- * 
- * - * Use cases: - * - Preserving the input selection ranges before/after reconciliation. - * Restoring selection even in the event of an unexpected error. - * - Deactivating events while rearranging the DOM, preventing blurs/focuses, - * while guaranteeing that afterwards, the event system is reactivated. - * - Flushing a queue of collected DOM mutations to the main UI thread after a - * reconciliation takes place in a worker thread. - * - Invoking any collected `componentDidUpdate` callbacks after rendering new - * content. - * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue - * to preserve the `scrollTop` (an automatic scroll aware DOM). - * - (Future use case): Layout calculations before and after DOM updates. - * - * Transactional plugin API: - * - A module that has an `initialize` method that returns any precomputation. - * - and a `close` method that accepts the precomputation. `close` is invoked - * when the wrapped process is completed, or has failed. - * - * @param {Array} transactionWrapper Wrapper modules - * that implement `initialize` and `close`. - * @return {Transaction} Single transaction for reuse in thread. - * - * @class Transaction - */ -var TransactionImpl = { - /** - * Sets up this instance so that it is prepared for collecting metrics. Does - * so such that this setup method may be used on an instance that is already - * initialized, in a way that does not consume additional memory upon reuse. - * That can be useful if you decide to make your subclass of this mixin a - * "PooledClass". - */ - reinitializeTransaction: function () { - this.transactionWrappers = this.getTransactionWrappers(); - if (this.wrapperInitData) { - this.wrapperInitData.length = 0; - } else { - this.wrapperInitData = []; - } - this._isInTransaction = false; - }, - - _isInTransaction: false, - - /** - * @abstract - * @return {Array} Array of transaction wrappers. - */ - getTransactionWrappers: null, - - isInTransaction: function () { - return !!this._isInTransaction; - }, - - /* eslint-disable space-before-function-paren */ - - /** - * Executes the function within a safety window. Use this for the top level - * methods that result in large amounts of computation/mutations that would - * need to be safety checked. The optional arguments helps prevent the need - * to bind in many cases. - * - * @param {function} method Member of scope to call. - * @param {Object} scope Scope to invoke from. - * @param {Object?=} a Argument to pass to the method. - * @param {Object?=} b Argument to pass to the method. - * @param {Object?=} c Argument to pass to the method. - * @param {Object?=} d Argument to pass to the method. - * @param {Object?=} e Argument to pass to the method. - * @param {Object?=} f Argument to pass to the method. - * - * @return {*} Return value from `method`. - */ - perform: function (method, scope, a, b, c, d, e, f) { - /* eslint-enable space-before-function-paren */ - !!this.isInTransaction() ? true ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0; - var errorThrown; - var ret; - try { - this._isInTransaction = true; - // Catching errors makes debugging more difficult, so we start with - // errorThrown set to true before setting it to false after calling - // close -- if it's still set to true in the finally block, it means - // one of these calls threw. - errorThrown = true; - this.initializeAll(0); - ret = method.call(scope, a, b, c, d, e, f); - errorThrown = false; - } finally { - try { - if (errorThrown) { - // If `method` throws, prefer to show that stack trace over any thrown - // by invoking `closeAll`. - try { - this.closeAll(0); - } catch (err) {} - } else { - // Since `method` didn't throw, we don't want to silence the exception - // here. - this.closeAll(0); - } - } finally { - this._isInTransaction = false; - } - } - return ret; - }, - - initializeAll: function (startIndex) { - var transactionWrappers = this.transactionWrappers; - for (var i = startIndex; i < transactionWrappers.length; i++) { - var wrapper = transactionWrappers[i]; - try { - // Catching errors makes debugging more difficult, so we start with the - // OBSERVED_ERROR state before overwriting it with the real return value - // of initialize -- if it's still set to OBSERVED_ERROR in the finally - // block, it means wrapper.initialize threw. - this.wrapperInitData[i] = OBSERVED_ERROR; - this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; - } finally { - if (this.wrapperInitData[i] === OBSERVED_ERROR) { - // The initializer for wrapper i threw an error; initialize the - // remaining wrappers but silence any exceptions from them to ensure - // that the first error is the one to bubble up. - try { - this.initializeAll(i + 1); - } catch (err) {} - } - } - } - }, - - /** - * Invokes each of `this.transactionWrappers.close[i]` functions, passing into - * them the respective return values of `this.transactionWrappers.init[i]` - * (`close`rs that correspond to initializers that failed will not be - * invoked). - */ - closeAll: function (startIndex) { - !this.isInTransaction() ? true ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0; - var transactionWrappers = this.transactionWrappers; - for (var i = startIndex; i < transactionWrappers.length; i++) { - var wrapper = transactionWrappers[i]; - var initData = this.wrapperInitData[i]; - var errorThrown; - try { - // Catching errors makes debugging more difficult, so we start with - // errorThrown set to true before setting it to false after calling - // close -- if it's still set to true in the finally block, it means - // wrapper.close threw. - errorThrown = true; - if (initData !== OBSERVED_ERROR && wrapper.close) { - wrapper.close.call(this, initData); - } - errorThrown = false; - } finally { - if (errorThrown) { - // The closer for wrapper i threw an error; close the remaining - // wrappers but silence any exceptions from them to ensure that the - // first error is the one to bubble up. - try { - this.closeAll(i + 1); - } catch (e) {} - } - } - } - this.wrapperInitData.length = 0; - } -}; - -module.exports = TransactionImpl; - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticUIEvent = __webpack_require__(62); -var ViewportMetrics = __webpack_require__(189); - -var getEventModifierState = __webpack_require__(115); - -/** - * @interface MouseEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var MouseEventInterface = { - screenX: null, - screenY: null, - clientX: null, - clientY: null, - ctrlKey: null, - shiftKey: null, - altKey: null, - metaKey: null, - getModifierState: getEventModifierState, - button: function (event) { - // Webkit, Firefox, IE9+ - // which: 1 2 3 - // button: 0 1 2 (standard) - var button = event.button; - if ('which' in event) { - return button; - } - // IE<9 - // which: undefined - // button: 0 0 0 - // button: 1 4 2 (onmouseup) - return button === 2 ? 2 : button === 4 ? 1 : 0; - }, - buttons: null, - relatedTarget: function (event) { - return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement); - }, - // "Proprietary" Interface. - pageX: function (event) { - return 'pageX' in event ? event.pageX : event.clientX + ViewportMetrics.currentScrollLeft; - }, - pageY: function (event) { - return 'pageY' in event ? event.pageY : event.clientY + ViewportMetrics.currentScrollTop; - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticMouseEvent, MouseEventInterface); - -module.exports = SyntheticMouseEvent; - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ExecutionEnvironment = __webpack_require__(13); -var DOMNamespaces = __webpack_require__(117); - -var WHITESPACE_TEST = /^[ \r\n\t\f]/; -var NONVISIBLE_TEST = /<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/; - -var createMicrosoftUnsafeLocalFunction = __webpack_require__(118); - -// SVG temp container for IE lacking innerHTML -var reusableSVGContainer; - -/** - * Set the innerHTML property of a node, ensuring that whitespace is preserved - * even in IE8. - * - * @param {DOMElement} node - * @param {string} html - * @internal - */ -var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) { - // IE does not have innerHTML for SVG nodes, so instead we inject the - // new markup in a temp node and then move the child nodes across into - // the target node - if (node.namespaceURI === DOMNamespaces.svg && !('innerHTML' in node)) { - reusableSVGContainer = reusableSVGContainer || document.createElement('div'); - reusableSVGContainer.innerHTML = '' + html + ''; - var svgNode = reusableSVGContainer.firstChild; - while (svgNode.firstChild) { - node.appendChild(svgNode.firstChild); - } - } else { - node.innerHTML = html; - } -}); - -if (ExecutionEnvironment.canUseDOM) { - // IE8: When updating a just created node with innerHTML only leading - // whitespace is removed. When updating an existing node with innerHTML - // whitespace in root TextNodes is also collapsed. - // @see quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html - - // Feature detection; only IE8 is known to behave improperly like this. - var testElement = document.createElement('div'); - testElement.innerHTML = ' '; - if (testElement.innerHTML === '') { - setInnerHTML = function (node, html) { - // Magic theory: IE8 supposedly differentiates between added and updated - // nodes when processing innerHTML, innerHTML on updated nodes suffers - // from worse whitespace behavior. Re-adding a node like this triggers - // the initial and more favorable whitespace behavior. - // TODO: What to do on a detached node? - if (node.parentNode) { - node.parentNode.replaceChild(node, node); - } - - // We also implement a workaround for non-visible tags disappearing into - // thin air on IE8, this only happens if there is no visible text - // in-front of the non-visible tags. Piggyback on the whitespace fix - // and simply check if any non-visible tags appear in the source. - if (WHITESPACE_TEST.test(html) || html[0] === '<' && NONVISIBLE_TEST.test(html)) { - // Recover leading whitespace by temporarily prepending any character. - // \uFEFF has the potential advantage of being zero-width/invisible. - // UglifyJS drops U+FEFF chars when parsing, so use String.fromCharCode - // in hopes that this is preserved even if "\uFEFF" is transformed to - // the actual Unicode character (by Babel, for example). - // https://github.com/mishoo/UglifyJS2/blob/v2.4.20/lib/parse.js#L216 - node.innerHTML = String.fromCharCode(0xfeff) + html; - - // deleteData leaves an empty `TextNode` which offsets the index of all - // children. Definitely want to avoid this. - var textNode = node.firstChild; - if (textNode.data.length === 1) { - node.removeChild(textNode); - } else { - textNode.deleteData(0, 1); - } - } else { - node.innerHTML = html; - } - }; - } - testElement = null; -} - -module.exports = setInnerHTML; - -/***/ }), -/* 83 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2016-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * Based on the escape-html library, which is used under the MIT License below: - * - * Copyright (c) 2012-2013 TJ Holowaychuk - * Copyright (c) 2015 Andreas Lubbe - * Copyright (c) 2015 Tiancheng "Timothy" Gu - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * 'Software'), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - - - -// code copied and modified from escape-html -/** - * Module variables. - * @private - */ - -var matchHtmlRegExp = /["'&<>]/; - -/** - * Escape special characters in the given string of html. - * - * @param {string} string The string to escape for inserting into HTML - * @return {string} - * @public - */ - -function escapeHtml(string) { - var str = '' + string; - var match = matchHtmlRegExp.exec(str); - - if (!match) { - return str; - } - - var escape; - var html = ''; - var index = 0; - var lastIndex = 0; - - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: - // " - escape = '"'; - break; - case 38: - // & - escape = '&'; - break; - case 39: - // ' - escape = '''; // modified from escape-html; used to be ''' - break; - case 60: - // < - escape = '<'; - break; - case 62: - // > - escape = '>'; - break; - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index ? html + str.substring(lastIndex, index) : html; -} -// end code copied and modified from escape-html - -/** - * Escapes text to prevent scripting attacks. - * - * @param {*} text Text value to escape. - * @return {string} An escaped string. - */ -function escapeTextContentForBrowser(text) { - if (typeof text === 'boolean' || typeof text === 'number') { - // this shortcircuit helps perf for types that we know will never have - // special characters, especially given that this function is used often - // for numeric dom ids. - return '' + text; - } - return escapeHtml(text); -} - -module.exports = escapeTextContentForBrowser; - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var EventPluginRegistry = __webpack_require__(79); -var ReactEventEmitterMixin = __webpack_require__(417); -var ViewportMetrics = __webpack_require__(189); - -var getVendorPrefixedEventName = __webpack_require__(418); -var isEventSupported = __webpack_require__(114); - -/** - * Summary of `ReactBrowserEventEmitter` event handling: - * - * - Top-level delegation is used to trap most native browser events. This - * may only occur in the main thread and is the responsibility of - * ReactEventListener, which is injected and can therefore support pluggable - * event sources. This is the only work that occurs in the main thread. - * - * - We normalize and de-duplicate events to account for browser quirks. This - * may be done in the worker thread. - * - * - Forward these native events (with the associated top-level type used to - * trap it) to `EventPluginHub`, which in turn will ask plugins if they want - * to extract any synthetic events. - * - * - The `EventPluginHub` will then process each event by annotating them with - * "dispatches", a sequence of listeners and IDs that care about that event. - * - * - The `EventPluginHub` then dispatches the events. - * - * Overview of React and the event system: - * - * +------------+ . - * | DOM | . - * +------------+ . - * | . - * v . - * +------------+ . - * | ReactEvent | . - * | Listener | . - * +------------+ . +-----------+ - * | . +--------+|SimpleEvent| - * | . | |Plugin | - * +-----|------+ . v +-----------+ - * | | | . +--------------+ +------------+ - * | +-----------.--->|EventPluginHub| | Event | - * | | . | | +-----------+ | Propagators| - * | ReactEvent | . | | |TapEvent | |------------| - * | Emitter | . | |<---+|Plugin | |other plugin| - * | | . | | +-----------+ | utilities | - * | +-----------.--->| | +------------+ - * | | | . +--------------+ - * +-----|------+ . ^ +-----------+ - * | . | |Enter/Leave| - * + . +-------+|Plugin | - * +-------------+ . +-----------+ - * | application | . - * |-------------| . - * | | . - * | | . - * +-------------+ . - * . - * React Core . General Purpose Event Plugin System - */ - -var hasEventPageXY; -var alreadyListeningTo = {}; -var isMonitoringScrollValue = false; -var reactTopListenersCounter = 0; - -// For events like 'submit' which don't consistently bubble (which we trap at a -// lower node than `document`), binding at `document` would cause duplicate -// events so we don't include them here -var topEventMapping = { - topAbort: 'abort', - topAnimationEnd: getVendorPrefixedEventName('animationend') || 'animationend', - topAnimationIteration: getVendorPrefixedEventName('animationiteration') || 'animationiteration', - topAnimationStart: getVendorPrefixedEventName('animationstart') || 'animationstart', - topBlur: 'blur', - topCanPlay: 'canplay', - topCanPlayThrough: 'canplaythrough', - topChange: 'change', - topClick: 'click', - topCompositionEnd: 'compositionend', - topCompositionStart: 'compositionstart', - topCompositionUpdate: 'compositionupdate', - topContextMenu: 'contextmenu', - topCopy: 'copy', - topCut: 'cut', - topDoubleClick: 'dblclick', - topDrag: 'drag', - topDragEnd: 'dragend', - topDragEnter: 'dragenter', - topDragExit: 'dragexit', - topDragLeave: 'dragleave', - topDragOver: 'dragover', - topDragStart: 'dragstart', - topDrop: 'drop', - topDurationChange: 'durationchange', - topEmptied: 'emptied', - topEncrypted: 'encrypted', - topEnded: 'ended', - topError: 'error', - topFocus: 'focus', - topInput: 'input', - topKeyDown: 'keydown', - topKeyPress: 'keypress', - topKeyUp: 'keyup', - topLoadedData: 'loadeddata', - topLoadedMetadata: 'loadedmetadata', - topLoadStart: 'loadstart', - topMouseDown: 'mousedown', - topMouseMove: 'mousemove', - topMouseOut: 'mouseout', - topMouseOver: 'mouseover', - topMouseUp: 'mouseup', - topPaste: 'paste', - topPause: 'pause', - topPlay: 'play', - topPlaying: 'playing', - topProgress: 'progress', - topRateChange: 'ratechange', - topScroll: 'scroll', - topSeeked: 'seeked', - topSeeking: 'seeking', - topSelectionChange: 'selectionchange', - topStalled: 'stalled', - topSuspend: 'suspend', - topTextInput: 'textInput', - topTimeUpdate: 'timeupdate', - topTouchCancel: 'touchcancel', - topTouchEnd: 'touchend', - topTouchMove: 'touchmove', - topTouchStart: 'touchstart', - topTransitionEnd: getVendorPrefixedEventName('transitionend') || 'transitionend', - topVolumeChange: 'volumechange', - topWaiting: 'waiting', - topWheel: 'wheel' -}; - -/** - * To ensure no conflicts with other potential React instances on the page - */ -var topListenersIDKey = '_reactListenersID' + String(Math.random()).slice(2); - -function getListeningForDocument(mountAt) { - // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty` - // directly. - if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) { - mountAt[topListenersIDKey] = reactTopListenersCounter++; - alreadyListeningTo[mountAt[topListenersIDKey]] = {}; - } - return alreadyListeningTo[mountAt[topListenersIDKey]]; -} - -/** - * `ReactBrowserEventEmitter` is used to attach top-level event listeners. For - * example: - * - * EventPluginHub.putListener('myID', 'onClick', myFunction); - * - * This would allocate a "registration" of `('onClick', myFunction)` on 'myID'. - * - * @internal - */ -var ReactBrowserEventEmitter = _assign({}, ReactEventEmitterMixin, { - /** - * Injectable event backend - */ - ReactEventListener: null, - - injection: { - /** - * @param {object} ReactEventListener - */ - injectReactEventListener: function (ReactEventListener) { - ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel); - ReactBrowserEventEmitter.ReactEventListener = ReactEventListener; - } - }, - - /** - * Sets whether or not any created callbacks should be enabled. - * - * @param {boolean} enabled True if callbacks should be enabled. - */ - setEnabled: function (enabled) { - if (ReactBrowserEventEmitter.ReactEventListener) { - ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled); - } - }, - - /** - * @return {boolean} True if callbacks are enabled. - */ - isEnabled: function () { - return !!(ReactBrowserEventEmitter.ReactEventListener && ReactBrowserEventEmitter.ReactEventListener.isEnabled()); - }, - - /** - * We listen for bubbled touch events on the document object. - * - * Firefox v8.01 (and possibly others) exhibited strange behavior when - * mounting `onmousemove` events at some node that was not the document - * element. The symptoms were that if your mouse is not moving over something - * contained within that mount point (for example on the background) the - * top-level listeners for `onmousemove` won't be called. However, if you - * register the `mousemove` on the document object, then it will of course - * catch all `mousemove`s. This along with iOS quirks, justifies restricting - * top-level listeners to the document object only, at least for these - * movement types of events and possibly all events. - * - * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html - * - * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but - * they bubble to document. - * - * @param {string} registrationName Name of listener (e.g. `onClick`). - * @param {object} contentDocumentHandle Document which owns the container - */ - listenTo: function (registrationName, contentDocumentHandle) { - var mountAt = contentDocumentHandle; - var isListening = getListeningForDocument(mountAt); - var dependencies = EventPluginRegistry.registrationNameDependencies[registrationName]; - - for (var i = 0; i < dependencies.length; i++) { - var dependency = dependencies[i]; - if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) { - if (dependency === 'topWheel') { - if (isEventSupported('wheel')) { - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'wheel', mountAt); - } else if (isEventSupported('mousewheel')) { - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'mousewheel', mountAt); - } else { - // Firefox needs to capture a different mouse scroll event. - // @see http://www.quirksmode.org/dom/events/tests/scroll.html - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topWheel', 'DOMMouseScroll', mountAt); - } - } else if (dependency === 'topScroll') { - if (isEventSupported('scroll', true)) { - ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topScroll', 'scroll', mountAt); - } else { - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topScroll', 'scroll', ReactBrowserEventEmitter.ReactEventListener.WINDOW_HANDLE); - } - } else if (dependency === 'topFocus' || dependency === 'topBlur') { - if (isEventSupported('focus', true)) { - ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topFocus', 'focus', mountAt); - ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent('topBlur', 'blur', mountAt); - } else if (isEventSupported('focusin')) { - // IE has `focusin` and `focusout` events which bubble. - // @see http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topFocus', 'focusin', mountAt); - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent('topBlur', 'focusout', mountAt); - } - - // to make sure blur and focus event listeners are only attached once - isListening.topBlur = true; - isListening.topFocus = true; - } else if (topEventMapping.hasOwnProperty(dependency)) { - ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(dependency, topEventMapping[dependency], mountAt); - } - - isListening[dependency] = true; - } - } - }, - - trapBubbledEvent: function (topLevelType, handlerBaseName, handle) { - return ReactBrowserEventEmitter.ReactEventListener.trapBubbledEvent(topLevelType, handlerBaseName, handle); - }, - - trapCapturedEvent: function (topLevelType, handlerBaseName, handle) { - return ReactBrowserEventEmitter.ReactEventListener.trapCapturedEvent(topLevelType, handlerBaseName, handle); - }, - - /** - * Protect against document.createEvent() returning null - * Some popup blocker extensions appear to do this: - * https://github.com/facebook/react/issues/6887 - */ - supportsEventPageXY: function () { - if (!document.createEvent) { - return false; - } - var ev = document.createEvent('MouseEvent'); - return ev != null && 'pageX' in ev; - }, - - /** - * Listens to window scroll and resize events. We cache scroll values so that - * application code can access them without triggering reflows. - * - * ViewportMetrics is only used by SyntheticMouse/TouchEvent and only when - * pageX/pageY isn't supported (legacy browsers). - * - * NOTE: Scroll events do not bubble. - * - * @see http://www.quirksmode.org/dom/events/scroll.html - */ - ensureScrollValueMonitoring: function () { - if (hasEventPageXY === undefined) { - hasEventPageXY = ReactBrowserEventEmitter.supportsEventPageXY(); - } - if (!hasEventPageXY && !isMonitoringScrollValue) { - var refresh = ViewportMetrics.refreshScrollValues; - ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh); - isMonitoringScrollValue = true; - } - } -}); - -module.exports = ReactBrowserEventEmitter; - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {var win; - -if (typeof window !== "undefined") { - win = window; -} else if (typeof global !== "undefined") { - win = global; -} else if (typeof self !== "undefined"){ - win = self; -} else { - win = {}; -} - -module.exports = win; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22))) - -/***/ }), -/* 86 */, -/* 87 */, -/* 88 */, -/* 89 */, -/* 90 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__stripIndentTransformer__ = __webpack_require__(836); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__stripIndentTransformer__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudFRyYW5zZm9ybWVyL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0IsMEI7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9zdHJpcEluZGVudFRyYW5zZm9ybWVyJ1xuIl19 - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.15 ToLength -var toInteger = __webpack_require__(97); -var min = Math.min; -module.exports = function (it) { - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; - - -/***/ }), -/* 92 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -var anObject = __webpack_require__(25); -var dPs = __webpack_require__(222); -var enumBugKeys = __webpack_require__(100); -var IE_PROTO = __webpack_require__(98)('IE_PROTO'); -var Empty = function () { /* empty */ }; -var PROTOTYPE = 'prototype'; - -// Create object with fake `null` prototype: use iframe Object with cleared prototype -var createDict = function () { - // Thrash, waste and sodomy: IE GC bug - var iframe = __webpack_require__(101)('iframe'); - var i = enumBugKeys.length; - var lt = '<'; - var gt = '>'; - var iframeDocument; - iframe.style.display = 'none'; - __webpack_require__(155).appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; - return createDict(); -}; - -module.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - // add "__proto__" for Object.getPrototypeOf polyfill - result[IE_PROTO] = O; - } else result = createDict(); - return Properties === undefined ? result : dPs(result, Properties); -}; - - -/***/ }), -/* 93 */ -/***/ (function(module, exports, __webpack_require__) { - -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __webpack_require__(57); -var TAG = __webpack_require__(14)('toStringTag'); -// ES3 wrong here -var ARG = cof(function () { return arguments; }()) == 'Arguments'; - -// fallback for IE11 Script Access Denied error -var tryGet = function (it, key) { - try { - return it[key]; - } catch (e) { /* empty */ } -}; - -module.exports = function (it) { - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T - // builtinTag case - : ARG ? cof(O) - // ES3 arguments fallback - : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; -}; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _manager = __webpack_require__(331); - -Object.defineProperty(exports, 'register', { - enumerable: true, - get: function get() { - return _manager.register; - } -}); - -var _preview = __webpack_require__(332); - -Object.defineProperty(exports, 'linkTo', { - enumerable: true, - get: function get() { - return _preview.linkTo; - } -}); -var ADDON_ID = exports.ADDON_ID = 'storybook/links'; -var EVENT_ID = exports.EVENT_ID = ADDON_ID + '/link-event'; - -/***/ }), -/* 95 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Forked from fbjs/warning: - * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js - * - * Only change is we use console.warn instead of console.error, - * and do nothing when 'console' is not supported. - * This really simplifies the code. - * --- - * 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 lowPriorityWarning = function () {}; - -if (true) { - var printWarning = function (format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - 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('`warning(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)); - } - }; -} - -module.exports = lowPriorityWarning; - -/***/ }), -/* 96 */ -/***/ (function(module, exports) { - -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function (it) { - if (it == undefined) throw TypeError("Can't call method on " + it); - return it; -}; - - -/***/ }), -/* 97 */ -/***/ (function(module, exports) { - -// 7.1.4 ToInteger -var ceil = Math.ceil; -var floor = Math.floor; -module.exports = function (it) { - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); -}; - - -/***/ }), -/* 98 */ -/***/ (function(module, exports, __webpack_require__) { - -var shared = __webpack_require__(99)('keys'); -var uid = __webpack_require__(73); -module.exports = function (key) { - return shared[key] || (shared[key] = uid(key)); -}; - - -/***/ }), -/* 99 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(16); -var SHARED = '__core-js_shared__'; -var store = global[SHARED] || (global[SHARED] = {}); -module.exports = function (key) { - return store[key] || (store[key] = {}); -}; - - -/***/ }), -/* 100 */ -/***/ (function(module, exports) { - -// IE 8- don't enum bug keys -module.exports = ( - 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' -).split(','); - - -/***/ }), -/* 101 */ -/***/ (function(module, exports, __webpack_require__) { - -var isObject = __webpack_require__(28); -var document = __webpack_require__(16).document; -// typeof document.createElement is 'object' in old IE -var is = isObject(document) && isObject(document.createElement); -module.exports = function (it) { - return is ? document.createElement(it) : {}; -}; - - -/***/ }), -/* 102 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(28); -// instead of the ES6 spec version, we didn't implement @@toPrimitive case -// and the second argument - flag - preferred type is a string -module.exports = function (it, S) { - if (!isObject(it)) return it; - var fn, val; - if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; - if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; - throw TypeError("Can't convert object to primitive value"); -}; - - -/***/ }), -/* 103 */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(93); -var ITERATOR = __webpack_require__(14)('iterator'); -var Iterators = __webpack_require__(48); -module.exports = __webpack_require__(10).getIteratorMethod = function (it) { - if (it != undefined) return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; - - -/***/ }), -/* 104 */ -/***/ (function(module, exports, __webpack_require__) { - -exports.f = __webpack_require__(14); - - -/***/ }), -/* 105 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(16); -var core = __webpack_require__(10); -var LIBRARY = __webpack_require__(74); -var wksExt = __webpack_require__(104); -var defineProperty = __webpack_require__(24).f; -module.exports = function (name) { - var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); - if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); -}; - - -/***/ }), -/* 106 */ -/***/ (function(module, exports) { - -exports.f = Object.getOwnPropertySymbols; - - -/***/ }), -/* 107 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(300), __esModule: true }; - -/***/ }), -/* 108 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(0); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ThemeProvider = function (_Component) { - (0, _inherits3.default)(ThemeProvider, _Component); - - function ThemeProvider() { - (0, _classCallCheck3.default)(this, ThemeProvider); - return (0, _possibleConstructorReturn3.default)(this, (ThemeProvider.__proto__ || Object.getPrototypeOf(ThemeProvider)).apply(this, arguments)); - } - - (0, _createClass3.default)(ThemeProvider, [{ - key: 'getChildContext', - value: function getChildContext() { - var theme = this.props.theme; - - return { - // createStyles: createStyles - theme: theme - }; - } - }, { - key: 'render', - value: function render() { - return this.props.children; - } - }]); - return ThemeProvider; -}(_react.Component); - -ThemeProvider.childContextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]) -}; - -exports.default = ThemeProvider; - -/***/ }), -/* 109 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = function requirePromise() { - if (typeof Promise !== 'function') { - throw new TypeError('`Promise.prototype.finally` requires a global `Promise` be available.'); - } -}; - - -/***/ }), -/* 110 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(386); - - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var ReactErrorUtils = __webpack_require__(112); - -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -/** - * Injected dependencies: - */ - -/** - * - `ComponentTree`: [required] Module that can convert between React instances - * and actual node references. - */ -var ComponentTree; -var TreeTraversal; -var injection = { - injectComponentTree: function (Injected) { - ComponentTree = Injected; - if (true) { - true ? warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, 'EventPluginUtils.injection.injectComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0; - } - }, - injectTreeTraversal: function (Injected) { - TreeTraversal = Injected; - if (true) { - true ? warning(Injected && Injected.isAncestor && Injected.getLowestCommonAncestor, 'EventPluginUtils.injection.injectTreeTraversal(...): Injected ' + 'module is missing isAncestor or getLowestCommonAncestor.') : void 0; - } - } -}; - -function isEndish(topLevelType) { - return topLevelType === 'topMouseUp' || topLevelType === 'topTouchEnd' || topLevelType === 'topTouchCancel'; -} - -function isMoveish(topLevelType) { - return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove'; -} -function isStartish(topLevelType) { - return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart'; -} - -var validateEventDispatches; -if (true) { - 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; - - true ? warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, 'EventPluginUtils: Invalid `event`.') : void 0; - }; -} - -/** - * Dispatch the event to the listener. - * @param {SyntheticEvent} event SyntheticEvent to handle - * @param {boolean} simulated If the event is simulated (changes exn behavior) - * @param {function} listener Application-level callback - * @param {*} inst Internal component instance - */ -function executeDispatch(event, simulated, listener, inst) { - var type = event.type || 'unknown-event'; - event.currentTarget = EventPluginUtils.getNodeFromInstance(inst); - if (simulated) { - ReactErrorUtils.invokeGuardedCallbackWithCatch(type, listener, event); - } else { - ReactErrorUtils.invokeGuardedCallback(type, listener, event); - } - event.currentTarget = null; -} - -/** - * Standard/simple iteration through an event's collected dispatches. - */ -function executeDispatchesInOrder(event, simulated) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - if (true) { - 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, simulated, dispatchListeners[i], dispatchInstances[i]); - } - } else if (dispatchListeners) { - executeDispatch(event, simulated, dispatchListeners, dispatchInstances); - } - event._dispatchListeners = null; - event._dispatchInstances = null; -} - -/** - * Standard/simple iteration through an event's collected dispatches, but stops - * at the first dispatch execution returning true, and returns that id. - * - * @return {?string} id of the first dispatch execution who's listener returns - * true, or null if no listener returned true. - */ -function executeDispatchesInOrderStopAtTrueImpl(event) { - var dispatchListeners = event._dispatchListeners; - var dispatchInstances = event._dispatchInstances; - if (true) { - 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. - if (dispatchListeners[i](event, dispatchInstances[i])) { - return dispatchInstances[i]; - } - } - } else if (dispatchListeners) { - if (dispatchListeners(event, dispatchInstances)) { - return dispatchInstances; - } - } - return null; -} - -/** - * @see executeDispatchesInOrderStopAtTrueImpl - */ -function executeDispatchesInOrderStopAtTrue(event) { - var ret = executeDispatchesInOrderStopAtTrueImpl(event); - event._dispatchInstances = null; - event._dispatchListeners = null; - return ret; -} - -/** - * Execution of a "direct" dispatch - there must be at most one dispatch - * accumulated on the event or it is considered an error. It doesn't really make - * sense for an event with multiple dispatches (bubbled) to keep track of the - * return values at each dispatch execution, but it does tend to make sense when - * dealing with "direct" dispatches. - * - * @return {*} The return value of executing the single dispatch. - */ -function executeDirectDispatch(event) { - if (true) { - validateEventDispatches(event); - } - var dispatchListener = event._dispatchListeners; - var dispatchInstance = event._dispatchInstances; - !!Array.isArray(dispatchListener) ? true ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : _prodInvariant('103') : void 0; - event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; - var res = dispatchListener ? dispatchListener(event) : null; - event.currentTarget = null; - event._dispatchListeners = null; - event._dispatchInstances = null; - return res; -} - -/** - * @param {SyntheticEvent} event - * @return {boolean} True iff number of dispatches accumulated is greater than 0. - */ -function hasDispatches(event) { - return !!event._dispatchListeners; -} - -/** - * General utilities that are useful in creating custom Event Plugins. - */ -var EventPluginUtils = { - isEndish: isEndish, - isMoveish: isMoveish, - isStartish: isStartish, - - executeDirectDispatch: executeDirectDispatch, - executeDispatchesInOrder: executeDispatchesInOrder, - executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, - hasDispatches: hasDispatches, - - getInstanceFromNode: function (node) { - return ComponentTree.getInstanceFromNode(node); - }, - getNodeFromInstance: function (node) { - return ComponentTree.getNodeFromInstance(node); - }, - isAncestor: function (a, b) { - return TreeTraversal.isAncestor(a, b); - }, - getLowestCommonAncestor: function (a, b) { - return TreeTraversal.getLowestCommonAncestor(a, b); - }, - getParentInstance: function (inst) { - return TreeTraversal.getParentInstance(inst); - }, - traverseTwoPhase: function (target, fn, arg) { - return TreeTraversal.traverseTwoPhase(target, fn, arg); - }, - traverseEnterLeave: function (from, to, fn, argFrom, argTo) { - return TreeTraversal.traverseEnterLeave(from, to, fn, argFrom, argTo); - }, - - injection: injection -}; - -module.exports = EventPluginUtils; - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var caughtError = null; - -/** - * Call a function while guarding against errors that happens within it. - * - * @param {String} name of the guard to use for logging or debugging - * @param {Function} func The function to invoke - * @param {*} a First argument - * @param {*} b Second argument - */ -function invokeGuardedCallback(name, func, a) { - try { - func(a); - } catch (x) { - if (caughtError === null) { - caughtError = x; - } - } -} - -var ReactErrorUtils = { - invokeGuardedCallback: invokeGuardedCallback, - - /** - * Invoked by ReactTestUtils.Simulate so that any errors thrown by the event - * handler are sure to be rethrown by rethrowCaughtError. - */ - invokeGuardedCallbackWithCatch: invokeGuardedCallback, - - /** - * During execution of guarded functions we will capture the first error which - * we will rethrow to be handled by the top level error handler. - */ - rethrowCaughtError: function () { - if (caughtError) { - var error = caughtError; - caughtError = null; - throw error; - } - } -}; - -if (true) { - /** - * To help development we can get better devtools integration by simulating a - * real browser event. - */ - if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { - var fakeNode = document.createElement('react'); - ReactErrorUtils.invokeGuardedCallback = function (name, func, a) { - var boundFunc = function () { - func(a); - }; - var evtType = 'react-' + name; - fakeNode.addEventListener(evtType, boundFunc, false); - var evt = document.createEvent('Event'); - evt.initEvent(evtType, false, false); - fakeNode.dispatchEvent(evt); - fakeNode.removeEventListener(evtType, boundFunc, false); - }; - } -} - -module.exports = ReactErrorUtils; - -/***/ }), -/* 113 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Gets the target node from a native browser event by accounting for - * inconsistencies in browser DOM APIs. - * - * @param {object} nativeEvent Native browser event. - * @return {DOMEventTarget} Target node. - */ - -function getEventTarget(nativeEvent) { - var target = nativeEvent.target || nativeEvent.srcElement || window; - - // 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 === 3 ? target.parentNode : target; -} - -module.exports = getEventTarget; - -/***/ }), -/* 114 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ExecutionEnvironment = __webpack_require__(13); - -var useHasFeature; -if (ExecutionEnvironment.canUseDOM) { - useHasFeature = document.implementation && document.implementation.hasFeature && - // always returns true in newer browsers as per the standard. - // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature - document.implementation.hasFeature('', '') !== true; -} - -/** - * Checks if an event is supported in the current execution environment. - * - * NOTE: This will not work correctly for non-generic events such as `change`, - * `reset`, `load`, `error`, and `select`. - * - * Borrows from Modernizr. - * - * @param {string} eventNameSuffix Event name, e.g. "click". - * @param {?boolean} capture Check if the capture phase is supported. - * @return {boolean} True if the event is supported. - * @internal - * @license Modernizr 3.0.0pre (Custom Build) | MIT - */ -function isEventSupported(eventNameSuffix, capture) { - if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) { - return false; - } - - var eventName = 'on' + eventNameSuffix; - var isSupported = eventName in document; - - if (!isSupported) { - var element = document.createElement('div'); - element.setAttribute(eventName, 'return;'); - isSupported = typeof element[eventName] === 'function'; - } - - if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { - // This is the only way to test support for the `wheel` event in IE9+. - isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); - } - - return isSupported; -} - -module.exports = isEventSupported; - -/***/ }), -/* 115 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Translation from modifier key to the associated property in the event. - * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers - */ - -var modifierKeyToProp = { - Alt: 'altKey', - Control: 'ctrlKey', - Meta: 'metaKey', - Shift: 'shiftKey' -}; - -// IE8 does not implement getModifierState so we simply map it to the only -// modifier keys exposed by the event itself, does not support Lock-keys. -// Currently, all major browsers except Chrome seems to support Lock-keys. -function modifierStateGetter(keyArg) { - var syntheticEvent = this; - var nativeEvent = syntheticEvent.nativeEvent; - if (nativeEvent.getModifierState) { - return nativeEvent.getModifierState(keyArg); - } - var keyProp = modifierKeyToProp[keyArg]; - return keyProp ? !!nativeEvent[keyProp] : false; -} - -function getEventModifierState(nativeEvent) { - return modifierStateGetter; -} - -module.exports = getEventModifierState; - -/***/ }), -/* 116 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMLazyTree = __webpack_require__(52); -var Danger = __webpack_require__(405); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactInstrumentation = __webpack_require__(19); - -var createMicrosoftUnsafeLocalFunction = __webpack_require__(118); -var setInnerHTML = __webpack_require__(82); -var setTextContent = __webpack_require__(190); - -function getNodeAfter(parentNode, node) { - // Special case for text components, which return [open, close] comments - // from getHostNode. - if (Array.isArray(node)) { - node = node[1]; - } - return node ? node.nextSibling : parentNode.firstChild; -} - -/** - * Inserts `childNode` as a child of `parentNode` at the `index`. - * - * @param {DOMElement} parentNode Parent node in which to insert. - * @param {DOMElement} childNode Child node to insert. - * @param {number} index Index at which to insert the child. - * @internal - */ -var insertChildAt = createMicrosoftUnsafeLocalFunction(function (parentNode, childNode, referenceNode) { - // We rely exclusively on `insertBefore(node, null)` instead of also using - // `appendChild(node)`. (Using `undefined` is not allowed by all browsers so - // we are careful to use `null`.) - parentNode.insertBefore(childNode, referenceNode); -}); - -function insertLazyTreeChildAt(parentNode, childTree, referenceNode) { - DOMLazyTree.insertTreeBefore(parentNode, childTree, referenceNode); -} - -function moveChild(parentNode, childNode, referenceNode) { - if (Array.isArray(childNode)) { - moveDelimitedText(parentNode, childNode[0], childNode[1], referenceNode); - } else { - insertChildAt(parentNode, childNode, referenceNode); - } -} - -function removeChild(parentNode, childNode) { - if (Array.isArray(childNode)) { - var closingComment = childNode[1]; - childNode = childNode[0]; - removeDelimitedText(parentNode, childNode, closingComment); - parentNode.removeChild(closingComment); - } - parentNode.removeChild(childNode); -} - -function moveDelimitedText(parentNode, openingComment, closingComment, referenceNode) { - var node = openingComment; - while (true) { - var nextNode = node.nextSibling; - insertChildAt(parentNode, node, referenceNode); - if (node === closingComment) { - break; - } - node = nextNode; - } -} - -function removeDelimitedText(parentNode, startNode, closingComment) { - while (true) { - var node = startNode.nextSibling; - if (node === closingComment) { - // The closing comment is removed by ReactMultiChild. - break; - } else { - parentNode.removeChild(node); - } - } -} - -function replaceDelimitedText(openingComment, closingComment, stringText) { - var parentNode = openingComment.parentNode; - var nodeAfterComment = openingComment.nextSibling; - if (nodeAfterComment === closingComment) { - // There are no text nodes between the opening and closing comments; insert - // a new one if stringText isn't empty. - if (stringText) { - insertChildAt(parentNode, document.createTextNode(stringText), nodeAfterComment); - } - } else { - if (stringText) { - // Set the text content of the first node after the opening comment, and - // remove all following nodes up until the closing comment. - setTextContent(nodeAfterComment, stringText); - removeDelimitedText(parentNode, nodeAfterComment, closingComment); - } else { - removeDelimitedText(parentNode, openingComment, closingComment); - } - } - - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(openingComment)._debugID, - type: 'replace text', - payload: stringText - }); - } -} - -var dangerouslyReplaceNodeWithMarkup = Danger.dangerouslyReplaceNodeWithMarkup; -if (true) { - dangerouslyReplaceNodeWithMarkup = function (oldChild, markup, prevInstance) { - Danger.dangerouslyReplaceNodeWithMarkup(oldChild, markup); - if (prevInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: prevInstance._debugID, - type: 'replace with', - payload: markup.toString() - }); - } else { - var nextInstance = ReactDOMComponentTree.getInstanceFromNode(markup.node); - if (nextInstance._debugID !== 0) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: nextInstance._debugID, - type: 'mount', - payload: markup.toString() - }); - } - } - }; -} - -/** - * Operations for updating with DOM children. - */ -var DOMChildrenOperations = { - dangerouslyReplaceNodeWithMarkup: dangerouslyReplaceNodeWithMarkup, - - replaceDelimitedText: replaceDelimitedText, - - /** - * Updates a component's children by processing a series of updates. The - * update configurations are each expected to have a `parentNode` property. - * - * @param {array} updates List of update configurations. - * @internal - */ - processUpdates: function (parentNode, updates) { - if (true) { - var parentNodeDebugID = ReactDOMComponentTree.getInstanceFromNode(parentNode)._debugID; - } - - for (var k = 0; k < updates.length; k++) { - var update = updates[k]; - switch (update.type) { - case 'INSERT_MARKUP': - insertLazyTreeChildAt(parentNode, update.content, getNodeAfter(parentNode, update.afterNode)); - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'insert child', - payload: { - toIndex: update.toIndex, - content: update.content.toString() - } - }); - } - break; - case 'MOVE_EXISTING': - moveChild(parentNode, update.fromNode, getNodeAfter(parentNode, update.afterNode)); - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'move child', - payload: { fromIndex: update.fromIndex, toIndex: update.toIndex } - }); - } - break; - case 'SET_MARKUP': - setInnerHTML(parentNode, update.content); - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'replace children', - payload: update.content.toString() - }); - } - break; - case 'TEXT_CONTENT': - setTextContent(parentNode, update.content); - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'replace text', - payload: update.content.toString() - }); - } - break; - case 'REMOVE_NODE': - removeChild(parentNode, update.fromNode); - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: parentNodeDebugID, - type: 'remove child', - payload: { fromIndex: update.fromIndex } - }); - } - break; - } - } - } -}; - -module.exports = DOMChildrenOperations; - -/***/ }), -/* 117 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMNamespaces = { - html: 'http://www.w3.org/1999/xhtml', - mathml: 'http://www.w3.org/1998/Math/MathML', - svg: 'http://www.w3.org/2000/svg' -}; - -module.exports = DOMNamespaces; - -/***/ }), -/* 118 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -/* globals MSApp */ - - - -/** - * Create a function which has 'unsafe' privileges (required by windows8 apps) - */ - -var createMicrosoftUnsafeLocalFunction = function (func) { - if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { - return function (arg0, arg1, arg2, arg3) { - MSApp.execUnsafeLocalFunction(function () { - return func(arg0, arg1, arg2, arg3); - }); - }; - } else { - return func; - } -}; - -module.exports = createMicrosoftUnsafeLocalFunction; - -/***/ }), -/* 119 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var ReactPropTypesSecret = __webpack_require__(197); -var propTypesFactory = __webpack_require__(148); - -var React = __webpack_require__(42); -var PropTypes = propTypesFactory(React.isValidElement); - -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -var hasReadOnlyValue = { - button: true, - checkbox: true, - image: true, - hidden: true, - radio: true, - reset: true, - submit: true -}; - -function _assertSingleLink(inputProps) { - !(inputProps.checkedLink == null || inputProps.valueLink == null) ? true ? invariant(false, 'Cannot provide a checkedLink and a valueLink. If you want to use checkedLink, you probably don\'t want to use valueLink and vice versa.') : _prodInvariant('87') : void 0; -} -function _assertValueLink(inputProps) { - _assertSingleLink(inputProps); - !(inputProps.value == null && inputProps.onChange == null) ? true ? invariant(false, 'Cannot provide a valueLink and a value or onChange event. If you want to use value or onChange, you probably don\'t want to use valueLink.') : _prodInvariant('88') : void 0; -} - -function _assertCheckedLink(inputProps) { - _assertSingleLink(inputProps); - !(inputProps.checked == null && inputProps.onChange == null) ? true ? invariant(false, 'Cannot provide a checkedLink and a checked property or onChange event. If you want to use checked or onChange, you probably don\'t want to use checkedLink') : _prodInvariant('89') : void 0; -} - -var propTypes = { - value: function (props, propName, componentName) { - if (!props[propName] || hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled) { - 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[propName] || props.onChange || props.readOnly || props.disabled) { - 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`.'); - }, - onChange: PropTypes.func -}; - -var loggedTypeFailures = {}; -function getDeclarationErrorAddendum(owner) { - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; -} - -/** - * Provide a linked `value` attribute for controlled forms. You should not use - * this outside of the ReactDOM controlled form components. - */ -var LinkedValueUtils = { - checkPropTypes: function (tagName, props, owner) { - for (var propName in propTypes) { - if (propTypes.hasOwnProperty(propName)) { - var error = propTypes[propName](props, propName, tagName, 'prop', null, ReactPropTypesSecret); - } - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var addendum = getDeclarationErrorAddendum(owner); - true ? warning(false, 'Failed form propType: %s%s', error.message, addendum) : void 0; - } - } - }, - - /** - * @param {object} inputProps Props for form component - * @return {*} current value of the input either from value prop or link. - */ - getValue: function (inputProps) { - if (inputProps.valueLink) { - _assertValueLink(inputProps); - return inputProps.valueLink.value; - } - return inputProps.value; - }, - - /** - * @param {object} inputProps Props for form component - * @return {*} current checked status of the input either from checked prop - * or link. - */ - getChecked: function (inputProps) { - if (inputProps.checkedLink) { - _assertCheckedLink(inputProps); - return inputProps.checkedLink.value; - } - return inputProps.checked; - }, - - /** - * @param {object} inputProps Props for form component - * @param {SyntheticEvent} event change event to handle - */ - executeOnChange: function (inputProps, event) { - if (inputProps.valueLink) { - _assertValueLink(inputProps); - return inputProps.valueLink.requestChange(event.target.value); - } else if (inputProps.checkedLink) { - _assertCheckedLink(inputProps); - return inputProps.checkedLink.requestChange(event.target.checked); - } else if (inputProps.onChange) { - return inputProps.onChange.call(undefined, event); - } - } -}; - -module.exports = LinkedValueUtils; - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -var injected = false; - -var ReactComponentEnvironment = { - /** - * Optionally injectable hook for swapping out mount images in the middle of - * the tree. - */ - replaceNodeWithMarkup: null, - - /** - * Optionally injectable hook for processing a queue of child updates. Will - * later move into MultiChildComponents. - */ - processChildrenUpdates: null, - - injection: { - injectEnvironment: function (environment) { - !!injected ? true ? invariant(false, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : _prodInvariant('104') : void 0; - ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup; - ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates; - injected = true; - } - } -}; - -module.exports = ReactComponentEnvironment; - -/***/ }), -/* 121 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - * - */ - -/*eslint-disable no-self-compare */ - - - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** - * 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) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - // Added the nonzero y check to make Flow happy, but it is redundant - return x !== 0 || y !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } -} - -/** - * 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.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - - return true; -} - -module.exports = shallowEqual; - -/***/ }), -/* 122 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Given a `prevElement` and `nextElement`, determines if the existing - * instance should be updated as opposed to being destroyed or replaced by a new - * instance. Both arguments are elements. This ensures that this logic can - * operate on stateless trees without any backing instance. - * - * @param {?object} prevElement - * @param {?object} nextElement - * @return {boolean} True if the existing instance should be updated. - * @protected - */ - -function shouldUpdateReactComponent(prevElement, nextElement) { - var prevEmpty = prevElement === null || prevElement === false; - var nextEmpty = nextElement === null || nextElement === false; - if (prevEmpty || nextEmpty) { - return prevEmpty === nextEmpty; - } - - var prevType = typeof prevElement; - var nextType = typeof nextElement; - if (prevType === 'string' || prevType === 'number') { - return nextType === 'string' || nextType === 'number'; - } else { - return nextType === 'object' && prevElement.type === nextElement.type && prevElement.key === nextElement.key; - } -} - -module.exports = shouldUpdateReactComponent; - -/***/ }), -/* 123 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -/** - * 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; -} - -/** - * Unescape and unwrap key for human-readable display - * - * @param {string} key to unescape. - * @return {string} the unescaped key. - */ -function unescape(key) { - var unescapeRegex = /(=0|=2)/g; - var unescaperLookup = { - '=0': '=', - '=2': ':' - }; - var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); - - return ('' + keySubstring).replace(unescapeRegex, function (match) { - return unescaperLookup[match]; - }); -} - -var KeyEscapeUtils = { - escape: escape, - unescape: unescape -}; - -module.exports = KeyEscapeUtils; - -/***/ }), -/* 124 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var ReactCurrentOwner = __webpack_require__(23); -var ReactInstanceMap = __webpack_require__(63); -var ReactInstrumentation = __webpack_require__(19); -var ReactUpdates = __webpack_require__(26); - -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -function enqueueUpdate(internalInstance) { - ReactUpdates.enqueueUpdate(internalInstance); -} - -function formatUnexpectedArgument(arg) { - var type = typeof arg; - if (type !== 'object') { - return type; - } - var displayName = arg.constructor && arg.constructor.name || type; - var keys = Object.keys(arg); - if (keys.length > 0 && keys.length < 20) { - return displayName + ' (keys: ' + keys.join(', ') + ')'; - } - return displayName; -} - -function getInternalInstanceReadyForUpdate(publicInstance, callerName) { - var internalInstance = ReactInstanceMap.get(publicInstance); - if (!internalInstance) { - if (true) { - var ctor = publicInstance.constructor; - // Only warn when we have a callerName. Otherwise we should be silent. - // We're probably calling from enqueueCallback. We don't want to warn - // there because we already warned for the corresponding lifecycle method. - true ? warning(!callerName, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, ctor && (ctor.displayName || ctor.name) || 'ReactClass') : void 0; - } - return null; - } - - if (true) { - true ? warning(ReactCurrentOwner.current == null, '%s(...): Cannot update during an existing state transition (such as ' + "within `render` or another component's constructor). Render methods " + 'should be a pure function of props and state; constructor ' + 'side-effects are an anti-pattern, but can be moved to ' + '`componentWillMount`.', callerName) : void 0; - } - - return internalInstance; -} - -/** - * ReactUpdateQueue allows for state updates to be scheduled into a later - * reconciliation step. - */ -var ReactUpdateQueue = { - /** - * 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) { - if (true) { - var owner = ReactCurrentOwner.current; - if (owner !== null) { - true ? warning(owner._warnedAboutRefsInRender, '%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.', owner.getName() || 'A component') : void 0; - owner._warnedAboutRefsInRender = true; - } - } - var internalInstance = ReactInstanceMap.get(publicInstance); - if (internalInstance) { - // During componentWillMount and render this will still be null but after - // that will always render to something. At least for now. So we can use - // this hack. - return !!internalInstance._renderedComponent; - } else { - return false; - } - }, - - /** - * Enqueue a callback that will be executed after all the pending updates - * have processed. - * - * @param {ReactClass} publicInstance The instance to use as `this` context. - * @param {?function} callback Called after state is updated. - * @param {string} callerName Name of the calling function in the public API. - * @internal - */ - enqueueCallback: function (publicInstance, callback, callerName) { - ReactUpdateQueue.validateCallback(callback, callerName); - var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); - - // Previously we would throw an error if we didn't have an internal - // instance. Since we want to make it a no-op instead, we mirror the same - // behavior we have in other enqueue* methods. - // We also need to ignore callbacks in componentWillMount. See - // enqueueUpdates. - if (!internalInstance) { - return null; - } - - if (internalInstance._pendingCallbacks) { - internalInstance._pendingCallbacks.push(callback); - } else { - internalInstance._pendingCallbacks = [callback]; - } - // TODO: The callback here is ignored when setState is called from - // componentWillMount. Either fix it or disallow doing so completely in - // favor of getInitialState. Alternatively, we can disallow - // componentWillMount during server-side rendering. - enqueueUpdate(internalInstance); - }, - - enqueueCallbackInternal: function (internalInstance, callback) { - if (internalInstance._pendingCallbacks) { - internalInstance._pendingCallbacks.push(callback); - } else { - internalInstance._pendingCallbacks = [callback]; - } - enqueueUpdate(internalInstance); - }, - - /** - * 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. - * @internal - */ - enqueueForceUpdate: function (publicInstance) { - var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'forceUpdate'); - - if (!internalInstance) { - return; - } - - internalInstance._pendingForceUpdate = true; - - enqueueUpdate(internalInstance); - }, - - /** - * 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. - * @internal - */ - enqueueReplaceState: function (publicInstance, completeState, callback) { - var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'replaceState'); - - if (!internalInstance) { - return; - } - - internalInstance._pendingStateQueue = [completeState]; - internalInstance._pendingReplaceState = true; - - // Future-proof 15.5 - if (callback !== undefined && callback !== null) { - ReactUpdateQueue.validateCallback(callback, 'replaceState'); - if (internalInstance._pendingCallbacks) { - internalInstance._pendingCallbacks.push(callback); - } else { - internalInstance._pendingCallbacks = [callback]; - } - } - - enqueueUpdate(internalInstance); - }, - - /** - * 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. - * @internal - */ - enqueueSetState: function (publicInstance, partialState) { - if (true) { - ReactInstrumentation.debugTool.onSetState(); - true ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : void 0; - } - - var internalInstance = getInternalInstanceReadyForUpdate(publicInstance, 'setState'); - - if (!internalInstance) { - return; - } - - var queue = internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = []); - queue.push(partialState); - - enqueueUpdate(internalInstance); - }, - - enqueueElementInternal: function (internalInstance, nextElement, nextContext) { - internalInstance._pendingElement = nextElement; - // TODO: introduce _pendingContext instead of setting it directly. - internalInstance._context = nextContext; - enqueueUpdate(internalInstance); - }, - - validateCallback: function (callback, callerName) { - !(!callback || typeof callback === 'function') ? true ? invariant(false, '%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.', callerName, formatUnexpectedArgument(callback)) : _prodInvariant('122', callerName, formatUnexpectedArgument(callback)) : void 0; - } -}; - -module.exports = ReactUpdateQueue; - -/***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var emptyFunction = __webpack_require__(20); -var warning = __webpack_require__(2); - -var validateDOMNesting = emptyFunction; - -if (true) { - // This validation code was written based on the HTML5 parsing spec: - // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope - // - // Note: this does not catch all invalid nesting, nor does it try to (as it's - // not clear what practical benefit doing so provides); instead, we warn only - // for cases where the parser will give a parse tree differing from what React - // intended. For example,
is invalid but we don't warn - // because it still parses correctly; we do warn for other cases like nested - //

tags where the beginning of the second element implicitly closes the - // first, causing a confusing mess. - - // https://html.spec.whatwg.org/multipage/syntax.html#special - var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; - - // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope - var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', - - // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point - // TODO: Distinguish by namespace here -- for , including it here - // errs on the side of fewer warnings - 'foreignObject', 'desc', 'title']; - - // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope - var buttonScopeTags = inScopeTags.concat(['button']); - - // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags - var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt']; - - var emptyAncestorInfo = { - current: null, - - formTag: null, - aTagInScope: null, - buttonTagInScope: null, - nobrTagInScope: null, - pTagInButtonScope: null, - - listItemTagAutoclosing: null, - dlItemTagAutoclosing: null - }; - - var updatedAncestorInfo = function (oldInfo, tag, instance) { - var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo); - var info = { tag: tag, instance: instance }; - - if (inScopeTags.indexOf(tag) !== -1) { - ancestorInfo.aTagInScope = null; - ancestorInfo.buttonTagInScope = null; - ancestorInfo.nobrTagInScope = null; - } - if (buttonScopeTags.indexOf(tag) !== -1) { - ancestorInfo.pTagInButtonScope = null; - } - - // See rules for 'li', 'dd', 'dt' start tags in - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody - if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') { - ancestorInfo.listItemTagAutoclosing = null; - ancestorInfo.dlItemTagAutoclosing = null; - } - - ancestorInfo.current = info; - - if (tag === 'form') { - ancestorInfo.formTag = info; - } - if (tag === 'a') { - ancestorInfo.aTagInScope = info; - } - if (tag === 'button') { - ancestorInfo.buttonTagInScope = info; - } - if (tag === 'nobr') { - ancestorInfo.nobrTagInScope = info; - } - if (tag === 'p') { - ancestorInfo.pTagInButtonScope = info; - } - if (tag === 'li') { - ancestorInfo.listItemTagAutoclosing = info; - } - if (tag === 'dd' || tag === 'dt') { - ancestorInfo.dlItemTagAutoclosing = info; - } - - return ancestorInfo; - }; - - /** - * Returns whether - */ - var isTagValidWithParent = function (tag, parentTag) { - // First, let's check if we're in an unusual parsing mode... - switch (parentTag) { - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect - case 'select': - return tag === 'option' || tag === 'optgroup' || tag === '#text'; - case 'optgroup': - return tag === 'option' || tag === '#text'; - // Strictly speaking, seeing an <option> doesn't mean we're in a <select> - // but - case 'option': - return tag === '#text'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption - // No special behavior since these rules fall back to "in body" mode for - // all except special table nodes which cause bad parsing behavior anyway. - - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr - case 'tr': - return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody - case 'tbody': - case 'thead': - case 'tfoot': - return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup - case 'colgroup': - return tag === 'col' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable - case 'table': - return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead - case 'head': - return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; - // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element - case 'html': - return tag === 'head' || tag === 'body'; - case '#document': - return tag === 'html'; - } - - // Probably in the "in body" parsing mode, so we outlaw only tag combos - // where the parsing rules cause implicit opens or closes to be added. - // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody - switch (tag) { - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6'; - - case 'rp': - case 'rt': - return impliedEndTags.indexOf(parentTag) === -1; - - case 'body': - case 'caption': - case 'col': - case 'colgroup': - case 'frame': - case 'head': - case 'html': - case 'tbody': - case 'td': - case 'tfoot': - case 'th': - case 'thead': - case 'tr': - // These tags are only valid with a few parents that have special child - // parsing rules -- if we're down here, then none of those matched and - // so we allow it only if we don't know what the parent is, as all other - // cases are invalid. - return parentTag == null; - } - - return true; - }; - - /** - * Returns whether - */ - var findInvalidAncestorForTag = function (tag, ancestorInfo) { - switch (tag) { - case 'address': - case 'article': - case 'aside': - case 'blockquote': - case 'center': - case 'details': - case 'dialog': - case 'dir': - case 'div': - case 'dl': - case 'fieldset': - case 'figcaption': - case 'figure': - case 'footer': - case 'header': - case 'hgroup': - case 'main': - case 'menu': - case 'nav': - case 'ol': - case 'p': - case 'section': - case 'summary': - case 'ul': - case 'pre': - case 'listing': - case 'table': - case 'hr': - case 'xmp': - case 'h1': - case 'h2': - case 'h3': - case 'h4': - case 'h5': - case 'h6': - return ancestorInfo.pTagInButtonScope; - - case 'form': - return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; - - case 'li': - return ancestorInfo.listItemTagAutoclosing; - - case 'dd': - case 'dt': - return ancestorInfo.dlItemTagAutoclosing; - - case 'button': - return ancestorInfo.buttonTagInScope; - - case 'a': - // Spec says something about storing a list of markers, but it sounds - // equivalent to this check. - return ancestorInfo.aTagInScope; - - case 'nobr': - return ancestorInfo.nobrTagInScope; - } - - return null; - }; - - /** - * Given a ReactCompositeComponent instance, return a list of its recursive - * owners, starting at the root and ending with the instance itself. - */ - var findOwnerStack = function (instance) { - if (!instance) { - return []; - } - - var stack = []; - do { - stack.push(instance); - } while (instance = instance._currentElement._owner); - stack.reverse(); - return stack; - }; - - var didWarn = {}; - - validateDOMNesting = function (childTag, childText, childInstance, ancestorInfo) { - ancestorInfo = ancestorInfo || emptyAncestorInfo; - var parentInfo = ancestorInfo.current; - var parentTag = parentInfo && parentInfo.tag; - - if (childText != null) { - true ? warning(childTag == null, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0; - childTag = '#text'; - } - - var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; - var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); - var problematic = invalidParent || invalidAncestor; - - if (problematic) { - var ancestorTag = problematic.tag; - var ancestorInstance = problematic.instance; - - var childOwner = childInstance && childInstance._currentElement._owner; - var ancestorOwner = ancestorInstance && ancestorInstance._currentElement._owner; - - var childOwners = findOwnerStack(childOwner); - var ancestorOwners = findOwnerStack(ancestorOwner); - - var minStackLen = Math.min(childOwners.length, ancestorOwners.length); - var i; - - var deepestCommon = -1; - for (i = 0; i < minStackLen; i++) { - if (childOwners[i] === ancestorOwners[i]) { - deepestCommon = i; - } else { - break; - } - } - - var UNKNOWN = '(unknown)'; - var childOwnerNames = childOwners.slice(deepestCommon + 1).map(function (inst) { - return inst.getName() || UNKNOWN; - }); - var ancestorOwnerNames = ancestorOwners.slice(deepestCommon + 1).map(function (inst) { - return inst.getName() || UNKNOWN; - }); - var ownerInfo = [].concat( - // If the parent and child instances have a common owner ancestor, start - // with that -- otherwise we just start with the parent's owners. - deepestCommon !== -1 ? childOwners[deepestCommon].getName() || UNKNOWN : [], ancestorOwnerNames, ancestorTag, - // If we're warning about an invalid (non-parent) ancestry, add '...' - invalidAncestor ? ['...'] : [], childOwnerNames, childTag).join(' > '); - - var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + ownerInfo; - if (didWarn[warnKey]) { - return; - } - didWarn[warnKey] = true; - - var tagDisplayName = childTag; - var whitespaceInfo = ''; - if (childTag === '#text') { - if (/\S/.test(childText)) { - tagDisplayName = 'Text nodes'; - } else { - tagDisplayName = 'Whitespace text nodes'; - whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.'; - } - } else { - tagDisplayName = '<' + childTag + '>'; - } - - if (invalidParent) { - var info = ''; - if (ancestorTag === 'table' && childTag === 'tr') { - info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.'; - } - true ? warning(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s ' + 'See %s.%s', tagDisplayName, ancestorTag, whitespaceInfo, ownerInfo, info) : void 0; - } else { - true ? warning(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>. See %s.', tagDisplayName, ancestorTag, ownerInfo) : void 0; - } - } - }; - - validateDOMNesting.updatedAncestorInfo = updatedAncestorInfo; - - // For testing - validateDOMNesting.isTagValidInContext = function (tag, ancestorInfo) { - ancestorInfo = ancestorInfo || emptyAncestorInfo; - var parentInfo = ancestorInfo.current; - var parentTag = parentInfo && parentInfo.tag; - return isTagValidWithParent(tag, parentTag) && !findInvalidAncestorForTag(tag, ancestorInfo); - }; -} - -module.exports = validateDOMNesting; - -/***/ }), -/* 126 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * `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; - var keyCode = nativeEvent.keyCode; - - if ('charCode' in nativeEvent) { - charCode = nativeEvent.charCode; - - // FF does not set `charCode` for the Enter-key, check against `keyCode`. - if (charCode === 0 && keyCode === 13) { - charCode = 13; - } - } else { - // IE8 does not implement `charCode`, but `keyCode` has the correct value. - charCode = keyCode; - } - - // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. - // Must not discard the (non-)printable Enter-key. - if (charCode >= 32 || charCode === 13) { - return charCode; - } - - return 0; -} - -module.exports = getEventCharCode; - -/***/ }), -/* 127 */, -/* 128 */, -/* 129 */, -/* 130 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(34); -var call = __webpack_require__(157); -var isArrayIter = __webpack_require__(158); -var anObject = __webpack_require__(25); -var toLength = __webpack_require__(91); -var getIterFn = __webpack_require__(103); -var BREAK = {}; -var RETURN = {}; -var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { - var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); - var f = ctx(fn, that, entries ? 2 : 1); - var index = 0; - var length, step, iterator, result; - if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); - // fast case for arrays with default iterator - if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { - result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - if (result === BREAK || result === RETURN) return result; - } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { - result = call(iterator, f, step.value, entries); - if (result === BREAK || result === RETURN) return result; - } -}; -exports.BREAK = BREAK; -exports.RETURN = RETURN; - - -/***/ }), -/* 131 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 25.4.1.5 NewPromiseCapability(C) -var aFunction = __webpack_require__(67); - -function PromiseCapability(C) { - var resolve, reject; - this.promise = new C(function ($$resolve, $$reject) { - if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); - resolve = $$resolve; - reject = $$reject; - }); - this.resolve = aFunction(resolve); - this.reject = aFunction(reject); -} - -module.exports.f = function (C) { - return new PromiseCapability(C); -}; - - -/***/ }), -/* 132 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__replaceResultTransformer__ = __webpack_require__(837); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__replaceResultTransformer__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIvaW5kZXguanMiXSwibmFtZXMiOlsiZGVmYXVsdCJdLCJtYXBwaW5ncyI6IkFBQUE7O3FCQUVvQiw0QjtxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL3JlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcidcbiJdfQ== - -/***/ }), -/* 133 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(57); -// eslint-disable-next-line no-prototype-builtins -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { - return cof(it) == 'String' ? it.split('') : Object(it); -}; - - -/***/ }), -/* 134 */ -/***/ (function(module, exports, __webpack_require__) { - -// most Object methods by ES6 should accept primitives -var $export = __webpack_require__(15); -var core = __webpack_require__(10); -var fails = __webpack_require__(41); -module.exports = function (KEY, exec) { - var fn = (core.Object || {})[KEY] || Object[KEY]; - var exp = {}; - exp[KEY] = exec(fn); - $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); -}; - - -/***/ }), -/* 135 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(271), __esModule: true }; - -/***/ }), -/* 136 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(74); -var $export = __webpack_require__(15); -var redefine = __webpack_require__(154); -var hide = __webpack_require__(35); -var has = __webpack_require__(37); -var Iterators = __webpack_require__(48); -var $iterCreate = __webpack_require__(273); -var setToStringTag = __webpack_require__(68); -var getPrototypeOf = __webpack_require__(156); -var ITERATOR = __webpack_require__(14)('iterator'); -var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` -var FF_ITERATOR = '@@iterator'; -var KEYS = 'keys'; -var VALUES = 'values'; - -var returnThis = function () { return this; }; - -module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { - $iterCreate(Constructor, NAME, next); - var getMethod = function (kind) { - if (!BUGGY && kind in proto) return proto[kind]; - switch (kind) { - case KEYS: return function keys() { return new Constructor(this, kind); }; - case VALUES: return function values() { return new Constructor(this, kind); }; - } return function entries() { return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator'; - var DEF_VALUES = DEFAULT == VALUES; - var VALUES_BUG = false; - var proto = Base.prototype; - var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; - var $default = $native || getMethod(DEFAULT); - var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; - var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; - var methods, key, IteratorPrototype; - // Fix native - if ($anyNative) { - IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); - if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { - // Set @@toStringTag to native iterators - setToStringTag(IteratorPrototype, TAG, true); - // fix for some old engines - if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); - } - } - // fix Array#{values, @@iterator}.name in V8 / FF - if (DEF_VALUES && $native && $native.name !== VALUES) { - VALUES_BUG = true; - $default = function values() { return $native.call(this); }; - } - // Define iterator - if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { - hide(proto, ITERATOR, $default); - } - // Plug for library - Iterators[NAME] = $default; - Iterators[TAG] = returnThis; - if (DEFAULT) { - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: $entries - }; - if (FORCED) for (key in methods) { - if (!(key in proto)) redefine(proto, key, methods[key]); - } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; -}; - - -/***/ }), -/* 137 */ -/***/ (function(module, exports, __webpack_require__) { - -var META = __webpack_require__(73)('meta'); -var isObject = __webpack_require__(28); -var has = __webpack_require__(37); -var setDesc = __webpack_require__(24).f; -var id = 0; -var isExtensible = Object.isExtensible || function () { - return true; -}; -var FREEZE = !__webpack_require__(41)(function () { - return isExtensible(Object.preventExtensions({})); -}); -var setMeta = function (it) { - setDesc(it, META, { value: { - i: 'O' + ++id, // object ID - w: {} // weak collections IDs - } }); -}; -var fastKey = function (it, create) { - // return primitive with prefix - if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return 'F'; - // not necessary to add metadata - if (!create) return 'E'; - // add missing metadata - setMeta(it); - // return object ID - } return it[META].i; -}; -var getWeak = function (it, create) { - if (!has(it, META)) { - // can't set metadata to uncaught frozen object - if (!isExtensible(it)) return true; - // not necessary to add metadata - if (!create) return false; - // add missing metadata - setMeta(it); - // return hash weak collections IDs - } return it[META].w; -}; -// add metadata on freeze-family methods calling -var onFreeze = function (it) { - if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); - return it; -}; -var meta = module.exports = { - KEY: META, - NEED: false, - fastKey: fastKey, - getWeak: getWeak, - onFreeze: onFreeze -}; - - -/***/ }), -/* 138 */ -/***/ (function(module, exports) { - - - -/***/ }), -/* 139 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = capitalizeString; -function capitalizeString(str) { - return str.charAt(0).toUpperCase() + str.slice(1); -} -module.exports = exports["default"]; - -/***/ }), -/* 140 */, -/* 141 */, -/* 142 */, -/* 143 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(43), - _assign = __webpack_require__(7); - -var ReactNoopUpdateQueue = __webpack_require__(144); - -var canDefineProperty = __webpack_require__(71); -var emptyObject = __webpack_require__(72); -var invariant = __webpack_require__(1); -var lowPriorityWarning = __webpack_require__(95); - -/** - * Base class helpers for the updating state of a component. - */ -function ReactComponent(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the - // renderer. - this.updater = updater || ReactNoopUpdateQueue; -} - -ReactComponent.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 - */ -ReactComponent.prototype.setState = function (partialState, callback) { - !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? true ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0; - this.updater.enqueueSetState(this, partialState); - if (callback) { - this.updater.enqueueCallback(this, 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 - */ -ReactComponent.prototype.forceUpdate = function (callback) { - this.updater.enqueueForceUpdate(this); - if (callback) { - this.updater.enqueueCallback(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. - */ -if (true) { - 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) { - if (canDefineProperty) { - Object.defineProperty(ReactComponent.prototype, methodName, { - get: function () { - lowPriorityWarning(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]); - } - } -} - -/** - * Base class helpers for the updating state of a component. - */ -function ReactPureComponent(props, context, updater) { - // Duplicated from ReactComponent. - this.props = props; - this.context = context; - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the - // renderer. - this.updater = updater || ReactNoopUpdateQueue; -} - -function ComponentDummy() {} -ComponentDummy.prototype = ReactComponent.prototype; -ReactPureComponent.prototype = new ComponentDummy(); -ReactPureComponent.prototype.constructor = ReactPureComponent; -// Avoid an extra prototype jump for these methods. -_assign(ReactPureComponent.prototype, ReactComponent.prototype); -ReactPureComponent.prototype.isPureReactComponent = true; - -module.exports = { - Component: ReactComponent, - PureComponent: ReactPureComponent -}; - -/***/ }), -/* 144 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var warning = __webpack_require__(2); - -function warnNoop(publicInstance, callerName) { - if (true) { - var constructor = publicInstance.constructor; - true ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; - } -} - -/** - * 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; - }, - - /** - * Enqueue a callback that will be executed after all the pending updates - * have processed. - * - * @param {ReactClass} publicInstance The instance to use as `this` context. - * @param {?function} callback Called after state is updated. - * @internal - */ - enqueueCallback: function (publicInstance, callback) {}, - - /** - * 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. - * @internal - */ - enqueueForceUpdate: function (publicInstance) { - 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. - * @internal - */ - enqueueReplaceState: function (publicInstance, completeState) { - 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. - * @internal - */ - enqueueSetState: function (publicInstance, partialState) { - warnNoop(publicInstance, 'setState'); - } -}; - -module.exports = ReactNoopUpdateQueue; - -/***/ }), -/* 145 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -// The Symbol used to tag the ReactElement type. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. - -var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; - -module.exports = REACT_ELEMENT_TYPE; - -/***/ }), -/* 146 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -/* global Symbol */ - -var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - -/** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ -function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } -} - -module.exports = getIteratorFn; - -/***/ }), -/* 147 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -/** - * 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 ReactCurrentOwner = __webpack_require__(23); -var ReactComponentTreeHook = __webpack_require__(17); -var ReactElement = __webpack_require__(36); - -var checkReactTypeSpec = __webpack_require__(255); - -var canDefineProperty = __webpack_require__(71); -var getIteratorFn = __webpack_require__(146); -var warning = __webpack_require__(2); -var lowPriorityWarning = __webpack_require__(95); - -function getDeclarationErrorAddendum() { - if (ReactCurrentOwner.current) { - var name = ReactCurrentOwner.current.getName(); - if (name) { - return ' Check 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 ' Check 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 = ' Check 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 memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {}); - - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - if (memoizer[currentComponentErrorInfo]) { - return; - } - memoizer[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 ' + element._owner.getName() + '.'; - } - - true ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0; -} - -/** - * 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 (ReactElement.isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (ReactElement.isValidElement(node)) { - // This element was passed in a valid location. - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - // Entry iterators provide implicit keys. - if (iteratorFn) { - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - while (!(step = iterator.next()).done) { - if (ReactElement.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 componentClass = element.type; - if (typeof componentClass !== 'function') { - return; - } - var name = componentClass.displayName || componentClass.name; - if (componentClass.propTypes) { - checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null); - } - if (typeof componentClass.getDefaultProps === 'function') { - true ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; - } -} - -var ReactElementValidator = { - createElement: function (type, props, children) { - var validType = typeof type === 'string' || typeof type === 'function'; - // 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) { - if (typeof type !== 'function' && typeof type !== 'string') { - 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."; - } - - var sourceInfo = getSourceInfoErrorAddendum(props); - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - - info += ReactComponentTreeHook.getCurrentStackAddendum(); - - var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null; - ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource); - true ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; - ReactComponentTreeHook.popNonStandardWarningStack(); - } - } - - var element = ReactElement.createElement.apply(this, arguments); - - // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. - if (element == null) { - return element; - } - - // 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); - } - } - - validatePropTypes(element); - - return element; - }, - - createFactory: function (type) { - var validatedFactory = ReactElementValidator.createElement.bind(null, type); - // Legacy hook TODO: Warn if this is accessed - validatedFactory.type = type; - - if (true) { - if (canDefineProperty) { - Object.defineProperty(validatedFactory, 'type', { - enumerable: false, - get: function () { - lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); - Object.defineProperty(this, 'type', { - value: type - }); - return type; - } - }); - } - } - - return validatedFactory; - }, - - cloneElement: function (element, props, children) { - var newElement = ReactElement.cloneElement.apply(this, arguments); - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], newElement.type); - } - validatePropTypes(newElement); - return newElement; - } -}; - -module.exports = ReactElementValidator; - -/***/ }), -/* 148 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -// React 15.5 references this module, and assumes PropTypes are still callable in production. -// Therefore we re-export development-only version with all the PropTypes checks here. -// However if one is migrating to the `prop-types` npm library, they will go through the -// `index.js` entry point, and it will branch depending on the environment. -var factory = __webpack_require__(149); -module.exports = function(isValidElement) { - // It is still allowed in 15.5. - var throwOnDirectAccess = false; - return factory(isValidElement, throwOnDirectAccess); -}; - - -/***/ }), -/* 149 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var emptyFunction = __webpack_require__(20); -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); -var assign = __webpack_require__(7); - -var ReactPropTypesSecret = __webpack_require__(150); -var checkPropTypes = __webpack_require__(259); - -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } - - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - - var ANONYMOUS = '<<anonymous>>'; - - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker, - exact: createStrictShapeTypeChecker, - }; - - /** - * 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 - */ - /*eslint-disable no-self-compare*/ - function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } - } - /*eslint-enable no-self-compare*/ - - /** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However, we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ - function PropTypeError(message) { - this.message = message; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; - - function createChainableTypeChecker(validate) { - if (true) { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - // New behavior only for users of `prop-types` package - invariant( - false, - 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + - 'Use `PropTypes.checkPropTypes()` to call them. ' + - 'Read more at http://fb.me/use-check-prop-types' - ); - } else if ("development" !== 'production' && typeof console !== 'undefined') { - // Old behavior for people using React.PropTypes - var cacheKey = componentName + ':' + propName; - if ( - !manualPropTypeCallCache[cacheKey] && - // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3 - ) { - warning( - false, - 'You are manually calling a React.PropTypes validation ' + - 'function for the `%s` prop on `%s`. This is deprecated ' + - 'and will throw in the standalone `prop-types` package. ' + - 'You may be seeing this warning due to a third-party PropTypes ' + - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', - propFullName, - componentName - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props[propName] == null) { - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; - } - - function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturnsNull); - } - - function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - true ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); - } - - function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - true ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== 'function') { - warning( - false, - 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + - 'received %s at index %s.', - getPostfixForTypeWarning(checker), - i - ); - return emptyFunction.thatReturnsNull; - } - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - return createChainableTypeChecker(validate); - } - - function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createStrictShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - // We need to check all keys in case some are required but missing from - // props. - var allKeys = assign({}, props[propName], shapeTypes); - for (var key in allKeys) { - var checker = shapeTypes[key]; - if (!checker) { - return new PropTypeError( - 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + - '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + - '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') - ); - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - - return createChainableTypeChecker(validate); - } - - function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || isValidElement(propValue)) { - return true; - } - - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - - return true; - default: - return false; - } - } - - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; - } - - // Equivalent of `typeof` but with special handling for array and regexp. - function getPropType(propValue) { - var propType = typeof propValue; - if (Array.isArray(propValue)) { - return 'array'; - } - if (propValue instanceof RegExp) { - // Old webkits (at least until Android 4.0) return 'function' rather than - // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ - // passes PropTypes.object. - return 'object'; - } - if (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; - } - - // This handles more types than `getPropType`. Only used for error messages. - // See `createPrimitiveTypeChecker`. - function getPreciseType(propValue) { - if (typeof propValue === 'undefined' || propValue === null) { - return '' + propValue; - } - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; - } - - // Returns a string that is postfixed to a warning about an invalid type. - // For example, "undefined" or "of type array" - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case 'array': - case 'object': - return 'an ' + type; - case 'boolean': - case 'date': - case 'regexp': - return 'a ' + type; - default: - return type; - } - } - - // Returns class name of the object, if any. - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; - } - - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - - -/***/ }), -/* 151 */ -/***/ (function(module, exports, __webpack_require__) { - -var has = __webpack_require__(37); -var toIObject = __webpack_require__(46); -var arrayIndexOf = __webpack_require__(266)(false); -var IE_PROTO = __webpack_require__(98)('IE_PROTO'); - -module.exports = function (object, names) { - var O = toIObject(object); - var i = 0; - var result = []; - var key; - for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); - // Don't enum bug & hidden keys - while (names.length > i) if (has(O, key = names[i++])) { - ~arrayIndexOf(result, key) || result.push(key); - } - return result; -}; - - -/***/ }), -/* 152 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = !__webpack_require__(27) && !__webpack_require__(41)(function () { - return Object.defineProperty(__webpack_require__(101)('div'), 'a', { get: function () { return 7; } }).a != 7; -}); - - -/***/ }), -/* 153 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(268), __esModule: true }; - -/***/ }), -/* 154 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(35); - - -/***/ }), -/* 155 */ -/***/ (function(module, exports, __webpack_require__) { - -var document = __webpack_require__(16).document; -module.exports = document && document.documentElement; - - -/***/ }), -/* 156 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(37); -var toObject = __webpack_require__(53); -var IE_PROTO = __webpack_require__(98)('IE_PROTO'); -var ObjectProto = Object.prototype; - -module.exports = Object.getPrototypeOf || function (O) { - O = toObject(O); - if (has(O, IE_PROTO)) return O[IE_PROTO]; - if (typeof O.constructor == 'function' && O instanceof O.constructor) { - return O.constructor.prototype; - } return O instanceof Object ? ObjectProto : null; -}; - - -/***/ }), -/* 157 */ -/***/ (function(module, exports, __webpack_require__) { - -// call something on iterator step with safe closing on error -var anObject = __webpack_require__(25); -module.exports = function (iterator, fn, value, entries) { - try { - return entries ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch (e) { - var ret = iterator['return']; - if (ret !== undefined) anObject(ret.call(iterator)); - throw e; - } -}; - - -/***/ }), -/* 158 */ -/***/ (function(module, exports, __webpack_require__) { - -// check on default Array iterator -var Iterators = __webpack_require__(48); -var ITERATOR = __webpack_require__(14)('iterator'); -var ArrayProto = Array.prototype; - -module.exports = function (it) { - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; - - -/***/ }), -/* 159 */ -/***/ (function(module, exports, __webpack_require__) { - -var ITERATOR = __webpack_require__(14)('iterator'); -var SAFE_CLOSING = false; - -try { - var riter = [7][ITERATOR](); - riter['return'] = function () { SAFE_CLOSING = true; }; - // eslint-disable-next-line no-throw-literal - Array.from(riter, function () { throw 2; }); -} catch (e) { /* empty */ } - -module.exports = function (exec, skipClosing) { - if (!skipClosing && !SAFE_CLOSING) return false; - var safe = false; - try { - var arr = [7]; - var iter = arr[ITERATOR](); - iter.next = function () { return { done: safe = true }; }; - arr[ITERATOR] = function () { return iter; }; - exec(arr); - } catch (e) { /* empty */ } - return safe; -}; - - -/***/ }), -/* 160 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) -var $keys = __webpack_require__(151); -var hiddenKeys = __webpack_require__(100).concat('length', 'prototype'); - -exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return $keys(O, hiddenKeys); -}; - - -/***/ }), -/* 161 */ -/***/ (function(module, exports, __webpack_require__) { - -var pIE = __webpack_require__(75); -var createDesc = __webpack_require__(58); -var toIObject = __webpack_require__(46); -var toPrimitive = __webpack_require__(102); -var has = __webpack_require__(37); -var IE8_DOM_DEFINE = __webpack_require__(152); -var gOPD = Object.getOwnPropertyDescriptor; - -exports.f = __webpack_require__(27) ? gOPD : function getOwnPropertyDescriptor(O, P) { - O = toIObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) try { - return gOPD(O, P); - } catch (e) { /* empty */ } - if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); -}; - - -/***/ }), -/* 162 */ -/***/ (function(module, exports, __webpack_require__) { - -var pSlice = Array.prototype.slice; -var objectKeys = __webpack_require__(296); -var isArguments = __webpack_require__(297); - -var deepEqual = module.exports = function (actual, expected, opts) { - if (!opts) opts = {}; - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - - } else if (actual instanceof Date && expected instanceof Date) { - return actual.getTime() === expected.getTime(); - - // 7.3. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { - return opts.strict ? actual === expected : actual == expected; - - // 7.4. For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else { - return objEquiv(actual, expected, opts); - } -} - -function isUndefinedOrNull(value) { - return value === null || value === undefined; -} - -function isBuffer (x) { - if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; - if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { - return false; - } - if (x.length > 0 && typeof x[0] !== 'number') return false; - return true; -} - -function objEquiv(a, b, opts) { - var i, key; - if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) - return false; - // an identical 'prototype' property. - if (a.prototype !== b.prototype) return false; - //~~~I've managed to break Object.keys through screwy arguments passing. - // Converting to array solves the problem. - if (isArguments(a)) { - if (!isArguments(b)) { - return false; - } - a = pSlice.call(a); - b = pSlice.call(b); - return deepEqual(a, b, opts); - } - if (isBuffer(a)) { - if (!isBuffer(b)) { - return false; - } - if (a.length !== b.length) return false; - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) return false; - } - return true; - } - try { - var ka = objectKeys(a), - kb = objectKeys(b); - } catch (e) {//happens when one is a string literal and the other isn't - return false; - } - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length != kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!deepEqual(a[key], b[key], opts)) return false; - } - return typeof a === typeof b; -} - - -/***/ }), -/* 163 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.chromeLight = exports.chromeDark = undefined; - -var _chromeDark2 = __webpack_require__(303); - -var _chromeDark3 = _interopRequireDefault(_chromeDark2); - -var _chromeLight2 = __webpack_require__(304); - -var _chromeLight3 = _interopRequireDefault(_chromeLight2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.chromeDark = _chromeDark3.default; -exports.chromeLight = _chromeLight3.default; - -/***/ }), -/* 164 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(306); - - -/***/ }), -/* 165 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _isIterable2 = __webpack_require__(308); - -var _isIterable3 = _interopRequireDefault(_isIterable2); - -var _getIterator2 = __webpack_require__(225); - -var _getIterator3 = _interopRequireDefault(_getIterator2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if ((0, _isIterable3.default)(Object(arr))) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; -}(); - -/***/ }), -/* 166 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(49); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _defineProperty2 = __webpack_require__(226); - -var _defineProperty3 = _interopRequireDefault(_defineProperty2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _TreeNode = __webpack_require__(313); - -var _TreeNode2 = _interopRequireDefault(_TreeNode); - -var _pathUtils = __webpack_require__(316); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var reducer = function reducer(state, action) { - switch (action.type) { - case 'TOGGLE_EXPAND': - { - var path = action.path; - var expandedPaths = state.expandedPaths; - var expanded = !!expandedPaths[path]; - - return Object.assign({}, state, { - expandedPaths: Object.assign({}, state.expandedPaths, (0, _defineProperty3.default)({}, path, !expanded)) - }); - } - default: - return state; - } -}; - -var ConnectedTreeNode = function (_Component) { - (0, _inherits3.default)(ConnectedTreeNode, _Component); - - function ConnectedTreeNode(props, context) { - (0, _classCallCheck3.default)(this, ConnectedTreeNode); - - var _this = (0, _possibleConstructorReturn3.default)(this, (ConnectedTreeNode.__proto__ || Object.getPrototypeOf(ConnectedTreeNode)).call(this, props)); - - _this.state = context.store.storeState; - return _this; - } - - (0, _createClass3.default)(ConnectedTreeNode, [{ - key: 'shouldComponentUpdate', - value: function shouldComponentUpdate(nextProps, nextState) { - return !!nextState.expandedPaths[nextProps.path] !== !!this.state.expandedPaths[this.props.path] || nextProps.data !== this.props.data || nextProps.name !== this.props.name; - } - }, { - key: 'handleClick', - value: function handleClick(path) { - this.context.store.storeState = reducer(this.context.store.storeState, { - type: 'TOGGLE_EXPAND', - path: path - }); - this.setState(this.context.store.storeState); - } - }, { - key: 'renderChildNodes', - value: function renderChildNodes(parentData, parentPath) { - var dataIterator = this.props.dataIterator; - var depth = this.props.depth; - var nodeRenderer = this.props.nodeRenderer; - - - var childNodes = []; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = dataIterator(parentData)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _ref2 = _step.value; - var name = _ref2.name, - data = _ref2.data, - props = (0, _objectWithoutProperties3.default)(_ref2, ['name', 'data']); - - var key = name; - var path = parentPath + '.' + key; - childNodes.push(_react2.default.createElement(ConnectedTreeNode, (0, _extends3.default)({ - name: name, - data: data, - depth: depth + 1, - path: path, - key: key, - dataIterator: dataIterator, - nodeRenderer: nodeRenderer - }, props)) // props for nodeRenderer - ); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return childNodes; - } - }, { - key: 'render', - value: function render() { - var _props = this.props, - data = _props.data, - dataIterator = _props.dataIterator, - path = _props.path, - depth = _props.depth; - - - var nodeHasChildNodes = (0, _pathUtils.hasChildNodes)(data, dataIterator); - var expandedPaths = this.state.expandedPaths; - - var expanded = !!expandedPaths[path]; - - var nodeRenderer = this.props.nodeRenderer; - - - return _react2.default.createElement( - _TreeNode2.default, - (0, _extends3.default)({ - expanded: expanded, - onClick: nodeHasChildNodes ? this.handleClick.bind(this, path) : function () {} - // show arrow anyway even if not expanded and not rendering children - , shouldShowArrow: nodeHasChildNodes - // show placeholder only for non root nodes - , shouldShowPlaceholder: depth > 0 - // Render a node from name and data (or possibly other props like isNonenumerable) - , nodeRenderer: nodeRenderer - }, this.props), - // only render if the node is expanded - expanded ? this.renderChildNodes(data, path) : undefined - ); - } - }]); - return ConnectedTreeNode; -}(_react.Component); - -ConnectedTreeNode.propTypes = { - name: _propTypes2.default.string, - data: _propTypes2.default.any, - dataIterator: _propTypes2.default.func, - - depth: _propTypes2.default.number, - expanded: _propTypes2.default.bool, - - nodeRenderer: _propTypes2.default.func -}; - -ConnectedTreeNode.contextTypes = { - store: _propTypes2.default.any -}; - -var TreeView = function (_Component2) { - (0, _inherits3.default)(TreeView, _Component2); - - function TreeView(props) { - (0, _classCallCheck3.default)(this, TreeView); - - var _this2 = (0, _possibleConstructorReturn3.default)(this, (TreeView.__proto__ || Object.getPrototypeOf(TreeView)).call(this, props)); - - _this2.store = { - storeState: { - expandedPaths: (0, _pathUtils.getExpandedPaths)(props.data, props.dataIterator, props.expandPaths, props.expandLevel) - } - }; - return _this2; - } - - (0, _createClass3.default)(TreeView, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - this.store = { - storeState: { - expandedPaths: (0, _pathUtils.getExpandedPaths)(nextProps.data, nextProps.dataIterator, nextProps.expandPaths, nextProps.expandLevel, this.store.storeState.expandedPaths) - } - }; - } - }, { - key: 'getChildContext', - value: function getChildContext() { - return { - store: this.store - }; - } - }, { - key: 'render', - value: function render() { - var _props2 = this.props, - name = _props2.name, - data = _props2.data, - dataIterator = _props2.dataIterator; - var nodeRenderer = this.props.nodeRenderer; - - - var rootPath = _pathUtils.DEFAULT_ROOT_PATH; - - return _react2.default.createElement(ConnectedTreeNode, { - name: name, - data: data, - dataIterator: dataIterator, - depth: 0, - path: rootPath, - nodeRenderer: nodeRenderer - }); - } - }]); - return TreeView; -}(_react.Component); - -TreeView.defaultProps = { - expandLevel: 0, - expandPaths: [] -}; -TreeView.childContextTypes = { - store: _propTypes2.default.any -}; - - -TreeView.propTypes = { - name: _propTypes2.default.string, - data: _propTypes2.default.any, - dataIterator: _propTypes2.default.func, - - nodeRenderer: _propTypes2.default.func -}; - -TreeView.defaultProps = { - name: undefined -}; - -exports.default = TreeView; - -/***/ }), -/* 167 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _ObjectName = __webpack_require__(76); - -var _ObjectName2 = _interopRequireDefault(_ObjectName); - -var _ObjectPreview = __webpack_require__(317); - -var _ObjectPreview2 = _interopRequireDefault(_ObjectPreview); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ObjectRootLabel = function ObjectRootLabel(_ref) { - var name = _ref.name, - data = _ref.data; - - if (typeof name === 'string') { - return _react2.default.createElement( - 'span', - null, - _react2.default.createElement(_ObjectName2.default, { name: name }), - _react2.default.createElement( - 'span', - null, - ': ' - ), - _react2.default.createElement(_ObjectPreview2.default, { data: data }) - ); - } else { - return _react2.default.createElement(_ObjectPreview2.default, { data: data }); - } -}; - -exports.default = ObjectRootLabel; - -/***/ }), -/* 168 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _ObjectName = __webpack_require__(76); - -var _ObjectName2 = _interopRequireDefault(_ObjectName); - -var _ObjectValue = __webpack_require__(77); - -var _ObjectValue2 = _interopRequireDefault(_ObjectValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * if isNonenumerable is specified, render the name dimmed - */ -var ObjectLabel = function ObjectLabel(_ref) { - var name = _ref.name, - data = _ref.data, - isNonenumerable = _ref.isNonenumerable; - - var object = data; - - return _react2.default.createElement( - 'span', - null, - _react2.default.createElement(_ObjectName2.default, { name: name, dimmed: isNonenumerable }), - _react2.default.createElement( - 'span', - null, - ': ' - ), - _react2.default.createElement(_ObjectValue2.default, { object: object }) - ); -}; - -ObjectLabel.propTypes = { - /** Non enumerable object property will be dimmed */ - isNonenumerable: _propTypes2.default.bool -}; - -ObjectLabel.defaultProps = { - isNonenumerable: false -}; - -exports.default = ObjectLabel; - -/***/ }), -/* 169 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var TEXT_NODE_MAX_INLINE_CHARS = 80; - -var shouldInline = function shouldInline(data) { - return data.childNodes.length === 0 || data.childNodes.length === 1 && data.childNodes[0].nodeType === Node.TEXT_NODE && data.textContent.length < TEXT_NODE_MAX_INLINE_CHARS; -}; - -exports.default = shouldInline; - -/***/ }), -/* 170 */ -/***/ (function(module, exports) { - -exports = module.exports = stringify -exports.getSerialize = serializer - -function stringify(obj, replacer, spaces, cycleReplacer) { - return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) -} - -function serializer(replacer, cycleReplacer) { - var stack = [], keys = [] - - if (cycleReplacer == null) cycleReplacer = function(key, value) { - if (stack[0] === value) return "[Circular ~]" - return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" - } - - return function(key, value) { - if (stack.length > 0) { - var thisPos = stack.indexOf(this) - ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) - ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) - if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) - } - else stack.push(value) - - return replacer == null ? value : replacer.call(this, key, value) - } -} - - -/***/ }), -/* 171 */ -/***/ (function(module, exports) { - -module.exports = typeof function foo() {}.name === 'string'; // when function names are minified, checking for "foo" would break - - -/***/ }), -/* 172 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var has = __webpack_require__(59); -var toPrimitive = __webpack_require__(352); - -var toStr = Object.prototype.toString; -var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; - -var $isNaN = __webpack_require__(174); -var $isFinite = __webpack_require__(175); -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; - -var assign = __webpack_require__(176); -var sign = __webpack_require__(177); -var mod = __webpack_require__(178); -var isPrimitive = __webpack_require__(355); -var parseInteger = parseInt; -var bind = __webpack_require__(32); -var arraySlice = bind.call(Function.call, Array.prototype.slice); -var strSlice = bind.call(Function.call, String.prototype.slice); -var isBinary = bind.call(Function.call, RegExp.prototype.test, /^0b[01]+$/i); -var isOctal = bind.call(Function.call, RegExp.prototype.test, /^0o[0-7]+$/i); -var regexExec = bind.call(Function.call, RegExp.prototype.exec); -var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); -var nonWSregex = new RegExp('[' + nonWS + ']', 'g'); -var hasNonWS = bind.call(Function.call, RegExp.prototype.test, nonWSregex); -var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i; -var isInvalidHexLiteral = bind.call(Function.call, RegExp.prototype.test, invalidHexLiteral); - -// whitespace from: http://es5.github.io/#x15.5.4.20 -// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 -var ws = [ - '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', - '\u2029\uFEFF' -].join(''); -var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); -var replace = bind.call(Function.call, String.prototype.replace); -var trim = function (value) { - return replace(value, trimRegex, ''); -}; - -var ES5 = __webpack_require__(356); - -var hasRegExpMatcher = __webpack_require__(358); - -// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations -var ES6 = assign(assign({}, ES5), { - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args - Call: function Call(F, V) { - var args = arguments.length > 2 ? arguments[2] : []; - if (!this.IsCallable(F)) { - throw new TypeError(F + ' is not a function'); - } - return F.apply(V, args); - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive - ToPrimitive: toPrimitive, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean - // ToBoolean: ES5.ToBoolean, - - // http://www.ecma-international.org/ecma-262/6.0/#sec-tonumber - ToNumber: function ToNumber(argument) { - var value = isPrimitive(argument) ? argument : toPrimitive(argument, Number); - if (typeof value === 'symbol') { - throw new TypeError('Cannot convert a Symbol value to a number'); - } - if (typeof value === 'string') { - if (isBinary(value)) { - return this.ToNumber(parseInteger(strSlice(value, 2), 2)); - } else if (isOctal(value)) { - return this.ToNumber(parseInteger(strSlice(value, 2), 8)); - } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { - return NaN; - } else { - var trimmed = trim(value); - if (trimmed !== value) { - return this.ToNumber(trimmed); - } - } - } - return Number(value); - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger - // ToInteger: ES5.ToNumber, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32 - // ToInt32: ES5.ToInt32, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32 - // ToUint32: ES5.ToUint32, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16 - ToInt16: function ToInt16(argument) { - var int16bit = this.ToUint16(argument); - return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16 - // ToUint16: ES5.ToUint16, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8 - ToInt8: function ToInt8(argument) { - var int8bit = this.ToUint8(argument); - return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8 - ToUint8: function ToUint8(argument) { - var number = this.ToNumber(argument); - if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } - var posInt = sign(number) * Math.floor(Math.abs(number)); - return mod(posInt, 0x100); - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp - ToUint8Clamp: function ToUint8Clamp(argument) { - var number = this.ToNumber(argument); - if ($isNaN(number) || number <= 0) { return 0; } - if (number >= 0xFF) { return 0xFF; } - var f = Math.floor(argument); - if (f + 0.5 < number) { return f + 1; } - if (number < f + 0.5) { return f; } - if (f % 2 !== 0) { return f + 1; } - return f; - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring - ToString: function ToString(argument) { - if (typeof argument === 'symbol') { - throw new TypeError('Cannot convert a Symbol value to a string'); - } - return String(argument); - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject - ToObject: function ToObject(value) { - this.RequireObjectCoercible(value); - return Object(value); - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey - ToPropertyKey: function ToPropertyKey(argument) { - var key = this.ToPrimitive(argument, String); - return typeof key === 'symbol' ? key : this.ToString(key); - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - ToLength: function ToLength(argument) { - var len = this.ToInteger(argument); - if (len <= 0) { return 0; } // includes converting -0 to +0 - if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } - return len; - }, - - // http://www.ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring - CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) { - if (toStr.call(argument) !== '[object String]') { - throw new TypeError('must be a string'); - } - if (argument === '-0') { return -0; } - var n = this.ToNumber(argument); - if (this.SameValue(this.ToString(n), argument)) { return n; } - return void 0; - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible - RequireObjectCoercible: ES5.CheckObjectCoercible, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray - IsArray: Array.isArray || function IsArray(argument) { - return toStr.call(argument) === '[object Array]'; - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable - // IsCallable: ES5.IsCallable, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor - IsConstructor: function IsConstructor(argument) { - return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument` - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o - IsExtensible: function IsExtensible(obj) { - if (!Object.preventExtensions) { return true; } - if (isPrimitive(obj)) { - return false; - } - return Object.isExtensible(obj); - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger - IsInteger: function IsInteger(argument) { - if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { - return false; - } - var abs = Math.abs(argument); - return Math.floor(abs) === abs; - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey - IsPropertyKey: function IsPropertyKey(argument) { - return typeof argument === 'string' || typeof argument === 'symbol'; - }, - - // http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp - IsRegExp: function IsRegExp(argument) { - if (!argument || typeof argument !== 'object') { - return false; - } - if (hasSymbols) { - var isRegExp = argument[Symbol.match]; - if (typeof isRegExp !== 'undefined') { - return ES5.ToBoolean(isRegExp); - } - } - return hasRegExpMatcher(argument); - }, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue - // SameValue: ES5.SameValue, - - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero - SameValueZero: function SameValueZero(x, y) { - return (x === y) || ($isNaN(x) && $isNaN(y)); - }, - - /** - * 7.3.2 GetV (V, P) - * 1. Assert: IsPropertyKey(P) is true. - * 2. Let O be ToObject(V). - * 3. ReturnIfAbrupt(O). - * 4. Return O.[[Get]](P, V). - */ - GetV: function GetV(V, P) { - // 7.3.2.1 - if (!this.IsPropertyKey(P)) { - throw new TypeError('Assertion failed: IsPropertyKey(P) is not true'); - } - - // 7.3.2.2-3 - var O = this.ToObject(V); - - // 7.3.2.4 - return O[P]; - }, - - /** - * 7.3.9 - http://www.ecma-international.org/ecma-262/6.0/#sec-getmethod - * 1. Assert: IsPropertyKey(P) is true. - * 2. Let func be GetV(O, P). - * 3. ReturnIfAbrupt(func). - * 4. If func is either undefined or null, return undefined. - * 5. If IsCallable(func) is false, throw a TypeError exception. - * 6. Return func. - */ - GetMethod: function GetMethod(O, P) { - // 7.3.9.1 - if (!this.IsPropertyKey(P)) { - throw new TypeError('Assertion failed: IsPropertyKey(P) is not true'); - } - - // 7.3.9.2 - var func = this.GetV(O, P); - - // 7.3.9.4 - if (func == null) { - return void 0; - } - - // 7.3.9.5 - if (!this.IsCallable(func)) { - throw new TypeError(P + 'is not a function'); - } - - // 7.3.9.6 - return func; - }, - - /** - * 7.3.1 Get (O, P) - http://www.ecma-international.org/ecma-262/6.0/#sec-get-o-p - * 1. Assert: Type(O) is Object. - * 2. Assert: IsPropertyKey(P) is true. - * 3. Return O.[[Get]](P, O). - */ - Get: function Get(O, P) { - // 7.3.1.1 - if (this.Type(O) !== 'Object') { - throw new TypeError('Assertion failed: Type(O) is not Object'); - } - // 7.3.1.2 - if (!this.IsPropertyKey(P)) { - throw new TypeError('Assertion failed: IsPropertyKey(P) is not true'); - } - // 7.3.1.3 - return O[P]; - }, - - Type: function Type(x) { - if (typeof x === 'symbol') { - return 'Symbol'; - } - return ES5.Type(x); - }, - - // http://www.ecma-international.org/ecma-262/6.0/#sec-speciesconstructor - SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) { - if (this.Type(O) !== 'Object') { - throw new TypeError('Assertion failed: Type(O) is not Object'); - } - var C = O.constructor; - if (typeof C === 'undefined') { - return defaultConstructor; - } - if (this.Type(C) !== 'Object') { - throw new TypeError('O.constructor is not an Object'); - } - var S = hasSymbols && Symbol.species ? C[Symbol.species] : void 0; - if (S == null) { - return defaultConstructor; - } - if (this.IsConstructor(S)) { - return S; - } - throw new TypeError('no constructor found'); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor - CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) { - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { - if (!has(Desc, '[[Value]]')) { - Desc['[[Value]]'] = void 0; - } - if (!has(Desc, '[[Writable]]')) { - Desc['[[Writable]]'] = false; - } - } else { - if (!has(Desc, '[[Get]]')) { - Desc['[[Get]]'] = void 0; - } - if (!has(Desc, '[[Set]]')) { - Desc['[[Set]]'] = void 0; - } - } - if (!has(Desc, '[[Enumerable]]')) { - Desc['[[Enumerable]]'] = false; - } - if (!has(Desc, '[[Configurable]]')) { - Desc['[[Configurable]]'] = false; - } - return Desc; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw - Set: function Set(O, P, V, Throw) { - if (this.Type(O) !== 'Object') { - throw new TypeError('O must be an Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('P must be a Property Key'); - } - if (this.Type(Throw) !== 'Boolean') { - throw new TypeError('Throw must be a Boolean'); - } - if (Throw) { - O[P] = V; - return true; - } else { - try { - O[P] = V; - } catch (e) { - return false; - } - } - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-hasownproperty - HasOwnProperty: function HasOwnProperty(O, P) { - if (this.Type(O) !== 'Object') { - throw new TypeError('O must be an Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('P must be a Property Key'); - } - return has(O, P); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-hasproperty - HasProperty: function HasProperty(O, P) { - if (this.Type(O) !== 'Object') { - throw new TypeError('O must be an Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('P must be a Property Key'); - } - return P in O; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable - IsConcatSpreadable: function IsConcatSpreadable(O) { - if (this.Type(O) !== 'Object') { - return false; - } - if (hasSymbols && typeof Symbol.isConcatSpreadable === 'symbol') { - var spreadable = this.Get(O, Symbol.isConcatSpreadable); - if (typeof spreadable !== 'undefined') { - return this.ToBoolean(spreadable); - } - } - return this.IsArray(O); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-invoke - Invoke: function Invoke(O, P) { - if (!this.IsPropertyKey(P)) { - throw new TypeError('P must be a Property Key'); - } - var argumentsList = arraySlice(arguments, 2); - var func = this.GetV(O, P); - return this.Call(func, O, argumentsList); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject - CreateIterResultObject: function CreateIterResultObject(value, done) { - if (this.Type(done) !== 'Boolean') { - throw new TypeError('Assertion failed: Type(done) is not Boolean'); - } - return { - value: value, - done: done - }; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-regexpexec - RegExpExec: function RegExpExec(R, S) { - if (this.Type(R) !== 'Object') { - throw new TypeError('R must be an Object'); - } - if (this.Type(S) !== 'String') { - throw new TypeError('S must be a String'); - } - var exec = this.Get(R, 'exec'); - if (this.IsCallable(exec)) { - var result = this.Call(exec, R, [S]); - if (result === null || this.Type(result) === 'Object') { - return result; - } - throw new TypeError('"exec" method must return `null` or an Object'); - } - return regexExec(R, S); - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate - ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) { - if (!this.IsInteger(length) || length < 0) { - throw new TypeError('Assertion failed: length must be an integer >= 0'); - } - var len = length === 0 ? 0 : length; - var C; - var isArray = this.IsArray(originalArray); - if (isArray) { - C = this.Get(originalArray, 'constructor'); - // TODO: figure out how to make a cross-realm normal Array, a same-realm Array - // if (this.IsConstructor(C)) { - // if C is another realm's Array, C = undefined - // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? - // } - if (this.Type(C) === 'Object' && hasSymbols && Symbol.species) { - C = this.Get(C, Symbol.species); - if (C === null) { - C = void 0; - } - } - } - if (typeof C === 'undefined') { - return Array(len); - } - if (!this.IsConstructor(C)) { - throw new TypeError('C must be a constructor'); - } - return new C(len); // this.Construct(C, len); - }, - - CreateDataProperty: function CreateDataProperty(O, P, V) { - if (this.Type(O) !== 'Object') { - throw new TypeError('Assertion failed: Type(O) is not Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('Assertion failed: IsPropertyKey(P) is not true'); - } - var oldDesc = Object.getOwnPropertyDescriptor(O, P); - var extensible = oldDesc || (typeof Object.isExtensible !== 'function' || Object.isExtensible(O)); - var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable); - if (immutable || !extensible) { - return false; - } - var newDesc = { - configurable: true, - enumerable: true, - value: V, - writable: true - }; - Object.defineProperty(O, P, newDesc); - return true; - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow - CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) { - if (this.Type(O) !== 'Object') { - throw new TypeError('Assertion failed: Type(O) is not Object'); - } - if (!this.IsPropertyKey(P)) { - throw new TypeError('Assertion failed: IsPropertyKey(P) is not true'); - } - var success = this.CreateDataProperty(O, P, V); - if (!success) { - throw new TypeError('unable to create data property'); - } - return success; - } -}); - -delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible - -module.exports = ES6; - - -/***/ }), -/* 173 */ -/***/ (function(module, exports) { - -module.exports = function isPrimitive(value) { - return value === null || (typeof value !== 'function' && typeof value !== 'object'); -}; - - -/***/ }), -/* 174 */ -/***/ (function(module, exports) { - -module.exports = Number.isNaN || function isNaN(a) { - return a !== a; -}; - - -/***/ }), -/* 175 */ -/***/ (function(module, exports) { - -var $isNaN = Number.isNaN || function (a) { return a !== a; }; - -module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; - - -/***/ }), -/* 176 */ -/***/ (function(module, exports) { - -var has = Object.prototype.hasOwnProperty; -module.exports = function assign(target, source) { - if (Object.assign) { - return Object.assign(target, source); - } - for (var key in source) { - if (has.call(source, key)) { - target[key] = source[key]; - } - } - return target; -}; - - -/***/ }), -/* 177 */ -/***/ (function(module, exports) { - -module.exports = function sign(number) { - return number >= 0 ? 1 : -1; -}; - - -/***/ }), -/* 178 */ -/***/ (function(module, exports) { - -module.exports = function mod(number, modulo) { - var remain = number % modulo; - return Math.floor(remain >= 0 ? remain : remain + modulo); -}; - - -/***/ }), -/* 179 */, -/* 180 */, -/* 181 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactDOMComponentFlags = { - hasCachedChildNodes: 1 << 0 -}; - -module.exports = ReactDOMComponentFlags; - -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -/** - * 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) ? true ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : 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]; -} - -module.exports = accumulateInto; - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -/** - * @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). - */ - -function forEachAccumulated(arr, cb, scope) { - if (Array.isArray(arr)) { - arr.forEach(cb, scope); - } else if (arr) { - cb.call(scope, arr); - } -} - -module.exports = forEachAccumulated; - -/***/ }), -/* 184 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ExecutionEnvironment = __webpack_require__(13); - -var contentKey = null; - -/** - * Gets the key used to access text content on a DOM node. - * - * @return {?string} Key used to access text content. - * @internal - */ -function getTextContentAccessor() { - if (!contentKey && ExecutionEnvironment.canUseDOM) { - // Prefer textContent to innerText because many browsers support both but - // SVG <text> elements don't support innerText even when <div> does. - contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText'; - } - return contentKey; -} - -module.exports = getTextContentAccessor; - -/***/ }), -/* 185 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var PooledClass = __webpack_require__(38); - -var invariant = __webpack_require__(1); - -/** - * A specialized pseudo-event module to help keep track of components waiting to - * be notified when their DOM representations are available for use. - * - * This implements `PooledClass`, so you should never need to instantiate this. - * Instead, use `CallbackQueue.getPooled()`. - * - * @class ReactMountReady - * @implements PooledClass - * @internal - */ - -var CallbackQueue = function () { - function CallbackQueue(arg) { - _classCallCheck(this, CallbackQueue); - - this._callbacks = null; - this._contexts = null; - this._arg = arg; - } - - /** - * Enqueues a callback to be invoked when `notifyAll` is invoked. - * - * @param {function} callback Invoked when `notifyAll` is invoked. - * @param {?object} context Context to call `callback` with. - * @internal - */ - - - CallbackQueue.prototype.enqueue = function enqueue(callback, context) { - this._callbacks = this._callbacks || []; - this._callbacks.push(callback); - this._contexts = this._contexts || []; - this._contexts.push(context); - }; - - /** - * Invokes all enqueued callbacks and clears the queue. This is invoked after - * the DOM representation of a component has been created or updated. - * - * @internal - */ - - - CallbackQueue.prototype.notifyAll = function notifyAll() { - var callbacks = this._callbacks; - var contexts = this._contexts; - var arg = this._arg; - if (callbacks && contexts) { - !(callbacks.length === contexts.length) ? true ? invariant(false, 'Mismatched list of contexts in callback queue') : _prodInvariant('24') : void 0; - this._callbacks = null; - this._contexts = null; - for (var i = 0; i < callbacks.length; i++) { - callbacks[i].call(contexts[i], arg); - } - callbacks.length = 0; - contexts.length = 0; - } - }; - - CallbackQueue.prototype.checkpoint = function checkpoint() { - return this._callbacks ? this._callbacks.length : 0; - }; - - CallbackQueue.prototype.rollback = function rollback(len) { - if (this._callbacks && this._contexts) { - this._callbacks.length = len; - this._contexts.length = len; - } - }; - - /** - * Resets the internal queue. - * - * @internal - */ - - - CallbackQueue.prototype.reset = function reset() { - this._callbacks = null; - this._contexts = null; - }; - - /** - * `PooledClass` looks for this. - */ - - - CallbackQueue.prototype.destructor = function destructor() { - this.reset(); - }; - - return CallbackQueue; -}(); - -module.exports = PooledClass.addPoolingTo(CallbackQueue); - -/***/ }), -/* 186 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var ReactFeatureFlags = { - // When true, call console.time() before and .timeEnd() after each top-level - // render (both initial renders and updates). Useful when looking at prod-mode - // timeline profiles in Chrome, for example. - logTopLevelRenders: false -}; - -module.exports = ReactFeatureFlags; - -/***/ }), -/* 187 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactDOMComponentTree = __webpack_require__(9); - -function isCheckable(elem) { - var type = elem.type; - var nodeName = elem.nodeName; - return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); -} - -function getTracker(inst) { - return inst._wrapperState.valueTracker; -} - -function attachTracker(inst, tracker) { - inst._wrapperState.valueTracker = tracker; -} - -function detachTracker(inst) { - inst._wrapperState.valueTracker = null; -} - -function getValueFromNode(node) { - var value; - if (node) { - value = isCheckable(node) ? '' + node.checked : node.value; - } - return value; -} - -var inputValueTracking = { - // exposed for testing - _getTrackerFromNode: function (node) { - return getTracker(ReactDOMComponentTree.getInstanceFromNode(node)); - }, - - - track: function (inst) { - if (getTracker(inst)) { - return; - } - - var node = ReactDOMComponentTree.getNodeFromInstance(inst); - 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.get !== 'function' || typeof descriptor.set !== 'function') { - return; - } - - Object.defineProperty(node, valueField, { - enumerable: descriptor.enumerable, - configurable: true, - get: function () { - return descriptor.get.call(this); - }, - set: function (value) { - currentValue = '' + value; - descriptor.set.call(this, value); - } - }); - - attachTracker(inst, { - getValue: function () { - return currentValue; - }, - setValue: function (value) { - currentValue = '' + value; - }, - stopTracking: function () { - detachTracker(inst); - delete node[valueField]; - } - }); - }, - - updateValueIfChanged: function (inst) { - if (!inst) { - return false; - } - var tracker = getTracker(inst); - - if (!tracker) { - inputValueTracking.track(inst); - return true; - } - - var lastValue = tracker.getValue(); - var nextValue = getValueFromNode(ReactDOMComponentTree.getNodeFromInstance(inst)); - - if (nextValue !== lastValue) { - tracker.setValue(nextValue); - return true; - } - - return false; - }, - stopTracking: function (inst) { - var tracker = getTracker(inst); - if (tracker) { - tracker.stopTracking(); - } - } -}; - -module.exports = inputValueTracking; - -/***/ }), -/* 188 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -/** - * @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; -} - -module.exports = isTextInputElement; - -/***/ }), -/* 189 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ViewportMetrics = { - currentScrollLeft: 0, - - currentScrollTop: 0, - - refreshScrollValues: function (scrollPosition) { - ViewportMetrics.currentScrollLeft = scrollPosition.x; - ViewportMetrics.currentScrollTop = scrollPosition.y; - } -}; - -module.exports = ViewportMetrics; - -/***/ }), -/* 190 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ExecutionEnvironment = __webpack_require__(13); -var escapeTextContentForBrowser = __webpack_require__(83); -var setInnerHTML = __webpack_require__(82); - -/** - * Set the textContent property of a node, ensuring that whitespace is preserved - * even in IE8. innerText is a poor substitute for textContent and, among many - * issues, inserts <br> instead of the literal newline chars. innerHTML behaves - * as it should. - * - * @param {DOMElement} node - * @param {string} text - * @internal - */ -var setTextContent = function (node, text) { - if (text) { - var firstChild = node.firstChild; - - if (firstChild && firstChild === node.lastChild && firstChild.nodeType === 3) { - firstChild.nodeValue = text; - return; - } - } - node.textContent = text; -}; - -if (ExecutionEnvironment.canUseDOM) { - if (!('textContent' in document.documentElement)) { - setTextContent = function (node, text) { - if (node.nodeType === 3) { - node.nodeValue = text; - return; - } - setInnerHTML(node, escapeTextContentForBrowser(text)); - }; - } -} - -module.exports = setTextContent; - -/***/ }), -/* 191 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * @param {DOMElement} node input/textarea to focus - */ - -function focusNode(node) { - // IE8 can throw "Can't move focus to the control because it is invisible, - // not enabled, or of a type that does not accept the focus." for all kinds of - // reasons that are too expensive and fragile to test. - try { - node.focus(); - } catch (e) {} -} - -module.exports = focusNode; - -/***/ }), -/* 192 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * CSS properties which accept numbers but are not in units of "px". - */ - -var isUnitlessNumber = { - animationIterationCount: true, - borderImageOutset: true, - borderImageSlice: true, - borderImageWidth: true, - boxFlex: true, - boxFlexGroup: true, - boxOrdinalGroup: true, - columnCount: true, - columns: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - flexOrder: true, - gridRow: true, - gridRowEnd: true, - gridRowSpan: true, - gridRowStart: true, - gridColumn: true, - gridColumnEnd: true, - gridColumnSpan: true, - gridColumnStart: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - tabSize: true, - widows: true, - zIndex: true, - zoom: true, - - // SVG-related properties - fillOpacity: true, - floodOpacity: true, - stopOpacity: true, - strokeDasharray: true, - strokeDashoffset: true, - strokeMiterlimit: true, - strokeOpacity: true, - strokeWidth: true -}; - -/** - * @param {string} prefix vendor-specific prefix, eg: Webkit - * @param {string} key style name, eg: transitionDuration - * @return {string} style name prefixed with `prefix`, properly camelCased, eg: - * WebkitTransitionDuration - */ -function prefixKey(prefix, key) { - return prefix + key.charAt(0).toUpperCase() + key.substring(1); -} - -/** - * Support style names that may come passed in prefixed by adding permutations - * of vendor prefixes. - */ -var prefixes = ['Webkit', 'ms', 'Moz', 'O']; - -// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an -// infinite loop, because it iterates over the newly added props too. -Object.keys(isUnitlessNumber).forEach(function (prop) { - prefixes.forEach(function (prefix) { - isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; - }); -}); - -/** - * Most style properties can be unset by doing .style[prop] = '' but IE8 - * doesn't like doing that with shorthand properties so for the properties that - * IE8 breaks on, which are listed here, we instead unset each of the - * individual properties. See http://bugs.jquery.com/ticket/12385. - * The 4-value 'clock' properties like margin, padding, border-width seem to - * behave without any problems. Curiously, list-style works too without any - * special prodding. - */ -var shorthandPropertyExpansions = { - background: { - backgroundAttachment: true, - backgroundColor: true, - backgroundImage: true, - backgroundPositionX: true, - backgroundPositionY: true, - backgroundRepeat: true - }, - backgroundPosition: { - backgroundPositionX: true, - backgroundPositionY: true - }, - border: { - borderWidth: true, - borderStyle: true, - borderColor: true - }, - borderBottom: { - borderBottomWidth: true, - borderBottomStyle: true, - borderBottomColor: true - }, - borderLeft: { - borderLeftWidth: true, - borderLeftStyle: true, - borderLeftColor: true - }, - borderRight: { - borderRightWidth: true, - borderRightStyle: true, - borderRightColor: true - }, - borderTop: { - borderTopWidth: true, - borderTopStyle: true, - borderTopColor: true - }, - font: { - fontStyle: true, - fontVariant: true, - fontWeight: true, - fontSize: true, - lineHeight: true, - fontFamily: true - }, - outline: { - outlineWidth: true, - outlineStyle: true, - outlineColor: true - } -}; - -var CSSProperty = { - isUnitlessNumber: isUnitlessNumber, - shorthandPropertyExpansions: shorthandPropertyExpansions -}; - -module.exports = CSSProperty; - -/***/ }), -/* 193 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - - - -var camelize = __webpack_require__(413); - -var msPattern = /^-ms-/; - -/** - * Camelcases a hyphenated CSS property name, for example: - * - * > camelizeStyleName('background-color') - * < "backgroundColor" - * > camelizeStyleName('-moz-transition') - * < "MozTransition" - * > camelizeStyleName('-ms-transition') - * < "msTransition" - * - * As Andi Smith suggests - * (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix - * is converted to lowercase `ms`. - * - * @param {string} string - * @return {string} - */ -function camelizeStyleName(string) { - return camelize(string.replace(msPattern, 'ms-')); -} - -module.exports = camelizeStyleName; - -/***/ }), -/* 194 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - - - -var hyphenate = __webpack_require__(415); - -var msPattern = /^ms-/; - -/** - * Hyphenates a camelcased CSS property name, for example: - * - * > hyphenateStyleName('backgroundColor') - * < "background-color" - * > hyphenateStyleName('MozTransition') - * < "-moz-transition" - * > hyphenateStyleName('msTransition') - * < "-ms-transition" - * - * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix - * is converted to `-ms-`. - * - * @param {string} string - * @return {string} - */ -function hyphenateStyleName(string) { - return hyphenate(string).replace(msPattern, '-ms-'); -} - -module.exports = hyphenateStyleName; - -/***/ }), -/* 195 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - * @typechecks static-only - */ - - - -/** - * Memoizes the return value of a function that accepts one string argument. - */ - -function memoizeStringOnly(callback) { - var cache = {}; - return function (string) { - if (!cache.hasOwnProperty(string)) { - cache[string] = callback.call(this, string); - } - return cache[string]; - }; -} - -module.exports = memoizeStringOnly; - -/***/ }), -/* 196 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMProperty = __webpack_require__(33); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactInstrumentation = __webpack_require__(19); - -var quoteAttributeValueForBrowser = __webpack_require__(416); -var warning = __webpack_require__(2); - -var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$'); -var illegalAttributeNameCache = {}; -var validatedAttributeNameCache = {}; - -function isAttributeNameSafe(attributeName) { - if (validatedAttributeNameCache.hasOwnProperty(attributeName)) { - return true; - } - if (illegalAttributeNameCache.hasOwnProperty(attributeName)) { - return false; - } - if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { - validatedAttributeNameCache[attributeName] = true; - return true; - } - illegalAttributeNameCache[attributeName] = true; - true ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0; - return false; -} - -function shouldIgnoreValue(propertyInfo, value) { - return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false; -} - -/** - * Operations for dealing with DOM properties. - */ -var DOMPropertyOperations = { - /** - * Creates markup for the ID property. - * - * @param {string} id Unescaped ID. - * @return {string} Markup string. - */ - createMarkupForID: function (id) { - return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id); - }, - - setAttributeForID: function (node, id) { - node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id); - }, - - createMarkupForRoot: function () { - return DOMProperty.ROOT_ATTRIBUTE_NAME + '=""'; - }, - - setAttributeForRoot: function (node) { - node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, ''); - }, - - /** - * Creates markup for a property. - * - * @param {string} name - * @param {*} value - * @return {?string} Markup string, or null if the property was invalid. - */ - createMarkupForProperty: function (name, value) { - var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; - if (propertyInfo) { - if (shouldIgnoreValue(propertyInfo, value)) { - return ''; - } - var attributeName = propertyInfo.attributeName; - if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { - return attributeName + '=""'; - } - return attributeName + '=' + quoteAttributeValueForBrowser(value); - } else if (DOMProperty.isCustomAttribute(name)) { - if (value == null) { - return ''; - } - return name + '=' + quoteAttributeValueForBrowser(value); - } - return null; - }, - - /** - * Creates markup for a custom property. - * - * @param {string} name - * @param {*} value - * @return {string} Markup string, or empty string if the property was invalid. - */ - createMarkupForCustomAttribute: function (name, value) { - if (!isAttributeNameSafe(name) || value == null) { - return ''; - } - return name + '=' + quoteAttributeValueForBrowser(value); - }, - - /** - * Sets the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - * @param {*} value - */ - setValueForProperty: function (node, name, value) { - var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; - if (propertyInfo) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod) { - mutationMethod(node, value); - } else if (shouldIgnoreValue(propertyInfo, value)) { - this.deleteValueForProperty(node, name); - return; - } else if (propertyInfo.mustUseProperty) { - // Contrary to `setAttribute`, object properties are properly - // `toString`ed by IE8/9. - node[propertyInfo.propertyName] = value; - } else { - var attributeName = propertyInfo.attributeName; - var namespace = propertyInfo.attributeNamespace; - // `setAttribute` with objects becomes only `[object]` in IE8/9, - // ('' + value) makes it output the correct toString()-value. - if (namespace) { - node.setAttributeNS(namespace, attributeName, '' + value); - } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) { - node.setAttribute(attributeName, ''); - } else { - node.setAttribute(attributeName, '' + value); - } - } - } else if (DOMProperty.isCustomAttribute(name)) { - DOMPropertyOperations.setValueForAttribute(node, name, value); - return; - } - - if (true) { - var payload = {}; - payload[name] = value; - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, - type: 'update attribute', - payload: payload - }); - } - }, - - setValueForAttribute: function (node, name, value) { - if (!isAttributeNameSafe(name)) { - return; - } - if (value == null) { - node.removeAttribute(name); - } else { - node.setAttribute(name, '' + value); - } - - if (true) { - var payload = {}; - payload[name] = value; - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, - type: 'update attribute', - payload: payload - }); - } - }, - - /** - * Deletes an attributes from a node. - * - * @param {DOMElement} node - * @param {string} name - */ - deleteValueForAttribute: function (node, name) { - node.removeAttribute(name); - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, - type: 'remove attribute', - payload: name - }); - } - }, - - /** - * Deletes the value for a property on a node. - * - * @param {DOMElement} node - * @param {string} name - */ - deleteValueForProperty: function (node, name) { - var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null; - if (propertyInfo) { - var mutationMethod = propertyInfo.mutationMethod; - if (mutationMethod) { - mutationMethod(node, undefined); - } else if (propertyInfo.mustUseProperty) { - var propName = propertyInfo.propertyName; - if (propertyInfo.hasBooleanValue) { - node[propName] = false; - } else { - node[propName] = ''; - } - } else { - node.removeAttribute(propertyInfo.attributeName); - } - } else if (DOMProperty.isCustomAttribute(name)) { - node.removeAttribute(name); - } - - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID, - type: 'remove attribute', - payload: name - }); - } - } -}; - -module.exports = DOMPropertyOperations; - -/***/ }), -/* 197 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - -/***/ }), -/* 198 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var LinkedValueUtils = __webpack_require__(119); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactUpdates = __webpack_require__(26); - -var warning = __webpack_require__(2); - -var didWarnValueLink = false; -var didWarnValueDefaultValue = false; - -function updateOptionsIfPendingUpdateAndMounted() { - if (this._rootNodeID && this._wrapperState.pendingUpdate) { - this._wrapperState.pendingUpdate = false; - - var props = this._currentElement.props; - var value = LinkedValueUtils.getValue(props); - - if (value != null) { - updateOptions(this, Boolean(props.multiple), value); - } - } -} - -function getDeclarationErrorAddendum(owner) { - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; -} - -var valuePropNames = ['value', 'defaultValue']; - -/** - * Validation function for `value` and `defaultValue`. - * @private - */ -function checkSelectPropTypes(inst, props) { - var owner = inst._currentElement._owner; - LinkedValueUtils.checkPropTypes('select', props, owner); - - if (props.valueLink !== undefined && !didWarnValueLink) { - true ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0; - didWarnValueLink = true; - } - - for (var i = 0; i < valuePropNames.length; i++) { - var propName = valuePropNames[i]; - if (props[propName] == null) { - continue; - } - var isArray = Array.isArray(props[propName]); - if (props.multiple && !isArray) { - true ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0; - } else if (!props.multiple && isArray) { - true ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0; - } - } -} - -/** - * @param {ReactDOMComponent} inst - * @param {boolean} multiple - * @param {*} propValue A stringable (with `multiple`, a list of stringables). - * @private - */ -function updateOptions(inst, multiple, propValue) { - var selectedValue, i; - var options = ReactDOMComponentTree.getNodeFromInstance(inst).options; - - if (multiple) { - selectedValue = {}; - for (i = 0; i < propValue.length; i++) { - selectedValue['' + propValue[i]] = true; - } - for (i = 0; i < options.length; i++) { - var selected = selectedValue.hasOwnProperty(options[i].value); - if (options[i].selected !== selected) { - options[i].selected = selected; - } - } - } else { - // Do not set `select.value` as exact behavior isn't consistent across all - // browsers for all cases. - selectedValue = '' + propValue; - for (i = 0; i < options.length; i++) { - if (options[i].value === selectedValue) { - options[i].selected = true; - return; - } - } - if (options.length) { - options[0].selected = true; - } - } -} - -/** - * Implements a <select> host component that allows optionally setting the - * props `value` and `defaultValue`. If `multiple` is false, the prop must be a - * stringable. If `multiple` is true, the prop must be an array of stringables. - * - * If `value` is not supplied (or null/undefined), user actions that change the - * selected option will trigger updates to the rendered options. - * - * If it is supplied (and not null/undefined), the rendered options will not - * update in response to user actions. Instead, the `value` prop must change in - * order for the rendered options to update. - * - * If `defaultValue` is provided, any options with the supplied values will be - * selected. - */ -var ReactDOMSelect = { - getHostProps: function (inst, props) { - return _assign({}, props, { - onChange: inst._wrapperState.onChange, - value: undefined - }); - }, - - mountWrapper: function (inst, props) { - if (true) { - checkSelectPropTypes(inst, props); - } - - var value = LinkedValueUtils.getValue(props); - inst._wrapperState = { - pendingUpdate: false, - initialValue: value != null ? value : props.defaultValue, - listeners: null, - onChange: _handleChange.bind(inst), - wasMultiple: Boolean(props.multiple) - }; - - if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { - true ? warning(false, 'Select 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 select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0; - didWarnValueDefaultValue = true; - } - }, - - getSelectValueContext: function (inst) { - // ReactDOMOption looks at this initial value so the initial generated - // markup has correct `selected` attributes - return inst._wrapperState.initialValue; - }, - - postUpdateWrapper: function (inst) { - var props = inst._currentElement.props; - - // After the initial mount, we control selected-ness manually so don't pass - // this value down - inst._wrapperState.initialValue = undefined; - - var wasMultiple = inst._wrapperState.wasMultiple; - inst._wrapperState.wasMultiple = Boolean(props.multiple); - - var value = LinkedValueUtils.getValue(props); - if (value != null) { - inst._wrapperState.pendingUpdate = false; - updateOptions(inst, Boolean(props.multiple), value); - } else if (wasMultiple !== Boolean(props.multiple)) { - // For simplicity, reapply `defaultValue` if `multiple` is toggled. - if (props.defaultValue != null) { - updateOptions(inst, Boolean(props.multiple), props.defaultValue); - } else { - // Revert the select back to its default unselected state. - updateOptions(inst, Boolean(props.multiple), props.multiple ? [] : ''); - } - } - } -}; - -function _handleChange(event) { - var props = this._currentElement.props; - var returnValue = LinkedValueUtils.executeOnChange(props, event); - - if (this._rootNodeID) { - this._wrapperState.pendingUpdate = true; - } - ReactUpdates.asap(updateOptionsIfPendingUpdateAndMounted, this); - return returnValue; -} - -module.exports = ReactDOMSelect; - -/***/ }), -/* 199 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4), - _assign = __webpack_require__(7); - -var ReactCompositeComponent = __webpack_require__(424); -var ReactEmptyComponent = __webpack_require__(201); -var ReactHostComponent = __webpack_require__(202); - -var getNextDebugID = __webpack_require__(427); -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -// To avoid a cyclic dependency, we create the final class in this module -var ReactCompositeComponentWrapper = function (element) { - this.construct(element); -}; - -function getDeclarationErrorAddendum(owner) { - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; -} - -/** - * Check if the type reference is a known internal type. I.e. not a user - * provided composite type. - * - * @param {function} type - * @return {boolean} Returns true if this is a valid internal type. - */ -function isInternalComponentType(type) { - return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function'; -} - -/** - * Given a ReactNode, create an instance that will actually be mounted. - * - * @param {ReactNode} node - * @param {boolean} shouldHaveDebugID - * @return {object} A new instance of the element's constructor. - * @protected - */ -function instantiateReactComponent(node, shouldHaveDebugID) { - var instance; - - if (node === null || node === false) { - instance = ReactEmptyComponent.create(instantiateReactComponent); - } else if (typeof node === 'object') { - var element = node; - var type = element.type; - if (typeof type !== 'function' && typeof type !== 'string') { - var info = ''; - if (true) { - 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."; - } - } - info += getDeclarationErrorAddendum(element._owner); - true ? true ? invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info) : _prodInvariant('130', type == null ? type : typeof type, info) : void 0; - } - - // Special case string values - if (typeof element.type === 'string') { - instance = ReactHostComponent.createInternalComponent(element); - } else if (isInternalComponentType(element.type)) { - // This is temporarily available for custom components that are not string - // representations. I.e. ART. Once those are updated to use the string - // representation, we can drop this code path. - instance = new element.type(element); - - // We renamed this. Allow the old name for compat. :( - if (!instance.getHostNode) { - instance.getHostNode = instance.getNativeNode; - } - } else { - instance = new ReactCompositeComponentWrapper(element); - } - } else if (typeof node === 'string' || typeof node === 'number') { - instance = ReactHostComponent.createInstanceForText(node); - } else { - true ? true ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : _prodInvariant('131', typeof node) : void 0; - } - - if (true) { - true ? warning(typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.getHostNode === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : void 0; - } - - // These two fields are used by the DOM and ART diffing algorithms - // respectively. Instead of using expandos on components, we should be - // storing the state needed by the diffing algorithms elsewhere. - instance._mountIndex = 0; - instance._mountImage = null; - - if (true) { - instance._debugID = shouldHaveDebugID ? getNextDebugID() : 0; - } - - // Internal instances should fully constructed at this point, so they should - // not get any new fields added to them at this point. - if (true) { - if (Object.preventExtensions) { - Object.preventExtensions(instance); - } - } - - return instance; -} - -_assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent, { - _instantiateReactComponent: instantiateReactComponent -}); - -module.exports = instantiateReactComponent; - -/***/ }), -/* 200 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var React = __webpack_require__(42); - -var invariant = __webpack_require__(1); - -var ReactNodeTypes = { - HOST: 0, - COMPOSITE: 1, - EMPTY: 2, - - getType: function (node) { - if (node === null || node === false) { - return ReactNodeTypes.EMPTY; - } else if (React.isValidElement(node)) { - if (typeof node.type === 'function') { - return ReactNodeTypes.COMPOSITE; - } else { - return ReactNodeTypes.HOST; - } - } - true ? true ? invariant(false, 'Unexpected node: %s', node) : _prodInvariant('26', node) : void 0; - } -}; - -module.exports = ReactNodeTypes; - -/***/ }), -/* 201 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var emptyComponentFactory; - -var ReactEmptyComponentInjection = { - injectEmptyComponentFactory: function (factory) { - emptyComponentFactory = factory; - } -}; - -var ReactEmptyComponent = { - create: function (instantiate) { - return emptyComponentFactory(instantiate); - } -}; - -ReactEmptyComponent.injection = ReactEmptyComponentInjection; - -module.exports = ReactEmptyComponent; - -/***/ }), -/* 202 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -var genericComponentClass = null; -var textComponentClass = null; - -var ReactHostComponentInjection = { - // This accepts a class that receives the tag string. This is a catch all - // that can render any kind of tag. - injectGenericComponentClass: function (componentClass) { - genericComponentClass = componentClass; - }, - // This accepts a text component class that takes the text string to be - // rendered as props. - injectTextComponentClass: function (componentClass) { - textComponentClass = componentClass; - } -}; - -/** - * Get a host internal component class for a specific tag. - * - * @param {ReactElement} element The element to create. - * @return {function} The internal class constructor function. - */ -function createInternalComponent(element) { - !genericComponentClass ? true ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0; - return new genericComponentClass(element); -} - -/** - * @param {ReactText} text - * @return {ReactComponent} - */ -function createInstanceForText(text) { - return new textComponentClass(text); -} - -/** - * @param {ReactComponent} component - * @return {boolean} - */ -function isTextComponent(component) { - return component instanceof textComponentClass; -} - -var ReactHostComponent = { - createInternalComponent: createInternalComponent, - createInstanceForText: createInstanceForText, - isTextComponent: isTextComponent, - injection: ReactHostComponentInjection -}; - -module.exports = ReactHostComponent; - -/***/ }), -/* 203 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var ReactCurrentOwner = __webpack_require__(23); -var REACT_ELEMENT_TYPE = __webpack_require__(428); - -var getIteratorFn = __webpack_require__(429); -var invariant = __webpack_require__(1); -var KeyEscapeUtils = __webpack_require__(123); -var warning = __webpack_require__(2); - -var SEPARATOR = '.'; -var SUBSEPARATOR = ':'; - -/** - * This is inlined from ReactElement since this file is shared between - * isomorphic and renderers. We could extract this to a - * - */ - -/** - * TODO: Test that a single child and an array with one item have the same key - * pattern. - */ - -var didWarnAboutMaps = false; - -/** - * 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 (component && typeof component === 'object' && component.key != null) { - // Explicit key - return KeyEscapeUtils.escape(component.key); - } - // Implicit key determined by the index in the set - return index.toString(36); -} - -/** - * @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; - } - - if (children === null || type === 'string' || type === 'number' || - // The following is inlined from ReactElement. This means we can optimize - // some checks. React Fiber also inlines this logic for similar purposes. - type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { - 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; - var nextName; - 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 (iteratorFn) { - var iterator = iteratorFn.call(children); - var step; - if (iteratorFn !== children.entries) { - var ii = 0; - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getComponentKey(child, ii++); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } else { - if (true) { - var mapsAsChildrenAddendum = ''; - if (ReactCurrentOwner.current) { - var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); - if (mapsAsChildrenOwnerName) { - mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; - } - } - true ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; - didWarnAboutMaps = true; - } - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - child = entry[1]; - nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } - } - } else if (type === 'object') { - var addendum = ''; - if (true) { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; - if (children._isReactElement) { - addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.'; - } - if (ReactCurrentOwner.current) { - var name = ReactCurrentOwner.current.getName(); - if (name) { - addendum += ' Check the render method of `' + name + '`.'; - } - } - } - var childrenString = String(children); - true ? true ? 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) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; - } - } - - 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); -} - -module.exports = traverseAllChildren; - -/***/ }), -/* 204 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var emptyFunction = __webpack_require__(20); - -/** - * Upstream version of event listener. Does not take into account specific - * nature of platform. - */ -var EventListener = { - /** - * Listen to DOM events during the bubble phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - listen: function listen(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, false); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, false); - } - }; - } else if (target.attachEvent) { - target.attachEvent('on' + eventType, callback); - return { - remove: function remove() { - target.detachEvent('on' + eventType, callback); - } - }; - } - }, - - /** - * Listen to DOM events during the capture phase. - * - * @param {DOMEventTarget} target DOM element to register listener on. - * @param {string} eventType Event type, e.g. 'click' or 'mouseover'. - * @param {function} callback Callback function. - * @return {object} Object with a `remove` method. - */ - capture: function capture(target, eventType, callback) { - if (target.addEventListener) { - target.addEventListener(eventType, callback, true); - return { - remove: function remove() { - target.removeEventListener(eventType, callback, true); - } - }; - } else { - if (true) { - console.error('Attempted to listen to events during the capture phase on a ' + 'browser that does not support the capture phase. Your application ' + 'will not receive some events.'); - } - return { - remove: emptyFunction - }; - } - }, - - registerDefault: function registerDefault() {} -}; - -module.exports = EventListener; - -/***/ }), -/* 205 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactDOMSelection = __webpack_require__(441); - -var containsNode = __webpack_require__(443); -var focusNode = __webpack_require__(191); -var getActiveElement = __webpack_require__(206); - -function isInDocument(node) { - return containsNode(document.documentElement, node); -} - -/** - * @ReactInputSelection: React input selection module. Based on Selection.js, - * but modified to be suitable for react and has a couple of bug fixes (doesn't - * assume buttons have range selections allowed). - * Input selection module for React. - */ -var ReactInputSelection = { - hasSelectionCapabilities: function (elem) { - var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); - return nodeName && (nodeName === 'input' && elem.type === 'text' || nodeName === 'textarea' || elem.contentEditable === 'true'); - }, - - getSelectionInformation: function () { - var focusedElem = getActiveElement(); - return { - focusedElem: focusedElem, - selectionRange: ReactInputSelection.hasSelectionCapabilities(focusedElem) ? ReactInputSelection.getSelection(focusedElem) : null - }; - }, - - /** - * @restoreSelection: If any selection information was potentially lost, - * restore it. This is useful when performing operations that could remove dom - * nodes and place them back in, resulting in focus being lost. - */ - restoreSelection: function (priorSelectionInformation) { - var curFocusedElem = getActiveElement(); - var priorFocusedElem = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { - if (ReactInputSelection.hasSelectionCapabilities(priorFocusedElem)) { - ReactInputSelection.setSelection(priorFocusedElem, priorSelectionRange); - } - focusNode(priorFocusedElem); - } - }, - - /** - * @getSelection: Gets the selection bounds of a focused textarea, input or - * contentEditable node. - * -@input: Look up selection bounds of this input - * -@return {start: selectionStart, end: selectionEnd} - */ - getSelection: function (input) { - var selection; - - if ('selectionStart' in input) { - // Modern browser with input or textarea. - selection = { - start: input.selectionStart, - end: input.selectionEnd - }; - } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') { - // IE8 input. - var range = document.selection.createRange(); - // There can only be one selection per document in IE, so it must - // be in our element. - if (range.parentElement() === input) { - selection = { - start: -range.moveStart('character', -input.value.length), - end: -range.moveEnd('character', -input.value.length) - }; - } - } else { - // Content editable or old IE textarea. - selection = ReactDOMSelection.getOffsets(input); - } - - return selection || { start: 0, end: 0 }; - }, - - /** - * @setSelection: Sets the selection bounds of a textarea or input and focuses - * the input. - * -@input Set selection bounds of this input or textarea - * -@offsets Object of same form that is returned from get* - */ - setSelection: function (input, offsets) { - var start = offsets.start; - var end = offsets.end; - if (end === undefined) { - end = start; - } - - if ('selectionStart' in input) { - input.selectionStart = start; - input.selectionEnd = Math.min(end, input.value.length); - } else if (document.selection && input.nodeName && input.nodeName.toLowerCase() === 'input') { - var range = input.createTextRange(); - range.collapse(true); - range.moveStart('character', start); - range.moveEnd('character', end - start); - range.select(); - } else { - ReactDOMSelection.setOffsets(input, offsets); - } - } -}; - -module.exports = ReactInputSelection; - -/***/ }), -/* 206 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -/* eslint-disable fb-www/typeof-undefined */ - -/** - * Same as document.activeElement but wraps in a try-catch block. In IE it is - * not safe to call document.activeElement if there is nothing focused. - * - * The activeElement will be null only if the document or document body is not - * yet defined. - * - * @param {?DOMDocument} doc Defaults to current document. - * @return {?DOMElement} - */ -function getActiveElement(doc) /*?DOMElement*/{ - doc = doc || (typeof document !== 'undefined' ? document : undefined); - if (typeof doc === 'undefined') { - return null; - } - try { - return doc.activeElement || doc.body; - } catch (e) { - return doc.body; - } -} - -module.exports = getActiveElement; - -/***/ }), -/* 207 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var DOMLazyTree = __webpack_require__(52); -var DOMProperty = __webpack_require__(33); -var React = __webpack_require__(42); -var ReactBrowserEventEmitter = __webpack_require__(84); -var ReactCurrentOwner = __webpack_require__(23); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactDOMContainerInfo = __webpack_require__(458); -var ReactDOMFeatureFlags = __webpack_require__(459); -var ReactFeatureFlags = __webpack_require__(186); -var ReactInstanceMap = __webpack_require__(63); -var ReactInstrumentation = __webpack_require__(19); -var ReactMarkupChecksum = __webpack_require__(460); -var ReactReconciler = __webpack_require__(51); -var ReactUpdateQueue = __webpack_require__(124); -var ReactUpdates = __webpack_require__(26); - -var emptyObject = __webpack_require__(72); -var instantiateReactComponent = __webpack_require__(199); -var invariant = __webpack_require__(1); -var setInnerHTML = __webpack_require__(82); -var shouldUpdateReactComponent = __webpack_require__(122); -var warning = __webpack_require__(2); - -var ATTR_NAME = DOMProperty.ID_ATTRIBUTE_NAME; -var ROOT_ATTR_NAME = DOMProperty.ROOT_ATTRIBUTE_NAME; - -var ELEMENT_NODE_TYPE = 1; -var DOC_NODE_TYPE = 9; -var DOCUMENT_FRAGMENT_NODE_TYPE = 11; - -var instancesByReactRootID = {}; - -/** - * Finds the index of the first character - * that's not common between the two given strings. - * - * @return {number} the index of the character where the strings diverge - */ -function firstDifferenceIndex(string1, string2) { - var minLen = Math.min(string1.length, string2.length); - for (var i = 0; i < minLen; i++) { - if (string1.charAt(i) !== string2.charAt(i)) { - return i; - } - } - return string1.length === string2.length ? -1 : minLen; -} - -/** - * @param {DOMElement|DOMDocument} container DOM element that may contain - * a React component - * @return {?*} DOM element that may have the reactRoot ID, or null. - */ -function getReactRootElementInContainer(container) { - if (!container) { - return null; - } - - if (container.nodeType === DOC_NODE_TYPE) { - return container.documentElement; - } else { - return container.firstChild; - } -} - -function internalGetID(node) { - // If node is something like a window, document, or text node, none of - // which support attributes or a .getAttribute method, gracefully return - // the empty string, as if the attribute were missing. - return node.getAttribute && node.getAttribute(ATTR_NAME) || ''; -} - -/** - * Mounts this component and inserts it into the DOM. - * - * @param {ReactComponent} componentInstance The instance to mount. - * @param {DOMElement} container DOM element to mount into. - * @param {ReactReconcileTransaction} transaction - * @param {boolean} shouldReuseMarkup If true, do not insert markup - */ -function mountComponentIntoNode(wrapperInstance, container, transaction, shouldReuseMarkup, context) { - var markerName; - if (ReactFeatureFlags.logTopLevelRenders) { - var wrappedElement = wrapperInstance._currentElement.props.child; - var type = wrappedElement.type; - markerName = 'React mount: ' + (typeof type === 'string' ? type : type.displayName || type.name); - console.time(markerName); - } - - var markup = ReactReconciler.mountComponent(wrapperInstance, transaction, null, ReactDOMContainerInfo(wrapperInstance, container), context, 0 /* parentDebugID */ - ); - - if (markerName) { - console.timeEnd(markerName); - } - - wrapperInstance._renderedComponent._topLevelWrapper = wrapperInstance; - ReactMount._mountImageIntoNode(markup, container, wrapperInstance, shouldReuseMarkup, transaction); -} - -/** - * Batched mount. - * - * @param {ReactComponent} componentInstance The instance to mount. - * @param {DOMElement} container DOM element to mount into. - * @param {boolean} shouldReuseMarkup If true, do not insert markup - */ -function batchedMountComponentIntoNode(componentInstance, container, shouldReuseMarkup, context) { - var transaction = ReactUpdates.ReactReconcileTransaction.getPooled( - /* useCreateElement */ - !shouldReuseMarkup && ReactDOMFeatureFlags.useCreateElement); - transaction.perform(mountComponentIntoNode, null, componentInstance, container, transaction, shouldReuseMarkup, context); - ReactUpdates.ReactReconcileTransaction.release(transaction); -} - -/** - * Unmounts a component and removes it from the DOM. - * - * @param {ReactComponent} instance React component instance. - * @param {DOMElement} container DOM element to unmount from. - * @final - * @internal - * @see {ReactMount.unmountComponentAtNode} - */ -function unmountComponentFromNode(instance, container, safely) { - if (true) { - ReactInstrumentation.debugTool.onBeginFlush(); - } - ReactReconciler.unmountComponent(instance, safely); - if (true) { - ReactInstrumentation.debugTool.onEndFlush(); - } - - if (container.nodeType === DOC_NODE_TYPE) { - container = container.documentElement; - } - - // http://jsperf.com/emptying-a-node - while (container.lastChild) { - container.removeChild(container.lastChild); - } -} - -/** - * True if the supplied DOM node has a direct React-rendered child that is - * not a React root element. Useful for warning in `render`, - * `unmountComponentAtNode`, etc. - * - * @param {?DOMElement} node The candidate DOM node. - * @return {boolean} True if the DOM element contains a direct child that was - * rendered by React but is not a root element. - * @internal - */ -function hasNonRootReactChild(container) { - var rootEl = getReactRootElementInContainer(container); - if (rootEl) { - var inst = ReactDOMComponentTree.getInstanceFromNode(rootEl); - return !!(inst && inst._hostParent); - } -} - -/** - * True if the supplied DOM node is a React DOM element and - * it has been rendered by another copy of React. - * - * @param {?DOMElement} node The candidate DOM node. - * @return {boolean} True if the DOM has been rendered by another copy of React - * @internal - */ -function nodeIsRenderedByOtherInstance(container) { - var rootEl = getReactRootElementInContainer(container); - return !!(rootEl && isReactNode(rootEl) && !ReactDOMComponentTree.getInstanceFromNode(rootEl)); -} - -/** - * True if the supplied DOM node is a valid node element. - * - * @param {?DOMElement} node The candidate DOM node. - * @return {boolean} True if the DOM is a valid DOM node. - * @internal - */ -function isValidContainer(node) { - return !!(node && (node.nodeType === ELEMENT_NODE_TYPE || node.nodeType === DOC_NODE_TYPE || node.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)); -} - -/** - * True if the supplied DOM node is a valid React node element. - * - * @param {?DOMElement} node The candidate DOM node. - * @return {boolean} True if the DOM is a valid React DOM node. - * @internal - */ -function isReactNode(node) { - return isValidContainer(node) && (node.hasAttribute(ROOT_ATTR_NAME) || node.hasAttribute(ATTR_NAME)); -} - -function getHostRootInstanceInContainer(container) { - var rootEl = getReactRootElementInContainer(container); - var prevHostInstance = rootEl && ReactDOMComponentTree.getInstanceFromNode(rootEl); - return prevHostInstance && !prevHostInstance._hostParent ? prevHostInstance : null; -} - -function getTopLevelWrapperInContainer(container) { - var root = getHostRootInstanceInContainer(container); - return root ? root._hostContainerInfo._topLevelWrapper : null; -} - -/** - * Temporary (?) hack so that we can store all top-level pending updates on - * composites instead of having to worry about different types of components - * here. - */ -var topLevelRootCounter = 1; -var TopLevelWrapper = function () { - this.rootID = topLevelRootCounter++; -}; -TopLevelWrapper.prototype.isReactComponent = {}; -if (true) { - TopLevelWrapper.displayName = 'TopLevelWrapper'; -} -TopLevelWrapper.prototype.render = function () { - return this.props.child; -}; -TopLevelWrapper.isReactTopLevelWrapper = true; - -/** - * Mounting is the process of initializing a React component by creating its - * representative DOM elements and inserting them into a supplied `container`. - * Any prior content inside `container` is destroyed in the process. - * - * ReactMount.render( - * component, - * document.getElementById('container') - * ); - * - * <div id="container"> <-- Supplied `container`. - * <div data-reactid=".3"> <-- Rendered reactRoot of React - * // ... component. - * </div> - * </div> - * - * Inside of `container`, the first element rendered is the "reactRoot". - */ -var ReactMount = { - TopLevelWrapper: TopLevelWrapper, - - /** - * Used by devtools. The keys are not important. - */ - _instancesByReactRootID: instancesByReactRootID, - - /** - * This is a hook provided to support rendering React components while - * ensuring that the apparent scroll position of its `container` does not - * change. - * - * @param {DOMElement} container The `container` being rendered into. - * @param {function} renderCallback This must be called once to do the render. - */ - scrollMonitor: function (container, renderCallback) { - renderCallback(); - }, - - /** - * Take a component that's already mounted into the DOM and replace its props - * @param {ReactComponent} prevComponent component instance already in the DOM - * @param {ReactElement} nextElement component instance to render - * @param {DOMElement} container container to render into - * @param {?function} callback function triggered on completion - */ - _updateRootComponent: function (prevComponent, nextElement, nextContext, container, callback) { - ReactMount.scrollMonitor(container, function () { - ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement, nextContext); - if (callback) { - ReactUpdateQueue.enqueueCallbackInternal(prevComponent, callback); - } - }); - - return prevComponent; - }, - - /** - * Render a new component into the DOM. Hooked by hooks! - * - * @param {ReactElement} nextElement element to render - * @param {DOMElement} container container to render into - * @param {boolean} shouldReuseMarkup if we should skip the markup insertion - * @return {ReactComponent} nextComponent - */ - _renderNewRootComponent: function (nextElement, container, shouldReuseMarkup, context) { - // Various parts of our code (such as ReactCompositeComponent's - // _renderValidatedComponent) assume that calls to render aren't nested; - // verify that that's the case. - true ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0; - - !isValidContainer(container) ? true ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : _prodInvariant('37') : void 0; - - ReactBrowserEventEmitter.ensureScrollValueMonitoring(); - var componentInstance = instantiateReactComponent(nextElement, false); - - // The initial render is synchronous but any updates that happen during - // rendering, in componentWillMount or componentDidMount, will be batched - // according to the current batching strategy. - - ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, container, shouldReuseMarkup, context); - - var wrapperID = componentInstance._instance.rootID; - instancesByReactRootID[wrapperID] = componentInstance; - - return componentInstance; - }, - - /** - * Renders a React component into the DOM in the supplied `container`. - * - * If the React component was previously rendered into `container`, this will - * perform an update on it and only mutate the DOM as necessary to reflect the - * latest React component. - * - * @param {ReactComponent} parentComponent The conceptual parent of this render tree. - * @param {ReactElement} nextElement Component element to render. - * @param {DOMElement} container DOM element to render into. - * @param {?function} callback function triggered on completion - * @return {ReactComponent} Component instance rendered in `container`. - */ - renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { - !(parentComponent != null && ReactInstanceMap.has(parentComponent)) ? true ? invariant(false, 'parentComponent must be a valid React Component') : _prodInvariant('38') : void 0; - return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback); - }, - - _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) { - ReactUpdateQueue.validateCallback(callback, 'ReactDOM.render'); - !React.isValidElement(nextElement) ? true ? invariant(false, 'ReactDOM.render(): Invalid component element.%s', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or <div />." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : // Check if it quacks like an element - nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : _prodInvariant('39', typeof nextElement === 'string' ? " Instead of passing a string like 'div', pass " + "React.createElement('div') or <div />." : typeof nextElement === 'function' ? ' Instead of passing a class like Foo, pass ' + 'React.createElement(Foo) or <Foo />.' : nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : void 0; - - true ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0; - - var nextWrappedElement = React.createElement(TopLevelWrapper, { - child: nextElement - }); - - var nextContext; - if (parentComponent) { - var parentInst = ReactInstanceMap.get(parentComponent); - nextContext = parentInst._processChildContext(parentInst._context); - } else { - nextContext = emptyObject; - } - - var prevComponent = getTopLevelWrapperInContainer(container); - - if (prevComponent) { - var prevWrappedElement = prevComponent._currentElement; - var prevElement = prevWrappedElement.props.child; - if (shouldUpdateReactComponent(prevElement, nextElement)) { - var publicInst = prevComponent._renderedComponent.getPublicInstance(); - var updatedCallback = callback && function () { - callback.call(publicInst); - }; - ReactMount._updateRootComponent(prevComponent, nextWrappedElement, nextContext, container, updatedCallback); - return publicInst; - } else { - ReactMount.unmountComponentAtNode(container); - } - } - - var reactRootElement = getReactRootElementInContainer(container); - var containerHasReactMarkup = reactRootElement && !!internalGetID(reactRootElement); - var containerHasNonRootReactChild = hasNonRootReactChild(container); - - if (true) { - true ? warning(!containerHasNonRootReactChild, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0; - - if (!containerHasReactMarkup || reactRootElement.nextSibling) { - var rootElementSibling = reactRootElement; - while (rootElementSibling) { - if (internalGetID(rootElementSibling)) { - true ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : void 0; - break; - } - rootElementSibling = rootElementSibling.nextSibling; - } - } - } - - var shouldReuseMarkup = containerHasReactMarkup && !prevComponent && !containerHasNonRootReactChild; - var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, nextContext)._renderedComponent.getPublicInstance(); - if (callback) { - callback.call(component); - } - return component; - }, - - /** - * Renders a React component into the DOM in the supplied `container`. - * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.render - * - * If the React component was previously rendered into `container`, this will - * perform an update on it and only mutate the DOM as necessary to reflect the - * latest React component. - * - * @param {ReactElement} nextElement Component element to render. - * @param {DOMElement} container DOM element to render into. - * @param {?function} callback function triggered on completion - * @return {ReactComponent} Component instance rendered in `container`. - */ - render: function (nextElement, container, callback) { - return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback); - }, - - /** - * Unmounts and destroys the React component rendered in the `container`. - * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.unmountcomponentatnode - * - * @param {DOMElement} container DOM element containing a React component. - * @return {boolean} True if a component was found in and unmounted from - * `container` - */ - unmountComponentAtNode: function (container) { - // Various parts of our code (such as ReactCompositeComponent's - // _renderValidatedComponent) assume that calls to render aren't nested; - // verify that that's the case. (Strictly speaking, unmounting won't cause a - // render but we still don't expect to be in a render call here.) - true ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : void 0; - - !isValidContainer(container) ? true ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : _prodInvariant('40') : void 0; - - if (true) { - true ? warning(!nodeIsRenderedByOtherInstance(container), "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0; - } - - var prevComponent = getTopLevelWrapperInContainer(container); - if (!prevComponent) { - // Check if the node being unmounted was rendered by React, but isn't a - // root node. - var containerHasNonRootReactChild = hasNonRootReactChild(container); - - // Check if the container itself is a React root node. - var isContainerReactRoot = container.nodeType === 1 && container.hasAttribute(ROOT_ATTR_NAME); - - if (true) { - true ? warning(!containerHasNonRootReactChild, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0; - } - - return false; - } - delete instancesByReactRootID[prevComponent._instance.rootID]; - ReactUpdates.batchedUpdates(unmountComponentFromNode, prevComponent, container, false); - return true; - }, - - _mountImageIntoNode: function (markup, container, instance, shouldReuseMarkup, transaction) { - !isValidContainer(container) ? true ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : _prodInvariant('41') : void 0; - - if (shouldReuseMarkup) { - var rootElement = getReactRootElementInContainer(container); - if (ReactMarkupChecksum.canReuseMarkup(markup, rootElement)) { - ReactDOMComponentTree.precacheNode(instance, rootElement); - return; - } else { - var checksum = rootElement.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - rootElement.removeAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - - var rootMarkup = rootElement.outerHTML; - rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum); - - var normalizedMarkup = markup; - if (true) { - // because rootMarkup is retrieved from the DOM, various normalizations - // will have occurred which will not be present in `markup`. Here, - // insert markup into a <div> or <iframe> depending on the container - // type to perform the same normalizations before comparing. - var normalizer; - if (container.nodeType === ELEMENT_NODE_TYPE) { - normalizer = document.createElement('div'); - normalizer.innerHTML = markup; - normalizedMarkup = normalizer.innerHTML; - } else { - normalizer = document.createElement('iframe'); - document.body.appendChild(normalizer); - normalizer.contentDocument.write(markup); - normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML; - document.body.removeChild(normalizer); - } - } - - var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup); - var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20); - - !(container.nodeType !== DOC_NODE_TYPE) ? true ? invariant(false, 'You\'re trying to render a component to the document using server rendering but the checksum was invalid. This usually means you rendered a different component type or props on the client from the one on the server, or your render() methods are impure. React cannot handle this case due to cross-browser quirks by rendering at the document root. You should look for environment dependent code in your components and ensure the props are the same client and server side:\n%s', difference) : _prodInvariant('42', difference) : void 0; - - if (true) { - true ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : void 0; - } - } - } - - !(container.nodeType !== DOC_NODE_TYPE) ? true ? invariant(false, 'You\'re trying to render a component to the document but you didn\'t use server rendering. We can\'t do this without using server rendering due to cross-browser quirks. See ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('43') : void 0; - - if (transaction.useCreateElement) { - while (container.lastChild) { - container.removeChild(container.lastChild); - } - DOMLazyTree.insertTreeBefore(container, markup, null); - } else { - setInnerHTML(container, markup); - ReactDOMComponentTree.precacheNode(instance, container.firstChild); - } - - if (true) { - var hostNode = ReactDOMComponentTree.getInstanceFromNode(container.firstChild); - if (hostNode._debugID !== 0) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: hostNode._debugID, - type: 'mount', - payload: markup.toString() - }); - } - } - } -}; - -module.exports = ReactMount; - -/***/ }), -/* 208 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactNodeTypes = __webpack_require__(200); - -function getHostComponentFromComposite(inst) { - var type; - - while ((type = inst._renderedNodeType) === ReactNodeTypes.COMPOSITE) { - inst = inst._renderedComponent; - } - - if (type === ReactNodeTypes.HOST) { - return inst._renderedComponent; - } else if (type === ReactNodeTypes.EMPTY) { - return null; - } -} - -module.exports = getHostComponentFromComposite; - -/***/ }), -/* 209 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = prefixValue; -function prefixValue(plugins, property, value, style, metaData) { - for (var i = 0, len = plugins.length; i < len; ++i) { - var processedValue = plugins[i](property, value, style, metaData); - - // we can stop processing if a value is returned - // as all plugin criteria are unique - if (processedValue) { - return processedValue; - } - } -} -module.exports = exports["default"]; - -/***/ }), -/* 210 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var uppercasePattern = /[A-Z]/g; -var msPattern = /^ms-/; -var cache = {}; - -function hyphenateStyleName(string) { - return string in cache - ? cache[string] - : cache[string] = string - .replace(uppercasePattern, '-$&') - .toLowerCase() - .replace(msPattern, '-ms-'); -} - -module.exports = hyphenateStyleName; - - -/***/ }), -/* 211 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.processStyleName = undefined; -exports.createMarkupForStyles = createMarkupForStyles; - -var _camelizeStyleName = __webpack_require__(193); - -var _camelizeStyleName2 = _interopRequireDefault(_camelizeStyleName); - -var _dangerousStyleValue = __webpack_require__(472); - -var _dangerousStyleValue2 = _interopRequireDefault(_dangerousStyleValue); - -var _hyphenateStyleName = __webpack_require__(194); - -var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName); - -var _memoizeStringOnly = __webpack_require__(195); - -var _memoizeStringOnly2 = _interopRequireDefault(_memoizeStringOnly); - -var _warning = __webpack_require__(2); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var processStyleName = exports.processStyleName = (0, _memoizeStringOnly2.default)(_hyphenateStyleName2.default); /** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CSSPropertyOperations - */ - -if (true) { - // 'msTransform' is correct, but the other prefixes should be capitalized - var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; - - // style values shouldn't contain a semicolon - var badStyleValueWithSemicolonPattern = /;\s*$/; - - var warnedStyleNames = {}; - var warnedStyleValues = {}; - var warnedForNaNValue = false; - - var warnHyphenatedStyleName = function warnHyphenatedStyleName(name, owner) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - true ? (0, _warning2.default)(false, 'Unsupported style property %s. Did you mean %s?%s', name, (0, _camelizeStyleName2.default)(name), checkRenderMessage(owner)) : void 0; - }; - - var warnBadVendoredStyleName = function warnBadVendoredStyleName(name, owner) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - true ? (0, _warning2.default)(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0; - }; - - var warnStyleValueWithSemicolon = function warnStyleValueWithSemicolon(name, value, owner) { - if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { - return; - } - - warnedStyleValues[value] = true; - true ? (0, _warning2.default)(false, 'Style property values shouldn\'t contain a semicolon.%s ' + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0; - }; - - var warnStyleValueIsNaN = function warnStyleValueIsNaN(name, value, owner) { - if (warnedForNaNValue) { - return; - } - - warnedForNaNValue = true; - true ? (0, _warning2.default)(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0; - }; - - var checkRenderMessage = function checkRenderMessage(owner) { - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; - }; - - /** - * @param {string} name - * @param {*} value - * @param {ReactDOMComponent} component - */ - var warnValidStyle = function warnValidStyle(name, value, component) { - //eslint-disable-line no-var - var owner = void 0; - if (component) { - owner = component._currentElement._owner; - } - if (name.indexOf('-') > -1) { - warnHyphenatedStyleName(name, owner); - } else if (badVendoredStyleNamePattern.test(name)) { - warnBadVendoredStyleName(name, owner); - } else if (badStyleValueWithSemicolonPattern.test(value)) { - warnStyleValueWithSemicolon(name, value, owner); - } - - if (typeof value === 'number' && isNaN(value)) { - warnStyleValueIsNaN(name, value, owner); - } - }; -} - -/** - * Serializes a mapping of style properties for use as inline styles: - * - * > createMarkupForStyles({width: '200px', height: 0}) - * "width:200px;height:0;" - * - * Undefined values are ignored so that declarative programming is easier. - * The result should be HTML-escaped before insertion into the DOM. - * - * @param {object} styles - * @param {ReactDOMComponent} component - * @return {?string} - */ - -function createMarkupForStyles(styles, component) { - var serialized = ''; - for (var styleName in styles) { - var isCustomProp = styleName.indexOf('--') === 0; - if (!styles.hasOwnProperty(styleName)) { - continue; - } - if (styleName === 'label') { - continue; - } - var styleValue = styles[styleName]; - if ("development" !== 'production' && !isCustomProp) { - warnValidStyle(styleName, styleValue, component); - } - if (styleValue != null) { - if (isCustomProp) { - serialized += styleName + ':' + styleValue + ';'; - } else { - serialized += processStyleName(styleName) + ':'; - serialized += (0, _dangerousStyleValue2.default)(styleName, styleValue, component) + ';'; - } - } - } - return serialized || null; -} - -/***/ }), -/* 212 */, -/* 213 */, -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var has = Object.prototype.hasOwnProperty; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -}()); - -var compactQueue = function compactQueue(queue) { - var obj; - - while (queue.length) { - var item = queue.pop(); - obj = item.obj[item.prop]; - - if (Array.isArray(obj)) { - var compacted = []; - - for (var j = 0; j < obj.length; ++j) { - if (typeof obj[j] !== 'undefined') { - compacted.push(obj[j]); - } - } - - item.obj[item.prop] = compacted; - } - } - - return obj; -}; - -exports.arrayToObject = function arrayToObject(source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -}; - -exports.merge = function merge(target, source, options) { - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (Array.isArray(target)) { - target.push(source); - } else if (typeof target === 'object') { - if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) { - target[source] = true; - } - } else { - return [target, source]; - } - - return target; - } - - if (typeof target !== 'object') { - return [target].concat(source); - } - - var mergeTarget = target; - if (Array.isArray(target) && !Array.isArray(source)) { - mergeTarget = exports.arrayToObject(target, options); - } - - if (Array.isArray(target) && Array.isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - if (target[i] && typeof target[i] === 'object') { - target[i] = exports.merge(target[i], item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; - - if (has.call(acc, key)) { - acc[key] = exports.merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; - -exports.assign = function assignSingleSource(target, source) { - return Object.keys(source).reduce(function (acc, key) { - acc[key] = source[key]; - return acc; - }, target); -}; - -exports.decode = function (str) { - try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (e) { - return str; - } -}; - -exports.encode = function encode(str) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - var string = typeof str === 'string' ? str : String(str); - - var out = ''; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); - - if ( - c === 0x2D // - - || c === 0x2E // . - || c === 0x5F // _ - || c === 0x7E // ~ - || (c >= 0x30 && c <= 0x39) // 0-9 - || (c >= 0x41 && c <= 0x5A) // a-z - || (c >= 0x61 && c <= 0x7A) // A-Z - ) { - out += string.charAt(i); - continue; - } - - if (c < 0x80) { - out = out + hexTable[c]; - continue; - } - - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += hexTable[0xF0 | (c >> 18)] - + hexTable[0x80 | ((c >> 12) & 0x3F)] - + hexTable[0x80 | ((c >> 6) & 0x3F)] - + hexTable[0x80 | (c & 0x3F)]; - } - - return out; -}; - -exports.compact = function compact(value) { - var queue = [{ obj: { o: value }, prop: 'o' }]; - var refs = []; - - for (var i = 0; i < queue.length; ++i) { - var item = queue[i]; - var obj = item.obj[item.prop]; - - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; ++j) { - var key = keys[j]; - var val = obj[key]; - if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { - queue.push({ obj: obj, prop: key }); - refs.push(val); - } - } - } - - return compactQueue(queue); -}; - -exports.isRegExp = function isRegExp(obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -exports.isBuffer = function isBuffer(obj) { - if (obj === null || typeof obj === 'undefined') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - - -/***/ }), -/* 215 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var replace = String.prototype.replace; -var percentTwenties = /%20/g; - -module.exports = { - 'default': 'RFC3986', - formatters: { - RFC1738: function (value) { - return replace.call(value, percentTwenties, '+'); - }, - RFC3986: function (value) { - return value; - } - }, - RFC1738: 'RFC1738', - RFC3986: 'RFC3986' -}; - - -/***/ }), -/* 216 */ -/***/ (function(module, exports, __webpack_require__) { - -var hide = __webpack_require__(35); -module.exports = function (target, src, safe) { - for (var key in src) { - if (safe && target[key]) target[key] = src[key]; - else hide(target, key, src[key]); - } return target; -}; - - -/***/ }), -/* 217 */ -/***/ (function(module, exports) { - -module.exports = function (it, Constructor, name, forbiddenField) { - if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { - throw TypeError(name + ': incorrect invocation!'); - } return it; -}; - - -/***/ }), -/* 218 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = __webpack_require__(25); -var aFunction = __webpack_require__(67); -var SPECIES = __webpack_require__(14)('species'); -module.exports = function (O, D) { - var C = anObject(O).constructor; - var S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; - - -/***/ }), -/* 219 */ -/***/ (function(module, exports, __webpack_require__) { - -var ctx = __webpack_require__(34); -var invoke = __webpack_require__(495); -var html = __webpack_require__(155); -var cel = __webpack_require__(101); -var global = __webpack_require__(16); -var process = global.process; -var setTask = global.setImmediate; -var clearTask = global.clearImmediate; -var MessageChannel = global.MessageChannel; -var Dispatch = global.Dispatch; -var counter = 0; -var queue = {}; -var ONREADYSTATECHANGE = 'onreadystatechange'; -var defer, channel, port; -var run = function () { - var id = +this; - // eslint-disable-next-line no-prototype-builtins - if (queue.hasOwnProperty(id)) { - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listener = function (event) { - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if (!setTask || !clearTask) { - setTask = function setImmediate(fn) { - var args = []; - var i = 1; - while (arguments.length > i) args.push(arguments[i++]); - queue[++counter] = function () { - // eslint-disable-next-line no-new-func - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id) { - delete queue[id]; - }; - // Node.js 0.8- - if (__webpack_require__(57)(process) == 'process') { - defer = function (id) { - process.nextTick(ctx(run, id, 1)); - }; - // Sphere (JS game engine) Dispatch API - } else if (Dispatch && Dispatch.now) { - defer = function (id) { - Dispatch.now(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if (MessageChannel) { - channel = new MessageChannel(); - port = channel.port2; - channel.port1.onmessage = listener; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { - defer = function (id) { - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listener, false); - // IE8- - } else if (ONREADYSTATECHANGE in cel('script')) { - defer = function (id) { - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function (id) { - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; - - -/***/ }), -/* 220 */ -/***/ (function(module, exports) { - -module.exports = function (exec) { - try { - return { e: false, v: exec() }; - } catch (e) { - return { e: true, v: e }; - } -}; - - -/***/ }), -/* 221 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(25); -var isObject = __webpack_require__(28); -var newPromiseCapability = __webpack_require__(131); - -module.exports = function (C, x) { - anObject(C); - if (isObject(x) && x.constructor === C) return x; - var promiseCapability = newPromiseCapability.f(C); - var resolve = promiseCapability.resolve; - resolve(x); - return promiseCapability.promise; -}; - - -/***/ }), -/* 222 */ -/***/ (function(module, exports, __webpack_require__) { - -var dP = __webpack_require__(24); -var anObject = __webpack_require__(25); -var getKeys = __webpack_require__(56); - -module.exports = __webpack_require__(27) ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = getKeys(Properties); - var length = keys.length; - var i = 0; - var P; - while (length > i) dP.f(O, P = keys[i++], Properties[P]); - return O; -}; - - -/***/ }), -/* 223 */ -/***/ (function(module, exports) { - -module.exports = function (done, value) { - return { value: value, done: !!done }; -}; - - -/***/ }), -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { - -// 7.2.2 IsArray(argument) -var cof = __webpack_require__(57); -module.exports = Array.isArray || function isArray(arg) { - return cof(arg) == 'Array'; -}; - - -/***/ }), -/* 225 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(311), __esModule: true }; - -/***/ }), -/* 226 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _defineProperty = __webpack_require__(153); - -var _defineProperty2 = _interopRequireDefault(_defineProperty); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (obj, key, value) { - if (key in obj) { - (0, _defineProperty2.default)(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -}; - -/***/ }), -/* 227 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.features = undefined; -exports.isModifierPressed = isModifierPressed; -exports.default = handle; - -var _keycode = __webpack_require__(385); - -var _keycode2 = _interopRequireDefault(_keycode); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var features = exports.features = { - FULLSCREEN: 1, - DOWN_PANEL: 2, - LEFT_PANEL: 3, - SHORTCUTS_HELP: 4, - ESCAPE: 5, - NEXT_STORY: 6, - PREV_STORY: 7, - SHOW_SEARCH: 8, - DOWN_PANEL_IN_RIGHT: 9 -}; - -function isModifierPressed(e) { - return (e.ctrlKey || e.keyCode === 91 || e.metaKey) && e.shiftKey; -} - -function focusInInput(e) { - return (/input|textarea/i.test(e.target.tagName) || e.target.getAttribute('contenteditable') !== null - ); -} - -function handle(e) { - if (e.keyCode === (0, _keycode2.default)('escape')) { - // We don't need to preventDefault escape. - // Just getting the event is enough for us. - return features.ESCAPE; - } - if (focusInInput(e)) { - // if we're focused in an element that accepts input, - // then we shouldn't perform a shortcut action - return false; - } - - if (!isModifierPressed(e)) return false; - - switch (e.keyCode) { - case (0, _keycode2.default)('F'): - e.preventDefault(); - return features.FULLSCREEN; - case (0, _keycode2.default)('D'): - e.preventDefault(); - return features.DOWN_PANEL; - case (0, _keycode2.default)('L'): - e.preventDefault(); - return features.LEFT_PANEL; - case (0, _keycode2.default)('right'): - e.preventDefault(); - return features.NEXT_STORY; - case (0, _keycode2.default)('left'): - e.preventDefault(); - return features.PREV_STORY; - case (0, _keycode2.default)('P'): - e.preventDefault(); - return features.SHOW_SEARCH; - case (0, _keycode2.default)('J'): - e.preventDefault(); - return features.DOWN_PANEL_IN_RIGHT; - default: - return false; - } -} - -/***/ }), -/* 228 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = hyphenateProperty; - -var _hyphenateStyleName = __webpack_require__(210); - -var _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function hyphenateProperty(property) { - return (0, _hyphenateStyleName2.default)(property); -} -module.exports = exports['default']; - -/***/ }), -/* 229 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = prefixProperty; - -var _capitalizeString = __webpack_require__(139); - -var _capitalizeString2 = _interopRequireDefault(_capitalizeString); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function prefixProperty(prefixProperties, property, style) { - if (prefixProperties.hasOwnProperty(property)) { - var requiredPrefixes = prefixProperties[property]; - for (var i = 0, len = requiredPrefixes.length; i < len; ++i) { - style[requiredPrefixes[i] + (0, _capitalizeString2.default)(property)] = style[property]; - } - } -} -module.exports = exports['default']; - -/***/ }), -/* 230 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var w = ["Webkit"]; -var m = ["Moz"]; -var ms = ["ms"]; -var wm = ["Webkit", "Moz"]; -var wms = ["Webkit", "ms"]; -var wmms = ["Webkit", "Moz", "ms"]; - -exports.default = { - plugins: [], - prefixMap: { "appearance": wm, "userSelect": wmms, "textEmphasisPosition": w, "textEmphasis": w, "textEmphasisStyle": w, "textEmphasisColor": w, "boxDecorationBreak": w, "clipPath": w, "maskImage": w, "maskMode": w, "maskRepeat": w, "maskPosition": w, "maskClip": w, "maskOrigin": w, "maskSize": w, "maskComposite": w, "mask": w, "maskBorderSource": w, "maskBorderMode": w, "maskBorderSlice": w, "maskBorderWidth": w, "maskBorderOutset": w, "maskBorderRepeat": w, "maskBorder": w, "maskType": w, "textDecorationStyle": w, "textDecorationSkip": w, "textDecorationLine": w, "textDecorationColor": w, "filter": w, "fontFeatureSettings": w, "breakAfter": wmms, "breakBefore": wmms, "breakInside": wmms, "columnCount": wm, "columnFill": wm, "columnGap": wm, "columnRule": wm, "columnRuleColor": wm, "columnRuleStyle": wm, "columnRuleWidth": wm, "columns": wm, "columnSpan": wm, "columnWidth": wm, "writingMode": wms, "flex": w, "flexBasis": w, "flexDirection": w, "flexGrow": w, "flexFlow": w, "flexShrink": w, "flexWrap": w, "alignContent": w, "alignItems": w, "alignSelf": w, "justifyContent": w, "order": w, "transform": w, "transformOrigin": w, "transformOriginX": w, "transformOriginY": w, "backfaceVisibility": w, "perspective": w, "perspectiveOrigin": w, "transformStyle": w, "transformOriginZ": w, "animation": w, "animationDelay": w, "animationDirection": w, "animationFillMode": w, "animationDuration": w, "animationIterationCount": w, "animationName": w, "animationPlayState": w, "animationTimingFunction": w, "backdropFilter": w, "fontKerning": w, "scrollSnapType": wms, "scrollSnapPointsX": wms, "scrollSnapPointsY": wms, "scrollSnapDestination": wms, "scrollSnapCoordinate": wms, "shapeImageThreshold": w, "shapeImageMargin": w, "shapeImageOutside": w, "hyphens": wmms, "flowInto": wms, "flowFrom": wms, "regionFragment": wms, "textAlignLast": m, "tabSize": m, "wrapFlow": ms, "wrapThrough": ms, "wrapMargin": ms, "gridTemplateColumns": ms, "gridTemplateRows": ms, "gridTemplateAreas": ms, "gridTemplate": ms, "gridAutoColumns": ms, "gridAutoRows": ms, "gridAutoFlow": ms, "grid": ms, "gridRowStart": ms, "gridColumnStart": ms, "gridRowEnd": ms, "gridRow": ms, "gridColumn": ms, "gridColumnEnd": ms, "gridColumnGap": ms, "gridRowGap": ms, "gridArea": ms, "gridGap": ms, "textSizeAdjust": wms, "borderImage": w, "borderImageOutset": w, "borderImageRepeat": w, "borderImageSlice": w, "borderImageSource": w, "borderImageWidth": w, "transitionDelay": w, "transitionDuration": w, "transitionProperty": w, "transitionTimingFunction": w } -}; -module.exports = exports["default"]; - -/***/ }), -/* 231 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = cursor; -var prefixes = ['-webkit-', '-moz-', '']; - -var values = { - 'zoom-in': true, - 'zoom-out': true, - grab: true, - grabbing: true -}; - -function cursor(property, value) { - if (property === 'cursor' && values.hasOwnProperty(value)) { - return prefixes.map(function (prefix) { - return prefix + value; - }); - } -} -module.exports = exports['default']; - -/***/ }), -/* 232 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = crossFade; - -var _isPrefixedValue = __webpack_require__(64); - -var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// http://caniuse.com/#search=cross-fade -var prefixes = ['-webkit-', '']; -function crossFade(property, value) { - if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.indexOf('cross-fade(') > -1) { - return prefixes.map(function (prefix) { - return value.replace(/cross-fade\(/g, prefix + 'cross-fade('); - }); - } -} -module.exports = exports['default']; - -/***/ }), -/* 233 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = filter; - -var _isPrefixedValue = __webpack_require__(64); - -var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// http://caniuse.com/#feat=css-filter-function -var prefixes = ['-webkit-', '']; -function filter(property, value) { - if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.indexOf('filter(') > -1) { - return prefixes.map(function (prefix) { - return value.replace(/filter\(/g, prefix + 'filter('); - }); - } -} -module.exports = exports['default']; - -/***/ }), -/* 234 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = flex; -var values = { - flex: ['-webkit-box', '-moz-box', '-ms-flexbox', '-webkit-flex', 'flex'], - 'inline-flex': ['-webkit-inline-box', '-moz-inline-box', '-ms-inline-flexbox', '-webkit-inline-flex', 'inline-flex'] -}; - -function flex(property, value) { - if (property === 'display' && values.hasOwnProperty(value)) { - return values[value]; - } -} -module.exports = exports['default']; - -/***/ }), -/* 235 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = flexboxOld; -var alternativeValues = { - 'space-around': 'justify', - 'space-between': 'justify', - 'flex-start': 'start', - 'flex-end': 'end', - 'wrap-reverse': 'multiple', - wrap: 'multiple' -}; - -var alternativeProps = { - alignItems: 'WebkitBoxAlign', - justifyContent: 'WebkitBoxPack', - flexWrap: 'WebkitBoxLines' -}; - -function flexboxOld(property, value, style) { - if (property === 'flexDirection' && typeof value === 'string') { - if (value.indexOf('column') > -1) { - style.WebkitBoxOrient = 'vertical'; - } else { - style.WebkitBoxOrient = 'horizontal'; - } - if (value.indexOf('reverse') > -1) { - style.WebkitBoxDirection = 'reverse'; - } else { - style.WebkitBoxDirection = 'normal'; - } - } - if (alternativeProps.hasOwnProperty(property)) { - style[alternativeProps[property]] = alternativeValues[value] || value; - } -} -module.exports = exports['default']; - -/***/ }), -/* 236 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = gradient; - -var _isPrefixedValue = __webpack_require__(64); - -var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var prefixes = ['-webkit-', '-moz-', '']; - -var values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/; - -function gradient(property, value) { - if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && values.test(value)) { - return prefixes.map(function (prefix) { - return prefix + value; - }); - } -} -module.exports = exports['default']; - -/***/ }), -/* 237 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = imageSet; - -var _isPrefixedValue = __webpack_require__(64); - -var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// http://caniuse.com/#feat=css-image-set -var prefixes = ['-webkit-', '']; -function imageSet(property, value) { - if (typeof value === 'string' && !(0, _isPrefixedValue2.default)(value) && value.indexOf('image-set(') > -1) { - return prefixes.map(function (prefix) { - return value.replace(/image-set\(/g, prefix + 'image-set('); - }); - } -} -module.exports = exports['default']; - -/***/ }), -/* 238 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = position; -function position(property, value) { - if (property === 'position' && value === 'sticky') { - return ['-webkit-sticky', 'sticky']; - } -} -module.exports = exports['default']; - -/***/ }), -/* 239 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = sizing; -var prefixes = ['-webkit-', '-moz-', '']; - -var properties = { - maxHeight: true, - maxWidth: true, - width: true, - height: true, - columnWidth: true, - minWidth: true, - minHeight: true -}; -var values = { - 'min-content': true, - 'max-content': true, - 'fill-available': true, - 'fit-content': true, - 'contain-floats': true -}; - -function sizing(property, value) { - if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) { - return prefixes.map(function (prefix) { - return prefix + value; - }); - } -} -module.exports = exports['default']; - -/***/ }), -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = transition; - -var _hyphenateProperty = __webpack_require__(228); - -var _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty); - -var _isPrefixedValue = __webpack_require__(64); - -var _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue); - -var _capitalizeString = __webpack_require__(139); - -var _capitalizeString2 = _interopRequireDefault(_capitalizeString); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var properties = { - transition: true, - transitionProperty: true, - WebkitTransition: true, - WebkitTransitionProperty: true, - MozTransition: true, - MozTransitionProperty: true -}; - - -var prefixMapping = { - Webkit: '-webkit-', - Moz: '-moz-', - ms: '-ms-' -}; - -function prefixValue(value, propertyPrefixMap) { - if ((0, _isPrefixedValue2.default)(value)) { - return value; - } - - // only split multi values, not cubic beziers - var multipleValues = value.split(/,(?![^()]*(?:\([^()]*\))?\))/g); - - for (var i = 0, len = multipleValues.length; i < len; ++i) { - var singleValue = multipleValues[i]; - var values = [singleValue]; - for (var property in propertyPrefixMap) { - var dashCaseProperty = (0, _hyphenateProperty2.default)(property); - - if (singleValue.indexOf(dashCaseProperty) > -1 && dashCaseProperty !== 'order') { - var prefixes = propertyPrefixMap[property]; - for (var j = 0, pLen = prefixes.length; j < pLen; ++j) { - // join all prefixes and create a new value - values.unshift(singleValue.replace(dashCaseProperty, prefixMapping[prefixes[j]] + dashCaseProperty)); - } - } - } - - multipleValues[i] = values.join(','); - } - - return multipleValues.join(','); -} - -function transition(property, value, style, propertyPrefixMap) { - // also check for already prefixed transitions - if (typeof value === 'string' && properties.hasOwnProperty(property)) { - var outputValue = prefixValue(value, propertyPrefixMap); - // if the property is already prefixed - var webkitOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) { - return !/-moz-|-ms-/.test(val); - }).join(','); - - if (property.indexOf('Webkit') > -1) { - return webkitOutput; - } - - var mozOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) { - return !/-webkit-|-ms-/.test(val); - }).join(','); - - if (property.indexOf('Moz') > -1) { - return mozOutput; - } - - style['Webkit' + (0, _capitalizeString2.default)(property)] = webkitOutput; - style['Moz' + (0, _capitalizeString2.default)(property)] = mozOutput; - return outputValue; - } -} -module.exports = exports['default']; - -/***/ }), -/* 241 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeProvider", function() { return ThemeProvider; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withTheme", function() { return withTheme; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return A; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Abbr", function() { return Abbr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Acronym", function() { return Acronym; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Address", function() { return Address; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Applet", function() { return Applet; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Area", function() { return Area; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Article", function() { return Article; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Aside", function() { return Aside; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Audio", function() { return Audio; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return B; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Base", function() { return Base; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Basefont", function() { return Basefont; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Bdi", function() { return Bdi; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Bdo", function() { return Bdo; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Bgsound", function() { return Bgsound; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Big", function() { return Big; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Blink", function() { return Blink; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Blockquote", function() { return Blockquote; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Body", function() { return Body; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Br", function() { return Br; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return Button; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Canvas", function() { return Canvas; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Caption", function() { return Caption; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Center", function() { return Center; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cite", function() { return Cite; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Code", function() { return Code; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Col", function() { return Col; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Colgroup", function() { return Colgroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Command", function() { return Command; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Content", function() { return Content; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Data", function() { return Data; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Datalist", function() { return Datalist; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dd", function() { return Dd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Del", function() { return Del; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Details", function() { return Details; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dfn", function() { return Dfn; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dialog", function() { return Dialog; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dir", function() { return Dir; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Div", function() { return Div; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dl", function() { return Dl; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Dt", function() { return Dt; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Element", function() { return Element; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Em", function() { return Em; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Embed", function() { return Embed; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Fieldset", function() { return Fieldset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Figcaption", function() { return Figcaption; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Figure", function() { return Figure; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Font", function() { return Font; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Footer", function() { return Footer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Form", function() { return Form; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Frame", function() { return Frame; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Frameset", function() { return Frameset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H1", function() { return H1; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H2", function() { return H2; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H3", function() { return H3; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H4", function() { return H4; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H5", function() { return H5; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H6", function() { return H6; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Head", function() { return Head; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Header", function() { return Header; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hgroup", function() { return Hgroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hr", function() { return Hr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Html", function() { return Html; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return I; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iframe", function() { return Iframe; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Image", function() { return Image; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Img", function() { return Img; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Input", function() { return Input; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ins", function() { return Ins; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Isindex", function() { return Isindex; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Kbd", function() { return Kbd; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Keygen", function() { return Keygen; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Label", function() { return Label; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Legend", function() { return Legend; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Li", function() { return Li; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return Link; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Listing", function() { return Listing; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Main", function() { return Main; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MapTag", function() { return MapTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mark", function() { return Mark; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Marquee", function() { return Marquee; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MathTag", function() { return MathTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Menu", function() { return Menu; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Menuitem", function() { return Menuitem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Meta", function() { return Meta; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Meter", function() { return Meter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Multicol", function() { return Multicol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nav", function() { return Nav; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nextid", function() { return Nextid; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Nobr", function() { return Nobr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Noembed", function() { return Noembed; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Noframes", function() { return Noframes; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Noscript", function() { return Noscript; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectTag", function() { return ObjectTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ol", function() { return Ol; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optgroup", function() { return Optgroup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Option", function() { return Option; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Output", function() { return Output; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "P", function() { return P; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Param", function() { return Param; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Picture", function() { return Picture; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Plaintext", function() { return Plaintext; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Pre", function() { return Pre; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Progress", function() { return Progress; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Q", function() { return Q; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rb", function() { return Rb; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rbc", function() { return Rbc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rp", function() { return Rp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rt", function() { return Rt; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rtc", function() { return Rtc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ruby", function() { return Ruby; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "S", function() { return S; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Samp", function() { return Samp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Script", function() { return Script; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Section", function() { return Section; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Select", function() { return Select; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Shadow", function() { return Shadow; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Slot", function() { return Slot; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Small", function() { return Small; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Source", function() { return Source; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Spacer", function() { return Spacer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Span", function() { return Span; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Strike", function() { return Strike; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Strong", function() { return Strong; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Style", function() { return Style; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sub", function() { return Sub; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Summary", function() { return Summary; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sup", function() { return Sup; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Svg", function() { return Svg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Table", function() { return Table; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tbody", function() { return Tbody; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Td", function() { return Td; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Template", function() { return Template; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Textarea", function() { return Textarea; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tfoot", function() { return Tfoot; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Th", function() { return Th; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Thead", function() { return Thead; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Time", function() { return Time; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Title", function() { return Title; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tr", function() { return Tr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Track", function() { return Track; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tt", function() { return Tt; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "U", function() { return U; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ul", function() { return Ul; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Var", function() { return Var; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Video", function() { return Video; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Wbr", function() { return Wbr; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Xmp", function() { return Xmp; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AltGlyph", function() { return AltGlyph; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AltGlyphDef", function() { return AltGlyphDef; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AltGlyphItem", function() { return AltGlyphItem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Animate", function() { return Animate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateColor", function() { return AnimateColor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateMotion", function() { return AnimateMotion; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimateTransform", function() { return AnimateTransform; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Animation", function() { return Animation; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Circle", function() { return Circle; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClipPath", function() { return ClipPath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorProfile", function() { return ColorProfile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Cursor", function() { return Cursor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Defs", function() { return Defs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Desc", function() { return Desc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Discard", function() { return Discard; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ellipse", function() { return Ellipse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeBlend", function() { return FeBlend; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeColorMatrix", function() { return FeColorMatrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeComponentTransfer", function() { return FeComponentTransfer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeComposite", function() { return FeComposite; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeConvolveMatrix", function() { return FeConvolveMatrix; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeDiffuseLighting", function() { return FeDiffuseLighting; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeDisplacementMap", function() { return FeDisplacementMap; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeDistantLight", function() { return FeDistantLight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeDropShadow", function() { return FeDropShadow; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeFlood", function() { return FeFlood; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeFuncA", function() { return FeFuncA; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeFuncB", function() { return FeFuncB; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeFuncG", function() { return FeFuncG; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeFuncR", function() { return FeFuncR; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeGaussianBlur", function() { return FeGaussianBlur; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeImage", function() { return FeImage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeMerge", function() { return FeMerge; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeMergeNode", function() { return FeMergeNode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeMorphology", function() { return FeMorphology; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeOffset", function() { return FeOffset; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FePointLight", function() { return FePointLight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeSpecularLighting", function() { return FeSpecularLighting; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeSpotLight", function() { return FeSpotLight; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeTile", function() { return FeTile; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FeTurbulence", function() { return FeTurbulence; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Filter", function() { return Filter; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFace", function() { return FontFace; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFaceFormat", function() { return FontFaceFormat; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFaceName", function() { return FontFaceName; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFaceSrc", function() { return FontFaceSrc; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FontFaceUri", function() { return FontFaceUri; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ForeignObject", function() { return ForeignObject; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return G; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Glyph", function() { return Glyph; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GlyphRef", function() { return GlyphRef; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Handler", function() { return Handler; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hatch", function() { return Hatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hatchpath", function() { return Hatchpath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Hkern", function() { return Hkern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Line", function() { return Line; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinearGradient", function() { return LinearGradient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Listener", function() { return Listener; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Marker", function() { return Marker; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mask", function() { return Mask; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mesh", function() { return Mesh; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Meshgradient", function() { return Meshgradient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Meshpatch", function() { return Meshpatch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Meshrow", function() { return Meshrow; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Metadata", function() { return Metadata; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MissingGlyph", function() { return MissingGlyph; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Mpath", function() { return Mpath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Path", function() { return Path; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Pattern", function() { return Pattern; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Polygon", function() { return Polygon; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Polyline", function() { return Polyline; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Prefetch", function() { return Prefetch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadialGradient", function() { return RadialGradient; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rect", function() { return Rect; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SetTag", function() { return SetTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SolidColor", function() { return SolidColor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Solidcolor", function() { return Solidcolor; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Stop", function() { return Stop; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tbreak", function() { return Tbreak; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Text", function() { return Text; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextArea", function() { return TextArea; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextPath", function() { return TextPath; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tref", function() { return Tref; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tspan", function() { return Tspan; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Unknown", function() { return Unknown; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Use", function() { return Use; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "View", function() { return View; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vkern", function() { return Vkern; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_glamor__ = __webpack_require__(470); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_glamor___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_glamor__); - - - -var htmlTagNames = [ - "a", - "abbr", - "acronym", - "address", - "applet", - "area", - "article", - "aside", - "audio", - "b", - "base", - "basefont", - "bdi", - "bdo", - "bgsound", - "big", - "blink", - "blockquote", - "body", - "br", - "button", - "canvas", - "caption", - "center", - "cite", - "code", - "col", - "colgroup", - "command", - "content", - "data", - "datalist", - "dd", - "del", - "details", - "dfn", - "dialog", - "dir", - "div", - "dl", - "dt", - "element", - "em", - "embed", - "fieldset", - "figcaption", - "figure", - "font", - "footer", - "form", - "frame", - "frameset", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - "head", - "header", - "hgroup", - "hr", - "html", - "i", - "iframe", - "image", - "img", - "input", - "ins", - "isindex", - "kbd", - "keygen", - "label", - "legend", - "li", - "link", - "listing", - "main", - "map", - "mark", - "marquee", - "math", - "menu", - "menuitem", - "meta", - "meter", - "multicol", - "nav", - "nextid", - "nobr", - "noembed", - "noframes", - "noscript", - "object", - "ol", - "optgroup", - "option", - "output", - "p", - "param", - "picture", - "plaintext", - "pre", - "progress", - "q", - "rb", - "rbc", - "rp", - "rt", - "rtc", - "ruby", - "s", - "samp", - "script", - "section", - "select", - "shadow", - "slot", - "small", - "source", - "spacer", - "span", - "strike", - "strong", - "style", - "sub", - "summary", - "sup", - "svg", - "table", - "tbody", - "td", - "template", - "textarea", - "tfoot", - "th", - "thead", - "time", - "title", - "tr", - "track", - "tt", - "u", - "ul", - "var", - "video", - "wbr", - "xmp" -] -; - -var svgTagNames = [ - "a", - "altGlyph", - "altGlyphDef", - "altGlyphItem", - "animate", - "animateColor", - "animateMotion", - "animateTransform", - "animation", - "audio", - "canvas", - "circle", - "clipPath", - "color-profile", - "cursor", - "defs", - "desc", - "discard", - "ellipse", - "feBlend", - "feColorMatrix", - "feComponentTransfer", - "feComposite", - "feConvolveMatrix", - "feDiffuseLighting", - "feDisplacementMap", - "feDistantLight", - "feDropShadow", - "feFlood", - "feFuncA", - "feFuncB", - "feFuncG", - "feFuncR", - "feGaussianBlur", - "feImage", - "feMerge", - "feMergeNode", - "feMorphology", - "feOffset", - "fePointLight", - "feSpecularLighting", - "feSpotLight", - "feTile", - "feTurbulence", - "filter", - "font", - "font-face", - "font-face-format", - "font-face-name", - "font-face-src", - "font-face-uri", - "foreignObject", - "g", - "glyph", - "glyphRef", - "handler", - "hatch", - "hatchpath", - "hkern", - "iframe", - "image", - "line", - "linearGradient", - "listener", - "marker", - "mask", - "mesh", - "meshgradient", - "meshpatch", - "meshrow", - "metadata", - "missing-glyph", - "mpath", - "path", - "pattern", - "polygon", - "polyline", - "prefetch", - "radialGradient", - "rect", - "script", - "set", - "solidColor", - "solidcolor", - "stop", - "style", - "svg", - "switch", - "symbol", - "tbreak", - "text", - "textArea", - "textPath", - "title", - "tref", - "tspan", - "unknown", - "use", - "video", - "view", - "vkern" -] -; - -var domElements = htmlTagNames.concat(svgTagNames).filter(function (tag, index, array) { - return array.indexOf(tag) === index; -}); - -var CHANNEL = '__glamorous__'; /* istanbul ignore next */ - -var isPreact = false; - -var _PropTypes = void 0; - -/* istanbul ignore next */ -if (isPreact) { - if (!__WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes) { - _PropTypes = function PropTypes() { - return _PropTypes; - }; - - ['array', 'bool', 'func', 'number', 'object', 'string', 'symbol', 'any', 'arrayOf', 'element', 'instanceOf', 'node', 'objectOf', 'oneOf', 'oneOfType', 'shape', 'exact'].forEach(function (type) { - _PropTypes[type] = _PropTypes; - }); - } - // copied from preact-compat - /* eslint-disable no-eq-null, eqeqeq, consistent-return */ - if (!__WEBPACK_IMPORTED_MODULE_0_react___default.a.Children) { - var Children = { - map: function map(children, fn, ctx) { - if (children == null) { - return null; - } - children = Children.toArray(children); - if (ctx && ctx !== children) { - fn = fn.bind(ctx); - } - return children.map(fn); - }, - forEach: function forEach(children, fn, ctx) { - if (children == null) { - return null; - } - children = Children.toArray(children); - if (ctx && ctx !== children) { - fn = fn.bind(ctx); - } - children.forEach(fn); - }, - count: function count(children) { - return children && children.length || 0; - }, - only: function only(children) { - children = Children.toArray(children); - if (children.length !== 1) { - throw new Error('Children.only() expects only one child.'); - } - return children[0]; - }, - toArray: function toArray(children) { - if (children == null) { - return []; - } - return [].concat(children); - } - }; - __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children = Children; - } - /* eslint-enable no-eq-null, eqeqeq, consistent-return */ -} else if (parseFloat(__WEBPACK_IMPORTED_MODULE_0_react___default.a.version.slice(0, 4)) >= 15.5) { - /* istanbul ignore next */ - try { - _PropTypes = __webpack_require__(3); - /* istanbul ignore next */ - } catch (error) { - // ignore - } -} -/* istanbul ignore next */ -_PropTypes = _PropTypes || __WEBPACK_IMPORTED_MODULE_0_react___default.a.PropTypes; - - - -/* -eslint - import/no-mutable-exports:0, - import/prefer-default-export:0, - react/no-deprecated:0 - */ - -var classCallCheck = function (instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -}; - -var createClass = function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - - return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps); - if (staticProps) defineProperties(Constructor, staticProps); - return Constructor; - }; -}(); - - - - - -var defineProperty = function (obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; -}; - -var _extends = Object.assign || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - - - -var inherits = function (subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - } - - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: false, - writable: true, - configurable: true - } - }); - if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; -}; - - - - - - - - - -var objectWithoutProperties = function (obj, keys) { - var target = {}; - - for (var i in obj) { - if (keys.indexOf(i) >= 0) continue; - if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; - target[i] = obj[i]; - } - - return target; -}; - -var possibleConstructorReturn = function (self, call) { - if (!self) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - - return call && (typeof call === "object" || typeof call === "function") ? call : self; -}; - - - - - - - - - - - - - - - - - - - -var toConsumableArray = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } else { - return Array.from(arr); - } -}; - -function generateWarningMessage(Comp) { - var componentName = Comp.displayName || Comp.name || 'FunctionComponent'; - // eslint-disable-next-line max-len - return 'glamorous warning: Expected component called "' + componentName + '" which uses withTheme to be within a ThemeProvider but none was found.'; -} - -function withTheme(ComponentToTheme) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$noWarn = _ref.noWarn, - noWarn = _ref$noWarn === undefined ? false : _ref$noWarn, - _ref$createElement = _ref.createElement, - createElement = _ref$createElement === undefined ? true : _ref$createElement; - - var ThemedComponent = function (_React$Component) { - inherits(ThemedComponent, _React$Component); - - function ThemedComponent() { - var _ref2; - - var _temp, _this, _ret; - - classCallCheck(this, ThemedComponent); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref2 = ThemedComponent.__proto__ || Object.getPrototypeOf(ThemedComponent)).call.apply(_ref2, [this].concat(args))), _this), _this.warned = noWarn, _this.state = { theme: {} }, _this.setTheme = function (theme) { - return _this.setState({ theme: theme }); - }, _temp), possibleConstructorReturn(_this, _ret); - } - - createClass(ThemedComponent, [{ - key: 'componentWillMount', - - - // eslint-disable-next-line complexity - value: function componentWillMount() { - if (!this.context[CHANNEL]) { - if ("development" !== 'production' && !this.warned) { - this.warned = true; - // eslint-disable-next-line no-console - console.warn(generateWarningMessage(ComponentToTheme)); - } - } - var theme = this.props.theme; - - if (this.context[CHANNEL]) { - // if a theme is provided via props, - // it takes precedence over context - this.setTheme(theme ? theme : this.context[CHANNEL].getState()); - } else { - this.setTheme(theme || {}); - } - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (this.props.theme !== nextProps.theme) { - this.setTheme(nextProps.theme); - } - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - if (this.context[CHANNEL] && !this.props.theme) { - // subscribe to future theme changes - this.subscriptionId = this.context[CHANNEL].subscribe(this.setTheme); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - // cleanup subscription - this.subscriptionId && this.context[CHANNEL].unsubscribe(this.subscriptionId); - } - }, { - key: 'render', - value: function render() { - if (createElement) { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(ComponentToTheme, _extends({}, this.props, this.state)); - } else { - // this allows us to effectively use the GlamorousComponent - // as our `render` method without going through lifecycle hooks. - // Also allows us to forward the context in the scenario where - // a user wants to add more context. - // eslint-disable-next-line babel/new-cap - return ComponentToTheme.call(this, _extends({}, this.props, this.state), this.context); - } - } - }]); - return ThemedComponent; - }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - - ThemedComponent.propTypes = { - theme: _PropTypes.object - }; - - - var defaultContextTypes = defineProperty({}, CHANNEL, _PropTypes.object); - - var userDefinedContextTypes = null; - - // configure the contextTypes to be settable by the user, - // however also retaining the glamorous channel. - Object.defineProperty(ThemedComponent, 'contextTypes', { - enumerable: true, - configurable: true, - set: function set$$1(value) { - userDefinedContextTypes = value; - }, - get: function get$$1() { - // if the user has provided a contextTypes definition, - // merge the default context types with the provided ones. - if (userDefinedContextTypes) { - return _extends({}, defaultContextTypes, userDefinedContextTypes); - } - return defaultContextTypes; - } - }); - - return ThemedComponent; -} - -var isFunction_1 = isFunction; - -var toString = Object.prototype.toString; - -function isFunction (fn) { - var string = toString.call(fn); - return string === '[object Function]' || - (typeof fn === 'function' && string !== '[object RegExp]') || - (typeof window !== 'undefined' && - // IE8 and below - (fn === window.setTimeout || - fn === window.alert || - fn === window.confirm || - fn === window.prompt)) -} - -/*! - * isobject <https://github.com/jonschlinkert/isobject> - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -var isobject = function isObject(val) { - return val != null && typeof val === 'object' && Array.isArray(val) === false; -}; - -function isObjectObject(o) { - return isobject(o) === true - && Object.prototype.toString.call(o) === '[object Object]'; -} - -var isPlainObject = function isPlainObject(o) { - var ctor,prot; - - if (isObjectObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (typeof ctor !== 'function') return false; - - // If has modified prototype - prot = ctor.prototype; - if (isObjectObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -}; - -function createBroadcast (initialState) { - var listeners = {}; - var id = 1; - var _state = initialState; - - function getState () { - return _state - } - - function setState (state) { - _state = state; - var keys = Object.keys(listeners); - var i = 0; - var len = keys.length; - for (; i < len; i++) { - // if a listener gets unsubscribed during setState we just skip it - if (listeners[keys[i]]) { listeners[keys[i]](state); } - } - } - - // subscribe to changes and return the subscriptionId - function subscribe (listener) { - if (typeof listener !== 'function') { - throw new Error('listener must be a function.') - } - var currentId = id; - listeners[currentId] = listener; - id += 1; - return currentId - } - - // remove subscription by removing the listener function - function unsubscribe (id) { - listeners[id] = undefined; - } - - return { getState: getState, setState: setState, subscribe: subscribe, unsubscribe: unsubscribe } -} - -/** - * This is a component which will provide a theme to the entire tree - * via context and event listener - * (because pure components block context updates) - * inspired by the styled-components implementation - * https://github.com/styled-components/styled-components - * @param {Object} theme the theme object.. - */ - -var ThemeProvider = function (_React$Component) { - inherits(ThemeProvider, _React$Component); - - function ThemeProvider() { - var _ref; - - var _temp, _this, _ret; - - classCallCheck(this, ThemeProvider); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = possibleConstructorReturn(this, (_ref = ThemeProvider.__proto__ || Object.getPrototypeOf(ThemeProvider)).call.apply(_ref, [this].concat(args))), _this), _this.broadcast = createBroadcast(_this.props.theme), _this.setOuterTheme = function (theme) { - _this.outerTheme = theme; - }, _temp), possibleConstructorReturn(_this, _ret); - } - - createClass(ThemeProvider, [{ - key: 'getTheme', - - - // create theme, by merging with outer theme, if present - value: function getTheme(passedTheme) { - var theme = passedTheme || this.props.theme; - if (isFunction_1(theme)) { - var mergedTheme = theme(this.outerTheme); - if (!isPlainObject(mergedTheme)) { - throw new Error('[ThemeProvider] Please return an object from your theme function, ' + 'i.e. theme={() => ({})}!'); - } - return mergedTheme; - } - return _extends({}, this.outerTheme, theme); - } - }, { - key: 'getChildContext', - value: function getChildContext() { - return defineProperty({}, CHANNEL, this.broadcast); - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - // create a new subscription for keeping track of outer theme, if present - if (this.context[CHANNEL]) { - this.subscriptionId = this.context[CHANNEL].subscribe(this.setOuterTheme); - } - } - }, { - key: 'componentWillMount', - value: function componentWillMount() { - // set broadcast state by merging outer theme with own - if (this.context[CHANNEL]) { - this.setOuterTheme(this.context[CHANNEL].getState()); - this.broadcast.setState(this.getTheme()); - } - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (this.props.theme !== nextProps.theme) { - this.broadcast.setState(this.getTheme(nextProps.theme)); - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.subscriptionId && this.context[CHANNEL].unsubscribe(this.subscriptionId); - } - }, { - key: 'render', - value: function render() { - return this.props.children ? __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.only(this.props.children) : null; - } - }]); - return ThemeProvider; -}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); - -ThemeProvider.childContextTypes = defineProperty({}, CHANNEL, _PropTypes.object.isRequired); - -ThemeProvider.contextTypes = defineProperty({}, CHANNEL, _PropTypes.object); - -ThemeProvider.propTypes = { - theme: _PropTypes.oneOfType([_PropTypes.object, _PropTypes.func]).isRequired, - children: _PropTypes.node -}; - -/** - * This function takes a className string and gets all the - * associated glamor styles. It's used to merge glamor styles - * from a className to make sure that specificity is not - * a problem when passing a className to a component. - * @param {String} [className=''] the className string - * @return {Object} { glamorStyles, glamorlessClassName } - * - glamorStyles is an array of all the glamor styles objects - * - glamorlessClassName is the rest of the className string - * without the glamor classNames - */ -function extractGlamorStyles(className) { - var glamorlessClassName = []; - var glamorStyles = []; - className.toString().split(' ').forEach(function (name) { - if (name.indexOf('css-') === 0) { - var style = buildGlamorSrcFromClassName(name); - glamorStyles.push(style); - } else { - glamorlessClassName.push(name); - } - }); - - return { glamorlessClassName: glamorlessClassName, glamorStyles: glamorStyles }; -} - -/** Glamor's css function returns an object with the shape - * - * { - * [`data-css-${hash}`]: '', - * toString() { return `css-${hash}` } - * } - * - * Whenever glamor's build function encounters an object with - * this shape it just pulls the resulting styles from the cache. - * - * note: the toString method is not needed to qualify the shape -**/ -function buildGlamorSrcFromClassName(className) { - return defineProperty({}, 'data-' + className, ''); -} - -function getGlamorClassName$1(_ref2) { - var styles = _ref2.styles, - props = _ref2.props, - cssOverrides = _ref2.cssOverrides, - cssProp = _ref2.cssProp, - context = _ref2.context, - displayName = _ref2.displayName; - - var _handleStyles = handleStyles([].concat(toConsumableArray(styles), [props.className, cssOverrides, cssProp]), props, context), - mappedArgs = _handleStyles.mappedArgs, - nonGlamorClassNames = _handleStyles.nonGlamorClassNames; - // eslint-disable-next-line max-len - - - var isDev = "development" === 'development' || !"development"; - var devRules = isDev ? { label: displayName } : null; - var glamorClassName = __WEBPACK_IMPORTED_MODULE_1_glamor__["css"].apply(undefined, [devRules].concat(toConsumableArray(mappedArgs))).toString(); - var extras = nonGlamorClassNames.join(' ').trim(); - return (glamorClassName + ' ' + extras).trim(); -} - -// this next function is on a "hot" code-path -// so it's pretty complex to make sure it's fast. -// eslint-disable-next-line complexity -function handleStyles(styles, props, context) { - var current = void 0; - var mappedArgs = []; - var nonGlamorClassNames = []; - for (var i = 0; i < styles.length; i++) { - current = styles[i]; - if (typeof current === 'function') { - var result = current(props, context); - if (typeof result === 'string') { - var _extractGlamorStyles = extractGlamorStyles(result), - glamorStyles = _extractGlamorStyles.glamorStyles, - glamorlessClassName = _extractGlamorStyles.glamorlessClassName; - - mappedArgs.push.apply(mappedArgs, toConsumableArray(glamorStyles)); - nonGlamorClassNames.push.apply(nonGlamorClassNames, toConsumableArray(glamorlessClassName)); - } else { - mappedArgs.push(result); - } - } else if (typeof current === 'string') { - var _extractGlamorStyles2 = extractGlamorStyles(current), - _glamorStyles = _extractGlamorStyles2.glamorStyles, - _glamorlessClassName = _extractGlamorStyles2.glamorlessClassName; - - mappedArgs.push.apply(mappedArgs, toConsumableArray(_glamorStyles)); - nonGlamorClassNames.push.apply(nonGlamorClassNames, toConsumableArray(_glamorlessClassName)); - } else if (Array.isArray(current)) { - var recursed = handleStyles(current, props, context); - mappedArgs.push.apply(mappedArgs, toConsumableArray(recursed.mappedArgs)); - nonGlamorClassNames.push.apply(nonGlamorClassNames, toConsumableArray(recursed.nonGlamorClassNames)); - } else { - mappedArgs.push(current); - } - } - return { mappedArgs: mappedArgs, nonGlamorClassNames: nonGlamorClassNames }; -} - -/* - * This is a relatively small abstraction that's ripe for open sourcing. - * Documentation is in the README.md - */ -function createGlamorous$1(splitProps) { - return glamorous; - - /** - * This is the main export and the function that people - * interact with most directly. - * - * It accepts a component which can be a string or - * a React Component and returns - * a "glamorousComponentFactory" - * @param {String|ReactComponent} comp the component to render - * @param {Object} options helpful info for the GlamorousComponents - * @return {Function} the glamorousComponentFactory - */ - function glamorous(comp) { - var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var rootEl = config.rootEl, - displayName = config.displayName, - shouldClassNameUpdate = config.shouldClassNameUpdate, - _config$filterProps = config.filterProps, - filterProps = _config$filterProps === undefined ? [] : _config$filterProps, - _config$forwardProps = config.forwardProps, - forwardProps = _config$forwardProps === undefined ? [] : _config$forwardProps, - _config$propsAreCssOv = config.propsAreCssOverrides, - propsAreCssOverrides = _config$propsAreCssOv === undefined ? comp.propsAreCssOverrides : _config$propsAreCssOv, - basePropsToApply = config.withProps; - - Object.assign(glamorousComponentFactory, { withConfig: withConfig }); - return glamorousComponentFactory; - - function withConfig(newConfig) { - return glamorous(comp, _extends({}, config, newConfig)); - } - - /** - * This returns a React Component that renders the comp (closure) - * with a className based on the given glamor styles object(s) - * @param {...Object|Function} styles the styles to create with glamor. - * If any of these are functions, they are invoked with the component - * props and the return value is used. - * @return {ReactComponent} the ReactComponent function - */ - function glamorousComponentFactory() { - for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) { - styles[_key] = arguments[_key]; - } - - /** - * This is a component which will render the comp (closure) - * with the glamorous styles (closure). Forwards any valid - * props to the underlying component. - */ - var GlamorousComponent = withTheme(function (props, context) { - props = getPropsToApply(GlamorousComponent.propsToApply, {}, props, context); - var updateClassName = shouldUpdate(props, context, this.previous); - - if (shouldClassNameUpdate) { - this.previous = { props: props, context: context }; - } - - var _splitProps = splitProps(props, GlamorousComponent), - toForward = _splitProps.toForward, - cssOverrides = _splitProps.cssOverrides, - cssProp = _splitProps.cssProp; - - // create className to apply - - - this.className = updateClassName ? getGlamorClassName$1({ - styles: GlamorousComponent.styles, - props: props, - cssOverrides: cssOverrides, - cssProp: cssProp, - context: context, - displayName: GlamorousComponent.displayName - }) : this.className; - - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(GlamorousComponent.comp, _extends({ - ref: props.innerRef - }, toForward, { - className: this.className - })); - }, { noWarn: true, createElement: false }); - - GlamorousComponent.propTypes = { - // className accepts an object due to glamor's css function - // returning an object with a toString method that gives the className - className: _PropTypes.oneOfType([_PropTypes.string, _PropTypes.object]), - cssOverrides: _PropTypes.object, - innerRef: _PropTypes.func, - glam: _PropTypes.object - }; - - function shouldUpdate(props, context, previous) { - // exiting early so components which do not use this - // optimization are not penalized by hanging onto - // references to previous props and context - if (!shouldClassNameUpdate) { - return true; - } - var update = true; - if (previous) { - if (!shouldClassNameUpdate(previous.props, props, previous.context, context)) { - update = false; - } - } - - return update; - } - - Object.assign(GlamorousComponent, getGlamorousComponentMetadata({ - comp: comp, - styles: styles, - rootEl: rootEl, - filterProps: filterProps, - forwardProps: forwardProps, - displayName: displayName, - propsToApply: basePropsToApply - }), { - isGlamorousComponent: true, - propsAreCssOverrides: propsAreCssOverrides, - withComponent: function (newComp) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var fwp = GlamorousComponent.forwardProps, - flp = GlamorousComponent.filterProps, - componentProperties = objectWithoutProperties(GlamorousComponent, ['forwardProps', 'filterProps']); - - return glamorous(_extends({}, componentProperties, { - comp: newComp - }), _extends({ - // allows the forwardProps and filterProps to be overridden - forwardProps: fwp, - filterProps: flp - }, options))(); - }, - withProps: function () { - for (var _len2 = arguments.length, propsToApply = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - propsToApply[_key2] = arguments[_key2]; - } - - return glamorous(GlamorousComponent, { withProps: propsToApply })(); - }, - withConfig: withConfig - }); - return GlamorousComponent; - } - } - - function getGlamorousComponentMetadata(_ref) { - var comp = _ref.comp, - styles = _ref.styles, - rootEl = _ref.rootEl, - filterProps = _ref.filterProps, - forwardProps = _ref.forwardProps, - displayName = _ref.displayName, - basePropsToApply = _ref.propsToApply; - - var componentsComp = comp.comp ? comp.comp : comp; - var propsToApply = comp.propsToApply ? [].concat(toConsumableArray(comp.propsToApply), toConsumableArray(arrayify(basePropsToApply))) : arrayify(basePropsToApply); - return { - // join styles together (for anyone doing: glamorous(glamorous.a({}), {})) - styles: when(comp.styles, styles), - // keep track of the ultimate rootEl to render (we never - // actually render anything but - // the base component, even when people wrap a glamorous - // component in glamorous - comp: componentsComp, - rootEl: rootEl || componentsComp, - // join forwardProps and filterProps - // (for anyone doing: glamorous(glamorous.a({}), {})) - forwardProps: when(comp.forwardProps, forwardProps), - filterProps: when(comp.filterProps, filterProps), - // set the displayName to something that's slightly more - // helpful than `GlamorousComponent` :) - displayName: displayName || 'glamorous(' + getDisplayName(comp) + ')', - // these are props that should be applied to the component at render time - propsToApply: propsToApply - }; - } -} - -/** - * reduces the propsToApply given to a single props object - * @param {Array} propsToApply an array of propsToApply objects: - * - object - * - array of propsToApply items - * - function that accepts the accumulated props and the context - * @param {Object} accumulator an object to apply props onto - * @param {Object} props the props that should ultimately take precedence - * @param {*} context the context object - * @return {Object} the reduced props - */ -function getPropsToApply(propsToApply, accumulator, props, context) { - // using forEach rather than reduce here because the reduce solution - // effectively did the same thing because we manipulate the `accumulator` - propsToApply.forEach(function (propsToApplyItem) { - if (typeof propsToApplyItem === 'function') { - return Object.assign(accumulator, propsToApplyItem(Object.assign({}, accumulator, props), context)); - } else if (Array.isArray(propsToApplyItem)) { - return Object.assign(accumulator, getPropsToApply(propsToApplyItem, accumulator, props, context)); - } - return Object.assign(accumulator, propsToApplyItem); - }); - // props wins - return Object.assign(accumulator, props); -} - -function arrayify() { - var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - return Array.isArray(x) ? x : [x]; -} - -function when(comp, prop) { - return comp ? comp.concat(prop) : prop; -} - -function getDisplayName(comp) { - return typeof comp === 'string' ? comp : comp.displayName || comp.name || 'unknown'; -} - -// -// Main -// - -function memoize (fn, options) { - var cache = options && options.cache - ? options.cache - : cacheDefault; - - var serializer = options && options.serializer - ? options.serializer - : serializerDefault; - - var strategy = options && options.strategy - ? options.strategy - : strategyDefault; - - return strategy(fn, { - cache: cache, - serializer: serializer - }) -} - -// -// Strategy -// - -function isPrimitive (value) { - return value == null || (typeof value !== 'function' && typeof value !== 'object') -} - -function monadic (fn, cache, serializer, arg) { - var cacheKey = isPrimitive(arg) ? arg : serializer(arg); - - if (!cache.has(cacheKey)) { - var computedValue = fn.call(this, arg); - cache.set(cacheKey, computedValue); - return computedValue - } - - return cache.get(cacheKey) -} - -function variadic (fn, cache, serializer) { - var args = Array.prototype.slice.call(arguments, 3); - var cacheKey = serializer(args); - - if (!cache.has(cacheKey)) { - var computedValue = fn.apply(this, args); - cache.set(cacheKey, computedValue); - return computedValue - } - - return cache.get(cacheKey) -} - -function assemble (fn, context, strategy, cache, serialize) { - return strategy.bind( - context, - fn, - cache, - serialize - ) -} - -function strategyDefault (fn, options) { - var strategy = fn.length === 1 ? monadic : variadic; - - return assemble( - fn, - this, - strategy, - options.cache.create(), - options.serializer - ) -} - -function strategyVariadic (fn, options) { - var strategy = variadic; - - return assemble( - fn, - this, - strategy, - options.cache.create(), - options.serializer - ) -} - -function strategyMonadic (fn, options) { - var strategy = monadic; - - return assemble( - fn, - this, - strategy, - options.cache.create(), - options.serializer - ) -} - -// -// Serializer -// - -function serializerDefault () { - return JSON.stringify(arguments) -} - -// -// Cache -// - -function ObjectWithoutPrototypeCache () { - this.cache = Object.create(null); -} - -ObjectWithoutPrototypeCache.prototype.has = function (key) { - return (key in this.cache) -}; - -ObjectWithoutPrototypeCache.prototype.get = function (key) { - return this.cache[key] -}; - -ObjectWithoutPrototypeCache.prototype.set = function (key, value) { - this.cache[key] = value; -}; - -var cacheDefault = { - create: function create () { - return new ObjectWithoutPrototypeCache() - } -}; - -// -// API -// - -var src$1 = memoize; -var strategies = { - variadic: strategyVariadic, - monadic: strategyMonadic -}; - -src$1.strategies = strategies; - -function unwrapExports (x) { - return x && x.__esModule ? x['default'] : x; -} - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var a = ["coords","download","href","name","rel","shape","target","type"]; -var abbr = ["title"]; -var applet = ["alt","height","name","width"]; -var area = ["alt","coords","download","href","rel","shape","target","type"]; -var audio = ["controls","loop","muted","preload","src"]; -var base = ["href","target"]; -var basefont = ["size"]; -var bdo = ["dir"]; -var blockquote = ["cite"]; -var button = ["disabled","form","name","type","value"]; -var canvas = ["height","width"]; -var col = ["span","width"]; -var colgroup = ["span","width"]; -var data = ["value"]; -var del = ["cite"]; -var details = ["open"]; -var dfn = ["title"]; -var dialog = ["open"]; -var embed = ["height","src","type","width"]; -var fieldset = ["disabled","form","name"]; -var font = ["size"]; -var form = ["accept","action","method","name","target"]; -var frame = ["name","scrolling","src"]; -var frameset = ["cols","rows"]; -var head = ["profile"]; -var hr = ["size","width"]; -var html = ["manifest"]; -var iframe = ["height","name","sandbox","scrolling","src","width"]; -var img = ["alt","height","name","sizes","src","width"]; -var input = ["accept","alt","autoCapitalize","autoCorrect","autoSave","checked","defaultChecked","defaultValue","disabled","form","height","list","max","min","multiple","name","onChange","pattern","placeholder","required","results","size","src","step","title","type","value","width"]; -var ins = ["cite"]; -var keygen = ["challenge","disabled","form","name"]; -var label = ["form"]; -var li = ["type","value"]; -var link = ["color","href","integrity","media","nonce","rel","scope","sizes","target","title","type"]; -var map = ["name"]; -var meta = ["content","name"]; -var meter = ["high","low","max","min","optimum","value"]; -var object = ["data","form","height","name","type","width"]; -var ol = ["reversed","start","type"]; -var optgroup = ["disabled","label"]; -var option = ["disabled","label","selected","value"]; -var output = ["form","name"]; -var param = ["name","type","value"]; -var pre = ["width"]; -var progress = ["max","value"]; -var q = ["cite"]; -var script = ["async","defer","integrity","nonce","src","type"]; -var select = ["defaultValue","disabled","form","multiple","name","onChange","required","size","value"]; -var slot = ["name"]; -var source = ["media","sizes","src","type"]; -var style = ["media","nonce","title","type"]; -var table = ["summary","width"]; -var td = ["headers","height","scope","width"]; -var textarea = ["autoCapitalize","autoCorrect","cols","defaultValue","disabled","form","name","onChange","placeholder","required","rows","value","wrap"]; -var th = ["headers","height","scope","width"]; -var track = ["default","kind","label","src"]; -var ul = ["type"]; -var video = ["controls","height","loop","muted","poster","preload","src","width"]; -var svg = ["accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baseProfile","baselineShift","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","color","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","height","horizAdvX","horizOriginX","ideographic","imageRendering","in","in2","intercept","k","k1","k2","k3","k4","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","points","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","scale","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","vHanging","vIdeographic","vMathematical","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","viewBox","viewTarget","visibility","width","widths","wordSpacing","writingMode","x","x1","x2","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlSpace","xmlns","xmlnsXlink","y","y1","y2","yChannelSelector","z","zoomAndPan"]; -var elements = {"html":["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],"svg":["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"]}; -var reactHtmlAttributes = { - a: a, - abbr: abbr, - applet: applet, - area: area, - audio: audio, - base: base, - basefont: basefont, - bdo: bdo, - blockquote: blockquote, - button: button, - canvas: canvas, - col: col, - colgroup: colgroup, - data: data, - del: del, - details: details, - dfn: dfn, - dialog: dialog, - embed: embed, - fieldset: fieldset, - font: font, - form: form, - frame: frame, - frameset: frameset, - head: head, - hr: hr, - html: html, - iframe: iframe, - img: img, - input: input, - ins: ins, - keygen: keygen, - label: label, - li: li, - link: link, - map: map, - meta: meta, - meter: meter, - object: object, - ol: ol, - optgroup: optgroup, - option: option, - output: output, - param: param, - pre: pre, - progress: progress, - q: q, - script: script, - select: select, - slot: slot, - source: source, - style: style, - table: table, - td: td, - textarea: textarea, - th: th, - track: track, - ul: ul, - video: video, - svg: svg, - elements: elements, - "*": ["about","acceptCharset","accessKey","allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","capture","cellPadding","cellSpacing","charSet","classID","className","colSpan","contentEditable","contextMenu","crossOrigin","dangerouslySetInnerHTML","datatype","dateTime","dir","draggable","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hidden","hrefLang","htmlFor","httpEquiv","icon","id","inlist","inputMode","is","itemID","itemProp","itemRef","itemScope","itemType","keyParams","keyType","lang","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","prefix","property","radioGroup","readOnly","resource","role","rowSpan","scoped","seamless","security","spellCheck","srcDoc","srcLang","srcSet","style","suppressContentEditableWarning","tabIndex","title","typeof","unselectable","useMap","vocab","wmode"] -}; - -var reactHtmlAttributes$1 = Object.freeze({ - a: a, - abbr: abbr, - applet: applet, - area: area, - audio: audio, - base: base, - basefont: basefont, - bdo: bdo, - blockquote: blockquote, - button: button, - canvas: canvas, - col: col, - colgroup: colgroup, - data: data, - del: del, - details: details, - dfn: dfn, - dialog: dialog, - embed: embed, - fieldset: fieldset, - font: font, - form: form, - frame: frame, - frameset: frameset, - head: head, - hr: hr, - html: html, - iframe: iframe, - img: img, - input: input, - ins: ins, - keygen: keygen, - label: label, - li: li, - link: link, - map: map, - meta: meta, - meter: meter, - object: object, - ol: ol, - optgroup: optgroup, - option: option, - output: output, - param: param, - pre: pre, - progress: progress, - q: q, - script: script, - select: select, - slot: slot, - source: source, - style: style, - table: table, - td: td, - textarea: textarea, - th: th, - track: track, - ul: ul, - video: video, - svg: svg, - elements: elements, - default: reactHtmlAttributes -}); - -var reactHtmlAttributes$2 = ( reactHtmlAttributes$1 && reactHtmlAttributes ) || reactHtmlAttributes$1; - -var dist = createCommonjsModule(function (module, exports) { -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - - -exports.default = reactHtmlAttributes$2; - -module.exports = reactHtmlAttributes$2; // for CommonJS compatibility -}); - -var reactHTMLAttributes = unwrapExports(dist); - -/* - * This is used to check if a property name is one of the React-specific - * properties and determine if that property should be forwarded - * to the React component - */ - -/* Logic copied from ReactDOMUnknownPropertyHook */ -var reactProps = ['children', 'dangerouslySetInnerHTML', 'key', 'ref', 'autoFocus', 'defaultValue', 'valueLink', 'defaultChecked', 'checkedLink', 'innerHTML', 'suppressContentEditableWarning', 'onFocusIn', 'onFocusOut', 'className', - -/* List copied from https://facebook.github.io/react/docs/events.html */ -'onCopy', 'onCut', 'onPaste', 'onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onFocus', 'onBlur', 'onChange', 'onInput', 'onInvalid', 'onSubmit', 'onClick', 'onContextMenu', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onSelect', 'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'onScroll', 'onWheel', 'onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onError', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting', 'onLoad', 'onAnimationStart', 'onAnimationEnd', 'onAnimationIteration', 'onTransitionEnd', 'onCopyCapture', 'onCutCapture', 'onPasteCapture', 'onCompositionEndCapture', 'onCompositionStartCapture', 'onCompositionUpdateCapture', 'onKeyDownCapture', 'onKeyPressCapture', 'onKeyUpCapture', 'onFocusCapture', 'onBlurCapture', 'onChangeCapture', 'onInputCapture', 'onSubmitCapture', 'onClickCapture', 'onContextMenuCapture', 'onDoubleClickCapture', 'onDragCapture', 'onDragEndCapture', 'onDragEnterCapture', 'onDragExitCapture', 'onDragLeaveCapture', 'onDragOverCapture', 'onDragStartCapture', 'onDropCapture', 'onMouseDownCapture', 'onMouseEnterCapture', 'onMouseLeaveCapture', 'onMouseMoveCapture', 'onMouseOutCapture', 'onMouseOverCapture', 'onMouseUpCapture', 'onSelectCapture', 'onTouchCancelCapture', 'onTouchEndCapture', 'onTouchMoveCapture', 'onTouchStartCapture', 'onScrollCapture', 'onWheelCapture', 'onAbortCapture', 'onCanPlayCapture', 'onCanPlayThroughCapture', 'onDurationChangeCapture', 'onEmptiedCapture', 'onEncryptedCapture', 'onEndedCapture', 'onErrorCapture', 'onLoadedDataCapture', 'onLoadedMetadataCapture', 'onLoadStartCapture', 'onPauseCapture', 'onPlayCapture', 'onPlayingCapture', 'onProgressCapture', 'onRateChangeCapture', 'onSeekedCapture', 'onSeekingCapture', 'onStalledCapture', 'onSuspendCapture', 'onTimeUpdateCapture', 'onVolumeChangeCapture', 'onWaitingCapture', 'onLoadCapture', 'onAnimationStartCapture', 'onAnimationEndCapture', 'onAnimationIterationCapture', 'onTransitionEndCapture']; - -if (isPreact) { - reactProps.push('autocomplete', 'autofocus', 'class', 'for', 'onDblClick', 'onSearch', 'slot', 'srcset'); -} - -/* eslint max-lines:0, func-style:0 */ -// copied from: -// https://github.com/styled-components/styled-components/tree/ -// 956e8210b6277860c89404f9cb08735f97eaa7e1/src/utils/validAttr.js -/* Trying to avoid the unknown-prop errors on glamorous components - by filtering by React's attribute whitelist. - */ - -var globalReactHtmlProps = reactHTMLAttributes['*']; -var supportedSVGTagNames = reactHTMLAttributes.elements.svg; -var supportedHtmlTagNames = reactHTMLAttributes.elements.html; - -// these are valid attributes that have the -// same name as CSS properties, and is used -// for css overrides API -var cssProps = ['color', 'height', 'width']; - -/* From DOMProperty */ -var ATTRIBUTE_NAME_START_CHAR = -// eslint-disable-next-line max-len -':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-disable-next-line max-len -var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040'; -var isCustomAttribute = RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$')); - -var isSvgTag = function (tagName) { - return ( - // in our context, we only say that SVG tags are SVG - // if they are not also HTML. - // See https://github.com/paypal/glamorous/issues/245 - // the svg tag will always be treated as svg for - // er... obvious reasons - tagName === 'svg' || supportedHtmlTagNames.indexOf(tagName) === -1 && supportedSVGTagNames.indexOf(tagName) !== -1 - ); -}; -var isHtmlProp = function (name, tagName) { - var elementAttributes = void 0; - - if (isSvgTag(tagName)) { - // all SVG attributes supported by React are grouped under 'svg' - elementAttributes = reactHTMLAttributes.svg; - } else { - elementAttributes = reactHTMLAttributes[tagName] || []; - } - - return globalReactHtmlProps.indexOf(name) !== -1 || elementAttributes.indexOf(name) !== -1; -}; -var isCssProp = function (name) { - return cssProps.indexOf(name) !== -1; -}; -var isReactProp = function (name) { - return reactProps.indexOf(name) !== -1; -}; - -// eslint-disable-next-line complexity -var shouldForwardProperty = function (tagName, name) { - return typeof tagName !== 'string' || (isHtmlProp(name, tagName) || isReactProp(name) || isCustomAttribute(name.toLowerCase())) && (!isCssProp(name) || isSvgTag(tagName)); -}; - -var shouldForwardProperty$1 = src$1(shouldForwardProperty); - -function splitProps(_ref, _ref2) { - var propsAreCssOverrides = _ref2.propsAreCssOverrides, - rootEl = _ref2.rootEl, - filterProps = _ref2.filterProps, - forwardProps = _ref2.forwardProps; - var cssProp = _ref.css, - theme = _ref.theme, - className = _ref.className, - innerRef = _ref.innerRef, - glam = _ref.glam, - rest = objectWithoutProperties(_ref, ['css', 'theme', 'className', 'innerRef', 'glam']); - - var returnValue = { toForward: {}, cssProp: cssProp, cssOverrides: {} }; - if (!propsAreCssOverrides) { - if (typeof rootEl !== 'string' && filterProps.length === 0) { - // if it's not a string and filterProps is empty, - // then we can forward everything (because it's a component) - returnValue.toForward = rest; - return returnValue; - } - } - return Object.keys(rest).reduce(function (split, propName) { - if (filterProps.indexOf(propName) !== -1) { - return split; - } else if (forwardProps.indexOf(propName) !== -1 || shouldForwardProperty$1(rootEl, propName)) { - split.toForward[propName] = rest[propName]; - } else if (propsAreCssOverrides) { - split.cssOverrides[propName] = rest[propName]; - } - return split; - }, returnValue); -} - -/* eslint no-unused-vars:0 */ - -var glamorous = createGlamorous$1(splitProps); - -/* - * This creates a glamorousComponentFactory for every DOM element so you can - * simply do: - * const GreenButton = glamorous.button({ - * backgroundColor: 'green', - * padding: 20, - * }) - * <GreenButton>Click Me!</GreenButton> - */ -Object.assign(glamorous, domElements.reduce(function (getters, tag) { - // TODO: next breaking change, let's make - // the `displayName` be: `glamorous.${tag}` - getters[tag] = glamorous(tag); - return getters; -}, {})); - -/* - * This creates a glamorous component for each DOM element so you can - * simply do: - * <glamorous.Div - * color="green" - * marginLeft={20} - * > - * I'm green! - * </glamorous.Div> - */ -Object.assign(glamorous, domElements.reduce(function (comps, tag) { - var capitalTag = capitalize(tag); - comps[capitalTag] = glamorous[tag](); - comps[capitalTag].displayName = 'glamorous.' + capitalTag; - comps[capitalTag].propsAreCssOverrides = true; - return comps; -}, {})); - -function capitalize(s) { - return s.slice(0, 1).toUpperCase() + s.slice(1); -} - -/* - * Fix importing in typescript after rollup compilation - * https://github.com/rollup/rollup/issues/1156 - * https://github.com/Microsoft/TypeScript/issues/13017#issuecomment-268657860 - */ -glamorous.default = glamorous; - -// these exports below are generated -// and will be tree-shaken if you're using Webpack 2 or Rollup -var A = glamorous['A']; -var Abbr = glamorous['Abbr']; -var Acronym = glamorous['Acronym']; -var Address = glamorous['Address']; -var Applet = glamorous['Applet']; -var Area = glamorous['Area']; -var Article = glamorous['Article']; -var Aside = glamorous['Aside']; -var Audio = glamorous['Audio']; -var B = glamorous['B']; -var Base = glamorous['Base']; -var Basefont = glamorous['Basefont']; -var Bdi = glamorous['Bdi']; -var Bdo = glamorous['Bdo']; -var Bgsound = glamorous['Bgsound']; -var Big = glamorous['Big']; -var Blink = glamorous['Blink']; -var Blockquote = glamorous['Blockquote']; -var Body = glamorous['Body']; -var Br = glamorous['Br']; -var Button = glamorous['Button']; -var Canvas = glamorous['Canvas']; -var Caption = glamorous['Caption']; -var Center = glamorous['Center']; -var Cite = glamorous['Cite']; -var Code = glamorous['Code']; -var Col = glamorous['Col']; -var Colgroup = glamorous['Colgroup']; -var Command = glamorous['Command']; -var Content = glamorous['Content']; -var Data = glamorous['Data']; -var Datalist = glamorous['Datalist']; -var Dd = glamorous['Dd']; -var Del = glamorous['Del']; -var Details = glamorous['Details']; -var Dfn = glamorous['Dfn']; -var Dialog = glamorous['Dialog']; -var Dir = glamorous['Dir']; -var Div = glamorous['Div']; -var Dl = glamorous['Dl']; -var Dt = glamorous['Dt']; -var Element = glamorous['Element']; -var Em = glamorous['Em']; -var Embed = glamorous['Embed']; -var Fieldset = glamorous['Fieldset']; -var Figcaption = glamorous['Figcaption']; -var Figure = glamorous['Figure']; -var Font = glamorous['Font']; -var Footer = glamorous['Footer']; -var Form = glamorous['Form']; -var Frame = glamorous['Frame']; -var Frameset = glamorous['Frameset']; -var H1 = glamorous['H1']; -var H2 = glamorous['H2']; -var H3 = glamorous['H3']; -var H4 = glamorous['H4']; -var H5 = glamorous['H5']; -var H6 = glamorous['H6']; -var Head = glamorous['Head']; -var Header = glamorous['Header']; -var Hgroup = glamorous['Hgroup']; -var Hr = glamorous['Hr']; -var Html = glamorous['Html']; -var I = glamorous['I']; -var Iframe = glamorous['Iframe']; -var Image = glamorous['Image']; -var Img = glamorous['Img']; -var Input = glamorous['Input']; -var Ins = glamorous['Ins']; -var Isindex = glamorous['Isindex']; -var Kbd = glamorous['Kbd']; -var Keygen = glamorous['Keygen']; -var Label = glamorous['Label']; -var Legend = glamorous['Legend']; -var Li = glamorous['Li']; -var Link = glamorous['Link']; -var Listing = glamorous['Listing']; -var Main = glamorous['Main']; -var MapTag = glamorous['Map']; -var Mark = glamorous['Mark']; -var Marquee = glamorous['Marquee']; -var MathTag = glamorous['Math']; -var Menu = glamorous['Menu']; -var Menuitem = glamorous['Menuitem']; -var Meta = glamorous['Meta']; -var Meter = glamorous['Meter']; -var Multicol = glamorous['Multicol']; -var Nav = glamorous['Nav']; -var Nextid = glamorous['Nextid']; -var Nobr = glamorous['Nobr']; -var Noembed = glamorous['Noembed']; -var Noframes = glamorous['Noframes']; -var Noscript = glamorous['Noscript']; -var ObjectTag = glamorous['Object']; -var Ol = glamorous['Ol']; -var Optgroup = glamorous['Optgroup']; -var Option = glamorous['Option']; -var Output = glamorous['Output']; -var P = glamorous['P']; -var Param = glamorous['Param']; -var Picture = glamorous['Picture']; -var Plaintext = glamorous['Plaintext']; -var Pre = glamorous['Pre']; -var Progress = glamorous['Progress']; -var Q = glamorous['Q']; -var Rb = glamorous['Rb']; -var Rbc = glamorous['Rbc']; -var Rp = glamorous['Rp']; -var Rt = glamorous['Rt']; -var Rtc = glamorous['Rtc']; -var Ruby = glamorous['Ruby']; -var S = glamorous['S']; -var Samp = glamorous['Samp']; -var Script = glamorous['Script']; -var Section = glamorous['Section']; -var Select = glamorous['Select']; -var Shadow = glamorous['Shadow']; -var Slot = glamorous['Slot']; -var Small = glamorous['Small']; -var Source = glamorous['Source']; -var Spacer = glamorous['Spacer']; -var Span = glamorous['Span']; -var Strike = glamorous['Strike']; -var Strong = glamorous['Strong']; -var Style = glamorous['Style']; -var Sub = glamorous['Sub']; -var Summary = glamorous['Summary']; -var Sup = glamorous['Sup']; -var Svg = glamorous['Svg']; -var Table = glamorous['Table']; -var Tbody = glamorous['Tbody']; -var Td = glamorous['Td']; -var Template = glamorous['Template']; -var Textarea = glamorous['Textarea']; -var Tfoot = glamorous['Tfoot']; -var Th = glamorous['Th']; -var Thead = glamorous['Thead']; -var Time = glamorous['Time']; -var Title = glamorous['Title']; -var Tr = glamorous['Tr']; -var Track = glamorous['Track']; -var Tt = glamorous['Tt']; -var U = glamorous['U']; -var Ul = glamorous['Ul']; -var Var = glamorous['Var']; -var Video = glamorous['Video']; -var Wbr = glamorous['Wbr']; -var Xmp = glamorous['Xmp']; -var AltGlyph = glamorous['AltGlyph']; -var AltGlyphDef = glamorous['AltGlyphDef']; -var AltGlyphItem = glamorous['AltGlyphItem']; -var Animate = glamorous['Animate']; -var AnimateColor = glamorous['AnimateColor']; -var AnimateMotion = glamorous['AnimateMotion']; -var AnimateTransform = glamorous['AnimateTransform']; -var Animation = glamorous['Animation']; -var Circle = glamorous['Circle']; -var ClipPath = glamorous['ClipPath']; -var ColorProfile = glamorous['Color-profile']; -var Cursor = glamorous['Cursor']; -var Defs = glamorous['Defs']; -var Desc = glamorous['Desc']; -var Discard = glamorous['Discard']; -var Ellipse = glamorous['Ellipse']; -var FeBlend = glamorous['FeBlend']; -var FeColorMatrix = glamorous['FeColorMatrix']; -var FeComponentTransfer = glamorous['FeComponentTransfer']; -var FeComposite = glamorous['FeComposite']; -var FeConvolveMatrix = glamorous['FeConvolveMatrix']; -var FeDiffuseLighting = glamorous['FeDiffuseLighting']; -var FeDisplacementMap = glamorous['FeDisplacementMap']; -var FeDistantLight = glamorous['FeDistantLight']; -var FeDropShadow = glamorous['FeDropShadow']; -var FeFlood = glamorous['FeFlood']; -var FeFuncA = glamorous['FeFuncA']; -var FeFuncB = glamorous['FeFuncB']; -var FeFuncG = glamorous['FeFuncG']; -var FeFuncR = glamorous['FeFuncR']; -var FeGaussianBlur = glamorous['FeGaussianBlur']; -var FeImage = glamorous['FeImage']; -var FeMerge = glamorous['FeMerge']; -var FeMergeNode = glamorous['FeMergeNode']; -var FeMorphology = glamorous['FeMorphology']; -var FeOffset = glamorous['FeOffset']; -var FePointLight = glamorous['FePointLight']; -var FeSpecularLighting = glamorous['FeSpecularLighting']; -var FeSpotLight = glamorous['FeSpotLight']; -var FeTile = glamorous['FeTile']; -var FeTurbulence = glamorous['FeTurbulence']; -var Filter = glamorous['Filter']; -var FontFace = glamorous['Font-face']; -var FontFaceFormat = glamorous['Font-face-format']; -var FontFaceName = glamorous['Font-face-name']; -var FontFaceSrc = glamorous['Font-face-src']; -var FontFaceUri = glamorous['Font-face-uri']; -var ForeignObject = glamorous['ForeignObject']; -var G = glamorous['G']; -var Glyph = glamorous['Glyph']; -var GlyphRef = glamorous['GlyphRef']; -var Handler = glamorous['Handler']; -var Hatch = glamorous['Hatch']; -var Hatchpath = glamorous['Hatchpath']; -var Hkern = glamorous['Hkern']; -var Line = glamorous['Line']; -var LinearGradient = glamorous['LinearGradient']; -var Listener = glamorous['Listener']; -var Marker = glamorous['Marker']; -var Mask = glamorous['Mask']; -var Mesh = glamorous['Mesh']; -var Meshgradient = glamorous['Meshgradient']; -var Meshpatch = glamorous['Meshpatch']; -var Meshrow = glamorous['Meshrow']; -var Metadata = glamorous['Metadata']; -var MissingGlyph = glamorous['Missing-glyph']; -var Mpath = glamorous['Mpath']; -var Path = glamorous['Path']; -var Pattern = glamorous['Pattern']; -var Polygon = glamorous['Polygon']; -var Polyline = glamorous['Polyline']; -var Prefetch = glamorous['Prefetch']; -var RadialGradient = glamorous['RadialGradient']; -var Rect = glamorous['Rect']; -var SetTag = glamorous['Set']; -var SolidColor = glamorous['SolidColor']; -var Solidcolor = glamorous['Solidcolor']; -var Stop = glamorous['Stop']; -var Switch = glamorous['Switch']; -var SymbolTag = glamorous['Symbol']; -var Tbreak = glamorous['Tbreak']; -var Text = glamorous['Text']; -var TextArea = glamorous['TextArea']; -var TextPath = glamorous['TextPath']; -var Tref = glamorous['Tref']; -var Tspan = glamorous['Tspan']; -var Unknown = glamorous['Unknown']; -var Use = glamorous['Use']; -var View = glamorous['View']; -var Vkern = glamorous['Vkern']; - - -/* harmony default export */ __webpack_exports__["default"] = (glamorous); - - -/***/ }), -/* 242 */, -/* 243 */, -/* 244 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var stringify = __webpack_require__(489); -var parse = __webpack_require__(490); -var formats = __webpack_require__(215); - -module.exports = { - formats: formats, - parse: parse, - stringify: stringify -}; - - -/***/ }), -/* 245 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var global = __webpack_require__(16); -var core = __webpack_require__(10); -var dP = __webpack_require__(24); -var DESCRIPTORS = __webpack_require__(27); -var SPECIES = __webpack_require__(14)('species'); - -module.exports = function (KEY) { - var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; - if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { - configurable: true, - get: function () { return this; } - }); -}; - - -/***/ }), -/* 246 */ -/***/ (function(module, exports) { - -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; - - -/***/ }), -/* 247 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.setInitialStory = setInitialStory; -exports.setError = setError; -exports.clearError = clearError; -exports.selectStory = selectStory; -var types = exports.types = { - SET_ERROR: 'PREVIEW_SET_ERROR', - CLEAR_ERROR: 'PREVIEW_CLEAR_ERROR', - SELECT_STORY: 'PREVIEW_SELECT_STORY', - SET_INITIAL_STORY: 'PREVIEW_SET_INITIAL_STORY' -}; - -function setInitialStory(storyKindList) { - return { - type: types.SET_INITIAL_STORY, - storyKindList: storyKindList - }; -} - -function setError(error) { - return { - type: types.SET_ERROR, - error: error - }; -} - -function clearError() { - return { - type: types.CLEAR_ERROR - }; -} - -function selectStory(kind, story) { - return { - type: types.SELECT_STORY, - kind: kind, - story: story - }; -} - -/***/ }), -/* 248 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// turn {x: {val: 1, stiffness: 1, damping: 2}, y: 2} generated by -// `{x: spring(1, {stiffness: 1, damping: 2}), y: 2}` into {x: 1, y: 2} - - - -exports.__esModule = true; -exports['default'] = stripStyle; - -function stripStyle(style) { - var ret = {}; - for (var key in style) { - if (!Object.prototype.hasOwnProperty.call(style, key)) { - continue; - } - ret[key] = typeof style[key] === 'number' ? style[key] : style[key].val; - } - return ret; -} - -module.exports = exports['default']; - -/***/ }), -/* 249 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.register = register; - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _addons = __webpack_require__(55); - -var _addons2 = _interopRequireDefault(_addons); - -var _ActionLogger = __webpack_require__(270); - -var _ActionLogger2 = _interopRequireDefault(_ActionLogger); - -var _ = __webpack_require__(66); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function register() { - _addons2.default.register(_.ADDON_ID, function () { - var channel = _addons2.default.getChannel(); - _addons2.default.addPanel(_.PANEL_ID, { - title: 'Action Logger', - render: function render() { - return _react2.default.createElement(_ActionLogger2.default, { channel: channel }); - } - }); - }); -} - -/***/ }), -/* 250 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var PooledClass = __webpack_require__(251); -var ReactElement = __webpack_require__(36); - -var emptyFunction = __webpack_require__(20); -var traverseAllChildren = __webpack_require__(252); - -var twoArgumentPooler = PooledClass.twoArgumentPooler; -var fourArgumentPooler = PooledClass.fourArgumentPooler; - -var userProvidedKeyEscapeRegex = /\/+/g; -function escapeUserProvidedKey(text) { - return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); -} - -/** - * PooledClass representing the bookkeeping associated with performing a child - * traversal. Allows avoiding binding callbacks. - * - * @constructor ForEachBookKeeping - * @param {!function} forEachFunction Function to perform traversal with. - * @param {?*} forEachContext Context to perform context with. - */ -function ForEachBookKeeping(forEachFunction, forEachContext) { - this.func = forEachFunction; - this.context = forEachContext; - this.count = 0; -} -ForEachBookKeeping.prototype.destructor = function () { - this.func = null; - this.context = null; - this.count = 0; -}; -PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); - -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://facebook.github.io/react/docs/top-level-api.html#react.children.foreach - * - * The provided forEachFunc(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} forEachFunc - * @param {*} forEachContext Context for forEachContext. - */ -function forEachChildren(children, forEachFunc, forEachContext) { - if (children == null) { - return children; - } - var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); - traverseAllChildren(children, forEachSingleChild, traverseContext); - ForEachBookKeeping.release(traverseContext); -} - -/** - * PooledClass representing the bookkeeping associated with performing a child - * mapping. Allows avoiding binding callbacks. - * - * @constructor MapBookKeeping - * @param {!*} mapResult Object containing the ordered map of results. - * @param {!function} mapFunction Function to perform mapping with. - * @param {?*} mapContext Context to perform mapping with. - */ -function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { - this.result = mapResult; - this.keyPrefix = keyPrefix; - this.func = mapFunction; - this.context = mapContext; - this.count = 0; -} -MapBookKeeping.prototype.destructor = function () { - this.result = null; - this.keyPrefix = null; - this.func = null; - this.context = null; - this.count = 0; -}; -PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); - -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, emptyFunction.thatReturnsArgument); - } else if (mappedChild != null) { - if (ReactElement.isValidElement(mappedChild)) { - mappedChild = ReactElement.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 = MapBookKeeping.getPooled(array, escapedPrefix, func, context); - traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); - MapBookKeeping.release(traverseContext); -} - -/** - * Maps children that are typically specified as `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map - * - * 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; -} - -function forEachSingleChildDummy(traverseContext, child, name) { - return null; -} - -/** - * Count the number of children that are typically specified as - * `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count - * - * @param {?*} children Children tree container. - * @return {number} The number of children. - */ -function countChildren(children, context) { - return traverseAllChildren(children, forEachSingleChildDummy, null); -} - -/** - * Flatten a children object (typically specified as `props.children`) and - * return an array with appropriately re-keyed children. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray - */ -function toArray(children) { - var result = []; - mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); - return result; -} - -var ReactChildren = { - forEach: forEachChildren, - map: mapChildren, - mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, - count: countChildren, - toArray: toArray -}; - -module.exports = ReactChildren; - -/***/ }), -/* 251 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(43); - -var invariant = __webpack_require__(1); - -/** - * Static poolers. Several custom versions for each potential number of - * arguments. A completely generic pooler is easy to implement, but would - * require accessing the `arguments` object. In each of these, `this` refers to - * the Class itself, not an instance. If any others are needed, simply add them - * here, or in their own files. - */ -var oneArgumentPooler = function (copyFieldsFrom) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, copyFieldsFrom); - return instance; - } else { - return new Klass(copyFieldsFrom); - } -}; - -var twoArgumentPooler = function (a1, a2) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2); - return instance; - } else { - return new Klass(a1, a2); - } -}; - -var threeArgumentPooler = function (a1, a2, a3) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3); - return instance; - } else { - return new Klass(a1, a2, a3); - } -}; - -var fourArgumentPooler = function (a1, a2, a3, a4) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3, a4); - return instance; - } else { - return new Klass(a1, a2, a3, a4); - } -}; - -var standardReleaser = function (instance) { - var Klass = this; - !(instance instanceof Klass) ? true ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; - instance.destructor(); - if (Klass.instancePool.length < Klass.poolSize) { - Klass.instancePool.push(instance); - } -}; - -var DEFAULT_POOL_SIZE = 10; -var DEFAULT_POOLER = oneArgumentPooler; - -/** - * Augments `CopyConstructor` to be a poolable class, augmenting only the class - * itself (statically) not adding any prototypical fields. Any CopyConstructor - * you give this may have a `poolSize` property, and will look for a - * prototypical `destructor` on instances. - * - * @param {Function} CopyConstructor Constructor that can be used to reset. - * @param {Function} pooler Customizable pooler. - */ -var addPoolingTo = function (CopyConstructor, pooler) { - // Casting as any so that flow ignores the actual implementation and trusts - // it to match the type we declared - var NewKlass = CopyConstructor; - NewKlass.instancePool = []; - NewKlass.getPooled = pooler || DEFAULT_POOLER; - if (!NewKlass.poolSize) { - NewKlass.poolSize = DEFAULT_POOL_SIZE; - } - NewKlass.release = standardReleaser; - return NewKlass; -}; - -var PooledClass = { - addPoolingTo: addPoolingTo, - oneArgumentPooler: oneArgumentPooler, - twoArgumentPooler: twoArgumentPooler, - threeArgumentPooler: threeArgumentPooler, - fourArgumentPooler: fourArgumentPooler -}; - -module.exports = PooledClass; - -/***/ }), -/* 252 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(43); - -var ReactCurrentOwner = __webpack_require__(23); -var REACT_ELEMENT_TYPE = __webpack_require__(145); - -var getIteratorFn = __webpack_require__(146); -var invariant = __webpack_require__(1); -var KeyEscapeUtils = __webpack_require__(253); -var warning = __webpack_require__(2); - -var SEPARATOR = '.'; -var SUBSEPARATOR = ':'; - -/** - * This is inlined from ReactElement since this file is shared between - * isomorphic and renderers. We could extract this to a - * - */ - -/** - * TODO: Test that a single child and an array with one item have the same key - * pattern. - */ - -var didWarnAboutMaps = false; - -/** - * 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 (component && typeof component === 'object' && component.key != null) { - // Explicit key - return KeyEscapeUtils.escape(component.key); - } - // Implicit key determined by the index in the set - return index.toString(36); -} - -/** - * @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; - } - - if (children === null || type === 'string' || type === 'number' || - // The following is inlined from ReactElement. This means we can optimize - // some checks. React Fiber also inlines this logic for similar purposes. - type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { - 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; - var nextName; - 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 (iteratorFn) { - var iterator = iteratorFn.call(children); - var step; - if (iteratorFn !== children.entries) { - var ii = 0; - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getComponentKey(child, ii++); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } else { - if (true) { - var mapsAsChildrenAddendum = ''; - if (ReactCurrentOwner.current) { - var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); - if (mapsAsChildrenOwnerName) { - mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; - } - } - true ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; - didWarnAboutMaps = true; - } - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - child = entry[1]; - nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } - } - } else if (type === 'object') { - var addendum = ''; - if (true) { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; - if (children._isReactElement) { - addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.'; - } - if (ReactCurrentOwner.current) { - var name = ReactCurrentOwner.current.getName(); - if (name) { - addendum += ' Check the render method of `' + name + '`.'; - } - } - } - var childrenString = String(children); - true ? true ? 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) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; - } - } - - 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); -} - -module.exports = traverseAllChildren; - -/***/ }), -/* 253 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -/** - * 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; -} - -/** - * Unescape and unwrap key for human-readable display - * - * @param {string} key to unescape. - * @return {string} the unescaped key. - */ -function unescape(key) { - var unescapeRegex = /(=0|=2)/g; - var unescaperLookup = { - '=0': '=', - '=2': ':' - }; - var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); - - return ('' + keySubstring).replace(unescapeRegex, function (match) { - return unescaperLookup[match]; - }); -} - -var KeyEscapeUtils = { - escape: escape, - unescape: unescape -}; - -module.exports = KeyEscapeUtils; - -/***/ }), -/* 254 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactElement = __webpack_require__(36); - -/** - * Create a factory that creates HTML tag elements. - * - * @private - */ -var createDOMFactory = ReactElement.createFactory; -if (true) { - var ReactElementValidator = __webpack_require__(147); - createDOMFactory = ReactElementValidator.createFactory; -} - -/** - * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. - * - * @public - */ -var ReactDOMFactories = { - a: createDOMFactory('a'), - abbr: createDOMFactory('abbr'), - address: createDOMFactory('address'), - area: createDOMFactory('area'), - article: createDOMFactory('article'), - aside: createDOMFactory('aside'), - audio: createDOMFactory('audio'), - b: createDOMFactory('b'), - base: createDOMFactory('base'), - bdi: createDOMFactory('bdi'), - bdo: createDOMFactory('bdo'), - big: createDOMFactory('big'), - blockquote: createDOMFactory('blockquote'), - body: createDOMFactory('body'), - br: createDOMFactory('br'), - button: createDOMFactory('button'), - canvas: createDOMFactory('canvas'), - caption: createDOMFactory('caption'), - cite: createDOMFactory('cite'), - code: createDOMFactory('code'), - col: createDOMFactory('col'), - colgroup: createDOMFactory('colgroup'), - data: createDOMFactory('data'), - datalist: createDOMFactory('datalist'), - dd: createDOMFactory('dd'), - del: createDOMFactory('del'), - details: createDOMFactory('details'), - dfn: createDOMFactory('dfn'), - dialog: createDOMFactory('dialog'), - div: createDOMFactory('div'), - dl: createDOMFactory('dl'), - dt: createDOMFactory('dt'), - em: createDOMFactory('em'), - embed: createDOMFactory('embed'), - fieldset: createDOMFactory('fieldset'), - figcaption: createDOMFactory('figcaption'), - figure: createDOMFactory('figure'), - footer: createDOMFactory('footer'), - form: createDOMFactory('form'), - h1: createDOMFactory('h1'), - h2: createDOMFactory('h2'), - h3: createDOMFactory('h3'), - h4: createDOMFactory('h4'), - h5: createDOMFactory('h5'), - h6: createDOMFactory('h6'), - head: createDOMFactory('head'), - header: createDOMFactory('header'), - hgroup: createDOMFactory('hgroup'), - hr: createDOMFactory('hr'), - html: createDOMFactory('html'), - i: createDOMFactory('i'), - iframe: createDOMFactory('iframe'), - img: createDOMFactory('img'), - input: createDOMFactory('input'), - ins: createDOMFactory('ins'), - kbd: createDOMFactory('kbd'), - keygen: createDOMFactory('keygen'), - label: createDOMFactory('label'), - legend: createDOMFactory('legend'), - li: createDOMFactory('li'), - link: createDOMFactory('link'), - main: createDOMFactory('main'), - map: createDOMFactory('map'), - mark: createDOMFactory('mark'), - menu: createDOMFactory('menu'), - menuitem: createDOMFactory('menuitem'), - meta: createDOMFactory('meta'), - meter: createDOMFactory('meter'), - nav: createDOMFactory('nav'), - noscript: createDOMFactory('noscript'), - object: createDOMFactory('object'), - ol: createDOMFactory('ol'), - optgroup: createDOMFactory('optgroup'), - option: createDOMFactory('option'), - output: createDOMFactory('output'), - p: createDOMFactory('p'), - param: createDOMFactory('param'), - picture: createDOMFactory('picture'), - pre: createDOMFactory('pre'), - progress: createDOMFactory('progress'), - q: createDOMFactory('q'), - rp: createDOMFactory('rp'), - rt: createDOMFactory('rt'), - ruby: createDOMFactory('ruby'), - s: createDOMFactory('s'), - samp: createDOMFactory('samp'), - script: createDOMFactory('script'), - section: createDOMFactory('section'), - select: createDOMFactory('select'), - small: createDOMFactory('small'), - source: createDOMFactory('source'), - span: createDOMFactory('span'), - strong: createDOMFactory('strong'), - style: createDOMFactory('style'), - sub: createDOMFactory('sub'), - summary: createDOMFactory('summary'), - sup: createDOMFactory('sup'), - table: createDOMFactory('table'), - tbody: createDOMFactory('tbody'), - td: createDOMFactory('td'), - textarea: createDOMFactory('textarea'), - tfoot: createDOMFactory('tfoot'), - th: createDOMFactory('th'), - thead: createDOMFactory('thead'), - time: createDOMFactory('time'), - title: createDOMFactory('title'), - tr: createDOMFactory('tr'), - track: createDOMFactory('track'), - u: createDOMFactory('u'), - ul: createDOMFactory('ul'), - 'var': createDOMFactory('var'), - video: createDOMFactory('video'), - wbr: createDOMFactory('wbr'), - - // SVG - circle: createDOMFactory('circle'), - clipPath: createDOMFactory('clipPath'), - defs: createDOMFactory('defs'), - ellipse: createDOMFactory('ellipse'), - g: createDOMFactory('g'), - image: createDOMFactory('image'), - line: createDOMFactory('line'), - linearGradient: createDOMFactory('linearGradient'), - mask: createDOMFactory('mask'), - path: createDOMFactory('path'), - pattern: createDOMFactory('pattern'), - polygon: createDOMFactory('polygon'), - polyline: createDOMFactory('polyline'), - radialGradient: createDOMFactory('radialGradient'), - rect: createDOMFactory('rect'), - stop: createDOMFactory('stop'), - svg: createDOMFactory('svg'), - text: createDOMFactory('text'), - tspan: createDOMFactory('tspan') -}; - -module.exports = ReactDOMFactories; - -/***/ }), -/* 255 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(43); - -var ReactPropTypeLocationNames = __webpack_require__(256); -var ReactPropTypesSecret = __webpack_require__(257); - -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -var ReactComponentTreeHook; - -if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","PUBLIC_URL":"","STORYBOOK_GIT_ORIGIN":"https://github.com/oblador/loki.git","STORYBOOK_GIT_BRANCH":"master"}) && "development" === 'test') { - // Temporary hack. - // Inline requires don't work well with Jest: - // https://github.com/facebook/react/issues/7240 - // Remove the inline requires when we don't need them anymore: - // https://github.com/facebook/react/pull/7178 - ReactComponentTreeHook = __webpack_require__(17); -} - -var loggedTypeFailures = {}; - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?object} element The React element that is being type-checked - * @param {?number} debugID The React component instance that is being type-checked - * @private - */ -function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - !(typeof typeSpecs[typeSpecName] === 'function') ? true ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - true ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var componentStackInfo = ''; - - if (true) { - if (!ReactComponentTreeHook) { - ReactComponentTreeHook = __webpack_require__(17); - } - if (debugID !== null) { - componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); - } else if (element !== null) { - componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); - } - } - - true ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; - } - } - } -} - -module.exports = checkReactTypeSpec; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(44))) - -/***/ }), -/* 256 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var ReactPropTypeLocationNames = {}; - -if (true) { - ReactPropTypeLocationNames = { - prop: 'prop', - context: 'context', - childContext: 'child context' - }; -} - -module.exports = ReactPropTypeLocationNames; - -/***/ }), -/* 257 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - -/***/ }), -/* 258 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _require = __webpack_require__(36), - isValidElement = _require.isValidElement; - -var factory = __webpack_require__(148); - -module.exports = factory(isValidElement); - -/***/ }), -/* 259 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - - -if (true) { - var invariant = __webpack_require__(1); - var warning = __webpack_require__(2); - var ReactPropTypesSecret = __webpack_require__(150); - var loggedTypeFailures = {}; -} - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private - */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (true) { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var stack = getStack ? getStack() : ''; - - warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); - } - } - } - } -} - -module.exports = checkPropTypes; - - -/***/ }), -/* 260 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -module.exports = '15.6.2'; - -/***/ }), -/* 261 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _require = __webpack_require__(143), - Component = _require.Component; - -var _require2 = __webpack_require__(36), - isValidElement = _require2.isValidElement; - -var ReactNoopUpdateQueue = __webpack_require__(144); -var factory = __webpack_require__(262); - -module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue); - -/***/ }), -/* 262 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var emptyObject = __webpack_require__(72); -var _invariant = __webpack_require__(1); - -if (true) { - var warning = __webpack_require__(2); -} - -var MIXINS_KEY = 'mixins'; - -// Helper function to allow the creation of anonymous functions which do not -// have .name set to the name of the variable being assigned to. -function identity(fn) { - return fn; -} - -var ReactPropTypeLocationNames; -if (true) { - ReactPropTypeLocationNames = { - prop: 'prop', - context: 'context', - childContext: 'child context' - }; -} else { - ReactPropTypeLocationNames = {}; -} - -function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { - /** - * Policies that describe methods in `ReactClassInterface`. - */ - - var injectedMixins = []; - - /** - * Composite components are higher-level components that compose other composite - * or host components. - * - * To create a new type of `ReactClass`, pass a specification of - * your new class to `React.createClass`. The only requirement of your class - * specification is that you implement a `render` method. - * - * var MyComponent = React.createClass({ - * render: function() { - * return <div>Hello World</div>; - * } - * }); - * - * The class specification supports a specific protocol of methods that have - * special meaning (e.g. `render`). See `ReactClassInterface` for - * more the comprehensive protocol. Any other properties and methods in the - * class specification will be available on the prototype. - * - * @interface ReactClassInterface - * @internal - */ - var ReactClassInterface = { - /** - * An array of Mixin objects to include when defining your component. - * - * @type {array} - * @optional - */ - mixins: 'DEFINE_MANY', - - /** - * An object containing properties and methods that should be defined on - * the component's constructor instead of its prototype (static methods). - * - * @type {object} - * @optional - */ - statics: 'DEFINE_MANY', - - /** - * Definition of prop types for this component. - * - * @type {object} - * @optional - */ - propTypes: 'DEFINE_MANY', - - /** - * Definition of context types for this component. - * - * @type {object} - * @optional - */ - contextTypes: 'DEFINE_MANY', - - /** - * Definition of context types this component sets for its children. - * - * @type {object} - * @optional - */ - childContextTypes: 'DEFINE_MANY', - - // ==== Definition methods ==== - - /** - * Invoked when the component is mounted. Values in the mapping will be set on - * `this.props` if that prop is not specified (i.e. using an `in` check). - * - * This method is invoked before `getInitialState` and therefore cannot rely - * on `this.state` or use `this.setState`. - * - * @return {object} - * @optional - */ - getDefaultProps: 'DEFINE_MANY_MERGED', - - /** - * Invoked once before the component is mounted. The return value will be used - * as the initial value of `this.state`. - * - * getInitialState: function() { - * return { - * isOn: false, - * fooBaz: new BazFoo() - * } - * } - * - * @return {object} - * @optional - */ - getInitialState: 'DEFINE_MANY_MERGED', - - /** - * @return {object} - * @optional - */ - getChildContext: 'DEFINE_MANY_MERGED', - - /** - * Uses props from `this.props` and state from `this.state` to render the - * structure of the component. - * - * No guarantees are made about when or how often this method is invoked, so - * it must not have side effects. - * - * render: function() { - * var name = this.props.name; - * return <div>Hello, {name}!</div>; - * } - * - * @return {ReactComponent} - * @required - */ - render: 'DEFINE_ONCE', - - // ==== Delegate methods ==== - - /** - * Invoked when the component is initially created and about to be mounted. - * This may have side effects, but any external subscriptions or data created - * by this method must be cleaned up in `componentWillUnmount`. - * - * @optional - */ - componentWillMount: 'DEFINE_MANY', - - /** - * Invoked when the component has been mounted and has a DOM representation. - * However, there is no guarantee that the DOM node is in the document. - * - * Use this as an opportunity to operate on the DOM when the component has - * been mounted (initialized and rendered) for the first time. - * - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidMount: 'DEFINE_MANY', - - /** - * Invoked before the component receives new props. - * - * Use this as an opportunity to react to a prop transition by updating the - * state using `this.setState`. Current props are accessed via `this.props`. - * - * componentWillReceiveProps: function(nextProps, nextContext) { - * this.setState({ - * likesIncreasing: nextProps.likeCount > this.props.likeCount - * }); - * } - * - * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop - * transition may cause a state change, but the opposite is not true. If you - * need it, you are probably looking for `componentWillUpdate`. - * - * @param {object} nextProps - * @optional - */ - componentWillReceiveProps: 'DEFINE_MANY', - - /** - * Invoked while deciding if the component should be updated as a result of - * receiving new props, state and/or context. - * - * Use this as an opportunity to `return false` when you're certain that the - * transition to the new props/state/context will not require a component - * update. - * - * shouldComponentUpdate: function(nextProps, nextState, nextContext) { - * return !equal(nextProps, this.props) || - * !equal(nextState, this.state) || - * !equal(nextContext, this.context); - * } - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @return {boolean} True if the component should update. - * @optional - */ - shouldComponentUpdate: 'DEFINE_ONCE', - - /** - * Invoked when the component is about to update due to a transition from - * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` - * and `nextContext`. - * - * Use this as an opportunity to perform preparation before an update occurs. - * - * NOTE: You **cannot** use `this.setState()` in this method. - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @param {ReactReconcileTransaction} transaction - * @optional - */ - componentWillUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component's DOM representation has been updated. - * - * Use this as an opportunity to operate on the DOM when the component has - * been updated. - * - * @param {object} prevProps - * @param {?object} prevState - * @param {?object} prevContext - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component is about to be removed from its parent and have - * its DOM representation destroyed. - * - * Use this as an opportunity to deallocate any external resources. - * - * NOTE: There is no `componentDidUnmount` since your component will have been - * destroyed by that point. - * - * @optional - */ - componentWillUnmount: 'DEFINE_MANY', - - // ==== Advanced methods ==== - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @internal - * @overridable - */ - updateComponent: 'OVERRIDE_BASE' - }; - - /** - * Mapping from class specification keys to special processing functions. - * - * Although these are declared like instance properties in the specification - * when defining classes using `React.createClass`, they are actually static - * and are accessible on the constructor instead of the prototype. Despite - * being static, they must be defined outside of the "statics" key under - * which all other static methods are defined. - */ - var RESERVED_SPEC_KEYS = { - displayName: function(Constructor, displayName) { - Constructor.displayName = displayName; - }, - mixins: function(Constructor, mixins) { - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - mixSpecIntoComponent(Constructor, mixins[i]); - } - } - }, - childContextTypes: function(Constructor, childContextTypes) { - if (true) { - validateTypeDef(Constructor, childContextTypes, 'childContext'); - } - Constructor.childContextTypes = _assign( - {}, - Constructor.childContextTypes, - childContextTypes - ); - }, - contextTypes: function(Constructor, contextTypes) { - if (true) { - validateTypeDef(Constructor, contextTypes, 'context'); - } - Constructor.contextTypes = _assign( - {}, - Constructor.contextTypes, - contextTypes - ); - }, - /** - * Special case getDefaultProps which should move into statics but requires - * automatic merging. - */ - getDefaultProps: function(Constructor, getDefaultProps) { - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction( - Constructor.getDefaultProps, - getDefaultProps - ); - } else { - Constructor.getDefaultProps = getDefaultProps; - } - }, - propTypes: function(Constructor, propTypes) { - if (true) { - validateTypeDef(Constructor, propTypes, 'prop'); - } - Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); - }, - statics: function(Constructor, statics) { - mixStaticSpecIntoComponent(Constructor, statics); - }, - autobind: function() {} - }; - - function validateTypeDef(Constructor, typeDef, location) { - for (var propName in typeDef) { - if (typeDef.hasOwnProperty(propName)) { - // use a warning instead of an _invariant so components - // don't show up in prod but only in __DEV__ - if (true) { - warning( - typeof typeDef[propName] === 'function', - '%s: %s type `%s` is invalid; it must be a function, usually from ' + - 'React.PropTypes.', - Constructor.displayName || 'ReactClass', - ReactPropTypeLocationNames[location], - propName - ); - } - } - } - } - - function validateMethodOverride(isAlreadyDefined, name) { - var specPolicy = ReactClassInterface.hasOwnProperty(name) - ? ReactClassInterface[name] - : null; - - // Disallow overriding of base class methods unless explicitly allowed. - if (ReactClassMixin.hasOwnProperty(name)) { - _invariant( - specPolicy === 'OVERRIDE_BASE', - 'ReactClassInterface: You are attempting to override ' + - '`%s` from your class specification. Ensure that your method names ' + - 'do not overlap with React methods.', - name - ); - } - - // Disallow defining methods more than once unless explicitly allowed. - if (isAlreadyDefined) { - _invariant( - specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', - 'ReactClassInterface: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be due ' + - 'to a mixin.', - name - ); - } - } - - /** - * Mixin helper which handles policy validation and reserved - * specification keys when building React classes. - */ - function mixSpecIntoComponent(Constructor, spec) { - if (!spec) { - if (true) { - var typeofSpec = typeof spec; - var isMixinValid = typeofSpec === 'object' && spec !== null; - - if (true) { - warning( - isMixinValid, - "%s: You're attempting to include a mixin that is either null " + - 'or not an object. Check the mixins included by the component, ' + - 'as well as any mixins they include themselves. ' + - 'Expected object but got %s.', - Constructor.displayName || 'ReactClass', - spec === null ? null : typeofSpec - ); - } - } - - return; - } - - _invariant( - typeof spec !== 'function', - "ReactClass: You're attempting to " + - 'use a component class or function as a mixin. Instead, just use a ' + - 'regular object.' - ); - _invariant( - !isValidElement(spec), - "ReactClass: You're attempting to " + - 'use a component as a mixin. Instead, just use a regular object.' - ); - - var proto = Constructor.prototype; - var autoBindPairs = proto.__reactAutoBindPairs; - - // By handling mixins before any other properties, we ensure the same - // chaining order is applied to methods with DEFINE_MANY policy, whether - // mixins are listed before or after these methods in the spec. - if (spec.hasOwnProperty(MIXINS_KEY)) { - RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); - } - - for (var name in spec) { - if (!spec.hasOwnProperty(name)) { - continue; - } - - if (name === MIXINS_KEY) { - // We have already handled mixins in a special case above. - continue; - } - - var property = spec[name]; - var isAlreadyDefined = proto.hasOwnProperty(name); - validateMethodOverride(isAlreadyDefined, name); - - if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { - RESERVED_SPEC_KEYS[name](Constructor, property); - } else { - // Setup methods on prototype: - // The following member methods should not be automatically bound: - // 1. Expected ReactClass methods (in the "interface"). - // 2. Overridden methods (that were mixed in). - var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); - var isFunction = typeof property === 'function'; - var shouldAutoBind = - isFunction && - !isReactClassMethod && - !isAlreadyDefined && - spec.autobind !== false; - - if (shouldAutoBind) { - autoBindPairs.push(name, property); - proto[name] = property; - } else { - if (isAlreadyDefined) { - var specPolicy = ReactClassInterface[name]; - - // These cases should already be caught by validateMethodOverride. - _invariant( - isReactClassMethod && - (specPolicy === 'DEFINE_MANY_MERGED' || - specPolicy === 'DEFINE_MANY'), - 'ReactClass: Unexpected spec policy %s for key %s ' + - 'when mixing in component specs.', - specPolicy, - name - ); - - // For methods which are defined more than once, call the existing - // methods before calling the new property, merging if appropriate. - if (specPolicy === 'DEFINE_MANY_MERGED') { - proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === 'DEFINE_MANY') { - proto[name] = createChainedFunction(proto[name], property); - } - } else { - proto[name] = property; - if (true) { - // Add verbose displayName to the function, which helps when looking - // at profiling tools. - if (typeof property === 'function' && spec.displayName) { - proto[name].displayName = spec.displayName + '_' + name; - } - } - } - } - } - } - } - - function mixStaticSpecIntoComponent(Constructor, statics) { - if (!statics) { - return; - } - for (var name in statics) { - var property = statics[name]; - if (!statics.hasOwnProperty(name)) { - continue; - } - - var isReserved = name in RESERVED_SPEC_KEYS; - _invariant( - !isReserved, - 'ReactClass: You are attempting to define a reserved ' + - 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + - 'as an instance property instead; it will still be accessible on the ' + - 'constructor.', - name - ); - - var isInherited = name in Constructor; - _invariant( - !isInherited, - 'ReactClass: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be ' + - 'due to a mixin.', - name - ); - Constructor[name] = property; - } - } - - /** - * Merge two objects, but throw if both contain the same key. - * - * @param {object} one The first object, which is mutated. - * @param {object} two The second object - * @return {object} one after it has been mutated to contain everything in two. - */ - function mergeIntoWithNoDuplicateKeys(one, two) { - _invariant( - one && two && typeof one === 'object' && typeof two === 'object', - 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' - ); - - for (var key in two) { - if (two.hasOwnProperty(key)) { - _invariant( - one[key] === undefined, - 'mergeIntoWithNoDuplicateKeys(): ' + - 'Tried to merge two objects with the same key: `%s`. This conflict ' + - 'may be due to a mixin; in particular, this may be caused by two ' + - 'getInitialState() or getDefaultProps() methods returning objects ' + - 'with clashing keys.', - key - ); - one[key] = two[key]; - } - } - return one; - } - - /** - * Creates a function that invokes two functions and merges their return values. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createMergedResultFunction(one, two) { - return function mergedResult() { - var a = one.apply(this, arguments); - var b = two.apply(this, arguments); - if (a == null) { - return b; - } else if (b == null) { - return a; - } - var c = {}; - mergeIntoWithNoDuplicateKeys(c, a); - mergeIntoWithNoDuplicateKeys(c, b); - return c; - }; - } - - /** - * Creates a function that invokes two functions and ignores their return vales. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createChainedFunction(one, two) { - return function chainedFunction() { - one.apply(this, arguments); - two.apply(this, arguments); - }; - } - - /** - * Binds a method to the component. - * - * @param {object} component Component whose method is going to be bound. - * @param {function} method Method to be bound. - * @return {function} The bound method. - */ - function bindAutoBindMethod(component, method) { - var boundMethod = method.bind(component); - if (true) { - boundMethod.__reactBoundContext = component; - boundMethod.__reactBoundMethod = method; - boundMethod.__reactBoundArguments = null; - var componentName = component.constructor.displayName; - var _bind = boundMethod.bind; - boundMethod.bind = function(newThis) { - for ( - var _len = arguments.length, - args = Array(_len > 1 ? _len - 1 : 0), - _key = 1; - _key < _len; - _key++ - ) { - args[_key - 1] = arguments[_key]; - } - - // User is trying to bind() an autobound method; we effectively will - // ignore the value of "this" that the user is trying to use, so - // let's warn. - if (newThis !== component && newThis !== null) { - if (true) { - warning( - false, - 'bind(): React component methods may only be bound to the ' + - 'component instance. See %s', - componentName - ); - } - } else if (!args.length) { - if (true) { - warning( - false, - 'bind(): You are binding a component method to the component. ' + - 'React does this for you automatically in a high-performance ' + - 'way, so you can safely remove this call. See %s', - componentName - ); - } - return boundMethod; - } - var reboundMethod = _bind.apply(boundMethod, arguments); - reboundMethod.__reactBoundContext = component; - reboundMethod.__reactBoundMethod = method; - reboundMethod.__reactBoundArguments = args; - return reboundMethod; - }; - } - return boundMethod; - } - - /** - * Binds all auto-bound methods in a component. - * - * @param {object} component Component whose method is going to be bound. - */ - function bindAutoBindMethods(component) { - var pairs = component.__reactAutoBindPairs; - for (var i = 0; i < pairs.length; i += 2) { - var autoBindKey = pairs[i]; - var method = pairs[i + 1]; - component[autoBindKey] = bindAutoBindMethod(component, method); - } - } - - var IsMountedPreMixin = { - componentDidMount: function() { - this.__isMounted = true; - } - }; - - var IsMountedPostMixin = { - componentWillUnmount: function() { - this.__isMounted = false; - } - }; - - /** - * Add more to the ReactClass base class. These are all legacy features and - * therefore not already part of the modern ReactComponent. - */ - var ReactClassMixin = { - /** - * TODO: This will be deprecated because state should always keep a consistent - * type signature and the only use case for this, is to avoid that. - */ - replaceState: function(newState, callback) { - this.updater.enqueueReplaceState(this, newState, callback); - }, - - /** - * Checks whether or not this composite component is mounted. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function() { - if (true) { - warning( - this.__didWarnIsMounted, - '%s: isMounted is deprecated. Instead, make sure to clean up ' + - 'subscriptions and pending requests in componentWillUnmount to ' + - 'prevent memory leaks.', - (this.constructor && this.constructor.displayName) || - this.name || - 'Component' - ); - this.__didWarnIsMounted = true; - } - return !!this.__isMounted; - } - }; - - var ReactClassComponent = function() {}; - _assign( - ReactClassComponent.prototype, - ReactComponent.prototype, - ReactClassMixin - ); - - /** - * Creates a composite component class given a class specification. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass - * - * @param {object} spec Class specification (which must define `render`). - * @return {function} Component constructor function. - * @public - */ - function createClass(spec) { - // To keep our warnings more understandable, we'll use a little hack here to - // ensure that Constructor.name !== 'Constructor'. This makes sure we don't - // unnecessarily identify a class without displayName as 'Constructor'. - var Constructor = identity(function(props, context, updater) { - // This constructor gets overridden by mocks. The argument is used - // by mocks to assert on what gets mounted. - - if (true) { - warning( - this instanceof Constructor, - 'Something is calling a React component directly. Use a factory or ' + - 'JSX instead. See: https://fb.me/react-legacyfactory' - ); - } - - // Wire up auto-binding - if (this.__reactAutoBindPairs.length) { - bindAutoBindMethods(this); - } - - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - - this.state = null; - - // ReactClasses doesn't have constructors. Instead, they use the - // getInitialState and componentWillMount methods for initialization. - - var initialState = this.getInitialState ? this.getInitialState() : null; - if (true) { - // We allow auto-mocks to proceed as if they're returning null. - if ( - initialState === undefined && - this.getInitialState._isMockFunction - ) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - initialState = null; - } - } - _invariant( - typeof initialState === 'object' && !Array.isArray(initialState), - '%s.getInitialState(): must return an object or null', - Constructor.displayName || 'ReactCompositeComponent' - ); - - this.state = initialState; - }); - Constructor.prototype = new ReactClassComponent(); - Constructor.prototype.constructor = Constructor; - Constructor.prototype.__reactAutoBindPairs = []; - - injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); - - mixSpecIntoComponent(Constructor, IsMountedPreMixin); - mixSpecIntoComponent(Constructor, spec); - mixSpecIntoComponent(Constructor, IsMountedPostMixin); - - // Initialize the defaultProps property after all mixins have been merged. - if (Constructor.getDefaultProps) { - Constructor.defaultProps = Constructor.getDefaultProps(); - } - - if (true) { - // This is a tag to indicate that the use of these method names is ok, - // since it's used with createClass. If it's not, then it's likely a - // mistake so we'll warn you to use the static property, property - // initializer or constructor respectively. - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps.isReactClassApproved = {}; - } - if (Constructor.prototype.getInitialState) { - Constructor.prototype.getInitialState.isReactClassApproved = {}; - } - } - - _invariant( - Constructor.prototype.render, - 'createClass(...): Class specification must implement a `render` method.' - ); - - if (true) { - warning( - !Constructor.prototype.componentShouldUpdate, - '%s has a method called ' + - 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + - 'The name is phrased as a question because the function is ' + - 'expected to return a value.', - spec.displayName || 'A component' - ); - warning( - !Constructor.prototype.componentWillRecieveProps, - '%s has a method called ' + - 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', - spec.displayName || 'A component' - ); - } - - // Reduce time spent doing lookups by setting these on the prototype. - for (var methodName in ReactClassInterface) { - if (!Constructor.prototype[methodName]) { - Constructor.prototype[methodName] = null; - } - } - - return Constructor; - } - - return createClass; -} - -module.exports = factory; - - -/***/ }), -/* 263 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - -var _prodInvariant = __webpack_require__(43); - -var ReactElement = __webpack_require__(36); - -var invariant = __webpack_require__(1); - -/** - * Returns the first child in a collection of children and verifies that there - * is only one child in the collection. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only - * - * 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) { - !ReactElement.isValidElement(children) ? true ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0; - return children; -} - -module.exports = onlyChild; - -/***/ }), -/* 264 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(265); -module.exports = __webpack_require__(10).Object.keys; - - -/***/ }), -/* 265 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.14 Object.keys(O) -var toObject = __webpack_require__(53); -var $keys = __webpack_require__(56); - -__webpack_require__(134)('keys', function () { - return function keys(it) { - return $keys(toObject(it)); - }; -}); - - -/***/ }), -/* 266 */ -/***/ (function(module, exports, __webpack_require__) { - -// false -> Array#indexOf -// true -> Array#includes -var toIObject = __webpack_require__(46); -var toLength = __webpack_require__(91); -var toAbsoluteIndex = __webpack_require__(267); -module.exports = function (IS_INCLUDES) { - return function ($this, el, fromIndex) { - var O = toIObject($this); - var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); - var value; - // Array#includes uses SameValueZero equality algorithm - // eslint-disable-next-line no-self-compare - if (IS_INCLUDES && el != el) while (length > index) { - value = O[index++]; - // eslint-disable-next-line no-self-compare - if (value != value) return true; - // Array#indexOf ignores holes, Array#includes - not - } else for (;length > index; index++) if (IS_INCLUDES || index in O) { - if (O[index] === el) return IS_INCLUDES || index || 0; - } return !IS_INCLUDES && -1; - }; -}; - - -/***/ }), -/* 267 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(97); -var max = Math.max; -var min = Math.min; -module.exports = function (index, length) { - index = toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); -}; - - -/***/ }), -/* 268 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(269); -var $Object = __webpack_require__(10).Object; -module.exports = function defineProperty(it, key, desc) { - return $Object.defineProperty(it, key, desc); -}; - - -/***/ }), -/* 269 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(15); -// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) -$export($export.S + $export.F * !__webpack_require__(27), 'Object', { defineProperty: __webpack_require__(24).f }); - - -/***/ }), -/* 270 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _toConsumableArray2 = __webpack_require__(47); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _getPrototypeOf = __webpack_require__(18); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _deepEqual = __webpack_require__(162); - -var _deepEqual2 = _interopRequireDefault(_deepEqual); - -var _ActionLogger = __webpack_require__(298); - -var _ActionLogger2 = _interopRequireDefault(_ActionLogger); - -var _ = __webpack_require__(66); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ActionLogger = function (_React$Component) { - (0, _inherits3.default)(ActionLogger, _React$Component); - - function ActionLogger(props) { - var _ref; - - (0, _classCallCheck3.default)(this, ActionLogger); - - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var _this = (0, _possibleConstructorReturn3.default)(this, (_ref = ActionLogger.__proto__ || (0, _getPrototypeOf2.default)(ActionLogger)).call.apply(_ref, [this, props].concat(args))); - - _this.state = { actions: [] }; - _this._actionListener = function (action) { - return _this.addAction(action); - }; - return _this; - } - - (0, _createClass3.default)(ActionLogger, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.props.channel.on(_.EVENT_ID, this._actionListener); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.props.channel.removeListener(_.EVENT_ID, this._actionListener); - } - }, { - key: 'addAction', - value: function addAction(action) { - action.data.args = action.data.args.map(function (arg) { - return JSON.parse(arg); - }); // eslint-disable-line - var actions = [].concat((0, _toConsumableArray3.default)(this.state.actions)); - var previous = actions.length && actions[0]; - if (previous && (0, _deepEqual2.default)(previous.data, action.data, { strict: true })) { - previous.count++; // eslint-disable-line - } else { - action.count = 1; // eslint-disable-line - actions.unshift(action); - } - this.setState({ actions: actions }); - } - }, { - key: 'clearActions', - value: function clearActions() { - this.setState({ actions: [] }); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var props = { - actions: this.state.actions, - onClear: function onClear() { - return _this2.clearActions(); - } - }; - return _react2.default.createElement(_ActionLogger2.default, props); - } - }]); - return ActionLogger; -}(_react2.default.Component); /* eslint-disable no-underscore-dangle */ - -exports.default = ActionLogger; - - -ActionLogger.propTypes = { - channel: _propTypes2.default.object // eslint-disable-line react/forbid-prop-types -}; -ActionLogger.defaultProps = { - channel: {} -}; - -/***/ }), -/* 271 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(54); -__webpack_require__(274); -module.exports = __webpack_require__(10).Array.from; - - -/***/ }), -/* 272 */ -/***/ (function(module, exports, __webpack_require__) { - -var toInteger = __webpack_require__(97); -var defined = __webpack_require__(96); -// true -> String#at -// false -> String#codePointAt -module.exports = function (TO_STRING) { - return function (that, pos) { - var s = String(defined(that)); - var i = toInteger(pos); - var l = s.length; - var a, b; - if (i < 0 || i >= l) return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; -}; - - -/***/ }), -/* 273 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var create = __webpack_require__(92); -var descriptor = __webpack_require__(58); -var setToStringTag = __webpack_require__(68); -var IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(35)(IteratorPrototype, __webpack_require__(14)('iterator'), function () { return this; }); - -module.exports = function (Constructor, NAME, next) { - Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); - setToStringTag(Constructor, NAME + ' Iterator'); -}; - - -/***/ }), -/* 274 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var ctx = __webpack_require__(34); -var $export = __webpack_require__(15); -var toObject = __webpack_require__(53); -var call = __webpack_require__(157); -var isArrayIter = __webpack_require__(158); -var toLength = __webpack_require__(91); -var createProperty = __webpack_require__(275); -var getIterFn = __webpack_require__(103); - -$export($export.S + $export.F * !__webpack_require__(159)(function (iter) { Array.from(iter); }), 'Array', { - // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) - from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { - var O = toObject(arrayLike); - var C = typeof this == 'function' ? this : Array; - var aLen = arguments.length; - var mapfn = aLen > 1 ? arguments[1] : undefined; - var mapping = mapfn !== undefined; - var index = 0; - var iterFn = getIterFn(O); - var length, result, step, iterator; - if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); - // if object isn't iterable or it's array with default iterator - use simple case - if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { - for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { - createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); - } - } else { - length = toLength(O.length); - for (result = new C(length); length > index; index++) { - createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); - } - } - result.length = index; - return result; - } -}); - - -/***/ }), -/* 275 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var $defineProperty = __webpack_require__(24); -var createDesc = __webpack_require__(58); - -module.exports = function (object, index, value) { - if (index in object) $defineProperty.f(object, index, createDesc(0, value)); - else object[index] = value; -}; - - -/***/ }), -/* 276 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(277); -module.exports = __webpack_require__(10).Object.getPrototypeOf; - - -/***/ }), -/* 277 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.9 Object.getPrototypeOf(O) -var toObject = __webpack_require__(53); -var $getPrototypeOf = __webpack_require__(156); - -__webpack_require__(134)('getPrototypeOf', function () { - return function getPrototypeOf(it) { - return $getPrototypeOf(toObject(it)); - }; -}); - - -/***/ }), -/* 278 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(279), __esModule: true }; - -/***/ }), -/* 279 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(54); -__webpack_require__(69); -module.exports = __webpack_require__(104).f('iterator'); - - -/***/ }), -/* 280 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var addToUnscopables = __webpack_require__(281); -var step = __webpack_require__(223); -var Iterators = __webpack_require__(48); -var toIObject = __webpack_require__(46); - -// 22.1.3.4 Array.prototype.entries() -// 22.1.3.13 Array.prototype.keys() -// 22.1.3.29 Array.prototype.values() -// 22.1.3.30 Array.prototype[@@iterator]() -module.exports = __webpack_require__(136)(Array, 'Array', function (iterated, kind) { - this._t = toIObject(iterated); // target - this._i = 0; // next index - this._k = kind; // kind -// 22.1.5.2.1 %ArrayIteratorPrototype%.next() -}, function () { - var O = this._t; - var kind = this._k; - var index = this._i++; - if (!O || index >= O.length) { - this._t = undefined; - return step(1); - } - if (kind == 'keys') return step(0, index); - if (kind == 'values') return step(0, O[index]); - return step(0, [index, O[index]]); -}, 'values'); - -// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) -Iterators.Arguments = Iterators.Array; - -addToUnscopables('keys'); -addToUnscopables('values'); -addToUnscopables('entries'); - - -/***/ }), -/* 281 */ -/***/ (function(module, exports) { - -module.exports = function () { /* empty */ }; - - -/***/ }), -/* 282 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(283), __esModule: true }; - -/***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(284); -__webpack_require__(138); -__webpack_require__(287); -__webpack_require__(288); -module.exports = __webpack_require__(10).Symbol; - - -/***/ }), -/* 284 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// ECMAScript 6 symbols shim -var global = __webpack_require__(16); -var has = __webpack_require__(37); -var DESCRIPTORS = __webpack_require__(27); -var $export = __webpack_require__(15); -var redefine = __webpack_require__(154); -var META = __webpack_require__(137).KEY; -var $fails = __webpack_require__(41); -var shared = __webpack_require__(99); -var setToStringTag = __webpack_require__(68); -var uid = __webpack_require__(73); -var wks = __webpack_require__(14); -var wksExt = __webpack_require__(104); -var wksDefine = __webpack_require__(105); -var enumKeys = __webpack_require__(285); -var isArray = __webpack_require__(224); -var anObject = __webpack_require__(25); -var toIObject = __webpack_require__(46); -var toPrimitive = __webpack_require__(102); -var createDesc = __webpack_require__(58); -var _create = __webpack_require__(92); -var gOPNExt = __webpack_require__(286); -var $GOPD = __webpack_require__(161); -var $DP = __webpack_require__(24); -var $keys = __webpack_require__(56); -var gOPD = $GOPD.f; -var dP = $DP.f; -var gOPN = gOPNExt.f; -var $Symbol = global.Symbol; -var $JSON = global.JSON; -var _stringify = $JSON && $JSON.stringify; -var PROTOTYPE = 'prototype'; -var HIDDEN = wks('_hidden'); -var TO_PRIMITIVE = wks('toPrimitive'); -var isEnum = {}.propertyIsEnumerable; -var SymbolRegistry = shared('symbol-registry'); -var AllSymbols = shared('symbols'); -var OPSymbols = shared('op-symbols'); -var ObjectProto = Object[PROTOTYPE]; -var USE_NATIVE = typeof $Symbol == 'function'; -var QObject = global.QObject; -// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 -var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; - -// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 -var setSymbolDesc = DESCRIPTORS && $fails(function () { - return _create(dP({}, 'a', { - get: function () { return dP(this, 'a', { value: 7 }).a; } - })).a != 7; -}) ? function (it, key, D) { - var protoDesc = gOPD(ObjectProto, key); - if (protoDesc) delete ObjectProto[key]; - dP(it, key, D); - if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); -} : dP; - -var wrap = function (tag) { - var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); - sym._k = tag; - return sym; -}; - -var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { - return typeof it == 'symbol'; -} : function (it) { - return it instanceof $Symbol; -}; - -var $defineProperty = function defineProperty(it, key, D) { - if (it === ObjectProto) $defineProperty(OPSymbols, key, D); - anObject(it); - key = toPrimitive(key, true); - anObject(D); - if (has(AllSymbols, key)) { - if (!D.enumerable) { - if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); - it[HIDDEN][key] = true; - } else { - if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; - D = _create(D, { enumerable: createDesc(0, false) }); - } return setSymbolDesc(it, key, D); - } return dP(it, key, D); -}; -var $defineProperties = function defineProperties(it, P) { - anObject(it); - var keys = enumKeys(P = toIObject(P)); - var i = 0; - var l = keys.length; - var key; - while (l > i) $defineProperty(it, key = keys[i++], P[key]); - return it; -}; -var $create = function create(it, P) { - return P === undefined ? _create(it) : $defineProperties(_create(it), P); -}; -var $propertyIsEnumerable = function propertyIsEnumerable(key) { - var E = isEnum.call(this, key = toPrimitive(key, true)); - if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; - return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; -}; -var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { - it = toIObject(it); - key = toPrimitive(key, true); - if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; - var D = gOPD(it, key); - if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; - return D; -}; -var $getOwnPropertyNames = function getOwnPropertyNames(it) { - var names = gOPN(toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); - } return result; -}; -var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { - var IS_OP = it === ObjectProto; - var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); - var result = []; - var i = 0; - var key; - while (names.length > i) { - if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); - } return result; -}; - -// 19.4.1.1 Symbol([description]) -if (!USE_NATIVE) { - $Symbol = function Symbol() { - if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); - var tag = uid(arguments.length > 0 ? arguments[0] : undefined); - var $set = function (value) { - if (this === ObjectProto) $set.call(OPSymbols, value); - if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; - setSymbolDesc(this, tag, createDesc(1, value)); - }; - if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); - return wrap(tag); - }; - redefine($Symbol[PROTOTYPE], 'toString', function toString() { - return this._k; - }); - - $GOPD.f = $getOwnPropertyDescriptor; - $DP.f = $defineProperty; - __webpack_require__(160).f = gOPNExt.f = $getOwnPropertyNames; - __webpack_require__(75).f = $propertyIsEnumerable; - __webpack_require__(106).f = $getOwnPropertySymbols; - - if (DESCRIPTORS && !__webpack_require__(74)) { - redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); - } - - wksExt.f = function (name) { - return wrap(wks(name)); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); - -for (var es6Symbols = ( - // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 - 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' -).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); - -for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); - -$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { - // 19.4.2.1 Symbol.for(key) - 'for': function (key) { - return has(SymbolRegistry, key += '') - ? SymbolRegistry[key] - : SymbolRegistry[key] = $Symbol(key); - }, - // 19.4.2.5 Symbol.keyFor(sym) - keyFor: function keyFor(sym) { - if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); - for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; - }, - useSetter: function () { setter = true; }, - useSimple: function () { setter = false; } -}); - -$export($export.S + $export.F * !USE_NATIVE, 'Object', { - // 19.1.2.2 Object.create(O [, Properties]) - create: $create, - // 19.1.2.4 Object.defineProperty(O, P, Attributes) - defineProperty: $defineProperty, - // 19.1.2.3 Object.defineProperties(O, Properties) - defineProperties: $defineProperties, - // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) - getOwnPropertyDescriptor: $getOwnPropertyDescriptor, - // 19.1.2.7 Object.getOwnPropertyNames(O) - getOwnPropertyNames: $getOwnPropertyNames, - // 19.1.2.8 Object.getOwnPropertySymbols(O) - getOwnPropertySymbols: $getOwnPropertySymbols -}); - -// 24.3.2 JSON.stringify(value [, replacer [, space]]) -$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { - var S = $Symbol(); - // MS Edge converts symbol values to JSON as {} - // WebKit converts symbol values to JSON as null - // V8 throws on boxed symbols - return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; -})), 'JSON', { - stringify: function stringify(it) { - if (it === undefined || isSymbol(it)) return; // IE8 returns string on undefined - var args = [it]; - var i = 1; - var replacer, $replacer; - while (arguments.length > i) args.push(arguments[i++]); - replacer = args[1]; - if (typeof replacer == 'function') $replacer = replacer; - if ($replacer || !isArray(replacer)) replacer = function (key, value) { - if ($replacer) value = $replacer.call(this, key, value); - if (!isSymbol(value)) return value; - }; - args[1] = replacer; - return _stringify.apply($JSON, args); - } -}); - -// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) -$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(35)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); -// 19.4.3.5 Symbol.prototype[@@toStringTag] -setToStringTag($Symbol, 'Symbol'); -// 20.2.1.9 Math[@@toStringTag] -setToStringTag(Math, 'Math', true); -// 24.3.3 JSON[@@toStringTag] -setToStringTag(global.JSON, 'JSON', true); - - -/***/ }), -/* 285 */ -/***/ (function(module, exports, __webpack_require__) { - -// all enumerable object keys, includes symbols -var getKeys = __webpack_require__(56); -var gOPS = __webpack_require__(106); -var pIE = __webpack_require__(75); -module.exports = function (it) { - var result = getKeys(it); - var getSymbols = gOPS.f; - if (getSymbols) { - var symbols = getSymbols(it); - var isEnum = pIE.f; - var i = 0; - var key; - while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); - } return result; -}; - - -/***/ }), -/* 286 */ -/***/ (function(module, exports, __webpack_require__) { - -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = __webpack_require__(46); -var gOPN = __webpack_require__(160).f; -var toString = {}.toString; - -var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; - -var getWindowNames = function (it) { - try { - return gOPN(it); - } catch (e) { - return windowNames.slice(); - } -}; - -module.exports.f = function getOwnPropertyNames(it) { - return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); -}; - - -/***/ }), -/* 287 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(105)('asyncIterator'); - - -/***/ }), -/* 288 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(105)('observable'); - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(290), __esModule: true }; - -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(291); -module.exports = __webpack_require__(10).Object.setPrototypeOf; - - -/***/ }), -/* 291 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.19 Object.setPrototypeOf(O, proto) -var $export = __webpack_require__(15); -$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(292).set }); - - -/***/ }), -/* 292 */ -/***/ (function(module, exports, __webpack_require__) { - -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -var isObject = __webpack_require__(28); -var anObject = __webpack_require__(25); -var check = function (O, proto) { - anObject(O); - if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); -}; -module.exports = { - set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line - function (test, buggy, set) { - try { - set = __webpack_require__(34)(Function.call, __webpack_require__(161).f(Object.prototype, '__proto__').set, 2); - set(test, []); - buggy = !(test instanceof Array); - } catch (e) { buggy = true; } - return function setPrototypeOf(O, proto) { - check(O, proto); - if (buggy) O.__proto__ = proto; - else set(O, proto); - return O; - }; - }({}, false) : undefined), - check: check -}; - - -/***/ }), -/* 293 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(294), __esModule: true }; - -/***/ }), -/* 294 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(295); -var $Object = __webpack_require__(10).Object; -module.exports = function create(P, D) { - return $Object.create(P, D); -}; - - -/***/ }), -/* 295 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(15); -// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) -$export($export.S, 'Object', { create: __webpack_require__(92) }); - - -/***/ }), -/* 296 */ -/***/ (function(module, exports) { - -exports = module.exports = typeof Object.keys === 'function' - ? Object.keys : shim; - -exports.shim = shim; -function shim (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} - - -/***/ }), -/* 297 */ -/***/ (function(module, exports) { - -var supportsArgumentsClass = (function(){ - return Object.prototype.toString.call(arguments) -})() == '[object Arguments]'; - -exports = module.exports = supportsArgumentsClass ? supported : unsupported; - -exports.supported = supported; -function supported(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; -}; - -exports.unsupported = unsupported; -function unsupported(object){ - return object && - typeof object == 'object' && - typeof object.length == 'number' && - Object.prototype.hasOwnProperty.call(object, 'callee') && - !Object.prototype.propertyIsEnumerable.call(object, 'callee') || - false; -}; - - -/***/ }), -/* 298 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _getPrototypeOf = __webpack_require__(18); - -var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactInspector = __webpack_require__(299); - -var _reactInspector2 = _interopRequireDefault(_reactInspector); - -var _style = __webpack_require__(326); - -var _style2 = _interopRequireDefault(_style); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ActionLogger = function (_Component) { - (0, _inherits3.default)(ActionLogger, _Component); - - function ActionLogger() { - (0, _classCallCheck3.default)(this, ActionLogger); - return (0, _possibleConstructorReturn3.default)(this, (ActionLogger.__proto__ || (0, _getPrototypeOf2.default)(ActionLogger)).apply(this, arguments)); - } - - (0, _createClass3.default)(ActionLogger, [{ - key: 'getActionData', - value: function getActionData() { - var _this2 = this; - - return this.props.actions.map(function (action, i) { - return _this2.renderAction(action, i); - }); - } - }, { - key: 'renderAction', - value: function renderAction(action) { - var counter = _react2.default.createElement( - 'div', - { style: _style2.default.counter }, - action.count - ); - return _react2.default.createElement( - 'div', - { key: action.id, style: _style2.default.action }, - _react2.default.createElement( - 'div', - { style: _style2.default.countwrap }, - action.count > 1 && counter - ), - _react2.default.createElement( - 'div', - { style: _style2.default.inspector }, - _react2.default.createElement(_reactInspector2.default, { - showNonenumerable: true, - name: action.data.name, - data: action.data.args || action.data - }) - ) - ); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - 'div', - { style: _style2.default.wrapper }, - _react2.default.createElement( - 'pre', - { style: _style2.default.actions }, - this.getActionData() - ), - _react2.default.createElement( - 'button', - { style: _style2.default.button, onClick: this.props.onClear }, - 'CLEAR' - ) - ); - } - }]); - return ActionLogger; -}(_react.Component); - -ActionLogger.propTypes = { - onClear: _propTypes2.default.func, - actions: _propTypes2.default.array // eslint-disable-line react/forbid-prop-types -}; -ActionLogger.defaultProps = { - onClear: function onClear() {}, - actions: [] -}; - -exports.default = ActionLogger; - -/***/ }), -/* 299 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Inspector = exports.ObjectName = exports.ObjectValue = exports.ObjectRootLabel = exports.ObjectLabel = exports.DOMInspector = exports.TableInspector = exports.ObjectInspector = exports.chromeDark = exports.chromeLight = undefined; - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(49); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _themes = __webpack_require__(163); - -Object.defineProperty(exports, 'chromeLight', { - enumerable: true, - get: function get() { - return _themes.chromeLight; - } -}); -Object.defineProperty(exports, 'chromeDark', { - enumerable: true, - get: function get() { - return _themes.chromeDark; - } -}); - -var _ObjectInspector2 = __webpack_require__(305); - -var _ObjectInspector3 = _interopRequireDefault(_ObjectInspector2); - -var _TableInspector2 = __webpack_require__(318); - -var _TableInspector3 = _interopRequireDefault(_TableInspector2); - -var _DOMInspector2 = __webpack_require__(323); - -var _DOMInspector3 = _interopRequireDefault(_DOMInspector2); - -var _ObjectLabel2 = __webpack_require__(168); - -var _ObjectLabel3 = _interopRequireDefault(_ObjectLabel2); - -var _ObjectRootLabel2 = __webpack_require__(167); - -var _ObjectRootLabel3 = _interopRequireDefault(_ObjectRootLabel2); - -var _ObjectValue2 = __webpack_require__(77); - -var _ObjectValue3 = _interopRequireDefault(_ObjectValue2); - -var _ObjectName2 = __webpack_require__(76); - -var _ObjectName3 = _interopRequireDefault(_ObjectName2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _isDom = __webpack_require__(325); - -var _isDom2 = _interopRequireDefault(_isDom); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.ObjectInspector = _ObjectInspector3.default; -exports.TableInspector = _TableInspector3.default; -exports.DOMInspector = _DOMInspector3.default; -exports.ObjectLabel = _ObjectLabel3.default; -exports.ObjectRootLabel = _ObjectRootLabel3.default; -exports.ObjectValue = _ObjectValue3.default; -exports.ObjectName = _ObjectName3.default; - -// Wrapping the inspectors - -var Inspector = function Inspector(_ref) { - var _ref$table = _ref.table, - table = _ref$table === undefined ? false : _ref$table, - data = _ref.data, - rest = (0, _objectWithoutProperties3.default)(_ref, ['table', 'data']); - - if (table) { - return _react2.default.createElement(_TableInspector3.default, (0, _extends3.default)({ data: data }, rest)); - } - - if ((0, _isDom2.default)(data)) return _react2.default.createElement(_DOMInspector3.default, (0, _extends3.default)({ data: data }, rest)); - - return _react2.default.createElement(_ObjectInspector3.default, (0, _extends3.default)({ data: data }, rest)); -}; - -Inspector.propTypes = { - data: _propTypes2.default.any, - name: _propTypes2.default.string, - table: _propTypes2.default.bool -}; - -exports.Inspector = Inspector; -exports.default = Inspector; - -/***/ }), -/* 300 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(301); -module.exports = __webpack_require__(10).Object.assign; - - -/***/ }), -/* 301 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.3.1 Object.assign(target, source) -var $export = __webpack_require__(15); - -$export($export.S + $export.F, 'Object', { assign: __webpack_require__(302) }); - - -/***/ }), -/* 302 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// 19.1.2.1 Object.assign(target, source, ...) -var getKeys = __webpack_require__(56); -var gOPS = __webpack_require__(106); -var pIE = __webpack_require__(75); -var toObject = __webpack_require__(53); -var IObject = __webpack_require__(133); -var $assign = Object.assign; - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = !$assign || __webpack_require__(41)(function () { - var A = {}; - var B = {}; - // eslint-disable-next-line no-undef - var S = Symbol(); - var K = 'abcdefghijklmnopqrst'; - A[S] = 7; - K.split('').forEach(function (k) { B[k] = k; }); - return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; -}) ? function assign(target, source) { // eslint-disable-line no-unused-vars - var T = toObject(target); - var aLen = arguments.length; - var index = 1; - var getSymbols = gOPS.f; - var isEnum = pIE.f; - while (aLen > index) { - var S = IObject(arguments[index++]); - var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); - var length = keys.length; - var j = 0; - var key; - while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; - } return T; -} : $assign; - - -/***/ }), -/* 303 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var theme = { - BASE_FONT_FAMILY: 'Menlo, monospace', - BASE_FONT_SIZE: '11px', - BASE_LINE_HEIGHT: '14px', - - BASE_BACKGROUND_COLOR: 'rgb(36, 36, 36)', - BASE_COLOR: 'rgb(213, 213, 213)', - - OBJECT_NAME_COLOR: 'rgb(227, 110, 236)', - OBJECT_VALUE_NULL_COLOR: 'rgb(127, 127, 127)', - OBJECT_VALUE_UNDEFINED_COLOR: 'rgb(127, 127, 127)', - OBJECT_VALUE_REGEXP_COLOR: 'rgb(233, 63, 59)', - OBJECT_VALUE_STRING_COLOR: 'rgb(233, 63, 59)', - OBJECT_VALUE_SYMBOL_COLOR: 'rgb(233, 63, 59)', - OBJECT_VALUE_NUMBER_COLOR: 'hsl(252, 100%, 75%)', - OBJECT_VALUE_BOOLEAN_COLOR: 'hsl(252, 100%, 75%)', - OBJECT_VALUE_FUNCTION_KEYWORD_COLOR: 'rgb(242, 85, 217)', - - HTML_TAG_COLOR: 'rgb(93, 176, 215)', - HTML_TAGNAME_COLOR: 'rgb(93, 176, 215)', - HTML_TAGNAME_TEXT_TRANSFORM: 'lowercase', - HTML_ATTRIBUTE_NAME_COLOR: 'rgb(155, 187, 220)', - HTML_ATTRIBUTE_VALUE_COLOR: 'rgb(242, 151, 102)', - HTML_COMMENT_COLOR: 'rgb(137, 137, 137)', - HTML_DOCTYPE_COLOR: 'rgb(192, 192, 192)', - - ARROW_COLOR: 'rgb(145, 145, 145)', - ARROW_MARGIN_RIGHT: 3, - ARROW_FONT_SIZE: 12, - - TREENODE_FONT_FAMILY: 'Menlo, monospace', - TREENODE_FONT_SIZE: '11px', - TREENODE_LINE_HEIGHT: '14px', - TREENODE_PADDING_LEFT: 12, - - TABLE_BORDER_COLOR: 'rgb(85, 85, 85)', - TABLE_TH_BACKGROUND_COLOR: 'rgb(44, 44, 44)', - TABLE_TH_HOVER_COLOR: 'rgb(48, 48, 48)', - TABLE_SORT_ICON_COLOR: 'black', //'rgb(48, 57, 66)', - TABLE_DATA_BACKGROUND_IMAGE: 'linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))', - TABLE_DATA_BACKGROUND_SIZE: '128px 32px' -}; - -exports.default = theme; - -/***/ }), -/* 304 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var theme = { - BASE_FONT_FAMILY: 'Menlo, monospace', - BASE_FONT_SIZE: '11px', - BASE_LINE_HEIGHT: '14px', - - BASE_BACKGROUND_COLOR: 'white', - BASE_COLOR: 'black', - - OBJECT_NAME_COLOR: 'rgb(136, 19, 145)', - OBJECT_VALUE_NULL_COLOR: 'rgb(128, 128, 128)', - OBJECT_VALUE_UNDEFINED_COLOR: 'rgb(128, 128, 128)', - OBJECT_VALUE_REGEXP_COLOR: 'rgb(196, 26, 22)', - OBJECT_VALUE_STRING_COLOR: 'rgb(196, 26, 22)', - OBJECT_VALUE_SYMBOL_COLOR: 'rgb(196, 26, 22)', - OBJECT_VALUE_NUMBER_COLOR: 'rgb(28, 0, 207)', - OBJECT_VALUE_BOOLEAN_COLOR: 'rgb(28, 0, 207)', - OBJECT_VALUE_FUNCTION_KEYWORD_COLOR: 'rgb(170, 13, 145)', - - HTML_TAG_COLOR: 'rgb(168, 148, 166)', - HTML_TAGNAME_COLOR: 'rgb(136, 18, 128)', - HTML_TAGNAME_TEXT_TRANSFORM: 'lowercase', - HTML_ATTRIBUTE_NAME_COLOR: 'rgb(153, 69, 0)', - HTML_ATTRIBUTE_VALUE_COLOR: 'rgb(26, 26, 166)', - HTML_COMMENT_COLOR: 'rgb(35, 110, 37)', - HTML_DOCTYPE_COLOR: 'rgb(192, 192, 192)', - - ARROW_COLOR: '#6e6e6e', - ARROW_MARGIN_RIGHT: 3, - ARROW_FONT_SIZE: 12, - - TREENODE_FONT_FAMILY: 'Menlo, monospace', - TREENODE_FONT_SIZE: '11px', - TREENODE_LINE_HEIGHT: '14px', - TREENODE_PADDING_LEFT: 12, - - TABLE_BORDER_COLOR: '#aaa', - TABLE_TH_BACKGROUND_COLOR: '#eee', - TABLE_TH_HOVER_COLOR: 'hsla(0, 0%, 90%, 1)', - TABLE_SORT_ICON_COLOR: '#6e6e6e', - TABLE_DATA_BACKGROUND_IMAGE: 'linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))', - TABLE_DATA_BACKGROUND_SIZE: '128px 32px' -}; - -exports.default = theme; - -/***/ }), -/* 305 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _objectWithoutProperties2 = __webpack_require__(49); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _regenerator = __webpack_require__(164); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _slicedToArray2 = __webpack_require__(165); - -var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _TreeView = __webpack_require__(166); - -var _TreeView2 = _interopRequireDefault(_TreeView); - -var _ObjectRootLabel = __webpack_require__(167); - -var _ObjectRootLabel2 = _interopRequireDefault(_ObjectRootLabel); - -var _ObjectLabel = __webpack_require__(168); - -var _ObjectLabel2 = _interopRequireDefault(_ObjectLabel); - -var _ThemeProvider = __webpack_require__(108); - -var _ThemeProvider2 = _interopRequireDefault(_ThemeProvider); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var createIterator = function createIterator(showNonenumerable, sortObjectKeys) { - var objectIterator = _regenerator2.default.mark(function objectIterator(data) { - var shouldIterate, i, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, entry, _entry, k, v, keys, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, propertyName, propertyValue, _propertyValue; - - return _regenerator2.default.wrap(function objectIterator$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - shouldIterate = (typeof data === 'undefined' ? 'undefined' : (0, _typeof3.default)(data)) === 'object' && data !== null || typeof data === 'function'; - - if (shouldIterate) { - _context.next = 3; - break; - } - - return _context.abrupt('return'); - - case 3: - if (!(!Array.isArray(data) && data[Symbol.iterator])) { - _context.next = 40; - break; - } - - i = 0; - _iteratorNormalCompletion = true; - _didIteratorError = false; - _iteratorError = undefined; - _context.prev = 8; - _iterator = data[Symbol.iterator](); - - case 10: - if (_iteratorNormalCompletion = (_step = _iterator.next()).done) { - _context.next = 24; - break; - } - - entry = _step.value; - - if (!(Array.isArray(entry) && entry.length === 2)) { - _context.next = 18; - break; - } - - _entry = (0, _slicedToArray3.default)(entry, 2), k = _entry[0], v = _entry[1]; - _context.next = 16; - return { - name: k, - data: v - }; - - case 16: - _context.next = 20; - break; - - case 18: - _context.next = 20; - return { - name: i.toString(), - data: entry - }; - - case 20: - i++; - - case 21: - _iteratorNormalCompletion = true; - _context.next = 10; - break; - - case 24: - _context.next = 30; - break; - - case 26: - _context.prev = 26; - _context.t0 = _context['catch'](8); - _didIteratorError = true; - _iteratorError = _context.t0; - - case 30: - _context.prev = 30; - _context.prev = 31; - - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - - case 33: - _context.prev = 33; - - if (!_didIteratorError) { - _context.next = 36; - break; - } - - throw _iteratorError; - - case 36: - return _context.finish(33); - - case 37: - return _context.finish(30); - - case 38: - _context.next = 81; - break; - - case 40: - keys = Object.getOwnPropertyNames(data); - - if (sortObjectKeys === true) { - keys.sort(); - } else if (typeof sortObjectKeys === 'function') { - keys.sort(sortObjectKeys); - } - - _iteratorNormalCompletion2 = true; - _didIteratorError2 = false; - _iteratorError2 = undefined; - _context.prev = 45; - _iterator2 = keys[Symbol.iterator](); - - case 47: - if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { - _context.next = 64; - break; - } - - propertyName = _step2.value; - - if (!data.propertyIsEnumerable(propertyName)) { - _context.next = 55; - break; - } - - propertyValue = data[propertyName]; - _context.next = 53; - return { - name: propertyName || '""', - data: propertyValue - }; - - case 53: - _context.next = 61; - break; - - case 55: - if (!showNonenumerable) { - _context.next = 61; - break; - } - - // To work around the error (happens some time when propertyName === 'caller' || propertyName === 'arguments') - // 'caller' and 'arguments' are restricted function properties and cannot be accessed in this context - // http://stackoverflow.com/questions/31921189/caller-and-arguments-are-restricted-function-properties-and-cannot-be-access - _propertyValue = void 0; - - try { - _propertyValue = data[propertyName]; - } catch (e) { - // console.warn(e) - } - - if (!(_propertyValue !== undefined)) { - _context.next = 61; - break; - } - - _context.next = 61; - return { - name: propertyName, - data: _propertyValue, - isNonenumerable: true - }; - - case 61: - _iteratorNormalCompletion2 = true; - _context.next = 47; - break; - - case 64: - _context.next = 70; - break; - - case 66: - _context.prev = 66; - _context.t1 = _context['catch'](45); - _didIteratorError2 = true; - _iteratorError2 = _context.t1; - - case 70: - _context.prev = 70; - _context.prev = 71; - - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - - case 73: - _context.prev = 73; - - if (!_didIteratorError2) { - _context.next = 76; - break; - } - - throw _iteratorError2; - - case 76: - return _context.finish(73); - - case 77: - return _context.finish(70); - - case 78: - if (!(showNonenumerable && data !== Object.prototype /* already added */)) { - _context.next = 81; - break; - } - - _context.next = 81; - return { - name: '__proto__', - data: Object.getPrototypeOf(data), - isNonenumerable: true - }; - - case 81: - case 'end': - return _context.stop(); - } - } - }, objectIterator, this, [[8, 26, 30, 38], [31,, 33, 37], [45, 66, 70, 78], [71,, 73, 77]]); - }); - - return objectIterator; -}; - -var defaultNodeRenderer = function defaultNodeRenderer(_ref) { - var depth = _ref.depth, - name = _ref.name, - data = _ref.data, - isNonenumerable = _ref.isNonenumerable; - return depth === 0 ? _react2.default.createElement(_ObjectRootLabel2.default, { name: name, data: data }) : _react2.default.createElement(_ObjectLabel2.default, { name: name, data: data, isNonenumerable: isNonenumerable }); -}; - -/** - * Tree-view for objects - */ - -var ObjectInspector = function (_Component) { - (0, _inherits3.default)(ObjectInspector, _Component); - - function ObjectInspector() { - (0, _classCallCheck3.default)(this, ObjectInspector); - return (0, _possibleConstructorReturn3.default)(this, (ObjectInspector.__proto__ || Object.getPrototypeOf(ObjectInspector)).apply(this, arguments)); - } - - (0, _createClass3.default)(ObjectInspector, [{ - key: 'render', - value: function render() { - var _props = this.props, - showNonenumerable = _props.showNonenumerable, - sortObjectKeys = _props.sortObjectKeys, - nodeRenderer = _props.nodeRenderer, - rest = (0, _objectWithoutProperties3.default)(_props, ['showNonenumerable', 'sortObjectKeys', 'nodeRenderer']); - - var dataIterator = createIterator(showNonenumerable, sortObjectKeys); - - var renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer; - - return _react2.default.createElement( - _ThemeProvider2.default, - { theme: this.props.theme }, - _react2.default.createElement(_TreeView2.default, (0, _extends3.default)({ nodeRenderer: renderer, dataIterator: dataIterator }, rest)) - ); - } - }]); - return ObjectInspector; -}(_react.Component); - -ObjectInspector.defaultProps = { - showNonenumerable: false, - - theme: 'chromeLight' -}; -ObjectInspector.propTypes = { - /** An integer specifying to which level the tree should be initially expanded. */ - expandLevel: _propTypes2.default.number, - /** An array containing all the paths that should be expanded when the component is initialized, or a string of just one path */ - expandPaths: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.array]), - - name: _propTypes2.default.string, - /** Not required prop because we also allow undefined value */ - data: _propTypes2.default.any, - - /** A known theme or theme object */ - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]), - - /** Show non-enumerable properties */ - showNonenumerable: _propTypes2.default.bool, - /** Sort object keys with optional compare function. */ - sortObjectKeys: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.func]), - - /** Provide a custom nodeRenderer */ - nodeRenderer: _propTypes2.default.func -}; -exports.default = ObjectInspector; - -/***/ }), -/* 306 */ -/***/ (function(module, exports, __webpack_require__) { - -// This method of obtaining a reference to the global object needs to be -// kept identical to the way it is obtained in runtime.js -var g = (function() { return this })() || Function("return this")(); - -// Use `getOwnPropertyNames` because not all browsers support calling -// `hasOwnProperty` on the global `self` object in a worker. See #183. -var hadRuntime = g.regeneratorRuntime && - Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; - -// Save the old regeneratorRuntime in case it needs to be restored later. -var oldRuntime = hadRuntime && g.regeneratorRuntime; - -// Force reevalutation of runtime.js. -g.regeneratorRuntime = undefined; - -module.exports = __webpack_require__(307); - -if (hadRuntime) { - // Restore the original runtime. - g.regeneratorRuntime = oldRuntime; -} else { - // Remove the global property added by runtime.js. - try { - delete g.regeneratorRuntime; - } catch(e) { - g.regeneratorRuntime = undefined; - } -} - - -/***/ }), -/* 307 */ -/***/ (function(module, exports) { - -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -!(function(global) { - "use strict"; - - var Op = Object.prototype; - var hasOwn = Op.hasOwnProperty; - var undefined; // More compressible than void 0. - var $Symbol = typeof Symbol === "function" ? Symbol : {}; - var iteratorSymbol = $Symbol.iterator || "@@iterator"; - var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; - var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; - - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } - // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - return; - } - - // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. - var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; - var generator = Object.create(protoGenerator.prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return generator; - } - runtime.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - // This is a polyfill for %IteratorPrototype% for environments that - // don't natively support it. - var IteratorPrototype = {}; - IteratorPrototype[iteratorSymbol] = function () { - return this; - }; - - var getProto = Object.getPrototypeOf; - var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); - if (NativeIteratorPrototype && - NativeIteratorPrototype !== Op && - hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { - // This environment has a native %IteratorPrototype%; use it instead - // of the polyfill. - IteratorPrototype = NativeIteratorPrototype; - } - - var Gp = GeneratorFunctionPrototype.prototype = - Generator.prototype = Object.create(IteratorPrototype); - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunctionPrototype[toStringTagSymbol] = - GeneratorFunction.displayName = "GeneratorFunction"; - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } - - runtime.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - runtime.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - if (!(toStringTagSymbol in genFun)) { - genFun[toStringTagSymbol] = "GeneratorFunction"; - } - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `hasOwn.call(value, "__await")` to determine if the yielded value is - // meant to be awaited. - runtime.awrap = function(arg) { - return { __await: arg }; - }; - - function AsyncIterator(generator) { - function invoke(method, arg, resolve, reject) { - var record = tryCatch(generator[method], generator, arg); - if (record.type === "throw") { - reject(record.arg); - } else { - var result = record.arg; - var value = result.value; - if (value && - typeof value === "object" && - hasOwn.call(value, "__await")) { - return Promise.resolve(value.__await).then(function(value) { - invoke("next", value, resolve, reject); - }, function(err) { - invoke("throw", err, resolve, reject); - }); - } - - return Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - resolve(result); - }, reject); - } - } - - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return new Promise(function(resolve, reject) { - invoke(method, arg, resolve, reject); - }); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : callInvokeWithMethodAndArg(); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - AsyncIterator.prototype[asyncIteratorSymbol] = function () { - return this; - }; - runtime.AsyncIterator = AsyncIterator; - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - runtime.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); - - return runtime.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } - - context.method = method; - context.arg = arg; - - while (true) { - var delegate = context.delegate; - if (delegate) { - var delegateResult = maybeInvokeDelegate(delegate, context); - if (delegateResult) { - if (delegateResult === ContinueSentinel) continue; - return delegateResult; - } - } - - if (context.method === "next") { - // Setting context._sent for legacy support of Babel's - // function.sent implementation. - context.sent = context._sent = context.arg; - - } else if (context.method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw context.arg; - } - - context.dispatchException(context.arg); - - } else if (context.method === "return") { - context.abrupt("return", context.arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - if (record.arg === ContinueSentinel) { - continue; - } - - return { - value: record.arg, - done: context.done - }; - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(context.arg) call above. - context.method = "throw"; - context.arg = record.arg; - } - } - }; - } - - // Call delegate.iterator[context.method](context.arg) and handle the - // result, either by returning a { value, done } result from the - // delegate iterator, or by modifying context.method and context.arg, - // setting context.delegate to null, and returning the ContinueSentinel. - function maybeInvokeDelegate(delegate, context) { - var method = delegate.iterator[context.method]; - if (method === undefined) { - // A .throw or .return when the delegate iterator has no .throw - // method always terminates the yield* loop. - context.delegate = null; - - if (context.method === "throw") { - if (delegate.iterator.return) { - // If the delegate iterator has a return method, give it a - // chance to clean up. - context.method = "return"; - context.arg = undefined; - maybeInvokeDelegate(delegate, context); - - if (context.method === "throw") { - // If maybeInvokeDelegate(context) changed context.method from - // "return" to "throw", let that override the TypeError below. - return ContinueSentinel; - } - } - - context.method = "throw"; - context.arg = new TypeError( - "The iterator does not provide a 'throw' method"); - } - - return ContinueSentinel; - } - - var record = tryCatch(method, delegate.iterator, context.arg); - - if (record.type === "throw") { - context.method = "throw"; - context.arg = record.arg; - context.delegate = null; - return ContinueSentinel; - } - - var info = record.arg; - - if (! info) { - context.method = "throw"; - context.arg = new TypeError("iterator result is not an object"); - context.delegate = null; - return ContinueSentinel; - } - - if (info.done) { - // Assign the result of the finished delegate to the temporary - // variable specified by delegate.resultName (see delegateYield). - context[delegate.resultName] = info.value; - - // Resume execution at the desired location (see delegateYield). - context.next = delegate.nextLoc; - - // If context.method was "throw" but the delegate handled the - // exception, let the outer generator proceed normally. If - // context.method was "next", forget context.arg since it has been - // "consumed" by the delegate iterator. If context.method was - // "return", allow the original .return call to continue in the - // outer generator. - if (context.method !== "return") { - context.method = "next"; - context.arg = undefined; - } - - } else { - // Re-yield the result returned by the delegate method. - return info; - } - - // The delegate iterator is finished, so forget it and continue with - // the outer generator. - context.delegate = null; - return ContinueSentinel; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - Gp[toStringTagSymbol] = "Generator"; - - // A Generator should always return itself as the iterator object when the - // @@iterator function is called on it. Some browsers' implementations of the - // iterator prototype chain incorrectly implement this, causing the Generator - // object to not be returned from this call. This ensures that doesn't happen. - // See https://github.com/facebook/regenerator/issues/274 for more details. - Gp[iteratorSymbol] = function() { - return this; - }; - - Gp.toString = function() { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; - - function doneResult() { - return { value: undefined, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - // Resetting context._sent for legacy support of Babel's - // function.sent implementation. - this.sent = this._sent = undefined; - this.done = false; - this.delegate = null; - - this.method = "next"; - this.arg = undefined; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - - if (caught) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - context.method = "next"; - context.arg = undefined; - } - - return !! caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.method = "next"; - this.next = finallyEntry.finallyLoc; - return ContinueSentinel; - } - - return this.complete(record); - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = this.arg = record.arg; - this.method = "return"; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - - return ContinueSentinel; - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - if (this.method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - this.arg = undefined; - } - - return ContinueSentinel; - } - }; -})( - // In sloppy mode, unbound `this` refers to the global object, fallback to - // Function constructor if we're in global strict mode. That is sadly a form - // of indirect eval which violates Content Security Policy. - (function() { return this })() || Function("return this")() -); - - -/***/ }), -/* 308 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(309), __esModule: true }; - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(69); -__webpack_require__(54); -module.exports = __webpack_require__(310); - - -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { - -var classof = __webpack_require__(93); -var ITERATOR = __webpack_require__(14)('iterator'); -var Iterators = __webpack_require__(48); -module.exports = __webpack_require__(10).isIterable = function (it) { - var O = Object(it); - return O[ITERATOR] !== undefined - || '@@iterator' in O - // eslint-disable-next-line no-prototype-builtins - || Iterators.hasOwnProperty(classof(O)); -}; - - -/***/ }), -/* 311 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(69); -__webpack_require__(54); -module.exports = __webpack_require__(312); - - -/***/ }), -/* 312 */ -/***/ (function(module, exports, __webpack_require__) { - -var anObject = __webpack_require__(25); -var get = __webpack_require__(103); -module.exports = __webpack_require__(10).getIterator = function (it) { - var iterFn = get(it); - if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!'); - return anObject(iterFn.call(it)); -}; - - -/***/ }), -/* 313 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _createStyles = __webpack_require__(30); - -var _createStyles2 = _interopRequireDefault(_createStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Arrow = function Arrow(_ref) { - var expanded = _ref.expanded, - styles = _ref.styles; - return _react2.default.createElement( - 'span', - { style: (0, _extends3.default)({}, styles.base, expanded ? styles.expanded : styles.collapsed) }, - '\u25B6' - ); -}; - -var TreeNode = function (_Component) { - (0, _inherits3.default)(TreeNode, _Component); - - function TreeNode() { - (0, _classCallCheck3.default)(this, TreeNode); - return (0, _possibleConstructorReturn3.default)(this, (TreeNode.__proto__ || Object.getPrototypeOf(TreeNode)).apply(this, arguments)); - } - - (0, _createClass3.default)(TreeNode, [{ - key: 'render', - value: function render() { - var _props = this.props, - expanded = _props.expanded, - onClick = _props.onClick, - children = _props.children, - nodeRenderer = _props.nodeRenderer, - title = _props.title, - shouldShowArrow = _props.shouldShowArrow, - shouldShowPlaceholder = _props.shouldShowPlaceholder; - var theme = this.context.theme; - - var styles = (0, _createStyles2.default)('TreeNode', theme); - - var renderedNode = (0, _react.createElement)(nodeRenderer, this.props); - var childNodes = expanded ? children : undefined; - - return _react2.default.createElement( - 'li', - { 'aria-expanded': expanded, role: 'treeitem', style: styles.treeNodeBase, title: title }, - _react2.default.createElement( - 'div', - { style: styles.treeNodePreviewContainer, onClick: onClick }, - shouldShowArrow || _react.Children.count(children) > 0 ? _react2.default.createElement(Arrow, { expanded: expanded, styles: styles.treeNodeArrow }) : shouldShowPlaceholder && _react2.default.createElement( - 'span', - { style: styles.treeNodePlaceholder }, - '\xA0' - ), - renderedNode - ), - _react2.default.createElement( - 'ol', - { role: 'group', style: styles.treeNodeChildNodesContainer }, - childNodes - ) - ); - } - }]); - return TreeNode; -}(_react.Component); - -TreeNode.propTypes = { - name: _propTypes2.default.string, - data: _propTypes2.default.any, - - expanded: _propTypes2.default.bool, - shouldShowArrow: _propTypes2.default.bool, - shouldShowPlaceholder: _propTypes2.default.bool, - - nodeRenderer: _propTypes2.default.func, - - onClick: _propTypes2.default.func -}; - -TreeNode.defaultProps = { - name: undefined, - data: undefined, - expanded: true, - - nodeRenderer: function nodeRenderer(_ref2) { - var name = _ref2.name; - return _react2.default.createElement( - 'span', - null, - name - ); - }, - - onClick: function onClick() {}, - - shouldShowArrow: false, - shouldShowPlaceholder: true -}; - -TreeNode.contextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired -}; - -exports.default = TreeNode; - -/***/ }), -/* 314 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _unselectable = __webpack_require__(315); - -var _unselectable2 = _interopRequireDefault(_unselectable); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (theme) { - return { - DOMNodePreview: { - htmlOpenTag: { - base: { - color: theme.HTML_TAG_COLOR - }, - tagName: { - color: theme.HTML_TAGNAME_COLOR, - textTransform: theme.HTML_TAGNAME_TEXT_TRANSFORM - }, - htmlAttributeName: { - color: theme.HTML_ATTRIBUTE_NAME_COLOR - }, - htmlAttributeValue: { - color: theme.HTML_ATTRIBUTE_VALUE_COLOR - } - }, - htmlCloseTag: { - base: { - color: theme.HTML_TAG_COLOR - }, - offsetLeft: { - /* hack: offset placeholder */ - marginLeft: -theme.TREENODE_PADDING_LEFT - }, - tagName: { - color: theme.HTML_TAGNAME_COLOR, - textTransform: theme.HTML_TAGNAME_TEXT_TRANSFORM - } - }, - htmlComment: { - color: theme.HTML_COMMENT_COLOR - }, - htmlDoctype: { - color: theme.HTML_DOCTYPE_COLOR - } - }, - - ObjectName: { - base: { - color: theme.OBJECT_NAME_COLOR - }, - dimmed: { - opacity: 0.6 - } - }, - - ObjectValue: { - objectValueNull: { - color: theme.OBJECT_VALUE_NULL_COLOR - }, - objectValueUndefined: { - color: theme.OBJECT_VALUE_UNDEFINED_COLOR - }, - objectValueRegExp: { - color: theme.OBJECT_VALUE_REGEXP_COLOR - }, - objectValueString: { - color: theme.OBJECT_VALUE_STRING_COLOR - }, - objectValueSymbol: { - color: theme.OBJECT_VALUE_SYMBOL_COLOR - }, - objectValueNumber: { - color: theme.OBJECT_VALUE_NUMBER_COLOR - }, - objectValueBoolean: { - color: theme.OBJECT_VALUE_BOOLEAN_COLOR - }, - objectValueFunctionKeyword: { - color: theme.OBJECT_VALUE_FUNCTION_KEYWORD_COLOR, - fontStyle: 'italic' - }, - objectValueFunctionName: { - fontStyle: 'italic' - } - }, - - TreeNode: { - treeNodeBase: { - color: theme.BASE_COLOR, - backgroundColor: theme.BASE_BACKGROUND_COLOR, - - lineHeight: theme.TREENODE_LINE_HEIGHT, - cursor: 'default', - - boxSizing: 'border-box', - listStyle: 'none', - - fontFamily: theme.TREENODE_FONT_FAMILY, - fontSize: theme.TREENODE_FONT_SIZE - }, - treeNodePreviewContainer: {}, - treeNodePlaceholder: (0, _extends3.default)({ - whiteSpace: 'pre', - - fontSize: theme.ARROW_FONT_SIZE, - marginRight: theme.ARROW_MARGIN_RIGHT - }, _unselectable2.default), - treeNodeArrow: { - base: (0, _extends3.default)({ - color: theme.ARROW_COLOR, - display: 'inline-block', - // lineHeight: '14px', - fontSize: theme.ARROW_FONT_SIZE, - marginRight: theme.ARROW_MARGIN_RIGHT - }, _unselectable2.default), - expanded: { - WebkitTransform: 'rotateZ(90deg)', - MozTransform: 'rotateZ(90deg)', - transform: 'rotateZ(90deg)' - }, - collapsed: { - WebkitTransform: 'rotateZ(0deg)', - MozTransform: 'rotateZ(0deg)', - transform: 'rotateZ(0deg)' - } - }, - treeNodeChildNodesContainer: { - margin: 0, // reset user-agent style - paddingLeft: theme.TREENODE_PADDING_LEFT - } - }, - - TableInspector: { - base: { - color: theme.BASE_COLOR, - - position: 'relative', - border: '1px solid ' + theme.TABLE_BORDER_COLOR, - fontFamily: theme.BASE_FONT_FAMILY, - fontSize: theme.BASE_FONT_SIZE, - lineHeight: '120%', - boxSizing: 'border-box', - cursor: 'default' - } - }, - - TableInspectorHeaderContainer: { - base: { - top: 0, - height: '17px', - left: 0, - right: 0, - overflowX: 'hidden' - }, - table: { - tableLayout: 'fixed', - borderSpacing: 0, - borderCollapse: 'separate', - height: '100%', - width: '100%', - margin: 0 - } - }, - - TableInspectorDataContainer: { - tr: { - display: 'table-row' - }, - td: { - boxSizing: 'border-box', - border: 'none', // prevent overrides - height: '16px', // /* 0.5 * table.background-size height */ - verticalAlign: 'top', - padding: '1px 4px', - WebkitUserSelect: 'text', - - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - overflow: 'hidden', - lineHeight: '14px' - }, - div: { - position: 'static', - top: '17px', - bottom: 0, - overflowY: 'overlay', - transform: 'translateZ(0)', - - left: 0, - right: 0, - overflowX: 'hidden' - }, - table: { - positon: 'static', - left: 0, - top: 0, - right: 0, - bottom: 0, - borderTop: '0 none transparent', - margin: 0, // prevent user agent stylesheet overrides - - backgroundImage: theme.TABLE_DATA_BACKGROUND_IMAGE, - backgroundSize: theme.TABLE_DATA_BACKGROUND_SIZE, - tableLayout: 'fixed', - - // table - borderSpacing: 0, - borderCollapse: 'separate', - // height: '100%', - width: '100%', - - fontSize: theme.BASE_FONT_SIZE, - lineHeight: '120%' - } - }, - - TableInspectorTH: { - base: { - position: 'relative', // anchor for sort icon container - height: 'auto', - textAlign: 'left', - backgroundColor: theme.TABLE_TH_BACKGROUND_COLOR, - borderBottom: '1px solid ' + theme.TABLE_BORDER_COLOR, - fontWeight: 'normal', - verticalAlign: 'middle', - padding: '0 4px', - - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - overflow: 'hidden', - lineHeight: '14px', - - ':hover': { - backgroundColor: theme.TABLE_TH_HOVER_COLOR - } - }, - div: { - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - overflow: 'hidden', - - // prevent user agent stylesheet overrides - fontSize: theme.BASE_FONT_SIZE, - lineHeight: '120%' - } - }, - - TableInspectorLeftBorder: { - none: { - borderLeft: 'none' - }, - solid: { - borderLeft: '1px solid ' + theme.TABLE_BORDER_COLOR - } - }, - - TableInspectorSortIcon: (0, _extends3.default)({ - display: 'block', - marginRight: 3, // 4, - width: 8, - height: 7, - - marginTop: -7, - color: theme.TABLE_SORT_ICON_COLOR, - fontSize: 12 - }, _unselectable2.default) - }; -}; - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - WebkitTouchCallout: 'none', - WebkitUserSelect: 'none', - KhtmlUserSelect: 'none', - MozUserSelect: 'none', - msUserSelect: 'none', - OUserSelect: 'none', - userSelect: 'none' -}; - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hasChildNodes = hasChildNodes; -var DEFAULT_ROOT_PATH = exports.DEFAULT_ROOT_PATH = '$'; - -var WILDCARD = '*'; - -function hasChildNodes(data, dataIterator) { - return !dataIterator(data).next().done; -} - -var wildcardPathsFromLevel = exports.wildcardPathsFromLevel = function wildcardPathsFromLevel(level) { - // i is depth - return Array.from({ length: level }, function (_, i) { - return [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, function () { - return '*'; - })).join('.'); - }); -}; - -var getExpandedPaths = exports.getExpandedPaths = function getExpandedPaths(data, dataIterator, expandPaths, expandLevel) { - var initialState = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {}; - - var wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter(function (path) { - return typeof path === 'string'; - }); // could be undefined - - var expandedPaths = []; - wildcardPaths.forEach(function (wildcardPath) { - var keyPaths = wildcardPath.split('.'); - var populatePaths = function populatePaths(curData, curPath, depth) { - if (depth === keyPaths.length) { - expandedPaths.push(curPath); - return; - } - var key = keyPaths[depth]; - if (depth === 0) { - if (hasChildNodes(curData, dataIterator) && (key === DEFAULT_ROOT_PATH || key === WILDCARD)) { - populatePaths(curData, DEFAULT_ROOT_PATH, depth + 1); - } - } else { - if (key === WILDCARD) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = dataIterator(curData)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _ref2 = _step.value; - var name = _ref2.name, - _data = _ref2.data; - - if (hasChildNodes(_data, dataIterator)) { - populatePaths(_data, curPath + '.' + name, depth + 1); - } - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - } else { - var value = curData[key]; - if (hasChildNodes(value, dataIterator)) { - populatePaths(value, curPath + '.' + key, depth + 1); - } - } - } - }; - - populatePaths(data, '', 0); - }); - - return expandedPaths.reduce(function (obj, path) { - obj[path] = true; - return obj; - }, initialState); -}; - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _ObjectValue = __webpack_require__(77); - -var _ObjectValue2 = _interopRequireDefault(_ObjectValue); - -var _ObjectName = __webpack_require__(76); - -var _ObjectName2 = _interopRequireDefault(_ObjectName); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* NOTE: Chrome console.log is italic */ -var styles = { - preview: { - fontStyle: 'italic' - } -}; - -/* intersperse arr with separator */ -function intersperse(arr, sep) { - if (arr.length === 0) { - return []; - } - - return arr.slice(1).reduce(function (xs, x) { - return xs.concat([sep, x]); - }, [arr[0]]); -} - -/** - * A preview of the object - */ -var ObjectPreview = function ObjectPreview(_ref) { - var data = _ref.data, - maxProperties = _ref.maxProperties; - - var object = data; - - if ((typeof object === 'undefined' ? 'undefined' : (0, _typeof3.default)(object)) !== 'object' || object === null || object instanceof Date || object instanceof RegExp) { - return _react2.default.createElement(_ObjectValue2.default, { object: object }); - } - - if (Array.isArray(object)) { - return _react2.default.createElement( - 'span', - { style: styles.preview }, - '[', - intersperse(object.map(function (element, index) { - return _react2.default.createElement(_ObjectValue2.default, { key: index, object: element }); - }), ', '), - ']' - ); - } else { - var propertyNodes = []; - for (var propertyName in object) { - var propertyValue = object[propertyName]; - if (object.hasOwnProperty(propertyName)) { - var ellipsis = void 0; - if (propertyNodes.length === maxProperties - 1 && Object.keys(object).length > maxProperties) { - ellipsis = _react2.default.createElement( - 'span', - { key: 'ellipsis' }, - '\u2026' - ); - } - propertyNodes.push(_react2.default.createElement( - 'span', - { key: propertyName }, - _react2.default.createElement(_ObjectName2.default, { name: propertyName || '""' }), - ':\xA0', - _react2.default.createElement(_ObjectValue2.default, { object: propertyValue }), - ellipsis - )); - if (ellipsis) break; - } - } - - return _react2.default.createElement( - 'span', - { style: styles.preview }, - object.constructor.name + ' {', - intersperse(propertyNodes, ', '), - '}' - ); - } -}; - -ObjectPreview.propTypes = { - /** - * max number of properties shown in the property view - */ - maxProperties: _propTypes2.default.number -}; -ObjectPreview.defaultProps = { - maxProperties: 5 -}; - -exports.default = ObjectPreview; - -/***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _ThemeProvider = __webpack_require__(108); - -var _ThemeProvider2 = _interopRequireDefault(_ThemeProvider); - -var _createStyles = __webpack_require__(30); - -var _createStyles2 = _interopRequireDefault(_createStyles); - -var _getHeaders2 = __webpack_require__(319); - -var _getHeaders3 = _interopRequireDefault(_getHeaders2); - -var _DataContainer = __webpack_require__(320); - -var _DataContainer2 = _interopRequireDefault(_DataContainer); - -var _HeaderContainer = __webpack_require__(321); - -var _HeaderContainer2 = _interopRequireDefault(_HeaderContainer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var TableInspector = function (_Component) { - (0, _inherits3.default)(TableInspector, _Component); - - function TableInspector(props) { - (0, _classCallCheck3.default)(this, TableInspector); - - var _this = (0, _possibleConstructorReturn3.default)(this, (TableInspector.__proto__ || Object.getPrototypeOf(TableInspector)).call(this, props)); - - _this.state = { - sorted: false, // has user ever clicked the <th> tag to sort? - sortIndexColumn: false, // is index column sorted? - sortColumn: undefined, // which column is sorted? - sortAscending: false // is sorting ascending or descending? - }; - return _this; - } - - (0, _createClass3.default)(TableInspector, [{ - key: 'handleIndexTHClick', - value: function handleIndexTHClick() { - this.setState(function (_ref) { - var sortIndexColumn = _ref.sortIndexColumn, - sortAscending = _ref.sortAscending; - return { - sorted: true, - sortIndexColumn: true, - sortColumn: undefined, - // when changed to a new column, default to asending - sortAscending: sortIndexColumn ? !sortAscending : true - }; - }); - } - }, { - key: 'handleTHClick', - value: function handleTHClick(col) { - this.setState(function (_ref2) { - var sortColumn = _ref2.sortColumn, - sortAscending = _ref2.sortAscending; - return { - sorted: true, - sortIndexColumn: false, - // update sort column - sortColumn: col, - // when changed to a new column, default to asending - sortAscending: col === sortColumn ? !sortAscending : true - }; - }); - } - }, { - key: 'render', - value: function render() { - var data = this.props.data; - var columns = this.props.columns; - - var theme = this.props.theme; - - var styles = (0, _createStyles2.default)('TableInspector', theme); - - if ((typeof data === 'undefined' ? 'undefined' : (0, _typeof3.default)(data)) !== 'object' || data === null) { - return _react2.default.createElement('div', null); - } - - var _getHeaders = (0, _getHeaders3.default)(data), - rowHeaders = _getHeaders.rowHeaders, - colHeaders = _getHeaders.colHeaders; - - // columns to be displayed are specified - // NOTE: there's some space for optimization here - - - if (columns !== undefined) { - colHeaders = columns; - } - - var rowsData = rowHeaders.map(function (rowHeader) { - return data[rowHeader]; - }); - - var sortIndexColumn = this.state.sortIndexColumn, - sortColumn = this.state.sortColumn, - sortAscending = this.state.sortAscending; - - var columnDataWithRowIndexes = void 0; /* row indexes are [0..nRows-1] */ - // TODO: refactor - if (sortColumn !== undefined) { - // the column to be sorted (rowsData, column) => [[columnData, rowIndex]] - columnDataWithRowIndexes = rowsData.map(function (rowData, index) { - // normalize rowData - if ((typeof rowData === 'undefined' ? 'undefined' : (0, _typeof3.default)(rowData)) === 'object' && rowData !== null /*&& rowData.hasOwnProperty(sortColumn)*/ - ) { - var columnData = rowData[sortColumn]; - return [columnData, index]; - } - return [undefined, index]; - }); - } else { - if (sortIndexColumn) { - columnDataWithRowIndexes = rowHeaders.map(function (rowData, index) { - var columnData = rowHeaders[index]; - return [columnData, index]; - }); - } - } - if (columnDataWithRowIndexes !== undefined) { - // apply a mapper before sorting (because we need to access inside a container) - var comparator = function comparator(mapper, ascending) { - return function (a, b) { - var v1 = mapper(a); // the datum - var v2 = mapper(b); - var type1 = typeof v1 === 'undefined' ? 'undefined' : (0, _typeof3.default)(v1); - var type2 = typeof v2 === 'undefined' ? 'undefined' : (0, _typeof3.default)(v2); - // use '<' operator to compare same type of values or compare type precedence order # - var lt = function lt(v1, v2) { - if (v1 < v2) { - return -1; - } else if (v1 > v2) { - return 1; - } else { - return 0; - } - }; - var result = void 0; - if (type1 === type2) { - result = lt(v1, v2); - } else { - // order of different types - var order = { - string: 0, - number: 1, - object: 2, - symbol: 3, - boolean: 4, - undefined: 5, - function: 6 - }; - result = lt(order[type1], order[type2]); - } - // reverse result if descending - if (!ascending) result = -result; - return result; - }; - }; - var sortedRowIndexes = columnDataWithRowIndexes.sort(comparator(function (item) { - return item[0]; - }, sortAscending)).map(function (item) { - return item[1]; - }); // sorted row indexes - rowHeaders = sortedRowIndexes.map(function (i) { - return rowHeaders[i]; - }); - rowsData = sortedRowIndexes.map(function (i) { - return rowsData[i]; - }); - } - - return _react2.default.createElement( - _ThemeProvider2.default, - { theme: this.props.theme }, - _react2.default.createElement( - 'div', - { style: styles.base }, - _react2.default.createElement(_HeaderContainer2.default, { - columns: colHeaders - /* for sorting */ - , sorted: this.state.sorted, - sortIndexColumn: this.state.sortIndexColumn, - sortColumn: this.state.sortColumn, - sortAscending: this.state.sortAscending, - onTHClick: this.handleTHClick.bind(this), - onIndexTHClick: this.handleIndexTHClick.bind(this) - }), - _react2.default.createElement(_DataContainer2.default, { rows: rowHeaders, columns: colHeaders, rowsData: rowsData }) - ) - ); - } - }]); - return TableInspector; -}(_react.Component); /** - * Specs: - * https://developer.chrome.com/devtools/docs/commandline-api#tabledata-columns - * https://developer.mozilla.org/en-US/docs/Web/API/Console/table - */ - -exports.default = TableInspector; - - -TableInspector.propTypes = { - /** - * the Javascript object you would like to inspect, either an array or an object - */ - data: _propTypes2.default.oneOfType([_propTypes2.default.array, _propTypes2.default.object]), - /** - * An array of the names of the columns you'd like to display in the table - */ - columns: _propTypes2.default.array -}; - -TableInspector.defaultProps = { - data: undefined, - columns: undefined, - theme: 'chromeLight' -}; - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _toConsumableArray2 = __webpack_require__(47); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -exports.default = getHeaders; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * Polyfill for running tests - * `includes` is an ES2016 feature - */ -if (!Array.prototype.includes) { - Array.prototype.includes = function (searchElement /*, fromIndex*/) { - var O = Object(this); - var len = parseInt(O.length) || 0; - if (len === 0) { - return false; - } - var n = parseInt(arguments[1]) || 0; - var k; - if (n >= 0) { - k = n; - } else { - k = len + n; - if (k < 0) { - k = 0; - } - } - var currentElement; - while (k < len) { - currentElement = O[k]; - if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { - // NaN !== NaN - return true; - } - k++; - } - return false; - }; -} - -function getHeaders(data) { - if ((typeof data === 'undefined' ? 'undefined' : (0, _typeof3.default)(data)) === 'object') { - var rowHeaders = void 0; - // is an array - if (Array.isArray(data)) { - var nRows = data.length; - rowHeaders = [].concat((0, _toConsumableArray3.default)(Array(nRows).keys())); - } else if (data !== null) { - // is an object - // keys are row indexes - rowHeaders = Object.keys(data); - } - - // Time: O(nRows * nCols) - var colHeaders = rowHeaders.reduce(function (colHeaders, rowHeader) { - var row = data[rowHeader]; - if ((typeof row === 'undefined' ? 'undefined' : (0, _typeof3.default)(row)) === 'object' && row !== null) { - /* O(nCols) Could optimize `includes` here */ - var cols = Object.keys(row); - cols.reduce(function (xs, x) { - if (!xs.includes(x)) { - /* xs is the colHeaders to be filled by searching the row's indexes */ - xs.push(x); - } - return xs; - }, colHeaders); - } - return colHeaders; - }, []); - return { - rowHeaders: rowHeaders, - colHeaders: colHeaders - }; - } - return undefined; -} - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof2 = __webpack_require__(21); - -var _typeof3 = _interopRequireDefault(_typeof2); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _createStyles = __webpack_require__(30); - -var _createStyles2 = _interopRequireDefault(_createStyles); - -var _ObjectValue = __webpack_require__(77); - -var _ObjectValue2 = _interopRequireDefault(_ObjectValue); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var DataContainer = function DataContainer(_ref, _ref2) { - var rows = _ref.rows, - columns = _ref.columns, - rowsData = _ref.rowsData; - var theme = _ref2.theme; - - var styles = (0, _createStyles2.default)('TableInspectorDataContainer', theme); - var borderStyles = (0, _createStyles2.default)('TableInspectorLeftBorder', theme); - - return _react2.default.createElement( - 'div', - { style: styles.div }, - _react2.default.createElement( - 'table', - { style: styles.table }, - _react2.default.createElement('colgroup', null), - _react2.default.createElement( - 'tbody', - null, - rows.map(function (row, i) { - return _react2.default.createElement( - 'tr', - { key: row, style: styles.tr }, - _react2.default.createElement( - 'td', - { style: (0, _extends3.default)({}, styles.td, borderStyles.none) }, - row - ), - columns.map(function (column) { - var rowData = rowsData[i]; - // rowData could be - // object -> index by key - // array -> index by array index - // null -> pass - // boolean -> pass - // string -> pass (hasOwnProperty returns true for [0..len-1]) - // number -> pass - // function -> pass - // symbol - // undefined -> pass - if ((typeof rowData === 'undefined' ? 'undefined' : (0, _typeof3.default)(rowData)) === 'object' && rowData !== null && rowData.hasOwnProperty(column)) { - return _react2.default.createElement( - 'td', - { key: column, style: (0, _extends3.default)({}, styles.td, borderStyles.solid) }, - _react2.default.createElement(_ObjectValue2.default, { object: rowData[column] }) - ); - } else { - return _react2.default.createElement('td', { key: column, style: (0, _extends3.default)({}, styles.td, borderStyles.solid) }); - } - }) - ); - }) - ) - ) - ); -}; - -DataContainer.contextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired -}; - -exports.default = DataContainer; - -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _createStyles = __webpack_require__(30); - -var _createStyles2 = _interopRequireDefault(_createStyles); - -var _TH = __webpack_require__(322); - -var _TH2 = _interopRequireDefault(_TH); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var HeaderContainer = function HeaderContainer(_ref, _ref2) { - var indexColumnText = _ref.indexColumnText, - columns = _ref.columns, - sorted = _ref.sorted, - sortIndexColumn = _ref.sortIndexColumn, - sortColumn = _ref.sortColumn, - sortAscending = _ref.sortAscending, - onTHClick = _ref.onTHClick, - onIndexTHClick = _ref.onIndexTHClick; - var theme = _ref2.theme; - - var styles = (0, _createStyles2.default)('TableInspectorHeaderContainer', theme); - var borderStyles = (0, _createStyles2.default)('TableInspectorLeftBorder', theme); - return _react2.default.createElement( - 'div', - { style: styles.base }, - _react2.default.createElement( - 'table', - { style: styles.table }, - _react2.default.createElement( - 'tbody', - null, - _react2.default.createElement( - 'tr', - null, - _react2.default.createElement( - _TH2.default, - { - borderStyle: borderStyles.none, - sorted: sorted && sortIndexColumn, - sortAscending: sortAscending, - onClick: onIndexTHClick - }, - indexColumnText - ), - columns.map(function (column) { - return _react2.default.createElement( - _TH2.default, - { - borderStyle: borderStyles.solid, - key: column, - sorted: sorted && sortColumn === column, - sortAscending: sortAscending, - onClick: onTHClick.bind(undefined, column) - }, - column - ); - }) - ) - ) - ) - ); -}; - -HeaderContainer.defaultProps = { - indexColumnText: '(index)', - columns: [] -}; - -HeaderContainer.contextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired -}; - -exports.default = HeaderContainer; - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _createStyles = __webpack_require__(30); - -var _createStyles2 = _interopRequireDefault(_createStyles); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SortIconContainer = function SortIconContainer(props) { - return _react2.default.createElement( - 'div', - { - style: { - position: 'absolute', - top: 1, - right: 0, - bottom: 1, - display: 'flex', - alignItems: 'center' - } - }, - props.children - ); -}; - -var SortIcon = function SortIcon(_ref, _ref2) { - var sortAscending = _ref.sortAscending; - var theme = _ref2.theme; - - var glyph = sortAscending ? '▲' : '▼'; - var styles = (0, _createStyles2.default)('TableInspectorSortIcon', theme); - return _react2.default.createElement( - 'div', - { style: styles }, - glyph - ); -}; - -SortIcon.contextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired -}; - -var TH = function (_Component) { - (0, _inherits3.default)(TH, _Component); - - function TH() { - var _ref3; - - var _temp, _this, _ret; - - (0, _classCallCheck3.default)(this, TH); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref3 = TH.__proto__ || Object.getPrototypeOf(TH)).call.apply(_ref3, [this].concat(args))), _this), _this.state = { hovered: false }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); - } - - (0, _createClass3.default)(TH, [{ - key: 'toggleHovered', - value: function toggleHovered(hovered) { - this.setState({ hovered: hovered }); - } - }, { - key: 'render', - value: function render() { - // either not sorted, sort ascending or sort descending - var _props = this.props, - sorted = _props.sorted, - sortAscending = _props.sortAscending; - var theme = this.context.theme; - - var styles = (0, _createStyles2.default)('TableInspectorTH', theme); - - return _react2.default.createElement( - 'th', - (0, _extends3.default)({}, this.props, { - style: (0, _extends3.default)({}, styles.base, this.props.borderStyle, this.state.hovered ? styles.base[':hover'] : {}), - onMouseEnter: this.toggleHovered.bind(this, true), - onMouseLeave: this.toggleHovered.bind(this, false), - onClick: this.props.onClick - }), - _react2.default.createElement( - 'div', - { style: styles.div }, - this.props.children - ), - function () { - if (sorted) { - return _react2.default.createElement( - SortIconContainer, - null, - _react2.default.createElement(SortIcon, { sortAscending: sortAscending }) - ); - } - }() - ); - } - }]); - return TH; -}(_react.Component); - -TH.contextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired -}; - -TH.defaultProps = { - sortAscending: false, - sorted: false, - onClick: undefined -}; - -exports.default = TH; - -/***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _possibleConstructorReturn2 = __webpack_require__(11); - -var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); - -var _inherits2 = __webpack_require__(12); - -var _inherits3 = _interopRequireDefault(_inherits2); - -var _regenerator = __webpack_require__(164); - -var _regenerator2 = _interopRequireDefault(_regenerator); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _DOMNodePreview = __webpack_require__(324); - -var _DOMNodePreview2 = _interopRequireDefault(_DOMNodePreview); - -var _TreeView = __webpack_require__(166); - -var _TreeView2 = _interopRequireDefault(_TreeView); - -var _shouldInline = __webpack_require__(169); - -var _shouldInline2 = _interopRequireDefault(_shouldInline); - -var _ThemeProvider = __webpack_require__(108); - -var _ThemeProvider2 = _interopRequireDefault(_ThemeProvider); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var domIterator = _regenerator2.default.mark(function domIterator(data) { - var textInlined, i, node; - return _regenerator2.default.wrap(function domIterator$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - if (!(data && data.childNodes)) { - _context.next = 17; - break; - } - - textInlined = (0, _shouldInline2.default)(data); - - if (!textInlined) { - _context.next = 4; - break; - } - - return _context.abrupt('return'); - - case 4: - i = 0; - - case 5: - if (!(i < data.childNodes.length)) { - _context.next = 14; - break; - } - - node = data.childNodes[i]; - - if (!(node.nodeType === Node.TEXT_NODE && node.textContent.trim().length === 0)) { - _context.next = 9; - break; - } - - return _context.abrupt('continue', 11); - - case 9: - _context.next = 11; - return { - name: node.tagName + '[' + i + ']', - data: node - }; - - case 11: - i++; - _context.next = 5; - break; - - case 14: - if (!data.tagName) { - _context.next = 17; - break; - } - - _context.next = 17; - return { - name: 'CLOSE_TAG', - data: { - tagName: data.tagName - }, - isCloseTag: true - }; - - case 17: - case 'end': - return _context.stop(); - } - } - }, domIterator, this); -}); - -var DOMInspector = function (_Component) { - (0, _inherits3.default)(DOMInspector, _Component); - - function DOMInspector() { - (0, _classCallCheck3.default)(this, DOMInspector); - return (0, _possibleConstructorReturn3.default)(this, (DOMInspector.__proto__ || Object.getPrototypeOf(DOMInspector)).apply(this, arguments)); - } - - (0, _createClass3.default)(DOMInspector, [{ - key: 'render', - value: function render() { - var nodeRenderer = _DOMNodePreview2.default; - - return _react2.default.createElement( - _ThemeProvider2.default, - { theme: this.props.theme }, - _react2.default.createElement(_TreeView2.default, (0, _extends3.default)({ nodeRenderer: nodeRenderer, dataIterator: domIterator }, this.props)) - ); - } - }]); - return DOMInspector; -}(_react.Component); - -DOMInspector.propTypes = { - /** The DOM Node to inspect */ - data: _propTypes2.default.object.isRequired -}; -DOMInspector.defaultProps = { - theme: 'chromeLight' -}; -exports.default = DOMInspector; - -/***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _createStyles = __webpack_require__(30); - -var _createStyles2 = _interopRequireDefault(_createStyles); - -var _shouldInline = __webpack_require__(169); - -var _shouldInline2 = _interopRequireDefault(_shouldInline); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var OpenTag = function OpenTag(_ref) { - var tagName = _ref.tagName, - attributes = _ref.attributes, - styles = _ref.styles; - - return _react2.default.createElement( - 'span', - { style: styles.base }, - '<', - _react2.default.createElement( - 'span', - { style: styles.tagName }, - tagName - ), - function () { - if (attributes) { - var attributeNodes = []; - for (var i = 0; i < attributes.length; i++) { - var attribute = attributes[i]; - attributeNodes.push(_react2.default.createElement( - 'span', - { key: i }, - ' ', - _react2.default.createElement( - 'span', - { style: styles.htmlAttributeName }, - attribute.name - ), - '="', - _react2.default.createElement( - 'span', - { style: styles.htmlAttributeValue }, - attribute.value - ), - '"' - )); - } - return attributeNodes; - } - }(), - '>' - ); -}; - -// isChildNode style={{ marginLeft: -12 /* hack: offset placeholder */ }} -var CloseTag = function CloseTag(_ref2) { - var tagName = _ref2.tagName, - _ref2$isChildNode = _ref2.isChildNode, - isChildNode = _ref2$isChildNode === undefined ? false : _ref2$isChildNode, - styles = _ref2.styles; - return _react2.default.createElement( - 'span', - { style: Object.assign({}, styles.base, isChildNode && styles.offsetLeft) }, - '</', - _react2.default.createElement( - 'span', - { style: styles.tagName }, - tagName - ), - '>' - ); -}; - -var nameByNodeType = { - 1: 'ELEMENT_NODE', - 3: 'TEXT_NODE', - 7: 'PROCESSING_INSTRUCTION_NODE', - 8: 'COMMENT_NODE', - 9: 'DOCUMENT_NODE', - 10: 'DOCUMENT_TYPE_NODE', // http://stackoverflow.com/questions/6088972/get-doctype-of-an-html-as-string-with-javascript - 11: 'DOCUMENT_FRAGMENT_NODE' -}; - -var DOMNodePreview = function DOMNodePreview(_ref3, _ref4) { - var isCloseTag = _ref3.isCloseTag, - data = _ref3.data, - expanded = _ref3.expanded; - var theme = _ref4.theme; - - var styles = (0, _createStyles2.default)('DOMNodePreview', theme); - - if (isCloseTag) { - return _react2.default.createElement(CloseTag, { styles: styles.htmlCloseTag, isChildNode: true, tagName: data.tagName }); - } - - switch (data.nodeType) { - case Node.ELEMENT_NODE: - return _react2.default.createElement( - 'span', - null, - _react2.default.createElement(OpenTag, { - tagName: data.tagName, - attributes: data.attributes, - styles: styles.htmlOpenTag - }), - (0, _shouldInline2.default)(data) ? data.textContent : !expanded && '…', - !expanded && _react2.default.createElement(CloseTag, { tagName: data.tagName, styles: styles.htmlCloseTag }) - ); - case Node.TEXT_NODE: - return _react2.default.createElement( - 'span', - null, - data.textContent - ); - case Node.CDATA_SECTION_NODE: - return _react2.default.createElement( - 'span', - null, - '<![CDATA[' + data.textContent + ']]>' - ); - case Node.COMMENT_NODE: - return _react2.default.createElement( - 'span', - { style: styles.htmlComment }, - '<!--', - data.textContent, - '-->' - ); - case Node.PROCESSING_INSTRUCTION_NODE: - return _react2.default.createElement( - 'span', - null, - data.nodeName - ); - case Node.DOCUMENT_TYPE_NODE: - return _react2.default.createElement( - 'span', - { style: styles.htmlDoctype }, - '<!DOCTYPE ', - data.name, - data.publicId ? ' PUBLIC "' + data.publicId + '"' : '', - !data.publicId && data.systemId ? ' SYSTEM' : '', - data.systemId ? ' "' + data.systemId + '"' : '', - '>' - ); - case Node.DOCUMENT_NODE: - return _react2.default.createElement( - 'span', - null, - data.nodeName - ); - case Node.DOCUMENT_FRAGMENT_NODE: - return _react2.default.createElement( - 'span', - null, - data.nodeName - ); - default: - return _react2.default.createElement( - 'span', - null, - nameByNodeType[data.nodeType] - ); - } -}; - -DOMNodePreview.propTypes = { - /** If true, just render a close tag */ - isCloseTag: _propTypes2.default.bool, - /** */ - name: _propTypes2.default.string, - /** The DOM Node */ - data: _propTypes2.default.object.isRequired, - /** Whether the DOM node has been expanded. */ - expanded: _propTypes2.default.bool.isRequired -}; - -DOMNodePreview.contextTypes = { - theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]).isRequired -}; - -exports.default = DOMNodePreview; - -/***/ }), -/* 325 */ -/***/ (function(module, exports) { - -module.exports = isNode - -function isNode (val) { - return (!val || typeof val !== 'object') - ? false - : (typeof window === 'object' && typeof window.Node === 'object') - ? (val instanceof window.Node) - : (typeof val.nodeType === 'number') && - (typeof val.nodeName === 'string') -} - - -/***/ }), -/* 326 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - wrapper: { - flex: 1, - display: 'flex', - position: 'relative' - }, - actions: { - flex: 1, - margin: 0, - padding: '8px 2px 20px 0', - overflowY: 'auto', - color: '#666' - }, - action: { - display: 'flex', - padding: '3px 3px 3px 0', - borderLeft: '5px solid white', - borderBottom: '1px solid #fafafa', - transition: 'all 0.1s', - alignItems: 'start' - }, - countwrap: { - paddingBottom: 2 - }, - counter: { - margin: '0 5px 0 5px', - backgroundColor: '#777777', - color: '#ffffff', - padding: '1px 5px', - borderRadius: '20px' - }, - inspector: { - flex: 1, - padding: '0 0 0 5px' - }, - button: { - position: 'absolute', - bottom: 0, - right: 0, - border: 'none', - borderTop: 'solid 1px rgba(0, 0, 0, 0.2)', - borderLeft: 'solid 1px rgba(0, 0, 0, 0.2)', - background: 'rgba(255, 255, 255, 0.5)', - padding: '5px 10px', - borderRadius: '4px 0 0 0', - color: 'rgba(0, 0, 0, 0.5)', - outline: 'none' - } -}; - -/***/ }), -/* 327 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _toConsumableArray2 = __webpack_require__(47); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _from = __webpack_require__(135); - -var _from2 = _interopRequireDefault(_from); - -exports.action = action; -exports.decorateAction = decorateAction; - -var _addons = __webpack_require__(55); - -var _addons2 = _interopRequireDefault(_addons); - -var _jsonStringifySafe = __webpack_require__(170); - -var _jsonStringifySafe2 = _interopRequireDefault(_jsonStringifySafe); - -var _v = __webpack_require__(328); - -var _v2 = _interopRequireDefault(_v); - -var _ = __webpack_require__(66); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint-disable no-underscore-dangle */ - -function _format(arg) { - if (arg && typeof arg.preventDefault !== 'undefined') { - return (0, _jsonStringifySafe2.default)('[SyntheticEvent]'); - } - return (0, _jsonStringifySafe2.default)(arg); -} - -function action(name) { - // eslint-disable-next-line no-unused-vars, func-names - var handler = function handler() { - for (var _len = arguments.length, _args = Array(_len), _key = 0; _key < _len; _key++) { - _args[_key] = arguments[_key]; - } - - var args = (0, _from2.default)(_args).map(_format); - var channel = _addons2.default.getChannel(); - var id = (0, _v2.default)(); - channel.emit(_.EVENT_ID, { - id: id, - data: { name: name, args: args } - }); - }; - - // some day when {[name]: function() {}} syntax is not transpiled by babel - // we can get rid of this eval as by ES2015 spec the above function gets the - // name `name`, but babel transpiles to Object.defineProperty which doesn't do - // the same. - // - // Ref: https://bocoup.com/weblog/whats-in-a-function-name - var fnName = name && typeof name === 'string' ? name.replace(/\W+/g, '_') : 'action'; - // eslint-disable-next-line no-eval - var named = eval('(function ' + fnName + '() { return handler.apply(this, arguments) })'); - return named; -} - -function decorateAction(decorators) { - // eslint-disable-next-line no-unused-vars, func-names - return function (name) { - var callAction = action(name); - // eslint-disable-next-line no-unused-vars, func-names - return function () { - for (var _len2 = arguments.length, _args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - _args[_key2] = arguments[_key2]; - } - - var decorated = decorators.reduce(function (args, fn) { - return fn(args); - }, _args); - callAction.apply(undefined, (0, _toConsumableArray3.default)(decorated)); - }; - }; -} - -/***/ }), -/* 328 */ -/***/ (function(module, exports, __webpack_require__) { - -var rng = __webpack_require__(329); -var bytesToUuid = __webpack_require__(330); - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -// random #'s we need to init node and clockseq -var _seedBytes = rng(); - -// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) -var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] -]; - -// Per 4.2.2, randomize (14 bit) clockseq -var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; - -// Previous uuid creation time -var _lastMSecs = 0, _lastNSecs = 0; - -// See https://github.com/broofa/node-uuid for API details -function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - var node = options.node || _nodeId; - for (var n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - - return buf ? buf : bytesToUuid(b); -} - -module.exports = v1; - - -/***/ }), -/* 329 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {// Unique ID creation requires a high quality random # generator. In the -// browser this is a little complicated due to unknown quality of Math.random() -// and inconsistent support for the `crypto` API. We do the best we can via -// feature-detection -var rng; - -var crypto = global.crypto || global.msCrypto; // for IE 11 -if (crypto && crypto.getRandomValues) { - // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto - var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef - rng = function whatwgRNG() { - crypto.getRandomValues(rnds8); - return rnds8; - }; -} - -if (!rng) { - // Math.random()-based (RNG) - // - // If all else fails, use Math.random(). It's fast, but is of unspecified - // quality. - var rnds = new Array(16); - rng = function() { - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) === 0) r = Math.random() * 0x100000000; - rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return rnds; - }; -} - -module.exports = rng; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22))) - -/***/ }), -/* 330 */ -/***/ (function(module, exports) { - -/** - * Convert array of 16 byte values to UUID string format of the form: - * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX - */ -var byteToHex = []; -for (var i = 0; i < 256; ++i) { - byteToHex[i] = (i + 0x100).toString(16).substr(1); -} - -function bytesToUuid(buf, offset) { - var i = offset || 0; - var bth = byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; -} - -module.exports = bytesToUuid; - - -/***/ }), -/* 331 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.register = register; - -var _addons = __webpack_require__(55); - -var _addons2 = _interopRequireDefault(_addons); - -var _ = __webpack_require__(94); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function register() { - _addons2.default.register(_.ADDON_ID, function (api) { - var channel = _addons2.default.getChannel(); - channel.on(_.EVENT_ID, function (selection) { - api.selectStory(selection.kind, selection.story); - }); - }); -} - -/***/ }), -/* 332 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.linkTo = linkTo; - -var _addons = __webpack_require__(55); - -var _addons2 = _interopRequireDefault(_addons); - -var _ = __webpack_require__(94); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function linkTo(kind, story) { - return function () { - var resolvedKind = typeof kind === 'function' ? kind.apply(undefined, arguments) : kind; - var resolvedStory = typeof story === 'function' ? story.apply(undefined, arguments) : story; - - var channel = _addons2.default.getChannel(); - channel.emit(_.EVENT_ID, { kind: resolvedKind, story: resolvedStory }); - }; -} - -/***/ }), -/* 333 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -__webpack_require__(334); - -/***/ }), -/* 334 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -__webpack_require__(335); - - -/***/ }), -/* 335 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -__webpack_require__(336); -__webpack_require__(337); - -__webpack_require__(338); - - -/***/ }), -/* 336 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - * https://github.com/es-shims/es5-shim - * @license es5-shim Copyright 2009-2015 by contributors, MIT License - * see https://github.com/es-shims/es5-shim/blob/master/LICENSE - */ - -// vim: ts=4 sts=4 sw=4 expandtab - -// Add semicolon to prevent IIFE from being passed as argument to concatenated code. -; - -// UMD (Universal Module Definition) -// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js -(function (root, factory) { - 'use strict'; - - /* global define, exports, module */ - if (true) { - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : - __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like enviroments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals (root is window) - root.returnExports = factory(); - } -}(this, function () { - /** - * Brings an environment as close to ECMAScript 5 compliance - * as is possible with the facilities of erstwhile engines. - * - * Annotated ES5: http://es5.github.com/ (specific links below) - * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf - * Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/ - */ - - // Shortcut to an often accessed properties, in order to avoid multiple - // dereference that costs universally. This also holds a reference to known-good - // functions. - var $Array = Array; - var ArrayPrototype = $Array.prototype; - var $Object = Object; - var ObjectPrototype = $Object.prototype; - var $Function = Function; - var FunctionPrototype = $Function.prototype; - var $String = String; - var StringPrototype = $String.prototype; - var $Number = Number; - var NumberPrototype = $Number.prototype; - var array_slice = ArrayPrototype.slice; - var array_splice = ArrayPrototype.splice; - var array_push = ArrayPrototype.push; - var array_unshift = ArrayPrototype.unshift; - var array_concat = ArrayPrototype.concat; - var array_join = ArrayPrototype.join; - var call = FunctionPrototype.call; - var apply = FunctionPrototype.apply; - var max = Math.max; - var min = Math.min; - - // Having a toString local variable name breaks in Opera so use to_string. - var to_string = ObjectPrototype.toString; - - /* global Symbol */ - /* eslint-disable one-var-declaration-per-line, no-redeclare, max-statements-per-line */ - var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; }; - - var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; }; - var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; }; - /* eslint-enable one-var-declaration-per-line, no-redeclare, max-statements-per-line */ - - /* inlined from http://npmjs.com/define-properties */ - var supportsDescriptors = $Object.defineProperty && (function () { - try { - var obj = {}; - $Object.defineProperty(obj, 'x', { enumerable: false, value: obj }); - for (var _ in obj) { // jscs:ignore disallowUnusedVariables - return false; - } - return obj.x === obj; - } catch (e) { /* this is ES3 */ - return false; - } - }()); - var defineProperties = (function (has) { - // Define configurable, writable, and non-enumerable props - // if they don't exist. - var defineProperty; - if (supportsDescriptors) { - defineProperty = function (object, name, method, forceAssign) { - if (!forceAssign && (name in object)) { - return; - } - $Object.defineProperty(object, name, { - configurable: true, - enumerable: false, - writable: true, - value: method - }); - }; - } else { - defineProperty = function (object, name, method, forceAssign) { - if (!forceAssign && (name in object)) { - return; - } - object[name] = method; - }; - } - return function defineProperties(object, map, forceAssign) { - for (var name in map) { - if (has.call(map, name)) { - defineProperty(object, name, map[name], forceAssign); - } - } - }; - }(ObjectPrototype.hasOwnProperty)); - - // - // Util - // ====== - // - - /* replaceable with https://npmjs.com/package/es-abstract /helpers/isPrimitive */ - var isPrimitive = function isPrimitive(input) { - var type = typeof input; - return input === null || (type !== 'object' && type !== 'function'); - }; - - var isActualNaN = $Number.isNaN || function isActualNaN(x) { - return x !== x; - }; - - var ES = { - // ES5 9.4 - // http://es5.github.com/#x9.4 - // http://jsperf.com/to-integer - /* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */ - ToInteger: function ToInteger(num) { - var n = +num; - if (isActualNaN(n)) { - n = 0; - } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) { - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } - return n; - }, - - /* replaceable with https://npmjs.com/package/es-abstract ES5.ToPrimitive */ - ToPrimitive: function ToPrimitive(input) { - var val, valueOf, toStr; - if (isPrimitive(input)) { - return input; - } - valueOf = input.valueOf; - if (isCallable(valueOf)) { - val = valueOf.call(input); - if (isPrimitive(val)) { - return val; - } - } - toStr = input.toString; - if (isCallable(toStr)) { - val = toStr.call(input); - if (isPrimitive(val)) { - return val; - } - } - throw new TypeError(); - }, - - // ES5 9.9 - // http://es5.github.com/#x9.9 - /* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */ - ToObject: function (o) { - if (o == null) { // this matches both null and undefined - throw new TypeError("can't convert " + o + ' to object'); - } - return $Object(o); - }, - - /* replaceable with https://npmjs.com/package/es-abstract ES5.ToUint32 */ - ToUint32: function ToUint32(x) { - return x >>> 0; - } - }; - - // - // Function - // ======== - // - - // ES-5 15.3.4.5 - // http://es5.github.com/#x15.3.4.5 - - var Empty = function Empty() {}; - - defineProperties(FunctionPrototype, { - bind: function bind(that) { // .length is 1 - // 1. Let Target be the this value. - var target = this; - // 2. If IsCallable(Target) is false, throw a TypeError exception. - if (!isCallable(target)) { - throw new TypeError('Function.prototype.bind called on incompatible ' + target); - } - // 3. Let A be a new (possibly empty) internal list of all of the - // argument values provided after thisArg (arg1, arg2 etc), in order. - // XXX slicedArgs will stand in for "A" if used - var args = array_slice.call(arguments, 1); // for normal call - // 4. Let F be a new native ECMAScript object. - // 11. Set the [[Prototype]] internal property of F to the standard - // built-in Function prototype object as specified in 15.3.3.1. - // 12. Set the [[Call]] internal property of F as described in - // 15.3.4.5.1. - // 13. Set the [[Construct]] internal property of F as described in - // 15.3.4.5.2. - // 14. Set the [[HasInstance]] internal property of F as described in - // 15.3.4.5.3. - var bound; - var binder = function () { - - if (this instanceof bound) { - // 15.3.4.5.2 [[Construct]] - // When the [[Construct]] internal method of a function object, - // F that was created using the bind function is called with a - // list of arguments ExtraArgs, the following steps are taken: - // 1. Let target be the value of F's [[TargetFunction]] - // internal property. - // 2. If target has no [[Construct]] internal method, a - // TypeError exception is thrown. - // 3. Let boundArgs be the value of F's [[BoundArgs]] internal - // property. - // 4. Let args be a new list containing the same values as the - // list boundArgs in the same order followed by the same - // values as the list ExtraArgs in the same order. - // 5. Return the result of calling the [[Construct]] internal - // method of target providing args as the arguments. - - var result = apply.call( - target, - this, - array_concat.call(args, array_slice.call(arguments)) - ); - if ($Object(result) === result) { - return result; - } - return this; - - } else { - // 15.3.4.5.1 [[Call]] - // When the [[Call]] internal method of a function object, F, - // which was created using the bind function is called with a - // this value and a list of arguments ExtraArgs, the following - // steps are taken: - // 1. Let boundArgs be the value of F's [[BoundArgs]] internal - // property. - // 2. Let boundThis be the value of F's [[BoundThis]] internal - // property. - // 3. Let target be the value of F's [[TargetFunction]] internal - // property. - // 4. Let args be a new list containing the same values as the - // list boundArgs in the same order followed by the same - // values as the list ExtraArgs in the same order. - // 5. Return the result of calling the [[Call]] internal method - // of target providing boundThis as the this value and - // providing args as the arguments. - - // equiv: target.call(this, ...boundArgs, ...args) - return apply.call( - target, - that, - array_concat.call(args, array_slice.call(arguments)) - ); - - } - - }; - - // 15. If the [[Class]] internal property of Target is "Function", then - // a. Let L be the length property of Target minus the length of A. - // b. Set the length own property of F to either 0 or L, whichever is - // larger. - // 16. Else set the length own property of F to 0. - - var boundLength = max(0, target.length - args.length); - - // 17. Set the attributes of the length own property of F to the values - // specified in 15.3.5.1. - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - array_push.call(boundArgs, '$' + i); - } - - // XXX Build a dynamic function with desired amount of arguments is the only - // way to set the length property of a function. - // In environments where Content Security Policies enabled (Chrome extensions, - // for ex.) all use of eval or Function costructor throws an exception. - // However in all of these environments Function.prototype.bind exists - // and so this code will never be executed. - bound = $Function('binder', 'return function (' + array_join.call(boundArgs, ',') + '){ return binder.apply(this, arguments); }')(binder); - - if (target.prototype) { - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - // Clean up dangling references. - Empty.prototype = null; - } - - // TODO - // 18. Set the [[Extensible]] internal property of F to true. - - // TODO - // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3). - // 20. Call the [[DefineOwnProperty]] internal method of F with - // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]: - // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and - // false. - // 21. Call the [[DefineOwnProperty]] internal method of F with - // arguments "arguments", PropertyDescriptor {[[Get]]: thrower, - // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false}, - // and false. - - // TODO - // NOTE Function objects created using Function.prototype.bind do not - // have a prototype property or the [[Code]], [[FormalParameters]], and - // [[Scope]] internal properties. - // XXX can't delete prototype in pure-js. - - // 22. Return F. - return bound; - } - }); - - // _Please note: Shortcuts are defined after `Function.prototype.bind` as we - // use it in defining shortcuts. - var owns = call.bind(ObjectPrototype.hasOwnProperty); - var toStr = call.bind(ObjectPrototype.toString); - var arraySlice = call.bind(array_slice); - var arraySliceApply = apply.bind(array_slice); - var strSlice = call.bind(StringPrototype.slice); - var strSplit = call.bind(StringPrototype.split); - var strIndexOf = call.bind(StringPrototype.indexOf); - var pushCall = call.bind(array_push); - var isEnum = call.bind(ObjectPrototype.propertyIsEnumerable); - var arraySort = call.bind(ArrayPrototype.sort); - - // - // Array - // ===== - // - - var isArray = $Array.isArray || function isArray(obj) { - return toStr(obj) === '[object Array]'; - }; - - // ES5 15.4.4.12 - // http://es5.github.com/#x15.4.4.13 - // Return len+argCount. - // [bugfix, ielt8] - // IE < 8 bug: [].unshift(0) === undefined but should be "1" - var hasUnshiftReturnValueBug = [].unshift(0) !== 1; - defineProperties(ArrayPrototype, { - unshift: function () { - array_unshift.apply(this, arguments); - return this.length; - } - }, hasUnshiftReturnValueBug); - - // ES5 15.4.3.2 - // http://es5.github.com/#x15.4.3.2 - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray - defineProperties($Array, { isArray: isArray }); - - // The IsCallable() check in the Array functions - // has been replaced with a strict check on the - // internal class of the object to trap cases where - // the provided function was actually a regular - // expression literal, which in V8 and - // JavaScriptCore is a typeof "function". Only in - // V8 are regular expression literals permitted as - // reduce parameters, so it is desirable in the - // general case for the shim to match the more - // strict and common behavior of rejecting regular - // expressions. - - // ES5 15.4.4.18 - // http://es5.github.com/#x15.4.4.18 - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach - - // Check failure of by-index access of string characters (IE < 9) - // and failure of `0 in boxedString` (Rhino) - var boxedString = $Object('a'); - var splitString = boxedString[0] !== 'a' || !(0 in boxedString); - - var properlyBoxesContext = function properlyBoxed(method) { - // Check node 0.6.21 bug where third parameter is not boxed - var properlyBoxesNonStrict = true; - var properlyBoxesStrict = true; - var threwException = false; - if (method) { - try { - method.call('foo', function (_, __, context) { - if (typeof context !== 'object') { - properlyBoxesNonStrict = false; - } - }); - - method.call([1], function () { - 'use strict'; - - properlyBoxesStrict = typeof this === 'string'; - }, 'x'); - } catch (e) { - threwException = true; - } - } - return !!method && !threwException && properlyBoxesNonStrict && properlyBoxesStrict; - }; - - defineProperties(ArrayPrototype, { - forEach: function forEach(callbackfn/*, thisArg*/) { - var object = ES.ToObject(this); - var self = splitString && isString(this) ? strSplit(this, '') : object; - var i = -1; - var length = ES.ToUint32(self.length); - var T; - if (arguments.length > 1) { - T = arguments[1]; - } - - // If no callback function or if callback is not a callable function - if (!isCallable(callbackfn)) { - throw new TypeError('Array.prototype.forEach callback must be a function'); - } - - while (++i < length) { - if (i in self) { - // Invoke the callback function with call, passing arguments: - // context, property value, property key, thisArg object - if (typeof T === 'undefined') { - callbackfn(self[i], i, object); - } else { - callbackfn.call(T, self[i], i, object); - } - } - } - } - }, !properlyBoxesContext(ArrayPrototype.forEach)); - - // ES5 15.4.4.19 - // http://es5.github.com/#x15.4.4.19 - // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map - defineProperties(ArrayPrototype, { - map: function map(callbackfn/*, thisArg*/) { - var object = ES.ToObject(this); - var self = splitString && isString(this) ? strSplit(this, '') : object; - var length = ES.ToUint32(self.length); - var result = $Array(length); - var T; - if (arguments.length > 1) { - T = arguments[1]; - } - - // If no callback function or if callback is not a callable function - if (!isCallable(callbackfn)) { - throw new TypeError('Array.prototype.map callback must be a function'); - } - - for (var i = 0; i < length; i++) { - if (i in self) { - if (typeof T === 'undefined') { - result[i] = callbackfn(self[i], i, object); - } else { - result[i] = callbackfn.call(T, self[i], i, object); - } - } - } - return result; - } - }, !properlyBoxesContext(ArrayPrototype.map)); - - // ES5 15.4.4.20 - // http://es5.github.com/#x15.4.4.20 - // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter - defineProperties(ArrayPrototype, { - filter: function filter(callbackfn/*, thisArg*/) { - var object = ES.ToObject(this); - var self = splitString && isString(this) ? strSplit(this, '') : object; - var length = ES.ToUint32(self.length); - var result = []; - var value; - var T; - if (arguments.length > 1) { - T = arguments[1]; - } - - // If no callback function or if callback is not a callable function - if (!isCallable(callbackfn)) { - throw new TypeError('Array.prototype.filter callback must be a function'); - } - - for (var i = 0; i < length; i++) { - if (i in self) { - value = self[i]; - if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) { - pushCall(result, value); - } - } - } - return result; - } - }, !properlyBoxesContext(ArrayPrototype.filter)); - - // ES5 15.4.4.16 - // http://es5.github.com/#x15.4.4.16 - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every - defineProperties(ArrayPrototype, { - every: function every(callbackfn/*, thisArg*/) { - var object = ES.ToObject(this); - var self = splitString && isString(this) ? strSplit(this, '') : object; - var length = ES.ToUint32(self.length); - var T; - if (arguments.length > 1) { - T = arguments[1]; - } - - // If no callback function or if callback is not a callable function - if (!isCallable(callbackfn)) { - throw new TypeError('Array.prototype.every callback must be a function'); - } - - for (var i = 0; i < length; i++) { - if (i in self && !(typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) { - return false; - } - } - return true; - } - }, !properlyBoxesContext(ArrayPrototype.every)); - - // ES5 15.4.4.17 - // http://es5.github.com/#x15.4.4.17 - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some - defineProperties(ArrayPrototype, { - some: function some(callbackfn/*, thisArg */) { - var object = ES.ToObject(this); - var self = splitString && isString(this) ? strSplit(this, '') : object; - var length = ES.ToUint32(self.length); - var T; - if (arguments.length > 1) { - T = arguments[1]; - } - - // If no callback function or if callback is not a callable function - if (!isCallable(callbackfn)) { - throw new TypeError('Array.prototype.some callback must be a function'); - } - - for (var i = 0; i < length; i++) { - if (i in self && (typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) { - return true; - } - } - return false; - } - }, !properlyBoxesContext(ArrayPrototype.some)); - - // ES5 15.4.4.21 - // http://es5.github.com/#x15.4.4.21 - // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce - var reduceCoercesToObject = false; - if (ArrayPrototype.reduce) { - reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) { - return list; - }) === 'object'; - } - defineProperties(ArrayPrototype, { - reduce: function reduce(callbackfn/*, initialValue*/) { - var object = ES.ToObject(this); - var self = splitString && isString(this) ? strSplit(this, '') : object; - var length = ES.ToUint32(self.length); - - // If no callback function or if callback is not a callable function - if (!isCallable(callbackfn)) { - throw new TypeError('Array.prototype.reduce callback must be a function'); - } - - // no value to return if no initial value and an empty array - if (length === 0 && arguments.length === 1) { - throw new TypeError('reduce of empty array with no initial value'); - } - - var i = 0; - var result; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i++]; - break; - } - - // if array contains no values, no initial value to return - if (++i >= length) { - throw new TypeError('reduce of empty array with no initial value'); - } - } while (true); - } - - for (; i < length; i++) { - if (i in self) { - result = callbackfn(result, self[i], i, object); - } - } - - return result; - } - }, !reduceCoercesToObject); - - // ES5 15.4.4.22 - // http://es5.github.com/#x15.4.4.22 - // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight - var reduceRightCoercesToObject = false; - if (ArrayPrototype.reduceRight) { - reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) { - return list; - }) === 'object'; - } - defineProperties(ArrayPrototype, { - reduceRight: function reduceRight(callbackfn/*, initial*/) { - var object = ES.ToObject(this); - var self = splitString && isString(this) ? strSplit(this, '') : object; - var length = ES.ToUint32(self.length); - - // If no callback function or if callback is not a callable function - if (!isCallable(callbackfn)) { - throw new TypeError('Array.prototype.reduceRight callback must be a function'); - } - - // no value to return if no initial value, empty array - if (length === 0 && arguments.length === 1) { - throw new TypeError('reduceRight of empty array with no initial value'); - } - - var result; - var i = length - 1; - if (arguments.length >= 2) { - result = arguments[1]; - } else { - do { - if (i in self) { - result = self[i--]; - break; - } - - // if array contains no values, no initial value to return - if (--i < 0) { - throw new TypeError('reduceRight of empty array with no initial value'); - } - } while (true); - } - - if (i < 0) { - return result; - } - - do { - if (i in self) { - result = callbackfn(result, self[i], i, object); - } - } while (i--); - - return result; - } - }, !reduceRightCoercesToObject); - - // ES5 15.4.4.14 - // http://es5.github.com/#x15.4.4.14 - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf - var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1; - defineProperties(ArrayPrototype, { - indexOf: function indexOf(searchElement/*, fromIndex */) { - var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this); - var length = ES.ToUint32(self.length); - - if (length === 0) { - return -1; - } - - var i = 0; - if (arguments.length > 1) { - i = ES.ToInteger(arguments[1]); - } - - // handle negative indices - i = i >= 0 ? i : max(0, length + i); - for (; i < length; i++) { - if (i in self && self[i] === searchElement) { - return i; - } - } - return -1; - } - }, hasFirefox2IndexOfBug); - - // ES5 15.4.4.15 - // http://es5.github.com/#x15.4.4.15 - // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf - var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1; - defineProperties(ArrayPrototype, { - lastIndexOf: function lastIndexOf(searchElement/*, fromIndex */) { - var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this); - var length = ES.ToUint32(self.length); - - if (length === 0) { - return -1; - } - var i = length - 1; - if (arguments.length > 1) { - i = min(i, ES.ToInteger(arguments[1])); - } - // handle negative indices - i = i >= 0 ? i : length - Math.abs(i); - for (; i >= 0; i--) { - if (i in self && searchElement === self[i]) { - return i; - } - } - return -1; - } - }, hasFirefox2LastIndexOfBug); - - // ES5 15.4.4.12 - // http://es5.github.com/#x15.4.4.12 - var spliceNoopReturnsEmptyArray = (function () { - var a = [1, 2]; - var result = a.splice(); - return a.length === 2 && isArray(result) && result.length === 0; - }()); - defineProperties(ArrayPrototype, { - // Safari 5.0 bug where .splice() returns undefined - splice: function splice(start, deleteCount) { - if (arguments.length === 0) { - return []; - } else { - return array_splice.apply(this, arguments); - } - } - }, !spliceNoopReturnsEmptyArray); - - var spliceWorksWithEmptyObject = (function () { - var obj = {}; - ArrayPrototype.splice.call(obj, 0, 0, 1); - return obj.length === 1; - }()); - defineProperties(ArrayPrototype, { - splice: function splice(start, deleteCount) { - if (arguments.length === 0) { - return []; - } - var args = arguments; - this.length = max(ES.ToInteger(this.length), 0); - if (arguments.length > 0 && typeof deleteCount !== 'number') { - args = arraySlice(arguments); - if (args.length < 2) { - pushCall(args, this.length - start); - } else { - args[1] = ES.ToInteger(deleteCount); - } - } - return array_splice.apply(this, args); - } - }, !spliceWorksWithEmptyObject); - var spliceWorksWithLargeSparseArrays = (function () { - // Per https://github.com/es-shims/es5-shim/issues/295 - // Safari 7/8 breaks with sparse arrays of size 1e5 or greater - var arr = new $Array(1e5); - // note: the index MUST be 8 or larger or the test will false pass - arr[8] = 'x'; - arr.splice(1, 1); - // note: this test must be defined *after* the indexOf shim - // per https://github.com/es-shims/es5-shim/issues/313 - return arr.indexOf('x') === 7; - }()); - var spliceWorksWithSmallSparseArrays = (function () { - // Per https://github.com/es-shims/es5-shim/issues/295 - // Opera 12.15 breaks on this, no idea why. - var n = 256; - var arr = []; - arr[n] = 'a'; - arr.splice(n + 1, 0, 'b'); - return arr[n] === 'a'; - }()); - defineProperties(ArrayPrototype, { - splice: function splice(start, deleteCount) { - var O = ES.ToObject(this); - var A = []; - var len = ES.ToUint32(O.length); - var relativeStart = ES.ToInteger(start); - var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len); - var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart); - - var k = 0; - var from; - while (k < actualDeleteCount) { - from = $String(actualStart + k); - if (owns(O, from)) { - A[k] = O[from]; - } - k += 1; - } - - var items = arraySlice(arguments, 2); - var itemCount = items.length; - var to; - if (itemCount < actualDeleteCount) { - k = actualStart; - var maxK = len - actualDeleteCount; - while (k < maxK) { - from = $String(k + actualDeleteCount); - to = $String(k + itemCount); - if (owns(O, from)) { - O[to] = O[from]; - } else { - delete O[to]; - } - k += 1; - } - k = len; - var minK = len - actualDeleteCount + itemCount; - while (k > minK) { - delete O[k - 1]; - k -= 1; - } - } else if (itemCount > actualDeleteCount) { - k = len - actualDeleteCount; - while (k > actualStart) { - from = $String(k + actualDeleteCount - 1); - to = $String(k + itemCount - 1); - if (owns(O, from)) { - O[to] = O[from]; - } else { - delete O[to]; - } - k -= 1; - } - } - k = actualStart; - for (var i = 0; i < items.length; ++i) { - O[k] = items[i]; - k += 1; - } - O.length = len - actualDeleteCount + itemCount; - - return A; - } - }, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays); - - var originalJoin = ArrayPrototype.join; - var hasStringJoinBug; - try { - hasStringJoinBug = Array.prototype.join.call('123', ',') !== '1,2,3'; - } catch (e) { - hasStringJoinBug = true; - } - if (hasStringJoinBug) { - defineProperties(ArrayPrototype, { - join: function join(separator) { - var sep = typeof separator === 'undefined' ? ',' : separator; - return originalJoin.call(isString(this) ? strSplit(this, '') : this, sep); - } - }, hasStringJoinBug); - } - - var hasJoinUndefinedBug = [1, 2].join(undefined) !== '1,2'; - if (hasJoinUndefinedBug) { - defineProperties(ArrayPrototype, { - join: function join(separator) { - var sep = typeof separator === 'undefined' ? ',' : separator; - return originalJoin.call(this, sep); - } - }, hasJoinUndefinedBug); - } - - var pushShim = function push(item) { - var O = ES.ToObject(this); - var n = ES.ToUint32(O.length); - var i = 0; - while (i < arguments.length) { - O[n + i] = arguments[i]; - i += 1; - } - O.length = n + i; - return n + i; - }; - - var pushIsNotGeneric = (function () { - var obj = {}; - var result = Array.prototype.push.call(obj, undefined); - return result !== 1 || obj.length !== 1 || typeof obj[0] !== 'undefined' || !owns(obj, 0); - }()); - defineProperties(ArrayPrototype, { - push: function push(item) { - if (isArray(this)) { - return array_push.apply(this, arguments); - } - return pushShim.apply(this, arguments); - } - }, pushIsNotGeneric); - - // This fixes a very weird bug in Opera 10.6 when pushing `undefined - var pushUndefinedIsWeird = (function () { - var arr = []; - var result = arr.push(undefined); - return result !== 1 || arr.length !== 1 || typeof arr[0] !== 'undefined' || !owns(arr, 0); - }()); - defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird); - - // ES5 15.2.3.14 - // http://es5.github.io/#x15.4.4.10 - // Fix boxed string bug - defineProperties(ArrayPrototype, { - slice: function (start, end) { - var arr = isString(this) ? strSplit(this, '') : this; - return arraySliceApply(arr, arguments); - } - }, splitString); - - var sortIgnoresNonFunctions = (function () { - try { - [1, 2].sort(null); - [1, 2].sort({}); - return true; - } catch (e) {} - return false; - }()); - var sortThrowsOnRegex = (function () { - // this is a problem in Firefox 4, in which `typeof /a/ === 'function'` - try { - [1, 2].sort(/a/); - return false; - } catch (e) {} - return true; - }()); - var sortIgnoresUndefined = (function () { - // applies in IE 8, for one. - try { - [1, 2].sort(undefined); - return true; - } catch (e) {} - return false; - }()); - defineProperties(ArrayPrototype, { - sort: function sort(compareFn) { - if (typeof compareFn === 'undefined') { - return arraySort(this); - } - if (!isCallable(compareFn)) { - throw new TypeError('Array.prototype.sort callback must be a function'); - } - return arraySort(this, compareFn); - } - }, sortIgnoresNonFunctions || !sortIgnoresUndefined || !sortThrowsOnRegex); - - // - // Object - // ====== - // - - // ES5 15.2.3.14 - // http://es5.github.com/#x15.2.3.14 - - // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation - var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString'); - var hasProtoEnumBug = isEnum(function () {}, 'prototype'); - var hasStringEnumBug = !owns('x', '0'); - var equalsConstructorPrototype = function (o) { - var ctor = o.constructor; - return ctor && ctor.prototype === o; - }; - var blacklistedKeys = { - $window: true, - $console: true, - $parent: true, - $self: true, - $frame: true, - $frames: true, - $frameElement: true, - $webkitIndexedDB: true, - $webkitStorageInfo: true, - $external: true - }; - var hasAutomationEqualityBug = (function () { - /* globals window */ - if (typeof window === 'undefined') { - return false; - } - for (var k in window) { - try { - if (!blacklistedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') { - equalsConstructorPrototype(window[k]); - } - } catch (e) { - return true; - } - } - return false; - }()); - var equalsConstructorPrototypeIfNotBuggy = function (object) { - if (typeof window === 'undefined' || !hasAutomationEqualityBug) { - return equalsConstructorPrototype(object); - } - try { - return equalsConstructorPrototype(object); - } catch (e) { - return false; - } - }; - var dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' - ]; - var dontEnumsLength = dontEnums.length; - - // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js - // can be replaced with require('is-arguments') if we ever use a build process instead - var isStandardArguments = function isArguments(value) { - return toStr(value) === '[object Arguments]'; - }; - var isLegacyArguments = function isArguments(value) { - return value !== null && - typeof value === 'object' && - typeof value.length === 'number' && - value.length >= 0 && - !isArray(value) && - isCallable(value.callee); - }; - var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments; - - defineProperties($Object, { - keys: function keys(object) { - var isFn = isCallable(object); - var isArgs = isArguments(object); - var isObject = object !== null && typeof object === 'object'; - var isStr = isObject && isString(object); - - if (!isObject && !isFn && !isArgs) { - throw new TypeError('Object.keys called on a non-object'); - } - - var theKeys = []; - var skipProto = hasProtoEnumBug && isFn; - if ((isStr && hasStringEnumBug) || isArgs) { - for (var i = 0; i < object.length; ++i) { - pushCall(theKeys, $String(i)); - } - } - - if (!isArgs) { - for (var name in object) { - if (!(skipProto && name === 'prototype') && owns(object, name)) { - pushCall(theKeys, $String(name)); - } - } - } - - if (hasDontEnumBug) { - var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); - for (var j = 0; j < dontEnumsLength; j++) { - var dontEnum = dontEnums[j]; - if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) { - pushCall(theKeys, dontEnum); - } - } - } - return theKeys; - } - }); - - var keysWorksWithArguments = $Object.keys && (function () { - // Safari 5.0 bug - return $Object.keys(arguments).length === 2; - }(1, 2)); - var keysHasArgumentsLengthBug = $Object.keys && (function () { - var argKeys = $Object.keys(arguments); - return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1; - }(1)); - var originalKeys = $Object.keys; - defineProperties($Object, { - keys: function keys(object) { - if (isArguments(object)) { - return originalKeys(arraySlice(object)); - } else { - return originalKeys(object); - } - } - }, !keysWorksWithArguments || keysHasArgumentsLengthBug); - - // - // Date - // ==== - // - - var hasNegativeMonthYearBug = new Date(-3509827329600292).getUTCMonth() !== 0; - var aNegativeTestDate = new Date(-1509842289600292); - var aPositiveTestDate = new Date(1449662400000); - var hasToUTCStringFormatBug = aNegativeTestDate.toUTCString() !== 'Mon, 01 Jan -45875 11:59:59 GMT'; - var hasToDateStringFormatBug; - var hasToStringFormatBug; - var timeZoneOffset = aNegativeTestDate.getTimezoneOffset(); - if (timeZoneOffset < -720) { - hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875'; - hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString()); - } else { - hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875'; - hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString()); - } - - var originalGetFullYear = call.bind(Date.prototype.getFullYear); - var originalGetMonth = call.bind(Date.prototype.getMonth); - var originalGetDate = call.bind(Date.prototype.getDate); - var originalGetUTCFullYear = call.bind(Date.prototype.getUTCFullYear); - var originalGetUTCMonth = call.bind(Date.prototype.getUTCMonth); - var originalGetUTCDate = call.bind(Date.prototype.getUTCDate); - var originalGetUTCDay = call.bind(Date.prototype.getUTCDay); - var originalGetUTCHours = call.bind(Date.prototype.getUTCHours); - var originalGetUTCMinutes = call.bind(Date.prototype.getUTCMinutes); - var originalGetUTCSeconds = call.bind(Date.prototype.getUTCSeconds); - var originalGetUTCMilliseconds = call.bind(Date.prototype.getUTCMilliseconds); - var dayName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; - var monthName = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - var daysInMonth = function daysInMonth(month, year) { - return originalGetDate(new Date(year, month, 0)); - }; - - defineProperties(Date.prototype, { - getFullYear: function getFullYear() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var year = originalGetFullYear(this); - if (year < 0 && originalGetMonth(this) > 11) { - return year + 1; - } - return year; - }, - getMonth: function getMonth() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var year = originalGetFullYear(this); - var month = originalGetMonth(this); - if (year < 0 && month > 11) { - return 0; - } - return month; - }, - getDate: function getDate() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var year = originalGetFullYear(this); - var month = originalGetMonth(this); - var date = originalGetDate(this); - if (year < 0 && month > 11) { - if (month === 12) { - return date; - } - var days = daysInMonth(0, year + 1); - return (days - date) + 1; - } - return date; - }, - getUTCFullYear: function getUTCFullYear() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var year = originalGetUTCFullYear(this); - if (year < 0 && originalGetUTCMonth(this) > 11) { - return year + 1; - } - return year; - }, - getUTCMonth: function getUTCMonth() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var year = originalGetUTCFullYear(this); - var month = originalGetUTCMonth(this); - if (year < 0 && month > 11) { - return 0; - } - return month; - }, - getUTCDate: function getUTCDate() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var year = originalGetUTCFullYear(this); - var month = originalGetUTCMonth(this); - var date = originalGetUTCDate(this); - if (year < 0 && month > 11) { - if (month === 12) { - return date; - } - var days = daysInMonth(0, year + 1); - return (days - date) + 1; - } - return date; - } - }, hasNegativeMonthYearBug); - - defineProperties(Date.prototype, { - toUTCString: function toUTCString() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var day = originalGetUTCDay(this); - var date = originalGetUTCDate(this); - var month = originalGetUTCMonth(this); - var year = originalGetUTCFullYear(this); - var hour = originalGetUTCHours(this); - var minute = originalGetUTCMinutes(this); - var second = originalGetUTCSeconds(this); - return dayName[day] + ', ' + - (date < 10 ? '0' + date : date) + ' ' + - monthName[month] + ' ' + - year + ' ' + - (hour < 10 ? '0' + hour : hour) + ':' + - (minute < 10 ? '0' + minute : minute) + ':' + - (second < 10 ? '0' + second : second) + ' GMT'; - } - }, hasNegativeMonthYearBug || hasToUTCStringFormatBug); - - // Opera 12 has `,` - defineProperties(Date.prototype, { - toDateString: function toDateString() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var day = this.getDay(); - var date = this.getDate(); - var month = this.getMonth(); - var year = this.getFullYear(); - return dayName[day] + ' ' + - monthName[month] + ' ' + - (date < 10 ? '0' + date : date) + ' ' + - year; - } - }, hasNegativeMonthYearBug || hasToDateStringFormatBug); - - // can't use defineProperties here because of toString enumeration issue in IE <= 8 - if (hasNegativeMonthYearBug || hasToStringFormatBug) { - Date.prototype.toString = function toString() { - if (!this || !(this instanceof Date)) { - throw new TypeError('this is not a Date object.'); - } - var day = this.getDay(); - var date = this.getDate(); - var month = this.getMonth(); - var year = this.getFullYear(); - var hour = this.getHours(); - var minute = this.getMinutes(); - var second = this.getSeconds(); - var timezoneOffset = this.getTimezoneOffset(); - var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60); - var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60); - return dayName[day] + ' ' + - monthName[month] + ' ' + - (date < 10 ? '0' + date : date) + ' ' + - year + ' ' + - (hour < 10 ? '0' + hour : hour) + ':' + - (minute < 10 ? '0' + minute : minute) + ':' + - (second < 10 ? '0' + second : second) + ' GMT' + - (timezoneOffset > 0 ? '-' : '+') + - (hoursOffset < 10 ? '0' + hoursOffset : hoursOffset) + - (minutesOffset < 10 ? '0' + minutesOffset : minutesOffset); - }; - if (supportsDescriptors) { - $Object.defineProperty(Date.prototype, 'toString', { - configurable: true, - enumerable: false, - writable: true - }); - } - } - - // ES5 15.9.5.43 - // http://es5.github.com/#x15.9.5.43 - // This function returns a String value represent the instance in time - // represented by this Date object. The format of the String is the Date Time - // string format defined in 15.9.1.15. All fields are present in the String. - // The time zone is always UTC, denoted by the suffix Z. If the time value of - // this object is not a finite Number a RangeError exception is thrown. - var negativeDate = -62198755200000; - var negativeYearString = '-000001'; - var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1; - var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z'; - - var getTime = call.bind(Date.prototype.getTime); - - defineProperties(Date.prototype, { - toISOString: function toISOString() { - if (!isFinite(this) || !isFinite(getTime(this))) { - // Adope Photoshop requires the second check. - throw new RangeError('Date.prototype.toISOString called on non-finite value.'); - } - - var year = originalGetUTCFullYear(this); - - var month = originalGetUTCMonth(this); - // see https://github.com/es-shims/es5-shim/issues/111 - year += Math.floor(month / 12); - month = (month % 12 + 12) % 12; - - // the date time string format is specified in 15.9.1.15. - var result = [month + 1, originalGetUTCDate(this), originalGetUTCHours(this), originalGetUTCMinutes(this), originalGetUTCSeconds(this)]; - year = ( - (year < 0 ? '-' : (year > 9999 ? '+' : '')) + - strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6) - ); - - for (var i = 0; i < result.length; ++i) { - // pad months, days, hours, minutes, and seconds to have two digits. - result[i] = strSlice('00' + result[i], -2); - } - // pad milliseconds to have three digits. - return ( - year + '-' + arraySlice(result, 0, 2).join('-') + - 'T' + arraySlice(result, 2).join(':') + '.' + - strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z' - ); - } - }, hasNegativeDateBug || hasSafari51DateBug); - - // ES5 15.9.5.44 - // http://es5.github.com/#x15.9.5.44 - // This function provides a String representation of a Date object for use by - // JSON.stringify (15.12.3). - var dateToJSONIsSupported = (function () { - try { - return Date.prototype.toJSON && - new Date(NaN).toJSON() === null && - new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 && - Date.prototype.toJSON.call({ // generic - toISOString: function () { return true; } - }); - } catch (e) { - return false; - } - }()); - if (!dateToJSONIsSupported) { - Date.prototype.toJSON = function toJSON(key) { - // When the toJSON method is called with argument key, the following - // steps are taken: - - // 1. Let O be the result of calling ToObject, giving it the this - // value as its argument. - // 2. Let tv be ES.ToPrimitive(O, hint Number). - var O = $Object(this); - var tv = ES.ToPrimitive(O); - // 3. If tv is a Number and is not finite, return null. - if (typeof tv === 'number' && !isFinite(tv)) { - return null; - } - // 4. Let toISO be the result of calling the [[Get]] internal method of - // O with argument "toISOString". - var toISO = O.toISOString; - // 5. If IsCallable(toISO) is false, throw a TypeError exception. - if (!isCallable(toISO)) { - throw new TypeError('toISOString property is not callable'); - } - // 6. Return the result of calling the [[Call]] internal method of - // toISO with O as the this value and an empty argument list. - return toISO.call(O); - - // NOTE 1 The argument is ignored. - - // NOTE 2 The toJSON function is intentionally generic; it does not - // require that its this value be a Date object. Therefore, it can be - // transferred to other kinds of objects for use as a method. However, - // it does require that any such object have a toISOString method. An - // object is free to use the argument key to filter its - // stringification. - }; - } - - // ES5 15.9.4.2 - // http://es5.github.com/#x15.9.4.2 - // based on work shared by Daniel Friesen (dantman) - // http://gist.github.com/303249 - var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15; - var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z')); - var doesNotParseY2KNewYear = isNaN(Date.parse('2000-01-01T00:00:00.000Z')); - if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) { - // XXX global assignment won't work in embeddings that use - // an alternate object for the context. - /* global Date: true */ - /* eslint-disable no-undef */ - var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1; - var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime()); - /* eslint-disable no-implicit-globals */ - Date = (function (NativeDate) { - /* eslint-enable no-implicit-globals */ - /* eslint-enable no-undef */ - // Date.length === 7 - var DateShim = function Date(Y, M, D, h, m, s, ms) { - var length = arguments.length; - var date; - if (this instanceof NativeDate) { - var seconds = s; - var millis = ms; - if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) { - // work around a Safari 8/9 bug where it treats the seconds as signed - var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit; - var sToShift = Math.floor(msToShift / 1e3); - seconds += sToShift; - millis -= sToShift * 1e3; - } - date = length === 1 && $String(Y) === Y ? // isString(Y) - // We explicitly pass it through parse: - new NativeDate(DateShim.parse(Y)) : - // We have to manually make calls depending on argument - // length here - length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) : - length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) : - length >= 5 ? new NativeDate(Y, M, D, h, m) : - length >= 4 ? new NativeDate(Y, M, D, h) : - length >= 3 ? new NativeDate(Y, M, D) : - length >= 2 ? new NativeDate(Y, M) : - length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) : - new NativeDate(); - } else { - date = NativeDate.apply(this, arguments); - } - if (!isPrimitive(date)) { - // Prevent mixups with unfixed Date object - defineProperties(date, { constructor: DateShim }, true); - } - return date; - }; - - // 15.9.1.15 Date Time String Format. - var isoDateExpression = new RegExp('^' + - '(\\d{4}|[+-]\\d{6})' + // four-digit year capture or sign + - // 6-digit extended year - '(?:-(\\d{2})' + // optional month capture - '(?:-(\\d{2})' + // optional day capture - '(?:' + // capture hours:minutes:seconds.milliseconds - 'T(\\d{2})' + // hours capture - ':(\\d{2})' + // minutes capture - '(?:' + // optional :seconds.milliseconds - ':(\\d{2})' + // seconds capture - '(?:(\\.\\d{1,}))?' + // milliseconds capture - ')?' + - '(' + // capture UTC offset component - 'Z|' + // UTC capture - '(?:' + // offset specifier +/-hours:minutes - '([-+])' + // sign capture - '(\\d{2})' + // hours offset capture - ':(\\d{2})' + // minutes offset capture - ')' + - ')?)?)?)?' + - '$'); - - var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; - - var dayFromMonth = function dayFromMonth(year, month) { - var t = month > 1 ? 1 : 0; - return ( - months[month] + - Math.floor((year - 1969 + t) / 4) - - Math.floor((year - 1901 + t) / 100) + - Math.floor((year - 1601 + t) / 400) + - 365 * (year - 1970) - ); - }; - - var toUTC = function toUTC(t) { - var s = 0; - var ms = t; - if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) { - // work around a Safari 8/9 bug where it treats the seconds as signed - var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit; - var sToShift = Math.floor(msToShift / 1e3); - s += sToShift; - ms -= sToShift * 1e3; - } - return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms)); - }; - - // Copy any custom methods a 3rd party library may have added - for (var key in NativeDate) { - if (owns(NativeDate, key)) { - DateShim[key] = NativeDate[key]; - } - } - - // Copy "native" methods explicitly; they may be non-enumerable - defineProperties(DateShim, { - now: NativeDate.now, - UTC: NativeDate.UTC - }, true); - DateShim.prototype = NativeDate.prototype; - defineProperties(DateShim.prototype, { - constructor: DateShim - }, true); - - // Upgrade Date.parse to handle simplified ISO 8601 strings - var parseShim = function parse(string) { - var match = isoDateExpression.exec(string); - if (match) { - // parse months, days, hours, minutes, seconds, and milliseconds - // provide default values if necessary - // parse the UTC offset component - var year = $Number(match[1]), - month = $Number(match[2] || 1) - 1, - day = $Number(match[3] || 1) - 1, - hour = $Number(match[4] || 0), - minute = $Number(match[5] || 0), - second = $Number(match[6] || 0), - millisecond = Math.floor($Number(match[7] || 0) * 1000), - // When time zone is missed, local offset should be used - // (ES 5.1 bug) - // see https://bugs.ecmascript.org/show_bug.cgi?id=112 - isLocalTime = Boolean(match[4] && !match[8]), - signOffset = match[9] === '-' ? 1 : -1, - hourOffset = $Number(match[10] || 0), - minuteOffset = $Number(match[11] || 0), - result; - var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0; - if ( - hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) && - minute < 60 && second < 60 && millisecond < 1000 && - month > -1 && month < 12 && hourOffset < 24 && - minuteOffset < 60 && // detect invalid offsets - day > -1 && - day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month)) - ) { - result = ( - (dayFromMonth(year, month) + day) * 24 + - hour + - hourOffset * signOffset - ) * 60; - result = ( - (result + minute + minuteOffset * signOffset) * 60 + - second - ) * 1000 + millisecond; - if (isLocalTime) { - result = toUTC(result); - } - if (-8.64e15 <= result && result <= 8.64e15) { - return result; - } - } - return NaN; - } - return NativeDate.parse.apply(this, arguments); - }; - defineProperties(DateShim, { parse: parseShim }); - - return DateShim; - }(Date)); - /* global Date: false */ - } - - // ES5 15.9.4.4 - // http://es5.github.com/#x15.9.4.4 - if (!Date.now) { - Date.now = function now() { - return new Date().getTime(); - }; - } - - // - // Number - // ====== - // - - // ES5.1 15.7.4.5 - // http://es5.github.com/#x15.7.4.5 - var hasToFixedBugs = NumberPrototype.toFixed && ( - (0.00008).toFixed(3) !== '0.000' || - (0.9).toFixed(0) !== '1' || - (1.255).toFixed(2) !== '1.25' || - (1000000000000000128).toFixed(0) !== '1000000000000000128' - ); - - var toFixedHelpers = { - base: 1e7, - size: 6, - data: [0, 0, 0, 0, 0, 0], - multiply: function multiply(n, c) { - var i = -1; - var c2 = c; - while (++i < toFixedHelpers.size) { - c2 += n * toFixedHelpers.data[i]; - toFixedHelpers.data[i] = c2 % toFixedHelpers.base; - c2 = Math.floor(c2 / toFixedHelpers.base); - } - }, - divide: function divide(n) { - var i = toFixedHelpers.size; - var c = 0; - while (--i >= 0) { - c += toFixedHelpers.data[i]; - toFixedHelpers.data[i] = Math.floor(c / n); - c = (c % n) * toFixedHelpers.base; - } - }, - numToString: function numToString() { - var i = toFixedHelpers.size; - var s = ''; - while (--i >= 0) { - if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) { - var t = $String(toFixedHelpers.data[i]); - if (s === '') { - s = t; - } else { - s += strSlice('0000000', 0, 7 - t.length) + t; - } - } - } - return s; - }, - pow: function pow(x, n, acc) { - return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc))); - }, - log: function log(x) { - var n = 0; - var x2 = x; - while (x2 >= 4096) { - n += 12; - x2 /= 4096; - } - while (x2 >= 2) { - n += 1; - x2 /= 2; - } - return n; - } - }; - - var toFixedShim = function toFixed(fractionDigits) { - var f, x, s, m, e, z, j, k; - - // Test for NaN and round fractionDigits down - f = $Number(fractionDigits); - f = isActualNaN(f) ? 0 : Math.floor(f); - - if (f < 0 || f > 20) { - throw new RangeError('Number.toFixed called with invalid number of decimals'); - } - - x = $Number(this); - - if (isActualNaN(x)) { - return 'NaN'; - } - - // If it is too big or small, return the string value of the number - if (x <= -1e21 || x >= 1e21) { - return $String(x); - } - - s = ''; - - if (x < 0) { - s = '-'; - x = -x; - } - - m = '0'; - - if (x > 1e-21) { - // 1e-21 < x < 1e21 - // -70 < log2(x) < 70 - e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69; - z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1)); - z *= 0x10000000000000; // Math.pow(2, 52); - e = 52 - e; - - // -18 < e < 122 - // x = z / 2 ^ e - if (e > 0) { - toFixedHelpers.multiply(0, z); - j = f; - - while (j >= 7) { - toFixedHelpers.multiply(1e7, 0); - j -= 7; - } - - toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0); - j = e - 1; - - while (j >= 23) { - toFixedHelpers.divide(1 << 23); - j -= 23; - } - - toFixedHelpers.divide(1 << j); - toFixedHelpers.multiply(1, 1); - toFixedHelpers.divide(2); - m = toFixedHelpers.numToString(); - } else { - toFixedHelpers.multiply(0, z); - toFixedHelpers.multiply(1 << (-e), 0); - m = toFixedHelpers.numToString() + strSlice('0.00000000000000000000', 2, 2 + f); - } - } - - if (f > 0) { - k = m.length; - - if (k <= f) { - m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m; - } else { - m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f); - } - } else { - m = s + m; - } - - return m; - }; - defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs); - - var hasToPrecisionUndefinedBug = (function () { - try { - return 1.0.toPrecision(undefined) === '1'; - } catch (e) { - return true; - } - }()); - var originalToPrecision = NumberPrototype.toPrecision; - defineProperties(NumberPrototype, { - toPrecision: function toPrecision(precision) { - return typeof precision === 'undefined' ? originalToPrecision.call(this) : originalToPrecision.call(this, precision); - } - }, hasToPrecisionUndefinedBug); - - // - // String - // ====== - // - - // ES5 15.5.4.14 - // http://es5.github.com/#x15.5.4.14 - - // [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers] - // Many browsers do not split properly with regular expressions or they - // do not perform the split correctly under obscure conditions. - // See http://blog.stevenlevithan.com/archives/cross-browser-split - // I've tested in many browsers and this seems to cover the deviant ones: - // 'ab'.split(/(?:ab)*/) should be ["", ""], not [""] - // '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""] - // 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not - // [undefined, "t", undefined, "e", ...] - // ''.split(/.?/) should be [], not [""] - // '.'.split(/()()/) should be ["."], not ["", "", "."] - - if ( - 'ab'.split(/(?:ab)*/).length !== 2 || - '.'.split(/(.?)(.?)/).length !== 4 || - 'tesst'.split(/(s)*/)[1] === 't' || - 'test'.split(/(?:)/, -1).length !== 4 || - ''.split(/.?/).length || - '.'.split(/()()/).length > 1 - ) { - (function () { - var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group - var maxSafe32BitInt = Math.pow(2, 32) - 1; - - StringPrototype.split = function (separator, limit) { - var string = String(this); - if (typeof separator === 'undefined' && limit === 0) { - return []; - } - - // If `separator` is not a regex, use native split - if (!isRegex(separator)) { - return strSplit(this, separator, limit); - } - - var output = []; - var flags = (separator.ignoreCase ? 'i' : '') + - (separator.multiline ? 'm' : '') + - (separator.unicode ? 'u' : '') + // in ES6 - (separator.sticky ? 'y' : ''), // Firefox 3+ and ES6 - lastLastIndex = 0, - // Make `global` and avoid `lastIndex` issues by working with a copy - separator2, match, lastIndex, lastLength; - var separatorCopy = new RegExp(separator.source, flags + 'g'); - if (!compliantExecNpcg) { - // Doesn't need flags gy, but they don't hurt - separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); - } - /* Values for `limit`, per the spec: - * If undefined: 4294967295 // maxSafe32BitInt - * If 0, Infinity, or NaN: 0 - * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296; - * If negative number: 4294967296 - Math.floor(Math.abs(limit)) - * If other: Type-convert, then use the above rules - */ - var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit); - match = separatorCopy.exec(string); - while (match) { - // `separatorCopy.lastIndex` is not reliable cross-browser - lastIndex = match.index + match[0].length; - if (lastIndex > lastLastIndex) { - pushCall(output, strSlice(string, lastLastIndex, match.index)); - // Fix browsers whose `exec` methods don't consistently return `undefined` for - // nonparticipating capturing groups - if (!compliantExecNpcg && match.length > 1) { - /* eslint-disable no-loop-func */ - match[0].replace(separator2, function () { - for (var i = 1; i < arguments.length - 2; i++) { - if (typeof arguments[i] === 'undefined') { - match[i] = void 0; - } - } - }); - /* eslint-enable no-loop-func */ - } - if (match.length > 1 && match.index < string.length) { - array_push.apply(output, arraySlice(match, 1)); - } - lastLength = match[0].length; - lastLastIndex = lastIndex; - if (output.length >= splitLimit) { - break; - } - } - if (separatorCopy.lastIndex === match.index) { - separatorCopy.lastIndex++; // Avoid an infinite loop - } - match = separatorCopy.exec(string); - } - if (lastLastIndex === string.length) { - if (lastLength || !separatorCopy.test('')) { - pushCall(output, ''); - } - } else { - pushCall(output, strSlice(string, lastLastIndex)); - } - return output.length > splitLimit ? arraySlice(output, 0, splitLimit) : output; - }; - }()); - - // [bugfix, chrome] - // If separator is undefined, then the result array contains just one String, - // which is the this value (converted to a String). If limit is not undefined, - // then the output array is truncated so that it contains no more than limit - // elements. - // "0".split(undefined, 0) -> [] - } else if ('0'.split(void 0, 0).length) { - StringPrototype.split = function split(separator, limit) { - if (typeof separator === 'undefined' && limit === 0) { - return []; - } - return strSplit(this, separator, limit); - }; - } - - var str_replace = StringPrototype.replace; - var replaceReportsGroupsCorrectly = (function () { - var groups = []; - 'x'.replace(/x(.)?/g, function (match, group) { - pushCall(groups, group); - }); - return groups.length === 1 && typeof groups[0] === 'undefined'; - }()); - - if (!replaceReportsGroupsCorrectly) { - StringPrototype.replace = function replace(searchValue, replaceValue) { - var isFn = isCallable(replaceValue); - var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source); - if (!isFn || !hasCapturingGroups) { - return str_replace.call(this, searchValue, replaceValue); - } else { - var wrappedReplaceValue = function (match) { - var length = arguments.length; - var originalLastIndex = searchValue.lastIndex; - searchValue.lastIndex = 0; - var args = searchValue.exec(match) || []; - searchValue.lastIndex = originalLastIndex; - pushCall(args, arguments[length - 2], arguments[length - 1]); - return replaceValue.apply(this, args); - }; - return str_replace.call(this, searchValue, wrappedReplaceValue); - } - }; - } - - // ECMA-262, 3rd B.2.3 - // Not an ECMAScript standard, although ECMAScript 3rd Edition has a - // non-normative section suggesting uniform semantics and it should be - // normalized across all browsers - // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE - var string_substr = StringPrototype.substr; - var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b'; - defineProperties(StringPrototype, { - substr: function substr(start, length) { - var normalizedStart = start; - if (start < 0) { - normalizedStart = max(this.length + start, 0); - } - return string_substr.call(this, normalizedStart, length); - } - }, hasNegativeSubstrBug); - - // ES5 15.5.4.20 - // whitespace from: http://es5.github.io/#x15.5.4.20 - var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028' + - '\u2029\uFEFF'; - var zeroWidth = '\u200b'; - var wsRegexChars = '[' + ws + ']'; - var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*'); - var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$'); - var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim()); - defineProperties(StringPrototype, { - // http://blog.stevenlevithan.com/archives/faster-trim-javascript - // http://perfectionkills.com/whitespace-deviations/ - trim: function trim() { - if (typeof this === 'undefined' || this === null) { - throw new TypeError("can't convert " + this + ' to object'); - } - return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, ''); - } - }, hasTrimWhitespaceBug); - var trim = call.bind(String.prototype.trim); - - var hasLastIndexBug = StringPrototype.lastIndexOf && 'abcあい'.lastIndexOf('あい', 2) !== -1; - defineProperties(StringPrototype, { - lastIndexOf: function lastIndexOf(searchString) { - if (typeof this === 'undefined' || this === null) { - throw new TypeError("can't convert " + this + ' to object'); - } - var S = $String(this); - var searchStr = $String(searchString); - var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN; - var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos); - var start = min(max(pos, 0), S.length); - var searchLen = searchStr.length; - var k = start + searchLen; - while (k > 0) { - k = max(0, k - searchLen); - var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr); - if (index !== -1) { - return k + index; - } - } - return -1; - } - }, hasLastIndexBug); - - var originalLastIndexOf = StringPrototype.lastIndexOf; - defineProperties(StringPrototype, { - lastIndexOf: function lastIndexOf(searchString) { - return originalLastIndexOf.apply(this, arguments); - } - }, StringPrototype.lastIndexOf.length !== 1); - - // ES-5 15.1.2.2 - /* eslint-disable radix */ - if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) { - /* eslint-enable radix */ - /* global parseInt: true */ - parseInt = (function (origParseInt) { - var hexRegex = /^[\-+]?0[xX]/; - return function parseInt(str, radix) { - var string = trim(String(str)); - var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); - return origParseInt(string, defaultedRadix); - }; - }(parseInt)); - } - - // https://es5.github.io/#x15.1.2.3 - if (1 / parseFloat('-0') !== -Infinity) { - /* global parseFloat: true */ - parseFloat = (function (origParseFloat) { - return function parseFloat(string) { - var inputString = trim(String(string)); - var result = origParseFloat(inputString); - return result === 0 && strSlice(inputString, 0, 1) === '-' ? -0 : result; - }; - }(parseFloat)); - } - - if (String(new RangeError('test')) !== 'RangeError: test') { - var errorToStringShim = function toString() { - if (typeof this === 'undefined' || this === null) { - throw new TypeError("can't convert " + this + ' to object'); - } - var name = this.name; - if (typeof name === 'undefined') { - name = 'Error'; - } else if (typeof name !== 'string') { - name = $String(name); - } - var msg = this.message; - if (typeof msg === 'undefined') { - msg = ''; - } else if (typeof msg !== 'string') { - msg = $String(msg); - } - if (!name) { - return msg; - } - if (!msg) { - return name; - } - return name + ': ' + msg; - }; - // can't use defineProperties here because of toString enumeration issue in IE <= 8 - Error.prototype.toString = errorToStringShim; - } - - if (supportsDescriptors) { - var ensureNonEnumerable = function (obj, prop) { - if (isEnum(obj, prop)) { - var desc = Object.getOwnPropertyDescriptor(obj, prop); - if (desc.configurable) { - desc.enumerable = false; - Object.defineProperty(obj, prop, desc); - } - } - }; - ensureNonEnumerable(Error.prototype, 'message'); - if (Error.prototype.message !== '') { - Error.prototype.message = ''; - } - ensureNonEnumerable(Error.prototype, 'name'); - } - - if (String(/a/mig) !== '/a/gim') { - var regexToString = function toString() { - var str = '/' + this.source + '/'; - if (this.global) { - str += 'g'; - } - if (this.ignoreCase) { - str += 'i'; - } - if (this.multiline) { - str += 'm'; - } - return str; - }; - // can't use defineProperties here because of toString enumeration issue in IE <= 8 - RegExp.prototype.toString = regexToString; - } -})); - - -/***/ }), -/* 337 */ -/***/ (function(module, exports, __webpack_require__) { - -var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - * https://github.com/es-shims/es5-shim - * @license es5-shim Copyright 2009-2015 by contributors, MIT License - * see https://github.com/es-shims/es5-shim/blob/master/LICENSE - */ - -// vim: ts=4 sts=4 sw=4 expandtab - -// Add semicolon to prevent IIFE from being passed as argument to concatenated code. -; - -// UMD (Universal Module Definition) -// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js -(function (root, factory) { - 'use strict'; - - /* global define, exports, module */ - if (true) { - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : - __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like enviroments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals (root is window) - root.returnExports = factory(); - } -}(this, function () { - - var call = Function.call; - var prototypeOfObject = Object.prototype; - var owns = call.bind(prototypeOfObject.hasOwnProperty); - var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable); - var toStr = call.bind(prototypeOfObject.toString); - - // If JS engine supports accessors creating shortcuts. - var defineGetter; - var defineSetter; - var lookupGetter; - var lookupSetter; - var supportsAccessors = owns(prototypeOfObject, '__defineGetter__'); - if (supportsAccessors) { - /* eslint-disable no-underscore-dangle */ - defineGetter = call.bind(prototypeOfObject.__defineGetter__); - defineSetter = call.bind(prototypeOfObject.__defineSetter__); - lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); - lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); - /* eslint-enable no-underscore-dangle */ - } - - var isPrimitive = function isPrimitive(o) { - return o == null || (typeof o !== 'object' && typeof o !== 'function'); - }; - - // ES5 15.2.3.2 - // http://es5.github.com/#x15.2.3.2 - if (!Object.getPrototypeOf) { - // https://github.com/es-shims/es5-shim/issues#issue/2 - // http://ejohn.org/blog/objectgetprototypeof/ - // recommended by fschaefer on github - // - // sure, and webreflection says ^_^ - // ... this will nerever possibly return null - // ... Opera Mini breaks here with infinite loops - Object.getPrototypeOf = function getPrototypeOf(object) { - /* eslint-disable no-proto */ - var proto = object.__proto__; - /* eslint-enable no-proto */ - if (proto || proto === null) { - return proto; - } else if (toStr(object.constructor) === '[object Function]') { - return object.constructor.prototype; - } else if (object instanceof Object) { - return prototypeOfObject; - } else { - // Correctly return null for Objects created with `Object.create(null)` - // (shammed or native) or `{ __proto__: null}`. Also returns null for - // cross-realm objects on browsers that lack `__proto__` support (like - // IE <11), but that's the best we can do. - return null; - } - }; - } - - // ES5 15.2.3.3 - // http://es5.github.com/#x15.2.3.3 - - var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) { - try { - object.sentinel = 0; - return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0; - } catch (exception) { - return false; - } - }; - - // check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially. - if (Object.defineProperty) { - var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({}); - var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' || - doesGetOwnPropertyDescriptorWork(document.createElement('div')); - if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) { - var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor; - } - } - - if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) { - var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: '; - - /* eslint-disable no-proto */ - Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { - if (isPrimitive(object)) { - throw new TypeError(ERR_NON_OBJECT + object); - } - - // make a valiant attempt to use the real getOwnPropertyDescriptor - // for I8's DOM elements. - if (getOwnPropertyDescriptorFallback) { - try { - return getOwnPropertyDescriptorFallback.call(Object, object, property); - } catch (exception) { - // try the shim if the real one doesn't work - } - } - - var descriptor; - - // If object does not owns property return undefined immediately. - if (!owns(object, property)) { - return descriptor; - } - - // If object has a property then it's for sure `configurable`, and - // probably `enumerable`. Detect enumerability though. - descriptor = { - enumerable: isEnumerable(object, property), - configurable: true - }; - - // If JS engine supports accessor properties then property may be a - // getter or setter. - if (supportsAccessors) { - // Unfortunately `__lookupGetter__` will return a getter even - // if object has own non getter property along with a same named - // inherited getter. To avoid misbehavior we temporary remove - // `__proto__` so that `__lookupGetter__` will return getter only - // if it's owned by an object. - var prototype = object.__proto__; - var notPrototypeOfObject = object !== prototypeOfObject; - // avoid recursion problem, breaking in Opera Mini when - // Object.getOwnPropertyDescriptor(Object.prototype, 'toString') - // or any other Object.prototype accessor - if (notPrototypeOfObject) { - object.__proto__ = prototypeOfObject; - } - - var getter = lookupGetter(object, property); - var setter = lookupSetter(object, property); - - if (notPrototypeOfObject) { - // Once we have getter and setter we can put values back. - object.__proto__ = prototype; - } - - if (getter || setter) { - if (getter) { - descriptor.get = getter; - } - if (setter) { - descriptor.set = setter; - } - // If it was accessor property we're done and return here - // in order to avoid adding `value` to the descriptor. - return descriptor; - } - } - - // If we got this far we know that object has an own property that is - // not an accessor so we set it as a value and return descriptor. - descriptor.value = object[property]; - descriptor.writable = true; - return descriptor; - }; - /* eslint-enable no-proto */ - } - - // ES5 15.2.3.4 - // http://es5.github.com/#x15.2.3.4 - if (!Object.getOwnPropertyNames) { - Object.getOwnPropertyNames = function getOwnPropertyNames(object) { - return Object.keys(object); - }; - } - - // ES5 15.2.3.5 - // http://es5.github.com/#x15.2.3.5 - if (!Object.create) { - - // Contributed by Brandon Benvie, October, 2012 - var createEmpty; - var supportsProto = !({ __proto__: null } instanceof Object); - // the following produces false positives - // in Opera Mini => not a reliable check - // Object.prototype.__proto__ === null - - // Check for document.domain and active x support - // No need to use active x approach when document.domain is not set - // see https://github.com/es-shims/es5-shim/issues/150 - // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 - /* global ActiveXObject */ - var shouldUseActiveX = function shouldUseActiveX() { - // return early if document.domain not set - if (!document.domain) { - return false; - } - - try { - return !!new ActiveXObject('htmlfile'); - } catch (exception) { - return false; - } - }; - - // This supports IE8 when document.domain is used - // see https://github.com/es-shims/es5-shim/issues/150 - // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 - var getEmptyViaActiveX = function getEmptyViaActiveX() { - var empty; - var xDoc; - - xDoc = new ActiveXObject('htmlfile'); - - var script = 'script'; - xDoc.write('<' + script + '></' + script + '>'); - xDoc.close(); - - empty = xDoc.parentWindow.Object.prototype; - xDoc = null; - - return empty; - }; - - // The original implementation using an iframe - // before the activex approach was added - // see https://github.com/es-shims/es5-shim/issues/150 - var getEmptyViaIFrame = function getEmptyViaIFrame() { - var iframe = document.createElement('iframe'); - var parent = document.body || document.documentElement; - var empty; - - iframe.style.display = 'none'; - parent.appendChild(iframe); - /* eslint-disable no-script-url */ - iframe.src = 'javascript:'; - /* eslint-enable no-script-url */ - - empty = iframe.contentWindow.Object.prototype; - parent.removeChild(iframe); - iframe = null; - - return empty; - }; - - /* global document */ - if (supportsProto || typeof document === 'undefined') { - createEmpty = function () { - return { __proto__: null }; - }; - } else { - // In old IE __proto__ can't be used to manually set `null`, nor does - // any other method exist to make an object that inherits from nothing, - // aside from Object.prototype itself. Instead, create a new global - // object and *steal* its Object.prototype and strip it bare. This is - // used as the prototype to create nullary objects. - createEmpty = function () { - // Determine which approach to use - // see https://github.com/es-shims/es5-shim/issues/150 - var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame(); - - delete empty.constructor; - delete empty.hasOwnProperty; - delete empty.propertyIsEnumerable; - delete empty.isPrototypeOf; - delete empty.toLocaleString; - delete empty.toString; - delete empty.valueOf; - - var Empty = function Empty() {}; - Empty.prototype = empty; - // short-circuit future calls - createEmpty = function () { - return new Empty(); - }; - return new Empty(); - }; - } - - Object.create = function create(prototype, properties) { - - var object; - var Type = function Type() {}; // An empty constructor. - - if (prototype === null) { - object = createEmpty(); - } else { - if (prototype !== null && isPrimitive(prototype)) { - // In the native implementation `parent` can be `null` - // OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc) - // Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object` - // like they are in modern browsers. Using `Object.create` on DOM elements - // is...err...probably inappropriate, but the native version allows for it. - throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome - } - Type.prototype = prototype; - object = new Type(); - // IE has no built-in implementation of `Object.getPrototypeOf` - // neither `__proto__`, but this manually setting `__proto__` will - // guarantee that `Object.getPrototypeOf` will work as expected with - // objects created using `Object.create` - /* eslint-disable no-proto */ - object.__proto__ = prototype; - /* eslint-enable no-proto */ - } - - if (properties !== void 0) { - Object.defineProperties(object, properties); - } - - return object; - }; - } - - // ES5 15.2.3.6 - // http://es5.github.com/#x15.2.3.6 - - // Patch for WebKit and IE8 standard mode - // Designed by hax <hax.github.com> - // related issue: https://github.com/es-shims/es5-shim/issues#issue/5 - // IE8 Reference: - // http://msdn.microsoft.com/en-us/library/dd282900.aspx - // http://msdn.microsoft.com/en-us/library/dd229916.aspx - // WebKit Bugs: - // https://bugs.webkit.org/show_bug.cgi?id=36423 - - var doesDefinePropertyWork = function doesDefinePropertyWork(object) { - try { - Object.defineProperty(object, 'sentinel', {}); - return 'sentinel' in object; - } catch (exception) { - return false; - } - }; - - // check whether defineProperty works if it's given. Otherwise, - // shim partially. - if (Object.defineProperty) { - var definePropertyWorksOnObject = doesDefinePropertyWork({}); - var definePropertyWorksOnDom = typeof document === 'undefined' || - doesDefinePropertyWork(document.createElement('div')); - if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { - var definePropertyFallback = Object.defineProperty, - definePropertiesFallback = Object.defineProperties; - } - } - - if (!Object.defineProperty || definePropertyFallback) { - var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: '; - var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: '; - var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine'; - - Object.defineProperty = function defineProperty(object, property, descriptor) { - if (isPrimitive(object)) { - throw new TypeError(ERR_NON_OBJECT_TARGET + object); - } - if (isPrimitive(descriptor)) { - throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); - } - // make a valiant attempt to use the real defineProperty - // for I8's DOM elements. - if (definePropertyFallback) { - try { - return definePropertyFallback.call(Object, object, property, descriptor); - } catch (exception) { - // try the shim if the real one doesn't work - } - } - - // If it's a data property. - if ('value' in descriptor) { - // fail silently if 'writable', 'enumerable', or 'configurable' - // are requested but not supported - /* - // alternate approach: - if ( // can't implement these features; allow false but not true - ('writable' in descriptor && !descriptor.writable) || - ('enumerable' in descriptor && !descriptor.enumerable) || - ('configurable' in descriptor && !descriptor.configurable) - )) - throw new RangeError( - 'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.' - ); - */ - - if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) { - // As accessors are supported only on engines implementing - // `__proto__` we can safely override `__proto__` while defining - // a property to make sure that we don't hit an inherited - // accessor. - /* eslint-disable no-proto */ - var prototype = object.__proto__; - object.__proto__ = prototypeOfObject; - // Deleting a property anyway since getter / setter may be - // defined on object itself. - delete object[property]; - object[property] = descriptor.value; - // Setting original `__proto__` back now. - object.__proto__ = prototype; - /* eslint-enable no-proto */ - } else { - object[property] = descriptor.value; - } - } else { - var hasGetter = 'get' in descriptor; - var hasSetter = 'set' in descriptor; - if (!supportsAccessors && (hasGetter || hasSetter)) { - throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); - } - // If we got that far then getters and setters can be defined !! - if (hasGetter) { - defineGetter(object, property, descriptor.get); - } - if (hasSetter) { - defineSetter(object, property, descriptor.set); - } - } - return object; - }; - } - - // ES5 15.2.3.7 - // http://es5.github.com/#x15.2.3.7 - if (!Object.defineProperties || definePropertiesFallback) { - Object.defineProperties = function defineProperties(object, properties) { - // make a valiant attempt to use the real defineProperties - if (definePropertiesFallback) { - try { - return definePropertiesFallback.call(Object, object, properties); - } catch (exception) { - // try the shim if the real one doesn't work - } - } - - Object.keys(properties).forEach(function (property) { - if (property !== '__proto__') { - Object.defineProperty(object, property, properties[property]); - } - }); - return object; - }; - } - - // ES5 15.2.3.8 - // http://es5.github.com/#x15.2.3.8 - if (!Object.seal) { - Object.seal = function seal(object) { - if (Object(object) !== object) { - throw new TypeError('Object.seal can only be called on Objects.'); - } - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; - } - - // ES5 15.2.3.9 - // http://es5.github.com/#x15.2.3.9 - if (!Object.freeze) { - Object.freeze = function freeze(object) { - if (Object(object) !== object) { - throw new TypeError('Object.freeze can only be called on Objects.'); - } - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; - } - - // detect a Rhino bug and patch it - try { - Object.freeze(function () {}); - } catch (exception) { - Object.freeze = (function (freezeObject) { - return function freeze(object) { - if (typeof object === 'function') { - return object; - } else { - return freezeObject(object); - } - }; - }(Object.freeze)); - } - - // ES5 15.2.3.10 - // http://es5.github.com/#x15.2.3.10 - if (!Object.preventExtensions) { - Object.preventExtensions = function preventExtensions(object) { - if (Object(object) !== object) { - throw new TypeError('Object.preventExtensions can only be called on Objects.'); - } - // this is misleading and breaks feature-detection, but - // allows "securable" code to "gracefully" degrade to working - // but insecure code. - return object; - }; - } - - // ES5 15.2.3.11 - // http://es5.github.com/#x15.2.3.11 - if (!Object.isSealed) { - Object.isSealed = function isSealed(object) { - if (Object(object) !== object) { - throw new TypeError('Object.isSealed can only be called on Objects.'); - } - return false; - }; - } - - // ES5 15.2.3.12 - // http://es5.github.com/#x15.2.3.12 - if (!Object.isFrozen) { - Object.isFrozen = function isFrozen(object) { - if (Object(object) !== object) { - throw new TypeError('Object.isFrozen can only be called on Objects.'); - } - return false; - }; - } - - // ES5 15.2.3.13 - // http://es5.github.com/#x15.2.3.13 - if (!Object.isExtensible) { - Object.isExtensible = function isExtensible(object) { - // 1. If Type(O) is not Object throw a TypeError exception. - if (Object(object) !== object) { - throw new TypeError('Object.isExtensible can only be called on Objects.'); - } - // 2. Return the Boolean value of the [[Extensible]] internal property of O. - var name = ''; - while (owns(object, name)) { - name += '?'; - } - object[name] = true; - var returnValue = owns(object, name); - delete object[name]; - return returnValue; - }; - } - -})); - - -/***/ }), -/* 338 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -__webpack_require__(339); - -__webpack_require__(340)(); - -__webpack_require__(347); - - -/***/ }), -/* 339 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global, process) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__; /*! - * https://github.com/paulmillr/es6-shim - * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) - * and contributors, MIT License - * es6-shim: v0.35.1 - * see https://github.com/paulmillr/es6-shim/blob/0.35.1/LICENSE - * Details and documentation: - * https://github.com/paulmillr/es6-shim/ - */ - -// UMD (Universal Module Definition) -// see https://github.com/umdjs/umd/blob/master/returnExports.js -(function (root, factory) { - /*global define, module, exports */ - if (true) { - // AMD. Register as an anonymous module. - !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), - __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? - (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : - __WEBPACK_AMD_DEFINE_FACTORY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals (root is window) - root.returnExports = factory(); - } -}(this, function () { - 'use strict'; - - var _apply = Function.call.bind(Function.apply); - var _call = Function.call.bind(Function.call); - var isArray = Array.isArray; - var keys = Object.keys; - - var not = function notThunker(func) { - return function notThunk() { - return !_apply(func, this, arguments); - }; - }; - var throwsError = function (func) { - try { - func(); - return false; - } catch (e) { - return true; - } - }; - var valueOrFalseIfThrows = function valueOrFalseIfThrows(func) { - try { - return func(); - } catch (e) { - return false; - } - }; - - var isCallableWithoutNew = not(throwsError); - var arePropertyDescriptorsSupported = function () { - // if Object.defineProperty exists but throws, it's IE 8 - return !throwsError(function () { - Object.defineProperty({}, 'x', { get: function () {} }); - }); - }; - var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported(); - var functionsHaveNames = (function foo() {}).name === 'foo'; // eslint-disable-line no-extra-parens - - var _forEach = Function.call.bind(Array.prototype.forEach); - var _reduce = Function.call.bind(Array.prototype.reduce); - var _filter = Function.call.bind(Array.prototype.filter); - var _some = Function.call.bind(Array.prototype.some); - - var defineProperty = function (object, name, value, force) { - if (!force && name in object) { return; } - if (supportsDescriptors) { - Object.defineProperty(object, name, { - configurable: true, - enumerable: false, - writable: true, - value: value - }); - } else { - object[name] = value; - } - }; - - // Define configurable, writable and non-enumerable props - // if they don’t exist. - var defineProperties = function (object, map, forceOverride) { - _forEach(keys(map), function (name) { - var method = map[name]; - defineProperty(object, name, method, !!forceOverride); - }); - }; - - var _toString = Function.call.bind(Object.prototype.toString); - var isCallable = false ? function IsCallableSlow(x) { - // Some old browsers (IE, FF) say that typeof /abc/ === 'function' - return typeof x === 'function' && _toString(x) === '[object Function]'; - } : function IsCallableFast(x) { return typeof x === 'function'; }; - - var Value = { - getter: function (object, name, getter) { - if (!supportsDescriptors) { - throw new TypeError('getters require true ES5 support'); - } - Object.defineProperty(object, name, { - configurable: true, - enumerable: false, - get: getter - }); - }, - proxy: function (originalObject, key, targetObject) { - if (!supportsDescriptors) { - throw new TypeError('getters require true ES5 support'); - } - var originalDescriptor = Object.getOwnPropertyDescriptor(originalObject, key); - Object.defineProperty(targetObject, key, { - configurable: originalDescriptor.configurable, - enumerable: originalDescriptor.enumerable, - get: function getKey() { return originalObject[key]; }, - set: function setKey(value) { originalObject[key] = value; } - }); - }, - redefine: function (object, property, newValue) { - if (supportsDescriptors) { - var descriptor = Object.getOwnPropertyDescriptor(object, property); - descriptor.value = newValue; - Object.defineProperty(object, property, descriptor); - } else { - object[property] = newValue; - } - }, - defineByDescriptor: function (object, property, descriptor) { - if (supportsDescriptors) { - Object.defineProperty(object, property, descriptor); - } else if ('value' in descriptor) { - object[property] = descriptor.value; - } - }, - preserveToString: function (target, source) { - if (source && isCallable(source.toString)) { - defineProperty(target, 'toString', source.toString.bind(source), true); - } - } - }; - - // Simple shim for Object.create on ES3 browsers - // (unlike real shim, no attempt to support `prototype === null`) - var create = Object.create || function (prototype, properties) { - var Prototype = function Prototype() {}; - Prototype.prototype = prototype; - var object = new Prototype(); - if (typeof properties !== 'undefined') { - keys(properties).forEach(function (key) { - Value.defineByDescriptor(object, key, properties[key]); - }); - } - return object; - }; - - var supportsSubclassing = function (C, f) { - if (!Object.setPrototypeOf) { return false; /* skip test on IE < 11 */ } - return valueOrFalseIfThrows(function () { - var Sub = function Subclass(arg) { - var o = new C(arg); - Object.setPrototypeOf(o, Subclass.prototype); - return o; - }; - Object.setPrototypeOf(Sub, C); - Sub.prototype = create(C.prototype, { - constructor: { value: Sub } - }); - return f(Sub); - }); - }; - - var getGlobal = function () { - /* global self, window, global */ - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { return self; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - throw new Error('unable to locate global object'); - }; - - var globals = getGlobal(); - var globalIsFinite = globals.isFinite; - var _indexOf = Function.call.bind(String.prototype.indexOf); - var _arrayIndexOfApply = Function.apply.bind(Array.prototype.indexOf); - var _concat = Function.call.bind(Array.prototype.concat); - // var _sort = Function.call.bind(Array.prototype.sort); - var _strSlice = Function.call.bind(String.prototype.slice); - var _push = Function.call.bind(Array.prototype.push); - var _pushApply = Function.apply.bind(Array.prototype.push); - var _shift = Function.call.bind(Array.prototype.shift); - var _max = Math.max; - var _min = Math.min; - var _floor = Math.floor; - var _abs = Math.abs; - var _exp = Math.exp; - var _log = Math.log; - var _sqrt = Math.sqrt; - var _hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); - var ArrayIterator; // make our implementation private - var noop = function () {}; - - var OrigMap = globals.Map; - var origMapDelete = OrigMap && OrigMap.prototype['delete']; - var origMapGet = OrigMap && OrigMap.prototype.get; - var origMapHas = OrigMap && OrigMap.prototype.has; - var origMapSet = OrigMap && OrigMap.prototype.set; - - var Symbol = globals.Symbol || {}; - var symbolSpecies = Symbol.species || '@@species'; - - var numberIsNaN = Number.isNaN || function isNaN(value) { - // NaN !== NaN, but they are identical. - // NaNs are the only non-reflexive value, i.e., if x !== x, - // then x is NaN. - // isNaN is broken: it converts its argument to number, so - // isNaN('foo') => true - return value !== value; - }; - var numberIsFinite = Number.isFinite || function isFinite(value) { - return typeof value === 'number' && globalIsFinite(value); - }; - var _sign = isCallable(Math.sign) ? Math.sign : function sign(value) { - var number = Number(value); - if (number === 0) { return number; } - if (numberIsNaN(number)) { return number; } - return number < 0 ? -1 : 1; - }; - - // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js - // can be replaced with require('is-arguments') if we ever use a build process instead - var isStandardArguments = function isArguments(value) { - return _toString(value) === '[object Arguments]'; - }; - var isLegacyArguments = function isArguments(value) { - return value !== null && - typeof value === 'object' && - typeof value.length === 'number' && - value.length >= 0 && - _toString(value) !== '[object Array]' && - _toString(value.callee) === '[object Function]'; - }; - var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments; - - var Type = { - primitive: function (x) { return x === null || (typeof x !== 'function' && typeof x !== 'object'); }, - string: function (x) { return _toString(x) === '[object String]'; }, - regex: function (x) { return _toString(x) === '[object RegExp]'; }, - symbol: function (x) { - return typeof globals.Symbol === 'function' && typeof x === 'symbol'; - } - }; - - var overrideNative = function overrideNative(object, property, replacement) { - var original = object[property]; - defineProperty(object, property, replacement, true); - Value.preserveToString(object[property], original); - }; - - // eslint-disable-next-line no-restricted-properties - var hasSymbols = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' && Type.symbol(Symbol()); - - // This is a private name in the es6 spec, equal to '[Symbol.iterator]' - // we're going to use an arbitrary _-prefixed name to make our shims - // work properly with each other, even though we don't have full Iterator - // support. That is, `Array.from(map.keys())` will work, but we don't - // pretend to export a "real" Iterator interface. - var $iterator$ = Type.symbol(Symbol.iterator) ? Symbol.iterator : '_es6-shim iterator_'; - // Firefox ships a partial implementation using the name @@iterator. - // https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14 - // So use that name if we detect it. - if (globals.Set && typeof new globals.Set()['@@iterator'] === 'function') { - $iterator$ = '@@iterator'; - } - - // Reflect - if (!globals.Reflect) { - defineProperty(globals, 'Reflect', {}, true); - } - var Reflect = globals.Reflect; - - var $String = String; - - /* global document */ - var domAll = (typeof document === 'undefined' || !document) ? null : document.all; - /* jshint eqnull:true */ - var isNullOrUndefined = domAll == null ? function isNullOrUndefined(x) { - /* jshint eqnull:true */ - return x == null; - } : function isNullOrUndefinedAndNotDocumentAll(x) { - /* jshint eqnull:true */ - return x == null && x !== domAll; - }; - - var ES = { - // http://www.ecma-international.org/ecma-262/6.0/#sec-call - Call: function Call(F, V) { - var args = arguments.length > 2 ? arguments[2] : []; - if (!ES.IsCallable(F)) { - throw new TypeError(F + ' is not a function'); - } - return _apply(F, V, args); - }, - - RequireObjectCoercible: function (x, optMessage) { - if (isNullOrUndefined(x)) { - throw new TypeError(optMessage || 'Cannot call method on ' + x); - } - return x; - }, - - // This might miss the "(non-standard exotic and does not implement - // [[Call]])" case from - // http://www.ecma-international.org/ecma-262/6.0/#sec-typeof-operator-runtime-semantics-evaluation - // but we can't find any evidence these objects exist in practice. - // If we find some in the future, you could test `Object(x) === x`, - // which is reliable according to - // http://www.ecma-international.org/ecma-262/6.0/#sec-toobject - // but is not well optimized by runtimes and creates an object - // whenever it returns false, and thus is very slow. - TypeIsObject: function (x) { - if (x === void 0 || x === null || x === true || x === false) { - return false; - } - return typeof x === 'function' || typeof x === 'object' || x === domAll; - }, - - ToObject: function (o, optMessage) { - return Object(ES.RequireObjectCoercible(o, optMessage)); - }, - - IsCallable: isCallable, - - IsConstructor: function (x) { - // We can't tell callables from constructors in ES5 - return ES.IsCallable(x); - }, - - ToInt32: function (x) { - return ES.ToNumber(x) >> 0; - }, - - ToUint32: function (x) { - return ES.ToNumber(x) >>> 0; - }, - - ToNumber: function (value) { - if (_toString(value) === '[object Symbol]') { - throw new TypeError('Cannot convert a Symbol value to a number'); - } - return +value; - }, - - ToInteger: function (value) { - var number = ES.ToNumber(value); - if (numberIsNaN(number)) { return 0; } - if (number === 0 || !numberIsFinite(number)) { return number; } - return (number > 0 ? 1 : -1) * _floor(_abs(number)); - }, - - ToLength: function (value) { - var len = ES.ToInteger(value); - if (len <= 0) { return 0; } // includes converting -0 to +0 - if (len > Number.MAX_SAFE_INTEGER) { return Number.MAX_SAFE_INTEGER; } - return len; - }, - - SameValue: function (a, b) { - if (a === b) { - // 0 === -0, but they are not identical. - if (a === 0) { return 1 / a === 1 / b; } - return true; - } - return numberIsNaN(a) && numberIsNaN(b); - }, - - SameValueZero: function (a, b) { - // same as SameValue except for SameValueZero(+0, -0) == true - return (a === b) || (numberIsNaN(a) && numberIsNaN(b)); - }, - - IsIterable: function (o) { - return ES.TypeIsObject(o) && (typeof o[$iterator$] !== 'undefined' || isArguments(o)); - }, - - GetIterator: function (o) { - if (isArguments(o)) { - // special case support for `arguments` - return new ArrayIterator(o, 'value'); - } - var itFn = ES.GetMethod(o, $iterator$); - if (!ES.IsCallable(itFn)) { - // Better diagnostics if itFn is null or undefined - throw new TypeError('value is not an iterable'); - } - var it = ES.Call(itFn, o); - if (!ES.TypeIsObject(it)) { - throw new TypeError('bad iterator'); - } - return it; - }, - - GetMethod: function (o, p) { - var func = ES.ToObject(o)[p]; - if (isNullOrUndefined(func)) { - return void 0; - } - if (!ES.IsCallable(func)) { - throw new TypeError('Method not callable: ' + p); - } - return func; - }, - - IteratorComplete: function (iterResult) { - return !!iterResult.done; - }, - - IteratorClose: function (iterator, completionIsThrow) { - var returnMethod = ES.GetMethod(iterator, 'return'); - if (returnMethod === void 0) { - return; - } - var innerResult, innerException; - try { - innerResult = ES.Call(returnMethod, iterator); - } catch (e) { - innerException = e; - } - if (completionIsThrow) { - return; - } - if (innerException) { - throw innerException; - } - if (!ES.TypeIsObject(innerResult)) { - throw new TypeError("Iterator's return method returned a non-object."); - } - }, - - IteratorNext: function (it) { - var result = arguments.length > 1 ? it.next(arguments[1]) : it.next(); - if (!ES.TypeIsObject(result)) { - throw new TypeError('bad iterator'); - } - return result; - }, - - IteratorStep: function (it) { - var result = ES.IteratorNext(it); - var done = ES.IteratorComplete(result); - return done ? false : result; - }, - - Construct: function (C, args, newTarget, isES6internal) { - var target = typeof newTarget === 'undefined' ? C : newTarget; - - if (!isES6internal && Reflect.construct) { - // Try to use Reflect.construct if available - return Reflect.construct(C, args, target); - } - // OK, we have to fake it. This will only work if the - // C.[[ConstructorKind]] == "base" -- but that's the only - // kind we can make in ES5 code anyway. - - // OrdinaryCreateFromConstructor(target, "%ObjectPrototype%") - var proto = target.prototype; - if (!ES.TypeIsObject(proto)) { - proto = Object.prototype; - } - var obj = create(proto); - // Call the constructor. - var result = ES.Call(C, obj, args); - return ES.TypeIsObject(result) ? result : obj; - }, - - SpeciesConstructor: function (O, defaultConstructor) { - var C = O.constructor; - if (C === void 0) { - return defaultConstructor; - } - if (!ES.TypeIsObject(C)) { - throw new TypeError('Bad constructor'); - } - var S = C[symbolSpecies]; - if (isNullOrUndefined(S)) { - return defaultConstructor; - } - if (!ES.IsConstructor(S)) { - throw new TypeError('Bad @@species'); - } - return S; - }, - - CreateHTML: function (string, tag, attribute, value) { - var S = ES.ToString(string); - var p1 = '<' + tag; - if (attribute !== '') { - var V = ES.ToString(value); - var escapedV = V.replace(/"/g, '"'); - p1 += ' ' + attribute + '="' + escapedV + '"'; - } - var p2 = p1 + '>'; - var p3 = p2 + S; - return p3 + '</' + tag + '>'; - }, - - IsRegExp: function IsRegExp(argument) { - if (!ES.TypeIsObject(argument)) { - return false; - } - var isRegExp = argument[Symbol.match]; - if (typeof isRegExp !== 'undefined') { - return !!isRegExp; - } - return Type.regex(argument); - }, - - ToString: function ToString(string) { - return $String(string); - } - }; - - // Well-known Symbol shims - if (supportsDescriptors && hasSymbols) { - var defineWellKnownSymbol = function defineWellKnownSymbol(name) { - if (Type.symbol(Symbol[name])) { - return Symbol[name]; - } - // eslint-disable-next-line no-restricted-properties - var sym = Symbol['for']('Symbol.' + name); - Object.defineProperty(Symbol, name, { - configurable: false, - enumerable: false, - writable: false, - value: sym - }); - return sym; - }; - if (!Type.symbol(Symbol.search)) { - var symbolSearch = defineWellKnownSymbol('search'); - var originalSearch = String.prototype.search; - defineProperty(RegExp.prototype, symbolSearch, function search(string) { - return ES.Call(originalSearch, string, [this]); - }); - var searchShim = function search(regexp) { - var O = ES.RequireObjectCoercible(this); - if (!isNullOrUndefined(regexp)) { - var searcher = ES.GetMethod(regexp, symbolSearch); - if (typeof searcher !== 'undefined') { - return ES.Call(searcher, regexp, [O]); - } - } - return ES.Call(originalSearch, O, [ES.ToString(regexp)]); - }; - overrideNative(String.prototype, 'search', searchShim); - } - if (!Type.symbol(Symbol.replace)) { - var symbolReplace = defineWellKnownSymbol('replace'); - var originalReplace = String.prototype.replace; - defineProperty(RegExp.prototype, symbolReplace, function replace(string, replaceValue) { - return ES.Call(originalReplace, string, [this, replaceValue]); - }); - var replaceShim = function replace(searchValue, replaceValue) { - var O = ES.RequireObjectCoercible(this); - if (!isNullOrUndefined(searchValue)) { - var replacer = ES.GetMethod(searchValue, symbolReplace); - if (typeof replacer !== 'undefined') { - return ES.Call(replacer, searchValue, [O, replaceValue]); - } - } - return ES.Call(originalReplace, O, [ES.ToString(searchValue), replaceValue]); - }; - overrideNative(String.prototype, 'replace', replaceShim); - } - if (!Type.symbol(Symbol.split)) { - var symbolSplit = defineWellKnownSymbol('split'); - var originalSplit = String.prototype.split; - defineProperty(RegExp.prototype, symbolSplit, function split(string, limit) { - return ES.Call(originalSplit, string, [this, limit]); - }); - var splitShim = function split(separator, limit) { - var O = ES.RequireObjectCoercible(this); - if (!isNullOrUndefined(separator)) { - var splitter = ES.GetMethod(separator, symbolSplit); - if (typeof splitter !== 'undefined') { - return ES.Call(splitter, separator, [O, limit]); - } - } - return ES.Call(originalSplit, O, [ES.ToString(separator), limit]); - }; - overrideNative(String.prototype, 'split', splitShim); - } - var symbolMatchExists = Type.symbol(Symbol.match); - var stringMatchIgnoresSymbolMatch = symbolMatchExists && (function () { - // Firefox 41, through Nightly 45 has Symbol.match, but String#match ignores it. - // Firefox 40 and below have Symbol.match but String#match works fine. - var o = {}; - o[Symbol.match] = function () { return 42; }; - return 'a'.match(o) !== 42; - }()); - if (!symbolMatchExists || stringMatchIgnoresSymbolMatch) { - var symbolMatch = defineWellKnownSymbol('match'); - - var originalMatch = String.prototype.match; - defineProperty(RegExp.prototype, symbolMatch, function match(string) { - return ES.Call(originalMatch, string, [this]); - }); - - var matchShim = function match(regexp) { - var O = ES.RequireObjectCoercible(this); - if (!isNullOrUndefined(regexp)) { - var matcher = ES.GetMethod(regexp, symbolMatch); - if (typeof matcher !== 'undefined') { - return ES.Call(matcher, regexp, [O]); - } - } - return ES.Call(originalMatch, O, [ES.ToString(regexp)]); - }; - overrideNative(String.prototype, 'match', matchShim); - } - } - - var wrapConstructor = function wrapConstructor(original, replacement, keysToSkip) { - Value.preserveToString(replacement, original); - if (Object.setPrototypeOf) { - // sets up proper prototype chain where possible - Object.setPrototypeOf(original, replacement); - } - if (supportsDescriptors) { - _forEach(Object.getOwnPropertyNames(original), function (key) { - if (key in noop || keysToSkip[key]) { return; } - Value.proxy(original, key, replacement); - }); - } else { - _forEach(Object.keys(original), function (key) { - if (key in noop || keysToSkip[key]) { return; } - replacement[key] = original[key]; - }); - } - replacement.prototype = original.prototype; - Value.redefine(original.prototype, 'constructor', replacement); - }; - - var defaultSpeciesGetter = function () { return this; }; - var addDefaultSpecies = function (C) { - if (supportsDescriptors && !_hasOwnProperty(C, symbolSpecies)) { - Value.getter(C, symbolSpecies, defaultSpeciesGetter); - } - }; - - var addIterator = function (prototype, impl) { - var implementation = impl || function iterator() { return this; }; - defineProperty(prototype, $iterator$, implementation); - if (!prototype[$iterator$] && Type.symbol($iterator$)) { - // implementations are buggy when $iterator$ is a Symbol - prototype[$iterator$] = implementation; - } - }; - - var createDataProperty = function createDataProperty(object, name, value) { - if (supportsDescriptors) { - Object.defineProperty(object, name, { - configurable: true, - enumerable: true, - writable: true, - value: value - }); - } else { - object[name] = value; - } - }; - var createDataPropertyOrThrow = function createDataPropertyOrThrow(object, name, value) { - createDataProperty(object, name, value); - if (!ES.SameValue(object[name], value)) { - throw new TypeError('property is nonconfigurable'); - } - }; - - var emulateES6construct = function (o, defaultNewTarget, defaultProto, slots) { - // This is an es5 approximation to es6 construct semantics. in es6, - // 'new Foo' invokes Foo.[[Construct]] which (for almost all objects) - // just sets the internal variable NewTarget (in es6 syntax `new.target`) - // to Foo and then returns Foo(). - - // Many ES6 object then have constructors of the form: - // 1. If NewTarget is undefined, throw a TypeError exception - // 2. Let xxx by OrdinaryCreateFromConstructor(NewTarget, yyy, zzz) - - // So we're going to emulate those first two steps. - if (!ES.TypeIsObject(o)) { - throw new TypeError('Constructor requires `new`: ' + defaultNewTarget.name); - } - var proto = defaultNewTarget.prototype; - if (!ES.TypeIsObject(proto)) { - proto = defaultProto; - } - var obj = create(proto); - for (var name in slots) { - if (_hasOwnProperty(slots, name)) { - var value = slots[name]; - defineProperty(obj, name, value, true); - } - } - return obj; - }; - - // Firefox 31 reports this function's length as 0 - // https://bugzilla.mozilla.org/show_bug.cgi?id=1062484 - if (String.fromCodePoint && String.fromCodePoint.length !== 1) { - var originalFromCodePoint = String.fromCodePoint; - overrideNative(String, 'fromCodePoint', function fromCodePoint(codePoints) { - return ES.Call(originalFromCodePoint, this, arguments); - }); - } - - var StringShims = { - fromCodePoint: function fromCodePoint(codePoints) { - var result = []; - var next; - for (var i = 0, length = arguments.length; i < length; i++) { - next = Number(arguments[i]); - if (!ES.SameValue(next, ES.ToInteger(next)) || next < 0 || next > 0x10FFFF) { - throw new RangeError('Invalid code point ' + next); - } - - if (next < 0x10000) { - _push(result, String.fromCharCode(next)); - } else { - next -= 0x10000; - _push(result, String.fromCharCode((next >> 10) + 0xD800)); - _push(result, String.fromCharCode((next % 0x400) + 0xDC00)); - } - } - return result.join(''); - }, - - raw: function raw(callSite) { - var cooked = ES.ToObject(callSite, 'bad callSite'); - var rawString = ES.ToObject(cooked.raw, 'bad raw value'); - var len = rawString.length; - var literalsegments = ES.ToLength(len); - if (literalsegments <= 0) { - return ''; - } - - var stringElements = []; - var nextIndex = 0; - var nextKey, next, nextSeg, nextSub; - while (nextIndex < literalsegments) { - nextKey = ES.ToString(nextIndex); - nextSeg = ES.ToString(rawString[nextKey]); - _push(stringElements, nextSeg); - if (nextIndex + 1 >= literalsegments) { - break; - } - next = nextIndex + 1 < arguments.length ? arguments[nextIndex + 1] : ''; - nextSub = ES.ToString(next); - _push(stringElements, nextSub); - nextIndex += 1; - } - return stringElements.join(''); - } - }; - if (String.raw && String.raw({ raw: { 0: 'x', 1: 'y', length: 2 } }) !== 'xy') { - // IE 11 TP has a broken String.raw implementation - overrideNative(String, 'raw', StringShims.raw); - } - defineProperties(String, StringShims); - - // Fast repeat, uses the `Exponentiation by squaring` algorithm. - // Perf: http://jsperf.com/string-repeat2/2 - var stringRepeat = function repeat(s, times) { - if (times < 1) { return ''; } - if (times % 2) { return repeat(s, times - 1) + s; } - var half = repeat(s, times / 2); - return half + half; - }; - var stringMaxLength = Infinity; - - var StringPrototypeShims = { - repeat: function repeat(times) { - var thisStr = ES.ToString(ES.RequireObjectCoercible(this)); - var numTimes = ES.ToInteger(times); - if (numTimes < 0 || numTimes >= stringMaxLength) { - throw new RangeError('repeat count must be less than infinity and not overflow maximum string size'); - } - return stringRepeat(thisStr, numTimes); - }, - - startsWith: function startsWith(searchString) { - var S = ES.ToString(ES.RequireObjectCoercible(this)); - if (ES.IsRegExp(searchString)) { - throw new TypeError('Cannot call method "startsWith" with a regex'); - } - var searchStr = ES.ToString(searchString); - var position; - if (arguments.length > 1) { - position = arguments[1]; - } - var start = _max(ES.ToInteger(position), 0); - return _strSlice(S, start, start + searchStr.length) === searchStr; - }, - - endsWith: function endsWith(searchString) { - var S = ES.ToString(ES.RequireObjectCoercible(this)); - if (ES.IsRegExp(searchString)) { - throw new TypeError('Cannot call method "endsWith" with a regex'); - } - var searchStr = ES.ToString(searchString); - var len = S.length; - var endPosition; - if (arguments.length > 1) { - endPosition = arguments[1]; - } - var pos = typeof endPosition === 'undefined' ? len : ES.ToInteger(endPosition); - var end = _min(_max(pos, 0), len); - return _strSlice(S, end - searchStr.length, end) === searchStr; - }, - - includes: function includes(searchString) { - if (ES.IsRegExp(searchString)) { - throw new TypeError('"includes" does not accept a RegExp'); - } - var searchStr = ES.ToString(searchString); - var position; - if (arguments.length > 1) { - position = arguments[1]; - } - // Somehow this trick makes method 100% compat with the spec. - return _indexOf(this, searchStr, position) !== -1; - }, - - codePointAt: function codePointAt(pos) { - var thisStr = ES.ToString(ES.RequireObjectCoercible(this)); - var position = ES.ToInteger(pos); - var length = thisStr.length; - if (position >= 0 && position < length) { - var first = thisStr.charCodeAt(position); - var isEnd = position + 1 === length; - if (first < 0xD800 || first > 0xDBFF || isEnd) { return first; } - var second = thisStr.charCodeAt(position + 1); - if (second < 0xDC00 || second > 0xDFFF) { return first; } - return ((first - 0xD800) * 1024) + (second - 0xDC00) + 0x10000; - } - } - }; - if (String.prototype.includes && 'a'.includes('a', Infinity) !== false) { - overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); - } - - if (String.prototype.startsWith && String.prototype.endsWith) { - var startsWithRejectsRegex = throwsError(function () { - /* throws if spec-compliant */ - '/a/'.startsWith(/a/); - }); - var startsWithHandlesInfinity = valueOrFalseIfThrows(function () { - return 'abc'.startsWith('a', Infinity) === false; - }); - if (!startsWithRejectsRegex || !startsWithHandlesInfinity) { - // Firefox (< 37?) and IE 11 TP have a noncompliant startsWith implementation - overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); - overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); - } - } - if (hasSymbols) { - var startsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () { - var re = /a/; - re[Symbol.match] = false; - return '/a/'.startsWith(re); - }); - if (!startsWithSupportsSymbolMatch) { - overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); - } - var endsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () { - var re = /a/; - re[Symbol.match] = false; - return '/a/'.endsWith(re); - }); - if (!endsWithSupportsSymbolMatch) { - overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); - } - var includesSupportsSymbolMatch = valueOrFalseIfThrows(function () { - var re = /a/; - re[Symbol.match] = false; - return '/a/'.includes(re); - }); - if (!includesSupportsSymbolMatch) { - overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); - } - } - - defineProperties(String.prototype, StringPrototypeShims); - - // whitespace from: http://es5.github.io/#x15.5.4.20 - // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 - var ws = [ - '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', - '\u2029\uFEFF' - ].join(''); - var trimRegexp = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); - var trimShim = function trim() { - return ES.ToString(ES.RequireObjectCoercible(this)).replace(trimRegexp, ''); - }; - var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); - var nonWSregex = new RegExp('[' + nonWS + ']', 'g'); - var isBadHexRegex = /^[-+]0x[0-9a-f]+$/i; - var hasStringTrimBug = nonWS.trim().length !== nonWS.length; - defineProperty(String.prototype, 'trim', trimShim, hasStringTrimBug); - - // Given an argument x, it will return an IteratorResult object, - // with value set to x and done to false. - // Given no arguments, it will return an iterator completion object. - var iteratorResult = function (x) { - return { value: x, done: arguments.length === 0 }; - }; - - // see http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype-@@iterator - var StringIterator = function (s) { - ES.RequireObjectCoercible(s); - this._s = ES.ToString(s); - this._i = 0; - }; - StringIterator.prototype.next = function () { - var s = this._s; - var i = this._i; - if (typeof s === 'undefined' || i >= s.length) { - this._s = void 0; - return iteratorResult(); - } - var first = s.charCodeAt(i); - var second, len; - if (first < 0xD800 || first > 0xDBFF || (i + 1) === s.length) { - len = 1; - } else { - second = s.charCodeAt(i + 1); - len = (second < 0xDC00 || second > 0xDFFF) ? 1 : 2; - } - this._i = i + len; - return iteratorResult(s.substr(i, len)); - }; - addIterator(StringIterator.prototype); - addIterator(String.prototype, function () { - return new StringIterator(this); - }); - - var ArrayShims = { - from: function from(items) { - var C = this; - var mapFn; - if (arguments.length > 1) { - mapFn = arguments[1]; - } - var mapping, T; - if (typeof mapFn === 'undefined') { - mapping = false; - } else { - if (!ES.IsCallable(mapFn)) { - throw new TypeError('Array.from: when provided, the second argument must be a function'); - } - if (arguments.length > 2) { - T = arguments[2]; - } - mapping = true; - } - - // Note that that Arrays will use ArrayIterator: - // https://bugs.ecmascript.org/show_bug.cgi?id=2416 - var usingIterator = typeof (isArguments(items) || ES.GetMethod(items, $iterator$)) !== 'undefined'; - - var length, result, i; - if (usingIterator) { - result = ES.IsConstructor(C) ? Object(new C()) : []; - var iterator = ES.GetIterator(items); - var next, nextValue; - - i = 0; - while (true) { - next = ES.IteratorStep(iterator); - if (next === false) { - break; - } - nextValue = next.value; - try { - if (mapping) { - nextValue = typeof T === 'undefined' ? mapFn(nextValue, i) : _call(mapFn, T, nextValue, i); - } - result[i] = nextValue; - } catch (e) { - ES.IteratorClose(iterator, true); - throw e; - } - i += 1; - } - length = i; - } else { - var arrayLike = ES.ToObject(items); - length = ES.ToLength(arrayLike.length); - result = ES.IsConstructor(C) ? Object(new C(length)) : new Array(length); - var value; - for (i = 0; i < length; ++i) { - value = arrayLike[i]; - if (mapping) { - value = typeof T === 'undefined' ? mapFn(value, i) : _call(mapFn, T, value, i); - } - createDataPropertyOrThrow(result, i, value); - } - } - - result.length = length; - return result; - }, - - of: function of() { - var len = arguments.length; - var C = this; - var A = isArray(C) || !ES.IsCallable(C) ? new Array(len) : ES.Construct(C, [len]); - for (var k = 0; k < len; ++k) { - createDataPropertyOrThrow(A, k, arguments[k]); - } - A.length = len; - return A; - } - }; - defineProperties(Array, ArrayShims); - addDefaultSpecies(Array); - - // Our ArrayIterator is private; see - // https://github.com/paulmillr/es6-shim/issues/252 - ArrayIterator = function (array, kind) { - this.i = 0; - this.array = array; - this.kind = kind; - }; - - defineProperties(ArrayIterator.prototype, { - next: function () { - var i = this.i; - var array = this.array; - if (!(this instanceof ArrayIterator)) { - throw new TypeError('Not an ArrayIterator'); - } - if (typeof array !== 'undefined') { - var len = ES.ToLength(array.length); - for (; i < len; i++) { - var kind = this.kind; - var retval; - if (kind === 'key') { - retval = i; - } else if (kind === 'value') { - retval = array[i]; - } else if (kind === 'entry') { - retval = [i, array[i]]; - } - this.i = i + 1; - return iteratorResult(retval); - } - } - this.array = void 0; - return iteratorResult(); - } - }); - addIterator(ArrayIterator.prototype); - -/* - var orderKeys = function orderKeys(a, b) { - var aNumeric = String(ES.ToInteger(a)) === a; - var bNumeric = String(ES.ToInteger(b)) === b; - if (aNumeric && bNumeric) { - return b - a; - } else if (aNumeric && !bNumeric) { - return -1; - } else if (!aNumeric && bNumeric) { - return 1; - } else { - return a.localeCompare(b); - } - }; - - var getAllKeys = function getAllKeys(object) { - var ownKeys = []; - var keys = []; - - for (var key in object) { - _push(_hasOwnProperty(object, key) ? ownKeys : keys, key); - } - _sort(ownKeys, orderKeys); - _sort(keys, orderKeys); - - return _concat(ownKeys, keys); - }; - */ - - // note: this is positioned here because it depends on ArrayIterator - var arrayOfSupportsSubclassing = Array.of === ArrayShims.of || (function () { - // Detects a bug in Webkit nightly r181886 - var Foo = function Foo(len) { this.length = len; }; - Foo.prototype = []; - var fooArr = Array.of.apply(Foo, [1, 2]); - return fooArr instanceof Foo && fooArr.length === 2; - }()); - if (!arrayOfSupportsSubclassing) { - overrideNative(Array, 'of', ArrayShims.of); - } - - var ArrayPrototypeShims = { - copyWithin: function copyWithin(target, start) { - var o = ES.ToObject(this); - var len = ES.ToLength(o.length); - var relativeTarget = ES.ToInteger(target); - var relativeStart = ES.ToInteger(start); - var to = relativeTarget < 0 ? _max(len + relativeTarget, 0) : _min(relativeTarget, len); - var from = relativeStart < 0 ? _max(len + relativeStart, 0) : _min(relativeStart, len); - var end; - if (arguments.length > 2) { - end = arguments[2]; - } - var relativeEnd = typeof end === 'undefined' ? len : ES.ToInteger(end); - var finalItem = relativeEnd < 0 ? _max(len + relativeEnd, 0) : _min(relativeEnd, len); - var count = _min(finalItem - from, len - to); - var direction = 1; - if (from < to && to < (from + count)) { - direction = -1; - from += count - 1; - to += count - 1; - } - while (count > 0) { - if (from in o) { - o[to] = o[from]; - } else { - delete o[to]; - } - from += direction; - to += direction; - count -= 1; - } - return o; - }, - - fill: function fill(value) { - var start; - if (arguments.length > 1) { - start = arguments[1]; - } - var end; - if (arguments.length > 2) { - end = arguments[2]; - } - var O = ES.ToObject(this); - var len = ES.ToLength(O.length); - start = ES.ToInteger(typeof start === 'undefined' ? 0 : start); - end = ES.ToInteger(typeof end === 'undefined' ? len : end); - - var relativeStart = start < 0 ? _max(len + start, 0) : _min(start, len); - var relativeEnd = end < 0 ? len + end : end; - - for (var i = relativeStart; i < len && i < relativeEnd; ++i) { - O[i] = value; - } - return O; - }, - - find: function find(predicate) { - var list = ES.ToObject(this); - var length = ES.ToLength(list.length); - if (!ES.IsCallable(predicate)) { - throw new TypeError('Array#find: predicate must be a function'); - } - var thisArg = arguments.length > 1 ? arguments[1] : null; - for (var i = 0, value; i < length; i++) { - value = list[i]; - if (thisArg) { - if (_call(predicate, thisArg, value, i, list)) { - return value; - } - } else if (predicate(value, i, list)) { - return value; - } - } - }, - - findIndex: function findIndex(predicate) { - var list = ES.ToObject(this); - var length = ES.ToLength(list.length); - if (!ES.IsCallable(predicate)) { - throw new TypeError('Array#findIndex: predicate must be a function'); - } - var thisArg = arguments.length > 1 ? arguments[1] : null; - for (var i = 0; i < length; i++) { - if (thisArg) { - if (_call(predicate, thisArg, list[i], i, list)) { - return i; - } - } else if (predicate(list[i], i, list)) { - return i; - } - } - return -1; - }, - - keys: function keys() { - return new ArrayIterator(this, 'key'); - }, - - values: function values() { - return new ArrayIterator(this, 'value'); - }, - - entries: function entries() { - return new ArrayIterator(this, 'entry'); - } - }; - // Safari 7.1 defines Array#keys and Array#entries natively, - // but the resulting ArrayIterator objects don't have a "next" method. - if (Array.prototype.keys && !ES.IsCallable([1].keys().next)) { - delete Array.prototype.keys; - } - if (Array.prototype.entries && !ES.IsCallable([1].entries().next)) { - delete Array.prototype.entries; - } - - // Chrome 38 defines Array#keys and Array#entries, and Array#@@iterator, but not Array#values - if (Array.prototype.keys && Array.prototype.entries && !Array.prototype.values && Array.prototype[$iterator$]) { - defineProperties(Array.prototype, { - values: Array.prototype[$iterator$] - }); - if (Type.symbol(Symbol.unscopables)) { - Array.prototype[Symbol.unscopables].values = true; - } - } - // Chrome 40 defines Array#values with the incorrect name, although Array#{keys,entries} have the correct name - if (functionsHaveNames && Array.prototype.values && Array.prototype.values.name !== 'values') { - var originalArrayPrototypeValues = Array.prototype.values; - overrideNative(Array.prototype, 'values', function values() { return ES.Call(originalArrayPrototypeValues, this, arguments); }); - defineProperty(Array.prototype, $iterator$, Array.prototype.values, true); - } - defineProperties(Array.prototype, ArrayPrototypeShims); - - if (1 / [true].indexOf(true, -0) < 0) { - // indexOf when given a position arg of -0 should return +0. - // https://github.com/tc39/ecma262/pull/316 - defineProperty(Array.prototype, 'indexOf', function indexOf(searchElement) { - var value = _arrayIndexOfApply(this, arguments); - if (value === 0 && (1 / value) < 0) { - return 0; - } - return value; - }, true); - } - - addIterator(Array.prototype, function () { return this.values(); }); - // Chrome defines keys/values/entries on Array, but doesn't give us - // any way to identify its iterator. So add our own shimmed field. - if (Object.getPrototypeOf) { - addIterator(Object.getPrototypeOf([].values())); - } - - // note: this is positioned here because it relies on Array#entries - var arrayFromSwallowsNegativeLengths = (function () { - // Detects a Firefox bug in v32 - // https://bugzilla.mozilla.org/show_bug.cgi?id=1063993 - return valueOrFalseIfThrows(function () { - return Array.from({ length: -1 }).length === 0; - }); - }()); - var arrayFromHandlesIterables = (function () { - // Detects a bug in Webkit nightly r181886 - var arr = Array.from([0].entries()); - return arr.length === 1 && isArray(arr[0]) && arr[0][0] === 0 && arr[0][1] === 0; - }()); - if (!arrayFromSwallowsNegativeLengths || !arrayFromHandlesIterables) { - overrideNative(Array, 'from', ArrayShims.from); - } - var arrayFromHandlesUndefinedMapFunction = (function () { - // Microsoft Edge v0.11 throws if the mapFn argument is *provided* but undefined, - // but the spec doesn't care if it's provided or not - undefined doesn't throw. - return valueOrFalseIfThrows(function () { - return Array.from([0], void 0); - }); - }()); - if (!arrayFromHandlesUndefinedMapFunction) { - var origArrayFrom = Array.from; - overrideNative(Array, 'from', function from(items) { - if (arguments.length > 1 && typeof arguments[1] !== 'undefined') { - return ES.Call(origArrayFrom, this, arguments); - } else { - return _call(origArrayFrom, this, items); - } - }); - } - - var int32sAsOne = -(Math.pow(2, 32) - 1); - var toLengthsCorrectly = function (method, reversed) { - var obj = { length: int32sAsOne }; - obj[reversed ? (obj.length >>> 0) - 1 : 0] = true; - return valueOrFalseIfThrows(function () { - _call(method, obj, function () { - // note: in nonconforming browsers, this will be called - // -1 >>> 0 times, which is 4294967295, so the throw matters. - throw new RangeError('should not reach here'); - }, []); - return true; - }); - }; - if (!toLengthsCorrectly(Array.prototype.forEach)) { - var originalForEach = Array.prototype.forEach; - overrideNative(Array.prototype, 'forEach', function forEach(callbackFn) { - return ES.Call(originalForEach, this.length >= 0 ? this : [], arguments); - }, true); - } - if (!toLengthsCorrectly(Array.prototype.map)) { - var originalMap = Array.prototype.map; - overrideNative(Array.prototype, 'map', function map(callbackFn) { - return ES.Call(originalMap, this.length >= 0 ? this : [], arguments); - }, true); - } - if (!toLengthsCorrectly(Array.prototype.filter)) { - var originalFilter = Array.prototype.filter; - overrideNative(Array.prototype, 'filter', function filter(callbackFn) { - return ES.Call(originalFilter, this.length >= 0 ? this : [], arguments); - }, true); - } - if (!toLengthsCorrectly(Array.prototype.some)) { - var originalSome = Array.prototype.some; - overrideNative(Array.prototype, 'some', function some(callbackFn) { - return ES.Call(originalSome, this.length >= 0 ? this : [], arguments); - }, true); - } - if (!toLengthsCorrectly(Array.prototype.every)) { - var originalEvery = Array.prototype.every; - overrideNative(Array.prototype, 'every', function every(callbackFn) { - return ES.Call(originalEvery, this.length >= 0 ? this : [], arguments); - }, true); - } - if (!toLengthsCorrectly(Array.prototype.reduce)) { - var originalReduce = Array.prototype.reduce; - overrideNative(Array.prototype, 'reduce', function reduce(callbackFn) { - return ES.Call(originalReduce, this.length >= 0 ? this : [], arguments); - }, true); - } - if (!toLengthsCorrectly(Array.prototype.reduceRight, true)) { - var originalReduceRight = Array.prototype.reduceRight; - overrideNative(Array.prototype, 'reduceRight', function reduceRight(callbackFn) { - return ES.Call(originalReduceRight, this.length >= 0 ? this : [], arguments); - }, true); - } - - var lacksOctalSupport = Number('0o10') !== 8; - var lacksBinarySupport = Number('0b10') !== 2; - var trimsNonWhitespace = _some(nonWS, function (c) { - return Number(c + 0 + c) === 0; - }); - if (lacksOctalSupport || lacksBinarySupport || trimsNonWhitespace) { - var OrigNumber = Number; - var binaryRegex = /^0b[01]+$/i; - var octalRegex = /^0o[0-7]+$/i; - // Note that in IE 8, RegExp.prototype.test doesn't seem to exist: ie, "test" is an own property of regexes. wtf. - var isBinary = binaryRegex.test.bind(binaryRegex); - var isOctal = octalRegex.test.bind(octalRegex); - var toPrimitive = function (O) { // need to replace this with `es-to-primitive/es6` - var result; - if (typeof O.valueOf === 'function') { - result = O.valueOf(); - if (Type.primitive(result)) { - return result; - } - } - if (typeof O.toString === 'function') { - result = O.toString(); - if (Type.primitive(result)) { - return result; - } - } - throw new TypeError('No default value'); - }; - var hasNonWS = nonWSregex.test.bind(nonWSregex); - var isBadHex = isBadHexRegex.test.bind(isBadHexRegex); - var NumberShim = (function () { - // this is wrapped in an IIFE because of IE 6-8's wacky scoping issues with named function expressions. - var NumberShim = function Number(value) { - var primValue; - if (arguments.length > 0) { - primValue = Type.primitive(value) ? value : toPrimitive(value, 'number'); - } else { - primValue = 0; - } - if (typeof primValue === 'string') { - primValue = ES.Call(trimShim, primValue); - if (isBinary(primValue)) { - primValue = parseInt(_strSlice(primValue, 2), 2); - } else if (isOctal(primValue)) { - primValue = parseInt(_strSlice(primValue, 2), 8); - } else if (hasNonWS(primValue) || isBadHex(primValue)) { - primValue = NaN; - } - } - var receiver = this; - var valueOfSucceeds = valueOrFalseIfThrows(function () { - OrigNumber.prototype.valueOf.call(receiver); - return true; - }); - if (receiver instanceof NumberShim && !valueOfSucceeds) { - return new OrigNumber(primValue); - } - /* jshint newcap: false */ - return OrigNumber(primValue); - /* jshint newcap: true */ - }; - return NumberShim; - }()); - wrapConstructor(OrigNumber, NumberShim, {}); - // this is necessary for ES3 browsers, where these properties are non-enumerable. - defineProperties(NumberShim, { - NaN: OrigNumber.NaN, - MAX_VALUE: OrigNumber.MAX_VALUE, - MIN_VALUE: OrigNumber.MIN_VALUE, - NEGATIVE_INFINITY: OrigNumber.NEGATIVE_INFINITY, - POSITIVE_INFINITY: OrigNumber.POSITIVE_INFINITY - }); - /* globals Number: true */ - /* eslint-disable no-undef, no-global-assign */ - /* jshint -W020 */ - Number = NumberShim; - Value.redefine(globals, 'Number', NumberShim); - /* jshint +W020 */ - /* eslint-enable no-undef, no-global-assign */ - /* globals Number: false */ - } - - var maxSafeInteger = Math.pow(2, 53) - 1; - defineProperties(Number, { - MAX_SAFE_INTEGER: maxSafeInteger, - MIN_SAFE_INTEGER: -maxSafeInteger, - EPSILON: 2.220446049250313e-16, - - parseInt: globals.parseInt, - parseFloat: globals.parseFloat, - - isFinite: numberIsFinite, - - isInteger: function isInteger(value) { - return numberIsFinite(value) && ES.ToInteger(value) === value; - }, - - isSafeInteger: function isSafeInteger(value) { - return Number.isInteger(value) && _abs(value) <= Number.MAX_SAFE_INTEGER; - }, - - isNaN: numberIsNaN - }); - // Firefox 37 has a conforming Number.parseInt, but it's not === to the global parseInt (fixed in v40) - defineProperty(Number, 'parseInt', globals.parseInt, Number.parseInt !== globals.parseInt); - - // Work around bugs in Array#find and Array#findIndex -- early - // implementations skipped holes in sparse arrays. (Note that the - // implementations of find/findIndex indirectly use shimmed - // methods of Number, so this test has to happen down here.) - /*jshint elision: true */ - /* eslint-disable no-sparse-arrays */ - if ([, 1].find(function () { return true; }) === 1) { - overrideNative(Array.prototype, 'find', ArrayPrototypeShims.find); - } - if ([, 1].findIndex(function () { return true; }) !== 0) { - overrideNative(Array.prototype, 'findIndex', ArrayPrototypeShims.findIndex); - } - /* eslint-enable no-sparse-arrays */ - /*jshint elision: false */ - - var isEnumerableOn = Function.bind.call(Function.bind, Object.prototype.propertyIsEnumerable); - var ensureEnumerable = function ensureEnumerable(obj, prop) { - if (supportsDescriptors && isEnumerableOn(obj, prop)) { - Object.defineProperty(obj, prop, { enumerable: false }); - } - }; - var sliceArgs = function sliceArgs() { - // per https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments - // and https://gist.github.com/WebReflection/4327762cb87a8c634a29 - var initial = Number(this); - var len = arguments.length; - var desiredArgCount = len - initial; - var args = new Array(desiredArgCount < 0 ? 0 : desiredArgCount); - for (var i = initial; i < len; ++i) { - args[i - initial] = arguments[i]; - } - return args; - }; - var assignTo = function assignTo(source) { - return function assignToSource(target, key) { - target[key] = source[key]; - return target; - }; - }; - var assignReducer = function (target, source) { - var sourceKeys = keys(Object(source)); - var symbols; - if (ES.IsCallable(Object.getOwnPropertySymbols)) { - symbols = _filter(Object.getOwnPropertySymbols(Object(source)), isEnumerableOn(source)); - } - return _reduce(_concat(sourceKeys, symbols || []), assignTo(source), target); - }; - - var ObjectShims = { - // 19.1.3.1 - assign: function (target, source) { - var to = ES.ToObject(target, 'Cannot convert undefined or null to object'); - return _reduce(ES.Call(sliceArgs, 1, arguments), assignReducer, to); - }, - - // Added in WebKit in https://bugs.webkit.org/show_bug.cgi?id=143865 - is: function is(a, b) { - return ES.SameValue(a, b); - } - }; - var assignHasPendingExceptions = Object.assign && Object.preventExtensions && (function () { - // Firefox 37 still has "pending exception" logic in its Object.assign implementation, - // which is 72% slower than our shim, and Firefox 40's native implementation. - var thrower = Object.preventExtensions({ 1: 2 }); - try { - Object.assign(thrower, 'xy'); - } catch (e) { - return thrower[1] === 'y'; - } - }()); - if (assignHasPendingExceptions) { - overrideNative(Object, 'assign', ObjectShims.assign); - } - defineProperties(Object, ObjectShims); - - if (supportsDescriptors) { - var ES5ObjectShims = { - // 19.1.3.9 - // shim from https://gist.github.com/WebReflection/5593554 - setPrototypeOf: (function (Object, magic) { - var set; - - var checkArgs = function (O, proto) { - if (!ES.TypeIsObject(O)) { - throw new TypeError('cannot set prototype on a non-object'); - } - if (!(proto === null || ES.TypeIsObject(proto))) { - throw new TypeError('can only set prototype to an object or null' + proto); - } - }; - - var setPrototypeOf = function (O, proto) { - checkArgs(O, proto); - _call(set, O, proto); - return O; - }; - - try { - // this works already in Firefox and Safari - set = Object.getOwnPropertyDescriptor(Object.prototype, magic).set; - _call(set, {}, null); - } catch (e) { - if (Object.prototype !== {}[magic]) { - // IE < 11 cannot be shimmed - return; - } - // probably Chrome or some old Mobile stock browser - set = function (proto) { - this[magic] = proto; - }; - // please note that this will **not** work - // in those browsers that do not inherit - // __proto__ by mistake from Object.prototype - // in these cases we should probably throw an error - // or at least be informed about the issue - setPrototypeOf.polyfill = setPrototypeOf( - setPrototypeOf({}, null), - Object.prototype - ) instanceof Object; - // setPrototypeOf.polyfill === true means it works as meant - // setPrototypeOf.polyfill === false means it's not 100% reliable - // setPrototypeOf.polyfill === undefined - // or - // setPrototypeOf.polyfill == null means it's not a polyfill - // which means it works as expected - // we can even delete Object.prototype.__proto__; - } - return setPrototypeOf; - }(Object, '__proto__')) - }; - - defineProperties(Object, ES5ObjectShims); - } - - // Workaround bug in Opera 12 where setPrototypeOf(x, null) doesn't work, - // but Object.create(null) does. - if (Object.setPrototypeOf && Object.getPrototypeOf && - Object.getPrototypeOf(Object.setPrototypeOf({}, null)) !== null && - Object.getPrototypeOf(Object.create(null)) === null) { - (function () { - var FAKENULL = Object.create(null); - var gpo = Object.getPrototypeOf; - var spo = Object.setPrototypeOf; - Object.getPrototypeOf = function (o) { - var result = gpo(o); - return result === FAKENULL ? null : result; - }; - Object.setPrototypeOf = function (o, p) { - var proto = p === null ? FAKENULL : p; - return spo(o, proto); - }; - Object.setPrototypeOf.polyfill = false; - }()); - } - - var objectKeysAcceptsPrimitives = !throwsError(function () { Object.keys('foo'); }); - if (!objectKeysAcceptsPrimitives) { - var originalObjectKeys = Object.keys; - overrideNative(Object, 'keys', function keys(value) { - return originalObjectKeys(ES.ToObject(value)); - }); - keys = Object.keys; - } - var objectKeysRejectsRegex = throwsError(function () { Object.keys(/a/g); }); - if (objectKeysRejectsRegex) { - var regexRejectingObjectKeys = Object.keys; - overrideNative(Object, 'keys', function keys(value) { - if (Type.regex(value)) { - var regexKeys = []; - for (var k in value) { - if (_hasOwnProperty(value, k)) { - _push(regexKeys, k); - } - } - return regexKeys; - } - return regexRejectingObjectKeys(value); - }); - keys = Object.keys; - } - - if (Object.getOwnPropertyNames) { - var objectGOPNAcceptsPrimitives = !throwsError(function () { Object.getOwnPropertyNames('foo'); }); - if (!objectGOPNAcceptsPrimitives) { - var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : []; - var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; - overrideNative(Object, 'getOwnPropertyNames', function getOwnPropertyNames(value) { - var val = ES.ToObject(value); - if (_toString(val) === '[object Window]') { - try { - return originalObjectGetOwnPropertyNames(val); - } catch (e) { - // IE bug where layout engine calls userland gOPN for cross-domain `window` objects - return _concat([], cachedWindowNames); - } - } - return originalObjectGetOwnPropertyNames(val); - }); - } - } - if (Object.getOwnPropertyDescriptor) { - var objectGOPDAcceptsPrimitives = !throwsError(function () { Object.getOwnPropertyDescriptor('foo', 'bar'); }); - if (!objectGOPDAcceptsPrimitives) { - var originalObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - overrideNative(Object, 'getOwnPropertyDescriptor', function getOwnPropertyDescriptor(value, property) { - return originalObjectGetOwnPropertyDescriptor(ES.ToObject(value), property); - }); - } - } - if (Object.seal) { - var objectSealAcceptsPrimitives = !throwsError(function () { Object.seal('foo'); }); - if (!objectSealAcceptsPrimitives) { - var originalObjectSeal = Object.seal; - overrideNative(Object, 'seal', function seal(value) { - if (!ES.TypeIsObject(value)) { return value; } - return originalObjectSeal(value); - }); - } - } - if (Object.isSealed) { - var objectIsSealedAcceptsPrimitives = !throwsError(function () { Object.isSealed('foo'); }); - if (!objectIsSealedAcceptsPrimitives) { - var originalObjectIsSealed = Object.isSealed; - overrideNative(Object, 'isSealed', function isSealed(value) { - if (!ES.TypeIsObject(value)) { return true; } - return originalObjectIsSealed(value); - }); - } - } - if (Object.freeze) { - var objectFreezeAcceptsPrimitives = !throwsError(function () { Object.freeze('foo'); }); - if (!objectFreezeAcceptsPrimitives) { - var originalObjectFreeze = Object.freeze; - overrideNative(Object, 'freeze', function freeze(value) { - if (!ES.TypeIsObject(value)) { return value; } - return originalObjectFreeze(value); - }); - } - } - if (Object.isFrozen) { - var objectIsFrozenAcceptsPrimitives = !throwsError(function () { Object.isFrozen('foo'); }); - if (!objectIsFrozenAcceptsPrimitives) { - var originalObjectIsFrozen = Object.isFrozen; - overrideNative(Object, 'isFrozen', function isFrozen(value) { - if (!ES.TypeIsObject(value)) { return true; } - return originalObjectIsFrozen(value); - }); - } - } - if (Object.preventExtensions) { - var objectPreventExtensionsAcceptsPrimitives = !throwsError(function () { Object.preventExtensions('foo'); }); - if (!objectPreventExtensionsAcceptsPrimitives) { - var originalObjectPreventExtensions = Object.preventExtensions; - overrideNative(Object, 'preventExtensions', function preventExtensions(value) { - if (!ES.TypeIsObject(value)) { return value; } - return originalObjectPreventExtensions(value); - }); - } - } - if (Object.isExtensible) { - var objectIsExtensibleAcceptsPrimitives = !throwsError(function () { Object.isExtensible('foo'); }); - if (!objectIsExtensibleAcceptsPrimitives) { - var originalObjectIsExtensible = Object.isExtensible; - overrideNative(Object, 'isExtensible', function isExtensible(value) { - if (!ES.TypeIsObject(value)) { return false; } - return originalObjectIsExtensible(value); - }); - } - } - if (Object.getPrototypeOf) { - var objectGetProtoAcceptsPrimitives = !throwsError(function () { Object.getPrototypeOf('foo'); }); - if (!objectGetProtoAcceptsPrimitives) { - var originalGetProto = Object.getPrototypeOf; - overrideNative(Object, 'getPrototypeOf', function getPrototypeOf(value) { - return originalGetProto(ES.ToObject(value)); - }); - } - } - - var hasFlags = supportsDescriptors && (function () { - var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags'); - return desc && ES.IsCallable(desc.get); - }()); - if (supportsDescriptors && !hasFlags) { - var regExpFlagsGetter = function flags() { - if (!ES.TypeIsObject(this)) { - throw new TypeError('Method called on incompatible type: must be an object.'); - } - var result = ''; - if (this.global) { - result += 'g'; - } - if (this.ignoreCase) { - result += 'i'; - } - if (this.multiline) { - result += 'm'; - } - if (this.unicode) { - result += 'u'; - } - if (this.sticky) { - result += 'y'; - } - return result; - }; - - Value.getter(RegExp.prototype, 'flags', regExpFlagsGetter); - } - - var regExpSupportsFlagsWithRegex = supportsDescriptors && valueOrFalseIfThrows(function () { - return String(new RegExp(/a/g, 'i')) === '/a/i'; - }); - var regExpNeedsToSupportSymbolMatch = hasSymbols && supportsDescriptors && (function () { - // Edge 0.12 supports flags fully, but does not support Symbol.match - var regex = /./; - regex[Symbol.match] = false; - return RegExp(regex) === regex; - }()); - - var regexToStringIsGeneric = valueOrFalseIfThrows(function () { - return RegExp.prototype.toString.call({ source: 'abc' }) === '/abc/'; - }); - var regexToStringSupportsGenericFlags = regexToStringIsGeneric && valueOrFalseIfThrows(function () { - return RegExp.prototype.toString.call({ source: 'a', flags: 'b' }) === '/a/b'; - }); - if (!regexToStringIsGeneric || !regexToStringSupportsGenericFlags) { - var origRegExpToString = RegExp.prototype.toString; - defineProperty(RegExp.prototype, 'toString', function toString() { - var R = ES.RequireObjectCoercible(this); - if (Type.regex(R)) { - return _call(origRegExpToString, R); - } - var pattern = $String(R.source); - var flags = $String(R.flags); - return '/' + pattern + '/' + flags; - }, true); - Value.preserveToString(RegExp.prototype.toString, origRegExpToString); - } - - if (supportsDescriptors && (!regExpSupportsFlagsWithRegex || regExpNeedsToSupportSymbolMatch)) { - var flagsGetter = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get; - var sourceDesc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source') || {}; - var legacySourceGetter = function () { - // prior to it being a getter, it's own + nonconfigurable - return this.source; - }; - var sourceGetter = ES.IsCallable(sourceDesc.get) ? sourceDesc.get : legacySourceGetter; - - var OrigRegExp = RegExp; - var RegExpShim = (function () { - return function RegExp(pattern, flags) { - var patternIsRegExp = ES.IsRegExp(pattern); - var calledWithNew = this instanceof RegExp; - if (!calledWithNew && patternIsRegExp && typeof flags === 'undefined' && pattern.constructor === RegExp) { - return pattern; - } - - var P = pattern; - var F = flags; - if (Type.regex(pattern)) { - P = ES.Call(sourceGetter, pattern); - F = typeof flags === 'undefined' ? ES.Call(flagsGetter, pattern) : flags; - return new RegExp(P, F); - } else if (patternIsRegExp) { - P = pattern.source; - F = typeof flags === 'undefined' ? pattern.flags : flags; - } - return new OrigRegExp(pattern, flags); - }; - }()); - wrapConstructor(OrigRegExp, RegExpShim, { - $input: true // Chrome < v39 & Opera < 26 have a nonstandard "$input" property - }); - /* globals RegExp: true */ - /* eslint-disable no-undef, no-global-assign */ - /* jshint -W020 */ - RegExp = RegExpShim; - Value.redefine(globals, 'RegExp', RegExpShim); - /* jshint +W020 */ - /* eslint-enable no-undef, no-global-assign */ - /* globals RegExp: false */ - } - - if (supportsDescriptors) { - var regexGlobals = { - input: '$_', - lastMatch: '$&', - lastParen: '$+', - leftContext: '$`', - rightContext: '$\'' - }; - _forEach(keys(regexGlobals), function (prop) { - if (prop in RegExp && !(regexGlobals[prop] in RegExp)) { - Value.getter(RegExp, regexGlobals[prop], function get() { - return RegExp[prop]; - }); - } - }); - } - addDefaultSpecies(RegExp); - - var inverseEpsilon = 1 / Number.EPSILON; - var roundTiesToEven = function roundTiesToEven(n) { - // Even though this reduces down to `return n`, it takes advantage of built-in rounding. - return (n + inverseEpsilon) - inverseEpsilon; - }; - var BINARY_32_EPSILON = Math.pow(2, -23); - var BINARY_32_MAX_VALUE = Math.pow(2, 127) * (2 - BINARY_32_EPSILON); - var BINARY_32_MIN_VALUE = Math.pow(2, -126); - var E = Math.E; - var LOG2E = Math.LOG2E; - var LOG10E = Math.LOG10E; - var numberCLZ = Number.prototype.clz; - delete Number.prototype.clz; // Safari 8 has Number#clz - - var MathShims = { - acosh: function acosh(value) { - var x = Number(value); - if (numberIsNaN(x) || value < 1) { return NaN; } - if (x === 1) { return 0; } - if (x === Infinity) { return x; } - return _log((x / E) + (_sqrt(x + 1) * _sqrt(x - 1) / E)) + 1; - }, - - asinh: function asinh(value) { - var x = Number(value); - if (x === 0 || !globalIsFinite(x)) { - return x; - } - return x < 0 ? -asinh(-x) : _log(x + _sqrt((x * x) + 1)); - }, - - atanh: function atanh(value) { - var x = Number(value); - if (numberIsNaN(x) || x < -1 || x > 1) { - return NaN; - } - if (x === -1) { return -Infinity; } - if (x === 1) { return Infinity; } - if (x === 0) { return x; } - return 0.5 * _log((1 + x) / (1 - x)); - }, - - cbrt: function cbrt(value) { - var x = Number(value); - if (x === 0) { return x; } - var negate = x < 0; - var result; - if (negate) { x = -x; } - if (x === Infinity) { - result = Infinity; - } else { - result = _exp(_log(x) / 3); - // from http://en.wikipedia.org/wiki/Cube_root#Numerical_methods - result = ((x / (result * result)) + (2 * result)) / 3; - } - return negate ? -result : result; - }, - - clz32: function clz32(value) { - // See https://bugs.ecmascript.org/show_bug.cgi?id=2465 - var x = Number(value); - var number = ES.ToUint32(x); - if (number === 0) { - return 32; - } - return numberCLZ ? ES.Call(numberCLZ, number) : 31 - _floor(_log(number + 0.5) * LOG2E); - }, - - cosh: function cosh(value) { - var x = Number(value); - if (x === 0) { return 1; } // +0 or -0 - if (numberIsNaN(x)) { return NaN; } - if (!globalIsFinite(x)) { return Infinity; } - if (x < 0) { x = -x; } - if (x > 21) { return _exp(x) / 2; } - return (_exp(x) + _exp(-x)) / 2; - }, - - expm1: function expm1(value) { - var x = Number(value); - if (x === -Infinity) { return -1; } - if (!globalIsFinite(x) || x === 0) { return x; } - if (_abs(x) > 0.5) { - return _exp(x) - 1; - } - // A more precise approximation using Taylor series expansion - // from https://github.com/paulmillr/es6-shim/issues/314#issuecomment-70293986 - var t = x; - var sum = 0; - var n = 1; - while (sum + t !== sum) { - sum += t; - n += 1; - t *= x / n; - } - return sum; - }, - - hypot: function hypot(x, y) { - var result = 0; - var largest = 0; - for (var i = 0; i < arguments.length; ++i) { - var value = _abs(Number(arguments[i])); - if (largest < value) { - result *= (largest / value) * (largest / value); - result += 1; - largest = value; - } else { - result += value > 0 ? (value / largest) * (value / largest) : value; - } - } - return largest === Infinity ? Infinity : largest * _sqrt(result); - }, - - log2: function log2(value) { - return _log(value) * LOG2E; - }, - - log10: function log10(value) { - return _log(value) * LOG10E; - }, - - log1p: function log1p(value) { - var x = Number(value); - if (x < -1 || numberIsNaN(x)) { return NaN; } - if (x === 0 || x === Infinity) { return x; } - if (x === -1) { return -Infinity; } - - return (1 + x) - 1 === 0 ? x : x * (_log(1 + x) / ((1 + x) - 1)); - }, - - sign: _sign, - - sinh: function sinh(value) { - var x = Number(value); - if (!globalIsFinite(x) || x === 0) { return x; } - - if (_abs(x) < 1) { - return (Math.expm1(x) - Math.expm1(-x)) / 2; - } - return (_exp(x - 1) - _exp(-x - 1)) * E / 2; - }, - - tanh: function tanh(value) { - var x = Number(value); - if (numberIsNaN(x) || x === 0) { return x; } - // can exit early at +-20 as JS loses precision for true value at this integer - if (x >= 20) { return 1; } - if (x <= -20) { return -1; } - - return (Math.expm1(x) - Math.expm1(-x)) / (_exp(x) + _exp(-x)); - }, - - trunc: function trunc(value) { - var x = Number(value); - return x < 0 ? -_floor(-x) : _floor(x); - }, - - imul: function imul(x, y) { - // taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul - var a = ES.ToUint32(x); - var b = ES.ToUint32(y); - var ah = (a >>> 16) & 0xffff; - var al = a & 0xffff; - var bh = (b >>> 16) & 0xffff; - var bl = b & 0xffff; - // the shift by 0 fixes the sign on the high part - // the final |0 converts the unsigned value into a signed value - return (al * bl) + ((((ah * bl) + (al * bh)) << 16) >>> 0) | 0; - }, - - fround: function fround(x) { - var v = Number(x); - if (v === 0 || v === Infinity || v === -Infinity || numberIsNaN(v)) { - return v; - } - var sign = _sign(v); - var abs = _abs(v); - if (abs < BINARY_32_MIN_VALUE) { - return sign * roundTiesToEven( - abs / BINARY_32_MIN_VALUE / BINARY_32_EPSILON - ) * BINARY_32_MIN_VALUE * BINARY_32_EPSILON; - } - // Veltkamp's splitting (?) - var a = (1 + (BINARY_32_EPSILON / Number.EPSILON)) * abs; - var result = a - (a - abs); - if (result > BINARY_32_MAX_VALUE || numberIsNaN(result)) { - return sign * Infinity; - } - return sign * result; - } - }; - defineProperties(Math, MathShims); - // IE 11 TP has an imprecise log1p: reports Math.log1p(-1e-17) as 0 - defineProperty(Math, 'log1p', MathShims.log1p, Math.log1p(-1e-17) !== -1e-17); - // IE 11 TP has an imprecise asinh: reports Math.asinh(-1e7) as not exactly equal to -Math.asinh(1e7) - defineProperty(Math, 'asinh', MathShims.asinh, Math.asinh(-1e7) !== -Math.asinh(1e7)); - // Chrome 40 has an imprecise Math.tanh with very small numbers - defineProperty(Math, 'tanh', MathShims.tanh, Math.tanh(-2e-17) !== -2e-17); - // Chrome 40 loses Math.acosh precision with high numbers - defineProperty(Math, 'acosh', MathShims.acosh, Math.acosh(Number.MAX_VALUE) === Infinity); - // Firefox 38 on Windows - defineProperty(Math, 'cbrt', MathShims.cbrt, Math.abs(1 - (Math.cbrt(1e-300) / 1e-100)) / Number.EPSILON > 8); - // node 0.11 has an imprecise Math.sinh with very small numbers - defineProperty(Math, 'sinh', MathShims.sinh, Math.sinh(-2e-17) !== -2e-17); - // FF 35 on Linux reports 22025.465794806725 for Math.expm1(10) - var expm1OfTen = Math.expm1(10); - defineProperty(Math, 'expm1', MathShims.expm1, expm1OfTen > 22025.465794806719 || expm1OfTen < 22025.4657948067165168); - - var origMathRound = Math.round; - // breaks in e.g. Safari 8, Internet Explorer 11, Opera 12 - var roundHandlesBoundaryConditions = Math.round(0.5 - (Number.EPSILON / 4)) === 0 && - Math.round(-0.5 + (Number.EPSILON / 3.99)) === 1; - - // When engines use Math.floor(x + 0.5) internally, Math.round can be buggy for large integers. - // This behavior should be governed by "round to nearest, ties to even mode" - // see http://www.ecma-international.org/ecma-262/6.0/#sec-terms-and-definitions-number-type - // These are the boundary cases where it breaks. - var smallestPositiveNumberWhereRoundBreaks = inverseEpsilon + 1; - var largestPositiveNumberWhereRoundBreaks = (2 * inverseEpsilon) - 1; - var roundDoesNotIncreaseIntegers = [ - smallestPositiveNumberWhereRoundBreaks, - largestPositiveNumberWhereRoundBreaks - ].every(function (num) { - return Math.round(num) === num; - }); - defineProperty(Math, 'round', function round(x) { - var floor = _floor(x); - var ceil = floor === -1 ? -0 : floor + 1; - return x - floor < 0.5 ? floor : ceil; - }, !roundHandlesBoundaryConditions || !roundDoesNotIncreaseIntegers); - Value.preserveToString(Math.round, origMathRound); - - var origImul = Math.imul; - if (Math.imul(0xffffffff, 5) !== -5) { - // Safari 6.1, at least, reports "0" for this value - Math.imul = MathShims.imul; - Value.preserveToString(Math.imul, origImul); - } - if (Math.imul.length !== 2) { - // Safari 8.0.4 has a length of 1 - // fixed in https://bugs.webkit.org/show_bug.cgi?id=143658 - overrideNative(Math, 'imul', function imul(x, y) { - return ES.Call(origImul, Math, arguments); - }); - } - - // Promises - // Simplest possible implementation; use a 3rd-party library if you - // want the best possible speed and/or long stack traces. - var PromiseShim = (function () { - var setTimeout = globals.setTimeout; - // some environments don't have setTimeout - no way to shim here. - if (typeof setTimeout !== 'function' && typeof setTimeout !== 'object') { return; } - - ES.IsPromise = function (promise) { - if (!ES.TypeIsObject(promise)) { - return false; - } - if (typeof promise._promise === 'undefined') { - return false; // uninitialized, or missing our hidden field. - } - return true; - }; - - // "PromiseCapability" in the spec is what most promise implementations - // call a "deferred". - var PromiseCapability = function (C) { - if (!ES.IsConstructor(C)) { - throw new TypeError('Bad promise constructor'); - } - var capability = this; - var resolver = function (resolve, reject) { - if (capability.resolve !== void 0 || capability.reject !== void 0) { - throw new TypeError('Bad Promise implementation!'); - } - capability.resolve = resolve; - capability.reject = reject; - }; - // Initialize fields to inform optimizers about the object shape. - capability.resolve = void 0; - capability.reject = void 0; - capability.promise = new C(resolver); - if (!(ES.IsCallable(capability.resolve) && ES.IsCallable(capability.reject))) { - throw new TypeError('Bad promise constructor'); - } - }; - - // find an appropriate setImmediate-alike - var makeZeroTimeout; - /*global window */ - if (typeof window !== 'undefined' && ES.IsCallable(window.postMessage)) { - makeZeroTimeout = function () { - // from http://dbaron.org/log/20100309-faster-timeouts - var timeouts = []; - var messageName = 'zero-timeout-message'; - var setZeroTimeout = function (fn) { - _push(timeouts, fn); - window.postMessage(messageName, '*'); - }; - var handleMessage = function (event) { - if (event.source === window && event.data === messageName) { - event.stopPropagation(); - if (timeouts.length === 0) { return; } - var fn = _shift(timeouts); - fn(); - } - }; - window.addEventListener('message', handleMessage, true); - return setZeroTimeout; - }; - } - var makePromiseAsap = function () { - // An efficient task-scheduler based on a pre-existing Promise - // implementation, which we can use even if we override the - // global Promise below (in order to workaround bugs) - // https://github.com/Raynos/observ-hash/issues/2#issuecomment-35857671 - var P = globals.Promise; - var pr = P && P.resolve && P.resolve(); - return pr && function (task) { - return pr.then(task); - }; - }; - /*global process */ - /* jscs:disable disallowMultiLineTernary */ - var enqueue = ES.IsCallable(globals.setImmediate) ? - globals.setImmediate : - typeof process === 'object' && process.nextTick ? process.nextTick : - makePromiseAsap() || - (ES.IsCallable(makeZeroTimeout) ? makeZeroTimeout() : - function (task) { setTimeout(task, 0); }); // fallback - /* jscs:enable disallowMultiLineTernary */ - - // Constants for Promise implementation - var PROMISE_IDENTITY = function (x) { return x; }; - var PROMISE_THROWER = function (e) { throw e; }; - var PROMISE_PENDING = 0; - var PROMISE_FULFILLED = 1; - var PROMISE_REJECTED = 2; - // We store fulfill/reject handlers and capabilities in a single array. - var PROMISE_FULFILL_OFFSET = 0; - var PROMISE_REJECT_OFFSET = 1; - var PROMISE_CAPABILITY_OFFSET = 2; - // This is used in an optimization for chaining promises via then. - var PROMISE_FAKE_CAPABILITY = {}; - - var enqueuePromiseReactionJob = function (handler, capability, argument) { - enqueue(function () { - promiseReactionJob(handler, capability, argument); - }); - }; - - var promiseReactionJob = function (handler, promiseCapability, argument) { - var handlerResult, f; - if (promiseCapability === PROMISE_FAKE_CAPABILITY) { - // Fast case, when we don't actually need to chain through to a - // (real) promiseCapability. - return handler(argument); - } - try { - handlerResult = handler(argument); - f = promiseCapability.resolve; - } catch (e) { - handlerResult = e; - f = promiseCapability.reject; - } - f(handlerResult); - }; - - var fulfillPromise = function (promise, value) { - var _promise = promise._promise; - var length = _promise.reactionLength; - if (length > 0) { - enqueuePromiseReactionJob( - _promise.fulfillReactionHandler0, - _promise.reactionCapability0, - value - ); - _promise.fulfillReactionHandler0 = void 0; - _promise.rejectReactions0 = void 0; - _promise.reactionCapability0 = void 0; - if (length > 1) { - for (var i = 1, idx = 0; i < length; i++, idx += 3) { - enqueuePromiseReactionJob( - _promise[idx + PROMISE_FULFILL_OFFSET], - _promise[idx + PROMISE_CAPABILITY_OFFSET], - value - ); - promise[idx + PROMISE_FULFILL_OFFSET] = void 0; - promise[idx + PROMISE_REJECT_OFFSET] = void 0; - promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0; - } - } - } - _promise.result = value; - _promise.state = PROMISE_FULFILLED; - _promise.reactionLength = 0; - }; - - var rejectPromise = function (promise, reason) { - var _promise = promise._promise; - var length = _promise.reactionLength; - if (length > 0) { - enqueuePromiseReactionJob( - _promise.rejectReactionHandler0, - _promise.reactionCapability0, - reason - ); - _promise.fulfillReactionHandler0 = void 0; - _promise.rejectReactions0 = void 0; - _promise.reactionCapability0 = void 0; - if (length > 1) { - for (var i = 1, idx = 0; i < length; i++, idx += 3) { - enqueuePromiseReactionJob( - _promise[idx + PROMISE_REJECT_OFFSET], - _promise[idx + PROMISE_CAPABILITY_OFFSET], - reason - ); - promise[idx + PROMISE_FULFILL_OFFSET] = void 0; - promise[idx + PROMISE_REJECT_OFFSET] = void 0; - promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0; - } - } - } - _promise.result = reason; - _promise.state = PROMISE_REJECTED; - _promise.reactionLength = 0; - }; - - var createResolvingFunctions = function (promise) { - var alreadyResolved = false; - var resolve = function (resolution) { - var then; - if (alreadyResolved) { return; } - alreadyResolved = true; - if (resolution === promise) { - return rejectPromise(promise, new TypeError('Self resolution')); - } - if (!ES.TypeIsObject(resolution)) { - return fulfillPromise(promise, resolution); - } - try { - then = resolution.then; - } catch (e) { - return rejectPromise(promise, e); - } - if (!ES.IsCallable(then)) { - return fulfillPromise(promise, resolution); - } - enqueue(function () { - promiseResolveThenableJob(promise, resolution, then); - }); - }; - var reject = function (reason) { - if (alreadyResolved) { return; } - alreadyResolved = true; - return rejectPromise(promise, reason); - }; - return { resolve: resolve, reject: reject }; - }; - - var optimizedThen = function (then, thenable, resolve, reject) { - // Optimization: since we discard the result, we can pass our - // own then implementation a special hint to let it know it - // doesn't have to create it. (The PROMISE_FAKE_CAPABILITY - // object is local to this implementation and unforgeable outside.) - if (then === Promise$prototype$then) { - _call(then, thenable, resolve, reject, PROMISE_FAKE_CAPABILITY); - } else { - _call(then, thenable, resolve, reject); - } - }; - var promiseResolveThenableJob = function (promise, thenable, then) { - var resolvingFunctions = createResolvingFunctions(promise); - var resolve = resolvingFunctions.resolve; - var reject = resolvingFunctions.reject; - try { - optimizedThen(then, thenable, resolve, reject); - } catch (e) { - reject(e); - } - }; - - var Promise$prototype, Promise$prototype$then; - var Promise = (function () { - var PromiseShim = function Promise(resolver) { - if (!(this instanceof PromiseShim)) { - throw new TypeError('Constructor Promise requires "new"'); - } - if (this && this._promise) { - throw new TypeError('Bad construction'); - } - // see https://bugs.ecmascript.org/show_bug.cgi?id=2482 - if (!ES.IsCallable(resolver)) { - throw new TypeError('not a valid resolver'); - } - var promise = emulateES6construct(this, PromiseShim, Promise$prototype, { - _promise: { - result: void 0, - state: PROMISE_PENDING, - // The first member of the "reactions" array is inlined here, - // since most promises only have one reaction. - // We've also exploded the 'reaction' object to inline the - // "handler" and "capability" fields, since both fulfill and - // reject reactions share the same capability. - reactionLength: 0, - fulfillReactionHandler0: void 0, - rejectReactionHandler0: void 0, - reactionCapability0: void 0 - } - }); - var resolvingFunctions = createResolvingFunctions(promise); - var reject = resolvingFunctions.reject; - try { - resolver(resolvingFunctions.resolve, reject); - } catch (e) { - reject(e); - } - return promise; - }; - return PromiseShim; - }()); - Promise$prototype = Promise.prototype; - - var _promiseAllResolver = function (index, values, capability, remaining) { - var alreadyCalled = false; - return function (x) { - if (alreadyCalled) { return; } - alreadyCalled = true; - values[index] = x; - if ((--remaining.count) === 0) { - var resolve = capability.resolve; - resolve(values); // call w/ this===undefined - } - }; - }; - - var performPromiseAll = function (iteratorRecord, C, resultCapability) { - var it = iteratorRecord.iterator; - var values = []; - var remaining = { count: 1 }; - var next, nextValue; - var index = 0; - while (true) { - try { - next = ES.IteratorStep(it); - if (next === false) { - iteratorRecord.done = true; - break; - } - nextValue = next.value; - } catch (e) { - iteratorRecord.done = true; - throw e; - } - values[index] = void 0; - var nextPromise = C.resolve(nextValue); - var resolveElement = _promiseAllResolver( - index, values, resultCapability, remaining - ); - remaining.count += 1; - optimizedThen(nextPromise.then, nextPromise, resolveElement, resultCapability.reject); - index += 1; - } - if ((--remaining.count) === 0) { - var resolve = resultCapability.resolve; - resolve(values); // call w/ this===undefined - } - return resultCapability.promise; - }; - - var performPromiseRace = function (iteratorRecord, C, resultCapability) { - var it = iteratorRecord.iterator; - var next, nextValue, nextPromise; - while (true) { - try { - next = ES.IteratorStep(it); - if (next === false) { - // NOTE: If iterable has no items, resulting promise will never - // resolve; see: - // https://github.com/domenic/promises-unwrapping/issues/75 - // https://bugs.ecmascript.org/show_bug.cgi?id=2515 - iteratorRecord.done = true; - break; - } - nextValue = next.value; - } catch (e) { - iteratorRecord.done = true; - throw e; - } - nextPromise = C.resolve(nextValue); - optimizedThen(nextPromise.then, nextPromise, resultCapability.resolve, resultCapability.reject); - } - return resultCapability.promise; - }; - - defineProperties(Promise, { - all: function all(iterable) { - var C = this; - if (!ES.TypeIsObject(C)) { - throw new TypeError('Promise is not object'); - } - var capability = new PromiseCapability(C); - var iterator, iteratorRecord; - try { - iterator = ES.GetIterator(iterable); - iteratorRecord = { iterator: iterator, done: false }; - return performPromiseAll(iteratorRecord, C, capability); - } catch (e) { - var exception = e; - if (iteratorRecord && !iteratorRecord.done) { - try { - ES.IteratorClose(iterator, true); - } catch (ee) { - exception = ee; - } - } - var reject = capability.reject; - reject(exception); - return capability.promise; - } - }, - - race: function race(iterable) { - var C = this; - if (!ES.TypeIsObject(C)) { - throw new TypeError('Promise is not object'); - } - var capability = new PromiseCapability(C); - var iterator, iteratorRecord; - try { - iterator = ES.GetIterator(iterable); - iteratorRecord = { iterator: iterator, done: false }; - return performPromiseRace(iteratorRecord, C, capability); - } catch (e) { - var exception = e; - if (iteratorRecord && !iteratorRecord.done) { - try { - ES.IteratorClose(iterator, true); - } catch (ee) { - exception = ee; - } - } - var reject = capability.reject; - reject(exception); - return capability.promise; - } - }, - - reject: function reject(reason) { - var C = this; - if (!ES.TypeIsObject(C)) { - throw new TypeError('Bad promise constructor'); - } - var capability = new PromiseCapability(C); - var rejectFunc = capability.reject; - rejectFunc(reason); // call with this===undefined - return capability.promise; - }, - - resolve: function resolve(v) { - // See https://esdiscuss.org/topic/fixing-promise-resolve for spec - var C = this; - if (!ES.TypeIsObject(C)) { - throw new TypeError('Bad promise constructor'); - } - if (ES.IsPromise(v)) { - var constructor = v.constructor; - if (constructor === C) { - return v; - } - } - var capability = new PromiseCapability(C); - var resolveFunc = capability.resolve; - resolveFunc(v); // call with this===undefined - return capability.promise; - } - }); - - defineProperties(Promise$prototype, { - 'catch': function (onRejected) { - return this.then(null, onRejected); - }, - - then: function then(onFulfilled, onRejected) { - var promise = this; - if (!ES.IsPromise(promise)) { throw new TypeError('not a promise'); } - var C = ES.SpeciesConstructor(promise, Promise); - var resultCapability; - var returnValueIsIgnored = arguments.length > 2 && arguments[2] === PROMISE_FAKE_CAPABILITY; - if (returnValueIsIgnored && C === Promise) { - resultCapability = PROMISE_FAKE_CAPABILITY; - } else { - resultCapability = new PromiseCapability(C); - } - // PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability) - // Note that we've split the 'reaction' object into its two - // components, "capabilities" and "handler" - // "capabilities" is always equal to `resultCapability` - var fulfillReactionHandler = ES.IsCallable(onFulfilled) ? onFulfilled : PROMISE_IDENTITY; - var rejectReactionHandler = ES.IsCallable(onRejected) ? onRejected : PROMISE_THROWER; - var _promise = promise._promise; - var value; - if (_promise.state === PROMISE_PENDING) { - if (_promise.reactionLength === 0) { - _promise.fulfillReactionHandler0 = fulfillReactionHandler; - _promise.rejectReactionHandler0 = rejectReactionHandler; - _promise.reactionCapability0 = resultCapability; - } else { - var idx = 3 * (_promise.reactionLength - 1); - _promise[idx + PROMISE_FULFILL_OFFSET] = fulfillReactionHandler; - _promise[idx + PROMISE_REJECT_OFFSET] = rejectReactionHandler; - _promise[idx + PROMISE_CAPABILITY_OFFSET] = resultCapability; - } - _promise.reactionLength += 1; - } else if (_promise.state === PROMISE_FULFILLED) { - value = _promise.result; - enqueuePromiseReactionJob( - fulfillReactionHandler, resultCapability, value - ); - } else if (_promise.state === PROMISE_REJECTED) { - value = _promise.result; - enqueuePromiseReactionJob( - rejectReactionHandler, resultCapability, value - ); - } else { - throw new TypeError('unexpected Promise state'); - } - return resultCapability.promise; - } - }); - // This helps the optimizer by ensuring that methods which take - // capabilities aren't polymorphic. - PROMISE_FAKE_CAPABILITY = new PromiseCapability(Promise); - Promise$prototype$then = Promise$prototype.then; - - return Promise; - }()); - - // Chrome's native Promise has extra methods that it shouldn't have. Let's remove them. - if (globals.Promise) { - delete globals.Promise.accept; - delete globals.Promise.defer; - delete globals.Promise.prototype.chain; - } - - if (typeof PromiseShim === 'function') { - // export the Promise constructor. - defineProperties(globals, { Promise: PromiseShim }); - // In Chrome 33 (and thereabouts) Promise is defined, but the - // implementation is buggy in a number of ways. Let's check subclassing - // support to see if we have a buggy implementation. - var promiseSupportsSubclassing = supportsSubclassing(globals.Promise, function (S) { - return S.resolve(42).then(function () {}) instanceof S; - }); - var promiseIgnoresNonFunctionThenCallbacks = !throwsError(function () { - globals.Promise.reject(42).then(null, 5).then(null, noop); - }); - var promiseRequiresObjectContext = throwsError(function () { globals.Promise.call(3, noop); }); - // Promise.resolve() was errata'ed late in the ES6 process. - // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1170742 - // https://code.google.com/p/v8/issues/detail?id=4161 - // It serves as a proxy for a number of other bugs in early Promise - // implementations. - var promiseResolveBroken = (function (Promise) { - var p = Promise.resolve(5); - p.constructor = {}; - var p2 = Promise.resolve(p); - try { - p2.then(null, noop).then(null, noop); // avoid "uncaught rejection" warnings in console - } catch (e) { - return true; // v8 native Promises break here https://code.google.com/p/chromium/issues/detail?id=575314 - } - return p === p2; // This *should* be false! - }(globals.Promise)); - - // Chrome 46 (probably older too) does not retrieve a thenable's .then synchronously - var getsThenSynchronously = supportsDescriptors && (function () { - var count = 0; - var thenable = Object.defineProperty({}, 'then', { get: function () { count += 1; } }); - Promise.resolve(thenable); - return count === 1; - }()); - - var BadResolverPromise = function BadResolverPromise(executor) { - var p = new Promise(executor); - executor(3, function () {}); - this.then = p.then; - this.constructor = BadResolverPromise; - }; - BadResolverPromise.prototype = Promise.prototype; - BadResolverPromise.all = Promise.all; - // Chrome Canary 49 (probably older too) has some implementation bugs - var hasBadResolverPromise = valueOrFalseIfThrows(function () { - return !!BadResolverPromise.all([1, 2]); - }); - - if (!promiseSupportsSubclassing || !promiseIgnoresNonFunctionThenCallbacks || - !promiseRequiresObjectContext || promiseResolveBroken || - !getsThenSynchronously || hasBadResolverPromise) { - /* globals Promise: true */ - /* eslint-disable no-undef, no-global-assign */ - /* jshint -W020 */ - Promise = PromiseShim; - /* jshint +W020 */ - /* eslint-enable no-undef, no-global-assign */ - /* globals Promise: false */ - overrideNative(globals, 'Promise', PromiseShim); - } - if (Promise.all.length !== 1) { - var origAll = Promise.all; - overrideNative(Promise, 'all', function all(iterable) { - return ES.Call(origAll, this, arguments); - }); - } - if (Promise.race.length !== 1) { - var origRace = Promise.race; - overrideNative(Promise, 'race', function race(iterable) { - return ES.Call(origRace, this, arguments); - }); - } - if (Promise.resolve.length !== 1) { - var origResolve = Promise.resolve; - overrideNative(Promise, 'resolve', function resolve(x) { - return ES.Call(origResolve, this, arguments); - }); - } - if (Promise.reject.length !== 1) { - var origReject = Promise.reject; - overrideNative(Promise, 'reject', function reject(r) { - return ES.Call(origReject, this, arguments); - }); - } - ensureEnumerable(Promise, 'all'); - ensureEnumerable(Promise, 'race'); - ensureEnumerable(Promise, 'resolve'); - ensureEnumerable(Promise, 'reject'); - addDefaultSpecies(Promise); - } - - // Map and Set require a true ES5 environment - // Their fast path also requires that the environment preserve - // property insertion order, which is not guaranteed by the spec. - var testOrder = function (a) { - var b = keys(_reduce(a, function (o, k) { - o[k] = true; - return o; - }, {})); - return a.join(':') === b.join(':'); - }; - var preservesInsertionOrder = testOrder(['z', 'a', 'bb']); - // some engines (eg, Chrome) only preserve insertion order for string keys - var preservesNumericInsertionOrder = testOrder(['z', 1, 'a', '3', 2]); - - if (supportsDescriptors) { - - var fastkey = function fastkey(key, skipInsertionOrderCheck) { - if (!skipInsertionOrderCheck && !preservesInsertionOrder) { - return null; - } - if (isNullOrUndefined(key)) { - return '^' + ES.ToString(key); - } else if (typeof key === 'string') { - return '$' + key; - } else if (typeof key === 'number') { - // note that -0 will get coerced to "0" when used as a property key - if (!preservesNumericInsertionOrder) { - return 'n' + key; - } - return key; - } else if (typeof key === 'boolean') { - return 'b' + key; - } - return null; - }; - - var emptyObject = function emptyObject() { - // accomodate some older not-quite-ES5 browsers - return Object.create ? Object.create(null) : {}; - }; - - var addIterableToMap = function addIterableToMap(MapConstructor, map, iterable) { - if (isArray(iterable) || Type.string(iterable)) { - _forEach(iterable, function (entry) { - if (!ES.TypeIsObject(entry)) { - throw new TypeError('Iterator value ' + entry + ' is not an entry object'); - } - map.set(entry[0], entry[1]); - }); - } else if (iterable instanceof MapConstructor) { - _call(MapConstructor.prototype.forEach, iterable, function (value, key) { - map.set(key, value); - }); - } else { - var iter, adder; - if (!isNullOrUndefined(iterable)) { - adder = map.set; - if (!ES.IsCallable(adder)) { throw new TypeError('bad map'); } - iter = ES.GetIterator(iterable); - } - if (typeof iter !== 'undefined') { - while (true) { - var next = ES.IteratorStep(iter); - if (next === false) { break; } - var nextItem = next.value; - try { - if (!ES.TypeIsObject(nextItem)) { - throw new TypeError('Iterator value ' + nextItem + ' is not an entry object'); - } - _call(adder, map, nextItem[0], nextItem[1]); - } catch (e) { - ES.IteratorClose(iter, true); - throw e; - } - } - } - } - }; - var addIterableToSet = function addIterableToSet(SetConstructor, set, iterable) { - if (isArray(iterable) || Type.string(iterable)) { - _forEach(iterable, function (value) { - set.add(value); - }); - } else if (iterable instanceof SetConstructor) { - _call(SetConstructor.prototype.forEach, iterable, function (value) { - set.add(value); - }); - } else { - var iter, adder; - if (!isNullOrUndefined(iterable)) { - adder = set.add; - if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); } - iter = ES.GetIterator(iterable); - } - if (typeof iter !== 'undefined') { - while (true) { - var next = ES.IteratorStep(iter); - if (next === false) { break; } - var nextValue = next.value; - try { - _call(adder, set, nextValue); - } catch (e) { - ES.IteratorClose(iter, true); - throw e; - } - } - } - } - }; - - var collectionShims = { - Map: (function () { - - var empty = {}; - - var MapEntry = function MapEntry(key, value) { - this.key = key; - this.value = value; - this.next = null; - this.prev = null; - }; - - MapEntry.prototype.isRemoved = function isRemoved() { - return this.key === empty; - }; - - var isMap = function isMap(map) { - return !!map._es6map; - }; - - var requireMapSlot = function requireMapSlot(map, method) { - if (!ES.TypeIsObject(map) || !isMap(map)) { - throw new TypeError('Method Map.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(map)); - } - }; - - var MapIterator = function MapIterator(map, kind) { - requireMapSlot(map, '[[MapIterator]]'); - this.head = map._head; - this.i = this.head; - this.kind = kind; - }; - - MapIterator.prototype = { - next: function next() { - var i = this.i; - var kind = this.kind; - var head = this.head; - if (typeof this.i === 'undefined') { - return iteratorResult(); - } - while (i.isRemoved() && i !== head) { - // back up off of removed entries - i = i.prev; - } - // advance to next unreturned element. - var result; - while (i.next !== head) { - i = i.next; - if (!i.isRemoved()) { - if (kind === 'key') { - result = i.key; - } else if (kind === 'value') { - result = i.value; - } else { - result = [i.key, i.value]; - } - this.i = i; - return iteratorResult(result); - } - } - // once the iterator is done, it is done forever. - this.i = void 0; - return iteratorResult(); - } - }; - addIterator(MapIterator.prototype); - - var Map$prototype; - var MapShim = function Map() { - if (!(this instanceof Map)) { - throw new TypeError('Constructor Map requires "new"'); - } - if (this && this._es6map) { - throw new TypeError('Bad construction'); - } - var map = emulateES6construct(this, Map, Map$prototype, { - _es6map: true, - _head: null, - _map: OrigMap ? new OrigMap() : null, - _size: 0, - _storage: emptyObject() - }); - - var head = new MapEntry(null, null); - // circular doubly-linked list. - /* eslint no-multi-assign: 1 */ - head.next = head.prev = head; - map._head = head; - - // Optionally initialize map from iterable - if (arguments.length > 0) { - addIterableToMap(Map, map, arguments[0]); - } - return map; - }; - Map$prototype = MapShim.prototype; - - Value.getter(Map$prototype, 'size', function () { - if (typeof this._size === 'undefined') { - throw new TypeError('size method called on incompatible Map'); - } - return this._size; - }); - - defineProperties(Map$prototype, { - get: function get(key) { - requireMapSlot(this, 'get'); - var entry; - var fkey = fastkey(key, true); - if (fkey !== null) { - // fast O(1) path - entry = this._storage[fkey]; - if (entry) { - return entry.value; - } else { - return; - } - } - if (this._map) { - // fast object key path - entry = origMapGet.call(this._map, key); - if (entry) { - return entry.value; - } else { - return; - } - } - var head = this._head; - var i = head; - while ((i = i.next) !== head) { - if (ES.SameValueZero(i.key, key)) { - return i.value; - } - } - }, - - has: function has(key) { - requireMapSlot(this, 'has'); - var fkey = fastkey(key, true); - if (fkey !== null) { - // fast O(1) path - return typeof this._storage[fkey] !== 'undefined'; - } - if (this._map) { - // fast object key path - return origMapHas.call(this._map, key); - } - var head = this._head; - var i = head; - while ((i = i.next) !== head) { - if (ES.SameValueZero(i.key, key)) { - return true; - } - } - return false; - }, - - set: function set(key, value) { - requireMapSlot(this, 'set'); - var head = this._head; - var i = head; - var entry; - var fkey = fastkey(key, true); - if (fkey !== null) { - // fast O(1) path - if (typeof this._storage[fkey] !== 'undefined') { - this._storage[fkey].value = value; - return this; - } else { - entry = this._storage[fkey] = new MapEntry(key, value); /* eslint no-multi-assign: 1 */ - i = head.prev; - // fall through - } - } else if (this._map) { - // fast object key path - if (origMapHas.call(this._map, key)) { - origMapGet.call(this._map, key).value = value; - } else { - entry = new MapEntry(key, value); - origMapSet.call(this._map, key, entry); - i = head.prev; - // fall through - } - } - while ((i = i.next) !== head) { - if (ES.SameValueZero(i.key, key)) { - i.value = value; - return this; - } - } - entry = entry || new MapEntry(key, value); - if (ES.SameValue(-0, key)) { - entry.key = +0; // coerce -0 to +0 in entry - } - entry.next = this._head; - entry.prev = this._head.prev; - entry.prev.next = entry; - entry.next.prev = entry; - this._size += 1; - return this; - }, - - 'delete': function (key) { - requireMapSlot(this, 'delete'); - var head = this._head; - var i = head; - var fkey = fastkey(key, true); - if (fkey !== null) { - // fast O(1) path - if (typeof this._storage[fkey] === 'undefined') { - return false; - } - i = this._storage[fkey].prev; - delete this._storage[fkey]; - // fall through - } else if (this._map) { - // fast object key path - if (!origMapHas.call(this._map, key)) { - return false; - } - i = origMapGet.call(this._map, key).prev; - origMapDelete.call(this._map, key); - // fall through - } - while ((i = i.next) !== head) { - if (ES.SameValueZero(i.key, key)) { - i.key = empty; - i.value = empty; - i.prev.next = i.next; - i.next.prev = i.prev; - this._size -= 1; - return true; - } - } - return false; - }, - - clear: function clear() { - /* eslint no-multi-assign: 1 */ - requireMapSlot(this, 'clear'); - this._map = OrigMap ? new OrigMap() : null; - this._size = 0; - this._storage = emptyObject(); - var head = this._head; - var i = head; - var p = i.next; - while ((i = p) !== head) { - i.key = empty; - i.value = empty; - p = i.next; - i.next = i.prev = head; - } - head.next = head.prev = head; - }, - - keys: function keys() { - requireMapSlot(this, 'keys'); - return new MapIterator(this, 'key'); - }, - - values: function values() { - requireMapSlot(this, 'values'); - return new MapIterator(this, 'value'); - }, - - entries: function entries() { - requireMapSlot(this, 'entries'); - return new MapIterator(this, 'key+value'); - }, - - forEach: function forEach(callback) { - requireMapSlot(this, 'forEach'); - var context = arguments.length > 1 ? arguments[1] : null; - var it = this.entries(); - for (var entry = it.next(); !entry.done; entry = it.next()) { - if (context) { - _call(callback, context, entry.value[1], entry.value[0], this); - } else { - callback(entry.value[1], entry.value[0], this); - } - } - } - }); - addIterator(Map$prototype, Map$prototype.entries); - - return MapShim; - }()), - - Set: (function () { - var isSet = function isSet(set) { - return set._es6set && typeof set._storage !== 'undefined'; - }; - var requireSetSlot = function requireSetSlot(set, method) { - if (!ES.TypeIsObject(set) || !isSet(set)) { - // https://github.com/paulmillr/es6-shim/issues/176 - throw new TypeError('Set.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(set)); - } - }; - - // Creating a Map is expensive. To speed up the common case of - // Sets containing only string or numeric keys, we use an object - // as backing storage and lazily create a full Map only when - // required. - var Set$prototype; - var SetShim = function Set() { - if (!(this instanceof Set)) { - throw new TypeError('Constructor Set requires "new"'); - } - if (this && this._es6set) { - throw new TypeError('Bad construction'); - } - var set = emulateES6construct(this, Set, Set$prototype, { - _es6set: true, - '[[SetData]]': null, - _storage: emptyObject() - }); - if (!set._es6set) { - throw new TypeError('bad set'); - } - - // Optionally initialize Set from iterable - if (arguments.length > 0) { - addIterableToSet(Set, set, arguments[0]); - } - return set; - }; - Set$prototype = SetShim.prototype; - - var decodeKey = function (key) { - var k = key; - if (k === '^null') { - return null; - } else if (k === '^undefined') { - return void 0; - } else { - var first = k.charAt(0); - if (first === '$') { - return _strSlice(k, 1); - } else if (first === 'n') { - return +_strSlice(k, 1); - } else if (first === 'b') { - return k === 'btrue'; - } - } - return +k; - }; - // Switch from the object backing storage to a full Map. - var ensureMap = function ensureMap(set) { - if (!set['[[SetData]]']) { - var m = new collectionShims.Map(); - set['[[SetData]]'] = m; - _forEach(keys(set._storage), function (key) { - var k = decodeKey(key); - m.set(k, k); - }); - set['[[SetData]]'] = m; - } - set._storage = null; // free old backing storage - }; - - Value.getter(SetShim.prototype, 'size', function () { - requireSetSlot(this, 'size'); - if (this._storage) { - return keys(this._storage).length; - } - ensureMap(this); - return this['[[SetData]]'].size; - }); - - defineProperties(SetShim.prototype, { - has: function has(key) { - requireSetSlot(this, 'has'); - var fkey; - if (this._storage && (fkey = fastkey(key)) !== null) { - return !!this._storage[fkey]; - } - ensureMap(this); - return this['[[SetData]]'].has(key); - }, - - add: function add(key) { - requireSetSlot(this, 'add'); - var fkey; - if (this._storage && (fkey = fastkey(key)) !== null) { - this._storage[fkey] = true; - return this; - } - ensureMap(this); - this['[[SetData]]'].set(key, key); - return this; - }, - - 'delete': function (key) { - requireSetSlot(this, 'delete'); - var fkey; - if (this._storage && (fkey = fastkey(key)) !== null) { - var hasFKey = _hasOwnProperty(this._storage, fkey); - return (delete this._storage[fkey]) && hasFKey; - } - ensureMap(this); - return this['[[SetData]]']['delete'](key); - }, - - clear: function clear() { - requireSetSlot(this, 'clear'); - if (this._storage) { - this._storage = emptyObject(); - } - if (this['[[SetData]]']) { - this['[[SetData]]'].clear(); - } - }, - - values: function values() { - requireSetSlot(this, 'values'); - ensureMap(this); - return this['[[SetData]]'].values(); - }, - - entries: function entries() { - requireSetSlot(this, 'entries'); - ensureMap(this); - return this['[[SetData]]'].entries(); - }, - - forEach: function forEach(callback) { - requireSetSlot(this, 'forEach'); - var context = arguments.length > 1 ? arguments[1] : null; - var entireSet = this; - ensureMap(entireSet); - this['[[SetData]]'].forEach(function (value, key) { - if (context) { - _call(callback, context, key, key, entireSet); - } else { - callback(key, key, entireSet); - } - }); - } - }); - defineProperty(SetShim.prototype, 'keys', SetShim.prototype.values, true); - addIterator(SetShim.prototype, SetShim.prototype.values); - - return SetShim; - }()) - }; - - if (globals.Map || globals.Set) { - // Safari 8, for example, doesn't accept an iterable. - var mapAcceptsArguments = valueOrFalseIfThrows(function () { return new Map([[1, 2]]).get(1) === 2; }); - if (!mapAcceptsArguments) { - globals.Map = function Map() { - if (!(this instanceof Map)) { - throw new TypeError('Constructor Map requires "new"'); - } - var m = new OrigMap(); - if (arguments.length > 0) { - addIterableToMap(Map, m, arguments[0]); - } - delete m.constructor; - Object.setPrototypeOf(m, globals.Map.prototype); - return m; - }; - globals.Map.prototype = create(OrigMap.prototype); - defineProperty(globals.Map.prototype, 'constructor', globals.Map, true); - Value.preserveToString(globals.Map, OrigMap); - } - var testMap = new Map(); - var mapUsesSameValueZero = (function () { - // Chrome 38-42, node 0.11/0.12, iojs 1/2 also have a bug when the Map has a size > 4 - var m = new Map([[1, 0], [2, 0], [3, 0], [4, 0]]); - m.set(-0, m); - return m.get(0) === m && m.get(-0) === m && m.has(0) && m.has(-0); - }()); - var mapSupportsChaining = testMap.set(1, 2) === testMap; - if (!mapUsesSameValueZero || !mapSupportsChaining) { - overrideNative(Map.prototype, 'set', function set(k, v) { - _call(origMapSet, this, k === 0 ? 0 : k, v); - return this; - }); - } - if (!mapUsesSameValueZero) { - defineProperties(Map.prototype, { - get: function get(k) { - return _call(origMapGet, this, k === 0 ? 0 : k); - }, - has: function has(k) { - return _call(origMapHas, this, k === 0 ? 0 : k); - } - }, true); - Value.preserveToString(Map.prototype.get, origMapGet); - Value.preserveToString(Map.prototype.has, origMapHas); - } - var testSet = new Set(); - var setUsesSameValueZero = (function (s) { - s['delete'](0); - s.add(-0); - return !s.has(0); - }(testSet)); - var setSupportsChaining = testSet.add(1) === testSet; - if (!setUsesSameValueZero || !setSupportsChaining) { - var origSetAdd = Set.prototype.add; - Set.prototype.add = function add(v) { - _call(origSetAdd, this, v === 0 ? 0 : v); - return this; - }; - Value.preserveToString(Set.prototype.add, origSetAdd); - } - if (!setUsesSameValueZero) { - var origSetHas = Set.prototype.has; - Set.prototype.has = function has(v) { - return _call(origSetHas, this, v === 0 ? 0 : v); - }; - Value.preserveToString(Set.prototype.has, origSetHas); - var origSetDel = Set.prototype['delete']; - Set.prototype['delete'] = function SetDelete(v) { - return _call(origSetDel, this, v === 0 ? 0 : v); - }; - Value.preserveToString(Set.prototype['delete'], origSetDel); - } - var mapSupportsSubclassing = supportsSubclassing(globals.Map, function (M) { - var m = new M([]); - // Firefox 32 is ok with the instantiating the subclass but will - // throw when the map is used. - m.set(42, 42); - return m instanceof M; - }); - // without Object.setPrototypeOf, subclassing is not possible - var mapFailsToSupportSubclassing = Object.setPrototypeOf && !mapSupportsSubclassing; - var mapRequiresNew = (function () { - try { - return !(globals.Map() instanceof globals.Map); - } catch (e) { - return e instanceof TypeError; - } - }()); - if (globals.Map.length !== 0 || mapFailsToSupportSubclassing || !mapRequiresNew) { - globals.Map = function Map() { - if (!(this instanceof Map)) { - throw new TypeError('Constructor Map requires "new"'); - } - var m = new OrigMap(); - if (arguments.length > 0) { - addIterableToMap(Map, m, arguments[0]); - } - delete m.constructor; - Object.setPrototypeOf(m, Map.prototype); - return m; - }; - globals.Map.prototype = OrigMap.prototype; - defineProperty(globals.Map.prototype, 'constructor', globals.Map, true); - Value.preserveToString(globals.Map, OrigMap); - } - var setSupportsSubclassing = supportsSubclassing(globals.Set, function (S) { - var s = new S([]); - s.add(42, 42); - return s instanceof S; - }); - // without Object.setPrototypeOf, subclassing is not possible - var setFailsToSupportSubclassing = Object.setPrototypeOf && !setSupportsSubclassing; - var setRequiresNew = (function () { - try { - return !(globals.Set() instanceof globals.Set); - } catch (e) { - return e instanceof TypeError; - } - }()); - if (globals.Set.length !== 0 || setFailsToSupportSubclassing || !setRequiresNew) { - var OrigSet = globals.Set; - globals.Set = function Set() { - if (!(this instanceof Set)) { - throw new TypeError('Constructor Set requires "new"'); - } - var s = new OrigSet(); - if (arguments.length > 0) { - addIterableToSet(Set, s, arguments[0]); - } - delete s.constructor; - Object.setPrototypeOf(s, Set.prototype); - return s; - }; - globals.Set.prototype = OrigSet.prototype; - defineProperty(globals.Set.prototype, 'constructor', globals.Set, true); - Value.preserveToString(globals.Set, OrigSet); - } - var newMap = new globals.Map(); - var mapIterationThrowsStopIterator = !valueOrFalseIfThrows(function () { - return newMap.keys().next().done; - }); - /* - - In Firefox < 23, Map#size is a function. - - In all current Firefox, Set#entries/keys/values & Map#clear do not exist - - https://bugzilla.mozilla.org/show_bug.cgi?id=869996 - - In Firefox 24, Map and Set do not implement forEach - - In Firefox 25 at least, Map and Set are callable without "new" - */ - if ( - typeof globals.Map.prototype.clear !== 'function' || - new globals.Set().size !== 0 || - newMap.size !== 0 || - typeof globals.Map.prototype.keys !== 'function' || - typeof globals.Set.prototype.keys !== 'function' || - typeof globals.Map.prototype.forEach !== 'function' || - typeof globals.Set.prototype.forEach !== 'function' || - isCallableWithoutNew(globals.Map) || - isCallableWithoutNew(globals.Set) || - typeof newMap.keys().next !== 'function' || // Safari 8 - mapIterationThrowsStopIterator || // Firefox 25 - !mapSupportsSubclassing - ) { - defineProperties(globals, { - Map: collectionShims.Map, - Set: collectionShims.Set - }, true); - } - - if (globals.Set.prototype.keys !== globals.Set.prototype.values) { - // Fixed in WebKit with https://bugs.webkit.org/show_bug.cgi?id=144190 - defineProperty(globals.Set.prototype, 'keys', globals.Set.prototype.values, true); - } - - // Shim incomplete iterator implementations. - addIterator(Object.getPrototypeOf((new globals.Map()).keys())); - addIterator(Object.getPrototypeOf((new globals.Set()).keys())); - - if (functionsHaveNames && globals.Set.prototype.has.name !== 'has') { - // Microsoft Edge v0.11.10074.0 is missing a name on Set#has - var anonymousSetHas = globals.Set.prototype.has; - overrideNative(globals.Set.prototype, 'has', function has(key) { - return _call(anonymousSetHas, this, key); - }); - } - } - defineProperties(globals, collectionShims); - addDefaultSpecies(globals.Map); - addDefaultSpecies(globals.Set); - } - - var throwUnlessTargetIsObject = function throwUnlessTargetIsObject(target) { - if (!ES.TypeIsObject(target)) { - throw new TypeError('target must be an object'); - } - }; - - // Some Reflect methods are basically the same as - // those on the Object global, except that a TypeError is thrown if - // target isn't an object. As well as returning a boolean indicating - // the success of the operation. - var ReflectShims = { - // Apply method in a functional form. - apply: function apply() { - return ES.Call(ES.Call, null, arguments); - }, - - // New operator in a functional form. - construct: function construct(constructor, args) { - if (!ES.IsConstructor(constructor)) { - throw new TypeError('First argument must be a constructor.'); - } - var newTarget = arguments.length > 2 ? arguments[2] : constructor; - if (!ES.IsConstructor(newTarget)) { - throw new TypeError('new.target must be a constructor.'); - } - return ES.Construct(constructor, args, newTarget, 'internal'); - }, - - // When deleting a non-existent or configurable property, - // true is returned. - // When attempting to delete a non-configurable property, - // it will return false. - deleteProperty: function deleteProperty(target, key) { - throwUnlessTargetIsObject(target); - if (supportsDescriptors) { - var desc = Object.getOwnPropertyDescriptor(target, key); - - if (desc && !desc.configurable) { - return false; - } - } - - // Will return true. - return delete target[key]; - }, - - has: function has(target, key) { - throwUnlessTargetIsObject(target); - return key in target; - } - }; - - if (Object.getOwnPropertyNames) { - Object.assign(ReflectShims, { - // Basically the result of calling the internal [[OwnPropertyKeys]]. - // Concatenating propertyNames and propertySymbols should do the trick. - // This should continue to work together with a Symbol shim - // which overrides Object.getOwnPropertyNames and implements - // Object.getOwnPropertySymbols. - ownKeys: function ownKeys(target) { - throwUnlessTargetIsObject(target); - var keys = Object.getOwnPropertyNames(target); - - if (ES.IsCallable(Object.getOwnPropertySymbols)) { - _pushApply(keys, Object.getOwnPropertySymbols(target)); - } - - return keys; - } - }); - } - - var callAndCatchException = function ConvertExceptionToBoolean(func) { - return !throwsError(func); - }; - - if (Object.preventExtensions) { - Object.assign(ReflectShims, { - isExtensible: function isExtensible(target) { - throwUnlessTargetIsObject(target); - return Object.isExtensible(target); - }, - preventExtensions: function preventExtensions(target) { - throwUnlessTargetIsObject(target); - return callAndCatchException(function () { - Object.preventExtensions(target); - }); - } - }); - } - - if (supportsDescriptors) { - var internalGet = function get(target, key, receiver) { - var desc = Object.getOwnPropertyDescriptor(target, key); - - if (!desc) { - var parent = Object.getPrototypeOf(target); - - if (parent === null) { - return void 0; - } - - return internalGet(parent, key, receiver); - } - - if ('value' in desc) { - return desc.value; - } - - if (desc.get) { - return ES.Call(desc.get, receiver); - } - - return void 0; - }; - - var internalSet = function set(target, key, value, receiver) { - var desc = Object.getOwnPropertyDescriptor(target, key); - - if (!desc) { - var parent = Object.getPrototypeOf(target); - - if (parent !== null) { - return internalSet(parent, key, value, receiver); - } - - desc = { - value: void 0, - writable: true, - enumerable: true, - configurable: true - }; - } - - if ('value' in desc) { - if (!desc.writable) { - return false; - } - - if (!ES.TypeIsObject(receiver)) { - return false; - } - - var existingDesc = Object.getOwnPropertyDescriptor(receiver, key); - - if (existingDesc) { - return Reflect.defineProperty(receiver, key, { - value: value - }); - } else { - return Reflect.defineProperty(receiver, key, { - value: value, - writable: true, - enumerable: true, - configurable: true - }); - } - } - - if (desc.set) { - _call(desc.set, receiver, value); - return true; - } - - return false; - }; - - Object.assign(ReflectShims, { - defineProperty: function defineProperty(target, propertyKey, attributes) { - throwUnlessTargetIsObject(target); - return callAndCatchException(function () { - Object.defineProperty(target, propertyKey, attributes); - }); - }, - - getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { - throwUnlessTargetIsObject(target); - return Object.getOwnPropertyDescriptor(target, propertyKey); - }, - - // Syntax in a functional form. - get: function get(target, key) { - throwUnlessTargetIsObject(target); - var receiver = arguments.length > 2 ? arguments[2] : target; - - return internalGet(target, key, receiver); - }, - - set: function set(target, key, value) { - throwUnlessTargetIsObject(target); - var receiver = arguments.length > 3 ? arguments[3] : target; - - return internalSet(target, key, value, receiver); - } - }); - } - - if (Object.getPrototypeOf) { - var objectDotGetPrototypeOf = Object.getPrototypeOf; - ReflectShims.getPrototypeOf = function getPrototypeOf(target) { - throwUnlessTargetIsObject(target); - return objectDotGetPrototypeOf(target); - }; - } - - if (Object.setPrototypeOf && ReflectShims.getPrototypeOf) { - var willCreateCircularPrototype = function (object, lastProto) { - var proto = lastProto; - while (proto) { - if (object === proto) { - return true; - } - proto = ReflectShims.getPrototypeOf(proto); - } - return false; - }; - - Object.assign(ReflectShims, { - // Sets the prototype of the given object. - // Returns true on success, otherwise false. - setPrototypeOf: function setPrototypeOf(object, proto) { - throwUnlessTargetIsObject(object); - if (proto !== null && !ES.TypeIsObject(proto)) { - throw new TypeError('proto must be an object or null'); - } - - // If they already are the same, we're done. - if (proto === Reflect.getPrototypeOf(object)) { - return true; - } - - // Cannot alter prototype if object not extensible. - if (Reflect.isExtensible && !Reflect.isExtensible(object)) { - return false; - } - - // Ensure that we do not create a circular prototype chain. - if (willCreateCircularPrototype(object, proto)) { - return false; - } - - Object.setPrototypeOf(object, proto); - - return true; - } - }); - } - var defineOrOverrideReflectProperty = function (key, shim) { - if (!ES.IsCallable(globals.Reflect[key])) { - defineProperty(globals.Reflect, key, shim); - } else { - var acceptsPrimitives = valueOrFalseIfThrows(function () { - globals.Reflect[key](1); - globals.Reflect[key](NaN); - globals.Reflect[key](true); - return true; - }); - if (acceptsPrimitives) { - overrideNative(globals.Reflect, key, shim); - } - } - }; - Object.keys(ReflectShims).forEach(function (key) { - defineOrOverrideReflectProperty(key, ReflectShims[key]); - }); - var originalReflectGetProto = globals.Reflect.getPrototypeOf; - if (functionsHaveNames && originalReflectGetProto && originalReflectGetProto.name !== 'getPrototypeOf') { - overrideNative(globals.Reflect, 'getPrototypeOf', function getPrototypeOf(target) { - return _call(originalReflectGetProto, globals.Reflect, target); - }); - } - if (globals.Reflect.setPrototypeOf) { - if (valueOrFalseIfThrows(function () { - globals.Reflect.setPrototypeOf(1, {}); - return true; - })) { - overrideNative(globals.Reflect, 'setPrototypeOf', ReflectShims.setPrototypeOf); - } - } - if (globals.Reflect.defineProperty) { - if (!valueOrFalseIfThrows(function () { - var basic = !globals.Reflect.defineProperty(1, 'test', { value: 1 }); - // "extensible" fails on Edge 0.12 - var extensible = typeof Object.preventExtensions !== 'function' || !globals.Reflect.defineProperty(Object.preventExtensions({}), 'test', {}); - return basic && extensible; - })) { - overrideNative(globals.Reflect, 'defineProperty', ReflectShims.defineProperty); - } - } - if (globals.Reflect.construct) { - if (!valueOrFalseIfThrows(function () { - var F = function F() {}; - return globals.Reflect.construct(function () {}, [], F) instanceof F; - })) { - overrideNative(globals.Reflect, 'construct', ReflectShims.construct); - } - } - - if (String(new Date(NaN)) !== 'Invalid Date') { - var dateToString = Date.prototype.toString; - var shimmedDateToString = function toString() { - var valueOf = +this; - if (valueOf !== valueOf) { - return 'Invalid Date'; - } - return ES.Call(dateToString, this); - }; - overrideNative(Date.prototype, 'toString', shimmedDateToString); - } - - // Annex B HTML methods - // http://www.ecma-international.org/ecma-262/6.0/#sec-additional-properties-of-the-string.prototype-object - var stringHTMLshims = { - anchor: function anchor(name) { return ES.CreateHTML(this, 'a', 'name', name); }, - big: function big() { return ES.CreateHTML(this, 'big', '', ''); }, - blink: function blink() { return ES.CreateHTML(this, 'blink', '', ''); }, - bold: function bold() { return ES.CreateHTML(this, 'b', '', ''); }, - fixed: function fixed() { return ES.CreateHTML(this, 'tt', '', ''); }, - fontcolor: function fontcolor(color) { return ES.CreateHTML(this, 'font', 'color', color); }, - fontsize: function fontsize(size) { return ES.CreateHTML(this, 'font', 'size', size); }, - italics: function italics() { return ES.CreateHTML(this, 'i', '', ''); }, - link: function link(url) { return ES.CreateHTML(this, 'a', 'href', url); }, - small: function small() { return ES.CreateHTML(this, 'small', '', ''); }, - strike: function strike() { return ES.CreateHTML(this, 'strike', '', ''); }, - sub: function sub() { return ES.CreateHTML(this, 'sub', '', ''); }, - sup: function sub() { return ES.CreateHTML(this, 'sup', '', ''); } - }; - _forEach(Object.keys(stringHTMLshims), function (key) { - var method = String.prototype[key]; - var shouldOverwrite = false; - if (ES.IsCallable(method)) { - var output = _call(method, '', ' " '); - var quotesCount = _concat([], output.match(/"/g)).length; - shouldOverwrite = output !== output.toLowerCase() || quotesCount > 2; - } else { - shouldOverwrite = true; - } - if (shouldOverwrite) { - overrideNative(String.prototype, key, stringHTMLshims[key]); - } - }); - - var JSONstringifiesSymbols = (function () { - // Microsoft Edge v0.12 stringifies Symbols incorrectly - if (!hasSymbols) { return false; } // Symbols are not supported - var stringify = typeof JSON === 'object' && typeof JSON.stringify === 'function' ? JSON.stringify : null; - if (!stringify) { return false; } // JSON.stringify is not supported - if (typeof stringify(Symbol()) !== 'undefined') { return true; } // Symbols should become `undefined` - if (stringify([Symbol()]) !== '[null]') { return true; } // Symbols in arrays should become `null` - var obj = { a: Symbol() }; - obj[Symbol()] = true; - if (stringify(obj) !== '{}') { return true; } // Symbol-valued keys *and* Symbol-valued properties should be omitted - return false; - }()); - var JSONstringifyAcceptsObjectSymbol = valueOrFalseIfThrows(function () { - // Chrome 45 throws on stringifying object symbols - if (!hasSymbols) { return true; } // Symbols are not supported - return JSON.stringify(Object(Symbol())) === '{}' && JSON.stringify([Object(Symbol())]) === '[{}]'; - }); - if (JSONstringifiesSymbols || !JSONstringifyAcceptsObjectSymbol) { - var origStringify = JSON.stringify; - overrideNative(JSON, 'stringify', function stringify(value) { - if (typeof value === 'symbol') { return; } - var replacer; - if (arguments.length > 1) { - replacer = arguments[1]; - } - var args = [value]; - if (!isArray(replacer)) { - var replaceFn = ES.IsCallable(replacer) ? replacer : null; - var wrappedReplacer = function (key, val) { - var parsedValue = replaceFn ? _call(replaceFn, this, key, val) : val; - if (typeof parsedValue !== 'symbol') { - if (Type.symbol(parsedValue)) { - return assignTo({})(parsedValue); - } else { - return parsedValue; - } - } - }; - args.push(wrappedReplacer); - } else { - // create wrapped replacer that handles an array replacer? - args.push(replacer); - } - if (arguments.length > 2) { - args.push(arguments[2]); - } - return origStringify.apply(this, args); - }); - } - - return globals; -})); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22), __webpack_require__(44))) - -/***/ }), -/* 340 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var supportsDescriptors = __webpack_require__(31).supportsDescriptors; -var functionsHaveNames = __webpack_require__(171); -var getPolyfill = __webpack_require__(344); -var defineProperty = Object.defineProperty; -var TypeErr = TypeError; - -module.exports = function shimName() { - var polyfill = getPolyfill(); - if (functionsHaveNames) { - return polyfill; - } - if (!supportsDescriptors) { - throw new TypeErr('Shimming Function.prototype.name support requires ES5 property descriptor support.'); - } - var functionProto = Function.prototype; - defineProperty(functionProto, 'name', { - configurable: true, - enumerable: false, - get: function () { - var name = polyfill.call(this); - if (this !== functionProto) { - defineProperty(this, 'name', { - configurable: true, - enumerable: false, - value: name, - writable: false - }); - } - return name; - } - }); - return polyfill; -}; - - -/***/ }), -/* 341 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// modified from https://github.com/es-shims/es5-shim -var has = Object.prototype.hasOwnProperty; -var toStr = Object.prototype.toString; -var slice = Array.prototype.slice; -var isArgs = __webpack_require__(342); -var isEnumerable = Object.prototype.propertyIsEnumerable; -var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); -var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); -var dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' -]; -var equalsConstructorPrototype = function (o) { - var ctor = o.constructor; - return ctor && ctor.prototype === o; -}; -var excludedKeys = { - $console: true, - $external: true, - $frame: true, - $frameElement: true, - $frames: true, - $innerHeight: true, - $innerWidth: true, - $outerHeight: true, - $outerWidth: true, - $pageXOffset: true, - $pageYOffset: true, - $parent: true, - $scrollLeft: true, - $scrollTop: true, - $scrollX: true, - $scrollY: true, - $self: true, - $webkitIndexedDB: true, - $webkitStorageInfo: true, - $window: true -}; -var hasAutomationEqualityBug = (function () { - /* global window */ - if (typeof window === 'undefined') { return false; } - for (var k in window) { - try { - if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { - try { - equalsConstructorPrototype(window[k]); - } catch (e) { - return true; - } - } - } catch (e) { - return true; - } - } - return false; -}()); -var equalsConstructorPrototypeIfNotBuggy = function (o) { - /* global window */ - if (typeof window === 'undefined' || !hasAutomationEqualityBug) { - return equalsConstructorPrototype(o); - } - try { - return equalsConstructorPrototype(o); - } catch (e) { - return false; - } -}; - -var keysShim = function keys(object) { - var isObject = object !== null && typeof object === 'object'; - var isFunction = toStr.call(object) === '[object Function]'; - var isArguments = isArgs(object); - var isString = isObject && toStr.call(object) === '[object String]'; - var theKeys = []; - - if (!isObject && !isFunction && !isArguments) { - throw new TypeError('Object.keys called on a non-object'); - } - - var skipProto = hasProtoEnumBug && isFunction; - if (isString && object.length > 0 && !has.call(object, 0)) { - for (var i = 0; i < object.length; ++i) { - theKeys.push(String(i)); - } - } - - if (isArguments && object.length > 0) { - for (var j = 0; j < object.length; ++j) { - theKeys.push(String(j)); - } - } else { - for (var name in object) { - if (!(skipProto && name === 'prototype') && has.call(object, name)) { - theKeys.push(String(name)); - } - } - } - - if (hasDontEnumBug) { - var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); - - for (var k = 0; k < dontEnums.length; ++k) { - if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { - theKeys.push(dontEnums[k]); - } - } - } - return theKeys; -}; - -keysShim.shim = function shimObjectKeys() { - if (Object.keys) { - var keysWorksWithArguments = (function () { - // Safari 5.0 bug - return (Object.keys(arguments) || '').length === 2; - }(1, 2)); - if (!keysWorksWithArguments) { - var originalKeys = Object.keys; - Object.keys = function keys(object) { - if (isArgs(object)) { - return originalKeys(slice.call(object)); - } else { - return originalKeys(object); - } - }; - } - } else { - Object.keys = keysShim; - } - return Object.keys || keysShim; -}; - -module.exports = keysShim; - - -/***/ }), -/* 342 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var toStr = Object.prototype.toString; - -module.exports = function isArguments(value) { - var str = toStr.call(value); - var isArgs = str === '[object Arguments]'; - if (!isArgs) { - isArgs = str !== '[object Array]' && - value !== null && - typeof value === 'object' && - typeof value.length === 'number' && - value.length >= 0 && - toStr.call(value.callee) === '[object Function]'; - } - return isArgs; -}; - - -/***/ }), -/* 343 */ -/***/ (function(module, exports) { - - -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; - -module.exports = function forEach (obj, fn, ctx) { - if (toString.call(fn) !== '[object Function]') { - throw new TypeError('iterator must be a function'); - } - var l = obj.length; - if (l === +l) { - for (var i = 0; i < l; i++) { - fn.call(ctx, obj[i], i, obj); - } - } else { - for (var k in obj) { - if (hasOwn.call(obj, k)) { - fn.call(ctx, obj[k], k, obj); - } - } - } -}; - - - -/***/ }), -/* 344 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var implementation = __webpack_require__(345); - -module.exports = function getPolyfill() { - return implementation; -}; - - -/***/ }), -/* 345 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var isCallable = __webpack_require__(78); -var functionsHaveNames = __webpack_require__(171); -var bind = __webpack_require__(32); -var functionToString = bind.call(Function.call, Function.prototype.toString); -var stringMatch = bind.call(Function.call, String.prototype.match); - -var classRegex = /^class /; - -var isClass = function isClassConstructor(fn) { - if (isCallable(fn)) { - return false; - } - if (typeof fn !== 'function') { - return false; - } - try { - var match = stringMatch(functionToString(fn), classRegex); - return !!match; - } catch (e) {} - return false; -}; - -var regex = /\s*function\s+([^(\s]*)\s*/; - -var functionProto = Function.prototype; - -module.exports = function getName() { - if (!isClass(this) && !isCallable(this)) { - throw new TypeError('Function.prototype.name sham getter called on non-function'); - } - if (functionsHaveNames) { - return this.name; - } - if (this === functionProto) { - return ''; - } - var str = functionToString(this); - var match = stringMatch(str, regex); - var name = match && match[1]; - return name; -}; - - -/***/ }), -/* 346 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* eslint no-invalid-this: 1 */ - -var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; -var slice = Array.prototype.slice; -var toStr = Object.prototype.toString; -var funcType = '[object Function]'; - -module.exports = function bind(that) { - var target = this; - if (typeof target !== 'function' || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - - var bound; - var binder = function () { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push('$' + i); - } - - bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); - - if (target.prototype) { - var Empty = function Empty() {}; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - - return bound; -}; - - -/***/ }), -/* 347 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// Array#includes is stage 4, in ES7/ES2016 -__webpack_require__(348)(); - -__webpack_require__(359); - - -/***/ }), -/* 348 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var define = __webpack_require__(31); -var getPolyfill = __webpack_require__(349); - -module.exports = function shimArrayPrototypeIncludes() { - var polyfill = getPolyfill(); - define( - Array.prototype, - { includes: polyfill }, - { includes: function () { return Array.prototype.includes !== polyfill; } } - ); - return polyfill; -}; - - -/***/ }), -/* 349 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var implementation = __webpack_require__(350); - -module.exports = function getPolyfill() { - return Array.prototype.includes || implementation; -}; - - -/***/ }), -/* 350 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) { - -var ES = __webpack_require__(351); -var $isNaN = Number.isNaN || function isNaN(a) { - return a !== a; -}; -var $isFinite = Number.isFinite || function isFinite(n) { - return typeof n === 'number' && global.isFinite(n); -}; -var indexOf = Array.prototype.indexOf; - -module.exports = function includes(searchElement) { - var fromIndex = arguments.length > 1 ? ES.ToInteger(arguments[1]) : 0; - if (indexOf && !$isNaN(searchElement) && $isFinite(fromIndex) && typeof searchElement !== 'undefined') { - return indexOf.apply(this, arguments) > -1; - } - - var O = ES.ToObject(this); - var length = ES.ToLength(O.length); - if (length === 0) { - return false; - } - var k = fromIndex >= 0 ? fromIndex : Math.max(0, length + fromIndex); - while (k < length) { - if (ES.SameValueZero(searchElement, O[k])) { - return true; - } - k += 1; - } - return false; -}; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22))) - -/***/ }), -/* 351 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = __webpack_require__(172); - - -/***/ }), -/* 352 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; - -var isPrimitive = __webpack_require__(173); -var isCallable = __webpack_require__(78); -var isDate = __webpack_require__(353); -var isSymbol = __webpack_require__(354); - -var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { - if (typeof O === 'undefined' || O === null) { - throw new TypeError('Cannot call method on ' + O); - } - if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { - throw new TypeError('hint must be "string" or "number"'); - } - var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; - var method, result, i; - for (i = 0; i < methodNames.length; ++i) { - method = O[methodNames[i]]; - if (isCallable(method)) { - result = method.call(O); - if (isPrimitive(result)) { - return result; - } - } - } - throw new TypeError('No default value'); -}; - -var GetMethod = function GetMethod(O, P) { - var func = O[P]; - if (func !== null && typeof func !== 'undefined') { - if (!isCallable(func)) { - throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); - } - return func; - } -}; - -// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive -module.exports = function ToPrimitive(input, PreferredType) { - if (isPrimitive(input)) { - return input; - } - var hint = 'default'; - if (arguments.length > 1) { - if (PreferredType === String) { - hint = 'string'; - } else if (PreferredType === Number) { - hint = 'number'; - } - } - - var exoticToPrim; - if (hasSymbols) { - if (Symbol.toPrimitive) { - exoticToPrim = GetMethod(input, Symbol.toPrimitive); - } else if (isSymbol(input)) { - exoticToPrim = Symbol.prototype.valueOf; - } - } - if (typeof exoticToPrim !== 'undefined') { - var result = exoticToPrim.call(input, hint); - if (isPrimitive(result)) { - return result; - } - throw new TypeError('unable to convert exotic object to primitive'); - } - if (hint === 'default' && (isDate(input) || isSymbol(input))) { - hint = 'string'; - } - return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); -}; - - -/***/ }), -/* 353 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var getDay = Date.prototype.getDay; -var tryDateObject = function tryDateObject(value) { - try { - getDay.call(value); - return true; - } catch (e) { - return false; - } -}; - -var toStr = Object.prototype.toString; -var dateClass = '[object Date]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isDateObject(value) { - if (typeof value !== 'object' || value === null) { return false; } - return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; -}; - - -/***/ }), -/* 354 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var toStr = Object.prototype.toString; -var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; - -if (hasSymbols) { - var symToStr = Symbol.prototype.toString; - var symStringRegex = /^Symbol\(.*\)$/; - var isSymbolObject = function isSymbolObject(value) { - if (typeof value.valueOf() !== 'symbol') { return false; } - return symStringRegex.test(symToStr.call(value)); - }; - module.exports = function isSymbol(value) { - if (typeof value === 'symbol') { return true; } - if (toStr.call(value) !== '[object Symbol]') { return false; } - try { - return isSymbolObject(value); - } catch (e) { - return false; - } - }; -} else { - module.exports = function isSymbol(value) { - // this environment does not support Symbols. - return false; - }; -} - - -/***/ }), -/* 355 */ -/***/ (function(module, exports) { - -module.exports = function isPrimitive(value) { - return value === null || (typeof value !== 'function' && typeof value !== 'object'); -}; - - -/***/ }), -/* 356 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var $isNaN = __webpack_require__(174); -var $isFinite = __webpack_require__(175); - -var sign = __webpack_require__(177); -var mod = __webpack_require__(178); - -var IsCallable = __webpack_require__(78); -var toPrimitive = __webpack_require__(357); - -var has = __webpack_require__(59); - -// https://es5.github.io/#x9 -var ES5 = { - ToPrimitive: toPrimitive, - - ToBoolean: function ToBoolean(value) { - return !!value; - }, - ToNumber: function ToNumber(value) { - return Number(value); - }, - ToInteger: function ToInteger(value) { - var number = this.ToNumber(value); - if ($isNaN(number)) { return 0; } - if (number === 0 || !$isFinite(number)) { return number; } - return sign(number) * Math.floor(Math.abs(number)); - }, - ToInt32: function ToInt32(x) { - return this.ToNumber(x) >> 0; - }, - ToUint32: function ToUint32(x) { - return this.ToNumber(x) >>> 0; - }, - ToUint16: function ToUint16(value) { - var number = this.ToNumber(value); - if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } - var posInt = sign(number) * Math.floor(Math.abs(number)); - return mod(posInt, 0x10000); - }, - ToString: function ToString(value) { - return String(value); - }, - ToObject: function ToObject(value) { - this.CheckObjectCoercible(value); - return Object(value); - }, - CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { - /* jshint eqnull:true */ - if (value == null) { - throw new TypeError(optMessage || 'Cannot call method on ' + value); - } - return value; - }, - IsCallable: IsCallable, - SameValue: function SameValue(x, y) { - if (x === y) { // 0 === -0, but they are not identical. - if (x === 0) { return 1 / x === 1 / y; } - return true; - } - return $isNaN(x) && $isNaN(y); - }, - - // http://www.ecma-international.org/ecma-262/5.1/#sec-8 - Type: function Type(x) { - if (x === null) { - return 'Null'; - } - if (typeof x === 'undefined') { - return 'Undefined'; - } - if (typeof x === 'function' || typeof x === 'object') { - return 'Object'; - } - if (typeof x === 'number') { - return 'Number'; - } - if (typeof x === 'boolean') { - return 'Boolean'; - } - if (typeof x === 'string') { - return 'String'; - } - }, - - // http://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type - IsPropertyDescriptor: function IsPropertyDescriptor(Desc) { - if (this.Type(Desc) !== 'Object') { - return false; - } - var allowed = { - '[[Configurable]]': true, - '[[Enumerable]]': true, - '[[Get]]': true, - '[[Set]]': true, - '[[Value]]': true, - '[[Writable]]': true - }; - // jscs:disable - for (var key in Desc) { // eslint-disable-line - if (has(Desc, key) && !allowed[key]) { - return false; - } - } - // jscs:enable - var isData = has(Desc, '[[Value]]'); - var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); - if (isData && IsAccessor) { - throw new TypeError('Property Descriptors may not be both accessor and data descriptors'); - } - return true; - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.1 - IsAccessorDescriptor: function IsAccessorDescriptor(Desc) { - if (typeof Desc === 'undefined') { - return false; - } - - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { - return false; - } - - return true; - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.2 - IsDataDescriptor: function IsDataDescriptor(Desc) { - if (typeof Desc === 'undefined') { - return false; - } - - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { - return false; - } - - return true; - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.3 - IsGenericDescriptor: function IsGenericDescriptor(Desc) { - if (typeof Desc === 'undefined') { - return false; - } - - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) { - return true; - } - - return false; - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.4 - FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { - if (typeof Desc === 'undefined') { - return Desc; - } - - if (!this.IsPropertyDescriptor(Desc)) { - throw new TypeError('Desc must be a Property Descriptor'); - } - - if (this.IsDataDescriptor(Desc)) { - return { - value: Desc['[[Value]]'], - writable: !!Desc['[[Writable]]'], - enumerable: !!Desc['[[Enumerable]]'], - configurable: !!Desc['[[Configurable]]'] - }; - } else if (this.IsAccessorDescriptor(Desc)) { - return { - get: Desc['[[Get]]'], - set: Desc['[[Set]]'], - enumerable: !!Desc['[[Enumerable]]'], - configurable: !!Desc['[[Configurable]]'] - }; - } else { - throw new TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); - } - }, - - // http://ecma-international.org/ecma-262/5.1/#sec-8.10.5 - ToPropertyDescriptor: function ToPropertyDescriptor(Obj) { - if (this.Type(Obj) !== 'Object') { - throw new TypeError('ToPropertyDescriptor requires an object'); - } - - var desc = {}; - if (has(Obj, 'enumerable')) { - desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable); - } - if (has(Obj, 'configurable')) { - desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable); - } - if (has(Obj, 'value')) { - desc['[[Value]]'] = Obj.value; - } - if (has(Obj, 'writable')) { - desc['[[Writable]]'] = this.ToBoolean(Obj.writable); - } - if (has(Obj, 'get')) { - var getter = Obj.get; - if (typeof getter !== 'undefined' && !this.IsCallable(getter)) { - throw new TypeError('getter must be a function'); - } - desc['[[Get]]'] = getter; - } - if (has(Obj, 'set')) { - var setter = Obj.set; - if (typeof setter !== 'undefined' && !this.IsCallable(setter)) { - throw new TypeError('setter must be a function'); - } - desc['[[Set]]'] = setter; - } - - if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { - throw new TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); - } - return desc; - } -}; - -module.exports = ES5; - - -/***/ }), -/* 357 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var toStr = Object.prototype.toString; - -var isPrimitive = __webpack_require__(173); - -var isCallable = __webpack_require__(78); - -// https://es5.github.io/#x8.12 -var ES5internalSlots = { - '[[DefaultValue]]': function (O, hint) { - var actualHint = hint || (toStr.call(O) === '[object Date]' ? String : Number); - - if (actualHint === String || actualHint === Number) { - var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; - var value, i; - for (i = 0; i < methods.length; ++i) { - if (isCallable(O[methods[i]])) { - value = O[methods[i]](); - if (isPrimitive(value)) { - return value; - } - } - } - throw new TypeError('No default value'); - } - throw new TypeError('invalid [[DefaultValue]] hint supplied'); - } -}; - -// https://es5.github.io/#x9 -module.exports = function ToPrimitive(input, PreferredType) { - if (isPrimitive(input)) { - return input; - } - return ES5internalSlots['[[DefaultValue]]'](input, PreferredType); -}; - - -/***/ }), -/* 358 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var has = __webpack_require__(59); -var regexExec = RegExp.prototype.exec; -var gOPD = Object.getOwnPropertyDescriptor; - -var tryRegexExecCall = function tryRegexExec(value) { - try { - var lastIndex = value.lastIndex; - value.lastIndex = 0; - - regexExec.call(value); - return true; - } catch (e) { - return false; - } finally { - value.lastIndex = lastIndex; - } -}; -var toStr = Object.prototype.toString; -var regexClass = '[object RegExp]'; -var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; - -module.exports = function isRegex(value) { - if (!value || typeof value !== 'object') { - return false; - } - if (!hasToStringTag) { - return toStr.call(value) === regexClass; - } - - var descriptor = gOPD(value, 'lastIndex'); - var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); - if (!hasLastIndexDataProperty) { - return false; - } - - return tryRegexExecCall(value); -}; - - -/***/ }), -/* 359 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// Object.values/Object.entries are stage 4, in ES2017 -__webpack_require__(360)(); -__webpack_require__(364)(); - -// String#padStart/String#padEnd are stage 4, in ES2017 -__webpack_require__(367)(); -__webpack_require__(370)(); - -// Object.getOwnPropertyDescriptors is stage 4, in ES2017 -__webpack_require__(373)(); - -__webpack_require__(376); - - -/***/ }), -/* 360 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var getPolyfill = __webpack_require__(361); -var define = __webpack_require__(31); - -module.exports = function shimValues() { - var polyfill = getPolyfill(); - define(Object, { values: polyfill }, { - values: function testValues() { - return Object.values !== polyfill; - } - }); - return polyfill; -}; - - -/***/ }), -/* 361 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var implementation = __webpack_require__(362); - -module.exports = function getPolyfill() { - return typeof Object.values === 'function' ? Object.values : implementation; -}; - - -/***/ }), -/* 362 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var ES = __webpack_require__(50); -var has = __webpack_require__(59); -var bind = __webpack_require__(32); -var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); - -module.exports = function values(O) { - var obj = ES.RequireObjectCoercible(O); - var vals = []; - for (var key in obj) { - if (has(obj, key) && isEnumerable(obj, key)) { - vals.push(obj[key]); - } - } - return vals; -}; - - -/***/ }), -/* 363 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var ES2015 = __webpack_require__(172); -var assign = __webpack_require__(176); - -var ES2016 = assign(assign({}, ES2015), { - // https://github.com/tc39/ecma262/pull/60 - SameValueNonNumber: function SameValueNonNumber(x, y) { - if (typeof x === 'number' || typeof x !== typeof y) { - throw new TypeError('SameValueNonNumber requires two non-number values of the same type.'); - } - return this.SameValue(x, y); - } -}); - -module.exports = ES2016; - - -/***/ }), -/* 364 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var getPolyfill = __webpack_require__(365); -var define = __webpack_require__(31); - -module.exports = function shimEntries() { - var polyfill = getPolyfill(); - define(Object, { entries: polyfill }, { - entries: function testEntries() { - return Object.entries !== polyfill; - } - }); - return polyfill; -}; - - -/***/ }), -/* 365 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var implementation = __webpack_require__(366); - -module.exports = function getPolyfill() { - return typeof Object.entries === 'function' ? Object.entries : implementation; -}; - - -/***/ }), -/* 366 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var ES = __webpack_require__(50); -var has = __webpack_require__(59); -var bind = __webpack_require__(32); -var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); - -module.exports = function entries(O) { - var obj = ES.RequireObjectCoercible(O); - var entrys = []; - for (var key in obj) { - if (has(obj, key) && isEnumerable(obj, key)) { - entrys.push([key, obj[key]]); - } - } - return entrys; -}; - - -/***/ }), -/* 367 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var getPolyfill = __webpack_require__(368); -var define = __webpack_require__(31); - -module.exports = function shimPadStart() { - var polyfill = getPolyfill(); - define(String.prototype, { padStart: polyfill }, { padStart: function () { return String.prototype.padStart !== polyfill; } }); - return polyfill; -}; - - -/***/ }), -/* 368 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var implementation = __webpack_require__(369); - -module.exports = function getPolyfill() { - return typeof String.prototype.padStart === 'function' ? String.prototype.padStart : implementation; -}; - - -/***/ }), -/* 369 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var bind = __webpack_require__(32); -var ES = __webpack_require__(50); -var slice = bind.call(Function.call, String.prototype.slice); - -module.exports = function padStart(maxLength) { - var O = ES.RequireObjectCoercible(this); - var S = ES.ToString(O); - var stringLength = ES.ToLength(S.length); - var fillString; - if (arguments.length > 1) { - fillString = arguments[1]; - } - var filler = typeof fillString === 'undefined' ? '' : ES.ToString(fillString); - if (filler === '') { - filler = ' '; - } - var intMaxLength = ES.ToLength(maxLength); - if (intMaxLength <= stringLength) { - return S; - } - var fillLen = intMaxLength - stringLength; - while (filler.length < fillLen) { - var fLen = filler.length; - var remainingCodeUnits = fillLen - fLen; - filler += fLen > remainingCodeUnits ? slice(filler, 0, remainingCodeUnits) : filler; - } - - var truncatedStringFiller = filler.length > fillLen ? slice(filler, 0, fillLen) : filler; - return truncatedStringFiller + S; -}; - - -/***/ }), -/* 370 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var getPolyfill = __webpack_require__(371); -var define = __webpack_require__(31); - -module.exports = function shimPadEnd() { - var polyfill = getPolyfill(); - define(String.prototype, { padEnd: polyfill }, { padEnd: function () { return String.prototype.padEnd !== polyfill; } }); - return polyfill; -}; - - -/***/ }), -/* 371 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var implementation = __webpack_require__(372); - -module.exports = function getPolyfill() { - return typeof String.prototype.padEnd === 'function' ? String.prototype.padEnd : implementation; -}; - - -/***/ }), -/* 372 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var bind = __webpack_require__(32); -var ES = __webpack_require__(50); -var slice = bind.call(Function.call, String.prototype.slice); - -module.exports = function padEnd(maxLength) { - var O = ES.RequireObjectCoercible(this); - var S = ES.ToString(O); - var stringLength = ES.ToLength(S.length); - var fillString; - if (arguments.length > 1) { - fillString = arguments[1]; - } - var filler = typeof fillString === 'undefined' ? '' : ES.ToString(fillString); - if (filler === '') { - filler = ' '; - } - var intMaxLength = ES.ToLength(maxLength); - if (intMaxLength <= stringLength) { - return S; - } - var fillLen = intMaxLength - stringLength; - while (filler.length < fillLen) { - var fLen = filler.length; - var remainingCodeUnits = fillLen - fLen; - filler += fLen > remainingCodeUnits ? slice(filler, 0, remainingCodeUnits) : filler; - } - - var truncatedStringFiller = filler.length > fillLen ? slice(filler, 0, fillLen) : filler; - return S + truncatedStringFiller; -}; - - -/***/ }), -/* 373 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var getPolyfill = __webpack_require__(374); -var define = __webpack_require__(31); - -module.exports = function shimGetOwnPropertyDescriptors() { - var polyfill = getPolyfill(); - define( - Object, - { getOwnPropertyDescriptors: polyfill }, - { getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill; } } - ); - return polyfill; -}; - - -/***/ }), -/* 374 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var implementation = __webpack_require__(375); - -module.exports = function getPolyfill() { - return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation; -}; - - -/***/ }), -/* 375 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var ES = __webpack_require__(50); - -var defineProperty = Object.defineProperty; -var getDescriptor = Object.getOwnPropertyDescriptor; -var getOwnNames = Object.getOwnPropertyNames; -var getSymbols = Object.getOwnPropertySymbols; -var concat = Function.call.bind(Array.prototype.concat); -var reduce = Function.call.bind(Array.prototype.reduce); -var getAll = getSymbols ? function (obj) { - return concat(getOwnNames(obj), getSymbols(obj)); -} : getOwnNames; - -var isES5 = ES.IsCallable(getDescriptor) && ES.IsCallable(getOwnNames); - -var safePut = function put(obj, prop, val) { // eslint-disable-line max-params - if (defineProperty && prop in obj) { - defineProperty(obj, prop, { - configurable: true, - enumerable: true, - value: val, - writable: true - }); - } else { - obj[prop] = val; - } -}; - -module.exports = function getOwnPropertyDescriptors(value) { - ES.RequireObjectCoercible(value); - if (!isES5) { - throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor'); - } - - var O = ES.ToObject(value); - return reduce(getAll(O), function (acc, key) { - var descriptor = getDescriptor(O, key); - if (typeof descriptor !== 'undefined') { - safePut(acc, key, descriptor); - } - return acc; - }, {}); -}; - - -/***/ }), -/* 376 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// Promise.prototype.finally is stage 3, a possible candidate for ES2018 -if (typeof Promise === 'function') { - __webpack_require__(377)(); // eslint-disable-line global-require -} - - -/***/ }), -/* 377 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var requirePromise = __webpack_require__(109); - -var getPolyfill = __webpack_require__(378); -var define = __webpack_require__(31); - -module.exports = function shimPromiseFinally() { - requirePromise(); - - var polyfill = getPolyfill(); - define(Promise.prototype, { 'finally': polyfill }, { - 'finally': function testFinally() { - return Promise.prototype['finally'] !== polyfill; - } - }); - return polyfill; -}; - - -/***/ }), -/* 378 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var requirePromise = __webpack_require__(109); - -var implementation = __webpack_require__(379); - -module.exports = function getPolyfill() { - requirePromise(); - return typeof Promise.prototype['finally'] === 'function' ? Promise.prototype['finally'] : implementation; -}; - - -/***/ }), -/* 379 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var requirePromise = __webpack_require__(109); - -requirePromise(); - -var ES = __webpack_require__(50); -var bind = __webpack_require__(32); - -var promiseResolve = function PromiseResolve(C, value) { - return new C(function (resolve) { - resolve(value); - }); -}; - -var OriginalPromise = Promise; - -var createThenFinally = function CreateThenFinally(C, onFinally) { - return function (value) { - var result = onFinally(); - var promise = promiseResolve(C, result); - var valueThunk = function () { - return value; - }; - return promise.then(valueThunk); - }; -}; - -var createCatchFinally = function CreateCatchFinally(C, onFinally) { - return function (reason) { - var result = onFinally(); - var promise = promiseResolve(C, result); - var thrower = function () { - throw reason; - }; - return promise.then(thrower); - }; -}; - -var then = bind.call(Function.call, OriginalPromise.prototype.then); - -var promiseFinally = function finally_(onFinally) { - /* eslint no-invalid-this: 0 */ - - var promise = this; - - then(then(promise), null, function () {}); // throw if IsPromise(this) is false; catch() to avoid unhandled rejection warnings - - var C = ES.SpeciesConstructor(promise, OriginalPromise); // may throw - - var thenFinally = onFinally; - var catchFinally = onFinally; - if (ES.IsCallable(onFinally)) { - thenFinally = createThenFinally(C, onFinally); - catchFinally = createCatchFinally(C, onFinally); - } - - return promise.then(thenFinally, catchFinally); -}; - -if (Object.getOwnPropertyDescriptor) { - var descriptor = Object.getOwnPropertyDescriptor(promiseFinally, 'name'); - if (descriptor && descriptor.configurable) { - Object.defineProperty(promiseFinally, 'name', { configurable: true, value: 'finally' }); - } -} - -module.exports = promiseFinally; - - -/***/ }), -/* 380 */, -/* 381 */, -/* 382 */, -/* 383 */, -/* 384 */, -/* 385 */ -/***/ (function(module, exports) { - -// Source: http://jsfiddle.net/vWx8V/ -// http://stackoverflow.com/questions/5603195/full-list-of-javascript-keycodes - -/** - * Conenience method returns corresponding value for given keyName or keyCode. - * - * @param {Mixed} keyCode {Number} or keyName {String} - * @return {Mixed} - * @api public - */ - -exports = module.exports = function(searchInput) { - // Keyboard Events - if (searchInput && 'object' === typeof searchInput) { - var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode - if (hasKeyCode) searchInput = hasKeyCode - } - - // Numbers - if ('number' === typeof searchInput) return names[searchInput] - - // Everything else (cast to string) - var search = String(searchInput) - - // check codes - var foundNamedKey = codes[search.toLowerCase()] - if (foundNamedKey) return foundNamedKey - - // check aliases - var foundNamedKey = aliases[search.toLowerCase()] - if (foundNamedKey) return foundNamedKey - - // weird character? - if (search.length === 1) return search.charCodeAt(0) - - return undefined -} - -/** - * Get by name - * - * exports.code['enter'] // => 13 - */ - -var codes = exports.code = exports.codes = { - 'backspace': 8, - 'tab': 9, - 'enter': 13, - 'shift': 16, - 'ctrl': 17, - 'alt': 18, - 'pause/break': 19, - 'caps lock': 20, - 'esc': 27, - 'space': 32, - 'page up': 33, - 'page down': 34, - 'end': 35, - 'home': 36, - 'left': 37, - 'up': 38, - 'right': 39, - 'down': 40, - 'insert': 45, - 'delete': 46, - 'command': 91, - 'left command': 91, - 'right command': 93, - 'numpad *': 106, - 'numpad +': 107, - 'numpad -': 109, - 'numpad .': 110, - 'numpad /': 111, - 'num lock': 144, - 'scroll lock': 145, - 'my computer': 182, - 'my calculator': 183, - ';': 186, - '=': 187, - ',': 188, - '-': 189, - '.': 190, - '/': 191, - '`': 192, - '[': 219, - '\\': 220, - ']': 221, - "'": 222 -} - -// Helper aliases - -var aliases = exports.aliases = { - 'windows': 91, - '⇧': 16, - '⌥': 18, - '⌃': 17, - '⌘': 91, - 'ctl': 17, - 'control': 17, - 'option': 18, - 'pause': 19, - 'break': 19, - 'caps': 20, - 'return': 13, - 'escape': 27, - 'spc': 32, - 'pgup': 33, - 'pgdn': 34, - 'ins': 45, - 'del': 46, - 'cmd': 91 -} - - -/*! - * Programatically add the following - */ - -// lower case chars -for (i = 97; i < 123; i++) codes[String.fromCharCode(i)] = i - 32 - -// numbers -for (var i = 48; i < 58; i++) codes[i - 48] = i - -// function keys -for (i = 1; i < 13; i++) codes['f'+i] = i + 111 - -// numpad keys -for (i = 0; i < 10; i++) codes['numpad '+i] = i + 96 - -/** - * Get by code - * - * exports.name[13] // => 'Enter' - */ - -var names = exports.names = exports.title = {} // title for backward compat - -// Create reverse mapping -for (i in codes) names[codes[i]] = i - -// Add aliases -for (var alias in aliases) { - codes[alias] = aliases[alias] -} - - -/***/ }), -/* 386 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -/* globals __REACT_DEVTOOLS_GLOBAL_HOOK__*/ - - - -var ReactDOMComponentTree = __webpack_require__(9); -var ReactDefaultInjection = __webpack_require__(387); -var ReactMount = __webpack_require__(207); -var ReactReconciler = __webpack_require__(51); -var ReactUpdates = __webpack_require__(26); -var ReactVersion = __webpack_require__(462); - -var findDOMNode = __webpack_require__(463); -var getHostComponentFromComposite = __webpack_require__(208); -var renderSubtreeIntoContainer = __webpack_require__(464); -var warning = __webpack_require__(2); - -ReactDefaultInjection.inject(); - -var ReactDOM = { - findDOMNode: findDOMNode, - render: ReactMount.render, - unmountComponentAtNode: ReactMount.unmountComponentAtNode, - version: ReactVersion, - - /* eslint-disable camelcase */ - unstable_batchedUpdates: ReactUpdates.batchedUpdates, - unstable_renderSubtreeIntoContainer: renderSubtreeIntoContainer - /* eslint-enable camelcase */ -}; - -// Inject the runtime into a devtools global hook regardless of browser. -// Allows for debugging when the hook is injected on the page. -if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject === 'function') { - __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ - ComponentTree: { - getClosestInstanceFromNode: ReactDOMComponentTree.getClosestInstanceFromNode, - getNodeFromInstance: function (inst) { - // inst is an internal instance (but could be a composite) - if (inst._renderedComponent) { - inst = getHostComponentFromComposite(inst); - } - if (inst) { - return ReactDOMComponentTree.getNodeFromInstance(inst); - } else { - return null; - } - } - }, - Mount: ReactMount, - Reconciler: ReactReconciler - }); -} - -if (true) { - var ExecutionEnvironment = __webpack_require__(13); - if (ExecutionEnvironment.canUseDOM && window.top === window.self) { - // First check if devtools is not installed - if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { - // If we're in Chrome or Firefox, provide a download link if not installed. - if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) { - // Firefox does not have the issue with devtools loaded over file:// - var showFileUrlMessage = window.location.protocol.indexOf('http') === -1 && navigator.userAgent.indexOf('Firefox') === -1; - console.debug('Download the React DevTools ' + (showFileUrlMessage ? 'and use an HTTP server (instead of a file: URL) ' : '') + 'for a better development experience: ' + 'https://fb.me/react-devtools'); - } - } - - var testFunc = function testFn() {}; - true ? warning((testFunc.name || testFunc.toString()).indexOf('testFn') !== -1, "It looks like you're using a minified copy of the development build " + 'of React. When deploying React apps to production, make sure to use ' + 'the production build which skips development warnings and is faster. ' + 'See https://fb.me/react-minification for more details.') : void 0; - - // If we're in IE8, check to see if we are in compatibility mode and provide - // information on preventing compatibility mode - var ieCompatibilityMode = document.documentMode && document.documentMode < 8; - - true ? warning(!ieCompatibilityMode, 'Internet Explorer is running in compatibility mode; please add the ' + 'following tag to your HTML to prevent this from happening: ' + '<meta http-equiv="X-UA-Compatible" content="IE=edge" />') : void 0; - - var expectedFeatures = [ - // shims - Array.isArray, Array.prototype.every, Array.prototype.forEach, Array.prototype.indexOf, Array.prototype.map, Date.now, Function.prototype.bind, Object.keys, String.prototype.trim]; - - for (var i = 0; i < expectedFeatures.length; i++) { - if (!expectedFeatures[i]) { - true ? warning(false, 'One or more ES5 shims expected by React are not available: ' + 'https://fb.me/react-warning-polyfills') : void 0; - break; - } - } - } -} - -if (true) { - var ReactInstrumentation = __webpack_require__(19); - var ReactDOMUnknownPropertyHook = __webpack_require__(465); - var ReactDOMNullInputValuePropHook = __webpack_require__(466); - var ReactDOMInvalidARIAHook = __webpack_require__(467); - - ReactInstrumentation.debugTool.addHook(ReactDOMUnknownPropertyHook); - ReactInstrumentation.debugTool.addHook(ReactDOMNullInputValuePropHook); - ReactInstrumentation.debugTool.addHook(ReactDOMInvalidARIAHook); -} - -module.exports = ReactDOM; - -/***/ }), -/* 387 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ARIADOMPropertyConfig = __webpack_require__(388); -var BeforeInputEventPlugin = __webpack_require__(389); -var ChangeEventPlugin = __webpack_require__(393); -var DefaultEventPluginOrder = __webpack_require__(401); -var EnterLeaveEventPlugin = __webpack_require__(402); -var HTMLDOMPropertyConfig = __webpack_require__(403); -var ReactComponentBrowserEnvironment = __webpack_require__(404); -var ReactDOMComponent = __webpack_require__(410); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactDOMEmptyComponent = __webpack_require__(433); -var ReactDOMTreeTraversal = __webpack_require__(434); -var ReactDOMTextComponent = __webpack_require__(435); -var ReactDefaultBatchingStrategy = __webpack_require__(436); -var ReactEventListener = __webpack_require__(437); -var ReactInjection = __webpack_require__(439); -var ReactReconcileTransaction = __webpack_require__(440); -var SVGDOMPropertyConfig = __webpack_require__(446); -var SelectEventPlugin = __webpack_require__(447); -var SimpleEventPlugin = __webpack_require__(448); - -var alreadyInjected = false; - -function inject() { - if (alreadyInjected) { - // TODO: This is currently true because these injections are shared between - // the client and the server package. They should be built independently - // and not share any injection state. Then this problem will be solved. - return; - } - alreadyInjected = true; - - ReactInjection.EventEmitter.injectReactEventListener(ReactEventListener); - - /** - * Inject modules for resolving DOM hierarchy and plugin ordering. - */ - ReactInjection.EventPluginHub.injectEventPluginOrder(DefaultEventPluginOrder); - ReactInjection.EventPluginUtils.injectComponentTree(ReactDOMComponentTree); - ReactInjection.EventPluginUtils.injectTreeTraversal(ReactDOMTreeTraversal); - - /** - * Some important event plugins included by default (without having to require - * them). - */ - ReactInjection.EventPluginHub.injectEventPluginsByName({ - SimpleEventPlugin: SimpleEventPlugin, - EnterLeaveEventPlugin: EnterLeaveEventPlugin, - ChangeEventPlugin: ChangeEventPlugin, - SelectEventPlugin: SelectEventPlugin, - BeforeInputEventPlugin: BeforeInputEventPlugin - }); - - ReactInjection.HostComponent.injectGenericComponentClass(ReactDOMComponent); - - ReactInjection.HostComponent.injectTextComponentClass(ReactDOMTextComponent); - - ReactInjection.DOMProperty.injectDOMPropertyConfig(ARIADOMPropertyConfig); - ReactInjection.DOMProperty.injectDOMPropertyConfig(HTMLDOMPropertyConfig); - ReactInjection.DOMProperty.injectDOMPropertyConfig(SVGDOMPropertyConfig); - - ReactInjection.EmptyComponent.injectEmptyComponentFactory(function (instantiate) { - return new ReactDOMEmptyComponent(instantiate); - }); - - ReactInjection.Updates.injectReconcileTransaction(ReactReconcileTransaction); - ReactInjection.Updates.injectBatchingStrategy(ReactDefaultBatchingStrategy); - - ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment); -} - -module.exports = { - inject: inject -}; - -/***/ }), -/* 388 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ARIADOMPropertyConfig = { - Properties: { - // Global States and Properties - 'aria-current': 0, // state - 'aria-details': 0, - 'aria-disabled': 0, // state - 'aria-hidden': 0, // state - 'aria-invalid': 0, // state - 'aria-keyshortcuts': 0, - 'aria-label': 0, - 'aria-roledescription': 0, - // Widget Attributes - 'aria-autocomplete': 0, - 'aria-checked': 0, - 'aria-expanded': 0, - 'aria-haspopup': 0, - 'aria-level': 0, - 'aria-modal': 0, - 'aria-multiline': 0, - 'aria-multiselectable': 0, - 'aria-orientation': 0, - 'aria-placeholder': 0, - 'aria-pressed': 0, - 'aria-readonly': 0, - 'aria-required': 0, - 'aria-selected': 0, - 'aria-sort': 0, - 'aria-valuemax': 0, - 'aria-valuemin': 0, - 'aria-valuenow': 0, - 'aria-valuetext': 0, - // Live Region Attributes - 'aria-atomic': 0, - 'aria-busy': 0, - 'aria-live': 0, - 'aria-relevant': 0, - // Drag-and-Drop Attributes - 'aria-dropeffect': 0, - 'aria-grabbed': 0, - // Relationship Attributes - 'aria-activedescendant': 0, - 'aria-colcount': 0, - 'aria-colindex': 0, - 'aria-colspan': 0, - 'aria-controls': 0, - 'aria-describedby': 0, - 'aria-errormessage': 0, - 'aria-flowto': 0, - 'aria-labelledby': 0, - 'aria-owns': 0, - 'aria-posinset': 0, - 'aria-rowcount': 0, - 'aria-rowindex': 0, - 'aria-rowspan': 0, - 'aria-setsize': 0 - }, - DOMAttributeNames: {}, - DOMPropertyNames: {} -}; - -module.exports = ARIADOMPropertyConfig; - -/***/ }), -/* 389 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var EventPropagators = __webpack_require__(60); -var ExecutionEnvironment = __webpack_require__(13); -var FallbackCompositionState = __webpack_require__(390); -var SyntheticCompositionEvent = __webpack_require__(391); -var SyntheticInputEvent = __webpack_require__(392); - -var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space -var START_KEYCODE = 229; - -var canUseCompositionEvent = ExecutionEnvironment.canUseDOM && 'CompositionEvent' in window; - -var documentMode = null; -if (ExecutionEnvironment.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 = ExecutionEnvironment.canUseDOM && 'TextEvent' in window && !documentMode && !isPresto(); - -// 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 = ExecutionEnvironment.canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); - -/** - * Opera <= 12 includes TextEvent in window, but does not fire - * text input events. Rely on keypress instead. - */ -function isPresto() { - var opera = window.opera; - return typeof opera === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12; -} - -var SPACEBAR_CODE = 32; -var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); - -// Events and their corresponding property names. -var eventTypes = { - beforeInput: { - phasedRegistrationNames: { - bubbled: 'onBeforeInput', - captured: 'onBeforeInputCapture' - }, - dependencies: ['topCompositionEnd', 'topKeyPress', 'topTextInput', 'topPaste'] - }, - compositionEnd: { - phasedRegistrationNames: { - bubbled: 'onCompositionEnd', - captured: 'onCompositionEndCapture' - }, - dependencies: ['topBlur', 'topCompositionEnd', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] - }, - compositionStart: { - phasedRegistrationNames: { - bubbled: 'onCompositionStart', - captured: 'onCompositionStartCapture' - }, - dependencies: ['topBlur', 'topCompositionStart', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] - }, - compositionUpdate: { - phasedRegistrationNames: { - bubbled: 'onCompositionUpdate', - captured: 'onCompositionUpdateCapture' - }, - dependencies: ['topBlur', 'topCompositionUpdate', 'topKeyDown', 'topKeyPress', 'topKeyUp', 'topMouseDown'] - } -}; - -// 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 'topCompositionStart': - return eventTypes.compositionStart; - case 'topCompositionEnd': - return eventTypes.compositionEnd; - case 'topCompositionUpdate': - return eventTypes.compositionUpdate; - } -} - -/** - * Does our fallback best-guess model think this event signifies that - * composition has begun? - * - * @param {string} topLevelType - * @param {object} nativeEvent - * @return {boolean} - */ -function isFallbackCompositionStart(topLevelType, nativeEvent) { - return topLevelType === 'topKeyDown' && nativeEvent.keyCode === START_KEYCODE; -} - -/** - * Does our fallback mode think that this event is the end of composition? - * - * @param {string} topLevelType - * @param {object} nativeEvent - * @return {boolean} - */ -function isFallbackCompositionEnd(topLevelType, nativeEvent) { - switch (topLevelType) { - case 'topKeyUp': - // Command keys insert or clear IME input. - return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; - case 'topKeyDown': - // Expect IME keyCode on each keydown. If we get any other - // code we must have exited earlier. - return nativeEvent.keyCode !== START_KEYCODE; - case 'topKeyPress': - case 'topMouseDown': - case 'topBlur': - // 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; -} - -// Track the current IME composition fallback object, if any. -var currentComposition = null; - -/** - * @return {?object} A SyntheticCompositionEvent. - */ -function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var eventType; - var fallbackData; - - if (canUseCompositionEvent) { - eventType = getCompositionEventType(topLevelType); - } else if (!currentComposition) { - if (isFallbackCompositionStart(topLevelType, nativeEvent)) { - eventType = eventTypes.compositionStart; - } - } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) { - eventType = eventTypes.compositionEnd; - } - - if (!eventType) { - return null; - } - - if (useFallbackCompositionData) { - // The current composition is stored statically and must not be - // overwritten while composition continues. - if (!currentComposition && eventType === eventTypes.compositionStart) { - currentComposition = FallbackCompositionState.getPooled(nativeEventTarget); - } else if (eventType === eventTypes.compositionEnd) { - if (currentComposition) { - fallbackData = currentComposition.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; - } - } - - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; -} - -/** - * @param {string} topLevelType Record from `EventConstants`. - * @param {object} nativeEvent Native browser event. - * @return {?string} The string corresponding to this `beforeInput` event. - */ -function getNativeBeforeInputChars(topLevelType, nativeEvent) { - switch (topLevelType) { - case 'topCompositionEnd': - return getDataFromCustomEvent(nativeEvent); - case 'topKeyPress': - /** - * If native `textInput` events are available, our goal is to make - * use of them. However, there is a special case: the spacebar key. - * In Webkit, preventing default on a spacebar `textInput` event - * cancels character insertion, but it *also* causes the browser - * to fall back to its default spacebar behavior of scrolling the - * page. - * - * Tracking at: - * https://code.google.com/p/chromium/issues/detail?id=355103 - * - * To avoid this issue, use the keypress event as if no `textInput` - * event is available. - */ - var which = nativeEvent.which; - if (which !== SPACEBAR_CODE) { - return null; - } - - hasSpaceKeypress = true; - return SPACEBAR_CHAR; - - case 'topTextInput': - // 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 blacklist 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 {string} topLevelType Record from `EventConstants`. - * @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 (currentComposition) { - if (topLevelType === 'topCompositionEnd' || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) { - var chars = currentComposition.getData(); - FallbackCompositionState.release(currentComposition); - currentComposition = null; - return chars; - } - return null; - } - - switch (topLevelType) { - case 'topPaste': - // If a paste event occurs after a keypress, throw out the input - // chars. Paste events should not lead to BeforeInput events. - return null; - case 'topKeyPress': - /** - * As of v27, Firefox may fire keypress events even when no character - * will be inserted. A few possibilities: - * - * - `which` is `0`. Arrow keys, Esc key, etc. - * - * - `which` is the pressed key code, but no char is available. - * Ex: 'AltGr + d` in Polish. There is no modified character for - * this key combination and no character is inserted into the - * document, but FF fires the keypress for char code `100` anyway. - * No `input` event will occur. - * - * - `which` is the pressed key code, but a command combination is - * being used. Ex: `Cmd+C`. No character is inserted, and no - * `input` event will occur. - */ - if (nativeEvent.which && !isKeypressCommand(nativeEvent)) { - return String.fromCharCode(nativeEvent.which); - } - return null; - case 'topCompositionEnd': - return useFallbackCompositionData ? 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; - - 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; - EventPropagators.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) { - return [extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget), extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget)]; - } -}; - -module.exports = BeforeInputEventPlugin; - -/***/ }), -/* 390 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var PooledClass = __webpack_require__(38); - -var getTextContentAccessor = __webpack_require__(184); - -/** - * This helper class stores 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. - * - * @param {DOMEventTarget} root - */ -function FallbackCompositionState(root) { - this._root = root; - this._startText = this.getText(); - this._fallbackText = null; -} - -_assign(FallbackCompositionState.prototype, { - destructor: function () { - this._root = null; - this._startText = null; - this._fallbackText = null; - }, - - /** - * Get current text of input. - * - * @return {string} - */ - getText: function () { - if ('value' in this._root) { - return this._root.value; - } - return this._root[getTextContentAccessor()]; - }, - - /** - * Determine the differing substring between the initially stored - * text content and the current content. - * - * @return {string} - */ - getData: function () { - if (this._fallbackText) { - return this._fallbackText; - } - - var start; - var startValue = this._startText; - var startLength = startValue.length; - var end; - var endValue = this.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; - this._fallbackText = endValue.slice(start, sliceTail); - return this._fallbackText; - } -}); - -PooledClass.addPoolingTo(FallbackCompositionState); - -module.exports = FallbackCompositionState; - -/***/ }), -/* 391 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticEvent = __webpack_require__(29); - -/** - * @interface Event - * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents - */ -var CompositionEventInterface = { - data: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticCompositionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent.augmentClass(SyntheticCompositionEvent, CompositionEventInterface); - -module.exports = SyntheticCompositionEvent; - -/***/ }), -/* 392 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticEvent = __webpack_require__(29); - -/** - * @interface Event - * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 - * /#events-inputevents - */ -var InputEventInterface = { - data: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticInputEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent.augmentClass(SyntheticInputEvent, InputEventInterface); - -module.exports = SyntheticInputEvent; - -/***/ }), -/* 393 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var EventPluginHub = __webpack_require__(61); -var EventPropagators = __webpack_require__(60); -var ExecutionEnvironment = __webpack_require__(13); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactUpdates = __webpack_require__(26); -var SyntheticEvent = __webpack_require__(29); - -var inputValueTracking = __webpack_require__(187); -var getEventTarget = __webpack_require__(113); -var isEventSupported = __webpack_require__(114); -var isTextInputElement = __webpack_require__(188); - -var eventTypes = { - change: { - phasedRegistrationNames: { - bubbled: 'onChange', - captured: 'onChangeCapture' - }, - dependencies: ['topBlur', 'topChange', 'topClick', 'topFocus', 'topInput', 'topKeyDown', 'topKeyUp', 'topSelectionChange'] - } -}; - -function createAndAccumulateChangeEvent(inst, nativeEvent, target) { - var event = SyntheticEvent.getPooled(eventTypes.change, inst, nativeEvent, target); - event.type = 'change'; - EventPropagators.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'; -} - -var doesChangeEventBubble = false; -if (ExecutionEnvironment.canUseDOM) { - // See `handleChange` comment below - doesChangeEventBubble = isEventSupported('change') && (!document.documentMode || document.documentMode > 8); -} - -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. - ReactUpdates.batchedUpdates(runEventInBatch, event); -} - -function runEventInBatch(event) { - EventPluginHub.enqueueEvents(event); - EventPluginHub.processEventQueue(false); -} - -function startWatchingForChangeEventIE8(target, targetInst) { - activeElement = target; - activeElementInst = targetInst; - activeElement.attachEvent('onchange', manualDispatchChangeEvent); -} - -function stopWatchingForChangeEventIE8() { - if (!activeElement) { - return; - } - activeElement.detachEvent('onchange', manualDispatchChangeEvent); - activeElement = null; - activeElementInst = null; -} - -function getInstIfValueChanged(targetInst, nativeEvent) { - var updated = inputValueTracking.updateValueIfChanged(targetInst); - var simulated = nativeEvent.simulated === true && ChangeEventPlugin._allowSimulatedPassThrough; - - if (updated || simulated) { - return targetInst; - } -} - -function getTargetInstForChangeEvent(topLevelType, targetInst) { - if (topLevelType === 'topChange') { - return targetInst; - } -} - -function handleEventsForChangeEventIE8(topLevelType, target, targetInst) { - if (topLevelType === 'topFocus') { - // stopWatching() should be a noop here but we call it just in case we - // missed a blur event somehow. - stopWatchingForChangeEventIE8(); - startWatchingForChangeEventIE8(target, targetInst); - } else if (topLevelType === 'topBlur') { - stopWatchingForChangeEventIE8(); - } -} - -/** - * SECTION: handle `input` event - */ -var isInputEventSupported = false; -if (ExecutionEnvironment.canUseDOM) { - // IE9 claims to support the input event but fails to trigger it when - // deleting text, so we ignore its input events. - - isInputEventSupported = isEventSupported('input') && (!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, nativeEvent)) { - manualDispatchChangeEvent(nativeEvent); - } -} - -function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) { - if (topLevelType === 'topFocus') { - // In IE8, we can capture almost all .value changes by adding a - // propertychange handler and looking for events with propertyName - // equal to 'value' - // In IE9, propertychange fires for most input events but is buggy and - // doesn't fire when text is deleted, but conveniently, selectionchange - // appears to fire in all of the remaining cases so we catch those and - // forward the event if the value has changed - // In either case, we don't want to call the event handler if the value - // is changed from JS so we redefine a setter for `.value` that updates - // our activeElementValue variable, allowing us to ignore those changes - // - // stopWatching() should be a noop here but we call it just in case we - // missed a blur event somehow. - stopWatchingForValueChange(); - startWatchingForValueChange(target, targetInst); - } else if (topLevelType === 'topBlur') { - stopWatchingForValueChange(); - } -} - -// For IE8 and IE9. -function getTargetInstForInputEventPolyfill(topLevelType, targetInst, nativeEvent) { - if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') { - // On the selectionchange event, the target is just document which isn't - // helpful for us so just check activeElement instead. - // - // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire - // propertychange on the first input event after setting `value` from a - // script and fires only keydown, keypress, keyup. Catching keyup usually - // gets it and catching keydown lets us fire an event for the first - // keystroke if user does a key repeat (it'll be a little delayed: right - // before the second keystroke). Other input methods (e.g., paste) seem to - // fire selectionchange normally. - return getInstIfValueChanged(activeElementInst, nativeEvent); - } -} - -/** - * 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, nativeEvent) { - if (topLevelType === 'topClick') { - return getInstIfValueChanged(targetInst, nativeEvent); - } -} - -function getTargetInstForInputOrChangeEvent(topLevelType, targetInst, nativeEvent) { - if (topLevelType === 'topInput' || topLevelType === 'topChange') { - return getInstIfValueChanged(targetInst, nativeEvent); - } -} - -function handleControlledInputBlur(inst, node) { - // TODO: In IE, inst is occasionally null. Why? - if (inst == null) { - return; - } - - // Fiber and ReactDOM keep wrapper state in separate places - var state = inst._wrapperState || node._wrapperState; - - if (!state || !state.controlled || node.type !== 'number') { - return; - } - - // If controlled, assign the value attribute to the current value on blur - var value = '' + node.value; - if (node.getAttribute('value') !== value) { - node.setAttribute('value', 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, - - _allowSimulatedPassThrough: true, - _isInputEventSupported: isInputEventSupported, - - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window; - - var getTargetInstFunc, handleEventFunc; - if (shouldUseChangeEvent(targetNode)) { - if (doesChangeEventBubble) { - getTargetInstFunc = getTargetInstForChangeEvent; - } else { - handleEventFunc = handleEventsForChangeEventIE8; - } - } 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, nativeEvent); - 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 === 'topBlur') { - handleControlledInputBlur(targetInst, targetNode); - } - } -}; - -module.exports = ChangeEventPlugin; - -/***/ }), -/* 394 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var ReactOwner = __webpack_require__(395); - -var ReactRef = {}; - -function attachRef(ref, component, owner) { - if (typeof ref === 'function') { - ref(component.getPublicInstance()); - } else { - // Legacy ref - ReactOwner.addComponentAsRefTo(component, ref, owner); - } -} - -function detachRef(ref, component, owner) { - if (typeof ref === 'function') { - ref(null); - } else { - // Legacy ref - ReactOwner.removeComponentAsRefFrom(component, ref, owner); - } -} - -ReactRef.attachRefs = function (instance, element) { - if (element === null || typeof element !== 'object') { - return; - } - var ref = element.ref; - if (ref != null) { - attachRef(ref, instance, element._owner); - } -}; - -ReactRef.shouldUpdateRefs = function (prevElement, nextElement) { - // If either the owner or a `ref` has changed, make sure the newest owner - // has stored a reference to `this`, and the previous owner (if different) - // has forgotten the reference to `this`. We use the element instead - // of the public this.props because the post processing cannot determine - // a ref. The ref conceptually lives on the element. - - // TODO: Should this even be possible? The owner cannot change because - // it's forbidden by shouldUpdateReactComponent. The ref can change - // if you swap the keys of but not the refs. Reconsider where this check - // is made. It probably belongs where the key checking and - // instantiateReactComponent is done. - - var prevRef = null; - var prevOwner = null; - if (prevElement !== null && typeof prevElement === 'object') { - prevRef = prevElement.ref; - prevOwner = prevElement._owner; - } - - var nextRef = null; - var nextOwner = null; - if (nextElement !== null && typeof nextElement === 'object') { - nextRef = nextElement.ref; - nextOwner = nextElement._owner; - } - - return prevRef !== nextRef || - // If owner changes but we have an unchanged function ref, don't update refs - typeof nextRef === 'string' && nextOwner !== prevOwner; -}; - -ReactRef.detachRefs = function (instance, element) { - if (element === null || typeof element !== 'object') { - return; - } - var ref = element.ref; - if (ref != null) { - detachRef(ref, instance, element._owner); - } -}; - -module.exports = ReactRef; - -/***/ }), -/* 395 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -/** - * @param {?object} object - * @return {boolean} True if `object` is a valid owner. - * @final - */ -function isValidOwner(object) { - return !!(object && typeof object.attachRef === 'function' && typeof object.detachRef === 'function'); -} - -/** - * ReactOwners are capable of storing references to owned components. - * - * All components are capable of //being// referenced by owner components, but - * only ReactOwner components are capable of //referencing// owned components. - * The named reference is known as a "ref". - * - * Refs are available when mounted and updated during reconciliation. - * - * var MyComponent = React.createClass({ - * render: function() { - * return ( - * <div onClick={this.handleClick}> - * <CustomComponent ref="custom" /> - * </div> - * ); - * }, - * handleClick: function() { - * this.refs.custom.handleClick(); - * }, - * componentDidMount: function() { - * this.refs.custom.initialize(); - * } - * }); - * - * Refs should rarely be used. When refs are used, they should only be done to - * control data that is not handled by React's data flow. - * - * @class ReactOwner - */ -var ReactOwner = { - /** - * Adds a component by ref to an owner component. - * - * @param {ReactComponent} component Component to reference. - * @param {string} ref Name by which to refer to the component. - * @param {ReactOwner} owner Component on which to record the ref. - * @final - * @internal - */ - addComponentAsRefTo: function (component, ref, owner) { - !isValidOwner(owner) ? true ? invariant(false, 'addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('119') : void 0; - owner.attachRef(ref, component); - }, - - /** - * Removes a component by ref from an owner component. - * - * @param {ReactComponent} component Component to dereference. - * @param {string} ref Name of the ref to remove. - * @param {ReactOwner} owner Component on which the ref is recorded. - * @final - * @internal - */ - removeComponentAsRefFrom: function (component, ref, owner) { - !isValidOwner(owner) ? true ? invariant(false, 'removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component\'s `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).') : _prodInvariant('120') : void 0; - var ownerPublicInstance = owner.getPublicInstance(); - // Check that `component`'s owner is still alive and that `component` is still the current ref - // because we do not want to detach the ref if another component stole it. - if (ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance()) { - owner.detachRef(ref); - } - } -}; - -module.exports = ReactOwner; - -/***/ }), -/* 396 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2016-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var ReactInvalidSetStateWarningHook = __webpack_require__(397); -var ReactHostOperationHistoryHook = __webpack_require__(398); -var ReactComponentTreeHook = __webpack_require__(17); -var ExecutionEnvironment = __webpack_require__(13); - -var performanceNow = __webpack_require__(399); -var warning = __webpack_require__(2); - -var hooks = []; -var didHookThrowForEvent = {}; - -function callHook(event, fn, context, arg1, arg2, arg3, arg4, arg5) { - try { - fn.call(context, arg1, arg2, arg3, arg4, arg5); - } catch (e) { - true ? warning(didHookThrowForEvent[event], 'Exception thrown by hook while handling %s: %s', event, e + '\n' + e.stack) : void 0; - didHookThrowForEvent[event] = true; - } -} - -function emitEvent(event, arg1, arg2, arg3, arg4, arg5) { - for (var i = 0; i < hooks.length; i++) { - var hook = hooks[i]; - var fn = hook[event]; - if (fn) { - callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5); - } - } -} - -var isProfiling = false; -var flushHistory = []; -var lifeCycleTimerStack = []; -var currentFlushNesting = 0; -var currentFlushMeasurements = []; -var currentFlushStartTime = 0; -var currentTimerDebugID = null; -var currentTimerStartTime = 0; -var currentTimerNestedFlushDuration = 0; -var currentTimerType = null; - -var lifeCycleTimerHasWarned = false; - -function clearHistory() { - ReactComponentTreeHook.purgeUnmountedComponents(); - ReactHostOperationHistoryHook.clearHistory(); -} - -function getTreeSnapshot(registeredIDs) { - return registeredIDs.reduce(function (tree, id) { - var ownerID = ReactComponentTreeHook.getOwnerID(id); - var parentID = ReactComponentTreeHook.getParentID(id); - tree[id] = { - displayName: ReactComponentTreeHook.getDisplayName(id), - text: ReactComponentTreeHook.getText(id), - updateCount: ReactComponentTreeHook.getUpdateCount(id), - childIDs: ReactComponentTreeHook.getChildIDs(id), - // Text nodes don't have owners but this is close enough. - ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0, - parentID: parentID - }; - return tree; - }, {}); -} - -function resetMeasurements() { - var previousStartTime = currentFlushStartTime; - var previousMeasurements = currentFlushMeasurements; - var previousOperations = ReactHostOperationHistoryHook.getHistory(); - - if (currentFlushNesting === 0) { - currentFlushStartTime = 0; - currentFlushMeasurements = []; - clearHistory(); - return; - } - - if (previousMeasurements.length || previousOperations.length) { - var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); - flushHistory.push({ - duration: performanceNow() - previousStartTime, - measurements: previousMeasurements || [], - operations: previousOperations || [], - treeSnapshot: getTreeSnapshot(registeredIDs) - }); - } - - clearHistory(); - currentFlushStartTime = performanceNow(); - currentFlushMeasurements = []; -} - -function checkDebugID(debugID) { - var allowRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - if (allowRoot && debugID === 0) { - return; - } - if (!debugID) { - true ? warning(false, 'ReactDebugTool: debugID may not be empty.') : void 0; - } -} - -function beginLifeCycleTimer(debugID, timerType) { - if (currentFlushNesting === 0) { - return; - } - if (currentTimerType && !lifeCycleTimerHasWarned) { - true ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'Did not expect %s timer to start while %s timer is still in ' + 'progress for %s instance.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0; - lifeCycleTimerHasWarned = true; - } - currentTimerStartTime = performanceNow(); - currentTimerNestedFlushDuration = 0; - currentTimerDebugID = debugID; - currentTimerType = timerType; -} - -function endLifeCycleTimer(debugID, timerType) { - if (currentFlushNesting === 0) { - return; - } - if (currentTimerType !== timerType && !lifeCycleTimerHasWarned) { - true ? warning(false, 'There is an internal error in the React performance measurement code. ' + 'We did not expect %s timer to stop while %s timer is still in ' + 'progress for %s instance. Please report this as a bug in React.', timerType, currentTimerType || 'no', debugID === currentTimerDebugID ? 'the same' : 'another') : void 0; - lifeCycleTimerHasWarned = true; - } - if (isProfiling) { - currentFlushMeasurements.push({ - timerType: timerType, - instanceID: debugID, - duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration - }); - } - currentTimerStartTime = 0; - currentTimerNestedFlushDuration = 0; - currentTimerDebugID = null; - currentTimerType = null; -} - -function pauseCurrentLifeCycleTimer() { - var currentTimer = { - startTime: currentTimerStartTime, - nestedFlushStartTime: performanceNow(), - debugID: currentTimerDebugID, - timerType: currentTimerType - }; - lifeCycleTimerStack.push(currentTimer); - currentTimerStartTime = 0; - currentTimerNestedFlushDuration = 0; - currentTimerDebugID = null; - currentTimerType = null; -} - -function resumeCurrentLifeCycleTimer() { - var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), - startTime = _lifeCycleTimerStack$.startTime, - nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, - debugID = _lifeCycleTimerStack$.debugID, - timerType = _lifeCycleTimerStack$.timerType; - - var nestedFlushDuration = performanceNow() - nestedFlushStartTime; - currentTimerStartTime = startTime; - currentTimerNestedFlushDuration += nestedFlushDuration; - currentTimerDebugID = debugID; - currentTimerType = timerType; -} - -var lastMarkTimeStamp = 0; -var canUsePerformanceMeasure = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; - -function shouldMark(debugID) { - if (!isProfiling || !canUsePerformanceMeasure) { - return false; - } - var element = ReactComponentTreeHook.getElement(debugID); - if (element == null || typeof element !== 'object') { - return false; - } - var isHostElement = typeof element.type === 'string'; - if (isHostElement) { - return false; - } - return true; -} - -function markBegin(debugID, markType) { - if (!shouldMark(debugID)) { - return; - } - - var markName = debugID + '::' + markType; - lastMarkTimeStamp = performanceNow(); - performance.mark(markName); -} - -function markEnd(debugID, markType) { - if (!shouldMark(debugID)) { - return; - } - - var markName = debugID + '::' + markType; - var displayName = ReactComponentTreeHook.getDisplayName(debugID) || 'Unknown'; - - // Chrome has an issue of dropping markers recorded too fast: - // https://bugs.chromium.org/p/chromium/issues/detail?id=640652 - // To work around this, we will not report very small measurements. - // I determined the magic number by tweaking it back and forth. - // 0.05ms was enough to prevent the issue, but I set it to 0.1ms to be safe. - // When the bug is fixed, we can `measure()` unconditionally if we want to. - var timeStamp = performanceNow(); - if (timeStamp - lastMarkTimeStamp > 0.1) { - var measurementName = displayName + ' [' + markType + ']'; - performance.measure(measurementName, markName); - } - - performance.clearMarks(markName); - if (measurementName) { - performance.clearMeasures(measurementName); - } -} - -var ReactDebugTool = { - addHook: function (hook) { - hooks.push(hook); - }, - removeHook: function (hook) { - for (var i = 0; i < hooks.length; i++) { - if (hooks[i] === hook) { - hooks.splice(i, 1); - i--; - } - } - }, - isProfiling: function () { - return isProfiling; - }, - beginProfiling: function () { - if (isProfiling) { - return; - } - - isProfiling = true; - flushHistory.length = 0; - resetMeasurements(); - ReactDebugTool.addHook(ReactHostOperationHistoryHook); - }, - endProfiling: function () { - if (!isProfiling) { - return; - } - - isProfiling = false; - resetMeasurements(); - ReactDebugTool.removeHook(ReactHostOperationHistoryHook); - }, - getFlushHistory: function () { - return flushHistory; - }, - onBeginFlush: function () { - currentFlushNesting++; - resetMeasurements(); - pauseCurrentLifeCycleTimer(); - emitEvent('onBeginFlush'); - }, - onEndFlush: function () { - resetMeasurements(); - currentFlushNesting--; - resumeCurrentLifeCycleTimer(); - emitEvent('onEndFlush'); - }, - onBeginLifeCycleTimer: function (debugID, timerType) { - checkDebugID(debugID); - emitEvent('onBeginLifeCycleTimer', debugID, timerType); - markBegin(debugID, timerType); - beginLifeCycleTimer(debugID, timerType); - }, - onEndLifeCycleTimer: function (debugID, timerType) { - checkDebugID(debugID); - endLifeCycleTimer(debugID, timerType); - markEnd(debugID, timerType); - emitEvent('onEndLifeCycleTimer', debugID, timerType); - }, - onBeginProcessingChildContext: function () { - emitEvent('onBeginProcessingChildContext'); - }, - onEndProcessingChildContext: function () { - emitEvent('onEndProcessingChildContext'); - }, - onHostOperation: function (operation) { - checkDebugID(operation.instanceID); - emitEvent('onHostOperation', operation); - }, - onSetState: function () { - emitEvent('onSetState'); - }, - onSetChildren: function (debugID, childDebugIDs) { - checkDebugID(debugID); - childDebugIDs.forEach(checkDebugID); - emitEvent('onSetChildren', debugID, childDebugIDs); - }, - onBeforeMountComponent: function (debugID, element, parentDebugID) { - checkDebugID(debugID); - checkDebugID(parentDebugID, true); - emitEvent('onBeforeMountComponent', debugID, element, parentDebugID); - markBegin(debugID, 'mount'); - }, - onMountComponent: function (debugID) { - checkDebugID(debugID); - markEnd(debugID, 'mount'); - emitEvent('onMountComponent', debugID); - }, - onBeforeUpdateComponent: function (debugID, element) { - checkDebugID(debugID); - emitEvent('onBeforeUpdateComponent', debugID, element); - markBegin(debugID, 'update'); - }, - onUpdateComponent: function (debugID) { - checkDebugID(debugID); - markEnd(debugID, 'update'); - emitEvent('onUpdateComponent', debugID); - }, - onBeforeUnmountComponent: function (debugID) { - checkDebugID(debugID); - emitEvent('onBeforeUnmountComponent', debugID); - markBegin(debugID, 'unmount'); - }, - onUnmountComponent: function (debugID) { - checkDebugID(debugID); - markEnd(debugID, 'unmount'); - emitEvent('onUnmountComponent', debugID); - }, - onTestEvent: function () { - emitEvent('onTestEvent'); - } -}; - -// TODO remove these when RN/www gets updated -ReactDebugTool.addDevtool = ReactDebugTool.addHook; -ReactDebugTool.removeDevtool = ReactDebugTool.removeHook; - -ReactDebugTool.addHook(ReactInvalidSetStateWarningHook); -ReactDebugTool.addHook(ReactComponentTreeHook); -var url = ExecutionEnvironment.canUseDOM && window.location.href || ''; -if (/[?&]react_perf\b/.test(url)) { - ReactDebugTool.beginProfiling(); -} - -module.exports = ReactDebugTool; - -/***/ }), -/* 397 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2016-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var warning = __webpack_require__(2); - -if (true) { - var processingChildContext = false; - - var warnInvalidSetState = function () { - true ? warning(!processingChildContext, 'setState(...): Cannot call setState() inside getChildContext()') : void 0; - }; -} - -var ReactInvalidSetStateWarningHook = { - onBeginProcessingChildContext: function () { - processingChildContext = true; - }, - onEndProcessingChildContext: function () { - processingChildContext = false; - }, - onSetState: function () { - warnInvalidSetState(); - } -}; - -module.exports = ReactInvalidSetStateWarningHook; - -/***/ }), -/* 398 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2016-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var history = []; - -var ReactHostOperationHistoryHook = { - onHostOperation: function (operation) { - history.push(operation); - }, - clearHistory: function () { - if (ReactHostOperationHistoryHook._preventClearing) { - // Should only be used for tests. - return; - } - - history = []; - }, - getHistory: function () { - return history; - } -}; - -module.exports = ReactHostOperationHistoryHook; - -/***/ }), -/* 399 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var performance = __webpack_require__(400); - -var performanceNow; - -/** - * Detect if we can use `window.performance.now()` and gracefully fallback to - * `Date.now()` if it doesn't exist. We need to support Firefox < 15 for now - * because of Facebook's testing infrastructure. - */ -if (performance.now) { - performanceNow = function performanceNow() { - return performance.now(); - }; -} else { - performanceNow = function performanceNow() { - return Date.now(); - }; -} - -module.exports = performanceNow; - -/***/ }), -/* 400 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - - - -var ExecutionEnvironment = __webpack_require__(13); - -var performance; - -if (ExecutionEnvironment.canUseDOM) { - performance = window.performance || window.msPerformance || window.webkitPerformance; -} - -module.exports = performance || {}; - -/***/ }), -/* 401 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Module that is injectable into `EventPluginHub`, that specifies a - * deterministic ordering of `EventPlugin`s. A convenient way to reason about - * plugins, without having to package every one of them. This is better than - * having plugins be ordered in the same order that they are injected because - * that ordering would be influenced by the packaging order. - * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that - * preventing default on events is convenient in `SimpleEventPlugin` handlers. - */ - -var DefaultEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'TapEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin']; - -module.exports = DefaultEventPluginOrder; - -/***/ }), -/* 402 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var EventPropagators = __webpack_require__(60); -var ReactDOMComponentTree = __webpack_require__(9); -var SyntheticMouseEvent = __webpack_require__(81); - -var eventTypes = { - mouseEnter: { - registrationName: 'onMouseEnter', - dependencies: ['topMouseOut', 'topMouseOver'] - }, - mouseLeave: { - registrationName: 'onMouseLeave', - dependencies: ['topMouseOut', 'topMouseOver'] - } -}; - -var EnterLeaveEventPlugin = { - eventTypes: eventTypes, - - /** - * For almost every interaction we care about, there will be both a top-level - * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that - * we do not extract duplicate events. However, moving the mouse into the - * browser from outside will not fire a `mouseout` event. In this case, we use - * the `mouseover` top-level event. - */ - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - if (topLevelType === 'topMouseOver' && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { - return null; - } - if (topLevelType !== 'topMouseOut' && topLevelType !== 'topMouseOver') { - // Must not be a mouse in or mouse out - ignoring. - return null; - } - - var win; - 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; - var to; - if (topLevelType === 'topMouseOut') { - from = targetInst; - var related = nativeEvent.relatedTarget || nativeEvent.toElement; - to = related ? ReactDOMComponentTree.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 fromNode = from == null ? win : ReactDOMComponentTree.getNodeFromInstance(from); - var toNode = to == null ? win : ReactDOMComponentTree.getNodeFromInstance(to); - - var leave = SyntheticMouseEvent.getPooled(eventTypes.mouseLeave, from, nativeEvent, nativeEventTarget); - leave.type = 'mouseleave'; - leave.target = fromNode; - leave.relatedTarget = toNode; - - var enter = SyntheticMouseEvent.getPooled(eventTypes.mouseEnter, to, nativeEvent, nativeEventTarget); - enter.type = 'mouseenter'; - enter.target = toNode; - enter.relatedTarget = fromNode; - - EventPropagators.accumulateEnterLeaveDispatches(leave, enter, from, to); - - return [leave, enter]; - } -}; - -module.exports = EnterLeaveEventPlugin; - -/***/ }), -/* 403 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMProperty = __webpack_require__(33); - -var MUST_USE_PROPERTY = DOMProperty.injection.MUST_USE_PROPERTY; -var HAS_BOOLEAN_VALUE = DOMProperty.injection.HAS_BOOLEAN_VALUE; -var HAS_NUMERIC_VALUE = DOMProperty.injection.HAS_NUMERIC_VALUE; -var HAS_POSITIVE_NUMERIC_VALUE = DOMProperty.injection.HAS_POSITIVE_NUMERIC_VALUE; -var HAS_OVERLOADED_BOOLEAN_VALUE = DOMProperty.injection.HAS_OVERLOADED_BOOLEAN_VALUE; - -var HTMLDOMPropertyConfig = { - isCustomAttribute: RegExp.prototype.test.bind(new RegExp('^(data|aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$')), - Properties: { - /** - * Standard Properties - */ - accept: 0, - acceptCharset: 0, - accessKey: 0, - action: 0, - allowFullScreen: HAS_BOOLEAN_VALUE, - allowTransparency: 0, - alt: 0, - // specifies target context for links with `preload` type - as: 0, - async: HAS_BOOLEAN_VALUE, - autoComplete: 0, - // autoFocus is polyfilled/normalized by AutoFocusUtils - // autoFocus: HAS_BOOLEAN_VALUE, - autoPlay: HAS_BOOLEAN_VALUE, - capture: HAS_BOOLEAN_VALUE, - cellPadding: 0, - cellSpacing: 0, - charSet: 0, - challenge: 0, - checked: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - cite: 0, - classID: 0, - className: 0, - cols: HAS_POSITIVE_NUMERIC_VALUE, - colSpan: 0, - content: 0, - contentEditable: 0, - contextMenu: 0, - controls: HAS_BOOLEAN_VALUE, - controlsList: 0, - coords: 0, - crossOrigin: 0, - data: 0, // For `<object />` acts as `src`. - dateTime: 0, - 'default': HAS_BOOLEAN_VALUE, - defer: HAS_BOOLEAN_VALUE, - dir: 0, - disabled: HAS_BOOLEAN_VALUE, - download: HAS_OVERLOADED_BOOLEAN_VALUE, - draggable: 0, - encType: 0, - form: 0, - formAction: 0, - formEncType: 0, - formMethod: 0, - formNoValidate: HAS_BOOLEAN_VALUE, - formTarget: 0, - frameBorder: 0, - headers: 0, - height: 0, - hidden: HAS_BOOLEAN_VALUE, - high: 0, - href: 0, - hrefLang: 0, - htmlFor: 0, - httpEquiv: 0, - icon: 0, - id: 0, - inputMode: 0, - integrity: 0, - is: 0, - keyParams: 0, - keyType: 0, - kind: 0, - label: 0, - lang: 0, - list: 0, - loop: HAS_BOOLEAN_VALUE, - low: 0, - manifest: 0, - marginHeight: 0, - marginWidth: 0, - max: 0, - maxLength: 0, - media: 0, - mediaGroup: 0, - method: 0, - min: 0, - minLength: 0, - // Caution; `option.selected` is not updated if `select.multiple` is - // disabled with `removeAttribute`. - multiple: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - name: 0, - nonce: 0, - noValidate: HAS_BOOLEAN_VALUE, - open: HAS_BOOLEAN_VALUE, - optimum: 0, - pattern: 0, - placeholder: 0, - playsInline: HAS_BOOLEAN_VALUE, - poster: 0, - preload: 0, - profile: 0, - radioGroup: 0, - readOnly: HAS_BOOLEAN_VALUE, - referrerPolicy: 0, - rel: 0, - required: HAS_BOOLEAN_VALUE, - reversed: HAS_BOOLEAN_VALUE, - role: 0, - rows: HAS_POSITIVE_NUMERIC_VALUE, - rowSpan: HAS_NUMERIC_VALUE, - sandbox: 0, - scope: 0, - scoped: HAS_BOOLEAN_VALUE, - scrolling: 0, - seamless: HAS_BOOLEAN_VALUE, - selected: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE, - shape: 0, - size: HAS_POSITIVE_NUMERIC_VALUE, - sizes: 0, - span: HAS_POSITIVE_NUMERIC_VALUE, - spellCheck: 0, - src: 0, - srcDoc: 0, - srcLang: 0, - srcSet: 0, - start: HAS_NUMERIC_VALUE, - step: 0, - style: 0, - summary: 0, - tabIndex: 0, - target: 0, - title: 0, - // Setting .type throws on non-<input> tags - type: 0, - useMap: 0, - value: 0, - width: 0, - wmode: 0, - wrap: 0, - - /** - * RDFa Properties - */ - about: 0, - datatype: 0, - inlist: 0, - prefix: 0, - // property is also supported for OpenGraph in meta tags. - property: 0, - resource: 0, - 'typeof': 0, - vocab: 0, - - /** - * Non-standard Properties - */ - // autoCapitalize and autoCorrect are supported in Mobile Safari for - // keyboard hints. - autoCapitalize: 0, - autoCorrect: 0, - // autoSave allows WebKit/Blink to persist values of input fields on page reloads - autoSave: 0, - // color is for Safari mask-icon link - color: 0, - // itemProp, itemScope, itemType are for - // Microdata support. See http://schema.org/docs/gs.html - itemProp: 0, - itemScope: HAS_BOOLEAN_VALUE, - itemType: 0, - // itemID and itemRef are for Microdata support as well but - // only specified in the WHATWG spec document. See - // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api - itemID: 0, - itemRef: 0, - // results show looking glass icon and recent searches on input - // search fields in WebKit/Blink - results: 0, - // IE-only attribute that specifies security restrictions on an iframe - // as an alternative to the sandbox attribute on IE<10 - security: 0, - // IE-only attribute that controls focus behavior - unselectable: 0 - }, - DOMAttributeNames: { - acceptCharset: 'accept-charset', - className: 'class', - htmlFor: 'for', - httpEquiv: 'http-equiv' - }, - DOMPropertyNames: {}, - DOMMutationMethods: { - value: function (node, value) { - if (value == null) { - return node.removeAttribute('value'); - } - - // Number inputs get special treatment due to some edge cases in - // Chrome. Let everything else assign the value attribute as normal. - // https://github.com/facebook/react/issues/7253#issuecomment-236074326 - if (node.type !== 'number' || node.hasAttribute('value') === false) { - node.setAttribute('value', '' + value); - } else if (node.validity && !node.validity.badInput && node.ownerDocument.activeElement !== node) { - // Don't assign an attribute if validation reports bad - // input. Chrome will clear the value. Additionally, don't - // operate on inputs that have focus, otherwise Chrome might - // strip off trailing decimal places and cause the user's - // cursor position to jump to the beginning of the input. - // - // In ReactDOMInput, we have an onBlur event that will trigger - // this function again when focus is lost. - node.setAttribute('value', '' + value); - } - } - } -}; - -module.exports = HTMLDOMPropertyConfig; - -/***/ }), -/* 404 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMChildrenOperations = __webpack_require__(116); -var ReactDOMIDOperations = __webpack_require__(409); - -/** - * Abstracts away all functionality of the reconciler that requires knowledge of - * the browser context. TODO: These callers should be refactored to avoid the - * need for this injection. - */ -var ReactComponentBrowserEnvironment = { - processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, - - replaceNodeWithMarkup: DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup -}; - -module.exports = ReactComponentBrowserEnvironment; - -/***/ }), -/* 405 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var DOMLazyTree = __webpack_require__(52); -var ExecutionEnvironment = __webpack_require__(13); - -var createNodesFromMarkup = __webpack_require__(406); -var emptyFunction = __webpack_require__(20); -var invariant = __webpack_require__(1); - -var Danger = { - /** - * Replaces a node with a string of markup at its current position within its - * parent. The markup must render into a single root node. - * - * @param {DOMElement} oldChild Child node to replace. - * @param {string} markup Markup to render in place of the child node. - * @internal - */ - dangerouslyReplaceNodeWithMarkup: function (oldChild, markup) { - !ExecutionEnvironment.canUseDOM ? true ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot render markup in a worker thread. Make sure `window` and `document` are available globally before requiring React when unit testing or use ReactDOMServer.renderToString() for server rendering.') : _prodInvariant('56') : void 0; - !markup ? true ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Missing markup.') : _prodInvariant('57') : void 0; - !(oldChild.nodeName !== 'HTML') ? true ? invariant(false, 'dangerouslyReplaceNodeWithMarkup(...): Cannot replace markup of the <html> node. This is because browser quirks make this unreliable and/or slow. If you want to render to the root you must use server rendering. See ReactDOMServer.renderToString().') : _prodInvariant('58') : void 0; - - if (typeof markup === 'string') { - var newChild = createNodesFromMarkup(markup, emptyFunction)[0]; - oldChild.parentNode.replaceChild(newChild, oldChild); - } else { - DOMLazyTree.replaceChildWithTree(oldChild, markup); - } - } -}; - -module.exports = Danger; - -/***/ }), -/* 406 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -/*eslint-disable fb-www/unsafe-html*/ - -var ExecutionEnvironment = __webpack_require__(13); - -var createArrayFromMixed = __webpack_require__(407); -var getMarkupWrap = __webpack_require__(408); -var invariant = __webpack_require__(1); - -/** - * Dummy container used to render all markup. - */ -var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; - -/** - * Pattern used by `getNodeName`. - */ -var nodeNamePattern = /^\s*<(\w+)/; - -/** - * Extracts the `nodeName` of the first element in a string of markup. - * - * @param {string} markup String of markup. - * @return {?string} Node name of the supplied markup. - */ -function getNodeName(markup) { - var nodeNameMatch = markup.match(nodeNamePattern); - return nodeNameMatch && nodeNameMatch[1].toLowerCase(); -} - -/** - * Creates an array containing the nodes rendered from the supplied markup. The - * optionally supplied `handleScript` function will be invoked once for each - * <script> element that is rendered. If no `handleScript` function is supplied, - * an exception is thrown if any <script> elements are rendered. - * - * @param {string} markup A string of valid HTML markup. - * @param {?function} handleScript Invoked once for each rendered <script>. - * @return {array<DOMElement|DOMTextNode>} An array of rendered nodes. - */ -function createNodesFromMarkup(markup, handleScript) { - var node = dummyNode; - !!!dummyNode ? true ? invariant(false, 'createNodesFromMarkup dummy not initialized') : invariant(false) : void 0; - var nodeName = getNodeName(markup); - - var wrap = nodeName && getMarkupWrap(nodeName); - if (wrap) { - node.innerHTML = wrap[1] + markup + wrap[2]; - - var wrapDepth = wrap[0]; - while (wrapDepth--) { - node = node.lastChild; - } - } else { - node.innerHTML = markup; - } - - var scripts = node.getElementsByTagName('script'); - if (scripts.length) { - !handleScript ? true ? invariant(false, 'createNodesFromMarkup(...): Unexpected <script> element rendered.') : invariant(false) : void 0; - createArrayFromMixed(scripts).forEach(handleScript); - } - - var nodes = Array.from(node.childNodes); - while (node.lastChild) { - node.removeChild(node.lastChild); - } - return nodes; -} - -module.exports = createNodesFromMarkup; - -/***/ }), -/* 407 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var invariant = __webpack_require__(1); - -/** - * Convert array-like objects to arrays. - * - * This API assumes the caller knows the contents of the data type. For less - * well defined inputs use createArrayFromMixed. - * - * @param {object|function|filelist} obj - * @return {array} - */ -function toArray(obj) { - var length = obj.length; - - // Some browsers builtin objects can report typeof 'function' (e.g. NodeList - // in old versions of Safari). - !(!Array.isArray(obj) && (typeof obj === 'object' || typeof obj === 'function')) ? true ? invariant(false, 'toArray: Array-like object expected') : invariant(false) : void 0; - - !(typeof length === 'number') ? true ? invariant(false, 'toArray: Object needs a length property') : invariant(false) : void 0; - - !(length === 0 || length - 1 in obj) ? true ? invariant(false, 'toArray: Object should have keys for indices') : invariant(false) : void 0; - - !(typeof obj.callee !== 'function') ? true ? invariant(false, 'toArray: Object can\'t be `arguments`. Use rest params ' + '(function(...args) {}) or Array.from() instead.') : invariant(false) : void 0; - - // Old IE doesn't give collections access to hasOwnProperty. Assume inputs - // without method will throw during the slice call and skip straight to the - // fallback. - if (obj.hasOwnProperty) { - try { - return Array.prototype.slice.call(obj); - } catch (e) { - // IE < 9 does not support Array#slice on collections objects - } - } - - // Fall back to copying key by key. This assumes all keys have a value, - // so will not preserve sparsely populated inputs. - var ret = Array(length); - for (var ii = 0; ii < length; ii++) { - ret[ii] = obj[ii]; - } - return ret; -} - -/** - * Perform a heuristic test to determine if an object is "array-like". - * - * A monk asked Joshu, a Zen master, "Has a dog Buddha nature?" - * Joshu replied: "Mu." - * - * This function determines if its argument has "array nature": it returns - * true if the argument is an actual array, an `arguments' object, or an - * HTMLCollection (e.g. node.childNodes or node.getElementsByTagName()). - * - * It will return false for other array-like objects like Filelist. - * - * @param {*} obj - * @return {boolean} - */ -function hasArrayNature(obj) { - return ( - // not null/false - !!obj && ( - // arrays are objects, NodeLists are functions in Safari - typeof obj == 'object' || typeof obj == 'function') && - // quacks like an array - 'length' in obj && - // not window - !('setInterval' in obj) && - // no DOM node should be considered an array-like - // a 'select' element has 'length' and 'item' properties on IE8 - typeof obj.nodeType != 'number' && ( - // a real array - Array.isArray(obj) || - // arguments - 'callee' in obj || - // HTMLCollection/NodeList - 'item' in obj) - ); -} - -/** - * Ensure that the argument is an array by wrapping it in an array if it is not. - * Creates a copy of the argument if it is already an array. - * - * This is mostly useful idiomatically: - * - * var createArrayFromMixed = require('createArrayFromMixed'); - * - * function takesOneOrMoreThings(things) { - * things = createArrayFromMixed(things); - * ... - * } - * - * This allows you to treat `things' as an array, but accept scalars in the API. - * - * If you need to convert an array-like object, like `arguments`, into an array - * use toArray instead. - * - * @param {*} obj - * @return {array} - */ -function createArrayFromMixed(obj) { - if (!hasArrayNature(obj)) { - return [obj]; - } else if (Array.isArray(obj)) { - return obj.slice(); - } else { - return toArray(obj); - } -} - -module.exports = createArrayFromMixed; - -/***/ }), -/* 408 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -/*eslint-disable fb-www/unsafe-html */ - -var ExecutionEnvironment = __webpack_require__(13); - -var invariant = __webpack_require__(1); - -/** - * Dummy container used to detect which wraps are necessary. - */ -var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null; - -/** - * Some browsers cannot use `innerHTML` to render certain elements standalone, - * so we wrap them, render the wrapped nodes, then extract the desired node. - * - * In IE8, certain elements cannot render alone, so wrap all elements ('*'). - */ - -var shouldWrap = {}; - -var selectWrap = [1, '<select multiple="true">', '</select>']; -var tableWrap = [1, '<table>', '</table>']; -var trWrap = [3, '<table><tbody><tr>', '</tr></tbody></table>']; - -var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>']; - -var markupWrap = { - '*': [1, '?<div>', '</div>'], - - 'area': [1, '<map>', '</map>'], - 'col': [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'], - 'legend': [1, '<fieldset>', '</fieldset>'], - 'param': [1, '<object>', '</object>'], - 'tr': [2, '<table><tbody>', '</tbody></table>'], - - 'optgroup': selectWrap, - 'option': selectWrap, - - 'caption': tableWrap, - 'colgroup': tableWrap, - 'tbody': tableWrap, - 'tfoot': tableWrap, - 'thead': tableWrap, - - 'td': trWrap, - 'th': trWrap -}; - -// Initialize the SVG elements since we know they'll always need to be wrapped -// consistently. If they are created inside a <div> they will be initialized in -// the wrong namespace (and will not display). -var svgElements = ['circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'text', 'tspan']; -svgElements.forEach(function (nodeName) { - markupWrap[nodeName] = svgWrap; - shouldWrap[nodeName] = true; -}); - -/** - * Gets the markup wrap configuration for the supplied `nodeName`. - * - * NOTE: This lazily detects which wraps are necessary for the current browser. - * - * @param {string} nodeName Lowercase `nodeName`. - * @return {?array} Markup wrap configuration, if applicable. - */ -function getMarkupWrap(nodeName) { - !!!dummyNode ? true ? invariant(false, 'Markup wrapping node not initialized') : invariant(false) : void 0; - if (!markupWrap.hasOwnProperty(nodeName)) { - nodeName = '*'; - } - if (!shouldWrap.hasOwnProperty(nodeName)) { - if (nodeName === '*') { - dummyNode.innerHTML = '<link />'; - } else { - dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>'; - } - shouldWrap[nodeName] = !dummyNode.firstChild; - } - return shouldWrap[nodeName] ? markupWrap[nodeName] : null; -} - -module.exports = getMarkupWrap; - -/***/ }), -/* 409 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMChildrenOperations = __webpack_require__(116); -var ReactDOMComponentTree = __webpack_require__(9); - -/** - * Operations used to process updates to DOM nodes. - */ -var ReactDOMIDOperations = { - /** - * Updates a component's children by processing a series of updates. - * - * @param {array<object>} updates List of update configurations. - * @internal - */ - dangerouslyProcessChildrenUpdates: function (parentInst, updates) { - var node = ReactDOMComponentTree.getNodeFromInstance(parentInst); - DOMChildrenOperations.processUpdates(node, updates); - } -}; - -module.exports = ReactDOMIDOperations; - -/***/ }), -/* 410 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -/* global hasOwnProperty:true */ - - - -var _prodInvariant = __webpack_require__(4), - _assign = __webpack_require__(7); - -var AutoFocusUtils = __webpack_require__(411); -var CSSPropertyOperations = __webpack_require__(412); -var DOMLazyTree = __webpack_require__(52); -var DOMNamespaces = __webpack_require__(117); -var DOMProperty = __webpack_require__(33); -var DOMPropertyOperations = __webpack_require__(196); -var EventPluginHub = __webpack_require__(61); -var EventPluginRegistry = __webpack_require__(79); -var ReactBrowserEventEmitter = __webpack_require__(84); -var ReactDOMComponentFlags = __webpack_require__(181); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactDOMInput = __webpack_require__(419); -var ReactDOMOption = __webpack_require__(420); -var ReactDOMSelect = __webpack_require__(198); -var ReactDOMTextarea = __webpack_require__(421); -var ReactInstrumentation = __webpack_require__(19); -var ReactMultiChild = __webpack_require__(422); -var ReactServerRenderingTransaction = __webpack_require__(431); - -var emptyFunction = __webpack_require__(20); -var escapeTextContentForBrowser = __webpack_require__(83); -var invariant = __webpack_require__(1); -var isEventSupported = __webpack_require__(114); -var shallowEqual = __webpack_require__(121); -var inputValueTracking = __webpack_require__(187); -var validateDOMNesting = __webpack_require__(125); -var warning = __webpack_require__(2); - -var Flags = ReactDOMComponentFlags; -var deleteListener = EventPluginHub.deleteListener; -var getNode = ReactDOMComponentTree.getNodeFromInstance; -var listenTo = ReactBrowserEventEmitter.listenTo; -var registrationNameModules = EventPluginRegistry.registrationNameModules; - -// For quickly matching children type, to test if can be treated as content. -var CONTENT_TYPES = { string: true, number: true }; - -var STYLE = 'style'; -var HTML = '__html'; -var RESERVED_PROPS = { - children: null, - dangerouslySetInnerHTML: null, - suppressContentEditableWarning: null -}; - -// Node type for document fragments (Node.DOCUMENT_FRAGMENT_NODE). -var DOC_FRAGMENT_TYPE = 11; - -function getDeclarationErrorAddendum(internalInstance) { - if (internalInstance) { - var owner = internalInstance._currentElement._owner || null; - if (owner) { - var name = owner.getName(); - if (name) { - return ' This DOM node was rendered by `' + name + '`.'; - } - } - } - return ''; -} - -function friendlyStringify(obj) { - if (typeof obj === 'object') { - if (Array.isArray(obj)) { - return '[' + obj.map(friendlyStringify).join(', ') + ']'; - } else { - var pairs = []; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var keyEscaped = /^[a-z$_][\w$_]*$/i.test(key) ? key : JSON.stringify(key); - pairs.push(keyEscaped + ': ' + friendlyStringify(obj[key])); - } - } - return '{' + pairs.join(', ') + '}'; - } - } else if (typeof obj === 'string') { - return JSON.stringify(obj); - } else if (typeof obj === 'function') { - return '[function object]'; - } - // Differs from JSON.stringify in that undefined because undefined and that - // inf and nan don't become null - return String(obj); -} - -var styleMutationWarning = {}; - -function checkAndWarnForMutatedStyle(style1, style2, component) { - if (style1 == null || style2 == null) { - return; - } - if (shallowEqual(style1, style2)) { - return; - } - - var componentName = component._tag; - var owner = component._currentElement._owner; - var ownerName; - if (owner) { - ownerName = owner.getName(); - } - - var hash = ownerName + '|' + componentName; - - if (styleMutationWarning.hasOwnProperty(hash)) { - return; - } - - styleMutationWarning[hash] = true; - - true ? warning(false, '`%s` was passed a style object that has previously been mutated. ' + 'Mutating `style` is deprecated. Consider cloning it beforehand. Check ' + 'the `render` %s. Previous style: %s. Mutated style: %s.', componentName, owner ? 'of `' + ownerName + '`' : 'using <' + componentName + '>', friendlyStringify(style1), friendlyStringify(style2)) : void 0; -} - -/** - * @param {object} component - * @param {?object} props - */ -function assertValidProps(component, props) { - if (!props) { - return; - } - // Note the use of `==` which checks for null or undefined. - if (voidElementTags[component._tag]) { - !(props.children == null && props.dangerouslySetInnerHTML == null) ? true ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : _prodInvariant('137', component._tag, component._currentElement._owner ? ' Check the render method of ' + component._currentElement._owner.getName() + '.' : '') : void 0; - } - if (props.dangerouslySetInnerHTML != null) { - !(props.children == null) ? true ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : _prodInvariant('60') : void 0; - !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? true ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : _prodInvariant('61') : void 0; - } - if (true) { - true ? warning(props.innerHTML == null, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.') : void 0; - true ? warning(props.suppressContentEditableWarning || !props.contentEditable || props.children == null, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0; - true ? warning(props.onFocusIn == null && props.onFocusOut == null, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.') : void 0; - } - !(props.style == null || typeof props.style === 'object') ? true ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', getDeclarationErrorAddendum(component)) : _prodInvariant('62', getDeclarationErrorAddendum(component)) : void 0; -} - -function enqueuePutListener(inst, registrationName, listener, transaction) { - if (transaction instanceof ReactServerRenderingTransaction) { - return; - } - if (true) { - // IE8 has no API for event capturing and the `onScroll` event doesn't - // bubble. - true ? warning(registrationName !== 'onScroll' || isEventSupported('scroll', true), "This browser doesn't support the `onScroll` event") : void 0; - } - var containerInfo = inst._hostContainerInfo; - var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE; - var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument; - listenTo(registrationName, doc); - transaction.getReactMountReady().enqueue(putListener, { - inst: inst, - registrationName: registrationName, - listener: listener - }); -} - -function putListener() { - var listenerToPut = this; - EventPluginHub.putListener(listenerToPut.inst, listenerToPut.registrationName, listenerToPut.listener); -} - -function inputPostMount() { - var inst = this; - ReactDOMInput.postMountWrapper(inst); -} - -function textareaPostMount() { - var inst = this; - ReactDOMTextarea.postMountWrapper(inst); -} - -function optionPostMount() { - var inst = this; - ReactDOMOption.postMountWrapper(inst); -} - -var setAndValidateContentChildDev = emptyFunction; -if (true) { - setAndValidateContentChildDev = function (content) { - var hasExistingContent = this._contentDebugID != null; - var debugID = this._debugID; - // This ID represents the inlined child that has no backing instance: - var contentDebugID = -debugID; - - if (content == null) { - if (hasExistingContent) { - ReactInstrumentation.debugTool.onUnmountComponent(this._contentDebugID); - } - this._contentDebugID = null; - return; - } - - validateDOMNesting(null, String(content), this, this._ancestorInfo); - this._contentDebugID = contentDebugID; - if (hasExistingContent) { - ReactInstrumentation.debugTool.onBeforeUpdateComponent(contentDebugID, content); - ReactInstrumentation.debugTool.onUpdateComponent(contentDebugID); - } else { - ReactInstrumentation.debugTool.onBeforeMountComponent(contentDebugID, content, debugID); - ReactInstrumentation.debugTool.onMountComponent(contentDebugID); - ReactInstrumentation.debugTool.onSetChildren(debugID, [contentDebugID]); - } - }; -} - -// There are so many media events, it makes sense to just -// maintain a list rather than create a `trapBubbledEvent` for each -var mediaEvents = { - topAbort: 'abort', - topCanPlay: 'canplay', - topCanPlayThrough: 'canplaythrough', - topDurationChange: 'durationchange', - topEmptied: 'emptied', - topEncrypted: 'encrypted', - topEnded: 'ended', - topError: 'error', - topLoadedData: 'loadeddata', - topLoadedMetadata: 'loadedmetadata', - topLoadStart: 'loadstart', - topPause: 'pause', - topPlay: 'play', - topPlaying: 'playing', - topProgress: 'progress', - topRateChange: 'ratechange', - topSeeked: 'seeked', - topSeeking: 'seeking', - topStalled: 'stalled', - topSuspend: 'suspend', - topTimeUpdate: 'timeupdate', - topVolumeChange: 'volumechange', - topWaiting: 'waiting' -}; - -function trackInputValue() { - inputValueTracking.track(this); -} - -function trapBubbledEventsLocal() { - var inst = this; - // If a component renders to null or if another component fatals and causes - // the state of the tree to be corrupted, `node` here can be null. - !inst._rootNodeID ? true ? invariant(false, 'Must be mounted to trap events') : _prodInvariant('63') : void 0; - var node = getNode(inst); - !node ? true ? invariant(false, 'trapBubbledEvent(...): Requires node to be rendered.') : _prodInvariant('64') : void 0; - - switch (inst._tag) { - case 'iframe': - case 'object': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)]; - break; - case 'video': - case 'audio': - inst._wrapperState.listeners = []; - // Create listener for each media event - for (var event in mediaEvents) { - if (mediaEvents.hasOwnProperty(event)) { - inst._wrapperState.listeners.push(ReactBrowserEventEmitter.trapBubbledEvent(event, mediaEvents[event], node)); - } - } - break; - case 'source': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node)]; - break; - case 'img': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topError', 'error', node), ReactBrowserEventEmitter.trapBubbledEvent('topLoad', 'load', node)]; - break; - case 'form': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topReset', 'reset', node), ReactBrowserEventEmitter.trapBubbledEvent('topSubmit', 'submit', node)]; - break; - case 'input': - case 'select': - case 'textarea': - inst._wrapperState.listeners = [ReactBrowserEventEmitter.trapBubbledEvent('topInvalid', 'invalid', node)]; - break; - } -} - -function postUpdateSelectWrapper() { - ReactDOMSelect.postUpdateWrapper(this); -} - -// For HTML, certain tags should omit their close tag. We keep a whitelist for -// those special-case tags. - -var omittedCloseTags = { - area: true, - base: true, - br: true, - col: true, - embed: true, - hr: true, - img: true, - input: true, - keygen: true, - link: true, - meta: true, - param: true, - source: true, - track: true, - wbr: true - // NOTE: menuitem's close tag should be omitted, but that causes problems. -}; - -var newlineEatingTags = { - listing: true, - pre: true, - textarea: true -}; - -// For HTML, certain tags cannot have children. This has the same purpose as -// `omittedCloseTags` except that `menuitem` should still have its closing tag. - -var voidElementTags = _assign({ - menuitem: true -}, omittedCloseTags); - -// We accept any tag to be rendered but since this gets injected into arbitrary -// HTML, we want to make sure that it's a safe tag. -// http://www.w3.org/TR/REC-xml/#NT-Name - -var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset -var validatedTagCache = {}; -var hasOwnProperty = {}.hasOwnProperty; - -function validateDangerousTag(tag) { - if (!hasOwnProperty.call(validatedTagCache, tag)) { - !VALID_TAG_REGEX.test(tag) ? true ? invariant(false, 'Invalid tag: %s', tag) : _prodInvariant('65', tag) : void 0; - validatedTagCache[tag] = true; - } -} - -function isCustomComponent(tagName, props) { - return tagName.indexOf('-') >= 0 || props.is != null; -} - -var globalIdCounter = 1; - -/** - * Creates a new React class that is idempotent and capable of containing other - * React components. It accepts event listeners and DOM properties that are - * valid according to `DOMProperty`. - * - * - Event listeners: `onClick`, `onMouseDown`, etc. - * - DOM properties: `className`, `name`, `title`, etc. - * - * The `style` property functions differently from the DOM API. It accepts an - * object mapping of style properties to values. - * - * @constructor ReactDOMComponent - * @extends ReactMultiChild - */ -function ReactDOMComponent(element) { - var tag = element.type; - validateDangerousTag(tag); - this._currentElement = element; - this._tag = tag.toLowerCase(); - this._namespaceURI = null; - this._renderedChildren = null; - this._previousStyle = null; - this._previousStyleCopy = null; - this._hostNode = null; - this._hostParent = null; - this._rootNodeID = 0; - this._domID = 0; - this._hostContainerInfo = null; - this._wrapperState = null; - this._topLevelWrapper = null; - this._flags = 0; - if (true) { - this._ancestorInfo = null; - setAndValidateContentChildDev.call(this, null); - } -} - -ReactDOMComponent.displayName = 'ReactDOMComponent'; - -ReactDOMComponent.Mixin = { - /** - * Generates root tag markup then recurses. This method has side effects and - * is not idempotent. - * - * @internal - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @param {?ReactDOMComponent} the parent component instance - * @param {?object} info about the host container - * @param {object} context - * @return {string} The computed markup. - */ - mountComponent: function (transaction, hostParent, hostContainerInfo, context) { - this._rootNodeID = globalIdCounter++; - this._domID = hostContainerInfo._idCounter++; - this._hostParent = hostParent; - this._hostContainerInfo = hostContainerInfo; - - var props = this._currentElement.props; - - switch (this._tag) { - case 'audio': - case 'form': - case 'iframe': - case 'img': - case 'link': - case 'object': - case 'source': - case 'video': - this._wrapperState = { - listeners: null - }; - transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); - break; - case 'input': - ReactDOMInput.mountWrapper(this, props, hostParent); - props = ReactDOMInput.getHostProps(this, props); - transaction.getReactMountReady().enqueue(trackInputValue, this); - transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); - break; - case 'option': - ReactDOMOption.mountWrapper(this, props, hostParent); - props = ReactDOMOption.getHostProps(this, props); - break; - case 'select': - ReactDOMSelect.mountWrapper(this, props, hostParent); - props = ReactDOMSelect.getHostProps(this, props); - transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); - break; - case 'textarea': - ReactDOMTextarea.mountWrapper(this, props, hostParent); - props = ReactDOMTextarea.getHostProps(this, props); - transaction.getReactMountReady().enqueue(trackInputValue, this); - transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this); - break; - } - - assertValidProps(this, props); - - // We create tags in the namespace of their parent container, except HTML - // tags get no namespace. - var namespaceURI; - var parentTag; - if (hostParent != null) { - namespaceURI = hostParent._namespaceURI; - parentTag = hostParent._tag; - } else if (hostContainerInfo._tag) { - namespaceURI = hostContainerInfo._namespaceURI; - parentTag = hostContainerInfo._tag; - } - if (namespaceURI == null || namespaceURI === DOMNamespaces.svg && parentTag === 'foreignobject') { - namespaceURI = DOMNamespaces.html; - } - if (namespaceURI === DOMNamespaces.html) { - if (this._tag === 'svg') { - namespaceURI = DOMNamespaces.svg; - } else if (this._tag === 'math') { - namespaceURI = DOMNamespaces.mathml; - } - } - this._namespaceURI = namespaceURI; - - if (true) { - var parentInfo; - if (hostParent != null) { - parentInfo = hostParent._ancestorInfo; - } else if (hostContainerInfo._tag) { - parentInfo = hostContainerInfo._ancestorInfo; - } - if (parentInfo) { - // parentInfo should always be present except for the top-level - // component when server rendering - validateDOMNesting(this._tag, null, this, parentInfo); - } - this._ancestorInfo = validateDOMNesting.updatedAncestorInfo(parentInfo, this._tag, this); - } - - var mountImage; - if (transaction.useCreateElement) { - var ownerDocument = hostContainerInfo._ownerDocument; - var el; - if (namespaceURI === DOMNamespaces.html) { - if (this._tag === 'script') { - // Create the script via .innerHTML so its "parser-inserted" flag is - // set to true and it does not execute - var div = ownerDocument.createElement('div'); - var type = this._currentElement.type; - div.innerHTML = '<' + type + '></' + type + '>'; - el = div.removeChild(div.firstChild); - } else if (props.is) { - el = ownerDocument.createElement(this._currentElement.type, props.is); - } else { - // Separate else branch instead of using `props.is || undefined` above becuase of a Firefox bug. - // See discussion in https://github.com/facebook/react/pull/6896 - // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240 - el = ownerDocument.createElement(this._currentElement.type); - } - } else { - el = ownerDocument.createElementNS(namespaceURI, this._currentElement.type); - } - ReactDOMComponentTree.precacheNode(this, el); - this._flags |= Flags.hasCachedChildNodes; - if (!this._hostParent) { - DOMPropertyOperations.setAttributeForRoot(el); - } - this._updateDOMProperties(null, props, transaction); - var lazyTree = DOMLazyTree(el); - this._createInitialChildren(transaction, props, context, lazyTree); - mountImage = lazyTree; - } else { - var tagOpen = this._createOpenTagMarkupAndPutListeners(transaction, props); - var tagContent = this._createContentMarkup(transaction, props, context); - if (!tagContent && omittedCloseTags[this._tag]) { - mountImage = tagOpen + '/>'; - } else { - mountImage = tagOpen + '>' + tagContent + '</' + this._currentElement.type + '>'; - } - } - - switch (this._tag) { - case 'input': - transaction.getReactMountReady().enqueue(inputPostMount, this); - if (props.autoFocus) { - transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); - } - break; - case 'textarea': - transaction.getReactMountReady().enqueue(textareaPostMount, this); - if (props.autoFocus) { - transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); - } - break; - case 'select': - if (props.autoFocus) { - transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); - } - break; - case 'button': - if (props.autoFocus) { - transaction.getReactMountReady().enqueue(AutoFocusUtils.focusDOMComponent, this); - } - break; - case 'option': - transaction.getReactMountReady().enqueue(optionPostMount, this); - break; - } - - return mountImage; - }, - - /** - * Creates markup for the open tag and all attributes. - * - * This method has side effects because events get registered. - * - * Iterating over object properties is faster than iterating over arrays. - * @see http://jsperf.com/obj-vs-arr-iteration - * - * @private - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @param {object} props - * @return {string} Markup of opening tag. - */ - _createOpenTagMarkupAndPutListeners: function (transaction, props) { - var ret = '<' + this._currentElement.type; - - for (var propKey in props) { - if (!props.hasOwnProperty(propKey)) { - continue; - } - var propValue = props[propKey]; - if (propValue == null) { - continue; - } - if (registrationNameModules.hasOwnProperty(propKey)) { - if (propValue) { - enqueuePutListener(this, propKey, propValue, transaction); - } - } else { - if (propKey === STYLE) { - if (propValue) { - if (true) { - // See `_updateDOMProperties`. style block - this._previousStyle = propValue; - } - propValue = this._previousStyleCopy = _assign({}, props.style); - } - propValue = CSSPropertyOperations.createMarkupForStyles(propValue, this); - } - var markup = null; - if (this._tag != null && isCustomComponent(this._tag, props)) { - if (!RESERVED_PROPS.hasOwnProperty(propKey)) { - markup = DOMPropertyOperations.createMarkupForCustomAttribute(propKey, propValue); - } - } else { - markup = DOMPropertyOperations.createMarkupForProperty(propKey, propValue); - } - if (markup) { - ret += ' ' + markup; - } - } - } - - // For static pages, no need to put React ID and checksum. Saves lots of - // bytes. - if (transaction.renderToStaticMarkup) { - return ret; - } - - if (!this._hostParent) { - ret += ' ' + DOMPropertyOperations.createMarkupForRoot(); - } - ret += ' ' + DOMPropertyOperations.createMarkupForID(this._domID); - return ret; - }, - - /** - * Creates markup for the content between the tags. - * - * @private - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @param {object} props - * @param {object} context - * @return {string} Content markup. - */ - _createContentMarkup: function (transaction, props, context) { - var ret = ''; - - // Intentional use of != to avoid catching zero/false. - var innerHTML = props.dangerouslySetInnerHTML; - if (innerHTML != null) { - if (innerHTML.__html != null) { - ret = innerHTML.__html; - } - } else { - var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null; - var childrenToUse = contentToUse != null ? null : props.children; - if (contentToUse != null) { - // TODO: Validate that text is allowed as a child of this node - ret = escapeTextContentForBrowser(contentToUse); - if (true) { - setAndValidateContentChildDev.call(this, contentToUse); - } - } else if (childrenToUse != null) { - var mountImages = this.mountChildren(childrenToUse, transaction, context); - ret = mountImages.join(''); - } - } - if (newlineEatingTags[this._tag] && ret.charAt(0) === '\n') { - // text/html ignores the first character in these tags if it's a newline - // Prefer to break application/xml over text/html (for now) by adding - // a newline specifically to get eaten by the parser. (Alternately for - // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first - // \r is normalized out by HTMLTextAreaElement#value.) - // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre> - // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions> - // See: <http://www.w3.org/TR/html5/syntax.html#newlines> - // See: Parsing of "textarea" "listing" and "pre" elements - // from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody> - return '\n' + ret; - } else { - return ret; - } - }, - - _createInitialChildren: function (transaction, props, context, lazyTree) { - // Intentional use of != to avoid catching zero/false. - var innerHTML = props.dangerouslySetInnerHTML; - if (innerHTML != null) { - if (innerHTML.__html != null) { - DOMLazyTree.queueHTML(lazyTree, innerHTML.__html); - } - } else { - var contentToUse = CONTENT_TYPES[typeof props.children] ? props.children : null; - var childrenToUse = contentToUse != null ? null : props.children; - // TODO: Validate that text is allowed as a child of this node - if (contentToUse != null) { - // Avoid setting textContent when the text is empty. In IE11 setting - // textContent on a text area will cause the placeholder to not - // show within the textarea until it has been focused and blurred again. - // https://github.com/facebook/react/issues/6731#issuecomment-254874553 - if (contentToUse !== '') { - if (true) { - setAndValidateContentChildDev.call(this, contentToUse); - } - DOMLazyTree.queueText(lazyTree, contentToUse); - } - } else if (childrenToUse != null) { - var mountImages = this.mountChildren(childrenToUse, transaction, context); - for (var i = 0; i < mountImages.length; i++) { - DOMLazyTree.queueChild(lazyTree, mountImages[i]); - } - } - } - }, - - /** - * Receives a next element and updates the component. - * - * @internal - * @param {ReactElement} nextElement - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @param {object} context - */ - receiveComponent: function (nextElement, transaction, context) { - var prevElement = this._currentElement; - this._currentElement = nextElement; - this.updateComponent(transaction, prevElement, nextElement, context); - }, - - /** - * Updates a DOM component after it has already been allocated and - * attached to the DOM. Reconciles the root DOM node, then recurses. - * - * @param {ReactReconcileTransaction} transaction - * @param {ReactElement} prevElement - * @param {ReactElement} nextElement - * @internal - * @overridable - */ - updateComponent: function (transaction, prevElement, nextElement, context) { - var lastProps = prevElement.props; - var nextProps = this._currentElement.props; - - switch (this._tag) { - case 'input': - lastProps = ReactDOMInput.getHostProps(this, lastProps); - nextProps = ReactDOMInput.getHostProps(this, nextProps); - break; - case 'option': - lastProps = ReactDOMOption.getHostProps(this, lastProps); - nextProps = ReactDOMOption.getHostProps(this, nextProps); - break; - case 'select': - lastProps = ReactDOMSelect.getHostProps(this, lastProps); - nextProps = ReactDOMSelect.getHostProps(this, nextProps); - break; - case 'textarea': - lastProps = ReactDOMTextarea.getHostProps(this, lastProps); - nextProps = ReactDOMTextarea.getHostProps(this, nextProps); - break; - } - - assertValidProps(this, nextProps); - this._updateDOMProperties(lastProps, nextProps, transaction); - this._updateDOMChildren(lastProps, nextProps, transaction, context); - - switch (this._tag) { - case 'input': - // Update the wrapper around inputs *after* updating props. This has to - // happen after `_updateDOMProperties`. Otherwise HTML5 input validations - // raise warnings and prevent the new value from being assigned. - ReactDOMInput.updateWrapper(this); - - // We also check that we haven't missed a value update, such as a - // Radio group shifting the checked value to another named radio input. - inputValueTracking.updateValueIfChanged(this); - break; - case 'textarea': - ReactDOMTextarea.updateWrapper(this); - break; - case 'select': - // <select> value update needs to occur after <option> children - // reconciliation - transaction.getReactMountReady().enqueue(postUpdateSelectWrapper, this); - break; - } - }, - - /** - * Reconciles the properties by detecting differences in property values and - * updating the DOM as necessary. This function is probably the single most - * critical path for performance optimization. - * - * TODO: Benchmark whether checking for changed values in memory actually - * improves performance (especially statically positioned elements). - * TODO: Benchmark the effects of putting this at the top since 99% of props - * do not change for a given reconciliation. - * TODO: Benchmark areas that can be improved with caching. - * - * @private - * @param {object} lastProps - * @param {object} nextProps - * @param {?DOMElement} node - */ - _updateDOMProperties: function (lastProps, nextProps, transaction) { - var propKey; - var styleName; - var styleUpdates; - for (propKey in lastProps) { - if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) { - continue; - } - if (propKey === STYLE) { - var lastStyle = this._previousStyleCopy; - for (styleName in lastStyle) { - if (lastStyle.hasOwnProperty(styleName)) { - styleUpdates = styleUpdates || {}; - styleUpdates[styleName] = ''; - } - } - this._previousStyleCopy = null; - } else if (registrationNameModules.hasOwnProperty(propKey)) { - if (lastProps[propKey]) { - // Only call deleteListener if there was a listener previously or - // else willDeleteListener gets called when there wasn't actually a - // listener (e.g., onClick={null}) - deleteListener(this, propKey); - } - } else if (isCustomComponent(this._tag, lastProps)) { - if (!RESERVED_PROPS.hasOwnProperty(propKey)) { - DOMPropertyOperations.deleteValueForAttribute(getNode(this), propKey); - } - } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) { - DOMPropertyOperations.deleteValueForProperty(getNode(this), propKey); - } - } - for (propKey in nextProps) { - var nextProp = nextProps[propKey]; - var lastProp = propKey === STYLE ? this._previousStyleCopy : lastProps != null ? lastProps[propKey] : undefined; - if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) { - continue; - } - if (propKey === STYLE) { - if (nextProp) { - if (true) { - checkAndWarnForMutatedStyle(this._previousStyleCopy, this._previousStyle, this); - this._previousStyle = nextProp; - } - nextProp = this._previousStyleCopy = _assign({}, nextProp); - } else { - this._previousStyleCopy = null; - } - if (lastProp) { - // Unset styles on `lastProp` but not on `nextProp`. - for (styleName in lastProp) { - if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) { - styleUpdates = styleUpdates || {}; - styleUpdates[styleName] = ''; - } - } - // Update styles that changed since `lastProp`. - for (styleName in nextProp) { - if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) { - styleUpdates = styleUpdates || {}; - styleUpdates[styleName] = nextProp[styleName]; - } - } - } else { - // Relies on `updateStylesByID` not mutating `styleUpdates`. - styleUpdates = nextProp; - } - } else if (registrationNameModules.hasOwnProperty(propKey)) { - if (nextProp) { - enqueuePutListener(this, propKey, nextProp, transaction); - } else if (lastProp) { - deleteListener(this, propKey); - } - } else if (isCustomComponent(this._tag, nextProps)) { - if (!RESERVED_PROPS.hasOwnProperty(propKey)) { - DOMPropertyOperations.setValueForAttribute(getNode(this), propKey, nextProp); - } - } else if (DOMProperty.properties[propKey] || DOMProperty.isCustomAttribute(propKey)) { - var node = getNode(this); - // If we're updating to null or undefined, we should remove the property - // from the DOM node instead of inadvertently setting to a string. This - // brings us in line with the same behavior we have on initial render. - if (nextProp != null) { - DOMPropertyOperations.setValueForProperty(node, propKey, nextProp); - } else { - DOMPropertyOperations.deleteValueForProperty(node, propKey); - } - } - } - if (styleUpdates) { - CSSPropertyOperations.setValueForStyles(getNode(this), styleUpdates, this); - } - }, - - /** - * Reconciles the children with the various properties that affect the - * children content. - * - * @param {object} lastProps - * @param {object} nextProps - * @param {ReactReconcileTransaction} transaction - * @param {object} context - */ - _updateDOMChildren: function (lastProps, nextProps, transaction, context) { - var lastContent = CONTENT_TYPES[typeof lastProps.children] ? lastProps.children : null; - var nextContent = CONTENT_TYPES[typeof nextProps.children] ? nextProps.children : null; - - var lastHtml = lastProps.dangerouslySetInnerHTML && lastProps.dangerouslySetInnerHTML.__html; - var nextHtml = nextProps.dangerouslySetInnerHTML && nextProps.dangerouslySetInnerHTML.__html; - - // Note the use of `!=` which checks for null or undefined. - var lastChildren = lastContent != null ? null : lastProps.children; - var nextChildren = nextContent != null ? null : nextProps.children; - - // If we're switching from children to content/html or vice versa, remove - // the old content - var lastHasContentOrHtml = lastContent != null || lastHtml != null; - var nextHasContentOrHtml = nextContent != null || nextHtml != null; - if (lastChildren != null && nextChildren == null) { - this.updateChildren(null, transaction, context); - } else if (lastHasContentOrHtml && !nextHasContentOrHtml) { - this.updateTextContent(''); - if (true) { - ReactInstrumentation.debugTool.onSetChildren(this._debugID, []); - } - } - - if (nextContent != null) { - if (lastContent !== nextContent) { - this.updateTextContent('' + nextContent); - if (true) { - setAndValidateContentChildDev.call(this, nextContent); - } - } - } else if (nextHtml != null) { - if (lastHtml !== nextHtml) { - this.updateMarkup('' + nextHtml); - } - if (true) { - ReactInstrumentation.debugTool.onSetChildren(this._debugID, []); - } - } else if (nextChildren != null) { - if (true) { - setAndValidateContentChildDev.call(this, null); - } - - this.updateChildren(nextChildren, transaction, context); - } - }, - - getHostNode: function () { - return getNode(this); - }, - - /** - * Destroys all event registrations for this instance. Does not remove from - * the DOM. That must be done by the parent. - * - * @internal - */ - unmountComponent: function (safely) { - switch (this._tag) { - case 'audio': - case 'form': - case 'iframe': - case 'img': - case 'link': - case 'object': - case 'source': - case 'video': - var listeners = this._wrapperState.listeners; - if (listeners) { - for (var i = 0; i < listeners.length; i++) { - listeners[i].remove(); - } - } - break; - case 'input': - case 'textarea': - inputValueTracking.stopTracking(this); - break; - case 'html': - case 'head': - case 'body': - /** - * Components like <html> <head> and <body> can't be removed or added - * easily in a cross-browser way, however it's valuable to be able to - * take advantage of React's reconciliation for styling and <title> - * management. So we just document it and throw in dangerous cases. - */ - true ? true ? invariant(false, '<%s> tried to unmount. Because of cross-browser quirks it is impossible to unmount some top-level components (eg <html>, <head>, and <body>) reliably and efficiently. To fix this, have a single top-level component that never unmounts render these elements.', this._tag) : _prodInvariant('66', this._tag) : void 0; - break; - } - - this.unmountChildren(safely); - ReactDOMComponentTree.uncacheNode(this); - EventPluginHub.deleteAllListeners(this); - this._rootNodeID = 0; - this._domID = 0; - this._wrapperState = null; - - if (true) { - setAndValidateContentChildDev.call(this, null); - } - }, - - getPublicInstance: function () { - return getNode(this); - } -}; - -_assign(ReactDOMComponent.prototype, ReactDOMComponent.Mixin, ReactMultiChild.Mixin); - -module.exports = ReactDOMComponent; - -/***/ }), -/* 411 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactDOMComponentTree = __webpack_require__(9); - -var focusNode = __webpack_require__(191); - -var AutoFocusUtils = { - focusDOMComponent: function () { - focusNode(ReactDOMComponentTree.getNodeFromInstance(this)); - } -}; - -module.exports = AutoFocusUtils; - -/***/ }), -/* 412 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var CSSProperty = __webpack_require__(192); -var ExecutionEnvironment = __webpack_require__(13); -var ReactInstrumentation = __webpack_require__(19); - -var camelizeStyleName = __webpack_require__(193); -var dangerousStyleValue = __webpack_require__(414); -var hyphenateStyleName = __webpack_require__(194); -var memoizeStringOnly = __webpack_require__(195); -var warning = __webpack_require__(2); - -var processStyleName = memoizeStringOnly(function (styleName) { - return hyphenateStyleName(styleName); -}); - -var hasShorthandPropertyBug = false; -var styleFloatAccessor = 'cssFloat'; -if (ExecutionEnvironment.canUseDOM) { - var tempStyle = document.createElement('div').style; - try { - // IE8 throws "Invalid argument." if resetting shorthand style properties. - tempStyle.font = ''; - } catch (e) { - hasShorthandPropertyBug = true; - } - // IE8 only supports accessing cssFloat (standard) as styleFloat - if (document.documentElement.style.cssFloat === undefined) { - styleFloatAccessor = 'styleFloat'; - } -} - -if (true) { - // 'msTransform' is correct, but the other prefixes should be capitalized - var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; - - // style values shouldn't contain a semicolon - var badStyleValueWithSemicolonPattern = /;\s*$/; - - var warnedStyleNames = {}; - var warnedStyleValues = {}; - var warnedForNaNValue = false; - - var warnHyphenatedStyleName = function (name, owner) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - true ? warning(false, 'Unsupported style property %s. Did you mean %s?%s', name, camelizeStyleName(name), checkRenderMessage(owner)) : void 0; - }; - - var warnBadVendoredStyleName = function (name, owner) { - if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { - return; - } - - warnedStyleNames[name] = true; - true ? warning(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?%s', name, name.charAt(0).toUpperCase() + name.slice(1), checkRenderMessage(owner)) : void 0; - }; - - var warnStyleValueWithSemicolon = function (name, value, owner) { - if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { - return; - } - - warnedStyleValues[value] = true; - true ? warning(false, "Style property values shouldn't contain a semicolon.%s " + 'Try "%s: %s" instead.', checkRenderMessage(owner), name, value.replace(badStyleValueWithSemicolonPattern, '')) : void 0; - }; - - var warnStyleValueIsNaN = function (name, value, owner) { - if (warnedForNaNValue) { - return; - } - - warnedForNaNValue = true; - true ? warning(false, '`NaN` is an invalid value for the `%s` css style property.%s', name, checkRenderMessage(owner)) : void 0; - }; - - var checkRenderMessage = function (owner) { - if (owner) { - var name = owner.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; - }; - - /** - * @param {string} name - * @param {*} value - * @param {ReactDOMComponent} component - */ - var warnValidStyle = function (name, value, component) { - var owner; - if (component) { - owner = component._currentElement._owner; - } - if (name.indexOf('-') > -1) { - warnHyphenatedStyleName(name, owner); - } else if (badVendoredStyleNamePattern.test(name)) { - warnBadVendoredStyleName(name, owner); - } else if (badStyleValueWithSemicolonPattern.test(value)) { - warnStyleValueWithSemicolon(name, value, owner); - } - - if (typeof value === 'number' && isNaN(value)) { - warnStyleValueIsNaN(name, value, owner); - } - }; -} - -/** - * Operations for dealing with CSS properties. - */ -var CSSPropertyOperations = { - /** - * Serializes a mapping of style properties for use as inline styles: - * - * > createMarkupForStyles({width: '200px', height: 0}) - * "width:200px;height:0;" - * - * Undefined values are ignored so that declarative programming is easier. - * The result should be HTML-escaped before insertion into the DOM. - * - * @param {object} styles - * @param {ReactDOMComponent} component - * @return {?string} - */ - createMarkupForStyles: function (styles, component) { - var serialized = ''; - for (var styleName in styles) { - if (!styles.hasOwnProperty(styleName)) { - continue; - } - var isCustomProperty = styleName.indexOf('--') === 0; - var styleValue = styles[styleName]; - if (true) { - if (!isCustomProperty) { - warnValidStyle(styleName, styleValue, component); - } - } - if (styleValue != null) { - serialized += processStyleName(styleName) + ':'; - serialized += dangerousStyleValue(styleName, styleValue, component, isCustomProperty) + ';'; - } - } - return serialized || null; - }, - - /** - * Sets the value for multiple styles on a node. If a value is specified as - * '' (empty string), the corresponding style property will be unset. - * - * @param {DOMElement} node - * @param {object} styles - * @param {ReactDOMComponent} component - */ - setValueForStyles: function (node, styles, component) { - if (true) { - ReactInstrumentation.debugTool.onHostOperation({ - instanceID: component._debugID, - type: 'update styles', - payload: styles - }); - } - - var style = node.style; - for (var styleName in styles) { - if (!styles.hasOwnProperty(styleName)) { - continue; - } - var isCustomProperty = styleName.indexOf('--') === 0; - if (true) { - if (!isCustomProperty) { - warnValidStyle(styleName, styles[styleName], component); - } - } - var styleValue = dangerousStyleValue(styleName, styles[styleName], component, isCustomProperty); - if (styleName === 'float' || styleName === 'cssFloat') { - styleName = styleFloatAccessor; - } - if (isCustomProperty) { - style.setProperty(styleName, styleValue); - } else if (styleValue) { - style[styleName] = styleValue; - } else { - var expansion = hasShorthandPropertyBug && CSSProperty.shorthandPropertyExpansions[styleName]; - if (expansion) { - // Shorthand property that IE8 won't like unsetting, so unset each - // component to placate it - for (var individualStyleName in expansion) { - style[individualStyleName] = ''; - } - } else { - style[styleName] = ''; - } - } - } - } -}; - -module.exports = CSSPropertyOperations; - -/***/ }), -/* 413 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var _hyphenPattern = /-(.)/g; - -/** - * Camelcases a hyphenated string, for example: - * - * > camelize('background-color') - * < "backgroundColor" - * - * @param {string} string - * @return {string} - */ -function camelize(string) { - return string.replace(_hyphenPattern, function (_, character) { - return character.toUpperCase(); - }); -} - -module.exports = camelize; - -/***/ }), -/* 414 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var CSSProperty = __webpack_require__(192); -var warning = __webpack_require__(2); - -var isUnitlessNumber = CSSProperty.isUnitlessNumber; -var styleWarnings = {}; - -/** - * Convert a value into the proper css writable value. The style name `name` - * should be logical (no hyphens), as specified - * in `CSSProperty.isUnitlessNumber`. - * - * @param {string} name CSS property name such as `topMargin`. - * @param {*} value CSS property value such as `10px`. - * @param {ReactDOMComponent} component - * @return {string} Normalized style value with dimensions applied. - */ -function dangerousStyleValue(name, value, component, isCustomProperty) { - // Note that we've removed escapeTextForBrowser() calls here since the - // whole string will be escaped when the attribute is injected into - // the markup. If you provide unsafe user data here they can inject - // arbitrary CSS which may be problematic (I couldn't repro this): - // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet - // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ - // This is not an XSS hole but instead a potential CSS injection issue - // which has lead to a greater discussion about how we're going to - // trust URLs moving forward. See #2115901 - - var isEmpty = value == null || typeof value === 'boolean' || value === ''; - if (isEmpty) { - return ''; - } - - var isNonNumeric = isNaN(value); - if (isCustomProperty || isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) { - return '' + value; // cast to string - } - - if (typeof value === 'string') { - if (true) { - // Allow '0' to pass through without warning. 0 is already special and - // doesn't require units, so we don't need to warn about it. - if (component && value !== '0') { - var owner = component._currentElement._owner; - var ownerName = owner ? owner.getName() : null; - if (ownerName && !styleWarnings[ownerName]) { - styleWarnings[ownerName] = {}; - } - var warned = false; - if (ownerName) { - var warnings = styleWarnings[ownerName]; - warned = warnings[name]; - if (!warned) { - warnings[name] = true; - } - } - if (!warned) { - true ? warning(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0; - } - } - } - value = value.trim(); - } - return value + 'px'; -} - -module.exports = dangerousStyleValue; - -/***/ }), -/* 415 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var _uppercasePattern = /([A-Z])/g; - -/** - * Hyphenates a camelcased string, for example: - * - * > hyphenate('backgroundColor') - * < "background-color" - * - * For CSS style names, use `hyphenateStyleName` instead which works properly - * with all vendor prefixes, including `ms`. - * - * @param {string} string - * @return {string} - */ -function hyphenate(string) { - return string.replace(_uppercasePattern, '-$1').toLowerCase(); -} - -module.exports = hyphenate; - -/***/ }), -/* 416 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var escapeTextContentForBrowser = __webpack_require__(83); - -/** - * Escapes attribute value to prevent scripting attacks. - * - * @param {*} value Value to escape. - * @return {string} An escaped string. - */ -function quoteAttributeValueForBrowser(value) { - return '"' + escapeTextContentForBrowser(value) + '"'; -} - -module.exports = quoteAttributeValueForBrowser; - -/***/ }), -/* 417 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var EventPluginHub = __webpack_require__(61); - -function runEventQueueInBatch(events) { - EventPluginHub.enqueueEvents(events); - EventPluginHub.processEventQueue(false); -} - -var ReactEventEmitterMixin = { - /** - * Streams a fired top-level event to `EventPluginHub` where plugins have the - * opportunity to create `ReactEvent`s to be dispatched. - */ - handleTopLevel: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var events = EventPluginHub.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); - runEventQueueInBatch(events); - } -}; - -module.exports = ReactEventEmitterMixin; - -/***/ }), -/* 418 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ExecutionEnvironment = __webpack_require__(13); - -/** - * 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; - prefixes['ms' + styleProp] = 'MS' + eventName; - prefixes['O' + styleProp] = 'o' + eventName.toLowerCase(); - - 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 (ExecutionEnvironment.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 ''; -} - -module.exports = getVendorPrefixedEventName; - -/***/ }), -/* 419 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4), - _assign = __webpack_require__(7); - -var DOMPropertyOperations = __webpack_require__(196); -var LinkedValueUtils = __webpack_require__(119); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactUpdates = __webpack_require__(26); - -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -var didWarnValueLink = false; -var didWarnCheckedLink = false; -var didWarnValueDefaultValue = false; -var didWarnCheckedDefaultChecked = false; -var didWarnControlledToUncontrolled = false; -var didWarnUncontrolledToControlled = false; - -function forceUpdateIfMounted() { - if (this._rootNodeID) { - // DOM component is still mounted; update - ReactDOMInput.updateWrapper(this); - } -} - -function isControlled(props) { - var usesChecked = props.type === 'checkbox' || props.type === 'radio'; - return usesChecked ? props.checked != null : props.value != null; -} - -/** - * Implements an <input> 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 - */ -var ReactDOMInput = { - getHostProps: function (inst, props) { - var value = LinkedValueUtils.getValue(props); - var checked = LinkedValueUtils.getChecked(props); - - var hostProps = _assign({ - // Make sure we set .type before any other properties (setting .value - // before .type means .value is lost in IE11 and below) - type: undefined, - // Make sure we set .step before .value (setting .value before .step - // means .value is rounded on mount, based upon step precision) - step: undefined, - // Make sure we set .min & .max before .value (to ensure proper order - // in corner cases such as min or max deriving from value, e.g. Issue #7170) - min: undefined, - max: undefined - }, props, { - defaultChecked: undefined, - defaultValue: undefined, - value: value != null ? value : inst._wrapperState.initialValue, - checked: checked != null ? checked : inst._wrapperState.initialChecked, - onChange: inst._wrapperState.onChange - }); - - return hostProps; - }, - - mountWrapper: function (inst, props) { - if (true) { - LinkedValueUtils.checkPropTypes('input', props, inst._currentElement._owner); - - var owner = inst._currentElement._owner; - - if (props.valueLink !== undefined && !didWarnValueLink) { - true ? warning(false, '`valueLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0; - didWarnValueLink = true; - } - if (props.checkedLink !== undefined && !didWarnCheckedLink) { - true ? warning(false, '`checkedLink` prop on `input` is deprecated; set `value` and `onChange` instead.') : void 0; - didWarnCheckedLink = true; - } - if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { - true ? warning(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', owner && owner.getName() || 'A component', props.type) : void 0; - didWarnCheckedDefaultChecked = true; - } - if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { - true ? warning(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', owner && owner.getName() || 'A component', props.type) : void 0; - didWarnValueDefaultValue = true; - } - } - - var defaultValue = props.defaultValue; - inst._wrapperState = { - initialChecked: props.checked != null ? props.checked : props.defaultChecked, - initialValue: props.value != null ? props.value : defaultValue, - listeners: null, - onChange: _handleChange.bind(inst), - controlled: isControlled(props) - }; - }, - - updateWrapper: function (inst) { - var props = inst._currentElement.props; - - if (true) { - var controlled = isControlled(props); - var owner = inst._currentElement._owner; - - if (!inst._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { - true ? warning(false, '%s 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', owner && owner.getName() || 'A component', props.type) : void 0; - didWarnUncontrolledToControlled = true; - } - if (inst._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { - true ? warning(false, '%s 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', owner && owner.getName() || 'A component', props.type) : void 0; - didWarnControlledToUncontrolled = true; - } - } - - // TODO: Shouldn't this be getChecked(props)? - var checked = props.checked; - if (checked != null) { - DOMPropertyOperations.setValueForProperty(ReactDOMComponentTree.getNodeFromInstance(inst), 'checked', checked || false); - } - - var node = ReactDOMComponentTree.getNodeFromInstance(inst); - var value = LinkedValueUtils.getValue(props); - if (value != null) { - if (value === 0 && node.value === '') { - node.value = '0'; - // Note: IE9 reports a number inputs as 'text', so check props instead. - } else if (props.type === 'number') { - // Simulate `input.valueAsNumber`. IE9 does not support it - var valueAsNumber = parseFloat(node.value, 10) || 0; - - if ( - // eslint-disable-next-line - value != valueAsNumber || - // eslint-disable-next-line - value == valueAsNumber && node.value != value) { - // Cast `value` to a string to ensure the value is set correctly. While - // browsers typically do this as necessary, jsdom doesn't. - node.value = '' + value; - } - } else if (node.value !== '' + value) { - // Cast `value` to a string to ensure the value is set correctly. While - // browsers typically do this as necessary, jsdom doesn't. - node.value = '' + value; - } - } else { - if (props.value == null && props.defaultValue != null) { - // 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 <x> 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 - if (node.defaultValue !== '' + props.defaultValue) { - node.defaultValue = '' + props.defaultValue; - } - } - if (props.checked == null && props.defaultChecked != null) { - node.defaultChecked = !!props.defaultChecked; - } - } - }, - - postMountWrapper: function (inst) { - var props = inst._currentElement.props; - - // This is in postMount because we need access to the DOM node, which is not - // available until after the component has mounted. - var node = ReactDOMComponentTree.getNodeFromInstance(inst); - - // Detach value from defaultValue. We won't do anything if we're working on - // submit or reset inputs as those values & defaultValues are linked. They - // are not resetable nodes so this operation doesn't matter and actually - // removes browser-default values (eg "Submit Query") when no value is - // provided. - - switch (props.type) { - case 'submit': - case 'reset': - break; - case 'color': - case 'date': - case 'datetime': - case 'datetime-local': - case 'month': - case 'time': - case 'week': - // This fixes the no-show issue on iOS Safari and Android Chrome: - // https://github.com/facebook/react/issues/7233 - node.value = ''; - node.value = node.defaultValue; - break; - default: - node.value = node.value; - break; - } - - // 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 = ''; - } - node.defaultChecked = !node.defaultChecked; - node.defaultChecked = !node.defaultChecked; - if (name !== '') { - node.name = name; - } - } -}; - -function _handleChange(event) { - var props = this._currentElement.props; - - var returnValue = LinkedValueUtils.executeOnChange(props, event); - - // Here we use asap to wait until all updates have propagated, which - // is important when using controlled components within layers: - // https://github.com/facebook/react/issues/1698 - ReactUpdates.asap(forceUpdateIfMounted, this); - - var name = props.name; - if (props.type === 'radio' && name != null) { - var rootNode = ReactDOMComponentTree.getNodeFromInstance(this); - var queryRoot = rootNode; - - while (queryRoot.parentNode) { - queryRoot = queryRoot.parentNode; - } - - // If `rootNode.form` was non-null, then we could try `form.elements`, - // but that sometimes behaves strangely in IE8. We could also try using - // `form.getElementsByName`, but that will only return direct children - // and won't include inputs that use the HTML5 `form=` attribute. Since - // the input might not even be in a form, let's just use the global - // `querySelectorAll` to ensure we don't miss anything. - var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); - - for (var i = 0; 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 otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode); - !otherInstance ? true ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : _prodInvariant('90') : void 0; - // If this is a controlled radio button group, forcing the input that - // was previously checked to update will cause it to be come re-checked - // as appropriate. - ReactUpdates.asap(forceUpdateIfMounted, otherInstance); - } - } - - return returnValue; -} - -module.exports = ReactDOMInput; - -/***/ }), -/* 420 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var React = __webpack_require__(42); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactDOMSelect = __webpack_require__(198); - -var warning = __webpack_require__(2); -var didWarnInvalidOptionChildren = false; - -function flattenChildren(children) { - var content = ''; - - // Flatten children and warn if they aren't strings or numbers; - // invalid types are ignored. - React.Children.forEach(children, function (child) { - if (child == null) { - return; - } - if (typeof child === 'string' || typeof child === 'number') { - content += child; - } else if (!didWarnInvalidOptionChildren) { - didWarnInvalidOptionChildren = true; - true ? warning(false, 'Only strings and numbers are supported as <option> children.') : void 0; - } - }); - - return content; -} - -/** - * Implements an <option> host component that warns when `selected` is set. - */ -var ReactDOMOption = { - mountWrapper: function (inst, props, hostParent) { - // TODO (yungsters): Remove support for `selected` in <option>. - if (true) { - true ? warning(props.selected == null, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.') : void 0; - } - - // Look up whether this option is 'selected' - var selectValue = null; - if (hostParent != null) { - var selectParent = hostParent; - - if (selectParent._tag === 'optgroup') { - selectParent = selectParent._hostParent; - } - - if (selectParent != null && selectParent._tag === 'select') { - selectValue = ReactDOMSelect.getSelectValueContext(selectParent); - } - } - - // If the value is null (e.g., no specified value or after initial mount) - // or missing (e.g., for <datalist>), we don't change props.selected - var selected = null; - if (selectValue != null) { - var value; - if (props.value != null) { - value = props.value + ''; - } else { - value = flattenChildren(props.children); - } - selected = false; - if (Array.isArray(selectValue)) { - // multiple - for (var i = 0; i < selectValue.length; i++) { - if ('' + selectValue[i] === value) { - selected = true; - break; - } - } - } else { - selected = '' + selectValue === value; - } - } - - inst._wrapperState = { selected: selected }; - }, - - postMountWrapper: function (inst) { - // value="" should make a value attribute (#6219) - var props = inst._currentElement.props; - if (props.value != null) { - var node = ReactDOMComponentTree.getNodeFromInstance(inst); - node.setAttribute('value', props.value); - } - }, - - getHostProps: function (inst, props) { - var hostProps = _assign({ selected: undefined, children: undefined }, props); - - // Read state only from initial mount because <select> updates value - // manually; we need the initial state only for server rendering - if (inst._wrapperState.selected != null) { - hostProps.selected = inst._wrapperState.selected; - } - - var content = flattenChildren(props.children); - - if (content) { - hostProps.children = content; - } - - return hostProps; - } -}; - -module.exports = ReactDOMOption; - -/***/ }), -/* 421 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4), - _assign = __webpack_require__(7); - -var LinkedValueUtils = __webpack_require__(119); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactUpdates = __webpack_require__(26); - -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -var didWarnValueLink = false; -var didWarnValDefaultVal = false; - -function forceUpdateIfMounted() { - if (this._rootNodeID) { - // DOM component is still mounted; update - ReactDOMTextarea.updateWrapper(this); - } -} - -/** - * Implements a <textarea> host component that allows setting `value`, and - * `defaultValue`. This differs from the traditional DOM API because value is - * usually set as PCDATA children. - * - * If `value` is not supplied (or null/undefined), user actions that affect the - * value will trigger updates to the element. - * - * If `value` is supplied (and not null/undefined), the rendered element will - * not trigger updates to the element. Instead, the `value` prop must change in - * order for the rendered element to be updated. - * - * The rendered element will be initialized with an empty value, the prop - * `defaultValue` if specified, or the children content (deprecated). - */ -var ReactDOMTextarea = { - getHostProps: function (inst, props) { - !(props.dangerouslySetInnerHTML == null) ? true ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : _prodInvariant('91') : void 0; - - // Always set children to the same thing. In IE9, the selection range will - // get reset if `textContent` is mutated. We could add a check in setTextContent - // to only set the value if/when the value differs from the node value (which would - // completely solve this IE9 bug), but Sebastian+Ben seemed to like this solution. - // The value can be a boolean or object so that's why it's forced to be a string. - var hostProps = _assign({}, props, { - value: undefined, - defaultValue: undefined, - children: '' + inst._wrapperState.initialValue, - onChange: inst._wrapperState.onChange - }); - - return hostProps; - }, - - mountWrapper: function (inst, props) { - if (true) { - LinkedValueUtils.checkPropTypes('textarea', props, inst._currentElement._owner); - if (props.valueLink !== undefined && !didWarnValueLink) { - true ? warning(false, '`valueLink` prop on `textarea` is deprecated; set `value` and `onChange` instead.') : void 0; - didWarnValueLink = true; - } - if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) { - true ? warning(false, 'Textarea 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 textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components') : void 0; - didWarnValDefaultVal = true; - } - } - - var value = LinkedValueUtils.getValue(props); - var initialValue = value; - - // Only bother fetching default value if we're going to use it - if (value == null) { - var defaultValue = props.defaultValue; - // TODO (yungsters): Remove support for children content in <textarea>. - var children = props.children; - if (children != null) { - if (true) { - true ? warning(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.') : void 0; - } - !(defaultValue == null) ? true ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : _prodInvariant('92') : void 0; - if (Array.isArray(children)) { - !(children.length <= 1) ? true ? invariant(false, '<textarea> can only have at most one child.') : _prodInvariant('93') : void 0; - children = children[0]; - } - - defaultValue = '' + children; - } - if (defaultValue == null) { - defaultValue = ''; - } - initialValue = defaultValue; - } - - inst._wrapperState = { - initialValue: '' + initialValue, - listeners: null, - onChange: _handleChange.bind(inst) - }; - }, - - updateWrapper: function (inst) { - var props = inst._currentElement.props; - - var node = ReactDOMComponentTree.getNodeFromInstance(inst); - var value = LinkedValueUtils.getValue(props); - if (value != null) { - // Cast `value` to a string to ensure the value is set correctly. While - // browsers typically do this as necessary, jsdom doesn't. - var newValue = '' + value; - - // To avoid side effects (such as losing text selection), only set value if changed - if (newValue !== node.value) { - node.value = newValue; - } - if (props.defaultValue == null) { - node.defaultValue = newValue; - } - } - if (props.defaultValue != null) { - node.defaultValue = props.defaultValue; - } - }, - - postMountWrapper: function (inst) { - // This is in postMount because we need access to the DOM node, which is not - // available until after the component has mounted. - var node = ReactDOMComponentTree.getNodeFromInstance(inst); - var textContent = node.textContent; - - // Only set node.value if textContent is equal to the expected - // initial value. In IE10/IE11 there is a bug where the placeholder attribute - // will populate textContent as well. - // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/ - if (textContent === inst._wrapperState.initialValue) { - node.value = textContent; - } - } -}; - -function _handleChange(event) { - var props = this._currentElement.props; - var returnValue = LinkedValueUtils.executeOnChange(props, event); - ReactUpdates.asap(forceUpdateIfMounted, this); - return returnValue; -} - -module.exports = ReactDOMTextarea; - -/***/ }), -/* 422 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var ReactComponentEnvironment = __webpack_require__(120); -var ReactInstanceMap = __webpack_require__(63); -var ReactInstrumentation = __webpack_require__(19); - -var ReactCurrentOwner = __webpack_require__(23); -var ReactReconciler = __webpack_require__(51); -var ReactChildReconciler = __webpack_require__(423); - -var emptyFunction = __webpack_require__(20); -var flattenChildren = __webpack_require__(430); -var invariant = __webpack_require__(1); - -/** - * Make an update for markup to be rendered and inserted at a supplied index. - * - * @param {string} markup Markup that renders into an element. - * @param {number} toIndex Destination index. - * @private - */ -function makeInsertMarkup(markup, afterNode, toIndex) { - // NOTE: Null values reduce hidden classes. - return { - type: 'INSERT_MARKUP', - content: markup, - fromIndex: null, - fromNode: null, - toIndex: toIndex, - afterNode: afterNode - }; -} - -/** - * Make an update for moving an existing element to another index. - * - * @param {number} fromIndex Source index of the existing element. - * @param {number} toIndex Destination index of the element. - * @private - */ -function makeMove(child, afterNode, toIndex) { - // NOTE: Null values reduce hidden classes. - return { - type: 'MOVE_EXISTING', - content: null, - fromIndex: child._mountIndex, - fromNode: ReactReconciler.getHostNode(child), - toIndex: toIndex, - afterNode: afterNode - }; -} - -/** - * Make an update for removing an element at an index. - * - * @param {number} fromIndex Index of the element to remove. - * @private - */ -function makeRemove(child, node) { - // NOTE: Null values reduce hidden classes. - return { - type: 'REMOVE_NODE', - content: null, - fromIndex: child._mountIndex, - fromNode: node, - toIndex: null, - afterNode: null - }; -} - -/** - * Make an update for setting the markup of a node. - * - * @param {string} markup Markup that renders into an element. - * @private - */ -function makeSetMarkup(markup) { - // NOTE: Null values reduce hidden classes. - return { - type: 'SET_MARKUP', - content: markup, - fromIndex: null, - fromNode: null, - toIndex: null, - afterNode: null - }; -} - -/** - * Make an update for setting the text content. - * - * @param {string} textContent Text content to set. - * @private - */ -function makeTextContent(textContent) { - // NOTE: Null values reduce hidden classes. - return { - type: 'TEXT_CONTENT', - content: textContent, - fromIndex: null, - fromNode: null, - toIndex: null, - afterNode: null - }; -} - -/** - * Push an update, if any, onto the queue. Creates a new queue if none is - * passed and always returns the queue. Mutative. - */ -function enqueue(queue, update) { - if (update) { - queue = queue || []; - queue.push(update); - } - return queue; -} - -/** - * Processes any enqueued updates. - * - * @private - */ -function processQueue(inst, updateQueue) { - ReactComponentEnvironment.processChildrenUpdates(inst, updateQueue); -} - -var setChildrenForInstrumentation = emptyFunction; -if (true) { - var getDebugID = function (inst) { - if (!inst._debugID) { - // Check for ART-like instances. TODO: This is silly/gross. - var internal; - if (internal = ReactInstanceMap.get(inst)) { - inst = internal; - } - } - return inst._debugID; - }; - setChildrenForInstrumentation = function (children) { - var debugID = getDebugID(this); - // TODO: React Native empty components are also multichild. - // This means they still get into this method but don't have _debugID. - if (debugID !== 0) { - ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function (key) { - return children[key]._debugID; - }) : []); - } - }; -} - -/** - * ReactMultiChild are capable of reconciling multiple children. - * - * @class ReactMultiChild - * @internal - */ -var ReactMultiChild = { - /** - * Provides common functionality for components that must reconcile multiple - * children. This is used by `ReactDOMComponent` to mount, update, and - * unmount child components. - * - * @lends {ReactMultiChild.prototype} - */ - Mixin: { - _reconcilerInstantiateChildren: function (nestedChildren, transaction, context) { - if (true) { - var selfDebugID = getDebugID(this); - if (this._currentElement) { - try { - ReactCurrentOwner.current = this._currentElement._owner; - return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context, selfDebugID); - } finally { - ReactCurrentOwner.current = null; - } - } - } - return ReactChildReconciler.instantiateChildren(nestedChildren, transaction, context); - }, - - _reconcilerUpdateChildren: function (prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) { - var nextChildren; - var selfDebugID = 0; - if (true) { - selfDebugID = getDebugID(this); - if (this._currentElement) { - try { - ReactCurrentOwner.current = this._currentElement._owner; - nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID); - } finally { - ReactCurrentOwner.current = null; - } - ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID); - return nextChildren; - } - } - nextChildren = flattenChildren(nextNestedChildrenElements, selfDebugID); - ReactChildReconciler.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID); - return nextChildren; - }, - - /** - * Generates a "mount image" for each of the supplied children. In the case - * of `ReactDOMComponent`, a mount image is a string of markup. - * - * @param {?object} nestedChildren Nested child maps. - * @return {array} An array of mounted representations. - * @internal - */ - mountChildren: function (nestedChildren, transaction, context) { - var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context); - this._renderedChildren = children; - - var mountImages = []; - var index = 0; - for (var name in children) { - if (children.hasOwnProperty(name)) { - var child = children[name]; - var selfDebugID = 0; - if (true) { - selfDebugID = getDebugID(this); - } - var mountImage = ReactReconciler.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID); - child._mountIndex = index++; - mountImages.push(mountImage); - } - } - - if (true) { - setChildrenForInstrumentation.call(this, children); - } - - return mountImages; - }, - - /** - * Replaces any rendered children with a text content string. - * - * @param {string} nextContent String of content. - * @internal - */ - updateTextContent: function (nextContent) { - var prevChildren = this._renderedChildren; - // Remove any rendered children. - ReactChildReconciler.unmountChildren(prevChildren, false); - for (var name in prevChildren) { - if (prevChildren.hasOwnProperty(name)) { - true ? true ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0; - } - } - // Set new text content. - var updates = [makeTextContent(nextContent)]; - processQueue(this, updates); - }, - - /** - * Replaces any rendered children with a markup string. - * - * @param {string} nextMarkup String of markup. - * @internal - */ - updateMarkup: function (nextMarkup) { - var prevChildren = this._renderedChildren; - // Remove any rendered children. - ReactChildReconciler.unmountChildren(prevChildren, false); - for (var name in prevChildren) { - if (prevChildren.hasOwnProperty(name)) { - true ? true ? invariant(false, 'updateTextContent called on non-empty component.') : _prodInvariant('118') : void 0; - } - } - var updates = [makeSetMarkup(nextMarkup)]; - processQueue(this, updates); - }, - - /** - * Updates the rendered children with new children. - * - * @param {?object} nextNestedChildrenElements Nested child element maps. - * @param {ReactReconcileTransaction} transaction - * @internal - */ - updateChildren: function (nextNestedChildrenElements, transaction, context) { - // Hook used by React ART - this._updateChildren(nextNestedChildrenElements, transaction, context); - }, - - /** - * @param {?object} nextNestedChildrenElements Nested child element maps. - * @param {ReactReconcileTransaction} transaction - * @final - * @protected - */ - _updateChildren: function (nextNestedChildrenElements, transaction, context) { - var prevChildren = this._renderedChildren; - var removedNodes = {}; - var mountImages = []; - var nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context); - if (!nextChildren && !prevChildren) { - return; - } - var updates = null; - var name; - // `nextIndex` will increment for each child in `nextChildren`, but - // `lastIndex` will be the last index visited in `prevChildren`. - var nextIndex = 0; - var lastIndex = 0; - // `nextMountIndex` will increment for each newly mounted child. - var nextMountIndex = 0; - var lastPlacedNode = null; - for (name in nextChildren) { - if (!nextChildren.hasOwnProperty(name)) { - continue; - } - var prevChild = prevChildren && prevChildren[name]; - var nextChild = nextChildren[name]; - if (prevChild === nextChild) { - updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)); - lastIndex = Math.max(prevChild._mountIndex, lastIndex); - prevChild._mountIndex = nextIndex; - } else { - if (prevChild) { - // Update `lastIndex` before `_mountIndex` gets unset by unmounting. - lastIndex = Math.max(prevChild._mountIndex, lastIndex); - // The `removedNodes` loop below will actually remove the child. - } - // The child must be instantiated before it's mounted. - updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)); - nextMountIndex++; - } - nextIndex++; - lastPlacedNode = ReactReconciler.getHostNode(nextChild); - } - // Remove children that are no longer present. - for (name in removedNodes) { - if (removedNodes.hasOwnProperty(name)) { - updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name])); - } - } - if (updates) { - processQueue(this, updates); - } - this._renderedChildren = nextChildren; - - if (true) { - setChildrenForInstrumentation.call(this, nextChildren); - } - }, - - /** - * Unmounts all rendered children. This should be used to clean up children - * when this component is unmounted. It does not actually perform any - * backend operations. - * - * @internal - */ - unmountChildren: function (safely) { - var renderedChildren = this._renderedChildren; - ReactChildReconciler.unmountChildren(renderedChildren, safely); - this._renderedChildren = null; - }, - - /** - * Moves a child component to the supplied index. - * - * @param {ReactComponent} child Component to move. - * @param {number} toIndex Destination index of the element. - * @param {number} lastIndex Last index visited of the siblings of `child`. - * @protected - */ - moveChild: function (child, afterNode, toIndex, lastIndex) { - // If the index of `child` is less than `lastIndex`, then it needs to - // be moved. Otherwise, we do not need to move it because a child will be - // inserted or moved before `child`. - if (child._mountIndex < lastIndex) { - return makeMove(child, afterNode, toIndex); - } - }, - - /** - * Creates a child component. - * - * @param {ReactComponent} child Component to create. - * @param {string} mountImage Markup to insert. - * @protected - */ - createChild: function (child, afterNode, mountImage) { - return makeInsertMarkup(mountImage, afterNode, child._mountIndex); - }, - - /** - * Removes a child component. - * - * @param {ReactComponent} child Child to remove. - * @protected - */ - removeChild: function (child, node) { - return makeRemove(child, node); - }, - - /** - * Mounts a child with the supplied name. - * - * NOTE: This is part of `updateChildren` and is here for readability. - * - * @param {ReactComponent} child Component to mount. - * @param {string} name Name of the child. - * @param {number} index Index at which to insert the child. - * @param {ReactReconcileTransaction} transaction - * @private - */ - _mountChildAtIndex: function (child, mountImage, afterNode, index, transaction, context) { - child._mountIndex = index; - return this.createChild(child, afterNode, mountImage); - }, - - /** - * Unmounts a rendered child. - * - * NOTE: This is part of `updateChildren` and is here for readability. - * - * @param {ReactComponent} child Component to unmount. - * @private - */ - _unmountChild: function (child, node) { - var update = this.removeChild(child, node); - child._mountIndex = null; - return update; - } - } -}; - -module.exports = ReactMultiChild; - -/***/ }), -/* 423 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactReconciler = __webpack_require__(51); - -var instantiateReactComponent = __webpack_require__(199); -var KeyEscapeUtils = __webpack_require__(123); -var shouldUpdateReactComponent = __webpack_require__(122); -var traverseAllChildren = __webpack_require__(203); -var warning = __webpack_require__(2); - -var ReactComponentTreeHook; - -if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","PUBLIC_URL":"","STORYBOOK_GIT_ORIGIN":"https://github.com/oblador/loki.git","STORYBOOK_GIT_BRANCH":"master"}) && "development" === 'test') { - // Temporary hack. - // Inline requires don't work well with Jest: - // https://github.com/facebook/react/issues/7240 - // Remove the inline requires when we don't need them anymore: - // https://github.com/facebook/react/pull/7178 - ReactComponentTreeHook = __webpack_require__(17); -} - -function instantiateChild(childInstances, child, name, selfDebugID) { - // We found a component instance. - var keyUnique = childInstances[name] === undefined; - if (true) { - if (!ReactComponentTreeHook) { - ReactComponentTreeHook = __webpack_require__(17); - } - if (!keyUnique) { - true ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0; - } - } - if (child != null && keyUnique) { - childInstances[name] = instantiateReactComponent(child, true); - } -} - -/** - * ReactChildReconciler provides helpers for initializing or updating a set of - * children. Its output is suitable for passing it onto ReactMultiChild which - * does diffed reordering and insertion. - */ -var ReactChildReconciler = { - /** - * Generates a "mount image" for each of the supplied children. In the case - * of `ReactDOMComponent`, a mount image is a string of markup. - * - * @param {?object} nestedChildNodes Nested child maps. - * @return {?object} A set of child instances. - * @internal - */ - instantiateChildren: function (nestedChildNodes, transaction, context, selfDebugID) // 0 in production and for roots - { - if (nestedChildNodes == null) { - return null; - } - var childInstances = {}; - - if (true) { - traverseAllChildren(nestedChildNodes, function (childInsts, child, name) { - return instantiateChild(childInsts, child, name, selfDebugID); - }, childInstances); - } else { - traverseAllChildren(nestedChildNodes, instantiateChild, childInstances); - } - return childInstances; - }, - - /** - * Updates the rendered children and returns a new set of children. - * - * @param {?object} prevChildren Previously initialized set of children. - * @param {?object} nextChildren Flat child element maps. - * @param {ReactReconcileTransaction} transaction - * @param {object} context - * @return {?object} A new set of child instances. - * @internal - */ - updateChildren: function (prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) // 0 in production and for roots - { - // We currently don't have a way to track moves here but if we use iterators - // instead of for..in we can zip the iterators and check if an item has - // moved. - // TODO: If nothing has changed, return the prevChildren object so that we - // can quickly bailout if nothing has changed. - if (!nextChildren && !prevChildren) { - return; - } - var name; - var prevChild; - for (name in nextChildren) { - if (!nextChildren.hasOwnProperty(name)) { - continue; - } - prevChild = prevChildren && prevChildren[name]; - var prevElement = prevChild && prevChild._currentElement; - var nextElement = nextChildren[name]; - if (prevChild != null && shouldUpdateReactComponent(prevElement, nextElement)) { - ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context); - nextChildren[name] = prevChild; - } else { - if (prevChild) { - removedNodes[name] = ReactReconciler.getHostNode(prevChild); - ReactReconciler.unmountComponent(prevChild, false); - } - // The child must be instantiated before it's mounted. - var nextChildInstance = instantiateReactComponent(nextElement, true); - nextChildren[name] = nextChildInstance; - // Creating mount image now ensures refs are resolved in right order - // (see https://github.com/facebook/react/pull/7101 for explanation). - var nextChildMountImage = ReactReconciler.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); - mountImages.push(nextChildMountImage); - } - } - // Unmount children that are no longer present. - for (name in prevChildren) { - if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) { - prevChild = prevChildren[name]; - removedNodes[name] = ReactReconciler.getHostNode(prevChild); - ReactReconciler.unmountComponent(prevChild, false); - } - } - }, - - /** - * Unmounts all rendered children. This should be used to clean up children - * when this component is unmounted. - * - * @param {?object} renderedChildren Previously initialized set of children. - * @internal - */ - unmountChildren: function (renderedChildren, safely) { - for (var name in renderedChildren) { - if (renderedChildren.hasOwnProperty(name)) { - var renderedChild = renderedChildren[name]; - ReactReconciler.unmountComponent(renderedChild, safely); - } - } - } -}; - -module.exports = ReactChildReconciler; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(44))) - -/***/ }), -/* 424 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4), - _assign = __webpack_require__(7); - -var React = __webpack_require__(42); -var ReactComponentEnvironment = __webpack_require__(120); -var ReactCurrentOwner = __webpack_require__(23); -var ReactErrorUtils = __webpack_require__(112); -var ReactInstanceMap = __webpack_require__(63); -var ReactInstrumentation = __webpack_require__(19); -var ReactNodeTypes = __webpack_require__(200); -var ReactReconciler = __webpack_require__(51); - -if (true) { - var checkReactTypeSpec = __webpack_require__(425); -} - -var emptyObject = __webpack_require__(72); -var invariant = __webpack_require__(1); -var shallowEqual = __webpack_require__(121); -var shouldUpdateReactComponent = __webpack_require__(122); -var warning = __webpack_require__(2); - -var CompositeTypes = { - ImpureClass: 0, - PureClass: 1, - StatelessFunctional: 2 -}; - -function StatelessComponent(Component) {} -StatelessComponent.prototype.render = function () { - var Component = ReactInstanceMap.get(this)._currentElement.type; - var element = Component(this.props, this.context, this.updater); - warnIfInvalidElement(Component, element); - return element; -}; - -function warnIfInvalidElement(Component, element) { - if (true) { - true ? warning(element === null || element === false || React.isValidElement(element), '%s(...): A valid React element (or null) must be returned. You may have ' + 'returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : void 0; - true ? warning(!Component.childContextTypes, '%s(...): childContextTypes cannot be defined on a functional component.', Component.displayName || Component.name || 'Component') : void 0; - } -} - -function shouldConstruct(Component) { - return !!(Component.prototype && Component.prototype.isReactComponent); -} - -function isPureComponent(Component) { - return !!(Component.prototype && Component.prototype.isPureReactComponent); -} - -// Separated into a function to contain deoptimizations caused by try/finally. -function measureLifeCyclePerf(fn, debugID, timerType) { - if (debugID === 0) { - // Top-level wrappers (see ReactMount) and empty components (see - // ReactDOMEmptyComponent) are invisible to hooks and devtools. - // Both are implementation details that should go away in the future. - return fn(); - } - - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType); - try { - return fn(); - } finally { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType); - } -} - -/** - * ------------------ The Life-Cycle of a Composite Component ------------------ - * - * - constructor: Initialization of state. The instance is now retained. - * - componentWillMount - * - render - * - [children's constructors] - * - [children's componentWillMount and render] - * - [children's componentDidMount] - * - componentDidMount - * - * Update Phases: - * - componentWillReceiveProps (only called if parent updated) - * - shouldComponentUpdate - * - componentWillUpdate - * - render - * - [children's constructors or receive props phases] - * - componentDidUpdate - * - * - componentWillUnmount - * - [children's componentWillUnmount] - * - [children destroyed] - * - (destroyed): The instance is now blank, released by React and ready for GC. - * - * ----------------------------------------------------------------------------- - */ - -/** - * An incrementing ID assigned to each component when it is mounted. This is - * used to enforce the order in which `ReactUpdates` updates dirty components. - * - * @private - */ -var nextMountID = 1; - -/** - * @lends {ReactCompositeComponent.prototype} - */ -var ReactCompositeComponent = { - /** - * Base constructor for all composite component. - * - * @param {ReactElement} element - * @final - * @internal - */ - construct: function (element) { - this._currentElement = element; - this._rootNodeID = 0; - this._compositeType = null; - this._instance = null; - this._hostParent = null; - this._hostContainerInfo = null; - - // See ReactUpdateQueue - this._updateBatchNumber = null; - this._pendingElement = null; - this._pendingStateQueue = null; - this._pendingReplaceState = false; - this._pendingForceUpdate = false; - - this._renderedNodeType = null; - this._renderedComponent = null; - this._context = null; - this._mountOrder = 0; - this._topLevelWrapper = null; - - // See ReactUpdates and ReactUpdateQueue. - this._pendingCallbacks = null; - - // ComponentWillUnmount shall only be called once - this._calledComponentWillUnmount = false; - - if (true) { - this._warnedAboutRefsInRender = false; - } - }, - - /** - * Initializes the component, renders markup, and registers event listeners. - * - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @param {?object} hostParent - * @param {?object} hostContainerInfo - * @param {?object} context - * @return {?string} Rendered markup to be inserted into the DOM. - * @final - * @internal - */ - mountComponent: function (transaction, hostParent, hostContainerInfo, context) { - var _this = this; - - this._context = context; - this._mountOrder = nextMountID++; - this._hostParent = hostParent; - this._hostContainerInfo = hostContainerInfo; - - var publicProps = this._currentElement.props; - var publicContext = this._processContext(context); - - var Component = this._currentElement.type; - - var updateQueue = transaction.getUpdateQueue(); - - // Initialize the public class - var doConstruct = shouldConstruct(Component); - var inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue); - var renderedElement; - - // Support functional components - if (!doConstruct && (inst == null || inst.render == null)) { - renderedElement = inst; - warnIfInvalidElement(Component, renderedElement); - !(inst === null || inst === false || React.isValidElement(inst)) ? true ? invariant(false, '%s(...): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', Component.displayName || Component.name || 'Component') : _prodInvariant('105', Component.displayName || Component.name || 'Component') : void 0; - inst = new StatelessComponent(Component); - this._compositeType = CompositeTypes.StatelessFunctional; - } else { - if (isPureComponent(Component)) { - this._compositeType = CompositeTypes.PureClass; - } else { - this._compositeType = CompositeTypes.ImpureClass; - } - } - - if (true) { - // This will throw later in _renderValidatedComponent, but add an early - // warning now to help debugging - if (inst.render == null) { - true ? warning(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', Component.displayName || Component.name || 'Component') : void 0; - } - - var propsMutated = inst.props !== publicProps; - var componentName = Component.displayName || Component.name || 'Component'; - - true ? warning(inst.props === undefined || !propsMutated, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", componentName, componentName) : void 0; - } - - // These should be set up in the constructor, but as a convenience for - // simpler class abstractions, we set them up after the fact. - inst.props = publicProps; - inst.context = publicContext; - inst.refs = emptyObject; - inst.updater = updateQueue; - - this._instance = inst; - - // Store a reference from the instance back to the internal representation - ReactInstanceMap.set(inst, this); - - if (true) { - // Since plain JS classes are defined without any special initialization - // logic, we can not catch common errors early. Therefore, we have to - // catch them here, at initialization time, instead. - true ? warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', this.getName() || 'a component') : void 0; - true ? warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', this.getName() || 'a component') : void 0; - true ? warning(!inst.propTypes, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', this.getName() || 'a component') : void 0; - true ? warning(!inst.contextTypes, 'contextTypes was defined as an instance property on %s. Use a ' + 'static property to define contextTypes instead.', this.getName() || 'a component') : void 0; - true ? warning(typeof inst.componentShouldUpdate !== 'function', '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', this.getName() || 'A component') : void 0; - true ? warning(typeof inst.componentDidUnmount !== 'function', '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', this.getName() || 'A component') : void 0; - true ? warning(typeof inst.componentWillRecieveProps !== 'function', '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', this.getName() || 'A component') : void 0; - } - - var initialState = inst.state; - if (initialState === undefined) { - inst.state = initialState = null; - } - !(typeof initialState === 'object' && !Array.isArray(initialState)) ? true ? invariant(false, '%s.state: must be set to an object or null', this.getName() || 'ReactCompositeComponent') : _prodInvariant('106', this.getName() || 'ReactCompositeComponent') : void 0; - - this._pendingStateQueue = null; - this._pendingReplaceState = false; - this._pendingForceUpdate = false; - - var markup; - if (inst.unstable_handleError) { - markup = this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context); - } else { - markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); - } - - if (inst.componentDidMount) { - if (true) { - transaction.getReactMountReady().enqueue(function () { - measureLifeCyclePerf(function () { - return inst.componentDidMount(); - }, _this._debugID, 'componentDidMount'); - }); - } else { - transaction.getReactMountReady().enqueue(inst.componentDidMount, inst); - } - } - - return markup; - }, - - _constructComponent: function (doConstruct, publicProps, publicContext, updateQueue) { - if ("development" !== 'production' && !doConstruct) { - ReactCurrentOwner.current = this; - try { - return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue); - } finally { - ReactCurrentOwner.current = null; - } - } else { - return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue); - } - }, - - _constructComponentWithoutOwner: function (doConstruct, publicProps, publicContext, updateQueue) { - var Component = this._currentElement.type; - - if (doConstruct) { - if (true) { - return measureLifeCyclePerf(function () { - return new Component(publicProps, publicContext, updateQueue); - }, this._debugID, 'ctor'); - } else { - return new Component(publicProps, publicContext, updateQueue); - } - } - - // This can still be an instance in case of factory components - // but we'll count this as time spent rendering as the more common case. - if (true) { - return measureLifeCyclePerf(function () { - return Component(publicProps, publicContext, updateQueue); - }, this._debugID, 'render'); - } else { - return Component(publicProps, publicContext, updateQueue); - } - }, - - performInitialMountWithErrorHandling: function (renderedElement, hostParent, hostContainerInfo, transaction, context) { - var markup; - var checkpoint = transaction.checkpoint(); - try { - markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); - } catch (e) { - // Roll back to checkpoint, handle error (which may add items to the transaction), and take a new checkpoint - transaction.rollback(checkpoint); - this._instance.unstable_handleError(e); - if (this._pendingStateQueue) { - this._instance.state = this._processPendingState(this._instance.props, this._instance.context); - } - checkpoint = transaction.checkpoint(); - - this._renderedComponent.unmountComponent(true); - transaction.rollback(checkpoint); - - // Try again - we've informed the component about the error, so they can render an error message this time. - // If this throws again, the error will bubble up (and can be caught by a higher error boundary). - markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); - } - return markup; - }, - - performInitialMount: function (renderedElement, hostParent, hostContainerInfo, transaction, context) { - var inst = this._instance; - - var debugID = 0; - if (true) { - debugID = this._debugID; - } - - if (inst.componentWillMount) { - if (true) { - measureLifeCyclePerf(function () { - return inst.componentWillMount(); - }, debugID, 'componentWillMount'); - } else { - inst.componentWillMount(); - } - // When mounting, calls to `setState` by `componentWillMount` will set - // `this._pendingStateQueue` without triggering a re-render. - if (this._pendingStateQueue) { - inst.state = this._processPendingState(inst.props, inst.context); - } - } - - // If not a stateless component, we now render - if (renderedElement === undefined) { - renderedElement = this._renderValidatedComponent(); - } - - var nodeType = ReactNodeTypes.getType(renderedElement); - this._renderedNodeType = nodeType; - var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */ - ); - this._renderedComponent = child; - - var markup = ReactReconciler.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID); - - if (true) { - if (debugID !== 0) { - var childDebugIDs = child._debugID !== 0 ? [child._debugID] : []; - ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); - } - } - - return markup; - }, - - getHostNode: function () { - return ReactReconciler.getHostNode(this._renderedComponent); - }, - - /** - * Releases any resources allocated by `mountComponent`. - * - * @final - * @internal - */ - unmountComponent: function (safely) { - if (!this._renderedComponent) { - return; - } - - var inst = this._instance; - - if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) { - inst._calledComponentWillUnmount = true; - - if (safely) { - var name = this.getName() + '.componentWillUnmount()'; - ReactErrorUtils.invokeGuardedCallback(name, inst.componentWillUnmount.bind(inst)); - } else { - if (true) { - measureLifeCyclePerf(function () { - return inst.componentWillUnmount(); - }, this._debugID, 'componentWillUnmount'); - } else { - inst.componentWillUnmount(); - } - } - } - - if (this._renderedComponent) { - ReactReconciler.unmountComponent(this._renderedComponent, safely); - this._renderedNodeType = null; - this._renderedComponent = null; - this._instance = null; - } - - // Reset pending fields - // Even if this component is scheduled for another update in ReactUpdates, - // it would still be ignored because these fields are reset. - this._pendingStateQueue = null; - this._pendingReplaceState = false; - this._pendingForceUpdate = false; - this._pendingCallbacks = null; - this._pendingElement = null; - - // These fields do not really need to be reset since this object is no - // longer accessible. - this._context = null; - this._rootNodeID = 0; - this._topLevelWrapper = null; - - // Delete the reference from the instance to this internal representation - // which allow the internals to be properly cleaned up even if the user - // leaks a reference to the public instance. - ReactInstanceMap.remove(inst); - - // Some existing components rely on inst.props even after they've been - // destroyed (in event handlers). - // TODO: inst.props = null; - // TODO: inst.state = null; - // TODO: inst.context = null; - }, - - /** - * Filters the context object to only contain keys specified in - * `contextTypes` - * - * @param {object} context - * @return {?object} - * @private - */ - _maskContext: function (context) { - var Component = this._currentElement.type; - var contextTypes = Component.contextTypes; - if (!contextTypes) { - return emptyObject; - } - var maskedContext = {}; - for (var contextName in contextTypes) { - maskedContext[contextName] = context[contextName]; - } - return maskedContext; - }, - - /** - * Filters the context object to only contain keys specified in - * `contextTypes`, and asserts that they are valid. - * - * @param {object} context - * @return {?object} - * @private - */ - _processContext: function (context) { - var maskedContext = this._maskContext(context); - if (true) { - var Component = this._currentElement.type; - if (Component.contextTypes) { - this._checkContextTypes(Component.contextTypes, maskedContext, 'context'); - } - } - return maskedContext; - }, - - /** - * @param {object} currentContext - * @return {object} - * @private - */ - _processChildContext: function (currentContext) { - var Component = this._currentElement.type; - var inst = this._instance; - var childContext; - - if (inst.getChildContext) { - if (true) { - ReactInstrumentation.debugTool.onBeginProcessingChildContext(); - try { - childContext = inst.getChildContext(); - } finally { - ReactInstrumentation.debugTool.onEndProcessingChildContext(); - } - } else { - childContext = inst.getChildContext(); - } - } - - if (childContext) { - !(typeof Component.childContextTypes === 'object') ? true ? invariant(false, '%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().', this.getName() || 'ReactCompositeComponent') : _prodInvariant('107', this.getName() || 'ReactCompositeComponent') : void 0; - if (true) { - this._checkContextTypes(Component.childContextTypes, childContext, 'child context'); - } - for (var name in childContext) { - !(name in Component.childContextTypes) ? true ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || 'ReactCompositeComponent', name) : _prodInvariant('108', this.getName() || 'ReactCompositeComponent', name) : void 0; - } - return _assign({}, currentContext, childContext); - } - return currentContext; - }, - - /** - * Assert that the context types are valid - * - * @param {object} typeSpecs Map of context field to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @private - */ - _checkContextTypes: function (typeSpecs, values, location) { - if (true) { - checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID); - } - }, - - receiveComponent: function (nextElement, transaction, nextContext) { - var prevElement = this._currentElement; - var prevContext = this._context; - - this._pendingElement = null; - - this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext); - }, - - /** - * If any of `_pendingElement`, `_pendingStateQueue`, or `_pendingForceUpdate` - * is set, update the component. - * - * @param {ReactReconcileTransaction} transaction - * @internal - */ - performUpdateIfNecessary: function (transaction) { - if (this._pendingElement != null) { - ReactReconciler.receiveComponent(this, this._pendingElement, transaction, this._context); - } else if (this._pendingStateQueue !== null || this._pendingForceUpdate) { - this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context); - } else { - this._updateBatchNumber = null; - } - }, - - /** - * Perform an update to a mounted component. The componentWillReceiveProps and - * shouldComponentUpdate methods are called, then (assuming the update isn't - * skipped) the remaining update lifecycle methods are called and the DOM - * representation is updated. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @param {ReactElement} prevParentElement - * @param {ReactElement} nextParentElement - * @internal - * @overridable - */ - updateComponent: function (transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) { - var inst = this._instance; - !(inst != null) ? true ? invariant(false, 'Attempted to update component `%s` that has already been unmounted (or failed to mount).', this.getName() || 'ReactCompositeComponent') : _prodInvariant('136', this.getName() || 'ReactCompositeComponent') : void 0; - - var willReceive = false; - var nextContext; - - // Determine if the context has changed or not - if (this._context === nextUnmaskedContext) { - nextContext = inst.context; - } else { - nextContext = this._processContext(nextUnmaskedContext); - willReceive = true; - } - - var prevProps = prevParentElement.props; - var nextProps = nextParentElement.props; - - // Not a simple state update but a props update - if (prevParentElement !== nextParentElement) { - willReceive = true; - } - - // An update here will schedule an update but immediately set - // _pendingStateQueue which will ensure that any state updates gets - // immediately reconciled instead of waiting for the next batch. - if (willReceive && inst.componentWillReceiveProps) { - if (true) { - measureLifeCyclePerf(function () { - return inst.componentWillReceiveProps(nextProps, nextContext); - }, this._debugID, 'componentWillReceiveProps'); - } else { - inst.componentWillReceiveProps(nextProps, nextContext); - } - } - - var nextState = this._processPendingState(nextProps, nextContext); - var shouldUpdate = true; - - if (!this._pendingForceUpdate) { - if (inst.shouldComponentUpdate) { - if (true) { - shouldUpdate = measureLifeCyclePerf(function () { - return inst.shouldComponentUpdate(nextProps, nextState, nextContext); - }, this._debugID, 'shouldComponentUpdate'); - } else { - shouldUpdate = inst.shouldComponentUpdate(nextProps, nextState, nextContext); - } - } else { - if (this._compositeType === CompositeTypes.PureClass) { - shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState); - } - } - } - - if (true) { - true ? warning(shouldUpdate !== undefined, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', this.getName() || 'ReactCompositeComponent') : void 0; - } - - this._updateBatchNumber = null; - if (shouldUpdate) { - this._pendingForceUpdate = false; - // Will set `this.props`, `this.state` and `this.context`. - this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext); - } else { - // If it's determined that a component should not update, we still want - // to set props and state but we shortcut the rest of the update. - this._currentElement = nextParentElement; - this._context = nextUnmaskedContext; - inst.props = nextProps; - inst.state = nextState; - inst.context = nextContext; - } - }, - - _processPendingState: function (props, context) { - var inst = this._instance; - var queue = this._pendingStateQueue; - var replace = this._pendingReplaceState; - this._pendingReplaceState = false; - this._pendingStateQueue = null; - - if (!queue) { - return inst.state; - } - - if (replace && queue.length === 1) { - return queue[0]; - } - - var nextState = _assign({}, replace ? queue[0] : inst.state); - for (var i = replace ? 1 : 0; i < queue.length; i++) { - var partial = queue[i]; - _assign(nextState, typeof partial === 'function' ? partial.call(inst, nextState, props, context) : partial); - } - - return nextState; - }, - - /** - * Merges new props and state, notifies delegate methods of update and - * performs update. - * - * @param {ReactElement} nextElement Next element - * @param {object} nextProps Next public object to set as properties. - * @param {?object} nextState Next object to set as state. - * @param {?object} nextContext Next public object to set as context. - * @param {ReactReconcileTransaction} transaction - * @param {?object} unmaskedContext - * @private - */ - _performComponentUpdate: function (nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) { - var _this2 = this; - - var inst = this._instance; - - var hasComponentDidUpdate = Boolean(inst.componentDidUpdate); - var prevProps; - var prevState; - var prevContext; - if (hasComponentDidUpdate) { - prevProps = inst.props; - prevState = inst.state; - prevContext = inst.context; - } - - if (inst.componentWillUpdate) { - if (true) { - measureLifeCyclePerf(function () { - return inst.componentWillUpdate(nextProps, nextState, nextContext); - }, this._debugID, 'componentWillUpdate'); - } else { - inst.componentWillUpdate(nextProps, nextState, nextContext); - } - } - - this._currentElement = nextElement; - this._context = unmaskedContext; - inst.props = nextProps; - inst.state = nextState; - inst.context = nextContext; - - this._updateRenderedComponent(transaction, unmaskedContext); - - if (hasComponentDidUpdate) { - if (true) { - transaction.getReactMountReady().enqueue(function () { - measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), _this2._debugID, 'componentDidUpdate'); - }); - } else { - transaction.getReactMountReady().enqueue(inst.componentDidUpdate.bind(inst, prevProps, prevState, prevContext), inst); - } - } - }, - - /** - * Call the component's `render` method and update the DOM accordingly. - * - * @param {ReactReconcileTransaction} transaction - * @internal - */ - _updateRenderedComponent: function (transaction, context) { - var prevComponentInstance = this._renderedComponent; - var prevRenderedElement = prevComponentInstance._currentElement; - var nextRenderedElement = this._renderValidatedComponent(); - - var debugID = 0; - if (true) { - debugID = this._debugID; - } - - if (shouldUpdateReactComponent(prevRenderedElement, nextRenderedElement)) { - ReactReconciler.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); - } else { - var oldHostNode = ReactReconciler.getHostNode(prevComponentInstance); - ReactReconciler.unmountComponent(prevComponentInstance, false); - - var nodeType = ReactNodeTypes.getType(nextRenderedElement); - this._renderedNodeType = nodeType; - var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes.EMPTY /* shouldHaveDebugID */ - ); - this._renderedComponent = child; - - var nextMarkup = ReactReconciler.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID); - - if (true) { - if (debugID !== 0) { - var childDebugIDs = child._debugID !== 0 ? [child._debugID] : []; - ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); - } - } - - this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance); - } - }, - - /** - * Overridden in shallow rendering. - * - * @protected - */ - _replaceNodeWithMarkup: function (oldHostNode, nextMarkup, prevInstance) { - ReactComponentEnvironment.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance); - }, - - /** - * @protected - */ - _renderValidatedComponentWithoutOwnerOrContext: function () { - var inst = this._instance; - var renderedElement; - - if (true) { - renderedElement = measureLifeCyclePerf(function () { - return inst.render(); - }, this._debugID, 'render'); - } else { - renderedElement = inst.render(); - } - - if (true) { - // We allow auto-mocks to proceed as if they're returning null. - if (renderedElement === undefined && inst.render._isMockFunction) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - renderedElement = null; - } - } - - return renderedElement; - }, - - /** - * @private - */ - _renderValidatedComponent: function () { - var renderedElement; - if (true) { - ReactCurrentOwner.current = this; - try { - renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); - } finally { - ReactCurrentOwner.current = null; - } - } else { - renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); - } - !( - // TODO: An `isValidNode` function would probably be more appropriate - renderedElement === null || renderedElement === false || React.isValidElement(renderedElement)) ? true ? invariant(false, '%s.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.', this.getName() || 'ReactCompositeComponent') : _prodInvariant('109', this.getName() || 'ReactCompositeComponent') : void 0; - - return renderedElement; - }, - - /** - * Lazily allocates the refs object and stores `component` as `ref`. - * - * @param {string} ref Reference name. - * @param {component} component Component to store as `ref`. - * @final - * @private - */ - attachRef: function (ref, component) { - var inst = this.getPublicInstance(); - !(inst != null) ? true ? invariant(false, 'Stateless function components cannot have refs.') : _prodInvariant('110') : void 0; - var publicComponentInstance = component.getPublicInstance(); - if (true) { - var componentName = component && component.getName ? component.getName() : 'a component'; - true ? warning(publicComponentInstance != null || component._compositeType !== CompositeTypes.StatelessFunctional, 'Stateless function components cannot be given refs ' + '(See ref "%s" in %s created by %s). ' + 'Attempts to access this ref will fail.', ref, componentName, this.getName()) : void 0; - } - var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs; - refs[ref] = publicComponentInstance; - }, - - /** - * Detaches a reference name. - * - * @param {string} ref Name to dereference. - * @final - * @private - */ - detachRef: function (ref) { - var refs = this.getPublicInstance().refs; - delete refs[ref]; - }, - - /** - * Get a text description of the component that can be used to identify it - * in error messages. - * @return {string} The name or null. - * @internal - */ - getName: function () { - var type = this._currentElement.type; - var constructor = this._instance && this._instance.constructor; - return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null; - }, - - /** - * Get the publicly accessible representation of this component - i.e. what - * is exposed by refs and returned by render. Can be null for stateless - * components. - * - * @return {ReactComponent} the public component instance. - * @internal - */ - getPublicInstance: function () { - var inst = this._instance; - if (this._compositeType === CompositeTypes.StatelessFunctional) { - return null; - } - return inst; - }, - - // Stub - _instantiateReactComponent: null -}; - -module.exports = ReactCompositeComponent; - -/***/ }), -/* 425 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var ReactPropTypeLocationNames = __webpack_require__(426); -var ReactPropTypesSecret = __webpack_require__(197); - -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -var ReactComponentTreeHook; - -if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","PUBLIC_URL":"","STORYBOOK_GIT_ORIGIN":"https://github.com/oblador/loki.git","STORYBOOK_GIT_BRANCH":"master"}) && "development" === 'test') { - // Temporary hack. - // Inline requires don't work well with Jest: - // https://github.com/facebook/react/issues/7240 - // Remove the inline requires when we don't need them anymore: - // https://github.com/facebook/react/pull/7178 - ReactComponentTreeHook = __webpack_require__(17); -} - -var loggedTypeFailures = {}; - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?object} element The React element that is being type-checked - * @param {?number} debugID The React component instance that is being type-checked - * @private - */ -function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - !(typeof typeSpecs[typeSpecName] === 'function') ? true ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - true ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var componentStackInfo = ''; - - if (true) { - if (!ReactComponentTreeHook) { - ReactComponentTreeHook = __webpack_require__(17); - } - if (debugID !== null) { - componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); - } else if (element !== null) { - componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); - } - } - - true ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; - } - } - } -} - -module.exports = checkReactTypeSpec; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(44))) - -/***/ }), -/* 426 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var ReactPropTypeLocationNames = {}; - -if (true) { - ReactPropTypeLocationNames = { - prop: 'prop', - context: 'context', - childContext: 'child context' - }; -} - -module.exports = ReactPropTypeLocationNames; - -/***/ }), -/* 427 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var nextDebugID = 1; - -function getNextDebugID() { - return nextDebugID++; -} - -module.exports = getNextDebugID; - -/***/ }), -/* 428 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -// The Symbol used to tag the ReactElement type. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. - -var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; - -module.exports = REACT_ELEMENT_TYPE; - -/***/ }), -/* 429 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -/* global Symbol */ - -var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - -/** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ -function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } -} - -module.exports = getIteratorFn; - -/***/ }), -/* 430 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) {/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var KeyEscapeUtils = __webpack_require__(123); -var traverseAllChildren = __webpack_require__(203); -var warning = __webpack_require__(2); - -var ReactComponentTreeHook; - -if (typeof process !== 'undefined' && Object({"NODE_ENV":"development","PUBLIC_URL":"","STORYBOOK_GIT_ORIGIN":"https://github.com/oblador/loki.git","STORYBOOK_GIT_BRANCH":"master"}) && "development" === 'test') { - // Temporary hack. - // Inline requires don't work well with Jest: - // https://github.com/facebook/react/issues/7240 - // Remove the inline requires when we don't need them anymore: - // https://github.com/facebook/react/pull/7178 - ReactComponentTreeHook = __webpack_require__(17); -} - -/** - * @param {function} traverseContext Context passed through traversal. - * @param {?ReactComponent} child React child component. - * @param {!string} name String name of key path to child. - * @param {number=} selfDebugID Optional debugID of the current internal instance. - */ -function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) { - // We found a component instance. - if (traverseContext && typeof traverseContext === 'object') { - var result = traverseContext; - var keyUnique = result[name] === undefined; - if (true) { - if (!ReactComponentTreeHook) { - ReactComponentTreeHook = __webpack_require__(17); - } - if (!keyUnique) { - true ? warning(false, 'flattenChildren(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.%s', KeyEscapeUtils.unescape(name), ReactComponentTreeHook.getStackAddendumByID(selfDebugID)) : void 0; - } - } - if (keyUnique && child != null) { - result[name] = child; - } - } -} - -/** - * Flattens children that are typically specified as `props.children`. Any null - * children will not be included in the resulting object. - * @return {!object} flattened children keyed by name. - */ -function flattenChildren(children, selfDebugID) { - if (children == null) { - return children; - } - var result = {}; - - if (true) { - traverseAllChildren(children, function (traverseContext, child, name) { - return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID); - }, result); - } else { - traverseAllChildren(children, flattenSingleChildIntoContext, result); - } - return result; -} - -module.exports = flattenChildren; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(44))) - -/***/ }), -/* 431 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var PooledClass = __webpack_require__(38); -var Transaction = __webpack_require__(80); -var ReactInstrumentation = __webpack_require__(19); -var ReactServerUpdateQueue = __webpack_require__(432); - -/** - * Executed within the scope of the `Transaction` instance. Consider these as - * being member methods, but with an implied ordering while being isolated from - * each other. - */ -var TRANSACTION_WRAPPERS = []; - -if (true) { - TRANSACTION_WRAPPERS.push({ - initialize: ReactInstrumentation.debugTool.onBeginFlush, - close: ReactInstrumentation.debugTool.onEndFlush - }); -} - -var noopCallbackQueue = { - enqueue: function () {} -}; - -/** - * @class ReactServerRenderingTransaction - * @param {boolean} renderToStaticMarkup - */ -function ReactServerRenderingTransaction(renderToStaticMarkup) { - this.reinitializeTransaction(); - this.renderToStaticMarkup = renderToStaticMarkup; - this.useCreateElement = false; - this.updateQueue = new ReactServerUpdateQueue(this); -} - -var Mixin = { - /** - * @see Transaction - * @abstract - * @final - * @return {array} Empty list of operation wrap procedures. - */ - getTransactionWrappers: function () { - return TRANSACTION_WRAPPERS; - }, - - /** - * @return {object} The queue to collect `onDOMReady` callbacks with. - */ - getReactMountReady: function () { - return noopCallbackQueue; - }, - - /** - * @return {object} The queue to collect React async events. - */ - getUpdateQueue: function () { - return this.updateQueue; - }, - - /** - * `PooledClass` looks for this, and will invoke this before allowing this - * instance to be reused. - */ - destructor: function () {}, - - checkpoint: function () {}, - - rollback: function () {} -}; - -_assign(ReactServerRenderingTransaction.prototype, Transaction, Mixin); - -PooledClass.addPoolingTo(ReactServerRenderingTransaction); - -module.exports = ReactServerRenderingTransaction; - -/***/ }), -/* 432 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var ReactUpdateQueue = __webpack_require__(124); - -var warning = __webpack_require__(2); - -function warnNoop(publicInstance, callerName) { - if (true) { - var constructor = publicInstance.constructor; - true ? warning(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; - } -} - -/** - * This is the update queue used for server rendering. - * It delegates to ReactUpdateQueue while server rendering is in progress and - * switches to ReactNoopUpdateQueue after the transaction has completed. - * @class ReactServerUpdateQueue - * @param {Transaction} transaction - */ - -var ReactServerUpdateQueue = function () { - function ReactServerUpdateQueue(transaction) { - _classCallCheck(this, ReactServerUpdateQueue); - - this.transaction = transaction; - } - - /** - * 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 - */ - - - ReactServerUpdateQueue.prototype.isMounted = function isMounted(publicInstance) { - return false; - }; - - /** - * Enqueue a callback that will be executed after all the pending updates - * have processed. - * - * @param {ReactClass} publicInstance The instance to use as `this` context. - * @param {?function} callback Called after state is updated. - * @internal - */ - - - ReactServerUpdateQueue.prototype.enqueueCallback = function enqueueCallback(publicInstance, callback, callerName) { - if (this.transaction.isInTransaction()) { - ReactUpdateQueue.enqueueCallback(publicInstance, callback, callerName); - } - }; - - /** - * 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. - * @internal - */ - - - ReactServerUpdateQueue.prototype.enqueueForceUpdate = function enqueueForceUpdate(publicInstance) { - if (this.transaction.isInTransaction()) { - ReactUpdateQueue.enqueueForceUpdate(publicInstance); - } else { - 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|function} completeState Next state. - * @internal - */ - - - ReactServerUpdateQueue.prototype.enqueueReplaceState = function enqueueReplaceState(publicInstance, completeState) { - if (this.transaction.isInTransaction()) { - ReactUpdateQueue.enqueueReplaceState(publicInstance, completeState); - } else { - 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|function} partialState Next partial state to be merged with state. - * @internal - */ - - - ReactServerUpdateQueue.prototype.enqueueSetState = function enqueueSetState(publicInstance, partialState) { - if (this.transaction.isInTransaction()) { - ReactUpdateQueue.enqueueSetState(publicInstance, partialState); - } else { - warnNoop(publicInstance, 'setState'); - } - }; - - return ReactServerUpdateQueue; -}(); - -module.exports = ReactServerUpdateQueue; - -/***/ }), -/* 433 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2014-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var DOMLazyTree = __webpack_require__(52); -var ReactDOMComponentTree = __webpack_require__(9); - -var ReactDOMEmptyComponent = function (instantiate) { - // ReactCompositeComponent uses this: - this._currentElement = null; - // ReactDOMComponentTree uses these: - this._hostNode = null; - this._hostParent = null; - this._hostContainerInfo = null; - this._domID = 0; -}; -_assign(ReactDOMEmptyComponent.prototype, { - mountComponent: function (transaction, hostParent, hostContainerInfo, context) { - var domID = hostContainerInfo._idCounter++; - this._domID = domID; - this._hostParent = hostParent; - this._hostContainerInfo = hostContainerInfo; - - var nodeValue = ' react-empty: ' + this._domID + ' '; - if (transaction.useCreateElement) { - var ownerDocument = hostContainerInfo._ownerDocument; - var node = ownerDocument.createComment(nodeValue); - ReactDOMComponentTree.precacheNode(this, node); - return DOMLazyTree(node); - } else { - if (transaction.renderToStaticMarkup) { - // Normally we'd insert a comment node, but since this is a situation - // where React won't take over (static pages), we can simply return - // nothing. - return ''; - } - return '<!--' + nodeValue + '-->'; - } - }, - receiveComponent: function () {}, - getHostNode: function () { - return ReactDOMComponentTree.getNodeFromInstance(this); - }, - unmountComponent: function () { - ReactDOMComponentTree.uncacheNode(this); - } -}); - -module.exports = ReactDOMEmptyComponent; - -/***/ }), -/* 434 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var invariant = __webpack_require__(1); - -/** - * Return the lowest common ancestor of A and B, or null if they are in - * different trees. - */ -function getLowestCommonAncestor(instA, instB) { - !('_hostNode' in instA) ? true ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0; - !('_hostNode' in instB) ? true ? invariant(false, 'getNodeFromInstance: Invalid argument.') : _prodInvariant('33') : void 0; - - var depthA = 0; - for (var tempA = instA; tempA; tempA = tempA._hostParent) { - depthA++; - } - var depthB = 0; - for (var tempB = instB; tempB; tempB = tempB._hostParent) { - depthB++; - } - - // If A is deeper, crawl up. - while (depthA - depthB > 0) { - instA = instA._hostParent; - depthA--; - } - - // If B is deeper, crawl up. - while (depthB - depthA > 0) { - instB = instB._hostParent; - depthB--; - } - - // Walk in lockstep until we find a match. - var depth = depthA; - while (depth--) { - if (instA === instB) { - return instA; - } - instA = instA._hostParent; - instB = instB._hostParent; - } - return null; -} - -/** - * Return if A is an ancestor of B. - */ -function isAncestor(instA, instB) { - !('_hostNode' in instA) ? true ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0; - !('_hostNode' in instB) ? true ? invariant(false, 'isAncestor: Invalid argument.') : _prodInvariant('35') : void 0; - - while (instB) { - if (instB === instA) { - return true; - } - instB = instB._hostParent; - } - return false; -} - -/** - * Return the parent instance of the passed-in instance. - */ -function getParentInstance(inst) { - !('_hostNode' in inst) ? true ? invariant(false, 'getParentInstance: Invalid argument.') : _prodInvariant('36') : void 0; - - return inst._hostParent; -} - -/** - * Simulates the traversal of a two-phase, capture/bubble event dispatch. - */ -function traverseTwoPhase(inst, fn, arg) { - var path = []; - while (inst) { - path.push(inst); - inst = inst._hostParent; - } - var i; - 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 (from && from !== common) { - pathFrom.push(from); - from = from._hostParent; - } - var pathTo = []; - while (to && to !== common) { - pathTo.push(to); - to = to._hostParent; - } - var i; - for (i = 0; i < pathFrom.length; i++) { - fn(pathFrom[i], 'bubbled', argFrom); - } - for (i = pathTo.length; i-- > 0;) { - fn(pathTo[i], 'captured', argTo); - } -} - -module.exports = { - isAncestor: isAncestor, - getLowestCommonAncestor: getLowestCommonAncestor, - getParentInstance: getParentInstance, - traverseTwoPhase: traverseTwoPhase, - traverseEnterLeave: traverseEnterLeave -}; - -/***/ }), -/* 435 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4), - _assign = __webpack_require__(7); - -var DOMChildrenOperations = __webpack_require__(116); -var DOMLazyTree = __webpack_require__(52); -var ReactDOMComponentTree = __webpack_require__(9); - -var escapeTextContentForBrowser = __webpack_require__(83); -var invariant = __webpack_require__(1); -var validateDOMNesting = __webpack_require__(125); - -/** - * Text nodes violate a couple assumptions that React makes about components: - * - * - When mounting text into the DOM, adjacent text nodes are merged. - * - Text nodes cannot be assigned a React root ID. - * - * This component is used to wrap strings between comment nodes so that they - * can undergo the same reconciliation that is applied to elements. - * - * TODO: Investigate representing React components in the DOM with text nodes. - * - * @class ReactDOMTextComponent - * @extends ReactComponent - * @internal - */ -var ReactDOMTextComponent = function (text) { - // TODO: This is really a ReactText (ReactNode), not a ReactElement - this._currentElement = text; - this._stringText = '' + text; - // ReactDOMComponentTree uses these: - this._hostNode = null; - this._hostParent = null; - - // Properties - this._domID = 0; - this._mountIndex = 0; - this._closingComment = null; - this._commentNodes = null; -}; - -_assign(ReactDOMTextComponent.prototype, { - /** - * Creates the markup for this text node. This node is not intended to have - * any features besides containing text content. - * - * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction - * @return {string} Markup for this text node. - * @internal - */ - mountComponent: function (transaction, hostParent, hostContainerInfo, context) { - if (true) { - var parentInfo; - if (hostParent != null) { - parentInfo = hostParent._ancestorInfo; - } else if (hostContainerInfo != null) { - parentInfo = hostContainerInfo._ancestorInfo; - } - if (parentInfo) { - // parentInfo should always be present except for the top-level - // component when server rendering - validateDOMNesting(null, this._stringText, this, parentInfo); - } - } - - var domID = hostContainerInfo._idCounter++; - var openingValue = ' react-text: ' + domID + ' '; - var closingValue = ' /react-text '; - this._domID = domID; - this._hostParent = hostParent; - if (transaction.useCreateElement) { - var ownerDocument = hostContainerInfo._ownerDocument; - var openingComment = ownerDocument.createComment(openingValue); - var closingComment = ownerDocument.createComment(closingValue); - var lazyTree = DOMLazyTree(ownerDocument.createDocumentFragment()); - DOMLazyTree.queueChild(lazyTree, DOMLazyTree(openingComment)); - if (this._stringText) { - DOMLazyTree.queueChild(lazyTree, DOMLazyTree(ownerDocument.createTextNode(this._stringText))); - } - DOMLazyTree.queueChild(lazyTree, DOMLazyTree(closingComment)); - ReactDOMComponentTree.precacheNode(this, openingComment); - this._closingComment = closingComment; - return lazyTree; - } else { - var escapedText = escapeTextContentForBrowser(this._stringText); - - if (transaction.renderToStaticMarkup) { - // Normally we'd wrap this between comment nodes for the reasons stated - // above, but since this is a situation where React won't take over - // (static pages), we can simply return the text as it is. - return escapedText; - } - - return '<!--' + openingValue + '-->' + escapedText + '<!--' + closingValue + '-->'; - } - }, - - /** - * Updates this component by updating the text content. - * - * @param {ReactText} nextText The next text content - * @param {ReactReconcileTransaction} transaction - * @internal - */ - receiveComponent: function (nextText, transaction) { - if (nextText !== this._currentElement) { - this._currentElement = nextText; - var nextStringText = '' + nextText; - if (nextStringText !== this._stringText) { - // TODO: Save this as pending props and use performUpdateIfNecessary - // and/or updateComponent to do the actual update for consistency with - // other component types? - this._stringText = nextStringText; - var commentNodes = this.getHostNode(); - DOMChildrenOperations.replaceDelimitedText(commentNodes[0], commentNodes[1], nextStringText); - } - } - }, - - getHostNode: function () { - var hostNode = this._commentNodes; - if (hostNode) { - return hostNode; - } - if (!this._closingComment) { - var openingComment = ReactDOMComponentTree.getNodeFromInstance(this); - var node = openingComment.nextSibling; - while (true) { - !(node != null) ? true ? invariant(false, 'Missing closing comment for text component %s', this._domID) : _prodInvariant('67', this._domID) : void 0; - if (node.nodeType === 8 && node.nodeValue === ' /react-text ') { - this._closingComment = node; - break; - } - node = node.nextSibling; - } - } - hostNode = [this._hostNode, this._closingComment]; - this._commentNodes = hostNode; - return hostNode; - }, - - unmountComponent: function () { - this._closingComment = null; - this._commentNodes = null; - ReactDOMComponentTree.uncacheNode(this); - } -}); - -module.exports = ReactDOMTextComponent; - -/***/ }), -/* 436 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var ReactUpdates = __webpack_require__(26); -var Transaction = __webpack_require__(80); - -var emptyFunction = __webpack_require__(20); - -var RESET_BATCHED_UPDATES = { - initialize: emptyFunction, - close: function () { - ReactDefaultBatchingStrategy.isBatchingUpdates = false; - } -}; - -var FLUSH_BATCHED_UPDATES = { - initialize: emptyFunction, - close: ReactUpdates.flushBatchedUpdates.bind(ReactUpdates) -}; - -var TRANSACTION_WRAPPERS = [FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES]; - -function ReactDefaultBatchingStrategyTransaction() { - this.reinitializeTransaction(); -} - -_assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, { - getTransactionWrappers: function () { - return TRANSACTION_WRAPPERS; - } -}); - -var transaction = new ReactDefaultBatchingStrategyTransaction(); - -var ReactDefaultBatchingStrategy = { - isBatchingUpdates: false, - - /** - * Call the provided function in a context within which calls to `setState` - * and friends are batched such that components aren't updated unnecessarily. - */ - batchedUpdates: function (callback, a, b, c, d, e) { - var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates; - - ReactDefaultBatchingStrategy.isBatchingUpdates = true; - - // The code is written this way to avoid extra allocations - if (alreadyBatchingUpdates) { - return callback(a, b, c, d, e); - } else { - return transaction.perform(callback, null, a, b, c, d, e); - } - } -}; - -module.exports = ReactDefaultBatchingStrategy; - -/***/ }), -/* 437 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var EventListener = __webpack_require__(204); -var ExecutionEnvironment = __webpack_require__(13); -var PooledClass = __webpack_require__(38); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactUpdates = __webpack_require__(26); - -var getEventTarget = __webpack_require__(113); -var getUnboundedScrollPosition = __webpack_require__(438); - -/** - * 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 findParent(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._hostParent) { - inst = inst._hostParent; - } - var rootNode = ReactDOMComponentTree.getNodeFromInstance(inst); - var container = rootNode.parentNode; - return ReactDOMComponentTree.getClosestInstanceFromNode(container); -} - -// Used to store ancestor hierarchy in top level callback -function TopLevelCallbackBookKeeping(topLevelType, nativeEvent) { - this.topLevelType = topLevelType; - this.nativeEvent = nativeEvent; - this.ancestors = []; -} -_assign(TopLevelCallbackBookKeeping.prototype, { - destructor: function () { - this.topLevelType = null; - this.nativeEvent = null; - this.ancestors.length = 0; - } -}); -PooledClass.addPoolingTo(TopLevelCallbackBookKeeping, PooledClass.twoArgumentPooler); - -function handleTopLevelImpl(bookKeeping) { - var nativeEventTarget = getEventTarget(bookKeeping.nativeEvent); - var targetInst = ReactDOMComponentTree.getClosestInstanceFromNode(nativeEventTarget); - - // 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 { - bookKeeping.ancestors.push(ancestor); - ancestor = ancestor && findParent(ancestor); - } while (ancestor); - - for (var i = 0; i < bookKeeping.ancestors.length; i++) { - targetInst = bookKeeping.ancestors[i]; - ReactEventListener._handleTopLevel(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent)); - } -} - -function scrollValueMonitor(cb) { - var scrollPosition = getUnboundedScrollPosition(window); - cb(scrollPosition); -} - -var ReactEventListener = { - _enabled: true, - _handleTopLevel: null, - - WINDOW_HANDLE: ExecutionEnvironment.canUseDOM ? window : null, - - setHandleTopLevel: function (handleTopLevel) { - ReactEventListener._handleTopLevel = handleTopLevel; - }, - - setEnabled: function (enabled) { - ReactEventListener._enabled = !!enabled; - }, - - isEnabled: function () { - return ReactEventListener._enabled; - }, - - /** - * Traps top-level events by using event bubbling. - * - * @param {string} topLevelType Record from `EventConstants`. - * @param {string} handlerBaseName Event name (e.g. "click"). - * @param {object} element Element on which to attach listener. - * @return {?object} An object with a remove function which will forcefully - * remove the listener. - * @internal - */ - trapBubbledEvent: function (topLevelType, handlerBaseName, element) { - if (!element) { - return null; - } - return EventListener.listen(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType)); - }, - - /** - * Traps a top-level event by using event capturing. - * - * @param {string} topLevelType Record from `EventConstants`. - * @param {string} handlerBaseName Event name (e.g. "click"). - * @param {object} element Element on which to attach listener. - * @return {?object} An object with a remove function which will forcefully - * remove the listener. - * @internal - */ - trapCapturedEvent: function (topLevelType, handlerBaseName, element) { - if (!element) { - return null; - } - return EventListener.capture(element, handlerBaseName, ReactEventListener.dispatchEvent.bind(null, topLevelType)); - }, - - monitorScrollValue: function (refresh) { - var callback = scrollValueMonitor.bind(null, refresh); - EventListener.listen(window, 'scroll', callback); - }, - - dispatchEvent: function (topLevelType, nativeEvent) { - if (!ReactEventListener._enabled) { - return; - } - - var bookKeeping = TopLevelCallbackBookKeeping.getPooled(topLevelType, nativeEvent); - try { - // Event queue being processed in the same cycle allows - // `preventDefault`. - ReactUpdates.batchedUpdates(handleTopLevelImpl, bookKeeping); - } finally { - TopLevelCallbackBookKeeping.release(bookKeeping); - } - } -}; - -module.exports = ReactEventListener; - -/***/ }), -/* 438 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - - - -/** - * Gets the scroll position of the supplied element or window. - * - * The return values are unbounded, unlike `getScrollPosition`. This means they - * may be negative or exceed the element boundaries (which is possible using - * inertial scrolling). - * - * @param {DOMWindow|DOMElement} scrollable - * @return {object} Map with `x` and `y` keys. - */ - -function getUnboundedScrollPosition(scrollable) { - if (scrollable.Window && scrollable instanceof scrollable.Window) { - return { - x: scrollable.pageXOffset || scrollable.document.documentElement.scrollLeft, - y: scrollable.pageYOffset || scrollable.document.documentElement.scrollTop - }; - } - return { - x: scrollable.scrollLeft, - y: scrollable.scrollTop - }; -} - -module.exports = getUnboundedScrollPosition; - -/***/ }), -/* 439 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMProperty = __webpack_require__(33); -var EventPluginHub = __webpack_require__(61); -var EventPluginUtils = __webpack_require__(111); -var ReactComponentEnvironment = __webpack_require__(120); -var ReactEmptyComponent = __webpack_require__(201); -var ReactBrowserEventEmitter = __webpack_require__(84); -var ReactHostComponent = __webpack_require__(202); -var ReactUpdates = __webpack_require__(26); - -var ReactInjection = { - Component: ReactComponentEnvironment.injection, - DOMProperty: DOMProperty.injection, - EmptyComponent: ReactEmptyComponent.injection, - EventPluginHub: EventPluginHub.injection, - EventPluginUtils: EventPluginUtils.injection, - EventEmitter: ReactBrowserEventEmitter.injection, - HostComponent: ReactHostComponent.injection, - Updates: ReactUpdates.injection -}; - -module.exports = ReactInjection; - -/***/ }), -/* 440 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _assign = __webpack_require__(7); - -var CallbackQueue = __webpack_require__(185); -var PooledClass = __webpack_require__(38); -var ReactBrowserEventEmitter = __webpack_require__(84); -var ReactInputSelection = __webpack_require__(205); -var ReactInstrumentation = __webpack_require__(19); -var Transaction = __webpack_require__(80); -var ReactUpdateQueue = __webpack_require__(124); - -/** - * Ensures that, when possible, the selection range (currently selected text - * input) is not disturbed by performing the transaction. - */ -var SELECTION_RESTORATION = { - /** - * @return {Selection} Selection information. - */ - initialize: ReactInputSelection.getSelectionInformation, - /** - * @param {Selection} sel Selection information returned from `initialize`. - */ - close: ReactInputSelection.restoreSelection -}; - -/** - * Suppresses events (blur/focus) that could be inadvertently dispatched due to - * high level DOM manipulations (like temporarily removing a text input from the - * DOM). - */ -var EVENT_SUPPRESSION = { - /** - * @return {boolean} The enabled status of `ReactBrowserEventEmitter` before - * the reconciliation. - */ - initialize: function () { - var currentlyEnabled = ReactBrowserEventEmitter.isEnabled(); - ReactBrowserEventEmitter.setEnabled(false); - return currentlyEnabled; - }, - - /** - * @param {boolean} previouslyEnabled Enabled status of - * `ReactBrowserEventEmitter` before the reconciliation occurred. `close` - * restores the previous value. - */ - close: function (previouslyEnabled) { - ReactBrowserEventEmitter.setEnabled(previouslyEnabled); - } -}; - -/** - * Provides a queue for collecting `componentDidMount` and - * `componentDidUpdate` callbacks during the transaction. - */ -var ON_DOM_READY_QUEUEING = { - /** - * Initializes the internal `onDOMReady` queue. - */ - initialize: function () { - this.reactMountReady.reset(); - }, - - /** - * After DOM is flushed, invoke all registered `onDOMReady` callbacks. - */ - close: function () { - this.reactMountReady.notifyAll(); - } -}; - -/** - * Executed within the scope of the `Transaction` instance. Consider these as - * being member methods, but with an implied ordering while being isolated from - * each other. - */ -var TRANSACTION_WRAPPERS = [SELECTION_RESTORATION, EVENT_SUPPRESSION, ON_DOM_READY_QUEUEING]; - -if (true) { - TRANSACTION_WRAPPERS.push({ - initialize: ReactInstrumentation.debugTool.onBeginFlush, - close: ReactInstrumentation.debugTool.onEndFlush - }); -} - -/** - * Currently: - * - The order that these are listed in the transaction is critical: - * - Suppresses events. - * - Restores selection range. - * - * Future: - * - Restore document/overflow scroll positions that were unintentionally - * modified via DOM insertions above the top viewport boundary. - * - Implement/integrate with customized constraint based layout system and keep - * track of which dimensions must be remeasured. - * - * @class ReactReconcileTransaction - */ -function ReactReconcileTransaction(useCreateElement) { - this.reinitializeTransaction(); - // Only server-side rendering really needs this option (see - // `ReactServerRendering`), but server-side uses - // `ReactServerRenderingTransaction` instead. This option is here so that it's - // accessible and defaults to false when `ReactDOMComponent` and - // `ReactDOMTextComponent` checks it in `mountComponent`.` - this.renderToStaticMarkup = false; - this.reactMountReady = CallbackQueue.getPooled(null); - this.useCreateElement = useCreateElement; -} - -var Mixin = { - /** - * @see Transaction - * @abstract - * @final - * @return {array<object>} List of operation wrap procedures. - * TODO: convert to array<TransactionWrapper> - */ - getTransactionWrappers: function () { - return TRANSACTION_WRAPPERS; - }, - - /** - * @return {object} The queue to collect `onDOMReady` callbacks with. - */ - getReactMountReady: function () { - return this.reactMountReady; - }, - - /** - * @return {object} The queue to collect React async events. - */ - getUpdateQueue: function () { - return ReactUpdateQueue; - }, - - /** - * Save current transaction state -- if the return value from this method is - * passed to `rollback`, the transaction will be reset to that state. - */ - checkpoint: function () { - // reactMountReady is the our only stateful wrapper - return this.reactMountReady.checkpoint(); - }, - - rollback: function (checkpoint) { - this.reactMountReady.rollback(checkpoint); - }, - - /** - * `PooledClass` looks for this, and will invoke this before allowing this - * instance to be reused. - */ - destructor: function () { - CallbackQueue.release(this.reactMountReady); - this.reactMountReady = null; - } -}; - -_assign(ReactReconcileTransaction.prototype, Transaction, Mixin); - -PooledClass.addPoolingTo(ReactReconcileTransaction); - -module.exports = ReactReconcileTransaction; - -/***/ }), -/* 441 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ExecutionEnvironment = __webpack_require__(13); - -var getNodeForCharacterOffset = __webpack_require__(442); -var getTextContentAccessor = __webpack_require__(184); - -/** - * While `isCollapsed` is available on the Selection object and `collapsed` - * is available on the Range object, IE11 sometimes gets them wrong. - * If the anchor/focus nodes and offsets are the same, the range is collapsed. - */ -function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) { - return anchorNode === focusNode && anchorOffset === focusOffset; -} - -/** - * Get the appropriate anchor and focus node/offset pairs for IE. - * - * The catch here is that IE's selection API doesn't provide information - * about whether the selection is forward or backward, so we have to - * behave as though it's always forward. - * - * IE text differs from modern selection in that it behaves as though - * block elements end with a new line. This means character offsets will - * differ between the two APIs. - * - * @param {DOMElement} node - * @return {object} - */ -function getIEOffsets(node) { - var selection = document.selection; - var selectedRange = selection.createRange(); - var selectedLength = selectedRange.text.length; - - // Duplicate selection so we can move range without breaking user selection. - var fromStart = selectedRange.duplicate(); - fromStart.moveToElementText(node); - fromStart.setEndPoint('EndToStart', selectedRange); - - var startOffset = fromStart.text.length; - var endOffset = startOffset + selectedLength; - - return { - start: startOffset, - end: endOffset - }; -} - -/** - * @param {DOMElement} node - * @return {?object} - */ -function getModernOffsets(node) { - var selection = window.getSelection && window.getSelection(); - - if (!selection || selection.rangeCount === 0) { - return null; - } - - var anchorNode = selection.anchorNode; - var anchorOffset = selection.anchorOffset; - var focusNode = selection.focusNode; - var focusOffset = selection.focusOffset; - - var currentRange = selection.getRangeAt(0); - - // In Firefox, range.startContainer and range.endContainer can be "anonymous - // divs", e.g. the up/down buttons on an <input type="number">. 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 */ - currentRange.startContainer.nodeType; - currentRange.endContainer.nodeType; - /* eslint-enable no-unused-expressions */ - } catch (e) { - return null; - } - - // If the node and offset values are the same, the selection is collapsed. - // `Selection.isCollapsed` is available natively, but IE sometimes gets - // this value wrong. - var isSelectionCollapsed = isCollapsed(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset); - - var rangeLength = isSelectionCollapsed ? 0 : currentRange.toString().length; - - var tempRange = currentRange.cloneRange(); - tempRange.selectNodeContents(node); - tempRange.setEnd(currentRange.startContainer, currentRange.startOffset); - - var isTempRangeCollapsed = isCollapsed(tempRange.startContainer, tempRange.startOffset, tempRange.endContainer, tempRange.endOffset); - - var start = isTempRangeCollapsed ? 0 : tempRange.toString().length; - var end = start + rangeLength; - - // Detect whether the selection is backward. - var detectionRange = document.createRange(); - detectionRange.setStart(anchorNode, anchorOffset); - detectionRange.setEnd(focusNode, focusOffset); - var isBackward = detectionRange.collapsed; - - return { - start: isBackward ? end : start, - end: isBackward ? start : end - }; -} - -/** - * @param {DOMElement|DOMTextNode} node - * @param {object} offsets - */ -function setIEOffsets(node, offsets) { - var range = document.selection.createRange().duplicate(); - var start, end; - - if (offsets.end === undefined) { - start = offsets.start; - end = start; - } else if (offsets.start > offsets.end) { - start = offsets.end; - end = offsets.start; - } else { - start = offsets.start; - end = offsets.end; - } - - range.moveToElementText(node); - range.moveStart('character', start); - range.setEndPoint('EndToStart', range); - range.moveEnd('character', end - start); - range.select(); -} - -/** - * In modern non-IE browsers, we can support both forward and backward - * selections. - * - * Note: IE10+ supports the Selection object, but it does not support - * the `extend` method, which means that even in modern IE, it's not possible - * to 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 setModernOffsets(node, offsets) { - if (!window.getSelection) { - return; - } - - var selection = window.getSelection(); - var length = node[getTextContentAccessor()].length; - var start = Math.min(offsets.start, length); - var end = offsets.end === undefined ? start : Math.min(offsets.end, length); - - // IE 11 uses modern selection, but doesn't support the extend method. - // Flip backward selections, so we can set with a single range. - if (!selection.extend && start > end) { - var temp = end; - end = start; - start = temp; - } - - var startMarker = getNodeForCharacterOffset(node, start); - var endMarker = getNodeForCharacterOffset(node, end); - - if (startMarker && endMarker) { - var range = document.createRange(); - range.setStart(startMarker.node, startMarker.offset); - selection.removeAllRanges(); - - if (start > end) { - selection.addRange(range); - selection.extend(endMarker.node, endMarker.offset); - } else { - range.setEnd(endMarker.node, endMarker.offset); - selection.addRange(range); - } - } -} - -var useIEOffsets = ExecutionEnvironment.canUseDOM && 'selection' in document && !('getSelection' in window); - -var ReactDOMSelection = { - /** - * @param {DOMElement} node - */ - getOffsets: useIEOffsets ? getIEOffsets : getModernOffsets, - - /** - * @param {DOMElement|DOMTextNode} node - * @param {object} offsets - */ - setOffsets: useIEOffsets ? setIEOffsets : setModernOffsets -}; - -module.exports = ReactDOMSelection; - -/***/ }), -/* 442 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -/** - * Given any node return the first leaf node without children. - * - * @param {DOMElement|DOMTextNode} node - * @return {DOMElement|DOMTextNode} - */ - -function getLeafNode(node) { - while (node && node.firstChild) { - node = node.firstChild; - } - return node; -} - -/** - * Get the next sibling within a container. This will walk up the - * DOM if a node's siblings have been exhausted. - * - * @param {DOMElement|DOMTextNode} node - * @return {?DOMElement|DOMTextNode} - */ -function getSiblingNode(node) { - while (node) { - if (node.nextSibling) { - return node.nextSibling; - } - node = node.parentNode; - } -} - -/** - * Get object describing the nodes which contain characters at offset. - * - * @param {DOMElement|DOMTextNode} root - * @param {number} offset - * @return {?object} - */ -function getNodeForCharacterOffset(root, offset) { - var node = getLeafNode(root); - var nodeStart = 0; - var nodeEnd = 0; - - while (node) { - if (node.nodeType === 3) { - nodeEnd = nodeStart + node.textContent.length; - - if (nodeStart <= offset && nodeEnd >= offset) { - return { - node: node, - offset: offset - nodeStart - }; - } - - nodeStart = nodeEnd; - } - - node = getLeafNode(getSiblingNode(node)); - } -} - -module.exports = getNodeForCharacterOffset; - -/***/ }), -/* 443 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - -var isTextNode = __webpack_require__(444); - -/*eslint-disable no-bitwise */ - -/** - * Checks if a given DOM node contains or is another DOM 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; - } -} - -module.exports = containsNode; - -/***/ }), -/* 444 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -var isNode = __webpack_require__(445); - -/** - * @param {*} object The object to check. - * @return {boolean} Whether or not the object is a DOM text node. - */ -function isTextNode(object) { - return isNode(object) && object.nodeType == 3; -} - -module.exports = isTextNode; - -/***/ }), -/* 445 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @typechecks - */ - -/** - * @param {*} object The object to check. - * @return {boolean} Whether or not the object is a DOM node. - */ -function isNode(object) { - var doc = object ? object.ownerDocument || object : document; - var defaultView = doc.defaultView || window; - return !!(object && (typeof defaultView.Node === 'function' ? object instanceof defaultView.Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string')); -} - -module.exports = isNode; - -/***/ }), -/* 446 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var NS = { - xlink: 'http://www.w3.org/1999/xlink', - xml: 'http://www.w3.org/XML/1998/namespace' -}; - -// We use attributes for everything SVG so let's avoid some duplication and run -// code instead. -// The following are all specified in the HTML config already so we exclude here. -// - class (as className) -// - color -// - height -// - id -// - lang -// - max -// - media -// - method -// - min -// - name -// - style -// - target -// - type -// - width -var ATTRS = { - accentHeight: 'accent-height', - accumulate: 0, - additive: 0, - alignmentBaseline: 'alignment-baseline', - allowReorder: 'allowReorder', - alphabetic: 0, - amplitude: 0, - arabicForm: 'arabic-form', - ascent: 0, - attributeName: 'attributeName', - attributeType: 'attributeType', - autoReverse: 'autoReverse', - azimuth: 0, - baseFrequency: 'baseFrequency', - baseProfile: 'baseProfile', - baselineShift: 'baseline-shift', - bbox: 0, - begin: 0, - bias: 0, - by: 0, - calcMode: 'calcMode', - capHeight: 'cap-height', - clip: 0, - clipPath: 'clip-path', - clipRule: 'clip-rule', - clipPathUnits: 'clipPathUnits', - colorInterpolation: 'color-interpolation', - colorInterpolationFilters: 'color-interpolation-filters', - colorProfile: 'color-profile', - colorRendering: 'color-rendering', - contentScriptType: 'contentScriptType', - contentStyleType: 'contentStyleType', - cursor: 0, - cx: 0, - cy: 0, - d: 0, - decelerate: 0, - descent: 0, - diffuseConstant: 'diffuseConstant', - direction: 0, - display: 0, - divisor: 0, - dominantBaseline: 'dominant-baseline', - dur: 0, - dx: 0, - dy: 0, - edgeMode: 'edgeMode', - elevation: 0, - enableBackground: 'enable-background', - end: 0, - exponent: 0, - externalResourcesRequired: 'externalResourcesRequired', - fill: 0, - fillOpacity: 'fill-opacity', - fillRule: 'fill-rule', - filter: 0, - filterRes: 'filterRes', - filterUnits: 'filterUnits', - floodColor: 'flood-color', - floodOpacity: 'flood-opacity', - focusable: 0, - fontFamily: 'font-family', - fontSize: 'font-size', - fontSizeAdjust: 'font-size-adjust', - fontStretch: 'font-stretch', - fontStyle: 'font-style', - fontVariant: 'font-variant', - fontWeight: 'font-weight', - format: 0, - from: 0, - fx: 0, - fy: 0, - g1: 0, - g2: 0, - glyphName: 'glyph-name', - glyphOrientationHorizontal: 'glyph-orientation-horizontal', - glyphOrientationVertical: 'glyph-orientation-vertical', - glyphRef: 'glyphRef', - gradientTransform: 'gradientTransform', - gradientUnits: 'gradientUnits', - hanging: 0, - horizAdvX: 'horiz-adv-x', - horizOriginX: 'horiz-origin-x', - ideographic: 0, - imageRendering: 'image-rendering', - 'in': 0, - in2: 0, - intercept: 0, - k: 0, - k1: 0, - k2: 0, - k3: 0, - k4: 0, - kernelMatrix: 'kernelMatrix', - kernelUnitLength: 'kernelUnitLength', - kerning: 0, - keyPoints: 'keyPoints', - keySplines: 'keySplines', - keyTimes: 'keyTimes', - lengthAdjust: 'lengthAdjust', - letterSpacing: 'letter-spacing', - lightingColor: 'lighting-color', - limitingConeAngle: 'limitingConeAngle', - local: 0, - markerEnd: 'marker-end', - markerMid: 'marker-mid', - markerStart: 'marker-start', - markerHeight: 'markerHeight', - markerUnits: 'markerUnits', - markerWidth: 'markerWidth', - mask: 0, - maskContentUnits: 'maskContentUnits', - maskUnits: 'maskUnits', - mathematical: 0, - mode: 0, - numOctaves: 'numOctaves', - offset: 0, - opacity: 0, - operator: 0, - order: 0, - orient: 0, - orientation: 0, - origin: 0, - overflow: 0, - overlinePosition: 'overline-position', - overlineThickness: 'overline-thickness', - paintOrder: 'paint-order', - panose1: 'panose-1', - pathLength: 'pathLength', - patternContentUnits: 'patternContentUnits', - patternTransform: 'patternTransform', - patternUnits: 'patternUnits', - pointerEvents: 'pointer-events', - points: 0, - pointsAtX: 'pointsAtX', - pointsAtY: 'pointsAtY', - pointsAtZ: 'pointsAtZ', - preserveAlpha: 'preserveAlpha', - preserveAspectRatio: 'preserveAspectRatio', - primitiveUnits: 'primitiveUnits', - r: 0, - radius: 0, - refX: 'refX', - refY: 'refY', - renderingIntent: 'rendering-intent', - repeatCount: 'repeatCount', - repeatDur: 'repeatDur', - requiredExtensions: 'requiredExtensions', - requiredFeatures: 'requiredFeatures', - restart: 0, - result: 0, - rotate: 0, - rx: 0, - ry: 0, - scale: 0, - seed: 0, - shapeRendering: 'shape-rendering', - slope: 0, - spacing: 0, - specularConstant: 'specularConstant', - specularExponent: 'specularExponent', - speed: 0, - spreadMethod: 'spreadMethod', - startOffset: 'startOffset', - stdDeviation: 'stdDeviation', - stemh: 0, - stemv: 0, - stitchTiles: 'stitchTiles', - stopColor: 'stop-color', - stopOpacity: 'stop-opacity', - strikethroughPosition: 'strikethrough-position', - strikethroughThickness: 'strikethrough-thickness', - string: 0, - stroke: 0, - strokeDasharray: 'stroke-dasharray', - strokeDashoffset: 'stroke-dashoffset', - strokeLinecap: 'stroke-linecap', - strokeLinejoin: 'stroke-linejoin', - strokeMiterlimit: 'stroke-miterlimit', - strokeOpacity: 'stroke-opacity', - strokeWidth: 'stroke-width', - surfaceScale: 'surfaceScale', - systemLanguage: 'systemLanguage', - tableValues: 'tableValues', - targetX: 'targetX', - targetY: 'targetY', - textAnchor: 'text-anchor', - textDecoration: 'text-decoration', - textRendering: 'text-rendering', - textLength: 'textLength', - to: 0, - transform: 0, - u1: 0, - u2: 0, - underlinePosition: 'underline-position', - underlineThickness: 'underline-thickness', - unicode: 0, - unicodeBidi: 'unicode-bidi', - unicodeRange: 'unicode-range', - unitsPerEm: 'units-per-em', - vAlphabetic: 'v-alphabetic', - vHanging: 'v-hanging', - vIdeographic: 'v-ideographic', - vMathematical: 'v-mathematical', - values: 0, - vectorEffect: 'vector-effect', - version: 0, - vertAdvY: 'vert-adv-y', - vertOriginX: 'vert-origin-x', - vertOriginY: 'vert-origin-y', - viewBox: 'viewBox', - viewTarget: 'viewTarget', - visibility: 0, - widths: 0, - wordSpacing: 'word-spacing', - writingMode: 'writing-mode', - x: 0, - xHeight: 'x-height', - x1: 0, - x2: 0, - xChannelSelector: 'xChannelSelector', - xlinkActuate: 'xlink:actuate', - xlinkArcrole: 'xlink:arcrole', - xlinkHref: 'xlink:href', - xlinkRole: 'xlink:role', - xlinkShow: 'xlink:show', - xlinkTitle: 'xlink:title', - xlinkType: 'xlink:type', - xmlBase: 'xml:base', - xmlns: 0, - xmlnsXlink: 'xmlns:xlink', - xmlLang: 'xml:lang', - xmlSpace: 'xml:space', - y: 0, - y1: 0, - y2: 0, - yChannelSelector: 'yChannelSelector', - z: 0, - zoomAndPan: 'zoomAndPan' -}; - -var SVGDOMPropertyConfig = { - Properties: {}, - DOMAttributeNamespaces: { - xlinkActuate: NS.xlink, - xlinkArcrole: NS.xlink, - xlinkHref: NS.xlink, - xlinkRole: NS.xlink, - xlinkShow: NS.xlink, - xlinkTitle: NS.xlink, - xlinkType: NS.xlink, - xmlBase: NS.xml, - xmlLang: NS.xml, - xmlSpace: NS.xml - }, - DOMAttributeNames: {} -}; - -Object.keys(ATTRS).forEach(function (key) { - SVGDOMPropertyConfig.Properties[key] = 0; - if (ATTRS[key]) { - SVGDOMPropertyConfig.DOMAttributeNames[key] = ATTRS[key]; - } -}); - -module.exports = SVGDOMPropertyConfig; - -/***/ }), -/* 447 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var EventPropagators = __webpack_require__(60); -var ExecutionEnvironment = __webpack_require__(13); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactInputSelection = __webpack_require__(205); -var SyntheticEvent = __webpack_require__(29); - -var getActiveElement = __webpack_require__(206); -var isTextInputElement = __webpack_require__(188); -var shallowEqual = __webpack_require__(121); - -var skipSelectionChangeEvent = ExecutionEnvironment.canUseDOM && 'documentMode' in document && document.documentMode <= 11; - -var eventTypes = { - select: { - phasedRegistrationNames: { - bubbled: 'onSelect', - captured: 'onSelectCapture' - }, - dependencies: ['topBlur', 'topContextMenu', 'topFocus', 'topKeyDown', 'topKeyUp', 'topMouseDown', 'topMouseUp', 'topSelectionChange'] - } -}; - -var activeElement = null; -var activeElementInst = null; -var lastSelection = null; -var mouseDown = false; - -// Track whether a listener exists for this plugin. If none exist, we do -// not extract events. See #3639. -var hasListener = 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 && ReactInputSelection.hasSelectionCapabilities(node)) { - return { - start: node.selectionStart, - end: node.selectionEnd - }; - } else if (window.getSelection) { - var selection = window.getSelection(); - return { - anchorNode: selection.anchorNode, - anchorOffset: selection.anchorOffset, - focusNode: selection.focusNode, - focusOffset: selection.focusOffset - }; - } else if (document.selection) { - var range = document.selection.createRange(); - return { - parentElement: range.parentElement(), - text: range.text, - top: range.boundingTop, - left: range.boundingLeft - }; - } -} - -/** - * Poll selection to see whether it's changed. - * - * @param {object} nativeEvent - * @return {?SyntheticEvent} - */ -function constructSelectEvent(nativeEvent, 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. - if (mouseDown || activeElement == null || activeElement !== getActiveElement()) { - return null; - } - - // Only fire when selection has actually changed. - var currentSelection = getSelection(activeElement); - if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { - lastSelection = currentSelection; - - var syntheticEvent = SyntheticEvent.getPooled(eventTypes.select, activeElementInst, nativeEvent, nativeEventTarget); - - syntheticEvent.type = 'select'; - syntheticEvent.target = activeElement; - - EventPropagators.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, - - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - if (!hasListener) { - return null; - } - - var targetNode = targetInst ? ReactDOMComponentTree.getNodeFromInstance(targetInst) : window; - - switch (topLevelType) { - // Track the input node that has focus. - case 'topFocus': - if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') { - activeElement = targetNode; - activeElementInst = targetInst; - lastSelection = null; - } - break; - case 'topBlur': - activeElement = null; - activeElementInst = null; - lastSelection = null; - break; - // Don't fire the event while the user is dragging. This matches the - // semantics of the native select event. - case 'topMouseDown': - mouseDown = true; - break; - case 'topContextMenu': - case 'topMouseUp': - 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 'topSelectionChange': - if (skipSelectionChangeEvent) { - break; - } - // falls through - case 'topKeyDown': - case 'topKeyUp': - return constructSelectEvent(nativeEvent, nativeEventTarget); - } - - return null; - }, - - didPutListener: function (inst, registrationName, listener) { - if (registrationName === 'onSelect') { - hasListener = true; - } - } -}; - -module.exports = SelectEventPlugin; - -/***/ }), -/* 448 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var EventListener = __webpack_require__(204); -var EventPropagators = __webpack_require__(60); -var ReactDOMComponentTree = __webpack_require__(9); -var SyntheticAnimationEvent = __webpack_require__(449); -var SyntheticClipboardEvent = __webpack_require__(450); -var SyntheticEvent = __webpack_require__(29); -var SyntheticFocusEvent = __webpack_require__(451); -var SyntheticKeyboardEvent = __webpack_require__(452); -var SyntheticMouseEvent = __webpack_require__(81); -var SyntheticDragEvent = __webpack_require__(454); -var SyntheticTouchEvent = __webpack_require__(455); -var SyntheticTransitionEvent = __webpack_require__(456); -var SyntheticUIEvent = __webpack_require__(62); -var SyntheticWheelEvent = __webpack_require__(457); - -var emptyFunction = __webpack_require__(20); -var getEventCharCode = __webpack_require__(126); -var invariant = __webpack_require__(1); - -/** - * Turns - * ['abort', ...] - * into - * eventTypes = { - * 'abort': { - * phasedRegistrationNames: { - * bubbled: 'onAbort', - * captured: 'onAbortCapture', - * }, - * dependencies: ['topAbort'], - * }, - * ... - * }; - * topLevelEventsToDispatchConfig = { - * 'topAbort': { sameConfig } - * }; - */ -var eventTypes = {}; -var topLevelEventsToDispatchConfig = {}; -['abort', 'animationEnd', 'animationIteration', 'animationStart', 'blur', 'canPlay', 'canPlayThrough', 'click', 'contextMenu', 'copy', 'cut', 'doubleClick', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'focus', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'progress', 'rateChange', 'reset', 'scroll', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchMove', 'touchStart', 'transitionEnd', 'volumeChange', 'waiting', 'wheel'].forEach(function (event) { - var capitalizedEvent = event[0].toUpperCase() + event.slice(1); - var onEvent = 'on' + capitalizedEvent; - var topEvent = 'top' + capitalizedEvent; - - var type = { - phasedRegistrationNames: { - bubbled: onEvent, - captured: onEvent + 'Capture' - }, - dependencies: [topEvent] - }; - eventTypes[event] = type; - topLevelEventsToDispatchConfig[topEvent] = type; -}); - -var onClickListeners = {}; - -function getDictionaryKey(inst) { - // Prevents V8 performance issue: - // https://github.com/facebook/react/pull/7232 - return '.' + inst._rootNodeID; -} - -function isInteractive(tag) { - return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; -} - -var SimpleEventPlugin = { - eventTypes: eventTypes, - - extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType]; - if (!dispatchConfig) { - return null; - } - var EventConstructor; - switch (topLevelType) { - case 'topAbort': - case 'topCanPlay': - case 'topCanPlayThrough': - case 'topDurationChange': - case 'topEmptied': - case 'topEncrypted': - case 'topEnded': - case 'topError': - case 'topInput': - case 'topInvalid': - case 'topLoad': - case 'topLoadedData': - case 'topLoadedMetadata': - case 'topLoadStart': - case 'topPause': - case 'topPlay': - case 'topPlaying': - case 'topProgress': - case 'topRateChange': - case 'topReset': - case 'topSeeked': - case 'topSeeking': - case 'topStalled': - case 'topSubmit': - case 'topSuspend': - case 'topTimeUpdate': - case 'topVolumeChange': - case 'topWaiting': - // HTML Events - // @see http://www.w3.org/TR/html5/index.html#events-0 - EventConstructor = SyntheticEvent; - break; - case 'topKeyPress': - // Firefox creates a keypress event for function keys too. This removes - // the unwanted keypress events. Enter is however both printable and - // non-printable. One would expect Tab to be as well (but it isn't). - if (getEventCharCode(nativeEvent) === 0) { - return null; - } - /* falls through */ - case 'topKeyDown': - case 'topKeyUp': - EventConstructor = SyntheticKeyboardEvent; - break; - case 'topBlur': - case 'topFocus': - EventConstructor = SyntheticFocusEvent; - break; - case 'topClick': - // Firefox creates a click event on right mouse clicks. This removes the - // unwanted click events. - if (nativeEvent.button === 2) { - return null; - } - /* falls through */ - case 'topDoubleClick': - case 'topMouseDown': - case 'topMouseMove': - case 'topMouseUp': - // TODO: Disabled elements should not respond to mouse events - /* falls through */ - case 'topMouseOut': - case 'topMouseOver': - case 'topContextMenu': - EventConstructor = SyntheticMouseEvent; - break; - case 'topDrag': - case 'topDragEnd': - case 'topDragEnter': - case 'topDragExit': - case 'topDragLeave': - case 'topDragOver': - case 'topDragStart': - case 'topDrop': - EventConstructor = SyntheticDragEvent; - break; - case 'topTouchCancel': - case 'topTouchEnd': - case 'topTouchMove': - case 'topTouchStart': - EventConstructor = SyntheticTouchEvent; - break; - case 'topAnimationEnd': - case 'topAnimationIteration': - case 'topAnimationStart': - EventConstructor = SyntheticAnimationEvent; - break; - case 'topTransitionEnd': - EventConstructor = SyntheticTransitionEvent; - break; - case 'topScroll': - EventConstructor = SyntheticUIEvent; - break; - case 'topWheel': - EventConstructor = SyntheticWheelEvent; - break; - case 'topCopy': - case 'topCut': - case 'topPaste': - EventConstructor = SyntheticClipboardEvent; - break; - } - !EventConstructor ? true ? invariant(false, 'SimpleEventPlugin: Unhandled event type, `%s`.', topLevelType) : _prodInvariant('86', topLevelType) : void 0; - var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget); - EventPropagators.accumulateTwoPhaseDispatches(event); - return event; - }, - - didPutListener: function (inst, registrationName, listener) { - // Mobile Safari does not fire properly bubble click events on - // non-interactive elements, which means delegated click listeners do not - // fire. The workaround for this bug involves attaching an empty click - // listener on the target node. - // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html - if (registrationName === 'onClick' && !isInteractive(inst._tag)) { - var key = getDictionaryKey(inst); - var node = ReactDOMComponentTree.getNodeFromInstance(inst); - if (!onClickListeners[key]) { - onClickListeners[key] = EventListener.listen(node, 'click', emptyFunction); - } - } - }, - - willDeleteListener: function (inst, registrationName) { - if (registrationName === 'onClick' && !isInteractive(inst._tag)) { - var key = getDictionaryKey(inst); - onClickListeners[key].remove(); - delete onClickListeners[key]; - } - } -}; - -module.exports = SimpleEventPlugin; - -/***/ }), -/* 449 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticEvent = __webpack_require__(29); - -/** - * @interface Event - * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface - * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent - */ -var AnimationEventInterface = { - animationName: null, - elapsedTime: null, - pseudoElement: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent.augmentClass(SyntheticAnimationEvent, AnimationEventInterface); - -module.exports = SyntheticAnimationEvent; - -/***/ }), -/* 450 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticEvent = __webpack_require__(29); - -/** - * @interface Event - * @see http://www.w3.org/TR/clipboard-apis/ - */ -var ClipboardEventInterface = { - clipboardData: function (event) { - return 'clipboardData' in event ? event.clipboardData : window.clipboardData; - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent.augmentClass(SyntheticClipboardEvent, ClipboardEventInterface); - -module.exports = SyntheticClipboardEvent; - -/***/ }), -/* 451 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticUIEvent = __webpack_require__(62); - -/** - * @interface FocusEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var FocusEventInterface = { - relatedTarget: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticFocusEvent, FocusEventInterface); - -module.exports = SyntheticFocusEvent; - -/***/ }), -/* 452 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticUIEvent = __webpack_require__(62); - -var getEventCharCode = __webpack_require__(126); -var getEventKey = __webpack_require__(453); -var getEventModifierState = __webpack_require__(115); - -/** - * @interface KeyboardEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var KeyboardEventInterface = { - key: getEventKey, - location: null, - ctrlKey: null, - shiftKey: null, - altKey: null, - metaKey: null, - repeat: null, - locale: null, - getModifierState: getEventModifierState, - // Legacy Interface - charCode: function (event) { - // `charCode` is the result of a KeyPress event and represents the value of - // the actual printable character. - - // KeyPress is deprecated, but its replacement is not yet final and not - // implemented in any major browser. Only KeyPress has charCode. - if (event.type === 'keypress') { - return getEventCharCode(event); - } - return 0; - }, - keyCode: function (event) { - // `keyCode` is the result of a KeyDown/Up event and represents the value of - // physical keyboard key. - - // The actual meaning of the value depends on the users' keyboard layout - // which cannot be detected. Assuming that it is a US keyboard layout - // provides a surprisingly accurate mapping for US and European users. - // Due to this, it is left to the user to implement at this time. - if (event.type === 'keydown' || event.type === 'keyup') { - return event.keyCode; - } - return 0; - }, - which: function (event) { - // `which` is an alias for either `keyCode` or `charCode` depending on the - // type of the event. - if (event.type === 'keypress') { - return getEventCharCode(event); - } - if (event.type === 'keydown' || event.type === 'keyup') { - return event.keyCode; - } - return 0; - } -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticKeyboardEvent, KeyboardEventInterface); - -module.exports = SyntheticKeyboardEvent; - -/***/ }), -/* 453 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var getEventCharCode = __webpack_require__(126); - -/** - * Normalization of deprecated HTML5 `key` values - * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names - */ -var normalizeKey = { - Esc: 'Escape', - Spacebar: ' ', - Left: 'ArrowLeft', - Up: 'ArrowUp', - Right: 'ArrowRight', - Down: 'ArrowDown', - Del: 'Delete', - Win: 'OS', - Menu: 'ContextMenu', - Apps: 'ContextMenu', - Scroll: 'ScrollLock', - MozPrintableKey: 'Unidentified' -}; - -/** - * Translation from legacy `keyCode` to HTML5 `key` - * Only special keys supported, all others depend on keyboard layout or browser - * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names - */ -var translateToKey = { - 8: 'Backspace', - 9: 'Tab', - 12: 'Clear', - 13: 'Enter', - 16: 'Shift', - 17: 'Control', - 18: 'Alt', - 19: 'Pause', - 20: 'CapsLock', - 27: 'Escape', - 32: ' ', - 33: 'PageUp', - 34: 'PageDown', - 35: 'End', - 36: 'Home', - 37: 'ArrowLeft', - 38: 'ArrowUp', - 39: 'ArrowRight', - 40: 'ArrowDown', - 45: 'Insert', - 46: 'Delete', - 112: 'F1', - 113: 'F2', - 114: 'F3', - 115: 'F4', - 116: 'F5', - 117: 'F6', - 118: 'F7', - 119: 'F8', - 120: 'F9', - 121: 'F10', - 122: 'F11', - 123: 'F12', - 144: 'NumLock', - 145: 'ScrollLock', - 224: 'Meta' -}; - -/** - * @param {object} nativeEvent Native browser event. - * @return {string} Normalized `key` property. - */ -function getEventKey(nativeEvent) { - if (nativeEvent.key) { - // Normalize inconsistent values reported by browsers due to - // implementations of a working draft specification. - - // FireFox implements `key` but returns `MozPrintableKey` for all - // printable characters (normalized to `Unidentified`), ignore it. - var key = normalizeKey[nativeEvent.key] || nativeEvent.key; - if (key !== 'Unidentified') { - return key; - } - } - - // Browser does not implement `key`, polyfill as much of it as we can. - if (nativeEvent.type === 'keypress') { - var charCode = getEventCharCode(nativeEvent); - - // The enter-key is technically both printable and non-printable and can - // thus be captured by `keypress`, no other non-printable key should. - return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); - } - if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { - // While user keyboard layout determines the actual meaning of each - // `keyCode` value, almost all function keys have a universal value. - return translateToKey[nativeEvent.keyCode] || 'Unidentified'; - } - return ''; -} - -module.exports = getEventKey; - -/***/ }), -/* 454 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticMouseEvent = __webpack_require__(81); - -/** - * @interface DragEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var DragEventInterface = { - dataTransfer: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticMouseEvent.augmentClass(SyntheticDragEvent, DragEventInterface); - -module.exports = SyntheticDragEvent; - -/***/ }), -/* 455 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticUIEvent = __webpack_require__(62); - -var getEventModifierState = __webpack_require__(115); - -/** - * @interface TouchEvent - * @see http://www.w3.org/TR/touch-events/ - */ -var TouchEventInterface = { - touches: null, - targetTouches: null, - changedTouches: null, - altKey: null, - metaKey: null, - ctrlKey: null, - shiftKey: null, - getModifierState: getEventModifierState -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticUIEvent} - */ -function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticUIEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticUIEvent.augmentClass(SyntheticTouchEvent, TouchEventInterface); - -module.exports = SyntheticTouchEvent; - -/***/ }), -/* 456 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticEvent = __webpack_require__(29); - -/** - * @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 TransitionEventInterface = { - propertyName: null, - elapsedTime: null, - pseudoElement: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticEvent} - */ -function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent.augmentClass(SyntheticTransitionEvent, TransitionEventInterface); - -module.exports = SyntheticTransitionEvent; - -/***/ }), -/* 457 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var SyntheticMouseEvent = __webpack_require__(81); - -/** - * @interface WheelEvent - * @see http://www.w3.org/TR/DOM-Level-3-Events/ - */ -var WheelEventInterface = { - deltaX: function (event) { - return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). - 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; - }, - deltaY: function (event) { - return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). - 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). - 'wheelDelta' in event ? -event.wheelDelta : 0; - }, - deltaZ: null, - - // Browsers without "deltaMode" is reporting in raw wheel delta where one - // notch on the scroll is always +/- 120, roughly equivalent to pixels. - // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or - // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. - deltaMode: null -}; - -/** - * @param {object} dispatchConfig Configuration used to dispatch this event. - * @param {string} dispatchMarker Marker identifying the event target. - * @param {object} nativeEvent Native browser event. - * @extends {SyntheticMouseEvent} - */ -function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticMouseEvent.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticMouseEvent.augmentClass(SyntheticWheelEvent, WheelEventInterface); - -module.exports = SyntheticWheelEvent; - -/***/ }), -/* 458 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var validateDOMNesting = __webpack_require__(125); - -var DOC_NODE_TYPE = 9; - -function ReactDOMContainerInfo(topLevelWrapper, node) { - var info = { - _topLevelWrapper: topLevelWrapper, - _idCounter: 1, - _ownerDocument: node ? node.nodeType === DOC_NODE_TYPE ? node : node.ownerDocument : null, - _node: node, - _tag: node ? node.nodeName.toLowerCase() : null, - _namespaceURI: node ? node.namespaceURI : null - }; - if (true) { - info._ancestorInfo = node ? validateDOMNesting.updatedAncestorInfo(null, info._tag, null) : null; - } - return info; -} - -module.exports = ReactDOMContainerInfo; - -/***/ }), -/* 459 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactDOMFeatureFlags = { - useCreateElement: true, - useFiber: false -}; - -module.exports = ReactDOMFeatureFlags; - -/***/ }), -/* 460 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var adler32 = __webpack_require__(461); - -var TAG_END = /\/?>/; -var COMMENT_START = /^<\!\-\-/; - -var ReactMarkupChecksum = { - CHECKSUM_ATTR_NAME: 'data-react-checksum', - - /** - * @param {string} markup Markup string - * @return {string} Markup string with checksum attribute attached - */ - addChecksumToMarkup: function (markup) { - var checksum = adler32(markup); - - // Add checksum (handle both parent tags, comments and self-closing tags) - if (COMMENT_START.test(markup)) { - return markup; - } else { - return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&'); - } - }, - - /** - * @param {string} markup to use - * @param {DOMElement} element root React element - * @returns {boolean} whether or not the markup is the same - */ - canReuseMarkup: function (markup, element) { - var existingChecksum = element.getAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME); - existingChecksum = existingChecksum && parseInt(existingChecksum, 10); - var markupChecksum = adler32(markup); - return markupChecksum === existingChecksum; - } -}; - -module.exports = ReactMarkupChecksum; - -/***/ }), -/* 461 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * - */ - - - -var MOD = 65521; - -// adler32 is not cryptographically strong, and is only used to sanity check that -// markup generated on the server matches the markup generated on the client. -// This implementation (a modified version of the SheetJS version) has been optimized -// for our use case, at the expense of conforming to the adler32 specification -// for non-ascii inputs. -function adler32(data) { - var a = 1; - var b = 0; - var i = 0; - var l = data.length; - var m = l & ~0x3; - while (i < m) { - var n = Math.min(i + 4096, m); - for (; i < n; i += 4) { - b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3)); - } - a %= MOD; - b %= MOD; - } - for (; i < l; i++) { - b += a += data.charCodeAt(i); - } - a %= MOD; - b %= MOD; - return a | b << 16; -} - -module.exports = adler32; - -/***/ }), -/* 462 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -module.exports = '15.6.2'; - -/***/ }), -/* 463 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var _prodInvariant = __webpack_require__(4); - -var ReactCurrentOwner = __webpack_require__(23); -var ReactDOMComponentTree = __webpack_require__(9); -var ReactInstanceMap = __webpack_require__(63); - -var getHostComponentFromComposite = __webpack_require__(208); -var invariant = __webpack_require__(1); -var warning = __webpack_require__(2); - -/** - * Returns the DOM node rendered by this element. - * - * See https://facebook.github.io/react/docs/top-level-api.html#reactdom.finddomnode - * - * @param {ReactComponent|DOMElement} componentOrElement - * @return {?DOMElement} The root node of this element. - */ -function findDOMNode(componentOrElement) { - if (true) { - var owner = ReactCurrentOwner.current; - if (owner !== null) { - true ? warning(owner._warnedAboutRefsInRender, '%s is accessing findDOMNode inside its render(). ' + '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.', owner.getName() || 'A component') : void 0; - owner._warnedAboutRefsInRender = true; - } - } - if (componentOrElement == null) { - return null; - } - if (componentOrElement.nodeType === 1) { - return componentOrElement; - } - - var inst = ReactInstanceMap.get(componentOrElement); - if (inst) { - inst = getHostComponentFromComposite(inst); - return inst ? ReactDOMComponentTree.getNodeFromInstance(inst) : null; - } - - if (typeof componentOrElement.render === 'function') { - true ? true ? invariant(false, 'findDOMNode was called on an unmounted component.') : _prodInvariant('44') : void 0; - } else { - true ? true ? invariant(false, 'Element appears to be neither ReactComponent nor DOMNode (keys: %s)', Object.keys(componentOrElement)) : _prodInvariant('45', Object.keys(componentOrElement)) : void 0; - } -} - -module.exports = findDOMNode; - -/***/ }), -/* 464 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactMount = __webpack_require__(207); - -module.exports = ReactMount.renderSubtreeIntoContainer; - -/***/ }), -/* 465 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMProperty = __webpack_require__(33); -var EventPluginRegistry = __webpack_require__(79); -var ReactComponentTreeHook = __webpack_require__(17); - -var warning = __webpack_require__(2); - -if (true) { - var reactProps = { - children: true, - dangerouslySetInnerHTML: true, - key: true, - ref: true, - - autoFocus: true, - defaultValue: true, - valueLink: true, - defaultChecked: true, - checkedLink: true, - innerHTML: true, - suppressContentEditableWarning: true, - onFocusIn: true, - onFocusOut: true - }; - var warnedProperties = {}; - - var validateProperty = function (tagName, name, debugID) { - if (DOMProperty.properties.hasOwnProperty(name) || DOMProperty.isCustomAttribute(name)) { - return true; - } - if (reactProps.hasOwnProperty(name) && reactProps[name] || warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { - return true; - } - if (EventPluginRegistry.registrationNameModules.hasOwnProperty(name)) { - return true; - } - warnedProperties[name] = true; - var lowerCasedName = name.toLowerCase(); - - // data-* attributes should be lowercase; suggest the lowercase version - var standardName = DOMProperty.isCustomAttribute(lowerCasedName) ? lowerCasedName : DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null; - - var registrationName = EventPluginRegistry.possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? EventPluginRegistry.possibleRegistrationNames[lowerCasedName] : null; - - if (standardName != null) { - true ? warning(false, 'Unknown DOM property %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - return true; - } else if (registrationName != null) { - true ? warning(false, 'Unknown event handler property %s. Did you mean `%s`?%s', name, registrationName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - return true; - } else { - // We were unable to guess which prop the user intended. - // It is likely that the user was just blindly spreading/forwarding props - // Components should be careful to only render valid props/attributes. - // Warning will be invoked in warnUnknownProperties to allow grouping. - return false; - } - }; -} - -var warnUnknownProperties = function (debugID, element) { - var unknownProps = []; - for (var key in element.props) { - var isValid = validateProperty(element.type, key, debugID); - if (!isValid) { - unknownProps.push(key); - } - } - - var unknownPropString = unknownProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (unknownProps.length === 1) { - true ? warning(false, 'Unknown prop %s on <%s> tag. Remove this prop from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - } else if (unknownProps.length > 1) { - true ? warning(false, 'Unknown props %s on <%s> tag. Remove these props from the element. ' + 'For details, see https://fb.me/react-unknown-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - } -}; - -function handleElement(debugID, element) { - if (element == null || typeof element.type !== 'string') { - return; - } - if (element.type.indexOf('-') >= 0 || element.props.is) { - return; - } - warnUnknownProperties(debugID, element); -} - -var ReactDOMUnknownPropertyHook = { - onBeforeMountComponent: function (debugID, element) { - handleElement(debugID, element); - }, - onBeforeUpdateComponent: function (debugID, element) { - handleElement(debugID, element); - } -}; - -module.exports = ReactDOMUnknownPropertyHook; - -/***/ }), -/* 466 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var ReactComponentTreeHook = __webpack_require__(17); - -var warning = __webpack_require__(2); - -var didWarnValueNull = false; - -function handleElement(debugID, element) { - if (element == null) { - return; - } - if (element.type !== 'input' && element.type !== 'textarea' && element.type !== 'select') { - return; - } - if (element.props != null && element.props.value === null && !didWarnValueNull) { - true ? warning(false, '`value` prop on `%s` should not be null. ' + 'Consider using the empty string to clear the component or `undefined` ' + 'for uncontrolled components.%s', element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - - didWarnValueNull = true; - } -} - -var ReactDOMNullInputValuePropHook = { - onBeforeMountComponent: function (debugID, element) { - handleElement(debugID, element); - }, - onBeforeUpdateComponent: function (debugID, element) { - handleElement(debugID, element); - } -}; - -module.exports = ReactDOMNullInputValuePropHook; - -/***/ }), -/* 467 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - - - -var DOMProperty = __webpack_require__(33); -var ReactComponentTreeHook = __webpack_require__(17); - -var warning = __webpack_require__(2); - -var warnedProperties = {}; -var rARIA = new RegExp('^(aria)-[' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$'); - -function validateProperty(tagName, name, debugID) { - if (warnedProperties.hasOwnProperty(name) && warnedProperties[name]) { - return true; - } - - if (rARIA.test(name)) { - var lowerCasedName = name.toLowerCase(); - var standardName = DOMProperty.getPossibleStandardName.hasOwnProperty(lowerCasedName) ? DOMProperty.getPossibleStandardName[lowerCasedName] : null; - - // If this is an aria-* attribute, but is not listed in the known DOM - // DOM properties, then it is an invalid aria-* attribute. - if (standardName == null) { - warnedProperties[name] = true; - return false; - } - // aria-* attributes should be lowercase; suggest the lowercase version. - if (name !== standardName) { - true ? warning(false, 'Unknown ARIA attribute %s. Did you mean %s?%s', name, standardName, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - warnedProperties[name] = true; - return true; - } - } - - return true; -} - -function warnInvalidARIAProps(debugID, element) { - var invalidProps = []; - - for (var key in element.props) { - var isValid = validateProperty(element.type, key, debugID); - if (!isValid) { - invalidProps.push(key); - } - } - - var unknownPropString = invalidProps.map(function (prop) { - return '`' + prop + '`'; - }).join(', '); - - if (invalidProps.length === 1) { - true ? warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - } else if (invalidProps.length > 1) { - true ? warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, element.type, ReactComponentTreeHook.getStackAddendumByID(debugID)) : void 0; - } -} - -function handleElement(debugID, element) { - if (element == null || typeof element.type !== 'string') { - return; - } - if (element.type.indexOf('-') >= 0 || element.props.is) { - return; - } - - warnInvalidARIAProps(debugID, element); -} - -var ReactDOMInvalidARIAHook = { - onBeforeMountComponent: function (debugID, element) { - if (true) { - handleElement(debugID, element); - } - }, - onBeforeUpdateComponent: function (debugID, element) { - if (true) { - handleElement(debugID, element); - } - } -}; - -module.exports = ReactDOMInvalidARIAHook; - -/***/ }), -/* 468 */, -/* 469 */, -/* 470 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.compose = exports.merge = exports.$ = exports.style = exports.presets = exports.keyframes = exports.fontFace = exports.insertGlobal = exports.insertRule = exports.plugins = exports.styleSheet = undefined; -exports.speedy = speedy; -exports.simulations = simulations; -exports.simulate = simulate; -exports.cssLabels = cssLabels; -exports.isLikeRule = isLikeRule; -exports.idFor = idFor; -exports.css = css; -exports.rehydrate = rehydrate; -exports.flush = flush; -exports.select = select; -exports.parent = parent; -exports.media = media; -exports.pseudo = pseudo; -exports.active = active; -exports.any = any; -exports.checked = checked; -exports.disabled = disabled; -exports.empty = empty; -exports.enabled = enabled; -exports._default = _default; -exports.first = first; -exports.firstChild = firstChild; -exports.firstOfType = firstOfType; -exports.fullscreen = fullscreen; -exports.focus = focus; -exports.hover = hover; -exports.indeterminate = indeterminate; -exports.inRange = inRange; -exports.invalid = invalid; -exports.lastChild = lastChild; -exports.lastOfType = lastOfType; -exports.left = left; -exports.link = link; -exports.onlyChild = onlyChild; -exports.onlyOfType = onlyOfType; -exports.optional = optional; -exports.outOfRange = outOfRange; -exports.readOnly = readOnly; -exports.readWrite = readWrite; -exports.required = required; -exports.right = right; -exports.root = root; -exports.scope = scope; -exports.target = target; -exports.valid = valid; -exports.visited = visited; -exports.dir = dir; -exports.lang = lang; -exports.not = not; -exports.nthChild = nthChild; -exports.nthLastChild = nthLastChild; -exports.nthLastOfType = nthLastOfType; -exports.nthOfType = nthOfType; -exports.after = after; -exports.before = before; -exports.firstLetter = firstLetter; -exports.firstLine = firstLine; -exports.selection = selection; -exports.backdrop = backdrop; -exports.placeholder = placeholder; -exports.cssFor = cssFor; -exports.attribsFor = attribsFor; - -var _objectAssign = __webpack_require__(7); - -var _objectAssign2 = _interopRequireDefault(_objectAssign); - -var _sheet = __webpack_require__(471); - -var _CSSPropertyOperations = __webpack_require__(211); - -var _clean = __webpack_require__(474); - -var _clean2 = _interopRequireDefault(_clean); - -var _plugins = __webpack_require__(475); - -var _hash = __webpack_require__(477); - -var _hash2 = _interopRequireDefault(_hash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -/* stylesheet */ - - -var styleSheet = exports.styleSheet = new _sheet.StyleSheet(); -// an isomorphic StyleSheet shim. hides all the nitty gritty. - -// /**************** LIFTOFF IN 3... 2... 1... ****************/ -styleSheet.inject(); //eslint-disable-line indent -// /**************** TO THE MOOOOOOON ****************/ - -// convenience function to toggle speedy -function speedy(bool) { - return styleSheet.speedy(bool); -} - -// plugins -// we include these by default -var plugins = exports.plugins = styleSheet.plugins = new _plugins.PluginSet([_plugins.prefixes, _plugins.contentWrap, _plugins.fallbacks]); -plugins.media = new _plugins.PluginSet(); // neat! media, font-face, keyframes -plugins.fontFace = new _plugins.PluginSet(); -plugins.keyframes = new _plugins.PluginSet([_plugins.prefixes, _plugins.fallbacks]); - -// define some constants - -var isDev = "development" === 'development' || !"development"; -var isTest = "development" === 'test'; -var isBrowser = typeof window !== 'undefined'; - -/**** simulations ****/ - -// a flag to enable simulation meta tags on dom nodes -// defaults to true in dev mode. recommend *not* to -// toggle often. -var canSimulate = isDev; - -// we use these flags for issuing warnings when simulate is called -// in prod / in incorrect order -var warned1 = false, - warned2 = false; - -// toggles simulation activity. shouldn't be needed in most cases -function simulations() { - var bool = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - canSimulate = !!bool; -} - -// use this on dom nodes to 'simulate' pseudoclasses -// <div {...hover({ color: 'red' })} {...simulate('hover', 'visited')}>...</div> -// you can even send in some weird ones, as long as it's in simple format -// and matches an existing rule on the element -// eg simulate('nthChild2', ':hover:active') etc -function simulate() { - for (var _len = arguments.length, pseudos = Array(_len), _key = 0; _key < _len; _key++) { - pseudos[_key] = arguments[_key]; - } - - pseudos = (0, _clean2.default)(pseudos); - if (!pseudos) return {}; - if (!canSimulate) { - if (!warned1) { - console.warn('can\'t simulate without once calling simulations(true)'); //eslint-disable-line no-console - warned1 = true; - } - if (!isDev && !isTest && !warned2) { - console.warn('don\'t use simulation outside dev'); //eslint-disable-line no-console - warned2 = true; - } - return {}; - } - return pseudos.reduce(function (o, p) { - return o['data-simulate-' + simple(p)] = '', o; - }, {}); -} - -/**** labels ****/ -// toggle for debug labels. -// *shouldn't* have to mess with this manually -var hasLabels = isDev; - -function cssLabels(bool) { - hasLabels = !!bool; -} - -// takes a string, converts to lowercase, strips out nonalphanumeric. -function simple(str) { - var char = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - - return str.toLowerCase().replace(/[^a-z0-9]/g, char); -} - -// hashes a string to something 'unique' -// we use this to generate ids for styles - - -function hashify(obj) { - var str = JSON.stringify(obj); - var toRet = (0, _hash2.default)(str).toString(36); - if (obj.label && obj.label.length > 0 && isDev) { - return simple(obj.label.join('.'), '-') + '-' + toRet; - } - return toRet; -} - -// of shape { 'data-css-<id>': '' } -function isLikeRule(rule) { - var keys = Object.keys(rule).filter(function (x) { - return x !== 'toString'; - }); - if (keys.length !== 1) { - return false; - } - return !!/data\-css\-([a-zA-Z0-9\-_]+)/.exec(keys[0]); -} - -// extracts id from a { 'data-css-<id>': ''} like object -function idFor(rule) { - var keys = Object.keys(rule).filter(function (x) { - return x !== 'toString'; - }); - if (keys.length !== 1) throw new Error('not a rule'); - var regex = /data\-css\-([a-zA-Z0-9\-_]+)/; - var match = regex.exec(keys[0]); - if (!match) throw new Error('not a rule'); - return match[1]; -} - -// from https://github.com/j2css/j2c/blob/5d381c2d721d04b54fabe6a165d587247c3087cb/src/helpers.js#L28-L61 - -// "Tokenizes" the selectors into parts relevant for the next function. -// Strings and comments are matched, but ignored afterwards. -// This is not a full tokenizers. It only recognizes comas, parentheses, -// strings and comments. -// regexp generated by scripts/regexps.js then trimmed by hand -var selectorTokenizer = /[(),]|"(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*'|\/\*[\s\S]*?\*\//g; - -/** - * This will split a coma-separated selector list into individual selectors, - * ignoring comas in strings, comments and in :pseudo-selectors(parameter, lists). - * - * @param {string} selector - * @return {string[]} - */ - -function splitSelector(selector) { - if (selector.indexOf(',') === -1) { - return [selector]; - } - - var indices = [], - res = [], - inParen = 0, - o; - /*eslint-disable no-cond-assign*/ - while (o = selectorTokenizer.exec(selector)) { - /*eslint-enable no-cond-assign*/ - switch (o[0]) { - case '(': - inParen++;break; - case ')': - inParen--;break; - case ',': - if (inParen) break;indices.push(o.index); - } - } - for (o = indices.length; o--;) { - res.unshift(selector.slice(indices[o] + 1)); - selector = selector.slice(0, indices[o]); - } - res.unshift(selector); - return res; -} - -function selector(id, path) { - if (!id) { - return path.replace(/\&/g, ''); - } - if (!path) return '.css-' + id + ',[data-css-' + id + ']'; - - var x = splitSelector(path).map(function (x) { - return x.indexOf('&') >= 0 ? [x.replace(/\&/mg, '.css-' + id), x.replace(/\&/mg, '[data-css-' + id + ']')].join(',') // todo - make sure each sub selector has an & - : '.css-' + id + x + ',[data-css-' + id + ']' + x; - }).join(','); - - if (canSimulate && /^\&\:/.exec(path) && !/\s/.exec(path)) { - x += ',.css-' + id + '[data-simulate-' + simple(path) + '],[data-css-' + id + '][data-simulate-' + simple(path) + ']'; - } - return x; -} - -// end https://github.com/j2css/j2c/blob/5d381c2d721d04b54fabe6a165d587247c3087cb/src/helpers.js#L28-L61 - - -function toCSS(_ref) { - var selector = _ref.selector, - style = _ref.style; - - var result = plugins.transform({ selector: selector, style: style }); - return result.selector + '{' + (0, _CSSPropertyOperations.createMarkupForStyles)(result.style) + '}'; -} - -function deconstruct(style) { - // we can be sure it's not infinitely nested here - var plain = void 0, - selects = void 0, - medias = void 0, - supports = void 0; - Object.keys(style).forEach(function (key) { - if (key.indexOf('&') >= 0) { - selects = selects || {}; - selects[key] = style[key]; - } else if (key.indexOf('@media') === 0) { - medias = medias || {}; - medias[key] = deconstruct(style[key]); - } else if (key.indexOf('@supports') === 0) { - supports = supports || {}; - supports[key] = deconstruct(style[key]); - } else if (key === 'label') { - if (style.label.length > 0) { - plain = plain || {}; - plain.label = hasLabels ? style.label.join('.') : ''; - } - } else { - plain = plain || {}; - plain[key] = style[key]; - } - }); - return { plain: plain, selects: selects, medias: medias, supports: supports }; -} - -function deconstructedStyleToCSS(id, style) { - var css = []; - - // plugins here - var plain = style.plain, - selects = style.selects, - medias = style.medias, - supports = style.supports; - - if (plain) { - css.push(toCSS({ style: plain, selector: selector(id) })); - } - if (selects) { - Object.keys(selects).forEach(function (key) { - return css.push(toCSS({ style: selects[key], selector: selector(id, key) })); - }); - } - if (medias) { - Object.keys(medias).forEach(function (key) { - return css.push(key + '{' + deconstructedStyleToCSS(id, medias[key]).join('') + '}'); - }); - } - if (supports) { - Object.keys(supports).forEach(function (key) { - return css.push(key + '{' + deconstructedStyleToCSS(id, supports[key]).join('') + '}'); - }); - } - return css; -} - -// this cache to track which rules have -// been inserted into the stylesheet -var inserted = styleSheet.inserted = {}; - -// and helpers to insert rules into said styleSheet -function insert(spec) { - if (!inserted[spec.id]) { - inserted[spec.id] = true; - var deconstructed = deconstruct(spec.style); - var rules = deconstructedStyleToCSS(spec.id, deconstructed); - inserted[spec.id] = isBrowser ? true : rules; - rules.forEach(function (cssRule) { - return styleSheet.insert(cssRule); - }); - } -} - -// a simple cache to store generated rules -var registered = styleSheet.registered = {}; -function register(spec) { - if (!registered[spec.id]) { - registered[spec.id] = spec; - } -} - -function _getRegistered(rule) { - if (isLikeRule(rule)) { - var ret = registered[idFor(rule)]; - if (ret == null) { - throw new Error('[glamor] an unexpected rule cache miss occurred. This is probably a sign of multiple glamor instances in your app. See https://github.com/threepointone/glamor/issues/79'); - } - return ret; - } - return rule; -} - -// todo - perf -var ruleCache = {}; -function toRule(spec) { - register(spec); - insert(spec); - - if (ruleCache[spec.id]) { - return ruleCache[spec.id]; - } - - var ret = _defineProperty({}, 'data-css-' + spec.id, hasLabels ? spec.label || '' : ''); - Object.defineProperty(ret, 'toString', { - enumerable: false, value: function value() { - return 'css-' + spec.id; - } - }); - ruleCache[spec.id] = ret; - return ret; -} - -function log() { - //eslint-disable-line no-unused-vars - console.log(this); //eslint-disable-line no-console - return this; -} - -function isSelector(key) { - var possibles = [':', '.', '[', '>', ' '], - found = false, - ch = key.charAt(0); - for (var i = 0; i < possibles.length; i++) { - if (ch === possibles[i]) { - found = true; - break; - } - } - return found || key.indexOf('&') >= 0; -} - -function joinSelectors(a, b) { - var as = splitSelector(a).map(function (a) { - return !(a.indexOf('&') >= 0) ? '&' + a : a; - }); - var bs = splitSelector(b).map(function (b) { - return !(b.indexOf('&') >= 0) ? '&' + b : b; - }); - - return bs.reduce(function (arr, b) { - return arr.concat(as.map(function (a) { - return b.replace(/\&/g, a); - })); - }, []).join(','); -} - -function joinMediaQueries(a, b) { - return a ? '@media ' + a.substring(6) + ' and ' + b.substring(6) : b; -} - -function isMediaQuery(key) { - return key.indexOf('@media') === 0; -} - -function isSupports(key) { - return key.indexOf('@supports') === 0; -} - -function joinSupports(a, b) { - return a ? '@supports ' + a.substring(9) + ' and ' + b.substring(9) : b; -} - -// flatten a nested array -function flatten(inArr) { - var arr = []; - for (var i = 0; i < inArr.length; i++) { - if (Array.isArray(inArr[i])) arr = arr.concat(flatten(inArr[i]));else arr = arr.concat(inArr[i]); - } - return arr; -} - -var prefixedPseudoSelectors = { - '::placeholder': ['::-webkit-input-placeholder', '::-moz-placeholder', '::-ms-input-placeholder'], - ':fullscreen': [':-webkit-full-screen', ':-moz-full-screen', ':-ms-fullscreen'] - - // mutable! modifies dest. -};function build(dest, _ref2) { - var _ref2$selector = _ref2.selector, - selector = _ref2$selector === undefined ? '' : _ref2$selector, - _ref2$mq = _ref2.mq, - mq = _ref2$mq === undefined ? '' : _ref2$mq, - _ref2$supp = _ref2.supp, - supp = _ref2$supp === undefined ? '' : _ref2$supp, - _ref2$src = _ref2.src, - src = _ref2$src === undefined ? {} : _ref2$src; - - - if (!Array.isArray(src)) { - src = [src]; - } - src = flatten(src); - - src.forEach(function (_src) { - if (isLikeRule(_src)) { - var reg = _getRegistered(_src); - if (reg.type !== 'css') { - throw new Error('cannot merge this rule'); - } - _src = reg.style; - } - _src = (0, _clean2.default)(_src); - if (_src && _src.composes) { - build(dest, { selector: selector, mq: mq, supp: supp, src: _src.composes }); - } - Object.keys(_src || {}).forEach(function (key) { - if (isSelector(key)) { - - if (prefixedPseudoSelectors[key]) { - prefixedPseudoSelectors[key].forEach(function (p) { - return build(dest, { selector: joinSelectors(selector, p), mq: mq, supp: supp, src: _src[key] }); - }); - } - - build(dest, { selector: joinSelectors(selector, key), mq: mq, supp: supp, src: _src[key] }); - } else if (isMediaQuery(key)) { - build(dest, { selector: selector, mq: joinMediaQueries(mq, key), supp: supp, src: _src[key] }); - } else if (isSupports(key)) { - build(dest, { selector: selector, mq: mq, supp: joinSupports(supp, key), src: _src[key] }); - } else if (key === 'composes') { - // ignore, we already dealth with it - } else { - var _dest = dest; - if (supp) { - _dest[supp] = _dest[supp] || {}; - _dest = _dest[supp]; - } - if (mq) { - _dest[mq] = _dest[mq] || {}; - _dest = _dest[mq]; - } - if (selector) { - _dest[selector] = _dest[selector] || {}; - _dest = _dest[selector]; - } - - if (key === 'label') { - if (hasLabels) { - dest.label = dest.label.concat(_src.label); - } - } else { - _dest[key] = _src[key]; - } - } - }); - }); -} - -function _css(rules) { - var style = { label: [] }; - build(style, { src: rules }); // mutative! but worth it. - - var spec = { - id: hashify(style), - style: style, label: hasLabels ? style.label.join('.') : '', - type: 'css' - }; - return toRule(spec); -} - -var nullrule = { - // 'data-css-nil': '' -}; -Object.defineProperty(nullrule, 'toString', { - enumerable: false, value: function value() { - return 'css-nil'; - } -}); - -var inputCaches = typeof WeakMap !== 'undefined' ? [nullrule, new WeakMap(), new WeakMap(), new WeakMap()] : [nullrule]; - -var warnedWeakMapError = false; -function multiIndexCache(fn) { - return function (args) { - if (inputCaches[args.length]) { - var coi = inputCaches[args.length]; - var ctr = 0; - while (ctr < args.length - 1) { - if (!coi.has(args[ctr])) { - coi.set(args[ctr], new WeakMap()); - } - coi = coi.get(args[ctr]); - ctr++; - } - if (coi.has(args[args.length - 1])) { - var ret = coi.get(args[ctr]); - - if (registered[ret.toString().substring(4)]) { - // make sure it hasn't been flushed - return ret; - } - } - } - var value = fn(args); - if (inputCaches[args.length]) { - var _ctr = 0, - _coi = inputCaches[args.length]; - while (_ctr < args.length - 1) { - _coi = _coi.get(args[_ctr]); - _ctr++; - } - try { - _coi.set(args[_ctr], value); - } catch (err) { - if (isDev && !warnedWeakMapError) { - var _console; - - warnedWeakMapError = true; - (_console = console).warn.apply(_console, ['failed setting the WeakMap cache for args:'].concat(_toConsumableArray(args))); // eslint-disable-line no-console - console.warn('this should NOT happen, please file a bug on the github repo.'); // eslint-disable-line no-console - } - } - } - return value; - }; -} - -var cachedCss = typeof WeakMap !== 'undefined' ? multiIndexCache(_css) : _css; - -function css() { - for (var _len2 = arguments.length, rules = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - rules[_key2] = arguments[_key2]; - } - - if (rules[0] && rules[0].length && rules[0].raw) { - throw new Error('you forgot to include glamor/babel in your babel plugins.'); - } - - rules = (0, _clean2.default)(rules); - if (!rules) { - return nullrule; - } - - return cachedCss(rules); -} - -css.insert = function (css) { - var spec = { - id: hashify(css), - css: css, - type: 'raw' - }; - register(spec); - if (!inserted[spec.id]) { - styleSheet.insert(spec.css); - inserted[spec.id] = isBrowser ? true : [spec.css]; - } -}; - -var insertRule = exports.insertRule = css.insert; - -css.global = function (selector, style) { - style = (0, _clean2.default)(style); - if (style) { - return css.insert(toCSS({ selector: selector, style: style })); - } -}; - -var insertGlobal = exports.insertGlobal = css.global; - -function insertKeyframe(spec) { - if (!inserted[spec.id]) { - var inner = Object.keys(spec.keyframes).map(function (kf) { - var result = plugins.keyframes.transform({ id: spec.id, name: kf, style: spec.keyframes[kf] }); - return result.name + '{' + (0, _CSSPropertyOperations.createMarkupForStyles)(result.style) + '}'; - }).join(''); - - var rules = ['-webkit-', '-moz-', '-o-', ''].map(function (prefix) { - return '@' + prefix + 'keyframes ' + (spec.name + '_' + spec.id) + '{' + inner + '}'; - }); - rules.forEach(function (rule) { - return styleSheet.insert(rule); - }); - - inserted[spec.id] = isBrowser ? true : rules; - } -} -css.keyframes = function (name, kfs) { - if (!kfs) { - kfs = name, name = 'animation'; - } - - // do not ignore empty keyframe definitions for now. - kfs = (0, _clean2.default)(kfs) || {}; - var spec = { - id: hashify({ name: name, kfs: kfs }), - type: 'keyframes', - name: name, - keyframes: kfs - }; - register(spec); - insertKeyframe(spec); - return name + '_' + spec.id; -}; - -// we don't go all out for fonts as much, giving a simple font loading strategy -// use a fancier lib if you need moar power -css.fontFace = function (font) { - font = (0, _clean2.default)(font); - var spec = { - id: hashify(font), - type: 'font-face', - font: font - }; - register(spec); - insertFontFace(spec); - - return font.fontFamily; -}; - -var fontFace = exports.fontFace = css.fontFace; -var keyframes = exports.keyframes = css.keyframes; - -function insertFontFace(spec) { - if (!inserted[spec.id]) { - var rule = '@font-face{' + (0, _CSSPropertyOperations.createMarkupForStyles)(spec.font) + '}'; - styleSheet.insert(rule); - inserted[spec.id] = isBrowser ? true : [rule]; - } -} - -// rehydrate the insertion cache with ids sent from -// renderStatic / renderStaticOptimized -function rehydrate(ids) { - // load up ids - (0, _objectAssign2.default)(inserted, ids.reduce(function (o, i) { - return o[i] = true, o; - }, {})); - // assume css loaded separately -} - -// clears out the cache and empties the stylesheet -// best for tests, though there might be some value for SSR. - -function flush() { - inserted = styleSheet.inserted = {}; - registered = styleSheet.registered = {}; - ruleCache = {}; - styleSheet.flush(); - styleSheet.inject(); -} - -var presets = exports.presets = { - mobile: '(min-width: 400px)', - Mobile: '@media (min-width: 400px)', - phablet: '(min-width: 550px)', - Phablet: '@media (min-width: 550px)', - tablet: '(min-width: 750px)', - Tablet: '@media (min-width: 750px)', - desktop: '(min-width: 1000px)', - Desktop: '@media (min-width: 1000px)', - hd: '(min-width: 1200px)', - Hd: '@media (min-width: 1200px)' -}; - -var style = exports.style = css; - -function select(selector) { - for (var _len3 = arguments.length, styles = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { - styles[_key3 - 1] = arguments[_key3]; - } - - if (!selector) { - return style(styles); - } - return css(_defineProperty({}, selector, styles)); -} -var $ = exports.$ = select; - -function parent(selector) { - for (var _len4 = arguments.length, styles = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { - styles[_key4 - 1] = arguments[_key4]; - } - - return css(_defineProperty({}, selector + ' &', styles)); -} - -var merge = exports.merge = css; -var compose = exports.compose = css; - -function media(query) { - for (var _len5 = arguments.length, rules = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { - rules[_key5 - 1] = arguments[_key5]; - } - - return css(_defineProperty({}, '@media ' + query, rules)); -} - -function pseudo(selector) { - for (var _len6 = arguments.length, styles = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) { - styles[_key6 - 1] = arguments[_key6]; - } - - return css(_defineProperty({}, selector, styles)); -} - -// allllll the pseudoclasses - -function active(x) { - return pseudo(':active', x); -} - -function any(x) { - return pseudo(':any', x); -} - -function checked(x) { - return pseudo(':checked', x); -} - -function disabled(x) { - return pseudo(':disabled', x); -} - -function empty(x) { - return pseudo(':empty', x); -} - -function enabled(x) { - return pseudo(':enabled', x); -} - -function _default(x) { - return pseudo(':default', x); // note '_default' name -} - -function first(x) { - return pseudo(':first', x); -} - -function firstChild(x) { - return pseudo(':first-child', x); -} - -function firstOfType(x) { - return pseudo(':first-of-type', x); -} - -function fullscreen(x) { - return pseudo(':fullscreen', x); -} - -function focus(x) { - return pseudo(':focus', x); -} - -function hover(x) { - return pseudo(':hover', x); -} - -function indeterminate(x) { - return pseudo(':indeterminate', x); -} - -function inRange(x) { - return pseudo(':in-range', x); -} - -function invalid(x) { - return pseudo(':invalid', x); -} - -function lastChild(x) { - return pseudo(':last-child', x); -} - -function lastOfType(x) { - return pseudo(':last-of-type', x); -} - -function left(x) { - return pseudo(':left', x); -} - -function link(x) { - return pseudo(':link', x); -} - -function onlyChild(x) { - return pseudo(':only-child', x); -} - -function onlyOfType(x) { - return pseudo(':only-of-type', x); -} - -function optional(x) { - return pseudo(':optional', x); -} - -function outOfRange(x) { - return pseudo(':out-of-range', x); -} - -function readOnly(x) { - return pseudo(':read-only', x); -} - -function readWrite(x) { - return pseudo(':read-write', x); -} - -function required(x) { - return pseudo(':required', x); -} - -function right(x) { - return pseudo(':right', x); -} - -function root(x) { - return pseudo(':root', x); -} - -function scope(x) { - return pseudo(':scope', x); -} - -function target(x) { - return pseudo(':target', x); -} - -function valid(x) { - return pseudo(':valid', x); -} - -function visited(x) { - return pseudo(':visited', x); -} - -// parameterized pseudoclasses -function dir(p, x) { - return pseudo(':dir(' + p + ')', x); -} -function lang(p, x) { - return pseudo(':lang(' + p + ')', x); -} -function not(p, x) { - // should this be a plugin? - var selector = p.split(',').map(function (x) { - return x.trim(); - }).map(function (x) { - return ':not(' + x + ')'; - }); - if (selector.length === 1) { - return pseudo(':not(' + p + ')', x); - } - return select(selector.join(''), x); -} -function nthChild(p, x) { - return pseudo(':nth-child(' + p + ')', x); -} -function nthLastChild(p, x) { - return pseudo(':nth-last-child(' + p + ')', x); -} -function nthLastOfType(p, x) { - return pseudo(':nth-last-of-type(' + p + ')', x); -} -function nthOfType(p, x) { - return pseudo(':nth-of-type(' + p + ')', x); -} - -// pseudoelements -function after(x) { - return pseudo('::after', x); -} -function before(x) { - return pseudo('::before', x); -} -function firstLetter(x) { - return pseudo('::first-letter', x); -} -function firstLine(x) { - return pseudo('::first-line', x); -} -function selection(x) { - return pseudo('::selection', x); -} -function backdrop(x) { - return pseudo('::backdrop', x); -} -function placeholder(x) { - // https://github.com/threepointone/glamor/issues/14 - return css({ '::placeholder': x }); -} - -/*** helpers for web components ***/ -// https://github.com/threepointone/glamor/issues/16 - -function cssFor() { - for (var _len7 = arguments.length, rules = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { - rules[_key7] = arguments[_key7]; - } - - rules = (0, _clean2.default)(rules); - return rules ? rules.map(function (r) { - var style = { label: [] }; - build(style, { src: r }); // mutative! but worth it. - return deconstructedStyleToCSS(hashify(style), deconstruct(style)).join(''); - }).join('') : ''; -} - -function attribsFor() { - for (var _len8 = arguments.length, rules = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { - rules[_key8] = arguments[_key8]; - } - - rules = (0, _clean2.default)(rules); - var htmlAttributes = rules ? rules.map(function (rule) { - idFor(rule); // throwaway check for rule - var key = Object.keys(rule)[0], - value = rule[key]; - return key + '="' + (value || '') + '"'; - }).join(' ') : ''; - - return htmlAttributes; -} - -/***/ }), -/* 471 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.StyleSheet = StyleSheet; - -var _objectAssign = __webpack_require__(7); - -var _objectAssign2 = _interopRequireDefault(_objectAssign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -/* - -high performance StyleSheet for css-in-js systems - -- uses multiple style tags behind the scenes for millions of rules -- uses `insertRule` for appending in production for *much* faster performance -- 'polyfills' on server side - - -// usage - -import StyleSheet from 'glamor/lib/sheet' -let styleSheet = new StyleSheet() - -styleSheet.inject() -- 'injects' the stylesheet into the page (or into memory if on server) - -styleSheet.insert('#box { border: 1px solid red; }') -- appends a css rule into the stylesheet - -styleSheet.flush() -- empties the stylesheet of all its contents - - -*/ - -function last(arr) { - return arr[arr.length - 1]; -} - -function sheetForTag(tag) { - if (tag.sheet) { - return tag.sheet; - } - - // this weirdness brought to you by firefox - for (var i = 0; i < document.styleSheets.length; i++) { - if (document.styleSheets[i].ownerNode === tag) { - return document.styleSheets[i]; - } - } -} - -var isBrowser = typeof window !== 'undefined'; -var isDev = "development" === 'development' || !"development"; //(x => (x === 'development') || !x)(process.env.NODE_ENV) -var isTest = "development" === 'test'; - -var oldIE = function () { - if (isBrowser) { - var div = document.createElement('div'); - div.innerHTML = '<!--[if lt IE 10]><i></i><![endif]-->'; - return div.getElementsByTagName('i').length === 1; - } -}(); - -function makeStyleTag() { - var tag = document.createElement('style'); - tag.type = 'text/css'; - tag.setAttribute('data-glamor', ''); - tag.appendChild(document.createTextNode('')); - (document.head || document.getElementsByTagName('head')[0]).appendChild(tag); - return tag; -} - -function StyleSheet() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$speedy = _ref.speedy, - speedy = _ref$speedy === undefined ? !isDev && !isTest : _ref$speedy, - _ref$maxLength = _ref.maxLength, - maxLength = _ref$maxLength === undefined ? isBrowser && oldIE ? 4000 : 65000 : _ref$maxLength; - - this.isSpeedy = speedy; // the big drawback here is that the css won't be editable in devtools - this.sheet = undefined; - this.tags = []; - this.maxLength = maxLength; - this.ctr = 0; -} - -(0, _objectAssign2.default)(StyleSheet.prototype, { - getSheet: function getSheet() { - return sheetForTag(last(this.tags)); - }, - inject: function inject() { - var _this = this; - - if (this.injected) { - throw new Error('already injected stylesheet!'); - } - if (isBrowser) { - this.tags[0] = makeStyleTag(); - } else { - // server side 'polyfill'. just enough behavior to be useful. - this.sheet = { - cssRules: [], - insertRule: function insertRule(rule) { - // enough 'spec compliance' to be able to extract the rules later - // in other words, just the cssText field - _this.sheet.cssRules.push({ cssText: rule }); - } - }; - } - this.injected = true; - }, - speedy: function speedy(bool) { - if (this.ctr !== 0) { - throw new Error('cannot change speedy mode after inserting any rule to sheet. Either call speedy(' + bool + ') earlier in your app, or call flush() before speedy(' + bool + ')'); - } - this.isSpeedy = !!bool; - }, - _insert: function _insert(rule) { - // this weirdness for perf, and chrome's weird bug - // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule - try { - var sheet = this.getSheet(); - sheet.insertRule(rule, rule.indexOf('@import') !== -1 ? 0 : sheet.cssRules.length); - } catch (e) { - if (isDev) { - // might need beter dx for this - console.warn('whoops, illegal rule inserted', rule); //eslint-disable-line no-console - } - } - }, - insert: function insert(rule) { - - if (isBrowser) { - // this is the ultrafast version, works across browsers - if (this.isSpeedy && this.getSheet().insertRule) { - this._insert(rule); - } - // more browser weirdness. I don't even know - // else if(this.tags.length > 0 && this.tags::last().styleSheet) { - // this.tags::last().styleSheet.cssText+= rule - // } - else { - if (rule.indexOf('@import') !== -1) { - var tag = last(this.tags); - tag.insertBefore(document.createTextNode(rule), tag.firstChild); - } else { - last(this.tags).appendChild(document.createTextNode(rule)); - } - } - } else { - // server side is pretty simple - this.sheet.insertRule(rule, rule.indexOf('@import') !== -1 ? 0 : this.sheet.cssRules.length); - } - - this.ctr++; - if (isBrowser && this.ctr % this.maxLength === 0) { - this.tags.push(makeStyleTag()); - } - return this.ctr - 1; - }, - - // commenting this out till we decide on v3's decision - // _replace(index, rule) { - // // this weirdness for perf, and chrome's weird bug - // // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule - // try { - // let sheet = this.getSheet() - // sheet.deleteRule(index) // todo - correct index here - // sheet.insertRule(rule, index) - // } - // catch(e) { - // if(isDev) { - // // might need beter dx for this - // console.warn('whoops, problem replacing rule', rule) //eslint-disable-line no-console - // } - // } - - // } - // replace(index, rule) { - // if(isBrowser) { - // if(this.isSpeedy && this.getSheet().insertRule) { - // this._replace(index, rule) - // } - // else { - // let _slot = Math.floor((index + this.maxLength) / this.maxLength) - 1 - // let _index = (index % this.maxLength) + 1 - // let tag = this.tags[_slot] - // tag.replaceChild(document.createTextNode(rule), tag.childNodes[_index]) - // } - // } - // else { - // let rules = this.sheet.cssRules - // this.sheet.cssRules = [ ...rules.slice(0, index), { cssText: rule }, ...rules.slice(index + 1) ] - // } - // } - delete: function _delete(index) { - // we insert a blank rule when 'deleting' so previously returned indexes remain stable - return this.replace(index, ''); - }, - flush: function flush() { - if (isBrowser) { - this.tags.forEach(function (tag) { - return tag.parentNode.removeChild(tag); - }); - this.tags = []; - this.sheet = null; - this.ctr = 0; - // todo - look for remnants in document.styleSheets - } else { - // simpler on server - this.sheet.cssRules = []; - } - this.injected = false; - }, - rules: function rules() { - if (!isBrowser) { - return this.sheet.cssRules; - } - var arr = []; - this.tags.forEach(function (tag) { - return arr.splice.apply(arr, [arr.length, 0].concat(_toConsumableArray(Array.from(sheetForTag(tag).cssRules)))); - }); - return arr; - } -}); - -/***/ }), -/* 472 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _CSSProperty = __webpack_require__(473); - -var _CSSProperty2 = _interopRequireDefault(_CSSProperty); - -var _warning = __webpack_require__(2); - -var _warning2 = _interopRequireDefault(_warning); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule dangerousStyleValue - */ - -var isUnitlessNumber = _CSSProperty2.default.isUnitlessNumber; -var styleWarnings = {}; - -/** - * Convert a value into the proper css writable value. The style name `name` - * should be logical (no hyphens), as specified - * in `CSSProperty.isUnitlessNumber`. - * - * @param {string} name CSS property name such as `topMargin`. - * @param {*} value CSS property value such as `10px`. - * @param {ReactDOMComponent} component - * @return {string} Normalized style value with dimensions applied. - */ -function dangerousStyleValue(name, value, component) { - // Note that we've removed escapeTextForBrowser() calls here since the - // whole string will be escaped when the attribute is injected into - // the markup. If you provide unsafe user data here they can inject - // arbitrary CSS which may be problematic (I couldn't repro this): - // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet - // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ - // This is not an XSS hole but instead a potential CSS injection issue - // which has lead to a greater discussion about how we're going to - // trust URLs moving forward. See #2115901 - - var isEmpty = value == null || typeof value === 'boolean' || value === ''; - if (isEmpty) { - return ''; - } - - var isNonNumeric = isNaN(value); - if (isNonNumeric || value === 0 || isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name]) { - return '' + value; // cast to string - } - - if (typeof value === 'string') { - if (true) { - // Allow '0' to pass through without warning. 0 is already special and - // doesn't require units, so we don't need to warn about it. - if (component && value !== '0') { - var owner = component._currentElement._owner; - var ownerName = owner ? owner.getName() : null; - if (ownerName && !styleWarnings[ownerName]) { - styleWarnings[ownerName] = {}; - } - var warned = false; - if (ownerName) { - var warnings = styleWarnings[ownerName]; - warned = warnings[name]; - if (!warned) { - warnings[name] = true; - } - } - if (!warned) { - true ? (0, _warning2.default)(false, 'a `%s` tag (owner: `%s`) was passed a numeric string value ' + 'for CSS property `%s` (value: `%s`) which will be treated ' + 'as a unitless number in a future version of React.', component._currentElement.type, ownerName || 'unknown', name, value) : void 0; - } - } - } - value = value.trim(); - } - return value + 'px'; -} - -exports.default = dangerousStyleValue; - -/***/ }), -/* 473 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -/** - * Copyright 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @providesModule CSSProperty - */ - -/** - * CSS properties which accept numbers but are not in units of "px". - */ - -var isUnitlessNumber = { - animationIterationCount: true, - borderImageOutset: true, - borderImageSlice: true, - borderImageWidth: true, - boxFlex: true, - boxFlexGroup: true, - boxOrdinalGroup: true, - columnCount: true, - flex: true, - flexGrow: true, - flexPositive: true, - flexShrink: true, - flexNegative: true, - flexOrder: true, - gridRow: true, - gridRowStart: true, - gridRowEnd: true, - gridColumn: true, - gridColumnStart: true, - gridColumnEnd: true, - fontWeight: true, - lineClamp: true, - lineHeight: true, - opacity: true, - order: true, - orphans: true, - tabSize: true, - widows: true, - zIndex: true, - zoom: true, - - // SVG-related properties - fillOpacity: true, - floodOpacity: true, - stopOpacity: true, - strokeDasharray: true, - strokeDashoffset: true, - strokeMiterlimit: true, - strokeOpacity: true, - strokeWidth: true - - /** - * @param {string} prefix vendor-specific prefix, eg: Webkit - * @param {string} key style name, eg: transitionDuration - * @return {string} style name prefixed with `prefix`, properly camelCased, eg: - * WebkitTransitionDuration - */ -};function prefixKey(prefix, key) { - return prefix + key.charAt(0).toUpperCase() + key.substring(1); -} - -/** - * Support style names that may come passed in prefixed by adding permutations - * of vendor prefixes. - */ -var prefixes = ['Webkit', 'ms', 'Moz', 'O']; - -// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an -// infinite loop, because it iterates over the newly added props too. -Object.keys(isUnitlessNumber).forEach(function (prop) { - prefixes.forEach(function (prefix) { - isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; - }); -}); - -/** - * Most style properties can be unset by doing .style[prop] = '' but IE8 - * doesn't like doing that with shorthand properties so for the properties that - * IE8 breaks on, which are listed here, we instead unset each of the - * individual properties. See http://bugs.jquery.com/ticket/12385. - * The 4-value 'clock' properties like margin, padding, border-width seem to - * behave without any problems. Curiously, list-style works too without any - * special prodding. - */ -var shorthandPropertyExpansions = { - background: { - backgroundAttachment: true, - backgroundColor: true, - backgroundImage: true, - backgroundPositionX: true, - backgroundPositionY: true, - backgroundRepeat: true - }, - backgroundPosition: { - backgroundPositionX: true, - backgroundPositionY: true - }, - border: { - borderWidth: true, - borderStyle: true, - borderColor: true - }, - borderBottom: { - borderBottomWidth: true, - borderBottomStyle: true, - borderBottomColor: true - }, - borderLeft: { - borderLeftWidth: true, - borderLeftStyle: true, - borderLeftColor: true - }, - borderRight: { - borderRightWidth: true, - borderRightStyle: true, - borderRightColor: true - }, - borderTop: { - borderTopWidth: true, - borderTopStyle: true, - borderTopColor: true - }, - font: { - fontStyle: true, - fontVariant: true, - fontWeight: true, - fontSize: true, - lineHeight: true, - fontFamily: true - }, - outline: { - outlineWidth: true, - outlineStyle: true, - outlineColor: true - } -}; - -var CSSProperty = { - isUnitlessNumber: isUnitlessNumber, - shorthandPropertyExpansions: shorthandPropertyExpansions -}; - -exports.default = CSSProperty; - -/***/ }), -/* 474 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -exports.default = clean; -// Returns true for null, false, undefined and {} -function isFalsy(value) { - return value === null || value === undefined || value === false || (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && Object.keys(value).length === 0; -} - -function cleanObject(object) { - if (isFalsy(object)) return null; - if ((typeof object === 'undefined' ? 'undefined' : _typeof(object)) !== 'object') return object; - - var acc = {}, - keys = Object.keys(object), - hasFalsy = false; - for (var i = 0; i < keys.length; i++) { - var value = object[keys[i]]; - var filteredValue = clean(value); - if (filteredValue === null || filteredValue !== value) { - hasFalsy = true; - } - if (filteredValue !== null) { - acc[keys[i]] = filteredValue; - } - } - return Object.keys(acc).length === 0 ? null : hasFalsy ? acc : object; -} - -function cleanArray(rules) { - var hasFalsy = false; - var filtered = []; - rules.forEach(function (rule) { - var filteredRule = clean(rule); - if (filteredRule === null || filteredRule !== rule) { - hasFalsy = true; - } - if (filteredRule !== null) { - filtered.push(filteredRule); - } - }); - return filtered.length == 0 ? null : hasFalsy ? filtered : rules; -} - -// Takes style array or object provided by user and clears all the falsy data -// If there is no styles left after filtration returns null -function clean(input) { - return Array.isArray(input) ? cleanArray(input) : cleanObject(input); -} - -/***/ }), -/* 475 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -exports.PluginSet = PluginSet; -exports.fallbacks = fallbacks; -exports.contentWrap = contentWrap; -exports.prefixes = prefixes; - -var _objectAssign = __webpack_require__(7); - -var _objectAssign2 = _interopRequireDefault(_objectAssign); - -var _CSSPropertyOperations = __webpack_require__(211); - -var _prefixer = __webpack_require__(476); - -var _prefixer2 = _interopRequireDefault(_prefixer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var isDev = function (x) { - return x === 'development' || !x; -}("development"); - -function PluginSet(initial) { - this.fns = initial || []; -} - -(0, _objectAssign2.default)(PluginSet.prototype, { - add: function add() { - var _this = this; - - for (var _len = arguments.length, fns = Array(_len), _key = 0; _key < _len; _key++) { - fns[_key] = arguments[_key]; - } - - fns.forEach(function (fn) { - if (_this.fns.indexOf(fn) >= 0) { - if (isDev) { - console.warn('adding the same plugin again, ignoring'); //eslint-disable-line no-console - } - } else { - _this.fns = [fn].concat(_this.fns); - } - }); - }, - remove: function remove(fn) { - this.fns = this.fns.filter(function (x) { - return x !== fn; - }); - }, - clear: function clear() { - this.fns = []; - }, - transform: function transform(o) { - return this.fns.reduce(function (o, fn) { - return fn(o); - }, o); - } -}); - -function fallbacks(node) { - var hasArray = Object.keys(node.style).map(function (x) { - return Array.isArray(node.style[x]); - }).indexOf(true) >= 0; - if (hasArray) { - var style = node.style; - - var flattened = Object.keys(style).reduce(function (o, key) { - o[key] = Array.isArray(style[key]) ? style[key].join('; ' + (0, _CSSPropertyOperations.processStyleName)(key) + ': ') : style[key]; - return o; - }, {}); - // todo - - // flatten arrays which haven't been flattened yet - return (0, _objectAssign2.default)({}, node, { style: flattened }); - } - return node; -} - -var contentValues = ['normal', 'none', 'counter', 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', 'initial', 'inherit']; - -function contentWrap(node) { - if (node.style.content) { - var cont = node.style.content; - if (contentValues.indexOf(cont) >= 0) { - return node; - } - if (/^(attr|calc|counters?|url)\(/.test(cont)) { - return node; - } - if (cont.charAt(0) === cont.charAt(cont.length - 1) && (cont.charAt(0) === '"' || cont.charAt(0) === "'")) { - return node; - } - return _extends({}, node, { style: _extends({}, node.style, { content: '"' + cont + '"' }) }); - } - return node; -} - -function prefixes(node) { - return (0, _objectAssign2.default)({}, node, { style: (0, _prefixer2.default)(_extends({}, node.style)) }); -} - -/***/ }), -/* 476 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = prefixer; - -var _staticData = __webpack_require__(230); - -var _staticData2 = _interopRequireDefault(_staticData); - -var _prefixProperty = __webpack_require__(229); - -var _prefixProperty2 = _interopRequireDefault(_prefixProperty); - -var _prefixValue = __webpack_require__(209); - -var _prefixValue2 = _interopRequireDefault(_prefixValue); - -var _cursor = __webpack_require__(231); - -var _cursor2 = _interopRequireDefault(_cursor); - -var _crossFade = __webpack_require__(232); - -var _crossFade2 = _interopRequireDefault(_crossFade); - -var _filter = __webpack_require__(233); - -var _filter2 = _interopRequireDefault(_filter); - -var _flex = __webpack_require__(234); - -var _flex2 = _interopRequireDefault(_flex); - -var _flexboxOld = __webpack_require__(235); - -var _flexboxOld2 = _interopRequireDefault(_flexboxOld); - -var _gradient = __webpack_require__(236); - -var _gradient2 = _interopRequireDefault(_gradient); - -var _imageSet = __webpack_require__(237); - -var _imageSet2 = _interopRequireDefault(_imageSet); - -var _position = __webpack_require__(238); - -var _position2 = _interopRequireDefault(_position); - -var _sizing = __webpack_require__(239); - -var _sizing2 = _interopRequireDefault(_sizing); - -var _transition = __webpack_require__(240); - -var _transition2 = _interopRequireDefault(_transition); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var plugins = [_crossFade2.default, _cursor2.default, _filter2.default, _flexboxOld2.default, _gradient2.default, _imageSet2.default, _position2.default, _sizing2.default, _transition2.default, _flex2.default]; // custom facade for inline-style-prefixer - -var prefixMap = _staticData2.default.prefixMap; - -function prefixer(style) { - for (var property in style) { - var value = style[property]; - - var processedValue = (0, _prefixValue2.default)(plugins, property, value, style, prefixMap); - - // only modify the value if it was touched - // by any plugin to prevent unnecessary mutations - if (processedValue) { - style[property] = processedValue; - } - - (0, _prefixProperty2.default)(prefixMap, property, style); - } - return style; -} - -/***/ }), -/* 477 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = doHash; -// murmurhash2 via https://gist.github.com/raycmorgan/588423 - -function doHash(str, seed) { - var m = 0x5bd1e995; - var r = 24; - var h = seed ^ str.length; - var length = str.length; - var currentIndex = 0; - - while (length >= 4) { - var k = UInt32(str, currentIndex); - - k = Umul32(k, m); - k ^= k >>> r; - k = Umul32(k, m); - - h = Umul32(h, m); - h ^= k; - - currentIndex += 4; - length -= 4; - } - - switch (length) { - case 3: - h ^= UInt16(str, currentIndex); - h ^= str.charCodeAt(currentIndex + 2) << 16; - h = Umul32(h, m); - break; - - case 2: - h ^= UInt16(str, currentIndex); - h = Umul32(h, m); - break; - - case 1: - h ^= str.charCodeAt(currentIndex); - h = Umul32(h, m); - break; - } - - h ^= h >>> 13; - h = Umul32(h, m); - h ^= h >>> 15; - - return h >>> 0; -} - -function UInt32(str, pos) { - return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8) + (str.charCodeAt(pos++) << 16) + (str.charCodeAt(pos) << 24); -} - -function UInt16(str, pos) { - return str.charCodeAt(pos++) + (str.charCodeAt(pos++) << 8); -} - -function Umul32(n, m) { - n = n | 0; - m = m | 0; - var nlo = n & 0xffff; - var nhi = n >>> 16; - var res = nlo * m + ((nhi * m & 0xffff) << 16) | 0; - return res; -} - -/***/ }), -/* 478 */, -/* 479 */, -/* 480 */, -/* 481 */, -/* 482 */, -/* 483 */, -/* 484 */, -/* 485 */, -/* 486 */, -/* 487 */, -/* 488 */, -/* 489 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(214); -var formats = __webpack_require__(215); - -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { // eslint-disable-line func-name-matching - return prefix + '[]'; - }, - indices: function indices(prefix, key) { // eslint-disable-line func-name-matching - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { // eslint-disable-line func-name-matching - return prefix; - } -}; - -var toISO = Date.prototype.toISOString; - -var defaults = { - delimiter: '&', - encode: true, - encoder: utils.encode, - encodeValuesOnly: false, - serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false -}; - -var stringify = function stringify( // eslint-disable-line func-name-matching - object, - prefix, - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - formatter, - encodeValuesOnly -) { - var obj = object; - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (obj === null) { - if (strictNullHandling) { - return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; - } - - obj = ''; - } - - if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { - if (encoder) { - var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder); - return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))]; - } - return [formatter(prefix) + '=' + formatter(String(obj))]; - } - - var values = []; - - if (typeof obj === 'undefined') { - return values; - } - - var objKeys; - if (Array.isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } - - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (skipNulls && obj[key] === null) { - continue; - } - - if (Array.isArray(obj)) { - values = values.concat(stringify( - obj[key], - generateArrayPrefix(prefix, key), - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - formatter, - encodeValuesOnly - )); - } else { - values = values.concat(stringify( - obj[key], - prefix + (allowDots ? '.' + key : '[' + key + ']'), - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - formatter, - encodeValuesOnly - )); - } - } - - return values; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = opts ? utils.assign({}, opts) : {}; - - if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; - var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; - var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; - var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; - var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder; - var sort = typeof options.sort === 'function' ? options.sort : null; - var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; - var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; - var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly; - if (typeof options.format === 'undefined') { - options.format = formats['default']; - } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { - throw new TypeError('Unknown format option provided.'); - } - var formatter = formats.formatters[options.format]; - var objKeys; - var filter; - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (Array.isArray(options.filter)) { - filter = options.filter; - objKeys = filter; - } - - var keys = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - var arrayFormat; - if (options.arrayFormat in arrayPrefixGenerators) { - arrayFormat = options.arrayFormat; - } else if ('indices' in options) { - arrayFormat = options.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; - } - - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; - - if (!objKeys) { - objKeys = Object.keys(obj); - } - - if (sort) { - objKeys.sort(sort); - } - - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (skipNulls && obj[key] === null) { - continue; - } - - keys = keys.concat(stringify( - obj[key], - key, - generateArrayPrefix, - strictNullHandling, - skipNulls, - encode ? encoder : null, - filter, - sort, - allowDots, - serializeDate, - formatter, - encodeValuesOnly - )); - } - - var joined = keys.join(delimiter); - var prefix = options.addQueryPrefix === true ? '?' : ''; - - return joined.length > 0 ? prefix + joined : ''; -}; - - -/***/ }), -/* 490 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var utils = __webpack_require__(214); - -var has = Object.prototype.hasOwnProperty; - -var defaults = { - allowDots: false, - allowPrototypes: false, - arrayLimit: 20, - decoder: utils.decode, - delimiter: '&', - depth: 5, - parameterLimit: 1000, - plainObjects: false, - strictNullHandling: false -}; - -var parseValues = function parseQueryStringValues(str, options) { - var obj = {}; - var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; - var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; - var parts = cleanStr.split(options.delimiter, limit); - - for (var i = 0; i < parts.length; ++i) { - var part = parts[i]; - - var bracketEqualsPos = part.indexOf(']='); - var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; - - var key, val; - if (pos === -1) { - key = options.decoder(part, defaults.decoder); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos), defaults.decoder); - val = options.decoder(part.slice(pos + 1), defaults.decoder); - } - if (has.call(obj, key)) { - obj[key] = [].concat(obj[key]).concat(val); - } else { - obj[key] = val; - } - } - - return obj; -}; - -var parseObject = function (chain, val, options) { - var leaf = val; - - for (var i = chain.length - 1; i >= 0; --i) { - var obj; - var root = chain[i]; - - if (root === '[]') { - obj = []; - obj = obj.concat(leaf); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; - var index = parseInt(cleanRoot, 10); - if ( - !isNaN(index) - && root !== cleanRoot - && String(index) === cleanRoot - && index >= 0 - && (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = leaf; - } else { - obj[cleanRoot] = leaf; - } - } - - leaf = obj; - } - - return leaf; -}; - -var parseKeys = function parseQueryStringKeys(givenKey, val, options) { - if (!givenKey) { - return; - } - - // Transform dot notation to bracket notation - var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; - - // The regex chunks - - var brackets = /(\[[^[\]]*])/; - var child = /(\[[^[\]]*])/g; - - // Get the parent - - var segment = brackets.exec(key); - var parent = segment ? key.slice(0, segment.index) : key; - - // Stash the parent if it exists - - var keys = []; - if (parent) { - // If we aren't using plain objects, optionally prefix keys - // that would overwrite object prototype properties - if (!options.plainObjects && has.call(Object.prototype, parent)) { - if (!options.allowPrototypes) { - return; - } - } - - keys.push(parent); - } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while ((segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { - if (!options.allowPrototypes) { - return; - } - } - keys.push(segment[1]); - } - - // If there's a remainder, just add whatever is left - - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } - - return parseObject(keys, val, options); -}; - -module.exports = function (str, opts) { - var options = opts ? utils.assign({}, opts) : {}; - - if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } - - options.ignoreQueryPrefix = options.ignoreQueryPrefix === true; - options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; - options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; - options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; - options.parseArrays = options.parseArrays !== false; - options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; - options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; - options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; - options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; - options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; - options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; - - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? Object.create(null) : {}; - } - - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options); - obj = utils.merge(obj, newObj, options); - } - - return utils.compact(obj); -}; - - -/***/ }), -/* 491 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PostmsgTransport = exports.KEY = undefined; - -var _promise = __webpack_require__(492); - -var _promise2 = _interopRequireDefault(_promise); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -exports.default = createChannel; - -var _global = __webpack_require__(85); - -var _channels = __webpack_require__(499); - -var _channels2 = _interopRequireDefault(_channels); - -var _jsonStringifySafe = __webpack_require__(170); - -var _jsonStringifySafe2 = _interopRequireDefault(_jsonStringifySafe); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var KEY = exports.KEY = 'storybook-channel'; /* eslint-disable no-underscore-dangle */ - -var PostmsgTransport = exports.PostmsgTransport = function () { - function PostmsgTransport(config) { - var _this = this; - - (0, _classCallCheck3.default)(this, PostmsgTransport); - - this._config = config; - this._buffer = []; - this._handler = null; - _global.window.addEventListener('message', this._handleEvent.bind(this), false); - _global.document.addEventListener('DOMContentLoaded', function () { - return _this._flush(); - }); - // Check whether the config.page parameter has a valid value - if (config.page !== 'manager' && config.page !== 'preview') { - throw new Error('postmsg-channel: "config.page" cannot be "' + config.page + '"'); - } - } - - (0, _createClass3.default)(PostmsgTransport, [{ - key: 'setHandler', - value: function setHandler(handler) { - this._handler = handler; - } - }, { - key: 'send', - value: function send(event) { - var _this2 = this; - - var iframeWindow = this._getWindow(); - if (!iframeWindow) { - return new _promise2.default(function (resolve, reject) { - _this2._buffer.push({ event: event, resolve: resolve, reject: reject }); - }); - } - var data = (0, _jsonStringifySafe2.default)({ key: KEY, event: event }); - iframeWindow.postMessage(data, '*'); - return _promise2.default.resolve(null); - } - }, { - key: '_flush', - value: function _flush() { - var _this3 = this; - - var buffer = this._buffer; - this._buffer = []; - buffer.forEach(function (item) { - _this3.send(item.event).then(item.resolve).catch(item.reject); - }); - } - }, { - key: '_getWindow', - value: function _getWindow() { - if (this._config.page === 'manager') { - // FIXME this is a really bad idea! use a better way to do this. - // This finds the storybook preview iframe to send messages to. - var iframe = _global.document.getElementById('storybook-preview-iframe'); - if (!iframe) { - return null; - } - return iframe.contentWindow; - } - return _global.window.parent; - } - }, { - key: '_handleEvent', - value: function _handleEvent(rawEvent) { - try { - var data = rawEvent.data; - - var _JSON$parse = JSON.parse(data), - key = _JSON$parse.key, - event = _JSON$parse.event; - - if (key === KEY) { - this._handler(event); - } - } catch (error) {} // eslint-disable-line - } - }]); - return PostmsgTransport; -}(); - -function createChannel(_ref) { - var page = _ref.page; - - var transport = new PostmsgTransport({ page: page }); - return new _channels2.default({ transport: transport }); -} - -/***/ }), -/* 492 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(493), __esModule: true }; - -/***/ }), -/* 493 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(138); -__webpack_require__(54); -__webpack_require__(69); -__webpack_require__(494); -__webpack_require__(497); -__webpack_require__(498); -module.exports = __webpack_require__(10).Promise; - - -/***/ }), -/* 494 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var LIBRARY = __webpack_require__(74); -var global = __webpack_require__(16); -var ctx = __webpack_require__(34); -var classof = __webpack_require__(93); -var $export = __webpack_require__(15); -var isObject = __webpack_require__(28); -var aFunction = __webpack_require__(67); -var anInstance = __webpack_require__(217); -var forOf = __webpack_require__(130); -var speciesConstructor = __webpack_require__(218); -var task = __webpack_require__(219).set; -var microtask = __webpack_require__(496)(); -var newPromiseCapabilityModule = __webpack_require__(131); -var perform = __webpack_require__(220); -var promiseResolve = __webpack_require__(221); -var PROMISE = 'Promise'; -var TypeError = global.TypeError; -var process = global.process; -var $Promise = global[PROMISE]; -var isNode = classof(process) == 'process'; -var empty = function () { /* empty */ }; -var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; -var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; - -var USE_NATIVE = !!function () { - try { - // correct subclassing with @@species support - var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[__webpack_require__(14)('species')] = function (exec) { - exec(empty, empty); - }; - // unhandled rejections tracking support, NodeJS Promise without it fails @@species test - return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; - } catch (e) { /* empty */ } -}(); - -// helpers -var isThenable = function (it) { - var then; - return isObject(it) && typeof (then = it.then) == 'function' ? then : false; -}; -var notify = function (promise, isReject) { - if (promise._n) return; - promise._n = true; - var chain = promise._c; - microtask(function () { - var value = promise._v; - var ok = promise._s == 1; - var i = 0; - var run = function (reaction) { - var handler = ok ? reaction.ok : reaction.fail; - var resolve = reaction.resolve; - var reject = reaction.reject; - var domain = reaction.domain; - var result, then; - try { - if (handler) { - if (!ok) { - if (promise._h == 2) onHandleUnhandled(promise); - promise._h = 1; - } - if (handler === true) result = value; - else { - if (domain) domain.enter(); - result = handler(value); - if (domain) domain.exit(); - } - if (result === reaction.promise) { - reject(TypeError('Promise-chain cycle')); - } else if (then = isThenable(result)) { - then.call(result, resolve, reject); - } else resolve(result); - } else reject(value); - } catch (e) { - reject(e); - } - }; - while (chain.length > i) run(chain[i++]); // variable length - can't use forEach - promise._c = []; - promise._n = false; - if (isReject && !promise._h) onUnhandled(promise); - }); -}; -var onUnhandled = function (promise) { - task.call(global, function () { - var value = promise._v; - var unhandled = isUnhandled(promise); - var result, handler, console; - if (unhandled) { - result = perform(function () { - if (isNode) { - process.emit('unhandledRejection', value, promise); - } else if (handler = global.onunhandledrejection) { - handler({ promise: promise, reason: value }); - } else if ((console = global.console) && console.error) { - console.error('Unhandled promise rejection', value); - } - }); - // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should - promise._h = isNode || isUnhandled(promise) ? 2 : 1; - } promise._a = undefined; - if (unhandled && result.e) throw result.v; - }); -}; -var isUnhandled = function (promise) { - if (promise._h == 1) return false; - var chain = promise._a || promise._c; - var i = 0; - var reaction; - while (chain.length > i) { - reaction = chain[i++]; - if (reaction.fail || !isUnhandled(reaction.promise)) return false; - } return true; -}; -var onHandleUnhandled = function (promise) { - task.call(global, function () { - var handler; - if (isNode) { - process.emit('rejectionHandled', promise); - } else if (handler = global.onrejectionhandled) { - handler({ promise: promise, reason: promise._v }); - } - }); -}; -var $reject = function (value) { - var promise = this; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - promise._v = value; - promise._s = 2; - if (!promise._a) promise._a = promise._c.slice(); - notify(promise, true); -}; -var $resolve = function (value) { - var promise = this; - var then; - if (promise._d) return; - promise._d = true; - promise = promise._w || promise; // unwrap - try { - if (promise === value) throw TypeError("Promise can't be resolved itself"); - if (then = isThenable(value)) { - microtask(function () { - var wrapper = { _w: promise, _d: false }; // wrap - try { - then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); - } catch (e) { - $reject.call(wrapper, e); - } - }); - } else { - promise._v = value; - promise._s = 1; - notify(promise, false); - } - } catch (e) { - $reject.call({ _w: promise, _d: false }, e); // wrap - } -}; - -// constructor polyfill -if (!USE_NATIVE) { - // 25.4.3.1 Promise(executor) - $Promise = function Promise(executor) { - anInstance(this, $Promise, PROMISE, '_h'); - aFunction(executor); - Internal.call(this); - try { - executor(ctx($resolve, this, 1), ctx($reject, this, 1)); - } catch (err) { - $reject.call(this, err); - } - }; - // eslint-disable-next-line no-unused-vars - Internal = function Promise(executor) { - this._c = []; // <- awaiting reactions - this._a = undefined; // <- checked in isUnhandled reactions - this._s = 0; // <- state - this._d = false; // <- done - this._v = undefined; // <- value - this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled - this._n = false; // <- notify - }; - Internal.prototype = __webpack_require__(216)($Promise.prototype, { - // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) - then: function then(onFulfilled, onRejected) { - var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); - reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; - reaction.fail = typeof onRejected == 'function' && onRejected; - reaction.domain = isNode ? process.domain : undefined; - this._c.push(reaction); - if (this._a) this._a.push(reaction); - if (this._s) notify(this, false); - return reaction.promise; - }, - // 25.4.5.1 Promise.prototype.catch(onRejected) - 'catch': function (onRejected) { - return this.then(undefined, onRejected); - } - }); - OwnPromiseCapability = function () { - var promise = new Internal(); - this.promise = promise; - this.resolve = ctx($resolve, promise, 1); - this.reject = ctx($reject, promise, 1); - }; - newPromiseCapabilityModule.f = newPromiseCapability = function (C) { - return C === $Promise || C === Wrapper - ? new OwnPromiseCapability(C) - : newGenericPromiseCapability(C); - }; -} - -$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); -__webpack_require__(68)($Promise, PROMISE); -__webpack_require__(245)(PROMISE); -Wrapper = __webpack_require__(10)[PROMISE]; - -// statics -$export($export.S + $export.F * !USE_NATIVE, PROMISE, { - // 25.4.4.5 Promise.reject(r) - reject: function reject(r) { - var capability = newPromiseCapability(this); - var $$reject = capability.reject; - $$reject(r); - return capability.promise; - } -}); -$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { - // 25.4.4.6 Promise.resolve(x) - resolve: function resolve(x) { - return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); - } -}); -$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(159)(function (iter) { - $Promise.all(iter)['catch'](empty); -})), PROMISE, { - // 25.4.4.1 Promise.all(iterable) - all: function all(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var resolve = capability.resolve; - var reject = capability.reject; - var result = perform(function () { - var values = []; - var index = 0; - var remaining = 1; - forOf(iterable, false, function (promise) { - var $index = index++; - var alreadyCalled = false; - values.push(undefined); - remaining++; - C.resolve(promise).then(function (value) { - if (alreadyCalled) return; - alreadyCalled = true; - values[$index] = value; - --remaining || resolve(values); - }, reject); - }); - --remaining || resolve(values); - }); - if (result.e) reject(result.v); - return capability.promise; - }, - // 25.4.4.4 Promise.race(iterable) - race: function race(iterable) { - var C = this; - var capability = newPromiseCapability(C); - var reject = capability.reject; - var result = perform(function () { - forOf(iterable, false, function (promise) { - C.resolve(promise).then(capability.resolve, reject); - }); - }); - if (result.e) reject(result.v); - return capability.promise; - } -}); - - -/***/ }), -/* 495 */ -/***/ (function(module, exports) { - -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function (fn, args, that) { - var un = that === undefined; - switch (args.length) { - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; - - -/***/ }), -/* 496 */ -/***/ (function(module, exports, __webpack_require__) { - -var global = __webpack_require__(16); -var macrotask = __webpack_require__(219).set; -var Observer = global.MutationObserver || global.WebKitMutationObserver; -var process = global.process; -var Promise = global.Promise; -var isNode = __webpack_require__(57)(process) == 'process'; - -module.exports = function () { - var head, last, notify; - - var flush = function () { - var parent, fn; - if (isNode && (parent = process.domain)) parent.exit(); - while (head) { - fn = head.fn; - head = head.next; - try { - fn(); - } catch (e) { - if (head) notify(); - else last = undefined; - throw e; - } - } last = undefined; - if (parent) parent.enter(); - }; - - // Node.js - if (isNode) { - notify = function () { - process.nextTick(flush); - }; - // browsers with MutationObserver - } else if (Observer) { - var toggle = true; - var node = document.createTextNode(''); - new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new - notify = function () { - node.data = toggle = !toggle; - }; - // environments with maybe non-completely correct, but existent Promise - } else if (Promise && Promise.resolve) { - var promise = Promise.resolve(); - notify = function () { - promise.then(flush); - }; - // for other environments - macrotask based on: - // - setImmediate - // - MessageChannel - // - window.postMessag - // - onreadystatechange - // - setTimeout - } else { - notify = function () { - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; - } - - return function (fn) { - var task = { fn: fn, next: undefined }; - if (last) last.next = task; - if (!head) { - head = task; - notify(); - } last = task; - }; -}; - - -/***/ }), -/* 497 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// https://github.com/tc39/proposal-promise-finally - -var $export = __webpack_require__(15); -var core = __webpack_require__(10); -var global = __webpack_require__(16); -var speciesConstructor = __webpack_require__(218); -var promiseResolve = __webpack_require__(221); - -$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { - var C = speciesConstructor(this, core.Promise || global.Promise); - var isFunction = typeof onFinally == 'function'; - return this.then( - isFunction ? function (x) { - return promiseResolve(C, onFinally()).then(function () { return x; }); - } : onFinally, - isFunction ? function (e) { - return promiseResolve(C, onFinally()).then(function () { throw e; }); - } : onFinally - ); -} }); - - -/***/ }), -/* 498 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// https://github.com/tc39/proposal-promise-try -var $export = __webpack_require__(15); -var newPromiseCapability = __webpack_require__(131); -var perform = __webpack_require__(220); - -$export($export.S, 'Promise', { 'try': function (callbackfn) { - var promiseCapability = newPromiseCapability.f(this); - var result = perform(callbackfn); - (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); - return promiseCapability.promise; -} }); - - -/***/ }), -/* 499 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _toConsumableArray2 = __webpack_require__(47); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _keys = __webpack_require__(45); - -var _keys2 = _interopRequireDefault(_keys); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint no-underscore-dangle: 0 */ - -var Channel = function () { - function Channel(_ref) { - var transport = _ref.transport; - (0, _classCallCheck3.default)(this, Channel); - - this._sender = this._randomId(); - this._transport = transport; - this._transport.setHandler(this._handleEvent.bind(this)); - this._listeners = {}; - } - - (0, _createClass3.default)(Channel, [{ - key: "addListener", - value: function addListener(type, listener) { - this.on(type, listener); - } - }, { - key: "emit", - value: function emit(type) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var event = { type: type, args: args, from: this._sender }; - this._transport.send(event); - } - }, { - key: "eventNames", - value: function eventNames() { - return (0, _keys2.default)(this._listeners); - } - }, { - key: "listenerCount", - value: function listenerCount(type) { - var listeners = this._listeners[type]; - return listeners ? listeners.length : 0; - } - }, { - key: "listeners", - value: function listeners(type) { - return this._listeners[type]; - } - }, { - key: "on", - value: function on(type, listener) { - this._listeners[type] = this._listeners[type] || []; - this._listeners[type].push(listener); - } - }, { - key: "once", - value: function once(type, listener) { - var onceListener = this._onceListener(type, listener); - this.on(type, onceListener); - } - }, { - key: "prependListener", - value: function prependListener(type, listener) { - this._listeners[type] = this._listeners[type] || []; - this._listeners[type].unshift(listener); - } - }, { - key: "prependOnceListener", - value: function prependOnceListener(type, listener) { - var onceListener = this._onceListener(type, listener); - this.prependListener(type, onceListener); - } - }, { - key: "removeAllListeners", - value: function removeAllListeners(type) { - if (!type) { - this._listeners = {}; - } else if (this._listeners[type]) { - delete this._listeners[type]; - } - } - }, { - key: "removeListener", - value: function removeListener(type, listener) { - var listeners = this._listeners[type]; - if (listeners) { - this._listeners[type] = listeners.filter(function (l) { - return l !== listener; - }); - } - } - }, { - key: "_randomId", - value: function _randomId() { - // generates a random 13 character string - return Math.random().toString(16).slice(2); - } - }, { - key: "_handleEvent", - value: function _handleEvent(event) { - var listeners = this._listeners[event.type]; - if (event.from !== this._sender && listeners) { - listeners.forEach(function (fn) { - return fn.apply(undefined, (0, _toConsumableArray3.default)(event.args)); - }); - } - } - }, { - key: "_onceListener", - value: function _onceListener(type, listener) { - var _this = this; - - var onceListener = function onceListener() { - _this.removeListener(type, onceListener); - return listener.apply(undefined, arguments); - }; - return onceListener; - } - }]); - return Channel; -}(); - -exports.default = Channel; - -/***/ }), -/* 500 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.linkTo = exports.action = exports.getStorybook = exports.configure = exports.addDecorator = exports.setAddon = exports.storiesOf = undefined; - -var _utilDeprecate = __webpack_require__(807); - -var _utilDeprecate2 = _interopRequireDefault(_utilDeprecate); - -var _addonActions = __webpack_require__(66); - -var _addonLinks = __webpack_require__(94); - -var _preview = __webpack_require__(560); - -var previewApi = _interopRequireWildcard(_preview); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var storiesOf = exports.storiesOf = previewApi.storiesOf; - -// NOTE export these to keep backwards compatibility -var setAddon = exports.setAddon = previewApi.setAddon; -var addDecorator = exports.addDecorator = previewApi.addDecorator; -var configure = exports.configure = previewApi.configure; -var getStorybook = exports.getStorybook = previewApi.getStorybook; - -var action = exports.action = (0, _utilDeprecate2.default)(_addonActions.action, '@storybook/react action is deprecated. See: https://github.com/storybooks/storybook/tree/master/addons/actions'); - -var linkTo = exports.linkTo = (0, _utilDeprecate2.default)(_addonLinks.linkTo, '@storybook/react linkTo is deprecated. See: https://github.com/storybooks/storybook/tree/master/addons/links'); - -/***/ }), -/* 501 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__splitStringTransformer__ = __webpack_require__(840); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__splitStringTransformer__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zcGxpdFN0cmluZ1RyYW5zZm9ybWVyL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0IsMEI7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9zcGxpdFN0cmluZ1RyYW5zZm9ybWVyJ1xuIl19 - -/***/ }), -/* 502 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__html__ = __webpack_require__(851); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__html__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9odG1sL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0IsUTtxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL2h0bWwnXG4iXX0= - -/***/ }), -/* 503 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// currently used to initiate the velocity style object to 0 - - -exports.__esModule = true; -exports['default'] = mapToZero; - -function mapToZero(obj) { - var ret = {}; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - ret[key] = 0; - } - } - return ret; -} - -module.exports = exports['default']; - -/***/ }), -/* 504 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// stepper is used a lot. Saves allocation to return the same array wrapper. -// This is fine and danger-free against mutations because the callsite -// immediately destructures it and gets the numbers inside without passing the - - -exports.__esModule = true; -exports["default"] = stepper; - -var reusedTuple = [0, 0]; - -function stepper(secondPerFrame, x, v, destX, k, b, precision) { - // Spring stiffness, in kg / s^2 - - // for animations, destX is really spring length (spring at rest). initial - // position is considered as the stretched/compressed position of a spring - var Fspring = -k * (x - destX); - - // Damping, in kg / s - var Fdamper = -b * v; - - // usually we put mass here, but for animation purposes, specifying mass is a - // bit redundant. you could simply adjust k and b accordingly - // let a = (Fspring + Fdamper) / mass; - var a = Fspring + Fdamper; - - var newV = v + a * secondPerFrame; - var newX = x + newV * secondPerFrame; - - if (Math.abs(newV) < precision && Math.abs(newX - destX) < precision) { - reusedTuple[0] = destX; - reusedTuple[1] = 0; - return reusedTuple; - } - - reusedTuple[0] = newX; - reusedTuple[1] = newV; - return reusedTuple; -} - -module.exports = exports["default"]; -// array reference around. - -/***/ }), -/* 505 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.7.1 -(function() { - var getNanoSeconds, hrtime, loadTime; - - if ((typeof performance !== "undefined" && performance !== null) && performance.now) { - module.exports = function() { - return performance.now(); - }; - } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { - module.exports = function() { - return (getNanoSeconds() - loadTime) / 1e6; - }; - hrtime = process.hrtime; - getNanoSeconds = function() { - var hr; - hr = hrtime(); - return hr[0] * 1e9 + hr[1]; - }; - loadTime = getNanoSeconds(); - } else if (Date.now) { - module.exports = function() { - return Date.now() - loadTime; - }; - loadTime = Date.now(); - } else { - module.exports = function() { - return new Date().getTime() - loadTime; - }; - loadTime = new Date().getTime(); - } - -}).call(this); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(44))) - -/***/ }), -/* 506 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {var now = __webpack_require__(891) - , root = typeof window === 'undefined' ? global : window - , vendors = ['moz', 'webkit'] - , suffix = 'AnimationFrame' - , raf = root['request' + suffix] - , caf = root['cancel' + suffix] || root['cancelRequest' + suffix] - -for(var i = 0; !raf && i < vendors.length; i++) { - raf = root[vendors[i] + 'Request' + suffix] - caf = root[vendors[i] + 'Cancel' + suffix] - || root[vendors[i] + 'CancelRequest' + suffix] -} - -// Some versions of FF have rAF but not cAF -if(!raf || !caf) { - var last = 0 - , id = 0 - , queue = [] - , frameDuration = 1000 / 60 - - raf = function(callback) { - if(queue.length === 0) { - var _now = now() - , next = Math.max(0, frameDuration - (_now - last)) - last = next + _now - setTimeout(function() { - var cp = queue.slice(0) - // Clear queue here to prevent - // callbacks from appending listeners - // to the current frame's queue - queue.length = 0 - for(var i = 0; i < cp.length; i++) { - if(!cp[i].cancelled) { - try{ - cp[i].callback(last) - } catch(e) { - setTimeout(function() { throw e }, 0) - } - } - } - }, Math.round(next)) - } - queue.push({ - handle: ++id, - callback: callback, - cancelled: false - }) - return id - } - - caf = function(handle) { - for(var i = 0; i < queue.length; i++) { - if(queue[i].handle === handle) { - queue[i].cancelled = true - } - } - } -} - -module.exports = function(fn) { - // Wrap in a new function to prevent - // `cancel` potentially being assigned - // to the native rAF function - return raf.call(root, fn) -} -module.exports.cancel = function() { - caf.apply(root, arguments) -} -module.exports.polyfill = function(object) { - if (!object) { - object = root; - } - object.requestAnimationFrame = raf - object.cancelAnimationFrame = caf -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22))) - -/***/ }), -/* 507 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// usage assumption: currentStyle values have already been rendered but it says -// nothing of whether currentStyle is stale (see unreadPropStyle) - - -exports.__esModule = true; -exports['default'] = shouldStopAnimation; - -function shouldStopAnimation(currentStyle, style, currentVelocity) { - for (var key in style) { - if (!Object.prototype.hasOwnProperty.call(style, key)) { - continue; - } - - if (currentVelocity[key] !== 0) { - return false; - } - - var styleValue = typeof style[key] === 'number' ? style[key] : style[key].val; - // stepper will have already taken care of rounding precision errors, so - // won't have such thing as 0.9999 !=== 1 - if (currentStyle[key] !== styleValue) { - return false; - } - } - - return true; -} - -module.exports = exports['default']; - -/***/ }), -/* 508 */ -/***/ (function(module, exports, __webpack_require__) { - -exports = module.exports = __webpack_require__(898)(undefined); -// imports - - -// module -exports.push([module.i, ".AnimatedComponent {\n width: 100px;\n height: 100px;\n margin: 50px;\n background-color: green;\n}\n\n.CSSTransition {\n -webkit-transition: -webkit-transform 1s;\n transition: -webkit-transform 1s;\n -o-transition: transform 1s;\n transition: transform 1s;\n transition: transform 1s, -webkit-transform 1s;\n -webkit-transform: rotate(0deg);\n -ms-transform: rotate(0deg);\n transform: rotate(0deg);\n}\n\n.CSSTransition-on {\n -webkit-transform: rotate(360deg);\n -ms-transform: rotate(360deg);\n transform: rotate(360deg);\n}\n\n.CSSAnimation {\n -webkit-animation: 1.5s AnimatedComponent-spin infinite normal linear;\n animation: 1.5s AnimatedComponent-spin infinite normal linear;\n}\n\n@-webkit-keyframes AnimatedComponent-spin {\n from {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes AnimatedComponent-spin {\n from {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n", ""]); - -// exports - - -/***/ }), -/* 509 */, -/* 510 */, -/* 511 */, -/* 512 */, -/* 513 */, -/* 514 */, -/* 515 */, -/* 516 */, -/* 517 */, -/* 518 */, -/* 519 */, -/* 520 */, -/* 521 */, -/* 522 */, -/* 523 */, -/* 524 */, -/* 525 */, -/* 526 */, -/* 527 */, -/* 528 */, -/* 529 */, -/* 530 */, -/* 531 */, -/* 532 */, -/* 533 */, -/* 534 */, -/* 535 */, -/* 536 */, -/* 537 */, -/* 538 */, -/* 539 */, -/* 540 */, -/* 541 */, -/* 542 */, -/* 543 */, -/* 544 */, -/* 545 */, -/* 546 */, -/* 547 */, -/* 548 */, -/* 549 */, -/* 550 */, -/* 551 */, -/* 552 */, -/* 553 */, -/* 554 */, -/* 555 */, -/* 556 */, -/* 557 */, -/* 558 */ -/***/ (function(module, exports) { - -var ENTITIES = [['Aacute', [193]], ['aacute', [225]], ['Abreve', [258]], ['abreve', [259]], ['ac', [8766]], ['acd', [8767]], ['acE', [8766, 819]], ['Acirc', [194]], ['acirc', [226]], ['acute', [180]], ['Acy', [1040]], ['acy', [1072]], ['AElig', [198]], ['aelig', [230]], ['af', [8289]], ['Afr', [120068]], ['afr', [120094]], ['Agrave', [192]], ['agrave', [224]], ['alefsym', [8501]], ['aleph', [8501]], ['Alpha', [913]], ['alpha', [945]], ['Amacr', [256]], ['amacr', [257]], ['amalg', [10815]], ['amp', [38]], ['AMP', [38]], ['andand', [10837]], ['And', [10835]], ['and', [8743]], ['andd', [10844]], ['andslope', [10840]], ['andv', [10842]], ['ang', [8736]], ['ange', [10660]], ['angle', [8736]], ['angmsdaa', [10664]], ['angmsdab', [10665]], ['angmsdac', [10666]], ['angmsdad', [10667]], ['angmsdae', [10668]], ['angmsdaf', [10669]], ['angmsdag', [10670]], ['angmsdah', [10671]], ['angmsd', [8737]], ['angrt', [8735]], ['angrtvb', [8894]], ['angrtvbd', [10653]], ['angsph', [8738]], ['angst', [197]], ['angzarr', [9084]], ['Aogon', [260]], ['aogon', [261]], ['Aopf', [120120]], ['aopf', [120146]], ['apacir', [10863]], ['ap', [8776]], ['apE', [10864]], ['ape', [8778]], ['apid', [8779]], ['apos', [39]], ['ApplyFunction', [8289]], ['approx', [8776]], ['approxeq', [8778]], ['Aring', [197]], ['aring', [229]], ['Ascr', [119964]], ['ascr', [119990]], ['Assign', [8788]], ['ast', [42]], ['asymp', [8776]], ['asympeq', [8781]], ['Atilde', [195]], ['atilde', [227]], ['Auml', [196]], ['auml', [228]], ['awconint', [8755]], ['awint', [10769]], ['backcong', [8780]], ['backepsilon', [1014]], ['backprime', [8245]], ['backsim', [8765]], ['backsimeq', [8909]], ['Backslash', [8726]], ['Barv', [10983]], ['barvee', [8893]], ['barwed', [8965]], ['Barwed', [8966]], ['barwedge', [8965]], ['bbrk', [9141]], ['bbrktbrk', [9142]], ['bcong', [8780]], ['Bcy', [1041]], ['bcy', [1073]], ['bdquo', [8222]], ['becaus', [8757]], ['because', [8757]], ['Because', [8757]], ['bemptyv', [10672]], ['bepsi', [1014]], ['bernou', [8492]], ['Bernoullis', [8492]], ['Beta', [914]], ['beta', [946]], ['beth', [8502]], ['between', [8812]], ['Bfr', [120069]], ['bfr', [120095]], ['bigcap', [8898]], ['bigcirc', [9711]], ['bigcup', [8899]], ['bigodot', [10752]], ['bigoplus', [10753]], ['bigotimes', [10754]], ['bigsqcup', [10758]], ['bigstar', [9733]], ['bigtriangledown', [9661]], ['bigtriangleup', [9651]], ['biguplus', [10756]], ['bigvee', [8897]], ['bigwedge', [8896]], ['bkarow', [10509]], ['blacklozenge', [10731]], ['blacksquare', [9642]], ['blacktriangle', [9652]], ['blacktriangledown', [9662]], ['blacktriangleleft', [9666]], ['blacktriangleright', [9656]], ['blank', [9251]], ['blk12', [9618]], ['blk14', [9617]], ['blk34', [9619]], ['block', [9608]], ['bne', [61, 8421]], ['bnequiv', [8801, 8421]], ['bNot', [10989]], ['bnot', [8976]], ['Bopf', [120121]], ['bopf', [120147]], ['bot', [8869]], ['bottom', [8869]], ['bowtie', [8904]], ['boxbox', [10697]], ['boxdl', [9488]], ['boxdL', [9557]], ['boxDl', [9558]], ['boxDL', [9559]], ['boxdr', [9484]], ['boxdR', [9554]], ['boxDr', [9555]], ['boxDR', [9556]], ['boxh', [9472]], ['boxH', [9552]], ['boxhd', [9516]], ['boxHd', [9572]], ['boxhD', [9573]], ['boxHD', [9574]], ['boxhu', [9524]], ['boxHu', [9575]], ['boxhU', [9576]], ['boxHU', [9577]], ['boxminus', [8863]], ['boxplus', [8862]], ['boxtimes', [8864]], ['boxul', [9496]], ['boxuL', [9563]], ['boxUl', [9564]], ['boxUL', [9565]], ['boxur', [9492]], ['boxuR', [9560]], ['boxUr', [9561]], ['boxUR', [9562]], ['boxv', [9474]], ['boxV', [9553]], ['boxvh', [9532]], ['boxvH', [9578]], ['boxVh', [9579]], ['boxVH', [9580]], ['boxvl', [9508]], ['boxvL', [9569]], ['boxVl', [9570]], ['boxVL', [9571]], ['boxvr', [9500]], ['boxvR', [9566]], ['boxVr', [9567]], ['boxVR', [9568]], ['bprime', [8245]], ['breve', [728]], ['Breve', [728]], ['brvbar', [166]], ['bscr', [119991]], ['Bscr', [8492]], ['bsemi', [8271]], ['bsim', [8765]], ['bsime', [8909]], ['bsolb', [10693]], ['bsol', [92]], ['bsolhsub', [10184]], ['bull', [8226]], ['bullet', [8226]], ['bump', [8782]], ['bumpE', [10926]], ['bumpe', [8783]], ['Bumpeq', [8782]], ['bumpeq', [8783]], ['Cacute', [262]], ['cacute', [263]], ['capand', [10820]], ['capbrcup', [10825]], ['capcap', [10827]], ['cap', [8745]], ['Cap', [8914]], ['capcup', [10823]], ['capdot', [10816]], ['CapitalDifferentialD', [8517]], ['caps', [8745, 65024]], ['caret', [8257]], ['caron', [711]], ['Cayleys', [8493]], ['ccaps', [10829]], ['Ccaron', [268]], ['ccaron', [269]], ['Ccedil', [199]], ['ccedil', [231]], ['Ccirc', [264]], ['ccirc', [265]], ['Cconint', [8752]], ['ccups', [10828]], ['ccupssm', [10832]], ['Cdot', [266]], ['cdot', [267]], ['cedil', [184]], ['Cedilla', [184]], ['cemptyv', [10674]], ['cent', [162]], ['centerdot', [183]], ['CenterDot', [183]], ['cfr', [120096]], ['Cfr', [8493]], ['CHcy', [1063]], ['chcy', [1095]], ['check', [10003]], ['checkmark', [10003]], ['Chi', [935]], ['chi', [967]], ['circ', [710]], ['circeq', [8791]], ['circlearrowleft', [8634]], ['circlearrowright', [8635]], ['circledast', [8859]], ['circledcirc', [8858]], ['circleddash', [8861]], ['CircleDot', [8857]], ['circledR', [174]], ['circledS', [9416]], ['CircleMinus', [8854]], ['CirclePlus', [8853]], ['CircleTimes', [8855]], ['cir', [9675]], ['cirE', [10691]], ['cire', [8791]], ['cirfnint', [10768]], ['cirmid', [10991]], ['cirscir', [10690]], ['ClockwiseContourIntegral', [8754]], ['clubs', [9827]], ['clubsuit', [9827]], ['colon', [58]], ['Colon', [8759]], ['Colone', [10868]], ['colone', [8788]], ['coloneq', [8788]], ['comma', [44]], ['commat', [64]], ['comp', [8705]], ['compfn', [8728]], ['complement', [8705]], ['complexes', [8450]], ['cong', [8773]], ['congdot', [10861]], ['Congruent', [8801]], ['conint', [8750]], ['Conint', [8751]], ['ContourIntegral', [8750]], ['copf', [120148]], ['Copf', [8450]], ['coprod', [8720]], ['Coproduct', [8720]], ['copy', [169]], ['COPY', [169]], ['copysr', [8471]], ['CounterClockwiseContourIntegral', [8755]], ['crarr', [8629]], ['cross', [10007]], ['Cross', [10799]], ['Cscr', [119966]], ['cscr', [119992]], ['csub', [10959]], ['csube', [10961]], ['csup', [10960]], ['csupe', [10962]], ['ctdot', [8943]], ['cudarrl', [10552]], ['cudarrr', [10549]], ['cuepr', [8926]], ['cuesc', [8927]], ['cularr', [8630]], ['cularrp', [10557]], ['cupbrcap', [10824]], ['cupcap', [10822]], ['CupCap', [8781]], ['cup', [8746]], ['Cup', [8915]], ['cupcup', [10826]], ['cupdot', [8845]], ['cupor', [10821]], ['cups', [8746, 65024]], ['curarr', [8631]], ['curarrm', [10556]], ['curlyeqprec', [8926]], ['curlyeqsucc', [8927]], ['curlyvee', [8910]], ['curlywedge', [8911]], ['curren', [164]], ['curvearrowleft', [8630]], ['curvearrowright', [8631]], ['cuvee', [8910]], ['cuwed', [8911]], ['cwconint', [8754]], ['cwint', [8753]], ['cylcty', [9005]], ['dagger', [8224]], ['Dagger', [8225]], ['daleth', [8504]], ['darr', [8595]], ['Darr', [8609]], ['dArr', [8659]], ['dash', [8208]], ['Dashv', [10980]], ['dashv', [8867]], ['dbkarow', [10511]], ['dblac', [733]], ['Dcaron', [270]], ['dcaron', [271]], ['Dcy', [1044]], ['dcy', [1076]], ['ddagger', [8225]], ['ddarr', [8650]], ['DD', [8517]], ['dd', [8518]], ['DDotrahd', [10513]], ['ddotseq', [10871]], ['deg', [176]], ['Del', [8711]], ['Delta', [916]], ['delta', [948]], ['demptyv', [10673]], ['dfisht', [10623]], ['Dfr', [120071]], ['dfr', [120097]], ['dHar', [10597]], ['dharl', [8643]], ['dharr', [8642]], ['DiacriticalAcute', [180]], ['DiacriticalDot', [729]], ['DiacriticalDoubleAcute', [733]], ['DiacriticalGrave', [96]], ['DiacriticalTilde', [732]], ['diam', [8900]], ['diamond', [8900]], ['Diamond', [8900]], ['diamondsuit', [9830]], ['diams', [9830]], ['die', [168]], ['DifferentialD', [8518]], ['digamma', [989]], ['disin', [8946]], ['div', [247]], ['divide', [247]], ['divideontimes', [8903]], ['divonx', [8903]], ['DJcy', [1026]], ['djcy', [1106]], ['dlcorn', [8990]], ['dlcrop', [8973]], ['dollar', [36]], ['Dopf', [120123]], ['dopf', [120149]], ['Dot', [168]], ['dot', [729]], ['DotDot', [8412]], ['doteq', [8784]], ['doteqdot', [8785]], ['DotEqual', [8784]], ['dotminus', [8760]], ['dotplus', [8724]], ['dotsquare', [8865]], ['doublebarwedge', [8966]], ['DoubleContourIntegral', [8751]], ['DoubleDot', [168]], ['DoubleDownArrow', [8659]], ['DoubleLeftArrow', [8656]], ['DoubleLeftRightArrow', [8660]], ['DoubleLeftTee', [10980]], ['DoubleLongLeftArrow', [10232]], ['DoubleLongLeftRightArrow', [10234]], ['DoubleLongRightArrow', [10233]], ['DoubleRightArrow', [8658]], ['DoubleRightTee', [8872]], ['DoubleUpArrow', [8657]], ['DoubleUpDownArrow', [8661]], ['DoubleVerticalBar', [8741]], ['DownArrowBar', [10515]], ['downarrow', [8595]], ['DownArrow', [8595]], ['Downarrow', [8659]], ['DownArrowUpArrow', [8693]], ['DownBreve', [785]], ['downdownarrows', [8650]], ['downharpoonleft', [8643]], ['downharpoonright', [8642]], ['DownLeftRightVector', [10576]], ['DownLeftTeeVector', [10590]], ['DownLeftVectorBar', [10582]], ['DownLeftVector', [8637]], ['DownRightTeeVector', [10591]], ['DownRightVectorBar', [10583]], ['DownRightVector', [8641]], ['DownTeeArrow', [8615]], ['DownTee', [8868]], ['drbkarow', [10512]], ['drcorn', [8991]], ['drcrop', [8972]], ['Dscr', [119967]], ['dscr', [119993]], ['DScy', [1029]], ['dscy', [1109]], ['dsol', [10742]], ['Dstrok', [272]], ['dstrok', [273]], ['dtdot', [8945]], ['dtri', [9663]], ['dtrif', [9662]], ['duarr', [8693]], ['duhar', [10607]], ['dwangle', [10662]], ['DZcy', [1039]], ['dzcy', [1119]], ['dzigrarr', [10239]], ['Eacute', [201]], ['eacute', [233]], ['easter', [10862]], ['Ecaron', [282]], ['ecaron', [283]], ['Ecirc', [202]], ['ecirc', [234]], ['ecir', [8790]], ['ecolon', [8789]], ['Ecy', [1069]], ['ecy', [1101]], ['eDDot', [10871]], ['Edot', [278]], ['edot', [279]], ['eDot', [8785]], ['ee', [8519]], ['efDot', [8786]], ['Efr', [120072]], ['efr', [120098]], ['eg', [10906]], ['Egrave', [200]], ['egrave', [232]], ['egs', [10902]], ['egsdot', [10904]], ['el', [10905]], ['Element', [8712]], ['elinters', [9191]], ['ell', [8467]], ['els', [10901]], ['elsdot', [10903]], ['Emacr', [274]], ['emacr', [275]], ['empty', [8709]], ['emptyset', [8709]], ['EmptySmallSquare', [9723]], ['emptyv', [8709]], ['EmptyVerySmallSquare', [9643]], ['emsp13', [8196]], ['emsp14', [8197]], ['emsp', [8195]], ['ENG', [330]], ['eng', [331]], ['ensp', [8194]], ['Eogon', [280]], ['eogon', [281]], ['Eopf', [120124]], ['eopf', [120150]], ['epar', [8917]], ['eparsl', [10723]], ['eplus', [10865]], ['epsi', [949]], ['Epsilon', [917]], ['epsilon', [949]], ['epsiv', [1013]], ['eqcirc', [8790]], ['eqcolon', [8789]], ['eqsim', [8770]], ['eqslantgtr', [10902]], ['eqslantless', [10901]], ['Equal', [10869]], ['equals', [61]], ['EqualTilde', [8770]], ['equest', [8799]], ['Equilibrium', [8652]], ['equiv', [8801]], ['equivDD', [10872]], ['eqvparsl', [10725]], ['erarr', [10609]], ['erDot', [8787]], ['escr', [8495]], ['Escr', [8496]], ['esdot', [8784]], ['Esim', [10867]], ['esim', [8770]], ['Eta', [919]], ['eta', [951]], ['ETH', [208]], ['eth', [240]], ['Euml', [203]], ['euml', [235]], ['euro', [8364]], ['excl', [33]], ['exist', [8707]], ['Exists', [8707]], ['expectation', [8496]], ['exponentiale', [8519]], ['ExponentialE', [8519]], ['fallingdotseq', [8786]], ['Fcy', [1060]], ['fcy', [1092]], ['female', [9792]], ['ffilig', [64259]], ['fflig', [64256]], ['ffllig', [64260]], ['Ffr', [120073]], ['ffr', [120099]], ['filig', [64257]], ['FilledSmallSquare', [9724]], ['FilledVerySmallSquare', [9642]], ['fjlig', [102, 106]], ['flat', [9837]], ['fllig', [64258]], ['fltns', [9649]], ['fnof', [402]], ['Fopf', [120125]], ['fopf', [120151]], ['forall', [8704]], ['ForAll', [8704]], ['fork', [8916]], ['forkv', [10969]], ['Fouriertrf', [8497]], ['fpartint', [10765]], ['frac12', [189]], ['frac13', [8531]], ['frac14', [188]], ['frac15', [8533]], ['frac16', [8537]], ['frac18', [8539]], ['frac23', [8532]], ['frac25', [8534]], ['frac34', [190]], ['frac35', [8535]], ['frac38', [8540]], ['frac45', [8536]], ['frac56', [8538]], ['frac58', [8541]], ['frac78', [8542]], ['frasl', [8260]], ['frown', [8994]], ['fscr', [119995]], ['Fscr', [8497]], ['gacute', [501]], ['Gamma', [915]], ['gamma', [947]], ['Gammad', [988]], ['gammad', [989]], ['gap', [10886]], ['Gbreve', [286]], ['gbreve', [287]], ['Gcedil', [290]], ['Gcirc', [284]], ['gcirc', [285]], ['Gcy', [1043]], ['gcy', [1075]], ['Gdot', [288]], ['gdot', [289]], ['ge', [8805]], ['gE', [8807]], ['gEl', [10892]], ['gel', [8923]], ['geq', [8805]], ['geqq', [8807]], ['geqslant', [10878]], ['gescc', [10921]], ['ges', [10878]], ['gesdot', [10880]], ['gesdoto', [10882]], ['gesdotol', [10884]], ['gesl', [8923, 65024]], ['gesles', [10900]], ['Gfr', [120074]], ['gfr', [120100]], ['gg', [8811]], ['Gg', [8921]], ['ggg', [8921]], ['gimel', [8503]], ['GJcy', [1027]], ['gjcy', [1107]], ['gla', [10917]], ['gl', [8823]], ['glE', [10898]], ['glj', [10916]], ['gnap', [10890]], ['gnapprox', [10890]], ['gne', [10888]], ['gnE', [8809]], ['gneq', [10888]], ['gneqq', [8809]], ['gnsim', [8935]], ['Gopf', [120126]], ['gopf', [120152]], ['grave', [96]], ['GreaterEqual', [8805]], ['GreaterEqualLess', [8923]], ['GreaterFullEqual', [8807]], ['GreaterGreater', [10914]], ['GreaterLess', [8823]], ['GreaterSlantEqual', [10878]], ['GreaterTilde', [8819]], ['Gscr', [119970]], ['gscr', [8458]], ['gsim', [8819]], ['gsime', [10894]], ['gsiml', [10896]], ['gtcc', [10919]], ['gtcir', [10874]], ['gt', [62]], ['GT', [62]], ['Gt', [8811]], ['gtdot', [8919]], ['gtlPar', [10645]], ['gtquest', [10876]], ['gtrapprox', [10886]], ['gtrarr', [10616]], ['gtrdot', [8919]], ['gtreqless', [8923]], ['gtreqqless', [10892]], ['gtrless', [8823]], ['gtrsim', [8819]], ['gvertneqq', [8809, 65024]], ['gvnE', [8809, 65024]], ['Hacek', [711]], ['hairsp', [8202]], ['half', [189]], ['hamilt', [8459]], ['HARDcy', [1066]], ['hardcy', [1098]], ['harrcir', [10568]], ['harr', [8596]], ['hArr', [8660]], ['harrw', [8621]], ['Hat', [94]], ['hbar', [8463]], ['Hcirc', [292]], ['hcirc', [293]], ['hearts', [9829]], ['heartsuit', [9829]], ['hellip', [8230]], ['hercon', [8889]], ['hfr', [120101]], ['Hfr', [8460]], ['HilbertSpace', [8459]], ['hksearow', [10533]], ['hkswarow', [10534]], ['hoarr', [8703]], ['homtht', [8763]], ['hookleftarrow', [8617]], ['hookrightarrow', [8618]], ['hopf', [120153]], ['Hopf', [8461]], ['horbar', [8213]], ['HorizontalLine', [9472]], ['hscr', [119997]], ['Hscr', [8459]], ['hslash', [8463]], ['Hstrok', [294]], ['hstrok', [295]], ['HumpDownHump', [8782]], ['HumpEqual', [8783]], ['hybull', [8259]], ['hyphen', [8208]], ['Iacute', [205]], ['iacute', [237]], ['ic', [8291]], ['Icirc', [206]], ['icirc', [238]], ['Icy', [1048]], ['icy', [1080]], ['Idot', [304]], ['IEcy', [1045]], ['iecy', [1077]], ['iexcl', [161]], ['iff', [8660]], ['ifr', [120102]], ['Ifr', [8465]], ['Igrave', [204]], ['igrave', [236]], ['ii', [8520]], ['iiiint', [10764]], ['iiint', [8749]], ['iinfin', [10716]], ['iiota', [8489]], ['IJlig', [306]], ['ijlig', [307]], ['Imacr', [298]], ['imacr', [299]], ['image', [8465]], ['ImaginaryI', [8520]], ['imagline', [8464]], ['imagpart', [8465]], ['imath', [305]], ['Im', [8465]], ['imof', [8887]], ['imped', [437]], ['Implies', [8658]], ['incare', [8453]], ['in', [8712]], ['infin', [8734]], ['infintie', [10717]], ['inodot', [305]], ['intcal', [8890]], ['int', [8747]], ['Int', [8748]], ['integers', [8484]], ['Integral', [8747]], ['intercal', [8890]], ['Intersection', [8898]], ['intlarhk', [10775]], ['intprod', [10812]], ['InvisibleComma', [8291]], ['InvisibleTimes', [8290]], ['IOcy', [1025]], ['iocy', [1105]], ['Iogon', [302]], ['iogon', [303]], ['Iopf', [120128]], ['iopf', [120154]], ['Iota', [921]], ['iota', [953]], ['iprod', [10812]], ['iquest', [191]], ['iscr', [119998]], ['Iscr', [8464]], ['isin', [8712]], ['isindot', [8949]], ['isinE', [8953]], ['isins', [8948]], ['isinsv', [8947]], ['isinv', [8712]], ['it', [8290]], ['Itilde', [296]], ['itilde', [297]], ['Iukcy', [1030]], ['iukcy', [1110]], ['Iuml', [207]], ['iuml', [239]], ['Jcirc', [308]], ['jcirc', [309]], ['Jcy', [1049]], ['jcy', [1081]], ['Jfr', [120077]], ['jfr', [120103]], ['jmath', [567]], ['Jopf', [120129]], ['jopf', [120155]], ['Jscr', [119973]], ['jscr', [119999]], ['Jsercy', [1032]], ['jsercy', [1112]], ['Jukcy', [1028]], ['jukcy', [1108]], ['Kappa', [922]], ['kappa', [954]], ['kappav', [1008]], ['Kcedil', [310]], ['kcedil', [311]], ['Kcy', [1050]], ['kcy', [1082]], ['Kfr', [120078]], ['kfr', [120104]], ['kgreen', [312]], ['KHcy', [1061]], ['khcy', [1093]], ['KJcy', [1036]], ['kjcy', [1116]], ['Kopf', [120130]], ['kopf', [120156]], ['Kscr', [119974]], ['kscr', [120000]], ['lAarr', [8666]], ['Lacute', [313]], ['lacute', [314]], ['laemptyv', [10676]], ['lagran', [8466]], ['Lambda', [923]], ['lambda', [955]], ['lang', [10216]], ['Lang', [10218]], ['langd', [10641]], ['langle', [10216]], ['lap', [10885]], ['Laplacetrf', [8466]], ['laquo', [171]], ['larrb', [8676]], ['larrbfs', [10527]], ['larr', [8592]], ['Larr', [8606]], ['lArr', [8656]], ['larrfs', [10525]], ['larrhk', [8617]], ['larrlp', [8619]], ['larrpl', [10553]], ['larrsim', [10611]], ['larrtl', [8610]], ['latail', [10521]], ['lAtail', [10523]], ['lat', [10923]], ['late', [10925]], ['lates', [10925, 65024]], ['lbarr', [10508]], ['lBarr', [10510]], ['lbbrk', [10098]], ['lbrace', [123]], ['lbrack', [91]], ['lbrke', [10635]], ['lbrksld', [10639]], ['lbrkslu', [10637]], ['Lcaron', [317]], ['lcaron', [318]], ['Lcedil', [315]], ['lcedil', [316]], ['lceil', [8968]], ['lcub', [123]], ['Lcy', [1051]], ['lcy', [1083]], ['ldca', [10550]], ['ldquo', [8220]], ['ldquor', [8222]], ['ldrdhar', [10599]], ['ldrushar', [10571]], ['ldsh', [8626]], ['le', [8804]], ['lE', [8806]], ['LeftAngleBracket', [10216]], ['LeftArrowBar', [8676]], ['leftarrow', [8592]], ['LeftArrow', [8592]], ['Leftarrow', [8656]], ['LeftArrowRightArrow', [8646]], ['leftarrowtail', [8610]], ['LeftCeiling', [8968]], ['LeftDoubleBracket', [10214]], ['LeftDownTeeVector', [10593]], ['LeftDownVectorBar', [10585]], ['LeftDownVector', [8643]], ['LeftFloor', [8970]], ['leftharpoondown', [8637]], ['leftharpoonup', [8636]], ['leftleftarrows', [8647]], ['leftrightarrow', [8596]], ['LeftRightArrow', [8596]], ['Leftrightarrow', [8660]], ['leftrightarrows', [8646]], ['leftrightharpoons', [8651]], ['leftrightsquigarrow', [8621]], ['LeftRightVector', [10574]], ['LeftTeeArrow', [8612]], ['LeftTee', [8867]], ['LeftTeeVector', [10586]], ['leftthreetimes', [8907]], ['LeftTriangleBar', [10703]], ['LeftTriangle', [8882]], ['LeftTriangleEqual', [8884]], ['LeftUpDownVector', [10577]], ['LeftUpTeeVector', [10592]], ['LeftUpVectorBar', [10584]], ['LeftUpVector', [8639]], ['LeftVectorBar', [10578]], ['LeftVector', [8636]], ['lEg', [10891]], ['leg', [8922]], ['leq', [8804]], ['leqq', [8806]], ['leqslant', [10877]], ['lescc', [10920]], ['les', [10877]], ['lesdot', [10879]], ['lesdoto', [10881]], ['lesdotor', [10883]], ['lesg', [8922, 65024]], ['lesges', [10899]], ['lessapprox', [10885]], ['lessdot', [8918]], ['lesseqgtr', [8922]], ['lesseqqgtr', [10891]], ['LessEqualGreater', [8922]], ['LessFullEqual', [8806]], ['LessGreater', [8822]], ['lessgtr', [8822]], ['LessLess', [10913]], ['lesssim', [8818]], ['LessSlantEqual', [10877]], ['LessTilde', [8818]], ['lfisht', [10620]], ['lfloor', [8970]], ['Lfr', [120079]], ['lfr', [120105]], ['lg', [8822]], ['lgE', [10897]], ['lHar', [10594]], ['lhard', [8637]], ['lharu', [8636]], ['lharul', [10602]], ['lhblk', [9604]], ['LJcy', [1033]], ['ljcy', [1113]], ['llarr', [8647]], ['ll', [8810]], ['Ll', [8920]], ['llcorner', [8990]], ['Lleftarrow', [8666]], ['llhard', [10603]], ['lltri', [9722]], ['Lmidot', [319]], ['lmidot', [320]], ['lmoustache', [9136]], ['lmoust', [9136]], ['lnap', [10889]], ['lnapprox', [10889]], ['lne', [10887]], ['lnE', [8808]], ['lneq', [10887]], ['lneqq', [8808]], ['lnsim', [8934]], ['loang', [10220]], ['loarr', [8701]], ['lobrk', [10214]], ['longleftarrow', [10229]], ['LongLeftArrow', [10229]], ['Longleftarrow', [10232]], ['longleftrightarrow', [10231]], ['LongLeftRightArrow', [10231]], ['Longleftrightarrow', [10234]], ['longmapsto', [10236]], ['longrightarrow', [10230]], ['LongRightArrow', [10230]], ['Longrightarrow', [10233]], ['looparrowleft', [8619]], ['looparrowright', [8620]], ['lopar', [10629]], ['Lopf', [120131]], ['lopf', [120157]], ['loplus', [10797]], ['lotimes', [10804]], ['lowast', [8727]], ['lowbar', [95]], ['LowerLeftArrow', [8601]], ['LowerRightArrow', [8600]], ['loz', [9674]], ['lozenge', [9674]], ['lozf', [10731]], ['lpar', [40]], ['lparlt', [10643]], ['lrarr', [8646]], ['lrcorner', [8991]], ['lrhar', [8651]], ['lrhard', [10605]], ['lrm', [8206]], ['lrtri', [8895]], ['lsaquo', [8249]], ['lscr', [120001]], ['Lscr', [8466]], ['lsh', [8624]], ['Lsh', [8624]], ['lsim', [8818]], ['lsime', [10893]], ['lsimg', [10895]], ['lsqb', [91]], ['lsquo', [8216]], ['lsquor', [8218]], ['Lstrok', [321]], ['lstrok', [322]], ['ltcc', [10918]], ['ltcir', [10873]], ['lt', [60]], ['LT', [60]], ['Lt', [8810]], ['ltdot', [8918]], ['lthree', [8907]], ['ltimes', [8905]], ['ltlarr', [10614]], ['ltquest', [10875]], ['ltri', [9667]], ['ltrie', [8884]], ['ltrif', [9666]], ['ltrPar', [10646]], ['lurdshar', [10570]], ['luruhar', [10598]], ['lvertneqq', [8808, 65024]], ['lvnE', [8808, 65024]], ['macr', [175]], ['male', [9794]], ['malt', [10016]], ['maltese', [10016]], ['Map', [10501]], ['map', [8614]], ['mapsto', [8614]], ['mapstodown', [8615]], ['mapstoleft', [8612]], ['mapstoup', [8613]], ['marker', [9646]], ['mcomma', [10793]], ['Mcy', [1052]], ['mcy', [1084]], ['mdash', [8212]], ['mDDot', [8762]], ['measuredangle', [8737]], ['MediumSpace', [8287]], ['Mellintrf', [8499]], ['Mfr', [120080]], ['mfr', [120106]], ['mho', [8487]], ['micro', [181]], ['midast', [42]], ['midcir', [10992]], ['mid', [8739]], ['middot', [183]], ['minusb', [8863]], ['minus', [8722]], ['minusd', [8760]], ['minusdu', [10794]], ['MinusPlus', [8723]], ['mlcp', [10971]], ['mldr', [8230]], ['mnplus', [8723]], ['models', [8871]], ['Mopf', [120132]], ['mopf', [120158]], ['mp', [8723]], ['mscr', [120002]], ['Mscr', [8499]], ['mstpos', [8766]], ['Mu', [924]], ['mu', [956]], ['multimap', [8888]], ['mumap', [8888]], ['nabla', [8711]], ['Nacute', [323]], ['nacute', [324]], ['nang', [8736, 8402]], ['nap', [8777]], ['napE', [10864, 824]], ['napid', [8779, 824]], ['napos', [329]], ['napprox', [8777]], ['natural', [9838]], ['naturals', [8469]], ['natur', [9838]], ['nbsp', [160]], ['nbump', [8782, 824]], ['nbumpe', [8783, 824]], ['ncap', [10819]], ['Ncaron', [327]], ['ncaron', [328]], ['Ncedil', [325]], ['ncedil', [326]], ['ncong', [8775]], ['ncongdot', [10861, 824]], ['ncup', [10818]], ['Ncy', [1053]], ['ncy', [1085]], ['ndash', [8211]], ['nearhk', [10532]], ['nearr', [8599]], ['neArr', [8663]], ['nearrow', [8599]], ['ne', [8800]], ['nedot', [8784, 824]], ['NegativeMediumSpace', [8203]], ['NegativeThickSpace', [8203]], ['NegativeThinSpace', [8203]], ['NegativeVeryThinSpace', [8203]], ['nequiv', [8802]], ['nesear', [10536]], ['nesim', [8770, 824]], ['NestedGreaterGreater', [8811]], ['NestedLessLess', [8810]], ['nexist', [8708]], ['nexists', [8708]], ['Nfr', [120081]], ['nfr', [120107]], ['ngE', [8807, 824]], ['nge', [8817]], ['ngeq', [8817]], ['ngeqq', [8807, 824]], ['ngeqslant', [10878, 824]], ['nges', [10878, 824]], ['nGg', [8921, 824]], ['ngsim', [8821]], ['nGt', [8811, 8402]], ['ngt', [8815]], ['ngtr', [8815]], ['nGtv', [8811, 824]], ['nharr', [8622]], ['nhArr', [8654]], ['nhpar', [10994]], ['ni', [8715]], ['nis', [8956]], ['nisd', [8954]], ['niv', [8715]], ['NJcy', [1034]], ['njcy', [1114]], ['nlarr', [8602]], ['nlArr', [8653]], ['nldr', [8229]], ['nlE', [8806, 824]], ['nle', [8816]], ['nleftarrow', [8602]], ['nLeftarrow', [8653]], ['nleftrightarrow', [8622]], ['nLeftrightarrow', [8654]], ['nleq', [8816]], ['nleqq', [8806, 824]], ['nleqslant', [10877, 824]], ['nles', [10877, 824]], ['nless', [8814]], ['nLl', [8920, 824]], ['nlsim', [8820]], ['nLt', [8810, 8402]], ['nlt', [8814]], ['nltri', [8938]], ['nltrie', [8940]], ['nLtv', [8810, 824]], ['nmid', [8740]], ['NoBreak', [8288]], ['NonBreakingSpace', [160]], ['nopf', [120159]], ['Nopf', [8469]], ['Not', [10988]], ['not', [172]], ['NotCongruent', [8802]], ['NotCupCap', [8813]], ['NotDoubleVerticalBar', [8742]], ['NotElement', [8713]], ['NotEqual', [8800]], ['NotEqualTilde', [8770, 824]], ['NotExists', [8708]], ['NotGreater', [8815]], ['NotGreaterEqual', [8817]], ['NotGreaterFullEqual', [8807, 824]], ['NotGreaterGreater', [8811, 824]], ['NotGreaterLess', [8825]], ['NotGreaterSlantEqual', [10878, 824]], ['NotGreaterTilde', [8821]], ['NotHumpDownHump', [8782, 824]], ['NotHumpEqual', [8783, 824]], ['notin', [8713]], ['notindot', [8949, 824]], ['notinE', [8953, 824]], ['notinva', [8713]], ['notinvb', [8951]], ['notinvc', [8950]], ['NotLeftTriangleBar', [10703, 824]], ['NotLeftTriangle', [8938]], ['NotLeftTriangleEqual', [8940]], ['NotLess', [8814]], ['NotLessEqual', [8816]], ['NotLessGreater', [8824]], ['NotLessLess', [8810, 824]], ['NotLessSlantEqual', [10877, 824]], ['NotLessTilde', [8820]], ['NotNestedGreaterGreater', [10914, 824]], ['NotNestedLessLess', [10913, 824]], ['notni', [8716]], ['notniva', [8716]], ['notnivb', [8958]], ['notnivc', [8957]], ['NotPrecedes', [8832]], ['NotPrecedesEqual', [10927, 824]], ['NotPrecedesSlantEqual', [8928]], ['NotReverseElement', [8716]], ['NotRightTriangleBar', [10704, 824]], ['NotRightTriangle', [8939]], ['NotRightTriangleEqual', [8941]], ['NotSquareSubset', [8847, 824]], ['NotSquareSubsetEqual', [8930]], ['NotSquareSuperset', [8848, 824]], ['NotSquareSupersetEqual', [8931]], ['NotSubset', [8834, 8402]], ['NotSubsetEqual', [8840]], ['NotSucceeds', [8833]], ['NotSucceedsEqual', [10928, 824]], ['NotSucceedsSlantEqual', [8929]], ['NotSucceedsTilde', [8831, 824]], ['NotSuperset', [8835, 8402]], ['NotSupersetEqual', [8841]], ['NotTilde', [8769]], ['NotTildeEqual', [8772]], ['NotTildeFullEqual', [8775]], ['NotTildeTilde', [8777]], ['NotVerticalBar', [8740]], ['nparallel', [8742]], ['npar', [8742]], ['nparsl', [11005, 8421]], ['npart', [8706, 824]], ['npolint', [10772]], ['npr', [8832]], ['nprcue', [8928]], ['nprec', [8832]], ['npreceq', [10927, 824]], ['npre', [10927, 824]], ['nrarrc', [10547, 824]], ['nrarr', [8603]], ['nrArr', [8655]], ['nrarrw', [8605, 824]], ['nrightarrow', [8603]], ['nRightarrow', [8655]], ['nrtri', [8939]], ['nrtrie', [8941]], ['nsc', [8833]], ['nsccue', [8929]], ['nsce', [10928, 824]], ['Nscr', [119977]], ['nscr', [120003]], ['nshortmid', [8740]], ['nshortparallel', [8742]], ['nsim', [8769]], ['nsime', [8772]], ['nsimeq', [8772]], ['nsmid', [8740]], ['nspar', [8742]], ['nsqsube', [8930]], ['nsqsupe', [8931]], ['nsub', [8836]], ['nsubE', [10949, 824]], ['nsube', [8840]], ['nsubset', [8834, 8402]], ['nsubseteq', [8840]], ['nsubseteqq', [10949, 824]], ['nsucc', [8833]], ['nsucceq', [10928, 824]], ['nsup', [8837]], ['nsupE', [10950, 824]], ['nsupe', [8841]], ['nsupset', [8835, 8402]], ['nsupseteq', [8841]], ['nsupseteqq', [10950, 824]], ['ntgl', [8825]], ['Ntilde', [209]], ['ntilde', [241]], ['ntlg', [8824]], ['ntriangleleft', [8938]], ['ntrianglelefteq', [8940]], ['ntriangleright', [8939]], ['ntrianglerighteq', [8941]], ['Nu', [925]], ['nu', [957]], ['num', [35]], ['numero', [8470]], ['numsp', [8199]], ['nvap', [8781, 8402]], ['nvdash', [8876]], ['nvDash', [8877]], ['nVdash', [8878]], ['nVDash', [8879]], ['nvge', [8805, 8402]], ['nvgt', [62, 8402]], ['nvHarr', [10500]], ['nvinfin', [10718]], ['nvlArr', [10498]], ['nvle', [8804, 8402]], ['nvlt', [60, 8402]], ['nvltrie', [8884, 8402]], ['nvrArr', [10499]], ['nvrtrie', [8885, 8402]], ['nvsim', [8764, 8402]], ['nwarhk', [10531]], ['nwarr', [8598]], ['nwArr', [8662]], ['nwarrow', [8598]], ['nwnear', [10535]], ['Oacute', [211]], ['oacute', [243]], ['oast', [8859]], ['Ocirc', [212]], ['ocirc', [244]], ['ocir', [8858]], ['Ocy', [1054]], ['ocy', [1086]], ['odash', [8861]], ['Odblac', [336]], ['odblac', [337]], ['odiv', [10808]], ['odot', [8857]], ['odsold', [10684]], ['OElig', [338]], ['oelig', [339]], ['ofcir', [10687]], ['Ofr', [120082]], ['ofr', [120108]], ['ogon', [731]], ['Ograve', [210]], ['ograve', [242]], ['ogt', [10689]], ['ohbar', [10677]], ['ohm', [937]], ['oint', [8750]], ['olarr', [8634]], ['olcir', [10686]], ['olcross', [10683]], ['oline', [8254]], ['olt', [10688]], ['Omacr', [332]], ['omacr', [333]], ['Omega', [937]], ['omega', [969]], ['Omicron', [927]], ['omicron', [959]], ['omid', [10678]], ['ominus', [8854]], ['Oopf', [120134]], ['oopf', [120160]], ['opar', [10679]], ['OpenCurlyDoubleQuote', [8220]], ['OpenCurlyQuote', [8216]], ['operp', [10681]], ['oplus', [8853]], ['orarr', [8635]], ['Or', [10836]], ['or', [8744]], ['ord', [10845]], ['order', [8500]], ['orderof', [8500]], ['ordf', [170]], ['ordm', [186]], ['origof', [8886]], ['oror', [10838]], ['orslope', [10839]], ['orv', [10843]], ['oS', [9416]], ['Oscr', [119978]], ['oscr', [8500]], ['Oslash', [216]], ['oslash', [248]], ['osol', [8856]], ['Otilde', [213]], ['otilde', [245]], ['otimesas', [10806]], ['Otimes', [10807]], ['otimes', [8855]], ['Ouml', [214]], ['ouml', [246]], ['ovbar', [9021]], ['OverBar', [8254]], ['OverBrace', [9182]], ['OverBracket', [9140]], ['OverParenthesis', [9180]], ['para', [182]], ['parallel', [8741]], ['par', [8741]], ['parsim', [10995]], ['parsl', [11005]], ['part', [8706]], ['PartialD', [8706]], ['Pcy', [1055]], ['pcy', [1087]], ['percnt', [37]], ['period', [46]], ['permil', [8240]], ['perp', [8869]], ['pertenk', [8241]], ['Pfr', [120083]], ['pfr', [120109]], ['Phi', [934]], ['phi', [966]], ['phiv', [981]], ['phmmat', [8499]], ['phone', [9742]], ['Pi', [928]], ['pi', [960]], ['pitchfork', [8916]], ['piv', [982]], ['planck', [8463]], ['planckh', [8462]], ['plankv', [8463]], ['plusacir', [10787]], ['plusb', [8862]], ['pluscir', [10786]], ['plus', [43]], ['plusdo', [8724]], ['plusdu', [10789]], ['pluse', [10866]], ['PlusMinus', [177]], ['plusmn', [177]], ['plussim', [10790]], ['plustwo', [10791]], ['pm', [177]], ['Poincareplane', [8460]], ['pointint', [10773]], ['popf', [120161]], ['Popf', [8473]], ['pound', [163]], ['prap', [10935]], ['Pr', [10939]], ['pr', [8826]], ['prcue', [8828]], ['precapprox', [10935]], ['prec', [8826]], ['preccurlyeq', [8828]], ['Precedes', [8826]], ['PrecedesEqual', [10927]], ['PrecedesSlantEqual', [8828]], ['PrecedesTilde', [8830]], ['preceq', [10927]], ['precnapprox', [10937]], ['precneqq', [10933]], ['precnsim', [8936]], ['pre', [10927]], ['prE', [10931]], ['precsim', [8830]], ['prime', [8242]], ['Prime', [8243]], ['primes', [8473]], ['prnap', [10937]], ['prnE', [10933]], ['prnsim', [8936]], ['prod', [8719]], ['Product', [8719]], ['profalar', [9006]], ['profline', [8978]], ['profsurf', [8979]], ['prop', [8733]], ['Proportional', [8733]], ['Proportion', [8759]], ['propto', [8733]], ['prsim', [8830]], ['prurel', [8880]], ['Pscr', [119979]], ['pscr', [120005]], ['Psi', [936]], ['psi', [968]], ['puncsp', [8200]], ['Qfr', [120084]], ['qfr', [120110]], ['qint', [10764]], ['qopf', [120162]], ['Qopf', [8474]], ['qprime', [8279]], ['Qscr', [119980]], ['qscr', [120006]], ['quaternions', [8461]], ['quatint', [10774]], ['quest', [63]], ['questeq', [8799]], ['quot', [34]], ['QUOT', [34]], ['rAarr', [8667]], ['race', [8765, 817]], ['Racute', [340]], ['racute', [341]], ['radic', [8730]], ['raemptyv', [10675]], ['rang', [10217]], ['Rang', [10219]], ['rangd', [10642]], ['range', [10661]], ['rangle', [10217]], ['raquo', [187]], ['rarrap', [10613]], ['rarrb', [8677]], ['rarrbfs', [10528]], ['rarrc', [10547]], ['rarr', [8594]], ['Rarr', [8608]], ['rArr', [8658]], ['rarrfs', [10526]], ['rarrhk', [8618]], ['rarrlp', [8620]], ['rarrpl', [10565]], ['rarrsim', [10612]], ['Rarrtl', [10518]], ['rarrtl', [8611]], ['rarrw', [8605]], ['ratail', [10522]], ['rAtail', [10524]], ['ratio', [8758]], ['rationals', [8474]], ['rbarr', [10509]], ['rBarr', [10511]], ['RBarr', [10512]], ['rbbrk', [10099]], ['rbrace', [125]], ['rbrack', [93]], ['rbrke', [10636]], ['rbrksld', [10638]], ['rbrkslu', [10640]], ['Rcaron', [344]], ['rcaron', [345]], ['Rcedil', [342]], ['rcedil', [343]], ['rceil', [8969]], ['rcub', [125]], ['Rcy', [1056]], ['rcy', [1088]], ['rdca', [10551]], ['rdldhar', [10601]], ['rdquo', [8221]], ['rdquor', [8221]], ['CloseCurlyDoubleQuote', [8221]], ['rdsh', [8627]], ['real', [8476]], ['realine', [8475]], ['realpart', [8476]], ['reals', [8477]], ['Re', [8476]], ['rect', [9645]], ['reg', [174]], ['REG', [174]], ['ReverseElement', [8715]], ['ReverseEquilibrium', [8651]], ['ReverseUpEquilibrium', [10607]], ['rfisht', [10621]], ['rfloor', [8971]], ['rfr', [120111]], ['Rfr', [8476]], ['rHar', [10596]], ['rhard', [8641]], ['rharu', [8640]], ['rharul', [10604]], ['Rho', [929]], ['rho', [961]], ['rhov', [1009]], ['RightAngleBracket', [10217]], ['RightArrowBar', [8677]], ['rightarrow', [8594]], ['RightArrow', [8594]], ['Rightarrow', [8658]], ['RightArrowLeftArrow', [8644]], ['rightarrowtail', [8611]], ['RightCeiling', [8969]], ['RightDoubleBracket', [10215]], ['RightDownTeeVector', [10589]], ['RightDownVectorBar', [10581]], ['RightDownVector', [8642]], ['RightFloor', [8971]], ['rightharpoondown', [8641]], ['rightharpoonup', [8640]], ['rightleftarrows', [8644]], ['rightleftharpoons', [8652]], ['rightrightarrows', [8649]], ['rightsquigarrow', [8605]], ['RightTeeArrow', [8614]], ['RightTee', [8866]], ['RightTeeVector', [10587]], ['rightthreetimes', [8908]], ['RightTriangleBar', [10704]], ['RightTriangle', [8883]], ['RightTriangleEqual', [8885]], ['RightUpDownVector', [10575]], ['RightUpTeeVector', [10588]], ['RightUpVectorBar', [10580]], ['RightUpVector', [8638]], ['RightVectorBar', [10579]], ['RightVector', [8640]], ['ring', [730]], ['risingdotseq', [8787]], ['rlarr', [8644]], ['rlhar', [8652]], ['rlm', [8207]], ['rmoustache', [9137]], ['rmoust', [9137]], ['rnmid', [10990]], ['roang', [10221]], ['roarr', [8702]], ['robrk', [10215]], ['ropar', [10630]], ['ropf', [120163]], ['Ropf', [8477]], ['roplus', [10798]], ['rotimes', [10805]], ['RoundImplies', [10608]], ['rpar', [41]], ['rpargt', [10644]], ['rppolint', [10770]], ['rrarr', [8649]], ['Rrightarrow', [8667]], ['rsaquo', [8250]], ['rscr', [120007]], ['Rscr', [8475]], ['rsh', [8625]], ['Rsh', [8625]], ['rsqb', [93]], ['rsquo', [8217]], ['rsquor', [8217]], ['CloseCurlyQuote', [8217]], ['rthree', [8908]], ['rtimes', [8906]], ['rtri', [9657]], ['rtrie', [8885]], ['rtrif', [9656]], ['rtriltri', [10702]], ['RuleDelayed', [10740]], ['ruluhar', [10600]], ['rx', [8478]], ['Sacute', [346]], ['sacute', [347]], ['sbquo', [8218]], ['scap', [10936]], ['Scaron', [352]], ['scaron', [353]], ['Sc', [10940]], ['sc', [8827]], ['sccue', [8829]], ['sce', [10928]], ['scE', [10932]], ['Scedil', [350]], ['scedil', [351]], ['Scirc', [348]], ['scirc', [349]], ['scnap', [10938]], ['scnE', [10934]], ['scnsim', [8937]], ['scpolint', [10771]], ['scsim', [8831]], ['Scy', [1057]], ['scy', [1089]], ['sdotb', [8865]], ['sdot', [8901]], ['sdote', [10854]], ['searhk', [10533]], ['searr', [8600]], ['seArr', [8664]], ['searrow', [8600]], ['sect', [167]], ['semi', [59]], ['seswar', [10537]], ['setminus', [8726]], ['setmn', [8726]], ['sext', [10038]], ['Sfr', [120086]], ['sfr', [120112]], ['sfrown', [8994]], ['sharp', [9839]], ['SHCHcy', [1065]], ['shchcy', [1097]], ['SHcy', [1064]], ['shcy', [1096]], ['ShortDownArrow', [8595]], ['ShortLeftArrow', [8592]], ['shortmid', [8739]], ['shortparallel', [8741]], ['ShortRightArrow', [8594]], ['ShortUpArrow', [8593]], ['shy', [173]], ['Sigma', [931]], ['sigma', [963]], ['sigmaf', [962]], ['sigmav', [962]], ['sim', [8764]], ['simdot', [10858]], ['sime', [8771]], ['simeq', [8771]], ['simg', [10910]], ['simgE', [10912]], ['siml', [10909]], ['simlE', [10911]], ['simne', [8774]], ['simplus', [10788]], ['simrarr', [10610]], ['slarr', [8592]], ['SmallCircle', [8728]], ['smallsetminus', [8726]], ['smashp', [10803]], ['smeparsl', [10724]], ['smid', [8739]], ['smile', [8995]], ['smt', [10922]], ['smte', [10924]], ['smtes', [10924, 65024]], ['SOFTcy', [1068]], ['softcy', [1100]], ['solbar', [9023]], ['solb', [10692]], ['sol', [47]], ['Sopf', [120138]], ['sopf', [120164]], ['spades', [9824]], ['spadesuit', [9824]], ['spar', [8741]], ['sqcap', [8851]], ['sqcaps', [8851, 65024]], ['sqcup', [8852]], ['sqcups', [8852, 65024]], ['Sqrt', [8730]], ['sqsub', [8847]], ['sqsube', [8849]], ['sqsubset', [8847]], ['sqsubseteq', [8849]], ['sqsup', [8848]], ['sqsupe', [8850]], ['sqsupset', [8848]], ['sqsupseteq', [8850]], ['square', [9633]], ['Square', [9633]], ['SquareIntersection', [8851]], ['SquareSubset', [8847]], ['SquareSubsetEqual', [8849]], ['SquareSuperset', [8848]], ['SquareSupersetEqual', [8850]], ['SquareUnion', [8852]], ['squarf', [9642]], ['squ', [9633]], ['squf', [9642]], ['srarr', [8594]], ['Sscr', [119982]], ['sscr', [120008]], ['ssetmn', [8726]], ['ssmile', [8995]], ['sstarf', [8902]], ['Star', [8902]], ['star', [9734]], ['starf', [9733]], ['straightepsilon', [1013]], ['straightphi', [981]], ['strns', [175]], ['sub', [8834]], ['Sub', [8912]], ['subdot', [10941]], ['subE', [10949]], ['sube', [8838]], ['subedot', [10947]], ['submult', [10945]], ['subnE', [10955]], ['subne', [8842]], ['subplus', [10943]], ['subrarr', [10617]], ['subset', [8834]], ['Subset', [8912]], ['subseteq', [8838]], ['subseteqq', [10949]], ['SubsetEqual', [8838]], ['subsetneq', [8842]], ['subsetneqq', [10955]], ['subsim', [10951]], ['subsub', [10965]], ['subsup', [10963]], ['succapprox', [10936]], ['succ', [8827]], ['succcurlyeq', [8829]], ['Succeeds', [8827]], ['SucceedsEqual', [10928]], ['SucceedsSlantEqual', [8829]], ['SucceedsTilde', [8831]], ['succeq', [10928]], ['succnapprox', [10938]], ['succneqq', [10934]], ['succnsim', [8937]], ['succsim', [8831]], ['SuchThat', [8715]], ['sum', [8721]], ['Sum', [8721]], ['sung', [9834]], ['sup1', [185]], ['sup2', [178]], ['sup3', [179]], ['sup', [8835]], ['Sup', [8913]], ['supdot', [10942]], ['supdsub', [10968]], ['supE', [10950]], ['supe', [8839]], ['supedot', [10948]], ['Superset', [8835]], ['SupersetEqual', [8839]], ['suphsol', [10185]], ['suphsub', [10967]], ['suplarr', [10619]], ['supmult', [10946]], ['supnE', [10956]], ['supne', [8843]], ['supplus', [10944]], ['supset', [8835]], ['Supset', [8913]], ['supseteq', [8839]], ['supseteqq', [10950]], ['supsetneq', [8843]], ['supsetneqq', [10956]], ['supsim', [10952]], ['supsub', [10964]], ['supsup', [10966]], ['swarhk', [10534]], ['swarr', [8601]], ['swArr', [8665]], ['swarrow', [8601]], ['swnwar', [10538]], ['szlig', [223]], ['Tab', [9]], ['target', [8982]], ['Tau', [932]], ['tau', [964]], ['tbrk', [9140]], ['Tcaron', [356]], ['tcaron', [357]], ['Tcedil', [354]], ['tcedil', [355]], ['Tcy', [1058]], ['tcy', [1090]], ['tdot', [8411]], ['telrec', [8981]], ['Tfr', [120087]], ['tfr', [120113]], ['there4', [8756]], ['therefore', [8756]], ['Therefore', [8756]], ['Theta', [920]], ['theta', [952]], ['thetasym', [977]], ['thetav', [977]], ['thickapprox', [8776]], ['thicksim', [8764]], ['ThickSpace', [8287, 8202]], ['ThinSpace', [8201]], ['thinsp', [8201]], ['thkap', [8776]], ['thksim', [8764]], ['THORN', [222]], ['thorn', [254]], ['tilde', [732]], ['Tilde', [8764]], ['TildeEqual', [8771]], ['TildeFullEqual', [8773]], ['TildeTilde', [8776]], ['timesbar', [10801]], ['timesb', [8864]], ['times', [215]], ['timesd', [10800]], ['tint', [8749]], ['toea', [10536]], ['topbot', [9014]], ['topcir', [10993]], ['top', [8868]], ['Topf', [120139]], ['topf', [120165]], ['topfork', [10970]], ['tosa', [10537]], ['tprime', [8244]], ['trade', [8482]], ['TRADE', [8482]], ['triangle', [9653]], ['triangledown', [9663]], ['triangleleft', [9667]], ['trianglelefteq', [8884]], ['triangleq', [8796]], ['triangleright', [9657]], ['trianglerighteq', [8885]], ['tridot', [9708]], ['trie', [8796]], ['triminus', [10810]], ['TripleDot', [8411]], ['triplus', [10809]], ['trisb', [10701]], ['tritime', [10811]], ['trpezium', [9186]], ['Tscr', [119983]], ['tscr', [120009]], ['TScy', [1062]], ['tscy', [1094]], ['TSHcy', [1035]], ['tshcy', [1115]], ['Tstrok', [358]], ['tstrok', [359]], ['twixt', [8812]], ['twoheadleftarrow', [8606]], ['twoheadrightarrow', [8608]], ['Uacute', [218]], ['uacute', [250]], ['uarr', [8593]], ['Uarr', [8607]], ['uArr', [8657]], ['Uarrocir', [10569]], ['Ubrcy', [1038]], ['ubrcy', [1118]], ['Ubreve', [364]], ['ubreve', [365]], ['Ucirc', [219]], ['ucirc', [251]], ['Ucy', [1059]], ['ucy', [1091]], ['udarr', [8645]], ['Udblac', [368]], ['udblac', [369]], ['udhar', [10606]], ['ufisht', [10622]], ['Ufr', [120088]], ['ufr', [120114]], ['Ugrave', [217]], ['ugrave', [249]], ['uHar', [10595]], ['uharl', [8639]], ['uharr', [8638]], ['uhblk', [9600]], ['ulcorn', [8988]], ['ulcorner', [8988]], ['ulcrop', [8975]], ['ultri', [9720]], ['Umacr', [362]], ['umacr', [363]], ['uml', [168]], ['UnderBar', [95]], ['UnderBrace', [9183]], ['UnderBracket', [9141]], ['UnderParenthesis', [9181]], ['Union', [8899]], ['UnionPlus', [8846]], ['Uogon', [370]], ['uogon', [371]], ['Uopf', [120140]], ['uopf', [120166]], ['UpArrowBar', [10514]], ['uparrow', [8593]], ['UpArrow', [8593]], ['Uparrow', [8657]], ['UpArrowDownArrow', [8645]], ['updownarrow', [8597]], ['UpDownArrow', [8597]], ['Updownarrow', [8661]], ['UpEquilibrium', [10606]], ['upharpoonleft', [8639]], ['upharpoonright', [8638]], ['uplus', [8846]], ['UpperLeftArrow', [8598]], ['UpperRightArrow', [8599]], ['upsi', [965]], ['Upsi', [978]], ['upsih', [978]], ['Upsilon', [933]], ['upsilon', [965]], ['UpTeeArrow', [8613]], ['UpTee', [8869]], ['upuparrows', [8648]], ['urcorn', [8989]], ['urcorner', [8989]], ['urcrop', [8974]], ['Uring', [366]], ['uring', [367]], ['urtri', [9721]], ['Uscr', [119984]], ['uscr', [120010]], ['utdot', [8944]], ['Utilde', [360]], ['utilde', [361]], ['utri', [9653]], ['utrif', [9652]], ['uuarr', [8648]], ['Uuml', [220]], ['uuml', [252]], ['uwangle', [10663]], ['vangrt', [10652]], ['varepsilon', [1013]], ['varkappa', [1008]], ['varnothing', [8709]], ['varphi', [981]], ['varpi', [982]], ['varpropto', [8733]], ['varr', [8597]], ['vArr', [8661]], ['varrho', [1009]], ['varsigma', [962]], ['varsubsetneq', [8842, 65024]], ['varsubsetneqq', [10955, 65024]], ['varsupsetneq', [8843, 65024]], ['varsupsetneqq', [10956, 65024]], ['vartheta', [977]], ['vartriangleleft', [8882]], ['vartriangleright', [8883]], ['vBar', [10984]], ['Vbar', [10987]], ['vBarv', [10985]], ['Vcy', [1042]], ['vcy', [1074]], ['vdash', [8866]], ['vDash', [8872]], ['Vdash', [8873]], ['VDash', [8875]], ['Vdashl', [10982]], ['veebar', [8891]], ['vee', [8744]], ['Vee', [8897]], ['veeeq', [8794]], ['vellip', [8942]], ['verbar', [124]], ['Verbar', [8214]], ['vert', [124]], ['Vert', [8214]], ['VerticalBar', [8739]], ['VerticalLine', [124]], ['VerticalSeparator', [10072]], ['VerticalTilde', [8768]], ['VeryThinSpace', [8202]], ['Vfr', [120089]], ['vfr', [120115]], ['vltri', [8882]], ['vnsub', [8834, 8402]], ['vnsup', [8835, 8402]], ['Vopf', [120141]], ['vopf', [120167]], ['vprop', [8733]], ['vrtri', [8883]], ['Vscr', [119985]], ['vscr', [120011]], ['vsubnE', [10955, 65024]], ['vsubne', [8842, 65024]], ['vsupnE', [10956, 65024]], ['vsupne', [8843, 65024]], ['Vvdash', [8874]], ['vzigzag', [10650]], ['Wcirc', [372]], ['wcirc', [373]], ['wedbar', [10847]], ['wedge', [8743]], ['Wedge', [8896]], ['wedgeq', [8793]], ['weierp', [8472]], ['Wfr', [120090]], ['wfr', [120116]], ['Wopf', [120142]], ['wopf', [120168]], ['wp', [8472]], ['wr', [8768]], ['wreath', [8768]], ['Wscr', [119986]], ['wscr', [120012]], ['xcap', [8898]], ['xcirc', [9711]], ['xcup', [8899]], ['xdtri', [9661]], ['Xfr', [120091]], ['xfr', [120117]], ['xharr', [10231]], ['xhArr', [10234]], ['Xi', [926]], ['xi', [958]], ['xlarr', [10229]], ['xlArr', [10232]], ['xmap', [10236]], ['xnis', [8955]], ['xodot', [10752]], ['Xopf', [120143]], ['xopf', [120169]], ['xoplus', [10753]], ['xotime', [10754]], ['xrarr', [10230]], ['xrArr', [10233]], ['Xscr', [119987]], ['xscr', [120013]], ['xsqcup', [10758]], ['xuplus', [10756]], ['xutri', [9651]], ['xvee', [8897]], ['xwedge', [8896]], ['Yacute', [221]], ['yacute', [253]], ['YAcy', [1071]], ['yacy', [1103]], ['Ycirc', [374]], ['ycirc', [375]], ['Ycy', [1067]], ['ycy', [1099]], ['yen', [165]], ['Yfr', [120092]], ['yfr', [120118]], ['YIcy', [1031]], ['yicy', [1111]], ['Yopf', [120144]], ['yopf', [120170]], ['Yscr', [119988]], ['yscr', [120014]], ['YUcy', [1070]], ['yucy', [1102]], ['yuml', [255]], ['Yuml', [376]], ['Zacute', [377]], ['zacute', [378]], ['Zcaron', [381]], ['zcaron', [382]], ['Zcy', [1047]], ['zcy', [1079]], ['Zdot', [379]], ['zdot', [380]], ['zeetrf', [8488]], ['ZeroWidthSpace', [8203]], ['Zeta', [918]], ['zeta', [950]], ['zfr', [120119]], ['Zfr', [8488]], ['ZHcy', [1046]], ['zhcy', [1078]], ['zigrarr', [8669]], ['zopf', [120171]], ['Zopf', [8484]], ['Zscr', [119989]], ['zscr', [120015]], ['zwj', [8205]], ['zwnj', [8204]]]; - -var alphaIndex = {}; -var charIndex = {}; - -createIndexes(alphaIndex, charIndex); - -/** - * @constructor - */ -function Html5Entities() {} - -/** - * @param {String} str - * @returns {String} - */ -Html5Entities.prototype.decode = function(str) { - if (!str || !str.length) { - return ''; - } - return str.replace(/&(#?[\w\d]+);?/g, function(s, entity) { - var chr; - if (entity.charAt(0) === "#") { - var code = entity.charAt(1) === 'x' ? - parseInt(entity.substr(2).toLowerCase(), 16) : - parseInt(entity.substr(1)); - - if (!(isNaN(code) || code < -32768 || code > 65535)) { - chr = String.fromCharCode(code); - } - } else { - chr = alphaIndex[entity]; - } - return chr || s; - }); -}; - -/** - * @param {String} str - * @returns {String} - */ - Html5Entities.decode = function(str) { - return new Html5Entities().decode(str); - }; - -/** - * @param {String} str - * @returns {String} - */ -Html5Entities.prototype.encode = function(str) { - if (!str || !str.length) { - return ''; - } - var strLength = str.length; - var result = ''; - var i = 0; - while (i < strLength) { - var charInfo = charIndex[str.charCodeAt(i)]; - if (charInfo) { - var alpha = charInfo[str.charCodeAt(i + 1)]; - if (alpha) { - i++; - } else { - alpha = charInfo['']; - } - if (alpha) { - result += "&" + alpha + ";"; - i++; - continue; - } - } - result += str.charAt(i); - i++; - } - return result; -}; - -/** - * @param {String} str - * @returns {String} - */ - Html5Entities.encode = function(str) { - return new Html5Entities().encode(str); - }; - -/** - * @param {String} str - * @returns {String} - */ -Html5Entities.prototype.encodeNonUTF = function(str) { - if (!str || !str.length) { - return ''; - } - var strLength = str.length; - var result = ''; - var i = 0; - while (i < strLength) { - var c = str.charCodeAt(i); - var charInfo = charIndex[c]; - if (charInfo) { - var alpha = charInfo[str.charCodeAt(i + 1)]; - if (alpha) { - i++; - } else { - alpha = charInfo['']; - } - if (alpha) { - result += "&" + alpha + ";"; - i++; - continue; - } - } - if (c < 32 || c > 126) { - result += '&#' + c + ';'; - } else { - result += str.charAt(i); - } - i++; - } - return result; -}; - -/** - * @param {String} str - * @returns {String} - */ - Html5Entities.encodeNonUTF = function(str) { - return new Html5Entities().encodeNonUTF(str); - }; - -/** - * @param {String} str - * @returns {String} - */ -Html5Entities.prototype.encodeNonASCII = function(str) { - if (!str || !str.length) { - return ''; - } - var strLength = str.length; - var result = ''; - var i = 0; - while (i < strLength) { - var c = str.charCodeAt(i); - if (c <= 255) { - result += str[i++]; - continue; - } - result += '&#' + c + ';'; - i++ - } - return result; -}; - -/** - * @param {String} str - * @returns {String} - */ - Html5Entities.encodeNonASCII = function(str) { - return new Html5Entities().encodeNonASCII(str); - }; - -/** - * @param {Object} alphaIndex Passed by reference. - * @param {Object} charIndex Passed by reference. - */ -function createIndexes(alphaIndex, charIndex) { - var i = ENTITIES.length; - var _results = []; - while (i--) { - var e = ENTITIES[i]; - var alpha = e[0]; - var chars = e[1]; - var chr = chars[0]; - var addChar = (chr < 32 || chr > 126) || chr === 62 || chr === 60 || chr === 38 || chr === 34 || chr === 39; - var charInfo; - if (addChar) { - charInfo = charIndex[chr] = charIndex[chr] || {}; - } - if (chars[1]) { - var chr2 = chars[1]; - alphaIndex[alpha] = String.fromCharCode(chr) + String.fromCharCode(chr2); - _results.push(addChar && (charInfo[chr2] = alpha)); - } else { - alphaIndex[alpha] = String.fromCharCode(chr); - _results.push(addChar && (charInfo[''] = alpha)); - } - } -} - -module.exports = Html5Entities; - - -/***/ }), -/* 559 */ -/***/ (function(module, exports) { - -module.exports = function(originalModule) { - if(!originalModule.webpackPolyfill) { - var module = Object.create(originalModule); - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - Object.defineProperty(module, "exports", { - enumerable: true, - }); - module.webpackPolyfill = 1; - } - return module; -}; - - -/***/ }), -/* 560 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.configure = exports.getStorybook = exports.clearDecorators = exports.addDecorator = exports.setAddon = exports.storiesOf = undefined; - -var _assign = __webpack_require__(107); - -var _assign2 = _interopRequireDefault(_assign); - -var _redux = __webpack_require__(808); - -var _addons = __webpack_require__(55); - -var _addons2 = _interopRequireDefault(_addons); - -var _channelPostmessage = __webpack_require__(491); - -var _channelPostmessage2 = _interopRequireDefault(_channelPostmessage); - -var _qs = __webpack_require__(244); - -var _qs2 = _interopRequireDefault(_qs); - -var _story_store = __webpack_require__(823); - -var _story_store2 = _interopRequireDefault(_story_store); - -var _client_api = __webpack_require__(824); - -var _client_api2 = _interopRequireDefault(_client_api); - -var _config_api = __webpack_require__(825); - -var _config_api2 = _interopRequireDefault(_config_api); - -var _render = __webpack_require__(826); - -var _render2 = _interopRequireDefault(_render); - -var _init = __webpack_require__(877); - -var _init2 = _interopRequireDefault(_init); - -var _actions = __webpack_require__(247); - -var _reducer = __webpack_require__(878); - -var _reducer2 = _interopRequireDefault(_reducer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// check whether we're running on node/browser -var _global = global, - navigator = _global.navigator; /* global window */ - -var isBrowser = navigator && navigator.userAgent !== 'storyshots' && !(navigator.userAgent.indexOf('Node.js') > -1); - -var storyStore = new _story_store2.default(); -var reduxStore = (0, _redux.createStore)(_reducer2.default); -var context = { storyStore: storyStore, reduxStore: reduxStore }; - -if (isBrowser) { - var queryParams = _qs2.default.parse(window.location.search.substring(1)); - var channel = (0, _channelPostmessage2.default)({ page: 'preview' }); - channel.on('setCurrentStory', function (data) { - reduxStore.dispatch((0, _actions.selectStory)(data.kind, data.story)); - }); - (0, _assign2.default)(context, { channel: channel, window: window, queryParams: queryParams }); - _addons2.default.setChannel(channel); - (0, _init2.default)(context); -} - -var clientApi = new _client_api2.default(context); -var configApi = new _config_api2.default(context); - -// do exports -var storiesOf = exports.storiesOf = clientApi.storiesOf.bind(clientApi); -var setAddon = exports.setAddon = clientApi.setAddon.bind(clientApi); -var addDecorator = exports.addDecorator = clientApi.addDecorator.bind(clientApi); -var clearDecorators = exports.clearDecorators = clientApi.clearDecorators.bind(clientApi); -var getStorybook = exports.getStorybook = clientApi.getStorybook.bind(clientApi); -var configure = exports.configure = configApi.configure.bind(configApi); - -// initialize the UI -var renderUI = function renderUI() { - if (isBrowser) { - (0, _render2.default)(context); - } -}; - -reduxStore.subscribe(renderUI); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22))) - -/***/ }), -/* 561 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; }); -/* harmony export (immutable) */ __webpack_exports__["b"] = createStore; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(562); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(817); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__); - - - -/** - * These are private action types reserved by Redux. - * For any unknown actions, you must return the current state. - * If the current state is undefined, you must return the initial state. - * Do not reference these action types directly in your code. - */ -var ActionTypes = { - INIT: '@@redux/INIT' - - /** - * Creates a Redux store that holds the state tree. - * The only way to change the data in the store is to call `dispatch()` on it. - * - * There should only be a single store in your app. To specify how different - * parts of the state tree respond to actions, you may combine several reducers - * into a single reducer function by using `combineReducers`. - * - * @param {Function} reducer A function that returns the next state tree, given - * the current state tree and the action to handle. - * - * @param {any} [preloadedState] The initial state. You may optionally specify it - * to hydrate the state from the server in universal apps, or to restore a - * previously serialized user session. - * If you use `combineReducers` to produce the root reducer function, this must be - * an object with the same shape as `combineReducers` keys. - * - * @param {Function} [enhancer] The store enhancer. You may optionally specify it - * to enhance the store with third-party capabilities such as middleware, - * time travel, persistence, etc. The only store enhancer that ships with Redux - * is `applyMiddleware()`. - * - * @returns {Store} A Redux store that lets you read the state, dispatch actions - * and subscribe to changes. - */ -};function createStore(reducer, preloadedState, enhancer) { - var _ref2; - - if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { - enhancer = preloadedState; - preloadedState = undefined; - } - - if (typeof enhancer !== 'undefined') { - if (typeof enhancer !== 'function') { - throw new Error('Expected the enhancer to be a function.'); - } - - return enhancer(createStore)(reducer, preloadedState); - } - - if (typeof reducer !== 'function') { - throw new Error('Expected the reducer to be a function.'); - } - - var currentReducer = reducer; - var currentState = preloadedState; - var currentListeners = []; - var nextListeners = currentListeners; - var isDispatching = false; - - function ensureCanMutateNextListeners() { - if (nextListeners === currentListeners) { - nextListeners = currentListeners.slice(); - } - } - - /** - * Reads the state tree managed by the store. - * - * @returns {any} The current state tree of your application. - */ - function getState() { - return currentState; - } - - /** - * Adds a change listener. It will be called any time an action is dispatched, - * and some part of the state tree may potentially have changed. You may then - * call `getState()` to read the current state tree inside the callback. - * - * You may call `dispatch()` from a change listener, with the following - * caveats: - * - * 1. The subscriptions are snapshotted just before every `dispatch()` call. - * If you subscribe or unsubscribe while the listeners are being invoked, this - * will not have any effect on the `dispatch()` that is currently in progress. - * However, the next `dispatch()` call, whether nested or not, will use a more - * recent snapshot of the subscription list. - * - * 2. The listener should not expect to see all state changes, as the state - * might have been updated multiple times during a nested `dispatch()` before - * the listener is called. It is, however, guaranteed that all subscribers - * registered before the `dispatch()` started will be called with the latest - * state by the time it exits. - * - * @param {Function} listener A callback to be invoked on every dispatch. - * @returns {Function} A function to remove this change listener. - */ - function subscribe(listener) { - if (typeof listener !== 'function') { - throw new Error('Expected listener to be a function.'); - } - - var isSubscribed = true; - - ensureCanMutateNextListeners(); - nextListeners.push(listener); - - return function unsubscribe() { - if (!isSubscribed) { - return; - } - - isSubscribed = false; - - ensureCanMutateNextListeners(); - var index = nextListeners.indexOf(listener); - nextListeners.splice(index, 1); - }; - } - - /** - * Dispatches an action. It is the only way to trigger a state change. - * - * The `reducer` function, used to create the store, will be called with the - * current state tree and the given `action`. Its return value will - * be considered the **next** state of the tree, and the change listeners - * will be notified. - * - * The base implementation only supports plain object actions. If you want to - * dispatch a Promise, an Observable, a thunk, or something else, you need to - * wrap your store creating function into the corresponding middleware. For - * example, see the documentation for the `redux-thunk` package. Even the - * middleware will eventually dispatch plain object actions using this method. - * - * @param {Object} action A plain object representing “what changed”. It is - * a good idea to keep actions serializable so you can record and replay user - * sessions, or use the time travelling `redux-devtools`. An action must have - * a `type` property which may not be `undefined`. It is a good idea to use - * string constants for action types. - * - * @returns {Object} For convenience, the same action object you dispatched. - * - * Note that, if you use a custom middleware, it may wrap `dispatch()` to - * return something else (for example, a Promise you can await). - */ - function dispatch(action) { - if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(action)) { - throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); - } - - if (typeof action.type === 'undefined') { - throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); - } - - if (isDispatching) { - throw new Error('Reducers may not dispatch actions.'); - } - - try { - isDispatching = true; - currentState = currentReducer(currentState, action); - } finally { - isDispatching = false; - } - - var listeners = currentListeners = nextListeners; - for (var i = 0; i < listeners.length; i++) { - var listener = listeners[i]; - listener(); - } - - return action; - } - - /** - * Replaces the reducer currently used by the store to calculate the state. - * - * You might need this if your app implements code splitting and you want to - * load some of the reducers dynamically. You might also need this if you - * implement a hot reloading mechanism for Redux. - * - * @param {Function} nextReducer The reducer for the store to use instead. - * @returns {void} - */ - function replaceReducer(nextReducer) { - if (typeof nextReducer !== 'function') { - throw new Error('Expected the nextReducer to be a function.'); - } - - currentReducer = nextReducer; - dispatch({ type: ActionTypes.INIT }); - } - - /** - * Interoperability point for observable/reactive libraries. - * @returns {observable} A minimal observable of state changes. - * For more information, see the observable proposal: - * https://github.com/tc39/proposal-observable - */ - function observable() { - var _ref; - - var outerSubscribe = subscribe; - return _ref = { - /** - * The minimal observable subscription method. - * @param {Object} observer Any object that can be used as an observer. - * The observer object should have a `next` method. - * @returns {subscription} An object with an `unsubscribe` method that can - * be used to unsubscribe the observable from the store, and prevent further - * emission of values from the observable. - */ - subscribe: function subscribe(observer) { - if (typeof observer !== 'object') { - throw new TypeError('Expected the observer to be an object.'); - } - - function observeState() { - if (observer.next) { - observer.next(getState()); - } - } - - observeState(); - var unsubscribe = outerSubscribe(observeState); - return { unsubscribe: unsubscribe }; - } - }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = function () { - return this; - }, _ref; - } - - // When a store is created, an "INIT" action is dispatched so that every - // reducer returns their initial state. This effectively populates - // the initial state tree. - dispatch({ type: ActionTypes.INIT }); - - return _ref2 = { - dispatch: dispatch, - subscribe: subscribe, - getState: getState, - replaceReducer: replaceReducer - }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2; -} - -/***/ }), -/* 562 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(809); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(814); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(816); - - - - -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; - -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); - -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!Object(__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) != objectTag) { - return false; - } - var proto = Object(__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */])(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; -} - -/* harmony default export */ __webpack_exports__["a"] = (isPlainObject); - - -/***/ }), -/* 563 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(810); - - -/** Built-in value references. */ -var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; - -/* harmony default export */ __webpack_exports__["a"] = (Symbol); - - -/***/ }), -/* 564 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = warning; -/** - * Prints a warning in the console if it exists. - * - * @param {String} message The warning message. - * @returns {void} - */ -function warning(message) { - /* eslint-disable no-console */ - if (typeof console !== 'undefined' && typeof console.error === 'function') { - console.error(message); - } - /* eslint-enable no-console */ - try { - // This error was thrown as a convenience so that if you enable - // "break on all exceptions" in your console, - // it would pause the execution at this line. - throw new Error(message); - /* eslint-disable no-empty */ - } catch (e) {} - /* eslint-enable no-empty */ -} - -/***/ }), -/* 565 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = compose; -/** - * Composes single-argument functions from right to left. The rightmost - * function can take multiple arguments as it provides the signature for - * the resulting composite function. - * - * @param {...Function} funcs The functions to compose. - * @returns {Function} A function obtained by composing the argument functions - * from right to left. For example, compose(f, g, h) is identical to doing - * (...args) => f(g(h(...args))). - */ - -function compose() { - for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { - funcs[_key] = arguments[_key]; - } - - if (funcs.length === 0) { - return function (arg) { - return arg; - }; - } - - if (funcs.length === 1) { - return funcs[0]; - } - - return funcs.reduce(function (a, b) { - return function () { - return a(b.apply(undefined, arguments)); - }; - }); -} - -/***/ }), -/* 566 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _defineProperties = __webpack_require__(827); - -var _defineProperties2 = _interopRequireDefault(_defineProperties); - -var _freeze = __webpack_require__(830); - -var _freeze2 = _interopRequireDefault(_freeze); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = function (strings, raw) { - return (0, _freeze2.default)((0, _defineProperties2.default)(strings, { - raw: { - value: (0, _freeze2.default)(raw) - } - })); -}; - -/***/ }), -/* 567 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__replaceSubstitutionTransformer__ = __webpack_require__(838); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__replaceSubstitutionTransformer__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXBsYWNlU3Vic3RpdHV0aW9uVHJhbnNmb3JtZXIvaW5kZXguanMiXSwibmFtZXMiOlsiZGVmYXVsdCJdLCJtYXBwaW5ncyI6IkFBQUE7O3FCQUVvQixrQztxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL3JlcGxhY2VTdWJzdGl0dXRpb25UcmFuc2Zvcm1lcidcbiJdfQ== - -/***/ }), -/* 568 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__removeNonPrintingValuesTransformer__ = __webpack_require__(841); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__removeNonPrintingValuesTransformer__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0Isc0M7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9yZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyJ1xuIl19 - -/***/ }), -/* 569 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports["default"] = { - noWobble: { stiffness: 170, damping: 26 }, // the default, if nothing provided - gentle: { stiffness: 120, damping: 14 }, - wobbly: { stiffness: 180, damping: 12 }, - stiff: { stiffness: 210, damping: 20 } -}; -module.exports = exports["default"]; - -/***/ }), -/* 570 */, -/* 571 */, -/* 572 */, -/* 573 */, -/* 574 */, -/* 575 */, -/* 576 */, -/* 577 */, -/* 578 */, -/* 579 */, -/* 580 */, -/* 581 */, -/* 582 */, -/* 583 */, -/* 584 */, -/* 585 */, -/* 586 */, -/* 587 */, -/* 588 */, -/* 589 */, -/* 590 */, -/* 591 */, -/* 592 */, -/* 593 */, -/* 594 */, -/* 595 */, -/* 596 */, -/* 597 */, -/* 598 */, -/* 599 */, -/* 600 */, -/* 601 */, -/* 602 */, -/* 603 */, -/* 604 */, -/* 605 */, -/* 606 */, -/* 607 */, -/* 608 */, -/* 609 */, -/* 610 */, -/* 611 */, -/* 612 */, -/* 613 */, -/* 614 */, -/* 615 */, -/* 616 */, -/* 617 */, -/* 618 */, -/* 619 */, -/* 620 */, -/* 621 */, -/* 622 */, -/* 623 */, -/* 624 */, -/* 625 */, -/* 626 */, -/* 627 */, -/* 628 */, -/* 629 */, -/* 630 */, -/* 631 */, -/* 632 */, -/* 633 */, -/* 634 */, -/* 635 */, -/* 636 */, -/* 637 */, -/* 638 */, -/* 639 */, -/* 640 */, -/* 641 */, -/* 642 */, -/* 643 */, -/* 644 */, -/* 645 */, -/* 646 */, -/* 647 */, -/* 648 */, -/* 649 */, -/* 650 */, -/* 651 */, -/* 652 */, -/* 653 */, -/* 654 */, -/* 655 */, -/* 656 */, -/* 657 */, -/* 658 */, -/* 659 */, -/* 660 */, -/* 661 */, -/* 662 */, -/* 663 */, -/* 664 */, -/* 665 */, -/* 666 */, -/* 667 */, -/* 668 */, -/* 669 */, -/* 670 */, -/* 671 */, -/* 672 */, -/* 673 */, -/* 674 */, -/* 675 */, -/* 676 */, -/* 677 */, -/* 678 */, -/* 679 */, -/* 680 */, -/* 681 */, -/* 682 */, -/* 683 */, -/* 684 */, -/* 685 */, -/* 686 */, -/* 687 */, -/* 688 */, -/* 689 */, -/* 690 */, -/* 691 */, -/* 692 */, -/* 693 */, -/* 694 */, -/* 695 */, -/* 696 */, -/* 697 */, -/* 698 */, -/* 699 */, -/* 700 */, -/* 701 */, -/* 702 */, -/* 703 */, -/* 704 */, -/* 705 */, -/* 706 */, -/* 707 */, -/* 708 */, -/* 709 */, -/* 710 */, -/* 711 */, -/* 712 */, -/* 713 */, -/* 714 */, -/* 715 */, -/* 716 */, -/* 717 */, -/* 718 */, -/* 719 */, -/* 720 */, -/* 721 */, -/* 722 */, -/* 723 */, -/* 724 */, -/* 725 */, -/* 726 */, -/* 727 */, -/* 728 */, -/* 729 */, -/* 730 */, -/* 731 */, -/* 732 */, -/* 733 */, -/* 734 */, -/* 735 */, -/* 736 */, -/* 737 */, -/* 738 */, -/* 739 */, -/* 740 */, -/* 741 */, -/* 742 */, -/* 743 */, -/* 744 */, -/* 745 */, -/* 746 */, -/* 747 */, -/* 748 */, -/* 749 */, -/* 750 */, -/* 751 */, -/* 752 */, -/* 753 */, -/* 754 */, -/* 755 */, -/* 756 */, -/* 757 */, -/* 758 */, -/* 759 */, -/* 760 */, -/* 761 */, -/* 762 */, -/* 763 */, -/* 764 */, -/* 765 */, -/* 766 */, -/* 767 */, -/* 768 */, -/* 769 */, -/* 770 */, -/* 771 */, -/* 772 */, -/* 773 */, -/* 774 */, -/* 775 */, -/* 776 */, -/* 777 */, -/* 778 */, -/* 779 */, -/* 780 */, -/* 781 */, -/* 782 */, -/* 783 */, -/* 784 */, -/* 785 */, -/* 786 */, -/* 787 */, -/* 788 */, -/* 789 */, -/* 790 */, -/* 791 */, -/* 792 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(333); -__webpack_require__(793); -__webpack_require__(794); -module.exports = __webpack_require__(806); - - -/***/ }), -/* 793 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/* globals window */ - -window.STORYBOOK_REACT_CLASSES = {}; -window.STORYBOOK_ENV = 'react'; - -/***/ }), -/* 794 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(__resourceQuery, module) {/*eslint-env browser*/ -/*global __resourceQuery __webpack_public_path__*/ - -var options = { - path: "/__webpack_hmr", - timeout: 20 * 1000, - overlay: true, - reload: false, - log: true, - warn: true, - name: '', - autoConnect: true -}; -if (true) { - var querystring = __webpack_require__(795); - var overrides = querystring.parse(__resourceQuery.slice(1)); - setOverrides(overrides); -} - -if (typeof window === 'undefined') { - // do nothing -} else if (typeof window.EventSource === 'undefined') { - console.warn( - "webpack-hot-middleware's client requires EventSource to work. " + - "You should include a polyfill if you want to support this browser: " + - "https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events#Tools" - ); -} else { - if (options.autoConnect) { - connect(); - } -} - -/* istanbul ignore next */ -function setOptionsAndConnect(overrides) { - setOverrides(overrides); - connect(); -} - -function setOverrides(overrides) { - if (overrides.autoConnect) options.autoConnect = overrides.autoConnect == 'true'; - if (overrides.path) options.path = overrides.path; - if (overrides.timeout) options.timeout = overrides.timeout; - if (overrides.overlay) options.overlay = overrides.overlay !== 'false'; - if (overrides.reload) options.reload = overrides.reload !== 'false'; - if (overrides.noInfo && overrides.noInfo !== 'false') { - options.log = false; - } - if (overrides.name) { - options.name = overrides.name; - } - if (overrides.quiet && overrides.quiet !== 'false') { - options.log = false; - options.warn = false; - } - - if (overrides.dynamicPublicPath) { - options.path = __webpack_require__.p + options.path; - } -} - -function EventSourceWrapper() { - var source; - var lastActivity = new Date(); - var listeners = []; - - init(); - var timer = setInterval(function() { - if ((new Date() - lastActivity) > options.timeout) { - handleDisconnect(); - } - }, options.timeout / 2); - - function init() { - source = new window.EventSource(options.path); - source.onopen = handleOnline; - source.onerror = handleDisconnect; - source.onmessage = handleMessage; - } - - function handleOnline() { - if (options.log) console.log("[HMR] connected"); - lastActivity = new Date(); - } - - function handleMessage(event) { - lastActivity = new Date(); - for (var i = 0; i < listeners.length; i++) { - listeners[i](event); - } - } - - function handleDisconnect() { - clearInterval(timer); - source.close(); - setTimeout(init, options.timeout); - } - - return { - addMessageListener: function(fn) { - listeners.push(fn); - } - }; -} - -function getEventSourceWrapper() { - if (!window.__whmEventSourceWrapper) { - window.__whmEventSourceWrapper = {}; - } - if (!window.__whmEventSourceWrapper[options.path]) { - // cache the wrapper for other entries loaded on - // the same page with the same options.path - window.__whmEventSourceWrapper[options.path] = EventSourceWrapper(); - } - return window.__whmEventSourceWrapper[options.path]; -} - -function connect() { - getEventSourceWrapper().addMessageListener(handleMessage); - - function handleMessage(event) { - if (event.data == "\uD83D\uDC93") { - return; - } - try { - processMessage(JSON.parse(event.data)); - } catch (ex) { - if (options.warn) { - console.warn("Invalid HMR message: " + event.data + "\n" + ex); - } - } - } -} - -// the reporter needs to be a singleton on the page -// in case the client is being used by multiple bundles -// we only want to report once. -// all the errors will go to all clients -var singletonKey = '__webpack_hot_middleware_reporter__'; -var reporter; -if (typeof window !== 'undefined') { - if (!window[singletonKey]) { - window[singletonKey] = createReporter(); - } - reporter = window[singletonKey]; -} - -function createReporter() { - var strip = __webpack_require__(798); - - var overlay; - if (typeof document !== 'undefined' && options.overlay) { - overlay = __webpack_require__(800); - } - - var styles = { - errors: "color: #ff0000;", - warnings: "color: #999933;" - }; - var previousProblems = null; - function log(type, obj) { - var newProblems = obj[type].map(function(msg) { return strip(msg); }).join('\n'); - if (previousProblems == newProblems) { - return; - } else { - previousProblems = newProblems; - } - - var style = styles[type]; - var name = obj.name ? "'" + obj.name + "' " : ""; - var title = "[HMR] bundle " + name + "has " + obj[type].length + " " + type; - // NOTE: console.warn or console.error will print the stack trace - // which isn't helpful here, so using console.log to escape it. - if (console.group && console.groupEnd) { - console.group("%c" + title, style); - console.log("%c" + newProblems, style); - console.groupEnd(); - } else { - console.log( - "%c" + title + "\n\t%c" + newProblems.replace(/\n/g, "\n\t"), - style + "font-weight: bold;", - style + "font-weight: normal;" - ); - } - } - - return { - cleanProblemsCache: function () { - previousProblems = null; - }, - problems: function(type, obj) { - if (options.warn) { - log(type, obj); - } - if (overlay && type !== 'warnings') overlay.showProblems(type, obj[type]); - }, - success: function() { - if (overlay) overlay.clear(); - }, - useCustomOverlay: function(customOverlay) { - overlay = customOverlay; - } - }; -} - -var processUpdate = __webpack_require__(805); - -var customHandler; -var subscribeAllHandler; -function processMessage(obj) { - switch(obj.action) { - case "building": - if (options.log) { - console.log( - "[HMR] bundle " + (obj.name ? "'" + obj.name + "' " : "") + - "rebuilding" - ); - } - break; - case "built": - if (options.log) { - console.log( - "[HMR] bundle " + (obj.name ? "'" + obj.name + "' " : "") + - "rebuilt in " + obj.time + "ms" - ); - } - // fall through - case "sync": - if (obj.name && options.name && obj.name !== options.name) { - return; - } - if (obj.errors.length > 0) { - if (reporter) reporter.problems('errors', obj); - } else { - if (reporter) { - if (obj.warnings.length > 0) { - reporter.problems('warnings', obj); - } else { - reporter.cleanProblemsCache(); - } - reporter.success(); - } - processUpdate(obj.hash, obj.modules, options); - } - break; - default: - if (customHandler) { - customHandler(obj); - } - } - - if (subscribeAllHandler) { - subscribeAllHandler(obj); - } -} - -if (module) { - module.exports = { - subscribeAll: function subscribeAll(handler) { - subscribeAllHandler = handler; - }, - subscribe: function subscribe(handler) { - customHandler = handler; - }, - useCustomOverlay: function useCustomOverlay(customOverlay) { - if (reporter) reporter.useCustomOverlay(customOverlay); - }, - setOptionsAndConnect: setOptionsAndConnect - }; -} - -/* WEBPACK VAR INJECTION */}.call(exports, "?reload=true", __webpack_require__(246)(module))) - -/***/ }), -/* 795 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.decode = exports.parse = __webpack_require__(796); -exports.encode = exports.stringify = __webpack_require__(797); - - -/***/ }), -/* 796 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -// If obj.hasOwnProperty has been overridden, then calling -// obj.hasOwnProperty(prop) will break. -// See: https://github.com/joyent/node/issues/1707 -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -module.exports = function(qs, sep, eq, options) { - sep = sep || '&'; - eq = eq || '='; - var obj = {}; - - if (typeof qs !== 'string' || qs.length === 0) { - return obj; - } - - var regexp = /\+/g; - qs = qs.split(sep); - - var maxKeys = 1000; - if (options && typeof options.maxKeys === 'number') { - maxKeys = options.maxKeys; - } - - var len = qs.length; - // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } - - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - kstr, vstr, k, v; - - if (idx >= 0) { - kstr = x.substr(0, idx); - vstr = x.substr(idx + 1); - } else { - kstr = x; - vstr = ''; - } - - k = decodeURIComponent(kstr); - v = decodeURIComponent(vstr); - - if (!hasOwnProperty(obj, k)) { - obj[k] = v; - } else if (isArray(obj[k])) { - obj[k].push(v); - } else { - obj[k] = [obj[k], v]; - } - } - - return obj; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - - -/***/ }), -/* 797 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - - - -var stringifyPrimitive = function(v) { - switch (typeof v) { - case 'string': - return v; - - case 'boolean': - return v ? 'true' : 'false'; - - case 'number': - return isFinite(v) ? v : ''; - - default: - return ''; - } -}; - -module.exports = function(obj, sep, eq, name) { - sep = sep || '&'; - eq = eq || '='; - if (obj === null) { - obj = undefined; - } - - if (typeof obj === 'object') { - return map(objectKeys(obj), function(k) { - var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; - if (isArray(obj[k])) { - return map(obj[k], function(v) { - return ks + encodeURIComponent(stringifyPrimitive(v)); - }).join(sep); - } else { - return ks + encodeURIComponent(stringifyPrimitive(obj[k])); - } - }).join(sep); - - } - - if (!name) return ''; - return encodeURIComponent(stringifyPrimitive(name)) + eq + - encodeURIComponent(stringifyPrimitive(obj)); -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -function map (xs, f) { - if (xs.map) return xs.map(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - res.push(f(xs[i], i)); - } - return res; -} - -var objectKeys = Object.keys || function (obj) { - var res = []; - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); - } - return res; -}; - - -/***/ }), -/* 798 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var ansiRegex = __webpack_require__(799)(); - -module.exports = function (str) { - return typeof str === 'string' ? str.replace(ansiRegex, '') : str; -}; - - -/***/ }), -/* 799 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; -}; - - -/***/ }), -/* 800 */ -/***/ (function(module, exports, __webpack_require__) { - -/*eslint-env browser*/ - -var clientOverlay = document.createElement('div'); -clientOverlay.id = 'webpack-hot-middleware-clientOverlay'; -var styles = { - background: 'rgba(0,0,0,0.85)', - color: '#E8E8E8', - lineHeight: '1.2', - whiteSpace: 'pre', - fontFamily: 'Menlo, Consolas, monospace', - fontSize: '13px', - position: 'fixed', - zIndex: 9999, - padding: '10px', - left: 0, - right: 0, - top: 0, - bottom: 0, - overflow: 'auto', - dir: 'ltr', - textAlign: 'left' -}; -for (var key in styles) { - clientOverlay.style[key] = styles[key]; -} - -var ansiHTML = __webpack_require__(801); -var colors = { - reset: ['transparent', 'transparent'], - black: '181818', - red: 'E36049', - green: 'B3CB74', - yellow: 'FFD080', - blue: '7CAFC2', - magenta: '7FACCA', - cyan: 'C3C2EF', - lightgrey: 'EBE7E3', - darkgrey: '6D7891' -}; -ansiHTML.setColors(colors); - -var Entities = __webpack_require__(802).AllHtmlEntities; -var entities = new Entities(); - -exports.showProblems = -function showProblems(type, lines) { - clientOverlay.innerHTML = ''; - lines.forEach(function(msg) { - msg = ansiHTML(entities.encode(msg)); - var div = document.createElement('div'); - div.style.marginBottom = '26px'; - div.innerHTML = problemType(type) + ' in ' + msg; - clientOverlay.appendChild(div); - }); - if (document.body) { - document.body.appendChild(clientOverlay); - } -}; - -exports.clear = -function clear() { - if (document.body && clientOverlay.parentNode) { - document.body.removeChild(clientOverlay); - } -}; - -var problemColors = { - errors: colors.red, - warnings: colors.yellow -}; - -function problemType (type) { - var color = problemColors[type] || colors.red; - return ( - '<span style="background-color:#' + color + '; color:#fff; padding:2px 4px; border-radius: 2px">' + - type.slice(0, -1).toUpperCase() + - '</span>' - ); -} - - -/***/ }), -/* 801 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -module.exports = ansiHTML - -// Reference to https://github.com/sindresorhus/ansi-regex -var _regANSI = /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/ - -var _defColors = { - reset: ['fff', '000'], // [FOREGROUD_COLOR, BACKGROUND_COLOR] - black: '000', - red: 'ff0000', - green: '209805', - yellow: 'e8bf03', - blue: '0000ff', - magenta: 'ff00ff', - cyan: '00ffee', - lightgrey: 'f0f0f0', - darkgrey: '888' -} -var _styles = { - 30: 'black', - 31: 'red', - 32: 'green', - 33: 'yellow', - 34: 'blue', - 35: 'magenta', - 36: 'cyan', - 37: 'lightgrey' -} -var _openTags = { - '1': 'font-weight:bold', // bold - '2': 'opacity:0.5', // dim - '3': '<i>', // italic - '4': '<u>', // underscore - '8': 'display:none', // hidden - '9': '<del>' // delete -} -var _closeTags = { - '23': '</i>', // reset italic - '24': '</u>', // reset underscore - '29': '</del>' // reset delete -} - -;[0, 21, 22, 27, 28, 39, 49].forEach(function (n) { - _closeTags[n] = '</span>' -}) - -/** - * Converts text with ANSI color codes to HTML markup. - * @param {String} text - * @returns {*} - */ -function ansiHTML (text) { - // Returns the text if the string has no ANSI escape code. - if (!_regANSI.test(text)) { - return text - } - - // Cache opened sequence. - var ansiCodes = [] - // Replace with markup. - var ret = text.replace(/\033\[(\d+)*m/g, function (match, seq) { - var ot = _openTags[seq] - if (ot) { - // If current sequence has been opened, close it. - if (!!~ansiCodes.indexOf(seq)) { // eslint-disable-line no-extra-boolean-cast - ansiCodes.pop() - return '</span>' - } - // Open tag. - ansiCodes.push(seq) - return ot[0] === '<' ? ot : '<span style="' + ot + ';">' - } - - var ct = _closeTags[seq] - if (ct) { - // Pop sequence - ansiCodes.pop() - return ct - } - return '' - }) - - // Make sure tags are closed. - var l = ansiCodes.length - ;(l > 0) && (ret += Array(l + 1).join('</span>')) - - return ret -} - -/** - * Customize colors. - * @param {Object} colors reference to _defColors - */ -ansiHTML.setColors = function (colors) { - if (typeof colors !== 'object') { - throw new Error('`colors` parameter must be an Object.') - } - - var _finalColors = {} - for (var key in _defColors) { - var hex = colors.hasOwnProperty(key) ? colors[key] : null - if (!hex) { - _finalColors[key] = _defColors[key] - continue - } - if ('reset' === key) { - if (typeof hex === 'string') { - hex = [hex] - } - if (!Array.isArray(hex) || hex.length === 0 || hex.some(function (h) { - return typeof h !== 'string' - })) { - throw new Error('The value of `' + key + '` property must be an Array and each item could only be a hex string, e.g.: FF0000') - } - var defHexColor = _defColors[key] - if (!hex[0]) { - hex[0] = defHexColor[0] - } - if (hex.length === 1 || !hex[1]) { - hex = [hex[0]] - hex.push(defHexColor[1]) - } - - hex = hex.slice(0, 2) - } else if (typeof hex !== 'string') { - throw new Error('The value of `' + key + '` property must be a hex string, e.g.: FF0000') - } - _finalColors[key] = hex - } - _setTags(_finalColors) -} - -/** - * Reset colors. - */ -ansiHTML.reset = function () { - _setTags(_defColors) -} - -/** - * Expose tags, including open and close. - * @type {Object} - */ -ansiHTML.tags = {} - -if (Object.defineProperty) { - Object.defineProperty(ansiHTML.tags, 'open', { - get: function () { return _openTags } - }) - Object.defineProperty(ansiHTML.tags, 'close', { - get: function () { return _closeTags } - }) -} else { - ansiHTML.tags.open = _openTags - ansiHTML.tags.close = _closeTags -} - -function _setTags (colors) { - // reset all - _openTags['0'] = 'font-weight:normal;opacity:1;color:#' + colors.reset[0] + ';background:#' + colors.reset[1] - // inverse - _openTags['7'] = 'color:#' + colors.reset[1] + ';background:#' + colors.reset[0] - // dark grey - _openTags['90'] = 'color:#' + colors.darkgrey - - for (var code in _styles) { - var color = _styles[code] - var oriColor = colors[color] || '000' - _openTags[code] = 'color:#' + oriColor - code = parseInt(code) - _openTags[(code + 10).toString()] = 'background:#' + oriColor - } -} - -ansiHTML.reset() - - -/***/ }), -/* 802 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { - XmlEntities: __webpack_require__(803), - Html4Entities: __webpack_require__(804), - Html5Entities: __webpack_require__(558), - AllHtmlEntities: __webpack_require__(558) -}; - - -/***/ }), -/* 803 */ -/***/ (function(module, exports) { - -var ALPHA_INDEX = { - '<': '<', - '>': '>', - '"': '"', - '&apos': '\'', - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': '\'', - '&': '&' -}; - -var CHAR_INDEX = { - 60: 'lt', - 62: 'gt', - 34: 'quot', - 39: 'apos', - 38: 'amp' -}; - -var CHAR_S_INDEX = { - '<': '<', - '>': '>', - '"': '"', - '\'': ''', - '&': '&' -}; - -/** - * @constructor - */ -function XmlEntities() {} - -/** - * @param {String} str - * @returns {String} - */ -XmlEntities.prototype.encode = function(str) { - if (!str || !str.length) { - return ''; - } - return str.replace(/<|>|"|'|&/g, function(s) { - return CHAR_S_INDEX[s]; - }); -}; - -/** - * @param {String} str - * @returns {String} - */ - XmlEntities.encode = function(str) { - return new XmlEntities().encode(str); - }; - -/** - * @param {String} str - * @returns {String} - */ -XmlEntities.prototype.decode = function(str) { - if (!str || !str.length) { - return ''; - } - return str.replace(/&#?[0-9a-zA-Z]+;?/g, function(s) { - if (s.charAt(1) === '#') { - var code = s.charAt(2).toLowerCase() === 'x' ? - parseInt(s.substr(3), 16) : - parseInt(s.substr(2)); - - if (isNaN(code) || code < -32768 || code > 65535) { - return ''; - } - return String.fromCharCode(code); - } - return ALPHA_INDEX[s] || s; - }); -}; - -/** - * @param {String} str - * @returns {String} - */ - XmlEntities.decode = function(str) { - return new XmlEntities().decode(str); - }; - -/** - * @param {String} str - * @returns {String} - */ -XmlEntities.prototype.encodeNonUTF = function(str) { - if (!str || !str.length) { - return ''; - } - var strLength = str.length; - var result = ''; - var i = 0; - while (i < strLength) { - var c = str.charCodeAt(i); - var alpha = CHAR_INDEX[c]; - if (alpha) { - result += "&" + alpha + ";"; - i++; - continue; - } - if (c < 32 || c > 126) { - result += '&#' + c + ';'; - } else { - result += str.charAt(i); - } - i++; - } - return result; -}; - -/** - * @param {String} str - * @returns {String} - */ - XmlEntities.encodeNonUTF = function(str) { - return new XmlEntities().encodeNonUTF(str); - }; - -/** - * @param {String} str - * @returns {String} - */ -XmlEntities.prototype.encodeNonASCII = function(str) { - if (!str || !str.length) { - return ''; - } - var strLenght = str.length; - var result = ''; - var i = 0; - while (i < strLenght) { - var c = str.charCodeAt(i); - if (c <= 255) { - result += str[i++]; - continue; - } - result += '&#' + c + ';'; - i++; - } - return result; -}; - -/** - * @param {String} str - * @returns {String} - */ - XmlEntities.encodeNonASCII = function(str) { - return new XmlEntities().encodeNonASCII(str); - }; - -module.exports = XmlEntities; - - -/***/ }), -/* 804 */ -/***/ (function(module, exports) { - -var HTML_ALPHA = ['apos', 'nbsp', 'iexcl', 'cent', 'pound', 'curren', 'yen', 'brvbar', 'sect', 'uml', 'copy', 'ordf', 'laquo', 'not', 'shy', 'reg', 'macr', 'deg', 'plusmn', 'sup2', 'sup3', 'acute', 'micro', 'para', 'middot', 'cedil', 'sup1', 'ordm', 'raquo', 'frac14', 'frac12', 'frac34', 'iquest', 'Agrave', 'Aacute', 'Acirc', 'Atilde', 'Auml', 'Aring', 'Aelig', 'Ccedil', 'Egrave', 'Eacute', 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml', 'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde', 'Ouml', 'times', 'Oslash', 'Ugrave', 'Uacute', 'Ucirc', 'Uuml', 'Yacute', 'THORN', 'szlig', 'agrave', 'aacute', 'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil', 'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute', 'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute', 'ocirc', 'otilde', 'ouml', 'divide', 'oslash', 'ugrave', 'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml', 'quot', 'amp', 'lt', 'gt', 'OElig', 'oelig', 'Scaron', 'scaron', 'Yuml', 'circ', 'tilde', 'ensp', 'emsp', 'thinsp', 'zwnj', 'zwj', 'lrm', 'rlm', 'ndash', 'mdash', 'lsquo', 'rsquo', 'sbquo', 'ldquo', 'rdquo', 'bdquo', 'dagger', 'Dagger', 'permil', 'lsaquo', 'rsaquo', 'euro', 'fnof', 'Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Xi', 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'Phi', 'Chi', 'Psi', 'Omega', 'alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho', 'sigmaf', 'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega', 'thetasym', 'upsih', 'piv', 'bull', 'hellip', 'prime', 'Prime', 'oline', 'frasl', 'weierp', 'image', 'real', 'trade', 'alefsym', 'larr', 'uarr', 'rarr', 'darr', 'harr', 'crarr', 'lArr', 'uArr', 'rArr', 'dArr', 'hArr', 'forall', 'part', 'exist', 'empty', 'nabla', 'isin', 'notin', 'ni', 'prod', 'sum', 'minus', 'lowast', 'radic', 'prop', 'infin', 'ang', 'and', 'or', 'cap', 'cup', 'int', 'there4', 'sim', 'cong', 'asymp', 'ne', 'equiv', 'le', 'ge', 'sub', 'sup', 'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp', 'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang', 'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams']; -var HTML_CODES = [39, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 34, 38, 60, 62, 338, 339, 352, 353, 376, 710, 732, 8194, 8195, 8201, 8204, 8205, 8206, 8207, 8211, 8212, 8216, 8217, 8218, 8220, 8221, 8222, 8224, 8225, 8240, 8249, 8250, 8364, 402, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 977, 978, 982, 8226, 8230, 8242, 8243, 8254, 8260, 8472, 8465, 8476, 8482, 8501, 8592, 8593, 8594, 8595, 8596, 8629, 8656, 8657, 8658, 8659, 8660, 8704, 8706, 8707, 8709, 8711, 8712, 8713, 8715, 8719, 8721, 8722, 8727, 8730, 8733, 8734, 8736, 8743, 8744, 8745, 8746, 8747, 8756, 8764, 8773, 8776, 8800, 8801, 8804, 8805, 8834, 8835, 8836, 8838, 8839, 8853, 8855, 8869, 8901, 8968, 8969, 8970, 8971, 9001, 9002, 9674, 9824, 9827, 9829, 9830]; - -var alphaIndex = {}; -var numIndex = {}; - -var i = 0; -var length = HTML_ALPHA.length; -while (i < length) { - var a = HTML_ALPHA[i]; - var c = HTML_CODES[i]; - alphaIndex[a] = String.fromCharCode(c); - numIndex[c] = a; - i++; -} - -/** - * @constructor - */ -function Html4Entities() {} - -/** - * @param {String} str - * @returns {String} - */ -Html4Entities.prototype.decode = function(str) { - if (!str || !str.length) { - return ''; - } - return str.replace(/&(#?[\w\d]+);?/g, function(s, entity) { - var chr; - if (entity.charAt(0) === "#") { - var code = entity.charAt(1).toLowerCase() === 'x' ? - parseInt(entity.substr(2), 16) : - parseInt(entity.substr(1)); - - if (!(isNaN(code) || code < -32768 || code > 65535)) { - chr = String.fromCharCode(code); - } - } else { - chr = alphaIndex[entity]; - } - return chr || s; - }); -}; - -/** - * @param {String} str - * @returns {String} - */ -Html4Entities.decode = function(str) { - return new Html4Entities().decode(str); -}; - -/** - * @param {String} str - * @returns {String} - */ -Html4Entities.prototype.encode = function(str) { - if (!str || !str.length) { - return ''; - } - var strLength = str.length; - var result = ''; - var i = 0; - while (i < strLength) { - var alpha = numIndex[str.charCodeAt(i)]; - result += alpha ? "&" + alpha + ";" : str.charAt(i); - i++; - } - return result; -}; - -/** - * @param {String} str - * @returns {String} - */ -Html4Entities.encode = function(str) { - return new Html4Entities().encode(str); -}; - -/** - * @param {String} str - * @returns {String} - */ -Html4Entities.prototype.encodeNonUTF = function(str) { - if (!str || !str.length) { - return ''; - } - var strLength = str.length; - var result = ''; - var i = 0; - while (i < strLength) { - var cc = str.charCodeAt(i); - var alpha = numIndex[cc]; - if (alpha) { - result += "&" + alpha + ";"; - } else if (cc < 32 || cc > 126) { - result += "&#" + cc + ";"; - } else { - result += str.charAt(i); - } - i++; - } - return result; -}; - -/** - * @param {String} str - * @returns {String} - */ -Html4Entities.encodeNonUTF = function(str) { - return new Html4Entities().encodeNonUTF(str); -}; - -/** - * @param {String} str - * @returns {String} - */ -Html4Entities.prototype.encodeNonASCII = function(str) { - if (!str || !str.length) { - return ''; - } - var strLength = str.length; - var result = ''; - var i = 0; - while (i < strLength) { - var c = str.charCodeAt(i); - if (c <= 255) { - result += str[i++]; - continue; - } - result += '&#' + c + ';'; - i++; - } - return result; -}; - -/** - * @param {String} str - * @returns {String} - */ -Html4Entities.encodeNonASCII = function(str) { - return new Html4Entities().encodeNonASCII(str); -}; - -module.exports = Html4Entities; - - -/***/ }), -/* 805 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * Based heavily on https://github.com/webpack/webpack/blob/ - * c0afdf9c6abc1dd70707c594e473802a566f7b6e/hot/only-dev-server.js - * Original copyright Tobias Koppers @sokra (MIT license) - */ - -/* global window __webpack_hash__ */ - -if (false) { - throw new Error("[HMR] Hot Module Replacement is disabled."); -} - -var hmrDocsUrl = "https://webpack.js.org/concepts/hot-module-replacement/"; // eslint-disable-line max-len - -var lastHash; -var failureStatuses = { abort: 1, fail: 1 }; -var applyOptions = { ignoreUnaccepted: true }; - -function upToDate(hash) { - if (hash) lastHash = hash; - return lastHash == __webpack_require__.h(); -} - -module.exports = function(hash, moduleMap, options) { - var reload = options.reload; - if (!upToDate(hash) && module.hot.status() == "idle") { - if (options.log) console.log("[HMR] Checking for updates on the server..."); - check(); - } - - function check() { - var cb = function(err, updatedModules) { - if (err) return handleError(err); - - if(!updatedModules) { - if (options.warn) { - console.warn("[HMR] Cannot find update (Full reload needed)"); - console.warn("[HMR] (Probably because of restarting the server)"); - } - performReload(); - return null; - } - - var applyCallback = function(applyErr, renewedModules) { - if (applyErr) return handleError(applyErr); - - if (!upToDate()) check(); - - logUpdates(updatedModules, renewedModules); - }; - - var applyResult = module.hot.apply(applyOptions, applyCallback); - // webpack 2 promise - if (applyResult && applyResult.then) { - // HotModuleReplacement.runtime.js refers to the result as `outdatedModules` - applyResult.then(function(outdatedModules) { - applyCallback(null, outdatedModules); - }); - applyResult.catch(applyCallback); - } - - }; - - var result = module.hot.check(false, cb); - // webpack 2 promise - if (result && result.then) { - result.then(function(updatedModules) { - cb(null, updatedModules); - }); - result.catch(cb); - } - } - - function logUpdates(updatedModules, renewedModules) { - var unacceptedModules = updatedModules.filter(function(moduleId) { - return renewedModules && renewedModules.indexOf(moduleId) < 0; - }); - - if(unacceptedModules.length > 0) { - if (options.warn) { - console.warn( - "[HMR] The following modules couldn't be hot updated: " + - "(Full reload needed)\n" + - "This is usually because the modules which have changed " + - "(and their parents) do not know how to hot reload themselves. " + - "See " + hmrDocsUrl + " for more details." - ); - unacceptedModules.forEach(function(moduleId) { - console.warn("[HMR] - " + moduleMap[moduleId]); - }); - } - performReload(); - return; - } - - if (options.log) { - if(!renewedModules || renewedModules.length === 0) { - console.log("[HMR] Nothing hot updated."); - } else { - console.log("[HMR] Updated modules:"); - renewedModules.forEach(function(moduleId) { - console.log("[HMR] - " + moduleMap[moduleId]); - }); - } - - if (upToDate()) { - console.log("[HMR] App is up to date."); - } - } - } - - function handleError(err) { - if (module.hot.status() in failureStatuses) { - if (options.warn) { - console.warn("[HMR] Cannot check for update (Full reload needed)"); - console.warn("[HMR] " + err.stack || err.message); - } - performReload(); - return; - } - if (options.warn) { - console.warn("[HMR] Update check failed: " + err.stack || err.message); - } - } - - function performReload() { - if (reload) { - if (options.warn) console.warn("[HMR] Reloading page"); - window.location.reload(); - } - } -}; - - -/***/ }), -/* 806 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__storybook_react__ = __webpack_require__(500); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__storybook_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__storybook_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_loki_configure_react__ = __webpack_require__(879); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_loki_configure_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_loki_configure_react__); -/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions */ - - - - -function loadStories() { - __webpack_require__(883); -} - -Object(__WEBPACK_IMPORTED_MODULE_0__storybook_react__["configure"])(loadStories, module); -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(559)(module))) - -/***/ }), -/* 807 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) { -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22))) - -/***/ }), -/* 808 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(561); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(820); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(821); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(822); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(565); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(564); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__["a"]; }); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__["a"]; }); - - - - - - - -/* -* This is a dummy function to check if the function name has been altered by minification. -* If the function has been minified and NODE_ENV !== 'production', warn the user. -*/ -function isCrushed() {} - -if ("development" !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') { - Object(__WEBPACK_IMPORTED_MODULE_5__utils_warning__["a" /* default */])('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); -} - - - -/***/ }), -/* 809 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(563); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(812); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(813); - - - - -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? Object(__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */])(value) - : Object(__WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */])(value); -} - -/* harmony default export */ __webpack_exports__["a"] = (baseGetTag); - - -/***/ }), -/* 810 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(811); - - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || freeSelf || Function('return this')(); - -/* harmony default export */ __webpack_exports__["a"] = (root); - - -/***/ }), -/* 811 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/* harmony default export */ __webpack_exports__["a"] = (freeGlobal); - -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(22))) - -/***/ }), -/* 812 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(563); - - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Built-in value references. */ -var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; - - try { - value[symToStringTag] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; - } - } - return result; -} - -/* harmony default export */ __webpack_exports__["a"] = (getRawTag); - - -/***/ }), -/* 813 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} - -/* harmony default export */ __webpack_exports__["a"] = (objectToString); - - -/***/ }), -/* 814 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(815); - - -/** Built-in value references. */ -var getPrototype = Object(__WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */])(Object.getPrototypeOf, Object); - -/* harmony default export */ __webpack_exports__["a"] = (getPrototype); - - -/***/ }), -/* 815 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/* harmony default export */ __webpack_exports__["a"] = (overArg); - - -/***/ }), -/* 816 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -/* harmony default export */ __webpack_exports__["a"] = (isObjectLike); - - -/***/ }), -/* 817 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(818); - - -/***/ }), -/* 818 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, module) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _ponyfill = __webpack_require__(819); - -var _ponyfill2 = _interopRequireDefault(_ponyfill); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var root; /* global window */ - - -if (typeof self !== 'undefined') { - root = self; -} else if (typeof window !== 'undefined') { - root = window; -} else if (typeof global !== 'undefined') { - root = global; -} else if (true) { - root = module; -} else { - root = Function('return this')(); -} - -var result = (0, _ponyfill2['default'])(root); -exports['default'] = result; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22), __webpack_require__(246)(module))) - -/***/ }), -/* 819 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports['default'] = symbolObservablePonyfill; -function symbolObservablePonyfill(root) { - var result; - var _Symbol = root.Symbol; - - if (typeof _Symbol === 'function') { - if (_Symbol.observable) { - result = _Symbol.observable; - } else { - result = _Symbol('observable'); - _Symbol.observable = result; - } - } else { - result = '@@observable'; - } - - return result; -}; - -/***/ }), -/* 820 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(561); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(562); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(564); - - - - -function getUndefinedStateErrorMessage(key, action) { - var actionType = action && action.type; - var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; - - return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; -} - -function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { - var reducerKeys = Object.keys(reducers); - var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; - - if (reducerKeys.length === 0) { - return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; - } - - if (!Object(__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__["a" /* default */])(inputState)) { - return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); - } - - var unexpectedKeys = Object.keys(inputState).filter(function (key) { - return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; - }); - - unexpectedKeys.forEach(function (key) { - unexpectedKeyCache[key] = true; - }); - - if (unexpectedKeys.length > 0) { - return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); - } -} - -function assertReducerShape(reducers) { - Object.keys(reducers).forEach(function (key) { - var reducer = reducers[key]; - var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT }); - - if (typeof initialState === 'undefined') { - throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.'); - } - - var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); - if (typeof reducer(undefined, { type: type }) === 'undefined') { - throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.'); - } - }); -} - -/** - * Turns an object whose values are different reducer functions, into a single - * reducer function. It will call every child reducer, and gather their results - * into a single state object, whose keys correspond to the keys of the passed - * reducer functions. - * - * @param {Object} reducers An object whose values correspond to different - * reducer functions that need to be combined into one. One handy way to obtain - * it is to use ES6 `import * as reducers` syntax. The reducers may never return - * undefined for any action. Instead, they should return their initial state - * if the state passed to them was undefined, and the current state for any - * unrecognized action. - * - * @returns {Function} A reducer function that invokes every reducer inside the - * passed object, and builds a state object with the same shape. - */ -function combineReducers(reducers) { - var reducerKeys = Object.keys(reducers); - var finalReducers = {}; - for (var i = 0; i < reducerKeys.length; i++) { - var key = reducerKeys[i]; - - if (true) { - if (typeof reducers[key] === 'undefined') { - Object(__WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */])('No reducer provided for key "' + key + '"'); - } - } - - if (typeof reducers[key] === 'function') { - finalReducers[key] = reducers[key]; - } - } - var finalReducerKeys = Object.keys(finalReducers); - - var unexpectedKeyCache = void 0; - if (true) { - unexpectedKeyCache = {}; - } - - var shapeAssertionError = void 0; - try { - assertReducerShape(finalReducers); - } catch (e) { - shapeAssertionError = e; - } - - return function combination() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var action = arguments[1]; - - if (shapeAssertionError) { - throw shapeAssertionError; - } - - if (true) { - var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); - if (warningMessage) { - Object(__WEBPACK_IMPORTED_MODULE_2__utils_warning__["a" /* default */])(warningMessage); - } - } - - var hasChanged = false; - var nextState = {}; - for (var _i = 0; _i < finalReducerKeys.length; _i++) { - var _key = finalReducerKeys[_i]; - var reducer = finalReducers[_key]; - var previousStateForKey = state[_key]; - var nextStateForKey = reducer(previousStateForKey, action); - if (typeof nextStateForKey === 'undefined') { - var errorMessage = getUndefinedStateErrorMessage(_key, action); - throw new Error(errorMessage); - } - nextState[_key] = nextStateForKey; - hasChanged = hasChanged || nextStateForKey !== previousStateForKey; - } - return hasChanged ? nextState : state; - }; -} - -/***/ }), -/* 821 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = bindActionCreators; -function bindActionCreator(actionCreator, dispatch) { - return function () { - return dispatch(actionCreator.apply(undefined, arguments)); - }; -} - -/** - * Turns an object whose values are action creators, into an object with the - * same keys, but with every function wrapped into a `dispatch` call so they - * may be invoked directly. This is just a convenience method, as you can call - * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. - * - * For convenience, you can also pass a single function as the first argument, - * and get a function in return. - * - * @param {Function|Object} actionCreators An object whose values are action - * creator functions. One handy way to obtain it is to use ES6 `import * as` - * syntax. You may also pass a single function. - * - * @param {Function} dispatch The `dispatch` function available on your Redux - * store. - * - * @returns {Function|Object} The object mimicking the original object, but with - * every action creator wrapped into the `dispatch` call. If you passed a - * function as `actionCreators`, the return value will also be a single - * function. - */ -function bindActionCreators(actionCreators, dispatch) { - if (typeof actionCreators === 'function') { - return bindActionCreator(actionCreators, dispatch); - } - - if (typeof actionCreators !== 'object' || actionCreators === null) { - throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); - } - - var keys = Object.keys(actionCreators); - var boundActionCreators = {}; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var actionCreator = actionCreators[key]; - if (typeof actionCreator === 'function') { - boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); - } - } - return boundActionCreators; -} - -/***/ }), -/* 822 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(565); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - - -/** - * Creates a store enhancer that applies middleware to the dispatch method - * of the Redux store. This is handy for a variety of tasks, such as expressing - * asynchronous actions in a concise manner, or logging every action payload. - * - * See `redux-thunk` package as an example of the Redux middleware. - * - * Because middleware is potentially asynchronous, this should be the first - * store enhancer in the composition chain. - * - * Note that each middleware will be given the `dispatch` and `getState` functions - * as named arguments. - * - * @param {...Function} middlewares The middleware chain to be applied. - * @returns {Function} A store enhancer applying the middleware. - */ -function applyMiddleware() { - for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { - middlewares[_key] = arguments[_key]; - } - - return function (createStore) { - return function (reducer, preloadedState, enhancer) { - var store = createStore(reducer, preloadedState, enhancer); - var _dispatch = store.dispatch; - var chain = []; - - var middlewareAPI = { - getState: store.getState, - dispatch: function dispatch(action) { - return _dispatch(action); - } - }; - chain = middlewares.map(function (middleware) { - return middleware(middlewareAPI); - }); - _dispatch = __WEBPACK_IMPORTED_MODULE_0__compose__["a" /* default */].apply(undefined, chain)(store.dispatch); - - return _extends({}, store, { - dispatch: _dispatch - }); - }; - }; -} - -/***/ }), -/* 823 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _keys = __webpack_require__(45); - -var _keys2 = _interopRequireDefault(_keys); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint no-underscore-dangle: 0 */ - -var count = 0; - -function getId() { - count += 1; - return count; -} - -var StoryStore = function () { - function StoryStore() { - (0, _classCallCheck3.default)(this, StoryStore); - - this._data = {}; - } - - (0, _createClass3.default)(StoryStore, [{ - key: "addStory", - value: function addStory(kind, name, fn) { - if (!this._data[kind]) { - this._data[kind] = { - kind: kind, - index: getId(), - stories: {} - }; - } - - this._data[kind].stories[name] = { - name: name, - index: getId(), - fn: fn - }; - } - }, { - key: "getStoryKinds", - value: function getStoryKinds() { - var _this = this; - - return (0, _keys2.default)(this._data).map(function (key) { - return _this._data[key]; - }).filter(function (kind) { - return (0, _keys2.default)(kind.stories).length > 0; - }).sort(function (info1, info2) { - return info1.index - info2.index; - }).map(function (info) { - return info.kind; - }); - } - }, { - key: "getStories", - value: function getStories(kind) { - var _this2 = this; - - if (!this._data[kind]) { - return []; - } - - return (0, _keys2.default)(this._data[kind].stories).map(function (name) { - return _this2._data[kind].stories[name]; - }).sort(function (info1, info2) { - return info1.index - info2.index; - }).map(function (info) { - return info.name; - }); - } - }, { - key: "getStory", - value: function getStory(kind, name) { - var storiesKind = this._data[kind]; - if (!storiesKind) { - return null; - } - - var storyInfo = storiesKind.stories[name]; - if (!storyInfo) { - return null; - } - - return storyInfo.fn; - } - }, { - key: "removeStoryKind", - value: function removeStoryKind(kind) { - this._data[kind].stories = {}; - } - }, { - key: "hasStoryKind", - value: function hasStoryKind(kind) { - return Boolean(this._data[kind]); - } - }, { - key: "hasStory", - value: function hasStory(kind, name) { - return Boolean(this.getStory(kind, name)); - } - }, { - key: "dumpStoryBook", - value: function dumpStoryBook() { - var _this3 = this; - - var data = this.getStoryKinds().map(function (kind) { - return { kind: kind, stories: _this3.getStories(kind) }; - }); - - return data; - } - }, { - key: "size", - value: function size() { - return (0, _keys2.default)(this._data).length; - } - }, { - key: "clean", - value: function clean() { - var _this4 = this; - - this.getStoryKinds().forEach(function (kind) { - return delete _this4._data[kind]; - }); - } - }]); - return StoryStore; -}(); - -exports.default = StoryStore; - -/***/ }), -/* 824 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _toConsumableArray2 = __webpack_require__(47); - -var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); - -var _keys = __webpack_require__(45); - -var _keys2 = _interopRequireDefault(_keys); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint no-underscore-dangle: 0 */ - -var ClientApi = function () { - function ClientApi(_ref) { - var channel = _ref.channel, - storyStore = _ref.storyStore; - (0, _classCallCheck3.default)(this, ClientApi); - - // channel can be null when running in node - // always check whether channel is available - this._channel = channel; - this._storyStore = storyStore; - this._addons = {}; - this._globalDecorators = []; - } - - (0, _createClass3.default)(ClientApi, [{ - key: 'setAddon', - value: function setAddon(addon) { - this._addons = (0, _extends3.default)({}, this._addons, addon); - } - }, { - key: 'addDecorator', - value: function addDecorator(decorator) { - this._globalDecorators.push(decorator); - } - }, { - key: 'clearDecorators', - value: function clearDecorators() { - this._globalDecorators = []; - } - }, { - key: 'storiesOf', - value: function storiesOf(kind, m) { - var _this = this; - - if (!kind && typeof kind !== 'string') { - throw new Error('Invalid or missing kind provided for stories, should be a string'); - } - - if (!m) { - // eslint-disable-next-line no-console - console.warn('Missing \'module\' parameter for story with a kind of \'' + kind + '\'. It will break your HMR'); - } - - if (m && m.hot) { - m.hot.dispose(function () { - _this._storyStore.removeStoryKind(kind); - }); - } - - var localDecorators = []; - var api = { - kind: kind - }; - - // apply addons - (0, _keys2.default)(this._addons).forEach(function (name) { - var addon = _this._addons[name]; - api[name] = function () { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - addon.apply(api, args); - return api; - }; - }); - - api.add = function (storyName, getStory) { - if (typeof storyName !== 'string') { - throw new Error('Invalid or missing storyName provided for a "' + kind + '" story.'); - } - - if (_this._storyStore.hasStory(kind, storyName)) { - throw new Error('Story of "' + kind + '" named "' + storyName + '" already exists'); - } - - // Wrap the getStory function with each decorator. The first - // decorator will wrap the story function. The second will - // wrap the first decorator and so on. - var decorators = [].concat(localDecorators, (0, _toConsumableArray3.default)(_this._globalDecorators)); - - var fn = decorators.reduce(function (decorated, decorator) { - return function (context) { - return decorator(function () { - return decorated(context); - }, context); - }; - }, getStory); - - // Add the fully decorated getStory function. - _this._storyStore.addStory(kind, storyName, fn); - return api; - }; - - api.addDecorator = function (decorator) { - localDecorators.push(decorator); - return api; - }; - - return api; - } - }, { - key: 'getStorybook', - value: function getStorybook() { - var _this2 = this; - - return this._storyStore.getStoryKinds().map(function (kind) { - var stories = _this2._storyStore.getStories(kind).map(function (name) { - var render = _this2._storyStore.getStory(kind, name); - return { name: name, render: render }; - }); - return { kind: kind, stories: stories }; - }); - } - }]); - return ClientApi; -}(); - -exports.default = ClientApi; - -/***/ }), -/* 825 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _classCallCheck2 = __webpack_require__(5); - -var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); - -var _createClass2 = __webpack_require__(6); - -var _createClass3 = _interopRequireDefault(_createClass2); - -var _global = __webpack_require__(85); - -var _actions = __webpack_require__(247); - -var _ = __webpack_require__(560); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ConfigApi = function () { - function ConfigApi(_ref) { - var channel = _ref.channel, - storyStore = _ref.storyStore, - reduxStore = _ref.reduxStore; - (0, _classCallCheck3.default)(this, ConfigApi); - - // channel can be null when running in node - // always check whether channel is available - this._channel = channel; - this._storyStore = storyStore; - this._reduxStore = reduxStore; - } - - (0, _createClass3.default)(ConfigApi, [{ - key: '_renderMain', - value: function _renderMain(loaders) { - if (loaders) loaders(); - - var stories = this._storyStore.dumpStoryBook(); - // send to the parent frame. - this._channel.emit('setStories', { stories: stories }); - - // clear the error if exists. - this._reduxStore.dispatch((0, _actions.clearError)()); - this._reduxStore.dispatch((0, _actions.setInitialStory)(stories)); - } - }, { - key: '_renderError', - value: function _renderError(e) { - var stack = e.stack, - message = e.message; - - var error = { stack: stack, message: message }; - this._reduxStore.dispatch((0, _actions.setError)(error)); - } - }, { - key: 'configure', - value: function configure(loaders, module) { - var _this = this; - - var render = function render() { - try { - _this._renderMain(loaders); - } catch (error) { - if (module.hot && module.hot.status() === 'apply') { - // We got this issue, after webpack fixed it and applying it. - // Therefore error message is displayed forever even it's being fixed. - // So, we'll detect it reload the page. - _global.location.reload(); - } else { - // If we are accessing the site, but the error is not fixed yet. - // There we can render the error. - _this._renderError(error); - } - } - }; - - if (module.hot) { - module.hot.accept(function () { - setTimeout(render); - }); - module.hot.dispose(function () { - (0, _.clearDecorators)(); - }); - } - - if (this._channel) { - render(); - } else { - loaders(); - } - } - }]); - return ConfigApi; -}(); /* eslint no-underscore-dangle: 0 */ - -exports.default = ConfigApi; - -/***/ }), -/* 826 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _taggedTemplateLiteral2 = __webpack_require__(566); - -var _taggedTemplateLiteral3 = _interopRequireDefault(_taggedTemplateLiteral2); - -var _templateObject = (0, _taggedTemplateLiteral3.default)(['\n Did you forget to return the React element from the story?\n Use "() => (<MyComp/>)" or "() => { return <MyComp/>; }" when defining the story.\n '], ['\n Did you forget to return the React element from the story?\n Use "() => (<MyComp/>)" or "() => { return <MyComp/>; }" when defining the story.\n ']), - _templateObject2 = (0, _taggedTemplateLiteral3.default)(['\n Seems like you are not returning a correct React element from the story.\n Could you double check that?\n '], ['\n Seems like you are not returning a correct React element from the story.\n Could you double check that?\n ']); /* global document */ - -exports.renderError = renderError; -exports.renderException = renderException; -exports.renderMain = renderMain; -exports.default = renderPreview; - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactDom = __webpack_require__(110); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _commonTags = __webpack_require__(833); - -var _element_check = __webpack_require__(874); - -var _element_check2 = _interopRequireDefault(_element_check); - -var _error_display = __webpack_require__(876); - -var _error_display2 = _interopRequireDefault(_error_display); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// check whether we're running on node/browser -var isBrowser = typeof window !== 'undefined'; - -var logger = console; - -var rootEl = null; -var previousKind = ''; -var previousStory = ''; - -if (isBrowser) { - rootEl = document.getElementById('root'); -} - -function renderError(error) { - var properError = new Error(error.title); - properError.stack = error.description; - - var redBox = _react2.default.createElement(_error_display2.default, { error: properError }); - _reactDom2.default.render(redBox, rootEl); -} - -function renderException(error) { - // We always need to render redbox in the mainPage if we get an error. - // Since this is an error, this affects to the main page as well. - var realError = new Error(error.message); - realError.stack = error.stack; - var redBox = _react2.default.createElement(_error_display2.default, { error: realError }); - _reactDom2.default.render(redBox, rootEl); - - // Log the stack to the console. So, user could check the source code. - logger.error(error.stack); -} - -function renderMain(data, storyStore) { - if (storyStore.size() === 0) return null; - - var NoPreview = function NoPreview() { - return _react2.default.createElement( - 'p', - null, - 'No Preview Available!' - ); - }; - var noPreview = _react2.default.createElement(NoPreview, null); - var selectedKind = data.selectedKind, - selectedStory = data.selectedStory; - - - var story = storyStore.getStory(selectedKind, selectedStory); - if (!story) { - _reactDom2.default.render(noPreview, rootEl); - return null; - } - - // Unmount the previous story only if selectedKind or selectedStory has changed. - // renderMain() gets executed after each action. Actions will cause the whole - // story to re-render without this check. - // https://github.com/storybooks/react-storybook/issues/116 - if (selectedKind !== previousKind || previousStory !== selectedStory) { - // We need to unmount the existing set of components in the DOM node. - // Otherwise, React may not recrease instances for every story run. - // This could leads to issues like below: - // https://github.com/storybooks/react-storybook/issues/81 - previousKind = selectedKind; - previousStory = selectedStory; - _reactDom2.default.unmountComponentAtNode(rootEl); - } - - var context = { - kind: selectedKind, - story: selectedStory - }; - - var element = story(context); - - if (!element) { - var error = { - title: 'Expecting a React element from the story: "' + selectedStory + '" of "' + selectedKind + '".', - description: (0, _commonTags.stripIndents)(_templateObject) - }; - return renderError(error); - } - - if (!(0, _element_check2.default)(element)) { - var _error = { - title: 'Expecting a valid React element from the story: "' + selectedStory + '" of "' + selectedKind + '".', - description: (0, _commonTags.stripIndents)(_templateObject2) - }; - return renderError(_error); - } - - _reactDom2.default.render(element, rootEl); - return null; -} - -function renderPreview(_ref) { - var reduxStore = _ref.reduxStore, - storyStore = _ref.storyStore; - - var state = reduxStore.getState(); - if (state.error) { - return renderException(state.error); - } - - try { - return renderMain(state, storyStore); - } catch (ex) { - return renderException(ex); - } -} - -/***/ }), -/* 827 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(828), __esModule: true }; - -/***/ }), -/* 828 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(829); -var $Object = __webpack_require__(10).Object; -module.exports = function defineProperties(T, D) { - return $Object.defineProperties(T, D); -}; - - -/***/ }), -/* 829 */ -/***/ (function(module, exports, __webpack_require__) { - -var $export = __webpack_require__(15); -// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) -$export($export.S + $export.F * !__webpack_require__(27), 'Object', { defineProperties: __webpack_require__(222) }); - - -/***/ }), -/* 830 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(831), __esModule: true }; - -/***/ }), -/* 831 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(832); -module.exports = __webpack_require__(10).Object.freeze; - - -/***/ }), -/* 832 */ -/***/ (function(module, exports, __webpack_require__) { - -// 19.1.2.5 Object.freeze(O) -var isObject = __webpack_require__(28); -var meta = __webpack_require__(137).onFreeze; - -__webpack_require__(134)('freeze', function ($freeze) { - return function freeze(it) { - return $freeze && isObject(it) ? $freeze(meta(it)) : it; - }; -}); - - -/***/ }), -/* 833 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateTag", function() { return __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__trimResultTransformer__ = __webpack_require__(40); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "trimResultTransformer", function() { return __WEBPACK_IMPORTED_MODULE_1__trimResultTransformer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__stripIndentTransformer__ = __webpack_require__(90); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "stripIndentTransformer", function() { return __WEBPACK_IMPORTED_MODULE_2__stripIndentTransformer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__ = __webpack_require__(132); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "replaceResultTransformer", function() { return __WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__replaceSubstitutionTransformer__ = __webpack_require__(567); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "replaceSubstitutionTransformer", function() { return __WEBPACK_IMPORTED_MODULE_4__replaceSubstitutionTransformer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inlineArrayTransformer", function() { return __WEBPACK_IMPORTED_MODULE_5__inlineArrayTransformer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__splitStringTransformer__ = __webpack_require__(501); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "splitStringTransformer", function() { return __WEBPACK_IMPORTED_MODULE_6__splitStringTransformer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__removeNonPrintingValuesTransformer__ = __webpack_require__(568); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "removeNonPrintingValuesTransformer", function() { return __WEBPACK_IMPORTED_MODULE_7__removeNonPrintingValuesTransformer__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__commaLists__ = __webpack_require__(845); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "commaLists", function() { return __WEBPACK_IMPORTED_MODULE_8__commaLists__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__commaListsAnd__ = __webpack_require__(847); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "commaListsAnd", function() { return __WEBPACK_IMPORTED_MODULE_9__commaListsAnd__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__commaListsOr__ = __webpack_require__(849); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "commaListsOr", function() { return __WEBPACK_IMPORTED_MODULE_10__commaListsOr__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__html__ = __webpack_require__(502); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "html", function() { return __WEBPACK_IMPORTED_MODULE_11__html__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__codeBlock__ = __webpack_require__(852); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "codeBlock", function() { return __WEBPACK_IMPORTED_MODULE_12__codeBlock__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__source__ = __webpack_require__(853); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "source", function() { return __WEBPACK_IMPORTED_MODULE_13__source__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__safeHtml__ = __webpack_require__(854); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "safeHtml", function() { return __WEBPACK_IMPORTED_MODULE_14__safeHtml__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__oneLine__ = __webpack_require__(856); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "oneLine", function() { return __WEBPACK_IMPORTED_MODULE_15__oneLine__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__oneLineTrim__ = __webpack_require__(858); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "oneLineTrim", function() { return __WEBPACK_IMPORTED_MODULE_16__oneLineTrim__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__oneLineCommaLists__ = __webpack_require__(860); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "oneLineCommaLists", function() { return __WEBPACK_IMPORTED_MODULE_17__oneLineCommaLists__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__oneLineCommaListsOr__ = __webpack_require__(862); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "oneLineCommaListsOr", function() { return __WEBPACK_IMPORTED_MODULE_18__oneLineCommaListsOr__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__oneLineCommaListsAnd__ = __webpack_require__(864); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "oneLineCommaListsAnd", function() { return __WEBPACK_IMPORTED_MODULE_19__oneLineCommaListsAnd__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__inlineLists__ = __webpack_require__(866); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "inlineLists", function() { return __WEBPACK_IMPORTED_MODULE_20__inlineLists__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__oneLineInlineLists__ = __webpack_require__(868); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "oneLineInlineLists", function() { return __WEBPACK_IMPORTED_MODULE_21__oneLineInlineLists__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__stripIndent__ = __webpack_require__(870); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "stripIndent", function() { return __WEBPACK_IMPORTED_MODULE_22__stripIndent__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__stripIndents__ = __webpack_require__(872); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "stripIndents", function() { return __WEBPACK_IMPORTED_MODULE_23__stripIndents__["a"]; }); - - -// core - - - - -// transformers - - - - - - - - - - - - - - - - -// tags - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInN0cmlwSW5kZW50VHJhbnNmb3JtZXIiLCJyZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIiLCJyZXBsYWNlU3Vic3RpdHV0aW9uVHJhbnNmb3JtZXIiLCJpbmxpbmVBcnJheVRyYW5zZm9ybWVyIiwic3BsaXRTdHJpbmdUcmFuc2Zvcm1lciIsInJlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIiLCJjb21tYUxpc3RzIiwiY29tbWFMaXN0c0FuZCIsImNvbW1hTGlzdHNPciIsImh0bWwiLCJjb2RlQmxvY2siLCJzb3VyY2UiLCJzYWZlSHRtbCIsIm9uZUxpbmUiLCJvbmVMaW5lVHJpbSIsIm9uZUxpbmVDb21tYUxpc3RzIiwib25lTGluZUNvbW1hTGlzdHNPciIsIm9uZUxpbmVDb21tYUxpc3RzQW5kIiwiaW5saW5lTGlzdHMiLCJvbmVMaW5lSW5saW5lTGlzdHMiLCJzdHJpcEluZGVudCIsInN0cmlwSW5kZW50cyJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUE7O3lCQUN3QixlO3lCQUFqQkEsVzs7QUFFUDs7bUNBQ2tDLHlCO21DQUEzQkMscUI7b0NBQzRCLDBCO29DQUE1QkMsc0I7c0NBQzhCLDRCO3NDQUE5QkMsd0I7NENBQ29DLGtDOzRDQUFwQ0MsOEI7b0NBQzRCLDBCO29DQUE1QkMsc0I7b0NBQzRCLDBCO29DQUE1QkMsc0I7Z0RBQ3dDLHNDO2dEQUF4Q0Msa0M7O0FBRVA7O3dCQUN1QixjO3dCQUFoQkMsVTsyQkFDbUIsaUI7MkJBQW5CQyxhOzBCQUNrQixnQjswQkFBbEJDLFk7a0JBQ1UsUTtrQkFBVkMsSTt1QkFDZSxhO3VCQUFmQyxTO29CQUNZLFU7b0JBQVpDLE07c0JBQ2MsWTtzQkFBZEMsUTtxQkFDYSxXO3FCQUFiQyxPO3lCQUNpQixlO3lCQUFqQkMsVzsrQkFDdUIscUI7K0JBQXZCQyxpQjtpQ0FDeUIsdUI7aUNBQXpCQyxtQjtrQ0FDMEIsd0I7a0NBQTFCQyxvQjt5QkFDaUIsZTt5QkFBakJDLFc7Z0NBQ3dCLHNCO2dDQUF4QkMsa0I7eUJBQ2lCLGU7eUJBQWpCQyxXOzBCQUNrQixnQjswQkFBbEJDLFkiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuLy8gY29yZVxuZXhwb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4vVGVtcGxhdGVUYWcnXG5cbi8vIHRyYW5zZm9ybWVyc1xuZXhwb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcidcbmV4cG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4vc3RyaXBJbmRlbnRUcmFuc2Zvcm1lcidcbmV4cG9ydCByZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXInXG5leHBvcnQgcmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyIGZyb20gJy4vcmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyJ1xuZXhwb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi9pbmxpbmVBcnJheVRyYW5zZm9ybWVyJ1xuZXhwb3J0IHNwbGl0U3RyaW5nVHJhbnNmb3JtZXIgZnJvbSAnLi9zcGxpdFN0cmluZ1RyYW5zZm9ybWVyJ1xuZXhwb3J0IHJlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIgZnJvbSAnLi9yZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyJ1xuXG4vLyB0YWdzXG5leHBvcnQgY29tbWFMaXN0cyBmcm9tICcuL2NvbW1hTGlzdHMnXG5leHBvcnQgY29tbWFMaXN0c0FuZCBmcm9tICcuL2NvbW1hTGlzdHNBbmQnXG5leHBvcnQgY29tbWFMaXN0c09yIGZyb20gJy4vY29tbWFMaXN0c09yJ1xuZXhwb3J0IGh0bWwgZnJvbSAnLi9odG1sJ1xuZXhwb3J0IGNvZGVCbG9jayBmcm9tICcuL2NvZGVCbG9jaydcbmV4cG9ydCBzb3VyY2UgZnJvbSAnLi9zb3VyY2UnXG5leHBvcnQgc2FmZUh0bWwgZnJvbSAnLi9zYWZlSHRtbCdcbmV4cG9ydCBvbmVMaW5lIGZyb20gJy4vb25lTGluZSdcbmV4cG9ydCBvbmVMaW5lVHJpbSBmcm9tICcuL29uZUxpbmVUcmltJ1xuZXhwb3J0IG9uZUxpbmVDb21tYUxpc3RzIGZyb20gJy4vb25lTGluZUNvbW1hTGlzdHMnXG5leHBvcnQgb25lTGluZUNvbW1hTGlzdHNPciBmcm9tICcuL29uZUxpbmVDb21tYUxpc3RzT3InXG5leHBvcnQgb25lTGluZUNvbW1hTGlzdHNBbmQgZnJvbSAnLi9vbmVMaW5lQ29tbWFMaXN0c0FuZCdcbmV4cG9ydCBpbmxpbmVMaXN0cyBmcm9tICcuL2lubGluZUxpc3RzJ1xuZXhwb3J0IG9uZUxpbmVJbmxpbmVMaXN0cyBmcm9tICcuL29uZUxpbmVJbmxpbmVMaXN0cydcbmV4cG9ydCBzdHJpcEluZGVudCBmcm9tICcuL3N0cmlwSW5kZW50J1xuZXhwb3J0IHN0cmlwSW5kZW50cyBmcm9tICcuL3N0cmlwSW5kZW50cydcbiJdfQ== - -/***/ }), -/* 834 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_taggedTemplateLiteral__ = __webpack_require__(566); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_taggedTemplateLiteral___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_taggedTemplateLiteral__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__); - - -/** - * @class TemplateTag - * @classdesc Consumes a pipeline of composeable transformer plugins and produces a template tag. - */ - - - - - -var _templateObject = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_taggedTemplateLiteral___default()(['', ''], ['', '']); - -var TemplateTag = function () { - /** - * constructs a template tag - * @constructs TemplateTag - * @param {...Object} [...transformers] - an array or arguments list of transformers - * @return {Function} - a template tag - */ - function TemplateTag() { - for (var _len = arguments.length, transformers = Array(_len), _key = 0; _key < _len; _key++) { - transformers[_key] = arguments[_key]; - } - - __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, TemplateTag); - - // if first argument is an array, extrude it as a list of transformers - if (transformers.length && Array.isArray(transformers[0])) { - transformers = transformers[0]; - } - - // if any transformers are functions, this means they are not initiated - automatically initiate them - this.transformers = transformers.map(function (transformer) { - return typeof transformer === 'function' ? transformer() : transformer; - }); - - // return an ES2015 template tag - return this.tag.bind(this); - } - - /** - * Applies all transformers to a template literal tagged with this method. - * If a function is passed as the first argument, assumes the function is a template tag - * and applies it to the template, returning a template tag. - * @param {(Function|Array<String>)} args[0] - Either a template tag or an array containing template strings separated by identifier - * @param {...*} [args[1]] - Optional list of substitution values. - * @return {(String|Function)} - Either an intermediary tag function or the results of processing the template. - */ - - - __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(TemplateTag, [{ - key: 'tag', - value: function tag() { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - // if the first argument passed is a function, assume it is a template tag and return - // an intermediary tag that processes the template using the aforementioned tag, passing the - // result to our tag - if (typeof args[0] === 'function') { - return this.interimTag.bind(this, args.shift()); - } - - // else, return a transformed end result of processing the template with our tag - return this.transformEndResult(args.shift().reduce(this.processSubstitutions.bind(this, args))); - } - - /** - * An intermediary template tag that receives a template tag and passes the result of calling the template with the received - * template tag to our own template tag. - * @param {Function} nextTag - the received template tag - * @param {Array<String>} template - the template to process - * @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template - * @return {*} - the final processed value - */ - - }, { - key: 'interimTag', - value: function interimTag(previousTag, template) { - for (var _len3 = arguments.length, substitutions = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { - substitutions[_key3 - 2] = arguments[_key3]; - } - - return this.tag(_templateObject, previousTag.apply(undefined, [template].concat(substitutions))); - } - - /** - * Performs bulk processing on the tagged template, transforming each substitution and then - * concatenating the resulting values into a string. - * @param {Array<*>} substitutions - an array of all remaining substitutions present in this template - * @param {String} resultSoFar - this iteration's result string so far - * @param {String} remainingPart - the template chunk after the current substitution - * @return {String} - the result of joining this iteration's processed substitution with the result - */ - - }, { - key: 'processSubstitutions', - value: function processSubstitutions(substitutions, resultSoFar, remainingPart) { - var substitution = this.transformSubstitution(substitutions.shift(), resultSoFar); - return resultSoFar + substitution + remainingPart; - } - - /** - * When a substitution is encountered, iterates through each transformer and applies the transformer's - * `onSubstitution` method to the substitution. - * @param {*} substitution - The current substitution - * @param {String} resultSoFar - The result up to and excluding this substitution. - * @return {*} - The final result of applying all substitution transformations. - */ - - }, { - key: 'transformSubstitution', - value: function transformSubstitution(substitution, resultSoFar) { - var cb = function cb(res, transform) { - return transform.onSubstitution ? transform.onSubstitution(res, resultSoFar) : res; - }; - return this.transformers.reduce(cb, substitution); - } - - /** - * Iterates through each transformer, applying the transformer's `onEndResult` method to the - * template literal after all substitutions have finished processing. - * @param {String} endResult - The processed template, just before it is returned from the tag - * @return {String} - The final results of processing each transformer - */ - - }, { - key: 'transformEndResult', - value: function transformEndResult(endResult) { - var cb = function cb(res, transform) { - return transform.onEndResult ? transform.onEndResult(res) : res; - }; - return this.transformers.reduce(cb, endResult); - } - }]); - - return TemplateTag; -}(); - -/* harmony default export */ __webpack_exports__["a"] = (TemplateTag); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9UZW1wbGF0ZVRhZy9UZW1wbGF0ZVRhZy5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInRyYW5zZm9ybWVycyIsImxlbmd0aCIsIkFycmF5IiwiaXNBcnJheSIsIm1hcCIsInRyYW5zZm9ybWVyIiwidGFnIiwiYXJncyIsImludGVyaW1UYWciLCJiaW5kIiwic2hpZnQiLCJ0cmFuc2Zvcm1FbmRSZXN1bHQiLCJyZWR1Y2UiLCJwcm9jZXNzU3Vic3RpdHV0aW9ucyIsInByZXZpb3VzVGFnIiwidGVtcGxhdGUiLCJzdWJzdGl0dXRpb25zIiwicmVzdWx0U29GYXIiLCJyZW1haW5pbmdQYXJ0Iiwic3Vic3RpdHV0aW9uIiwidHJhbnNmb3JtU3Vic3RpdHV0aW9uIiwiY2IiLCJyZXMiLCJ0cmFuc2Zvcm0iLCJvblN1YnN0aXR1dGlvbiIsImVuZFJlc3VsdCIsIm9uRW5kUmVzdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQTs7Ozs7Ozs7Ozs7SUFJcUJBLFc7QUFDbkI7Ozs7OztBQU1BLHlCQUE4QjtBQUFBLHNDQUFkQyxZQUFjO0FBQWRBLGtCQUFjO0FBQUE7O0FBQUE7O0FBQzVCO0FBQ0EsUUFBSUEsYUFBYUMsTUFBYixJQUF1QkMsTUFBTUMsT0FBTixDQUFjSCxhQUFhLENBQWIsQ0FBZCxDQUEzQixFQUEyRDtBQUN6REEscUJBQWVBLGFBQWEsQ0FBYixDQUFmO0FBQ0Q7O0FBRUQ7QUFDQSxTQUFLQSxZQUFMLEdBQW9CQSxhQUFhSSxHQUFiLENBQWlCLFVBQUNDLFdBQUQsRUFBaUI7QUFDcEQsYUFBTyxPQUFPQSxXQUFQLEtBQXVCLFVBQXZCLEdBQ0hBLGFBREcsR0FFSEEsV0FGSjtBQUdELEtBSm1CLENBQXBCOztBQU1BO0FBQ0EsV0FBUyxLQUFLQyxHQUFkLE1BQVMsSUFBVDtBQUNEOztBQUVEOzs7Ozs7Ozs7Ozs7MEJBUWM7QUFBQSx5Q0FBTkMsSUFBTTtBQUFOQSxZQUFNO0FBQUE7O0FBQ1o7QUFDQTtBQUNBO0FBQ0EsVUFBSSxPQUFPQSxLQUFLLENBQUwsQ0FBUCxLQUFtQixVQUF2QixFQUFtQztBQUNqQyxlQUFPLEtBQUtDLFVBQUwsQ0FBZ0JDLElBQWhCLENBQXFCLElBQXJCLEVBQTJCRixLQUFLRyxLQUFMLEVBQTNCLENBQVA7QUFDRDs7QUFFRDtBQUNBLGFBQU8sS0FBS0Msa0JBQUwsQ0FDTEosS0FBS0csS0FBTCxHQUFhRSxNQUFiLENBQW9CLEtBQUtDLG9CQUFMLENBQTBCSixJQUExQixDQUErQixJQUEvQixFQUFxQ0YsSUFBckMsQ0FBcEIsQ0FESyxDQUFQO0FBR0Q7O0FBRUQ7Ozs7Ozs7Ozs7OytCQVFZTyxXLEVBQWFDLFEsRUFBNEI7QUFBQSx5Q0FBZkMsYUFBZTtBQUFmQSxxQkFBZTtBQUFBOztBQUNuRCxhQUFPLEtBQUtWLEdBQVosa0JBQWtCUSw4QkFBWUMsUUFBWixTQUF5QkMsYUFBekIsRUFBbEI7QUFDRDs7QUFFRDs7Ozs7Ozs7Ozs7eUNBUXNCQSxhLEVBQWVDLFcsRUFBYUMsYSxFQUFlO0FBQy9ELFVBQU1DLGVBQWUsS0FBS0MscUJBQUwsQ0FDbkJKLGNBQWNOLEtBQWQsRUFEbUIsRUFFbkJPLFdBRm1CLENBQXJCO0FBSUEsYUFBT0EsY0FBY0UsWUFBZCxHQUE2QkQsYUFBcEM7QUFDRDs7QUFFRDs7Ozs7Ozs7OzswQ0FPdUJDLFksRUFBY0YsVyxFQUFhO0FBQ2hELFVBQU1JLEtBQUssU0FBTEEsRUFBSyxDQUFDQyxHQUFELEVBQU1DLFNBQU47QUFBQSxlQUFvQkEsVUFBVUMsY0FBVixHQUMzQkQsVUFBVUMsY0FBVixDQUF5QkYsR0FBekIsRUFBOEJMLFdBQTlCLENBRDJCLEdBRTNCSyxHQUZPO0FBQUEsT0FBWDtBQUdBLGFBQU8sS0FBS3RCLFlBQUwsQ0FBa0JZLE1BQWxCLENBQXlCUyxFQUF6QixFQUE2QkYsWUFBN0IsQ0FBUDtBQUNEOztBQUVEOzs7Ozs7Ozs7dUNBTW9CTSxTLEVBQVc7QUFDN0IsVUFBTUosS0FBSyxTQUFMQSxFQUFLLENBQUNDLEdBQUQsRUFBTUMsU0FBTjtBQUFBLGVBQW9CQSxVQUFVRyxXQUFWLEdBQzNCSCxVQUFVRyxXQUFWLENBQXNCSixHQUF0QixDQUQyQixHQUUzQkEsR0FGTztBQUFBLE9BQVg7QUFHQSxhQUFPLEtBQUt0QixZQUFMLENBQWtCWSxNQUFsQixDQUF5QlMsRUFBekIsRUFBNkJJLFNBQTdCLENBQVA7QUFDRDs7Ozs7O2VBbkdrQjFCLFciLCJmaWxlIjoiVGVtcGxhdGVUYWcuanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuLyoqXG4gKiBAY2xhc3MgVGVtcGxhdGVUYWdcbiAqIEBjbGFzc2Rlc2MgQ29uc3VtZXMgYSBwaXBlbGluZSBvZiBjb21wb3NlYWJsZSB0cmFuc2Zvcm1lciBwbHVnaW5zIGFuZCBwcm9kdWNlcyBhIHRlbXBsYXRlIHRhZy5cbiAqL1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgVGVtcGxhdGVUYWcge1xuICAvKipcbiAgICogY29uc3RydWN0cyBhIHRlbXBsYXRlIHRhZ1xuICAgKiBAY29uc3RydWN0cyBUZW1wbGF0ZVRhZ1xuICAgKiBAcGFyYW0gIHsuLi5PYmplY3R9IFsuLi50cmFuc2Zvcm1lcnNdIC0gYW4gYXJyYXkgb3IgYXJndW1lbnRzIGxpc3Qgb2YgdHJhbnNmb3JtZXJzXG4gICAqIEByZXR1cm4ge0Z1bmN0aW9ufSAgICAgICAgICAgICAgICAgICAgLSBhIHRlbXBsYXRlIHRhZ1xuICAgKi9cbiAgY29uc3RydWN0b3IgKC4uLnRyYW5zZm9ybWVycykge1xuICAgIC8vIGlmIGZpcnN0IGFyZ3VtZW50IGlzIGFuIGFycmF5LCBleHRydWRlIGl0IGFzIGEgbGlzdCBvZiB0cmFuc2Zvcm1lcnNcbiAgICBpZiAodHJhbnNmb3JtZXJzLmxlbmd0aCAmJiBBcnJheS5pc0FycmF5KHRyYW5zZm9ybWVyc1swXSkpIHtcbiAgICAgIHRyYW5zZm9ybWVycyA9IHRyYW5zZm9ybWVyc1swXVxuICAgIH1cblxuICAgIC8vIGlmIGFueSB0cmFuc2Zvcm1lcnMgYXJlIGZ1bmN0aW9ucywgdGhpcyBtZWFucyB0aGV5IGFyZSBub3QgaW5pdGlhdGVkIC0gYXV0b21hdGljYWxseSBpbml0aWF0ZSB0aGVtXG4gICAgdGhpcy50cmFuc2Zvcm1lcnMgPSB0cmFuc2Zvcm1lcnMubWFwKCh0cmFuc2Zvcm1lcikgPT4ge1xuICAgICAgcmV0dXJuIHR5cGVvZiB0cmFuc2Zvcm1lciA9PT0gJ2Z1bmN0aW9uJ1xuICAgICAgICA/IHRyYW5zZm9ybWVyKClcbiAgICAgICAgOiB0cmFuc2Zvcm1lclxuICAgIH0pXG5cbiAgICAvLyByZXR1cm4gYW4gRVMyMDE1IHRlbXBsYXRlIHRhZ1xuICAgIHJldHVybiA6OnRoaXMudGFnXG4gIH1cblxuICAvKipcbiAgICogQXBwbGllcyBhbGwgdHJhbnNmb3JtZXJzIHRvIGEgdGVtcGxhdGUgbGl0ZXJhbCB0YWdnZWQgd2l0aCB0aGlzIG1ldGhvZC5cbiAgICogSWYgYSBmdW5jdGlvbiBpcyBwYXNzZWQgYXMgdGhlIGZpcnN0IGFyZ3VtZW50LCBhc3N1bWVzIHRoZSBmdW5jdGlvbiBpcyBhIHRlbXBsYXRlIHRhZ1xuICAgKiBhbmQgYXBwbGllcyBpdCB0byB0aGUgdGVtcGxhdGUsIHJldHVybmluZyBhIHRlbXBsYXRlIHRhZy5cbiAgICogQHBhcmFtICB7KEZ1bmN0aW9ufEFycmF5PFN0cmluZz4pfSBhcmdzWzBdIC0gRWl0aGVyIGEgdGVtcGxhdGUgdGFnIG9yIGFuIGFycmF5IGNvbnRhaW5pbmcgdGVtcGxhdGUgc3RyaW5ncyBzZXBhcmF0ZWQgYnkgaWRlbnRpZmllclxuICAgKiBAcGFyYW0gIHsuLi4qfSBbYXJnc1sxXV0gICAgICAgICAgICAgICAgICAgLSBPcHRpb25hbCBsaXN0IG9mIHN1YnN0aXR1dGlvbiB2YWx1ZXMuXG4gICAqIEByZXR1cm4geyhTdHJpbmd8RnVuY3Rpb24pfSAgICAgICAgICAgICAgICAtIEVpdGhlciBhbiBpbnRlcm1lZGlhcnkgdGFnIGZ1bmN0aW9uIG9yIHRoZSByZXN1bHRzIG9mIHByb2Nlc3NpbmcgdGhlIHRlbXBsYXRlLlxuICAgKi9cbiAgdGFnICguLi5hcmdzKSB7XG4gICAgLy8gaWYgdGhlIGZpcnN0IGFyZ3VtZW50IHBhc3NlZCBpcyBhIGZ1bmN0aW9uLCBhc3N1bWUgaXQgaXMgYSB0ZW1wbGF0ZSB0YWcgYW5kIHJldHVyblxuICAgIC8vIGFuIGludGVybWVkaWFyeSB0YWcgdGhhdCBwcm9jZXNzZXMgdGhlIHRlbXBsYXRlIHVzaW5nIHRoZSBhZm9yZW1lbnRpb25lZCB0YWcsIHBhc3NpbmcgdGhlXG4gICAgLy8gcmVzdWx0IHRvIG91ciB0YWdcbiAgICBpZiAodHlwZW9mIGFyZ3NbMF0gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgIHJldHVybiB0aGlzLmludGVyaW1UYWcuYmluZCh0aGlzLCBhcmdzLnNoaWZ0KCkpXG4gICAgfVxuXG4gICAgLy8gZWxzZSwgcmV0dXJuIGEgdHJhbnNmb3JtZWQgZW5kIHJlc3VsdCBvZiBwcm9jZXNzaW5nIHRoZSB0ZW1wbGF0ZSB3aXRoIG91ciB0YWdcbiAgICByZXR1cm4gdGhpcy50cmFuc2Zvcm1FbmRSZXN1bHQoXG4gICAgICBhcmdzLnNoaWZ0KCkucmVkdWNlKHRoaXMucHJvY2Vzc1N1YnN0aXR1dGlvbnMuYmluZCh0aGlzLCBhcmdzKSlcbiAgICApXG4gIH1cblxuICAvKipcbiAgICogQW4gaW50ZXJtZWRpYXJ5IHRlbXBsYXRlIHRhZyB0aGF0IHJlY2VpdmVzIGEgdGVtcGxhdGUgdGFnIGFuZCBwYXNzZXMgdGhlIHJlc3VsdCBvZiBjYWxsaW5nIHRoZSB0ZW1wbGF0ZSB3aXRoIHRoZSByZWNlaXZlZFxuICAgKiB0ZW1wbGF0ZSB0YWcgdG8gb3VyIG93biB0ZW1wbGF0ZSB0YWcuXG4gICAqIEBwYXJhbSAge0Z1bmN0aW9ufSAgICAgICAgbmV4dFRhZyAgICAgICAgICAtIHRoZSByZWNlaXZlZCB0ZW1wbGF0ZSB0YWdcbiAgICogQHBhcmFtICB7QXJyYXk8U3RyaW5nPn0gICB0ZW1wbGF0ZSAgICAgICAgIC0gdGhlIHRlbXBsYXRlIHRvIHByb2Nlc3NcbiAgICogQHBhcmFtICB7Li4uKn0gICAgICAgICAgICAuLi5zdWJzdGl0dXRpb25zIC0gYHN1YnN0aXR1dGlvbnNgIGlzIGFuIGFycmF5IG9mIGFsbCBzdWJzdGl0dXRpb25zIGluIHRoZSB0ZW1wbGF0ZVxuICAgKiBAcmV0dXJuIHsqfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSB0aGUgZmluYWwgcHJvY2Vzc2VkIHZhbHVlXG4gICAqL1xuICBpbnRlcmltVGFnIChwcmV2aW91c1RhZywgdGVtcGxhdGUsIC4uLnN1YnN0aXR1dGlvbnMpIHtcbiAgICByZXR1cm4gdGhpcy50YWdgJHtwcmV2aW91c1RhZyh0ZW1wbGF0ZSwgLi4uc3Vic3RpdHV0aW9ucyl9YFxuICB9XG5cbiAgLyoqXG4gICAqIFBlcmZvcm1zIGJ1bGsgcHJvY2Vzc2luZyBvbiB0aGUgdGFnZ2VkIHRlbXBsYXRlLCB0cmFuc2Zvcm1pbmcgZWFjaCBzdWJzdGl0dXRpb24gYW5kIHRoZW5cbiAgICogY29uY2F0ZW5hdGluZyB0aGUgcmVzdWx0aW5nIHZhbHVlcyBpbnRvIGEgc3RyaW5nLlxuICAgKiBAcGFyYW0gIHtBcnJheTwqPn0gc3Vic3RpdHV0aW9ucyAtIGFuIGFycmF5IG9mIGFsbCByZW1haW5pbmcgc3Vic3RpdHV0aW9ucyBwcmVzZW50IGluIHRoaXMgdGVtcGxhdGVcbiAgICogQHBhcmFtICB7U3RyaW5nfSAgIHJlc3VsdFNvRmFyICAgLSB0aGlzIGl0ZXJhdGlvbidzIHJlc3VsdCBzdHJpbmcgc28gZmFyXG4gICAqIEBwYXJhbSAge1N0cmluZ30gICByZW1haW5pbmdQYXJ0IC0gdGhlIHRlbXBsYXRlIGNodW5rIGFmdGVyIHRoZSBjdXJyZW50IHN1YnN0aXR1dGlvblxuICAgKiBAcmV0dXJuIHtTdHJpbmd9ICAgICAgICAgICAgICAgICAtIHRoZSByZXN1bHQgb2Ygam9pbmluZyB0aGlzIGl0ZXJhdGlvbidzIHByb2Nlc3NlZCBzdWJzdGl0dXRpb24gd2l0aCB0aGUgcmVzdWx0XG4gICAqL1xuICBwcm9jZXNzU3Vic3RpdHV0aW9ucyAoc3Vic3RpdHV0aW9ucywgcmVzdWx0U29GYXIsIHJlbWFpbmluZ1BhcnQpIHtcbiAgICBjb25zdCBzdWJzdGl0dXRpb24gPSB0aGlzLnRyYW5zZm9ybVN1YnN0aXR1dGlvbihcbiAgICAgIHN1YnN0aXR1dGlvbnMuc2hpZnQoKSxcbiAgICAgIHJlc3VsdFNvRmFyXG4gICAgKVxuICAgIHJldHVybiByZXN1bHRTb0ZhciArIHN1YnN0aXR1dGlvbiArIHJlbWFpbmluZ1BhcnRcbiAgfVxuXG4gIC8qKlxuICAgKiBXaGVuIGEgc3Vic3RpdHV0aW9uIGlzIGVuY291bnRlcmVkLCBpdGVyYXRlcyB0aHJvdWdoIGVhY2ggdHJhbnNmb3JtZXIgYW5kIGFwcGxpZXMgdGhlIHRyYW5zZm9ybWVyJ3NcbiAgICogYG9uU3Vic3RpdHV0aW9uYCBtZXRob2QgdG8gdGhlIHN1YnN0aXR1dGlvbi5cbiAgICogQHBhcmFtICB7Kn0gICAgICBzdWJzdGl0dXRpb24gLSBUaGUgY3VycmVudCBzdWJzdGl0dXRpb25cbiAgICogQHBhcmFtICB7U3RyaW5nfSByZXN1bHRTb0ZhciAgLSBUaGUgcmVzdWx0IHVwIHRvIGFuZCBleGNsdWRpbmcgdGhpcyBzdWJzdGl0dXRpb24uXG4gICAqIEByZXR1cm4geyp9ICAgICAgICAgICAgICAgICAgIC0gVGhlIGZpbmFsIHJlc3VsdCBvZiBhcHBseWluZyBhbGwgc3Vic3RpdHV0aW9uIHRyYW5zZm9ybWF0aW9ucy5cbiAgICovXG4gIHRyYW5zZm9ybVN1YnN0aXR1dGlvbiAoc3Vic3RpdHV0aW9uLCByZXN1bHRTb0Zhcikge1xuICAgIGNvbnN0IGNiID0gKHJlcywgdHJhbnNmb3JtKSA9PiB0cmFuc2Zvcm0ub25TdWJzdGl0dXRpb25cbiAgICAgID8gdHJhbnNmb3JtLm9uU3Vic3RpdHV0aW9uKHJlcywgcmVzdWx0U29GYXIpXG4gICAgICA6IHJlc1xuICAgIHJldHVybiB0aGlzLnRyYW5zZm9ybWVycy5yZWR1Y2UoY2IsIHN1YnN0aXR1dGlvbilcbiAgfVxuXG4gIC8qKlxuICAgKiBJdGVyYXRlcyB0aHJvdWdoIGVhY2ggdHJhbnNmb3JtZXIsIGFwcGx5aW5nIHRoZSB0cmFuc2Zvcm1lcidzIGBvbkVuZFJlc3VsdGAgbWV0aG9kIHRvIHRoZVxuICAgKiB0ZW1wbGF0ZSBsaXRlcmFsIGFmdGVyIGFsbCBzdWJzdGl0dXRpb25zIGhhdmUgZmluaXNoZWQgcHJvY2Vzc2luZy5cbiAgICogQHBhcmFtICB7U3RyaW5nfSBlbmRSZXN1bHQgLSBUaGUgcHJvY2Vzc2VkIHRlbXBsYXRlLCBqdXN0IGJlZm9yZSBpdCBpcyByZXR1cm5lZCBmcm9tIHRoZSB0YWdcbiAgICogQHJldHVybiB7U3RyaW5nfSAgICAgICAgICAgLSBUaGUgZmluYWwgcmVzdWx0cyBvZiBwcm9jZXNzaW5nIGVhY2ggdHJhbnNmb3JtZXJcbiAgICovXG4gIHRyYW5zZm9ybUVuZFJlc3VsdCAoZW5kUmVzdWx0KSB7XG4gICAgY29uc3QgY2IgPSAocmVzLCB0cmFuc2Zvcm0pID0+IHRyYW5zZm9ybS5vbkVuZFJlc3VsdFxuICAgICAgPyB0cmFuc2Zvcm0ub25FbmRSZXN1bHQocmVzKVxuICAgICAgOiByZXNcbiAgICByZXR1cm4gdGhpcy50cmFuc2Zvcm1lcnMucmVkdWNlKGNiLCBlbmRSZXN1bHQpXG4gIH1cbn1cbiJdfQ== - -/***/ }), -/* 835 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - - -/** - * TemplateTag transformer that trims whitespace on the end result of a tagged template - * @param {String} side = '' - The side of the string to trim. Can be 'left' or 'right' - * @return {Object} - a TemplateTag transformer - */ - -var trimResultTransformer = function trimResultTransformer() { - var side = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - return { - onEndResult: function onEndResult(endResult) { - side = side.toLowerCase(); - // uppercase the first letter of side value - if (side === 'left' || side === 'right') { - side = side.charAt(0).toUpperCase() + side.slice(1); - } else if (side !== '') { - throw new Error('Side not supported: ' + side); - } - return endResult['trim' + side](); - } - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (trimResultTransformer); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90cmltUmVzdWx0VHJhbnNmb3JtZXIvdHJpbVJlc3VsdFRyYW5zZm9ybWVyLmpzIl0sIm5hbWVzIjpbInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInNpZGUiLCJvbkVuZFJlc3VsdCIsImVuZFJlc3VsdCIsInRvTG93ZXJDYXNlIiwiY2hhckF0IiwidG9VcHBlckNhc2UiLCJzbGljZSIsIkVycm9yIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQTs7Ozs7O0FBS0EsSUFBTUEsd0JBQXdCLFNBQXhCQSxxQkFBd0I7QUFBQSxNQUFDQyxJQUFELHVFQUFRLEVBQVI7QUFBQSxTQUFnQjtBQUM1Q0MsZUFENEMsdUJBQy9CQyxTQUQrQixFQUNwQjtBQUN0QkYsYUFBT0EsS0FBS0csV0FBTCxFQUFQO0FBQ0E7QUFDQSxVQUFJSCxTQUFTLE1BQVQsSUFBbUJBLFNBQVMsT0FBaEMsRUFBeUM7QUFDdkNBLGVBQU9BLEtBQUtJLE1BQUwsQ0FBWSxDQUFaLEVBQWVDLFdBQWYsS0FBK0JMLEtBQUtNLEtBQUwsQ0FBVyxDQUFYLENBQXRDO0FBQ0QsT0FGRCxNQUVPLElBQUlOLFNBQVMsRUFBYixFQUFpQjtBQUN0QixjQUFNLElBQUlPLEtBQUosMEJBQWlDUCxJQUFqQyxDQUFOO0FBQ0Q7QUFDRCxhQUFPRSxtQkFBaUJGLElBQWpCLEdBQVA7QUFDRDtBQVYyQyxHQUFoQjtBQUFBLENBQTlCOztBQWFBLGVBQWVELHFCQUFmIiwiZmlsZSI6InRyaW1SZXN1bHRUcmFuc2Zvcm1lci5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG4vKipcbiAqIFRlbXBsYXRlVGFnIHRyYW5zZm9ybWVyIHRoYXQgdHJpbXMgd2hpdGVzcGFjZSBvbiB0aGUgZW5kIHJlc3VsdCBvZiBhIHRhZ2dlZCB0ZW1wbGF0ZVxuICogQHBhcmFtICB7U3RyaW5nfSBzaWRlID0gJycgLSBUaGUgc2lkZSBvZiB0aGUgc3RyaW5nIHRvIHRyaW0uIENhbiBiZSAnbGVmdCcgb3IgJ3JpZ2h0J1xuICogQHJldHVybiB7T2JqZWN0fSAgICAgICAgICAgLSBhIFRlbXBsYXRlVGFnIHRyYW5zZm9ybWVyXG4gKi9cbmNvbnN0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciA9IChzaWRlID0gJycpID0+ICh7XG4gIG9uRW5kUmVzdWx0IChlbmRSZXN1bHQpIHtcbiAgICBzaWRlID0gc2lkZS50b0xvd2VyQ2FzZSgpXG4gICAgLy8gdXBwZXJjYXNlIHRoZSBmaXJzdCBsZXR0ZXIgb2Ygc2lkZSB2YWx1ZVxuICAgIGlmIChzaWRlID09PSAnbGVmdCcgfHwgc2lkZSA9PT0gJ3JpZ2h0Jykge1xuICAgICAgc2lkZSA9IHNpZGUuY2hhckF0KDApLnRvVXBwZXJDYXNlKCkgKyBzaWRlLnNsaWNlKDEpXG4gICAgfSBlbHNlIGlmIChzaWRlICE9PSAnJykge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGBTaWRlIG5vdCBzdXBwb3J0ZWQ6ICR7c2lkZX1gKVxuICAgIH1cbiAgICByZXR1cm4gZW5kUmVzdWx0W2B0cmltJHtzaWRlfWBdKClcbiAgfVxufSlcblxuZXhwb3J0IGRlZmF1bHQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyXG4iXX0= - -/***/ }), -/* 836 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray__ = __webpack_require__(47); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray__); - - -/** - * strips indentation from a template literal - * @param {String} type = 'initial' - whether to remove all indentation or just leading indentation. can be 'all' or 'initial' - * @return {Object} - a TemplateTag transformer - */ - - -var stripIndentTransformer = function stripIndentTransformer() { - var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'initial'; - return { - onEndResult: function onEndResult(endResult) { - if (type === 'initial') { - // remove the shortest leading indentation from each line - var match = endResult.match(/^[ \t]*(?=\S)/gm); - // return early if there's nothing to strip - if (match === null) { - return endResult; - } - var indent = Math.min.apply(Math, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toConsumableArray___default()(match.map(function (el) { - return el.length; - }))); - var regexp = new RegExp('^[ \\t]{' + indent + '}', 'gm'); - endResult = indent > 0 ? endResult.replace(regexp, '') : endResult; - } else if (type === 'all') { - // remove all indentation from each line - endResult = endResult.split('\n').map(function (line) { - return line.trimLeft(); - }).join('\n'); - } else { - throw new Error('Unknown type: ' + type); - } - return endResult; - } - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (stripIndentTransformer); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudFRyYW5zZm9ybWVyL3N0cmlwSW5kZW50VHJhbnNmb3JtZXIuanMiXSwibmFtZXMiOlsic3RyaXBJbmRlbnRUcmFuc2Zvcm1lciIsInR5cGUiLCJvbkVuZFJlc3VsdCIsImVuZFJlc3VsdCIsIm1hdGNoIiwiaW5kZW50IiwiTWF0aCIsIm1pbiIsIm1hcCIsImVsIiwibGVuZ3RoIiwicmVnZXhwIiwiUmVnRXhwIiwicmVwbGFjZSIsInNwbGl0IiwibGluZSIsInRyaW1MZWZ0Iiwiam9pbiIsIkVycm9yIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQTs7Ozs7OztBQUtBLElBQU1BLHlCQUF5QixTQUF6QkEsc0JBQXlCO0FBQUEsTUFBQ0MsSUFBRCx1RUFBUSxTQUFSO0FBQUEsU0FBdUI7QUFDcERDLGVBRG9ELHVCQUN2Q0MsU0FEdUMsRUFDNUI7QUFDdEIsVUFBSUYsU0FBUyxTQUFiLEVBQXdCO0FBQ3RCO0FBQ0EsWUFBTUcsUUFBUUQsVUFBVUMsS0FBVixDQUFnQixpQkFBaEIsQ0FBZDtBQUNBO0FBQ0EsWUFBSUEsVUFBVSxJQUFkLEVBQW9CO0FBQ2xCLGlCQUFPRCxTQUFQO0FBQ0Q7QUFDRCxZQUFNRSxTQUFTQyxLQUFLQyxHQUFMLGdDQUFZSCxNQUFNSSxHQUFOLENBQVU7QUFBQSxpQkFBTUMsR0FBR0MsTUFBVDtBQUFBLFNBQVYsQ0FBWixFQUFmO0FBQ0EsWUFBTUMsU0FBUyxJQUFJQyxNQUFKLENBQVcsYUFBYVAsTUFBYixHQUFzQixHQUFqQyxFQUFzQyxJQUF0QyxDQUFmO0FBQ0FGLG9CQUFZRSxTQUFTLENBQVQsR0FBYUYsVUFBVVUsT0FBVixDQUFrQkYsTUFBbEIsRUFBMEIsRUFBMUIsQ0FBYixHQUE2Q1IsU0FBekQ7QUFDRCxPQVZELE1BVU8sSUFBSUYsU0FBUyxLQUFiLEVBQW9CO0FBQ3pCO0FBQ0FFLG9CQUFZQSxVQUFVVyxLQUFWLENBQWdCLElBQWhCLEVBQXNCTixHQUF0QixDQUEwQjtBQUFBLGlCQUFRTyxLQUFLQyxRQUFMLEVBQVI7QUFBQSxTQUExQixFQUFtREMsSUFBbkQsQ0FBd0QsSUFBeEQsQ0FBWjtBQUNELE9BSE0sTUFHQTtBQUNMLGNBQU0sSUFBSUMsS0FBSixvQkFBMkJqQixJQUEzQixDQUFOO0FBQ0Q7QUFDRCxhQUFPRSxTQUFQO0FBQ0Q7QUFuQm1ELEdBQXZCO0FBQUEsQ0FBL0I7O0FBc0JBLGVBQWVILHNCQUFmIiwiZmlsZSI6InN0cmlwSW5kZW50VHJhbnNmb3JtZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuLyoqXG4gKiBzdHJpcHMgaW5kZW50YXRpb24gZnJvbSBhIHRlbXBsYXRlIGxpdGVyYWxcbiAqIEBwYXJhbSAge1N0cmluZ30gdHlwZSA9ICdpbml0aWFsJyAtIHdoZXRoZXIgdG8gcmVtb3ZlIGFsbCBpbmRlbnRhdGlvbiBvciBqdXN0IGxlYWRpbmcgaW5kZW50YXRpb24uIGNhbiBiZSAnYWxsJyBvciAnaW5pdGlhbCdcbiAqIEByZXR1cm4ge09iamVjdH0gICAgICAgICAgICAgICAgICAtIGEgVGVtcGxhdGVUYWcgdHJhbnNmb3JtZXJcbiAqL1xuY29uc3Qgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lciA9ICh0eXBlID0gJ2luaXRpYWwnKSA9PiAoe1xuICBvbkVuZFJlc3VsdCAoZW5kUmVzdWx0KSB7XG4gICAgaWYgKHR5cGUgPT09ICdpbml0aWFsJykge1xuICAgICAgLy8gcmVtb3ZlIHRoZSBzaG9ydGVzdCBsZWFkaW5nIGluZGVudGF0aW9uIGZyb20gZWFjaCBsaW5lXG4gICAgICBjb25zdCBtYXRjaCA9IGVuZFJlc3VsdC5tYXRjaCgvXlsgXFx0XSooPz1cXFMpL2dtKVxuICAgICAgLy8gcmV0dXJuIGVhcmx5IGlmIHRoZXJlJ3Mgbm90aGluZyB0byBzdHJpcFxuICAgICAgaWYgKG1hdGNoID09PSBudWxsKSB7XG4gICAgICAgIHJldHVybiBlbmRSZXN1bHRcbiAgICAgIH1cbiAgICAgIGNvbnN0IGluZGVudCA9IE1hdGgubWluKC4uLm1hdGNoLm1hcChlbCA9PiBlbC5sZW5ndGgpKVxuICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cCgnXlsgXFxcXHRdeycgKyBpbmRlbnQgKyAnfScsICdnbScpXG4gICAgICBlbmRSZXN1bHQgPSBpbmRlbnQgPiAwID8gZW5kUmVzdWx0LnJlcGxhY2UocmVnZXhwLCAnJykgOiBlbmRSZXN1bHRcbiAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdhbGwnKSB7XG4gICAgICAvLyByZW1vdmUgYWxsIGluZGVudGF0aW9uIGZyb20gZWFjaCBsaW5lXG4gICAgICBlbmRSZXN1bHQgPSBlbmRSZXN1bHQuc3BsaXQoJ1xcbicpLm1hcChsaW5lID0+IGxpbmUudHJpbUxlZnQoKSkuam9pbignXFxuJylcbiAgICB9IGVsc2Uge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGBVbmtub3duIHR5cGU6ICR7dHlwZX1gKVxuICAgIH1cbiAgICByZXR1cm4gZW5kUmVzdWx0XG4gIH1cbn0pXG5cbmV4cG9ydCBkZWZhdWx0IHN0cmlwSW5kZW50VHJhbnNmb3JtZXJcbiJdfQ== - -/***/ }), -/* 837 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - - -/** - * Replaces tabs, newlines and spaces with the chosen value when they occur in sequences - * @param {(String|RegExp)} replaceWhat - the value or pattern that should be replaced - * @param {*} replaceWith - the replacement value - * @return {Object} - a TemplateTag transformer - */ - -var replaceResultTransformer = function replaceResultTransformer(replaceWhat, replaceWith) { - return { - onEndResult: function onEndResult(endResult) { - if (replaceWhat == null || replaceWith == null) { - throw new Error('replaceResultTransformer requires at least 2 arguments.'); - } - return endResult.replace(replaceWhat, replaceWith); - } - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (replaceResultTransformer); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIvcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyLmpzIl0sIm5hbWVzIjpbInJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciIsInJlcGxhY2VXaGF0IiwicmVwbGFjZVdpdGgiLCJvbkVuZFJlc3VsdCIsImVuZFJlc3VsdCIsIkVycm9yIiwicmVwbGFjZSJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUE7Ozs7Ozs7QUFNQSxJQUFNQSwyQkFBMkIsU0FBM0JBLHdCQUEyQixDQUFDQyxXQUFELEVBQWNDLFdBQWQ7QUFBQSxTQUErQjtBQUM5REMsZUFEOEQsdUJBQ2pEQyxTQURpRCxFQUN0QztBQUN0QixVQUFJSCxlQUFlLElBQWYsSUFBdUJDLGVBQWUsSUFBMUMsRUFBZ0Q7QUFDOUMsY0FBTSxJQUFJRyxLQUFKLENBQVUseURBQVYsQ0FBTjtBQUNEO0FBQ0QsYUFBT0QsVUFBVUUsT0FBVixDQUFrQkwsV0FBbEIsRUFBK0JDLFdBQS9CLENBQVA7QUFDRDtBQU42RCxHQUEvQjtBQUFBLENBQWpDOztBQVNBLGVBQWVGLHdCQUFmIiwiZmlsZSI6InJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lci5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG4vKipcbiAqIFJlcGxhY2VzIHRhYnMsIG5ld2xpbmVzIGFuZCBzcGFjZXMgd2l0aCB0aGUgY2hvc2VuIHZhbHVlIHdoZW4gdGhleSBvY2N1ciBpbiBzZXF1ZW5jZXNcbiAqIEBwYXJhbSAgeyhTdHJpbmd8UmVnRXhwKX0gcmVwbGFjZVdoYXQgLSB0aGUgdmFsdWUgb3IgcGF0dGVybiB0aGF0IHNob3VsZCBiZSByZXBsYWNlZFxuICogQHBhcmFtICB7Kn0gICAgICAgICAgICAgICByZXBsYWNlV2l0aCAtIHRoZSByZXBsYWNlbWVudCB2YWx1ZVxuICogQHJldHVybiB7T2JqZWN0fSAgICAgICAgICAgICAgICAgICAgICAtIGEgVGVtcGxhdGVUYWcgdHJhbnNmb3JtZXJcbiAqL1xuY29uc3QgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyID0gKHJlcGxhY2VXaGF0LCByZXBsYWNlV2l0aCkgPT4gKHtcbiAgb25FbmRSZXN1bHQgKGVuZFJlc3VsdCkge1xuICAgIGlmIChyZXBsYWNlV2hhdCA9PSBudWxsIHx8IHJlcGxhY2VXaXRoID09IG51bGwpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcigncmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyIHJlcXVpcmVzIGF0IGxlYXN0IDIgYXJndW1lbnRzLicpXG4gICAgfVxuICAgIHJldHVybiBlbmRSZXN1bHQucmVwbGFjZShyZXBsYWNlV2hhdCwgcmVwbGFjZVdpdGgpXG4gIH1cbn0pXG5cbmV4cG9ydCBkZWZhdWx0IHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lclxuIl19 - -/***/ }), -/* 838 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - - -var replaceSubstitutionTransformer = function replaceSubstitutionTransformer(replaceWhat, replaceWith) { - return { - onSubstitution: function onSubstitution(substitution, resultSoFar) { - if (replaceWhat == null || replaceWith == null) { - throw new Error('replaceSubstitutionTransformer requires at least 2 arguments.'); - } - - // Do not touch if null or undefined - if (substitution == null) { - return substitution; - } else { - return substitution.toString().replace(replaceWhat, replaceWith); - } - } - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (replaceSubstitutionTransformer); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXBsYWNlU3Vic3RpdHV0aW9uVHJhbnNmb3JtZXIvcmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyLmpzIl0sIm5hbWVzIjpbInJlcGxhY2VTdWJzdGl0dXRpb25UcmFuc2Zvcm1lciIsInJlcGxhY2VXaGF0IiwicmVwbGFjZVdpdGgiLCJvblN1YnN0aXR1dGlvbiIsInN1YnN0aXR1dGlvbiIsInJlc3VsdFNvRmFyIiwiRXJyb3IiLCJ0b1N0cmluZyIsInJlcGxhY2UiXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBLElBQU1BLGlDQUFpQyxTQUFqQ0EsOEJBQWlDLENBQUNDLFdBQUQsRUFBY0MsV0FBZDtBQUFBLFNBQStCO0FBQ3BFQyxrQkFEb0UsMEJBQ3BEQyxZQURvRCxFQUN0Q0MsV0FEc0MsRUFDekI7QUFDekMsVUFBSUosZUFBZSxJQUFmLElBQXVCQyxlQUFlLElBQTFDLEVBQWdEO0FBQzlDLGNBQU0sSUFBSUksS0FBSixDQUFVLCtEQUFWLENBQU47QUFDRDs7QUFFRDtBQUNBLFVBQUlGLGdCQUFnQixJQUFwQixFQUEwQjtBQUN4QixlQUFPQSxZQUFQO0FBQ0QsT0FGRCxNQUVPO0FBQ0wsZUFBT0EsYUFBYUcsUUFBYixHQUF3QkMsT0FBeEIsQ0FBZ0NQLFdBQWhDLEVBQTZDQyxXQUE3QyxDQUFQO0FBQ0Q7QUFDRjtBQVptRSxHQUEvQjtBQUFBLENBQXZDOztBQWVBLGVBQWVGLDhCQUFmIiwiZmlsZSI6InJlcGxhY2VTdWJzdGl0dXRpb25UcmFuc2Zvcm1lci5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5jb25zdCByZXBsYWNlU3Vic3RpdHV0aW9uVHJhbnNmb3JtZXIgPSAocmVwbGFjZVdoYXQsIHJlcGxhY2VXaXRoKSA9PiAoe1xuICBvblN1YnN0aXR1dGlvbiAoc3Vic3RpdHV0aW9uLCByZXN1bHRTb0Zhcikge1xuICAgIGlmIChyZXBsYWNlV2hhdCA9PSBudWxsIHx8IHJlcGxhY2VXaXRoID09IG51bGwpIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcigncmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyIHJlcXVpcmVzIGF0IGxlYXN0IDIgYXJndW1lbnRzLicpXG4gICAgfVxuXG4gICAgLy8gRG8gbm90IHRvdWNoIGlmIG51bGwgb3IgdW5kZWZpbmVkXG4gICAgaWYgKHN1YnN0aXR1dGlvbiA9PSBudWxsKSB7XG4gICAgICByZXR1cm4gc3Vic3RpdHV0aW9uXG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBzdWJzdGl0dXRpb24udG9TdHJpbmcoKS5yZXBsYWNlKHJlcGxhY2VXaGF0LCByZXBsYWNlV2l0aClcbiAgICB9XG4gIH1cbn0pXG5cbmV4cG9ydCBkZWZhdWx0IHJlcGxhY2VTdWJzdGl0dXRpb25UcmFuc2Zvcm1lclxuIl19 - -/***/ }), -/* 839 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - - -var defaults = { - separator: '', - conjunction: '', - serial: false -}; - -/** - * Converts an array substitution to a string containing a list - * @param {String} [opts.separator = ''] - the character that separates each item - * @param {String} [opts.conjunction = ''] - replace the last separator with this - * @param {Boolean} [opts.serial = false] - include the separator before the conjunction? (Oxford comma use-case) - * - * @return {Object} - a TemplateTag transformer - */ -var inlineArrayTransformer = function inlineArrayTransformer() { - var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaults; - return { - onSubstitution: function onSubstitution(substitution, resultSoFar) { - // only operate on arrays - if (Array.isArray(substitution)) { - var separator = opts.separator; - var conjunction = opts.conjunction; - var serial = opts.serial; - // join each item in the array into a string where each item is separated by separator - // be sure to maintain indentation - var indent = resultSoFar.match(/(\s+)$/); - if (indent) { - substitution = substitution.join(separator + indent[1]); - } else { - substitution = substitution.join(separator + ' '); - } - // if conjunction is set, replace the last separator with conjunction - if (conjunction) { - var separatorIndex = substitution.lastIndexOf(separator); - substitution = substitution.substr(0, separatorIndex) + (serial ? separator : '') + ' ' + conjunction + substitution.substr(separatorIndex + 1); - } - } - return substitution; - } - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (inlineArrayTransformer); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmxpbmVBcnJheVRyYW5zZm9ybWVyL2lubGluZUFycmF5VHJhbnNmb3JtZXIuanMiXSwibmFtZXMiOlsiZGVmYXVsdHMiLCJzZXBhcmF0b3IiLCJjb25qdW5jdGlvbiIsInNlcmlhbCIsImlubGluZUFycmF5VHJhbnNmb3JtZXIiLCJvcHRzIiwib25TdWJzdGl0dXRpb24iLCJzdWJzdGl0dXRpb24iLCJyZXN1bHRTb0ZhciIsIkFycmF5IiwiaXNBcnJheSIsImluZGVudCIsIm1hdGNoIiwiam9pbiIsInNlcGFyYXRvckluZGV4IiwibGFzdEluZGV4T2YiLCJzdWJzdHIiXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBLElBQU1BLFdBQVc7QUFDZkMsYUFBVyxFQURJO0FBRWZDLGVBQWEsRUFGRTtBQUdmQyxVQUFRO0FBSE8sQ0FBakI7O0FBTUE7Ozs7Ozs7O0FBUUEsSUFBTUMseUJBQXlCLFNBQXpCQSxzQkFBeUI7QUFBQSxNQUFDQyxJQUFELHVFQUFRTCxRQUFSO0FBQUEsU0FBc0I7QUFDbkRNLGtCQURtRCwwQkFDbkNDLFlBRG1DLEVBQ3JCQyxXQURxQixFQUNSO0FBQ3pDO0FBQ0EsVUFBSUMsTUFBTUMsT0FBTixDQUFjSCxZQUFkLENBQUosRUFBaUM7QUFDL0IsWUFBTU4sWUFBWUksS0FBS0osU0FBdkI7QUFDQSxZQUFNQyxjQUFjRyxLQUFLSCxXQUF6QjtBQUNBLFlBQU1DLFNBQVNFLEtBQUtGLE1BQXBCO0FBQ0E7QUFDQTtBQUNBLFlBQU1RLFNBQVNILFlBQVlJLEtBQVosQ0FBa0IsUUFBbEIsQ0FBZjtBQUNBLFlBQUlELE1BQUosRUFBWTtBQUNWSix5QkFBZUEsYUFBYU0sSUFBYixDQUFrQlosWUFBWVUsT0FBTyxDQUFQLENBQTlCLENBQWY7QUFDRCxTQUZELE1BRU87QUFDTEoseUJBQWVBLGFBQWFNLElBQWIsQ0FBa0JaLFlBQVksR0FBOUIsQ0FBZjtBQUNEO0FBQ0Q7QUFDQSxZQUFJQyxXQUFKLEVBQWlCO0FBQ2YsY0FBTVksaUJBQWlCUCxhQUFhUSxXQUFiLENBQXlCZCxTQUF6QixDQUF2QjtBQUNBTSx5QkFBZUEsYUFDWlMsTUFEWSxDQUNMLENBREssRUFDRkYsY0FERSxLQUNpQlgsU0FBU0YsU0FBVCxHQUFxQixFQUR0QyxJQUM0QyxHQUQ1QyxHQUVYQyxXQUZXLEdBRUdLLGFBQWFTLE1BQWIsQ0FBb0JGLGlCQUFpQixDQUFyQyxDQUZsQjtBQUdEO0FBQ0Y7QUFDRCxhQUFPUCxZQUFQO0FBQ0Q7QUF4QmtELEdBQXRCO0FBQUEsQ0FBL0I7O0FBMkJBLGVBQWVILHNCQUFmIiwiZmlsZSI6ImlubGluZUFycmF5VHJhbnNmb3JtZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuY29uc3QgZGVmYXVsdHMgPSB7XG4gIHNlcGFyYXRvcjogJycsXG4gIGNvbmp1bmN0aW9uOiAnJyxcbiAgc2VyaWFsOiBmYWxzZVxufVxuXG4vKipcbiAqIENvbnZlcnRzIGFuIGFycmF5IHN1YnN0aXR1dGlvbiB0byBhIHN0cmluZyBjb250YWluaW5nIGEgbGlzdFxuICogQHBhcmFtICB7U3RyaW5nfSBbb3B0cy5zZXBhcmF0b3IgPSAnJ10gLSB0aGUgY2hhcmFjdGVyIHRoYXQgc2VwYXJhdGVzIGVhY2ggaXRlbVxuICogQHBhcmFtICB7U3RyaW5nfSBbb3B0cy5jb25qdW5jdGlvbiA9ICcnXSAgLSByZXBsYWNlIHRoZSBsYXN0IHNlcGFyYXRvciB3aXRoIHRoaXNcbiAqIEBwYXJhbSAge0Jvb2xlYW59IFtvcHRzLnNlcmlhbCA9IGZhbHNlXSAtIGluY2x1ZGUgdGhlIHNlcGFyYXRvciBiZWZvcmUgdGhlIGNvbmp1bmN0aW9uPyAoT3hmb3JkIGNvbW1hIHVzZS1jYXNlKVxuICpcbiAqIEByZXR1cm4ge09iamVjdH0gICAgICAgICAgICAgICAgICAgICAtIGEgVGVtcGxhdGVUYWcgdHJhbnNmb3JtZXJcbiAqL1xuY29uc3QgaW5saW5lQXJyYXlUcmFuc2Zvcm1lciA9IChvcHRzID0gZGVmYXVsdHMpID0+ICh7XG4gIG9uU3Vic3RpdHV0aW9uIChzdWJzdGl0dXRpb24sIHJlc3VsdFNvRmFyKSB7XG4gICAgLy8gb25seSBvcGVyYXRlIG9uIGFycmF5c1xuICAgIGlmIChBcnJheS5pc0FycmF5KHN1YnN0aXR1dGlvbikpIHtcbiAgICAgIGNvbnN0IHNlcGFyYXRvciA9IG9wdHMuc2VwYXJhdG9yXG4gICAgICBjb25zdCBjb25qdW5jdGlvbiA9IG9wdHMuY29uanVuY3Rpb25cbiAgICAgIGNvbnN0IHNlcmlhbCA9IG9wdHMuc2VyaWFsXG4gICAgICAvLyBqb2luIGVhY2ggaXRlbSBpbiB0aGUgYXJyYXkgaW50byBhIHN0cmluZyB3aGVyZSBlYWNoIGl0ZW0gaXMgc2VwYXJhdGVkIGJ5IHNlcGFyYXRvclxuICAgICAgLy8gYmUgc3VyZSB0byBtYWludGFpbiBpbmRlbnRhdGlvblxuICAgICAgY29uc3QgaW5kZW50ID0gcmVzdWx0U29GYXIubWF0Y2goLyhcXHMrKSQvKVxuICAgICAgaWYgKGluZGVudCkge1xuICAgICAgICBzdWJzdGl0dXRpb24gPSBzdWJzdGl0dXRpb24uam9pbihzZXBhcmF0b3IgKyBpbmRlbnRbMV0pXG4gICAgICB9IGVsc2Uge1xuICAgICAgICBzdWJzdGl0dXRpb24gPSBzdWJzdGl0dXRpb24uam9pbihzZXBhcmF0b3IgKyAnICcpXG4gICAgICB9XG4gICAgICAvLyBpZiBjb25qdW5jdGlvbiBpcyBzZXQsIHJlcGxhY2UgdGhlIGxhc3Qgc2VwYXJhdG9yIHdpdGggY29uanVuY3Rpb25cbiAgICAgIGlmIChjb25qdW5jdGlvbikge1xuICAgICAgICBjb25zdCBzZXBhcmF0b3JJbmRleCA9IHN1YnN0aXR1dGlvbi5sYXN0SW5kZXhPZihzZXBhcmF0b3IpXG4gICAgICAgIHN1YnN0aXR1dGlvbiA9IHN1YnN0aXR1dGlvblxuICAgICAgICAgIC5zdWJzdHIoMCwgc2VwYXJhdG9ySW5kZXgpICsgKHNlcmlhbCA/IHNlcGFyYXRvciA6ICcnKSArICcgJyArXG4gICAgICAgICAgICBjb25qdW5jdGlvbiArIHN1YnN0aXR1dGlvbi5zdWJzdHIoc2VwYXJhdG9ySW5kZXggKyAxKVxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gc3Vic3RpdHV0aW9uXG4gIH1cbn0pXG5cbmV4cG9ydCBkZWZhdWx0IGlubGluZUFycmF5VHJhbnNmb3JtZXJcbiJdfQ== - -/***/ }), -/* 840 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - - -var splitStringTransformer = function splitStringTransformer(splitBy) { - return { - onSubstitution: function onSubstitution(substitution, resultSoFar) { - if (splitBy != null && typeof splitBy === 'string') { - if (typeof substitution === 'string' && substitution.includes(splitBy)) { - substitution = substitution.split(splitBy); - } - } else { - throw new Error('You need to specify a string character to split by.'); - } - return substitution; - } - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (splitStringTransformer); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zcGxpdFN0cmluZ1RyYW5zZm9ybWVyL3NwbGl0U3RyaW5nVHJhbnNmb3JtZXIuanMiXSwibmFtZXMiOlsic3BsaXRTdHJpbmdUcmFuc2Zvcm1lciIsInNwbGl0QnkiLCJvblN1YnN0aXR1dGlvbiIsInN1YnN0aXR1dGlvbiIsInJlc3VsdFNvRmFyIiwiaW5jbHVkZXMiLCJzcGxpdCIsIkVycm9yIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQSxJQUFNQSx5QkFBeUIsU0FBekJBLHNCQUF5QixDQUFDQyxPQUFEO0FBQUEsU0FBYztBQUMzQ0Msa0JBRDJDLDBCQUMzQkMsWUFEMkIsRUFDYkMsV0FEYSxFQUNBO0FBQ3pDLFVBQUlILFdBQVcsSUFBWCxJQUFtQixPQUFPQSxPQUFQLEtBQW1CLFFBQTFDLEVBQW9EO0FBQ2xELFlBQUksT0FBT0UsWUFBUCxLQUF3QixRQUF4QixJQUFvQ0EsYUFBYUUsUUFBYixDQUFzQkosT0FBdEIsQ0FBeEMsRUFBd0U7QUFDdEVFLHlCQUFlQSxhQUFhRyxLQUFiLENBQW1CTCxPQUFuQixDQUFmO0FBQ0Q7QUFDRixPQUpELE1BSU87QUFDTCxjQUFNLElBQUlNLEtBQUosQ0FBVSxxREFBVixDQUFOO0FBQ0Q7QUFDRCxhQUFPSixZQUFQO0FBQ0Q7QUFWMEMsR0FBZDtBQUFBLENBQS9COztBQWFBLGVBQWVILHNCQUFmIiwiZmlsZSI6InNwbGl0U3RyaW5nVHJhbnNmb3JtZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuY29uc3Qgc3BsaXRTdHJpbmdUcmFuc2Zvcm1lciA9IChzcGxpdEJ5KSA9PiAoe1xuICBvblN1YnN0aXR1dGlvbiAoc3Vic3RpdHV0aW9uLCByZXN1bHRTb0Zhcikge1xuICAgIGlmIChzcGxpdEJ5ICE9IG51bGwgJiYgdHlwZW9mIHNwbGl0QnkgPT09ICdzdHJpbmcnKSB7XG4gICAgICBpZiAodHlwZW9mIHN1YnN0aXR1dGlvbiA9PT0gJ3N0cmluZycgJiYgc3Vic3RpdHV0aW9uLmluY2x1ZGVzKHNwbGl0QnkpKSB7XG4gICAgICAgIHN1YnN0aXR1dGlvbiA9IHN1YnN0aXR1dGlvbi5zcGxpdChzcGxpdEJ5KVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoJ1lvdSBuZWVkIHRvIHNwZWNpZnkgYSBzdHJpbmcgY2hhcmFjdGVyIHRvIHNwbGl0IGJ5LicpXG4gICAgfVxuICAgIHJldHVybiBzdWJzdGl0dXRpb25cbiAgfVxufSlcblxuZXhwb3J0IGRlZmF1bHQgc3BsaXRTdHJpbmdUcmFuc2Zvcm1lclxuIl19 - -/***/ }), -/* 841 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_number_is_nan__ = __webpack_require__(842); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_number_is_nan___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_number_is_nan__); - - - -var isValidValue = function isValidValue(x) { - return x != null && !__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_number_is_nan___default()(x) && typeof x !== 'boolean'; -}; - -var removeNonPrintingValuesTransformer = function removeNonPrintingValuesTransformer() { - return { - onSubstitution: function onSubstitution(substitution) { - if (Array.isArray(substitution)) { - return substitution.filter(isValidValue); - } - if (isValidValue(substitution)) { - return substitution; - } - return ''; - } - }; -}; - -/* harmony default export */ __webpack_exports__["a"] = (removeNonPrintingValuesTransformer); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyL3JlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIuanMiXSwibmFtZXMiOlsiaXNWYWxpZFZhbHVlIiwieCIsInJlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIiLCJvblN1YnN0aXR1dGlvbiIsInN1YnN0aXR1dGlvbiIsIkFycmF5IiwiaXNBcnJheSIsImZpbHRlciJdLCJtYXBwaW5ncyI6IkFBQUE7OztBQUVBLElBQU1BLGVBQWUsU0FBZkEsWUFBZSxDQUFDQyxDQUFEO0FBQUEsU0FDbkJBLEtBQUssSUFBTCxJQUNBLENBQUMsY0FBYUEsQ0FBYixDQURELElBRUEsT0FBT0EsQ0FBUCxLQUFhLFNBSE07QUFBQSxDQUFyQjs7QUFLQSxJQUFNQyxxQ0FBcUMsU0FBckNBLGtDQUFxQztBQUFBLFNBQU87QUFDaERDLGtCQURnRCwwQkFDaENDLFlBRGdDLEVBQ2xCO0FBQzVCLFVBQUlDLE1BQU1DLE9BQU4sQ0FBY0YsWUFBZCxDQUFKLEVBQWlDO0FBQy9CLGVBQU9BLGFBQWFHLE1BQWIsQ0FBb0JQLFlBQXBCLENBQVA7QUFDRDtBQUNELFVBQUlBLGFBQWFJLFlBQWIsQ0FBSixFQUFnQztBQUM5QixlQUFPQSxZQUFQO0FBQ0Q7QUFDRCxhQUFPLEVBQVA7QUFDRDtBQVQrQyxHQUFQO0FBQUEsQ0FBM0M7O0FBWUEsZUFBZUYsa0NBQWYiLCJmaWxlIjoicmVtb3ZlTm9uUHJpbnRpbmdWYWx1ZXNUcmFuc2Zvcm1lci5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5jb25zdCBpc1ZhbGlkVmFsdWUgPSAoeCkgPT5cbiAgeCAhPSBudWxsICYmXG4gICFOdW1iZXIuaXNOYU4oeCkgJiZcbiAgdHlwZW9mIHggIT09ICdib29sZWFuJ1xuXG5jb25zdCByZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyID0gKCkgPT4gKHtcbiAgb25TdWJzdGl0dXRpb24gKHN1YnN0aXR1dGlvbikge1xuICAgIGlmIChBcnJheS5pc0FycmF5KHN1YnN0aXR1dGlvbikpIHtcbiAgICAgIHJldHVybiBzdWJzdGl0dXRpb24uZmlsdGVyKGlzVmFsaWRWYWx1ZSlcbiAgICB9XG4gICAgaWYgKGlzVmFsaWRWYWx1ZShzdWJzdGl0dXRpb24pKSB7XG4gICAgICByZXR1cm4gc3Vic3RpdHV0aW9uXG4gICAgfVxuICAgIHJldHVybiAnJ1xuICB9XG59KVxuXG5leHBvcnQgZGVmYXVsdCByZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyXG4iXX0= - -/***/ }), -/* 842 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = { "default": __webpack_require__(843), __esModule: true }; - -/***/ }), -/* 843 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(844); -module.exports = __webpack_require__(10).Number.isNaN; - - -/***/ }), -/* 844 */ -/***/ (function(module, exports, __webpack_require__) { - -// 20.1.2.4 Number.isNaN(number) -var $export = __webpack_require__(15); - -$export($export.S, 'Number', { - isNaN: function isNaN(number) { - // eslint-disable-next-line no-self-compare - return number != number; - } -}); - - -/***/ }), -/* 845 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__commaLists__ = __webpack_require__(846); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__commaLists__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYUxpc3RzL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0IsYztxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL2NvbW1hTGlzdHMnXG4iXX0= - -/***/ }), -/* 846 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__ = __webpack_require__(40); - - - - - - - -var commaLists = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__["a" /* default */])({ separator: ',' }), __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (commaLists); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYUxpc3RzL2NvbW1hTGlzdHMuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJzdHJpcEluZGVudFRyYW5zZm9ybWVyIiwiaW5saW5lQXJyYXlUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsImNvbW1hTGlzdHMiLCJzZXBhcmF0b3IiXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBLE9BQU9BLFdBQVAsTUFBd0IsZ0JBQXhCO0FBQ0EsT0FBT0Msc0JBQVAsTUFBbUMsMkJBQW5DO0FBQ0EsT0FBT0Msc0JBQVAsTUFBbUMsMkJBQW5DO0FBQ0EsT0FBT0MscUJBQVAsTUFBa0MsMEJBQWxDOztBQUVBLElBQU1DLGFBQWEsSUFBSUosV0FBSixDQUNqQkUsdUJBQXVCLEVBQUVHLFdBQVcsR0FBYixFQUF2QixDQURpQixFQUVqQkosc0JBRmlCLEVBR2pCRSxxQkFIaUIsQ0FBbkI7O0FBTUEsZUFBZUMsVUFBZiIsImZpbGUiOiJjb21tYUxpc3RzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZydcbmltcG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4uL3N0cmlwSW5kZW50VHJhbnNmb3JtZXInXG5pbXBvcnQgaW5saW5lQXJyYXlUcmFuc2Zvcm1lciBmcm9tICcuLi9pbmxpbmVBcnJheVRyYW5zZm9ybWVyJ1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInXG5cbmNvbnN0IGNvbW1hTGlzdHMgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIGlubGluZUFycmF5VHJhbnNmb3JtZXIoeyBzZXBhcmF0b3I6ICcsJyB9KSxcbiAgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lcixcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyXG4pXG5cbmV4cG9ydCBkZWZhdWx0IGNvbW1hTGlzdHNcbiJdfQ== - -/***/ }), -/* 847 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__commaListsAnd__ = __webpack_require__(848); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__commaListsAnd__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYUxpc3RzQW5kL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0IsaUI7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9jb21tYUxpc3RzQW5kJ1xuIl19 - -/***/ }), -/* 848 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__ = __webpack_require__(40); - - - - - - - -var commaListsAnd = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__["a" /* default */])({ separator: ',', conjunction: 'and' }), __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (commaListsAnd); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYUxpc3RzQW5kL2NvbW1hTGlzdHNBbmQuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJzdHJpcEluZGVudFRyYW5zZm9ybWVyIiwiaW5saW5lQXJyYXlUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsImNvbW1hTGlzdHNBbmQiLCJzZXBhcmF0b3IiLCJjb25qdW5jdGlvbiJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7O0FBRUEsSUFBTUMsZ0JBQWdCLElBQUlKLFdBQUosQ0FDcEJFLHVCQUF1QixFQUFFRyxXQUFXLEdBQWIsRUFBa0JDLGFBQWEsS0FBL0IsRUFBdkIsQ0FEb0IsRUFFcEJMLHNCQUZvQixFQUdwQkUscUJBSG9CLENBQXRCOztBQU1BLGVBQWVDLGFBQWYiLCJmaWxlIjoiY29tbWFMaXN0c0FuZC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5pbXBvcnQgVGVtcGxhdGVUYWcgZnJvbSAnLi4vVGVtcGxhdGVUYWcnXG5pbXBvcnQgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lciBmcm9tICcuLi9zdHJpcEluZGVudFRyYW5zZm9ybWVyJ1xuaW1wb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi4vaW5saW5lQXJyYXlUcmFuc2Zvcm1lcidcbmltcG9ydCB0cmltUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi4vdHJpbVJlc3VsdFRyYW5zZm9ybWVyJ1xuXG5jb25zdCBjb21tYUxpc3RzQW5kID0gbmV3IFRlbXBsYXRlVGFnKFxuICBpbmxpbmVBcnJheVRyYW5zZm9ybWVyKHsgc2VwYXJhdG9yOiAnLCcsIGNvbmp1bmN0aW9uOiAnYW5kJyB9KSxcbiAgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lcixcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyXG4pXG5cbmV4cG9ydCBkZWZhdWx0IGNvbW1hTGlzdHNBbmRcbiJdfQ== - -/***/ }), -/* 849 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__commaListsOr__ = __webpack_require__(850); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__commaListsOr__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYUxpc3RzT3IvaW5kZXguanMiXSwibmFtZXMiOlsiZGVmYXVsdCJdLCJtYXBwaW5ncyI6IkFBQUE7O3FCQUVvQixnQjtxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL2NvbW1hTGlzdHNPcidcbiJdfQ== - -/***/ }), -/* 850 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__ = __webpack_require__(40); - - - - - - - -var commaListsOr = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__["a" /* default */])({ separator: ',', conjunction: 'or' }), __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (commaListsOr); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYUxpc3RzT3IvY29tbWFMaXN0c09yLmpzIl0sIm5hbWVzIjpbIlRlbXBsYXRlVGFnIiwic3RyaXBJbmRlbnRUcmFuc2Zvcm1lciIsImlubGluZUFycmF5VHJhbnNmb3JtZXIiLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJjb21tYUxpc3RzT3IiLCJzZXBhcmF0b3IiLCJjb25qdW5jdGlvbiJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7O0FBRUEsSUFBTUMsZUFBZSxJQUFJSixXQUFKLENBQ25CRSx1QkFBdUIsRUFBRUcsV0FBVyxHQUFiLEVBQWtCQyxhQUFhLElBQS9CLEVBQXZCLENBRG1CLEVBRW5CTCxzQkFGbUIsRUFHbkJFLHFCQUhtQixDQUFyQjs7QUFNQSxlQUFlQyxZQUFmIiwiZmlsZSI6ImNvbW1hTGlzdHNPci5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5pbXBvcnQgVGVtcGxhdGVUYWcgZnJvbSAnLi4vVGVtcGxhdGVUYWcnXG5pbXBvcnQgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lciBmcm9tICcuLi9zdHJpcEluZGVudFRyYW5zZm9ybWVyJ1xuaW1wb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi4vaW5saW5lQXJyYXlUcmFuc2Zvcm1lcidcbmltcG9ydCB0cmltUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi4vdHJpbVJlc3VsdFRyYW5zZm9ybWVyJ1xuXG5jb25zdCBjb21tYUxpc3RzT3IgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIGlubGluZUFycmF5VHJhbnNmb3JtZXIoeyBzZXBhcmF0b3I6ICcsJywgY29uanVuY3Rpb246ICdvcicgfSksXG4gIHN0cmlwSW5kZW50VHJhbnNmb3JtZXIsXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lclxuKVxuXG5leHBvcnQgZGVmYXVsdCBjb21tYUxpc3RzT3JcbiJdfQ== - -/***/ }), -/* 851 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__splitStringTransformer__ = __webpack_require__(501); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__removeNonPrintingValuesTransformer__ = __webpack_require__(568); - - - - - - - - - -var html = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_4__splitStringTransformer__["a" /* default */])('\n'), __WEBPACK_IMPORTED_MODULE_5__removeNonPrintingValuesTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (html); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9odG1sL2h0bWwuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJzdHJpcEluZGVudFRyYW5zZm9ybWVyIiwiaW5saW5lQXJyYXlUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInNwbGl0U3RyaW5nVHJhbnNmb3JtZXIiLCJyZW1vdmVOb25QcmludGluZ1ZhbHVlc1RyYW5zZm9ybWVyIiwiaHRtbCJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxrQ0FBUCxNQUErQyx1Q0FBL0M7O0FBRUEsSUFBTUMsT0FBTyxJQUFJTixXQUFKLENBQ1hJLHVCQUF1QixJQUF2QixDQURXLEVBRVhDLGtDQUZXLEVBR1hILHNCQUhXLEVBSVhELHNCQUpXLEVBS1hFLHFCQUxXLENBQWI7O0FBUUEsZUFBZUcsSUFBZiIsImZpbGUiOiJodG1sLmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZydcbmltcG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4uL3N0cmlwSW5kZW50VHJhbnNmb3JtZXInXG5pbXBvcnQgaW5saW5lQXJyYXlUcmFuc2Zvcm1lciBmcm9tICcuLi9pbmxpbmVBcnJheVRyYW5zZm9ybWVyJ1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInXG5pbXBvcnQgc3BsaXRTdHJpbmdUcmFuc2Zvcm1lciBmcm9tICcuLi9zcGxpdFN0cmluZ1RyYW5zZm9ybWVyJ1xuaW1wb3J0IHJlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIgZnJvbSAnLi4vcmVtb3ZlTm9uUHJpbnRpbmdWYWx1ZXNUcmFuc2Zvcm1lcidcblxuY29uc3QgaHRtbCA9IG5ldyBUZW1wbGF0ZVRhZyhcbiAgc3BsaXRTdHJpbmdUcmFuc2Zvcm1lcignXFxuJyksXG4gIHJlbW92ZU5vblByaW50aW5nVmFsdWVzVHJhbnNmb3JtZXIsXG4gIGlubGluZUFycmF5VHJhbnNmb3JtZXIsXG4gIHN0cmlwSW5kZW50VHJhbnNmb3JtZXIsXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lclxuKVxuXG5leHBvcnQgZGVmYXVsdCBodG1sXG4iXX0= - -/***/ }), -/* 852 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__html__ = __webpack_require__(502); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__html__["a"]; }); - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb2RlQmxvY2svaW5kZXguanMiXSwibmFtZXMiOlsiZGVmYXVsdCJdLCJtYXBwaW5ncyI6InFCQUFvQixTO3FCQUFiQSxPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi4vaHRtbCdcbiJdfQ== - -/***/ }), -/* 853 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__html__ = __webpack_require__(502); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__html__["a"]; }); - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zb3VyY2UvaW5kZXguanMiXSwibmFtZXMiOlsiZGVmYXVsdCJdLCJtYXBwaW5ncyI6InFCQUFvQixTO3FCQUFiQSxPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi4vaHRtbCdcbiJdfQ== - -/***/ }), -/* 854 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__safeHtml__ = __webpack_require__(855); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__safeHtml__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zYWZlSHRtbC9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7cUJBRW9CLFk7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9zYWZlSHRtbCdcbiJdfQ== - -/***/ }), -/* 855 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__splitStringTransformer__ = __webpack_require__(501); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__replaceSubstitutionTransformer__ = __webpack_require__(567); - - - - - - - - - -var safeHtml = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_4__splitStringTransformer__["a" /* default */])('\n'), __WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__["a" /* default */], Object(__WEBPACK_IMPORTED_MODULE_5__replaceSubstitutionTransformer__["a" /* default */])(/&/g, '&'), Object(__WEBPACK_IMPORTED_MODULE_5__replaceSubstitutionTransformer__["a" /* default */])(/</g, '<'), Object(__WEBPACK_IMPORTED_MODULE_5__replaceSubstitutionTransformer__["a" /* default */])(/>/g, '>'), Object(__WEBPACK_IMPORTED_MODULE_5__replaceSubstitutionTransformer__["a" /* default */])(/"/g, '"'), Object(__WEBPACK_IMPORTED_MODULE_5__replaceSubstitutionTransformer__["a" /* default */])(/'/g, '''), Object(__WEBPACK_IMPORTED_MODULE_5__replaceSubstitutionTransformer__["a" /* default */])(/`/g, '`')); - -/* harmony default export */ __webpack_exports__["a"] = (safeHtml); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zYWZlSHRtbC9zYWZlSHRtbC5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInN0cmlwSW5kZW50VHJhbnNmb3JtZXIiLCJpbmxpbmVBcnJheVRyYW5zZm9ybWVyIiwidHJpbVJlc3VsdFRyYW5zZm9ybWVyIiwic3BsaXRTdHJpbmdUcmFuc2Zvcm1lciIsInJlcGxhY2VTdWJzdGl0dXRpb25UcmFuc2Zvcm1lciIsInNhZmVIdG1sIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQSxPQUFPQSxXQUFQLE1BQXdCLGdCQUF4QjtBQUNBLE9BQU9DLHNCQUFQLE1BQW1DLDJCQUFuQztBQUNBLE9BQU9DLHNCQUFQLE1BQW1DLDJCQUFuQztBQUNBLE9BQU9DLHFCQUFQLE1BQWtDLDBCQUFsQztBQUNBLE9BQU9DLHNCQUFQLE1BQW1DLDJCQUFuQztBQUNBLE9BQU9DLDhCQUFQLE1BQTJDLG1DQUEzQzs7QUFFQSxJQUFNQyxXQUFXLElBQUlOLFdBQUosQ0FDZkksdUJBQXVCLElBQXZCLENBRGUsRUFFZkYsc0JBRmUsRUFHZkQsc0JBSGUsRUFJZkUscUJBSmUsRUFLZkUsK0JBQStCLElBQS9CLEVBQXFDLE9BQXJDLENBTGUsRUFNZkEsK0JBQStCLElBQS9CLEVBQXFDLE1BQXJDLENBTmUsRUFPZkEsK0JBQStCLElBQS9CLEVBQXFDLE1BQXJDLENBUGUsRUFRZkEsK0JBQStCLElBQS9CLEVBQXFDLFFBQXJDLENBUmUsRUFTZkEsK0JBQStCLElBQS9CLEVBQXFDLFFBQXJDLENBVGUsRUFVZkEsK0JBQStCLElBQS9CLEVBQXFDLFFBQXJDLENBVmUsQ0FBakI7O0FBYUEsZUFBZUMsUUFBZiIsImZpbGUiOiJzYWZlSHRtbC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5pbXBvcnQgVGVtcGxhdGVUYWcgZnJvbSAnLi4vVGVtcGxhdGVUYWcnXG5pbXBvcnQgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lciBmcm9tICcuLi9zdHJpcEluZGVudFRyYW5zZm9ybWVyJ1xuaW1wb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi4vaW5saW5lQXJyYXlUcmFuc2Zvcm1lcidcbmltcG9ydCB0cmltUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi4vdHJpbVJlc3VsdFRyYW5zZm9ybWVyJ1xuaW1wb3J0IHNwbGl0U3RyaW5nVHJhbnNmb3JtZXIgZnJvbSAnLi4vc3BsaXRTdHJpbmdUcmFuc2Zvcm1lcidcbmltcG9ydCByZXBsYWNlU3Vic3RpdHV0aW9uVHJhbnNmb3JtZXIgZnJvbSAnLi4vcmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyJ1xuXG5jb25zdCBzYWZlSHRtbCA9IG5ldyBUZW1wbGF0ZVRhZyhcbiAgc3BsaXRTdHJpbmdUcmFuc2Zvcm1lcignXFxuJyksXG4gIGlubGluZUFycmF5VHJhbnNmb3JtZXIsXG4gIHN0cmlwSW5kZW50VHJhbnNmb3JtZXIsXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lcixcbiAgcmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyKC8mL2csICcmYW1wOycpLFxuICByZXBsYWNlU3Vic3RpdHV0aW9uVHJhbnNmb3JtZXIoLzwvZywgJyZsdDsnKSxcbiAgcmVwbGFjZVN1YnN0aXR1dGlvblRyYW5zZm9ybWVyKC8+L2csICcmZ3Q7JyksXG4gIHJlcGxhY2VTdWJzdGl0dXRpb25UcmFuc2Zvcm1lcigvXCIvZywgJyZxdW90OycpLFxuICByZXBsYWNlU3Vic3RpdHV0aW9uVHJhbnNmb3JtZXIoLycvZywgJyYjeDI3OycpLFxuICByZXBsYWNlU3Vic3RpdHV0aW9uVHJhbnNmb3JtZXIoL2AvZywgJyYjeDYwOycpXG4pXG5cbmV4cG9ydCBkZWZhdWx0IHNhZmVIdG1sXG4iXX0= - -/***/ }), -/* 856 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__oneLine__ = __webpack_require__(857); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__oneLine__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0IsVztxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL29uZUxpbmUnXG4iXX0= - -/***/ }), -/* 857 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__trimResultTransformer__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__replaceResultTransformer__ = __webpack_require__(132); - - - - - - -var oneLine = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_2__replaceResultTransformer__["a" /* default */])(/(?:\s+)/g, ' '), __WEBPACK_IMPORTED_MODULE_1__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (oneLine); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lL29uZUxpbmUuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJyZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIiLCJvbmVMaW5lIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQSxPQUFPQSxXQUFQLE1BQXdCLGdCQUF4QjtBQUNBLE9BQU9DLHFCQUFQLE1BQWtDLDBCQUFsQztBQUNBLE9BQU9DLHdCQUFQLE1BQXFDLDZCQUFyQzs7QUFFQSxJQUFNQyxVQUFVLElBQUlILFdBQUosQ0FDZEUseUJBQXlCLFVBQXpCLEVBQXFDLEdBQXJDLENBRGMsRUFFZEQscUJBRmMsQ0FBaEI7O0FBS0EsZUFBZUUsT0FBZiIsImZpbGUiOiJvbmVMaW5lLmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZydcbmltcG9ydCB0cmltUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi4vdHJpbVJlc3VsdFRyYW5zZm9ybWVyJ1xuaW1wb3J0IHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXInXG5cbmNvbnN0IG9uZUxpbmUgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcigvKD86XFxzKykvZywgJyAnKSxcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyXG4pXG5cbmV4cG9ydCBkZWZhdWx0IG9uZUxpbmVcbiJdfQ== - -/***/ }), -/* 858 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__oneLineTrim__ = __webpack_require__(859); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__oneLineTrim__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lVHJpbS9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7cUJBRW9CLGU7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9vbmVMaW5lVHJpbSdcbiJdfQ== - -/***/ }), -/* 859 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__trimResultTransformer__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__replaceResultTransformer__ = __webpack_require__(132); - - - - - - -var oneLineTrim = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_2__replaceResultTransformer__["a" /* default */])(/(?:\n\s+)/g, ''), __WEBPACK_IMPORTED_MODULE_1__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (oneLineTrim); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lVHJpbS9vbmVMaW5lVHJpbS5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciIsIm9uZUxpbmVUcmltIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQSxPQUFPQSxXQUFQLE1BQXdCLGdCQUF4QjtBQUNBLE9BQU9DLHFCQUFQLE1BQWtDLDBCQUFsQztBQUNBLE9BQU9DLHdCQUFQLE1BQXFDLDZCQUFyQzs7QUFFQSxJQUFNQyxjQUFjLElBQUlILFdBQUosQ0FDbEJFLHlCQUF5QixZQUF6QixFQUF1QyxFQUF2QyxDQURrQixFQUVsQkQscUJBRmtCLENBQXBCOztBQUtBLGVBQWVFLFdBQWYiLCJmaWxlIjoib25lTGluZVRyaW0uanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuaW1wb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4uL1RlbXBsYXRlVGFnJ1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInXG5pbXBvcnQgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3JlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcidcblxuY29uc3Qgb25lTGluZVRyaW0gPSBuZXcgVGVtcGxhdGVUYWcoXG4gIHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcigvKD86XFxuXFxzKykvZywgJycpLFxuICB0cmltUmVzdWx0VHJhbnNmb3JtZXJcbilcblxuZXhwb3J0IGRlZmF1bHQgb25lTGluZVRyaW1cbiJdfQ== - -/***/ }), -/* 860 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__oneLineCommaLists__ = __webpack_require__(861); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__oneLineCommaLists__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0cy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7cUJBRW9CLHFCO3FCQUFiQSxPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmV4cG9ydCBkZWZhdWx0IGZyb20gJy4vb25lTGluZUNvbW1hTGlzdHMnXG4iXX0= - -/***/ }), -/* 861 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__ = __webpack_require__(132); - - - - - - - -var oneLineCommaLists = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_1__inlineArrayTransformer__["a" /* default */])({ separator: ',' }), Object(__WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__["a" /* default */])(/(?:\s+)/g, ' '), __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (oneLineCommaLists); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0cy9vbmVMaW5lQ29tbWFMaXN0cy5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsImlubGluZUFycmF5VHJhbnNmb3JtZXIiLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJyZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIiLCJvbmVMaW5lQ29tbWFMaXN0cyIsInNlcGFyYXRvciJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7QUFDQSxPQUFPQyx3QkFBUCxNQUFxQyw2QkFBckM7O0FBRUEsSUFBTUMsb0JBQW9CLElBQUlKLFdBQUosQ0FDeEJDLHVCQUF1QixFQUFFSSxXQUFXLEdBQWIsRUFBdkIsQ0FEd0IsRUFFeEJGLHlCQUF5QixVQUF6QixFQUFxQyxHQUFyQyxDQUZ3QixFQUd4QkQscUJBSHdCLENBQTFCOztBQU1BLGVBQWVFLGlCQUFmIiwiZmlsZSI6Im9uZUxpbmVDb21tYUxpc3RzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZydcbmltcG9ydCBpbmxpbmVBcnJheVRyYW5zZm9ybWVyIGZyb20gJy4uL2lubGluZUFycmF5VHJhbnNmb3JtZXInXG5pbXBvcnQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcidcbmltcG9ydCByZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi4vcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyJ1xuXG5jb25zdCBvbmVMaW5lQ29tbWFMaXN0cyA9IG5ldyBUZW1wbGF0ZVRhZyhcbiAgaW5saW5lQXJyYXlUcmFuc2Zvcm1lcih7IHNlcGFyYXRvcjogJywnIH0pLFxuICByZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIoLyg/OlxccyspL2csICcgJyksXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lclxuKVxuXG5leHBvcnQgZGVmYXVsdCBvbmVMaW5lQ29tbWFMaXN0c1xuIl19 - -/***/ }), -/* 862 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__oneLineCommaListsOr__ = __webpack_require__(863); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__oneLineCommaListsOr__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0c09yL2luZGV4LmpzIl0sIm5hbWVzIjpbImRlZmF1bHQiXSwibWFwcGluZ3MiOiJBQUFBOztxQkFFb0IsdUI7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9vbmVMaW5lQ29tbWFMaXN0c09yJ1xuIl19 - -/***/ }), -/* 863 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__ = __webpack_require__(132); - - - - - - - -var oneLineCommaListsOr = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_1__inlineArrayTransformer__["a" /* default */])({ separator: ',', conjunction: 'or' }), Object(__WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__["a" /* default */])(/(?:\s+)/g, ' '), __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (oneLineCommaListsOr); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0c09yL29uZUxpbmVDb21tYUxpc3RzT3IuanMiXSwibmFtZXMiOlsiVGVtcGxhdGVUYWciLCJpbmxpbmVBcnJheVRyYW5zZm9ybWVyIiwidHJpbVJlc3VsdFRyYW5zZm9ybWVyIiwicmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyIiwib25lTGluZUNvbW1hTGlzdHNPciIsInNlcGFyYXRvciIsImNvbmp1bmN0aW9uIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQSxPQUFPQSxXQUFQLE1BQXdCLGdCQUF4QjtBQUNBLE9BQU9DLHNCQUFQLE1BQW1DLDJCQUFuQztBQUNBLE9BQU9DLHFCQUFQLE1BQWtDLDBCQUFsQztBQUNBLE9BQU9DLHdCQUFQLE1BQXFDLDZCQUFyQzs7QUFFQSxJQUFNQyxzQkFBc0IsSUFBSUosV0FBSixDQUMxQkMsdUJBQXVCLEVBQUVJLFdBQVcsR0FBYixFQUFrQkMsYUFBYSxJQUEvQixFQUF2QixDQUQwQixFQUUxQkgseUJBQXlCLFVBQXpCLEVBQXFDLEdBQXJDLENBRjBCLEVBRzFCRCxxQkFIMEIsQ0FBNUI7O0FBTUEsZUFBZUUsbUJBQWYiLCJmaWxlIjoib25lTGluZUNvbW1hTGlzdHNPci5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5pbXBvcnQgVGVtcGxhdGVUYWcgZnJvbSAnLi4vVGVtcGxhdGVUYWcnXG5pbXBvcnQgaW5saW5lQXJyYXlUcmFuc2Zvcm1lciBmcm9tICcuLi9pbmxpbmVBcnJheVRyYW5zZm9ybWVyJ1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInXG5pbXBvcnQgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3JlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcidcblxuY29uc3Qgb25lTGluZUNvbW1hTGlzdHNPciA9IG5ldyBUZW1wbGF0ZVRhZyhcbiAgaW5saW5lQXJyYXlUcmFuc2Zvcm1lcih7IHNlcGFyYXRvcjogJywnLCBjb25qdW5jdGlvbjogJ29yJyB9KSxcbiAgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyKC8oPzpcXHMrKS9nLCAnICcpLFxuICB0cmltUmVzdWx0VHJhbnNmb3JtZXJcbilcblxuZXhwb3J0IGRlZmF1bHQgb25lTGluZUNvbW1hTGlzdHNPclxuIl19 - -/***/ }), -/* 864 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__oneLineCommaListsAnd__ = __webpack_require__(865); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__oneLineCommaListsAnd__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0c0FuZC9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7cUJBRW9CLHdCO3FCQUFiQSxPIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmV4cG9ydCBkZWZhdWx0IGZyb20gJy4vb25lTGluZUNvbW1hTGlzdHNBbmQnXG4iXX0= - -/***/ }), -/* 865 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__ = __webpack_require__(132); - - - - - - - -var oneLineCommaListsAnd = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_1__inlineArrayTransformer__["a" /* default */])({ separator: ',', conjunction: 'and' }), Object(__WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__["a" /* default */])(/(?:\s+)/g, ' '), __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (oneLineCommaListsAnd); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lQ29tbWFMaXN0c0FuZC9vbmVMaW5lQ29tbWFMaXN0c0FuZC5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsImlubGluZUFycmF5VHJhbnNmb3JtZXIiLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJyZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIiLCJvbmVMaW5lQ29tbWFMaXN0c0FuZCIsInNlcGFyYXRvciIsImNvbmp1bmN0aW9uIl0sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQSxPQUFPQSxXQUFQLE1BQXdCLGdCQUF4QjtBQUNBLE9BQU9DLHNCQUFQLE1BQW1DLDJCQUFuQztBQUNBLE9BQU9DLHFCQUFQLE1BQWtDLDBCQUFsQztBQUNBLE9BQU9DLHdCQUFQLE1BQXFDLDZCQUFyQzs7QUFFQSxJQUFNQyx1QkFBdUIsSUFBSUosV0FBSixDQUMzQkMsdUJBQXVCLEVBQUVJLFdBQVcsR0FBYixFQUFrQkMsYUFBYSxLQUEvQixFQUF2QixDQUQyQixFQUUzQkgseUJBQXlCLFVBQXpCLEVBQXFDLEdBQXJDLENBRjJCLEVBRzNCRCxxQkFIMkIsQ0FBN0I7O0FBTUEsZUFBZUUsb0JBQWYiLCJmaWxlIjoib25lTGluZUNvbW1hTGlzdHNBbmQuanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuaW1wb3J0IFRlbXBsYXRlVGFnIGZyb20gJy4uL1RlbXBsYXRlVGFnJ1xuaW1wb3J0IGlubGluZUFycmF5VHJhbnNmb3JtZXIgZnJvbSAnLi4vaW5saW5lQXJyYXlUcmFuc2Zvcm1lcidcbmltcG9ydCB0cmltUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi4vdHJpbVJlc3VsdFRyYW5zZm9ybWVyJ1xuaW1wb3J0IHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi9yZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXInXG5cbmNvbnN0IG9uZUxpbmVDb21tYUxpc3RzQW5kID0gbmV3IFRlbXBsYXRlVGFnKFxuICBpbmxpbmVBcnJheVRyYW5zZm9ybWVyKHsgc2VwYXJhdG9yOiAnLCcsIGNvbmp1bmN0aW9uOiAnYW5kJyB9KSxcbiAgcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyKC8oPzpcXHMrKS9nLCAnICcpLFxuICB0cmltUmVzdWx0VHJhbnNmb3JtZXJcbilcblxuZXhwb3J0IGRlZmF1bHQgb25lTGluZUNvbW1hTGlzdHNBbmRcbiJdfQ== - -/***/ }), -/* 866 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__inlineLists__ = __webpack_require__(867); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__inlineLists__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmxpbmVMaXN0cy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7cUJBRW9CLGU7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9pbmxpbmVMaXN0cydcbiJdfQ== - -/***/ }), -/* 867 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__ = __webpack_require__(40); - - - - - - - -var inlineLists = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](__WEBPACK_IMPORTED_MODULE_2__inlineArrayTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (inlineLists); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9pbmxpbmVMaXN0cy9pbmxpbmVMaXN0cy5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInN0cmlwSW5kZW50VHJhbnNmb3JtZXIiLCJpbmxpbmVBcnJheVRyYW5zZm9ybWVyIiwidHJpbVJlc3VsdFRyYW5zZm9ybWVyIiwiaW5saW5lTGlzdHMiXSwibWFwcGluZ3MiOiJBQUFBOztBQUVBLE9BQU9BLFdBQVAsTUFBd0IsZ0JBQXhCO0FBQ0EsT0FBT0Msc0JBQVAsTUFBbUMsMkJBQW5DO0FBQ0EsT0FBT0Msc0JBQVAsTUFBbUMsMkJBQW5DO0FBQ0EsT0FBT0MscUJBQVAsTUFBa0MsMEJBQWxDOztBQUVBLElBQU1DLGNBQWMsSUFBSUosV0FBSixDQUNsQkUsc0JBRGtCLEVBRWxCRCxzQkFGa0IsRUFHbEJFLHFCQUhrQixDQUFwQjs7QUFNQSxlQUFlQyxXQUFmIiwiZmlsZSI6ImlubGluZUxpc3RzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZydcbmltcG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4uL3N0cmlwSW5kZW50VHJhbnNmb3JtZXInXG5pbXBvcnQgaW5saW5lQXJyYXlUcmFuc2Zvcm1lciBmcm9tICcuLi9pbmxpbmVBcnJheVRyYW5zZm9ybWVyJ1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInXG5cbmNvbnN0IGlubGluZUxpc3RzID0gbmV3IFRlbXBsYXRlVGFnKFxuICBpbmxpbmVBcnJheVRyYW5zZm9ybWVyLFxuICBzdHJpcEluZGVudFRyYW5zZm9ybWVyLFxuICB0cmltUmVzdWx0VHJhbnNmb3JtZXJcbilcblxuZXhwb3J0IGRlZmF1bHQgaW5saW5lTGlzdHNcbiJdfQ== - -/***/ }), -/* 868 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__oneLineInlineLists__ = __webpack_require__(869); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__oneLineInlineLists__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lSW5saW5lTGlzdHMvaW5kZXguanMiXSwibmFtZXMiOlsiZGVmYXVsdCJdLCJtYXBwaW5ncyI6IkFBQUE7O3FCQUVvQixzQjtxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL29uZUxpbmVJbmxpbmVMaXN0cydcbiJdfQ== - -/***/ }), -/* 869 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__inlineArrayTransformer__ = __webpack_require__(65); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__ = __webpack_require__(132); - - - - - - - -var oneLineInlineLists = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](__WEBPACK_IMPORTED_MODULE_1__inlineArrayTransformer__["a" /* default */], Object(__WEBPACK_IMPORTED_MODULE_3__replaceResultTransformer__["a" /* default */])(/(?:\s+)/g, ' '), __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (oneLineInlineLists); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9vbmVMaW5lSW5saW5lTGlzdHMvb25lTGluZUlubGluZUxpc3RzLmpzIl0sIm5hbWVzIjpbIlRlbXBsYXRlVGFnIiwiaW5saW5lQXJyYXlUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lciIsIm9uZUxpbmVJbmxpbmVMaXN0cyJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7QUFDQSxPQUFPQyx3QkFBUCxNQUFxQyw2QkFBckM7O0FBRUEsSUFBTUMscUJBQXFCLElBQUlKLFdBQUosQ0FDekJDLHNCQUR5QixFQUV6QkUseUJBQXlCLFVBQXpCLEVBQXFDLEdBQXJDLENBRnlCLEVBR3pCRCxxQkFIeUIsQ0FBM0I7O0FBTUEsZUFBZUUsa0JBQWYiLCJmaWxlIjoib25lTGluZUlubGluZUxpc3RzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZydcbmltcG9ydCBpbmxpbmVBcnJheVRyYW5zZm9ybWVyIGZyb20gJy4uL2lubGluZUFycmF5VHJhbnNmb3JtZXInXG5pbXBvcnQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcidcbmltcG9ydCByZXBsYWNlUmVzdWx0VHJhbnNmb3JtZXIgZnJvbSAnLi4vcmVwbGFjZVJlc3VsdFRyYW5zZm9ybWVyJ1xuXG5jb25zdCBvbmVMaW5lSW5saW5lTGlzdHMgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIGlubGluZUFycmF5VHJhbnNmb3JtZXIsXG4gIHJlcGxhY2VSZXN1bHRUcmFuc2Zvcm1lcigvKD86XFxzKykvZywgJyAnKSxcbiAgdHJpbVJlc3VsdFRyYW5zZm9ybWVyXG4pXG5cbmV4cG9ydCBkZWZhdWx0IG9uZUxpbmVJbmxpbmVMaXN0c1xuIl19 - -/***/ }), -/* 870 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__stripIndent__ = __webpack_require__(871); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__stripIndent__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudC9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZWZhdWx0Il0sIm1hcHBpbmdzIjoiQUFBQTs7cUJBRW9CLGU7cUJBQWJBLE8iLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwb3J0IGRlZmF1bHQgZnJvbSAnLi9zdHJpcEluZGVudCdcbiJdfQ== - -/***/ }), -/* 871 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__ = __webpack_require__(40); - - - - - - -var stripIndent = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](__WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__["a" /* default */], __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (stripIndent); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudC9zdHJpcEluZGVudC5qcyJdLCJuYW1lcyI6WyJUZW1wbGF0ZVRhZyIsInN0cmlwSW5kZW50VHJhbnNmb3JtZXIiLCJ0cmltUmVzdWx0VHJhbnNmb3JtZXIiLCJzdHJpcEluZGVudCJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7O0FBRUEsSUFBTUMsY0FBYyxJQUFJSCxXQUFKLENBQ2xCQyxzQkFEa0IsRUFFbEJDLHFCQUZrQixDQUFwQjs7QUFLQSxlQUFlQyxXQUFmIiwiZmlsZSI6InN0cmlwSW5kZW50LmpzIiwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnXG5cbmltcG9ydCBUZW1wbGF0ZVRhZyBmcm9tICcuLi9UZW1wbGF0ZVRhZydcbmltcG9ydCBzdHJpcEluZGVudFRyYW5zZm9ybWVyIGZyb20gJy4uL3N0cmlwSW5kZW50VHJhbnNmb3JtZXInXG5pbXBvcnQgdHJpbVJlc3VsdFRyYW5zZm9ybWVyIGZyb20gJy4uL3RyaW1SZXN1bHRUcmFuc2Zvcm1lcidcblxuY29uc3Qgc3RyaXBJbmRlbnQgPSBuZXcgVGVtcGxhdGVUYWcoXG4gIHN0cmlwSW5kZW50VHJhbnNmb3JtZXIsXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lclxuKVxuXG5leHBvcnQgZGVmYXVsdCBzdHJpcEluZGVudFxuIl19 - -/***/ }), -/* 872 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__stripIndents__ = __webpack_require__(873); -/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__stripIndents__["a"]; }); - - - - -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudHMvaW5kZXguanMiXSwibmFtZXMiOlsiZGVmYXVsdCJdLCJtYXBwaW5ncyI6IkFBQUE7O3FCQUVvQixnQjtxQkFBYkEsTyIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5leHBvcnQgZGVmYXVsdCBmcm9tICcuL3N0cmlwSW5kZW50cydcbiJdfQ== - -/***/ }), -/* 873 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__TemplateTag__ = __webpack_require__(39); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__ = __webpack_require__(90); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__ = __webpack_require__(40); - - - - - - -var stripIndents = new __WEBPACK_IMPORTED_MODULE_0__TemplateTag__["a" /* default */](Object(__WEBPACK_IMPORTED_MODULE_1__stripIndentTransformer__["a" /* default */])('all'), __WEBPACK_IMPORTED_MODULE_2__trimResultTransformer__["a" /* default */]); - -/* harmony default export */ __webpack_exports__["a"] = (stripIndents); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJpcEluZGVudHMvc3RyaXBJbmRlbnRzLmpzIl0sIm5hbWVzIjpbIlRlbXBsYXRlVGFnIiwic3RyaXBJbmRlbnRUcmFuc2Zvcm1lciIsInRyaW1SZXN1bHRUcmFuc2Zvcm1lciIsInN0cmlwSW5kZW50cyJdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUEsT0FBT0EsV0FBUCxNQUF3QixnQkFBeEI7QUFDQSxPQUFPQyxzQkFBUCxNQUFtQywyQkFBbkM7QUFDQSxPQUFPQyxxQkFBUCxNQUFrQywwQkFBbEM7O0FBRUEsSUFBTUMsZUFBZSxJQUFJSCxXQUFKLENBQ25CQyx1QkFBdUIsS0FBdkIsQ0FEbUIsRUFFbkJDLHFCQUZtQixDQUFyQjs7QUFLQSxlQUFlQyxZQUFmIiwiZmlsZSI6InN0cmlwSW5kZW50cy5qcyIsInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0J1xuXG5pbXBvcnQgVGVtcGxhdGVUYWcgZnJvbSAnLi4vVGVtcGxhdGVUYWcnXG5pbXBvcnQgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lciBmcm9tICcuLi9zdHJpcEluZGVudFRyYW5zZm9ybWVyJ1xuaW1wb3J0IHRyaW1SZXN1bHRUcmFuc2Zvcm1lciBmcm9tICcuLi90cmltUmVzdWx0VHJhbnNmb3JtZXInXG5cbmNvbnN0IHN0cmlwSW5kZW50cyA9IG5ldyBUZW1wbGF0ZVRhZyhcbiAgc3RyaXBJbmRlbnRUcmFuc2Zvcm1lcignYWxsJyksXG4gIHRyaW1SZXN1bHRUcmFuc2Zvcm1lclxuKVxuXG5leHBvcnQgZGVmYXVsdCBzdHJpcEluZGVudHNcbiJdfQ== - -/***/ }), -/* 874 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isPriorToFiber = exports.isValidFiberElement = undefined; - -var _slicedToArray2 = __webpack_require__(165); - -var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _lodash = __webpack_require__(875); - -var _lodash2 = _interopRequireDefault(_lodash); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// return true if the element is renderable with react fiber -var isValidFiberElement = exports.isValidFiberElement = function isValidFiberElement(element) { - return typeof element === 'string' || typeof element === 'number' || _react2.default.isValidElement(element); -}; - -var isPriorToFiber = exports.isPriorToFiber = function isPriorToFiber(version) { - var _version$split = version.split('.'), - _version$split2 = (0, _slicedToArray3.default)(_version$split, 1), - majorVersion = _version$split2[0]; - - return Number(majorVersion) < 16; -}; - -// accepts an element and return true if renderable else return false -var isReactRenderable = function isReactRenderable(element) { - // storybook is running with a version prior to fiber, - // run a simple check on the element - if (isPriorToFiber(_react2.default.version)) { - return _react2.default.isValidElement(element); - } - - // the element is not an array, check if its a fiber renderable element - if (!Array.isArray(element)) { - return isValidFiberElement(element); - } - - // the element is in fact a list of elements (array), - // loop on its elements to see if its ok to render them - var elementsList = element.map(isReactRenderable); - - // flatten the list of elements (possibly deep nested) - var flatList = (0, _lodash2.default)(elementsList); - - // keep only invalid elements - var invalidElements = flatList.filter(function (elementIsRenderable) { - return elementIsRenderable === false; - }); - - // it's ok to render this list if there is no invalid elements inside - return !invalidElements.length; -}; - -exports.default = isReactRenderable; - -/***/ }), -/* 875 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) {/** - * lodash (Custom Build) <https://lodash.com/> - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors <https://jquery.org/> - * Released under MIT license <https://lodash.com/license> - * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; - -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} - -/** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); -} - -/** - * Recursively flattens `array`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Array - * @param {Array} array The array to flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, [3, [4]], 5]]); - * // => [1, 2, 3, 4, 5] - */ -function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, INFINITY) : []; -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = flattenDeep; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22))) - -/***/ }), -/* 876 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var mainStyle = { - position: 'fixed', - top: 0, - bottom: 0, - left: 0, - right: 0, - padding: 20, - backgroundColor: 'rgb(187, 49, 49)', - color: '#FFF', - WebkitFontSmoothing: 'antialiased' -}; - -var headingStyle = { - fontSize: 20, - fontWeight: 600, - letterSpacing: 0.2, - margin: '10px 0', - fontFamily: '\n -apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI",\n "Helvetica Neue", "Lucida Grande", sans-serif\n ' -}; - -var codeStyle = { - fontSize: 14, - width: '100vw', - overflow: 'auto' -}; - -var ErrorDisplay = function ErrorDisplay(_ref) { - var error = _ref.error; - return _react2.default.createElement( - 'div', - { style: mainStyle }, - _react2.default.createElement( - 'div', - { style: headingStyle }, - error.message - ), - _react2.default.createElement( - 'pre', - { style: codeStyle }, - _react2.default.createElement( - 'code', - null, - error.stack - ) - ) - ); -}; - -ErrorDisplay.propTypes = { - error: _propTypes2.default.shape({ - message: _propTypes2.default.string, - stack: _propTypes2.default.string - }).isRequired -}; - -exports.default = ErrorDisplay; - -/***/ }), -/* 877 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -exports.default = function (context) { - var queryParams = context.queryParams, - reduxStore = context.reduxStore, - window = context.window, - channel = context.channel; - // set the story if correct params are loaded via the URL. - - if (queryParams.selectedKind) { - reduxStore.dispatch((0, _actions.selectStory)(queryParams.selectedKind, queryParams.selectedStory)); - } - - // Handle keyEvents and pass them to the parent. - window.onkeydown = function (e) { - var parsedEvent = (0, _key_events2.default)(e); - if (parsedEvent) { - channel.emit('applyShortcut', { event: parsedEvent }); - } - }; -}; - -var _key_events = __webpack_require__(227); - -var _key_events2 = _interopRequireDefault(_key_events); - -var _actions = __webpack_require__(247); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/***/ }), -/* 878 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _extends2 = __webpack_require__(8); - -var _extends3 = _interopRequireDefault(_extends2); - -exports.default = reducer; - -var _actions = __webpack_require__(247); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function reducer() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var action = arguments[1]; - - switch (action.type) { - case _actions.types.CLEAR_ERROR: - { - return (0, _extends3.default)({}, state, { - error: null - }); - } - - case _actions.types.SET_ERROR: - { - return (0, _extends3.default)({}, state, { - error: action.error - }); - } - - case _actions.types.SELECT_STORY: - { - return (0, _extends3.default)({}, state, { - selectedKind: action.kind, - selectedStory: action.story - }); - } - - case _actions.types.SET_INITIAL_STORY: - { - var newState = (0, _extends3.default)({}, state); - var storyKindList = action.storyKindList; - - if (!newState.selectedKind && storyKindList.length > 0) { - newState.selectedKind = storyKindList[0].kind; - newState.selectedStory = storyKindList[0].stories[0]; - } - return newState; - } - - default: - return state; - } -} - -/***/ }), -/* 879 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(880)(); - - -/***/ }), -/* 880 */ -/***/ (function(module, exports, __webpack_require__) { - -const configureStorybook = __webpack_require__(881); -const storybook = __webpack_require__(500); - -module.exports = configureStorybook(storybook); - - -/***/ }), -/* 881 */ -/***/ (function(module, exports, __webpack_require__) { - -/* global window */ -const decorateStorybook = __webpack_require__(882); - -function createConfigurator(storybook) { - return function configureStorybook() { - if (typeof window === 'object') { - if (!window.loki) { - window.loki = {}; - } - window.loki.getStorybook = decorateStorybook(storybook); - } - }; -} - -module.exports = createConfigurator; - - -/***/ }), -/* 882 */ -/***/ (function(module, exports) { - -/* eslint no-param-reassign: ["error", { "props": false }] */ - -function decorateStorybook(storybook) { - const originalStoriesOf = storybook.storiesOf; - const skippedStories = {}; - - function storiesOf(kind, module) { - const stories = originalStoriesOf(kind, module); - stories.add.skip = function skip(story, storyFn) { - if (!skippedStories[kind]) { - skippedStories[kind] = []; - } - skippedStories[kind].push(story); - return stories.add(story, storyFn); - }; - return stories; - } - - storybook.storiesOf = storiesOf; - - function getStorybook() { - return storybook.getStorybook().map(function(category) { - const kind = category.kind; - const stories = category.stories; - const skipped = skippedStories[kind]; - if (skipped) { - return { - kind: kind, - skipped: skipped, - stories: stories.filter(function(story) { - return skipped.indexOf(story.name) === -1; - }) - }; - } - return category; - }); - } - - return getStorybook; -} - -module.exports = decorateStorybook; - - -/***/ }), -/* 883 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__storybook_react__ = __webpack_require__(500); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__storybook_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__storybook_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__storybook_addon_actions__ = __webpack_require__(66); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__storybook_addon_actions___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__storybook_addon_actions__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__storybook_addon_links__ = __webpack_require__(94); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__storybook_addon_links___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__storybook_addon_links__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__storybook_react_demo__ = __webpack_require__(884); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__storybook_react_demo___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__storybook_react_demo__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__src_Logo__ = __webpack_require__(887); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__src_AnimatedComponent__ = __webpack_require__(888); - - - - - - - - - - -Object(__WEBPACK_IMPORTED_MODULE_1__storybook_react__["storiesOf"])('Welcome', module).add('to Storybook', function () { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_4__storybook_react_demo__["Welcome"], { showApp: Object(__WEBPACK_IMPORTED_MODULE_3__storybook_addon_links__["linkTo"])('Button') }); -}); - -Object(__WEBPACK_IMPORTED_MODULE_1__storybook_react__["storiesOf"])('Button', module).add('with text', function () { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_4__storybook_react_demo__["Button"], - { onClick: Object(__WEBPACK_IMPORTED_MODULE_2__storybook_addon_actions__["action"])('clicked') }, - 'Hello Button' - ); -}).add('with some emoji', function () { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_4__storybook_react_demo__["Button"], - { onClick: Object(__WEBPACK_IMPORTED_MODULE_2__storybook_addon_actions__["action"])('clicked') }, - '\uD83D\uDE00 \uD83D\uDE0E \uD83D\uDC4D \uD83D\uDCAF' - ); -}).add.skip('skipped story', function () { - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_4__storybook_react_demo__["Button"], - { onClick: Object(__WEBPACK_IMPORTED_MODULE_2__storybook_addon_actions__["action"])('clicked') }, - 'I\'m skipped' - ); -}); -/* -storiesOf('Logo', module) - .add('without delay', () => <Logo />) - .add.skip('with 15s delay', () => <Logo delay={15000} />); - -storiesOf('Animation', module) - .add('with CSS transition', () => <AnimatedComponent.CSSTransition />) - .add('with CSS animation', () => <AnimatedComponent.CSSAnimation />) - .add('with react-motion', () => <AnimatedComponent.ReactMotion />); -*/ -/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(559)(module))) - -/***/ }), -/* 884 */ -/***/ (function(module, exports, __webpack_require__) { - -/* eslint-disable global-require */ -module.exports = { - Welcome: __webpack_require__(885).default, - Button: __webpack_require__(886).default, -}; - - -/***/ }), -/* 885 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = undefined; - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _glamorous = __webpack_require__(241); - -var _glamorous2 = _interopRequireDefault(_glamorous); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Main = _glamorous2.default.article({ - margin: 15, - maxWidth: 600, - lineHeight: 1.4, - fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif' -}); - -var Title = _glamorous2.default.h1({}); - -var Note = _glamorous2.default.p({ - opacity: 0.5 -}); - -var InlineCode = _glamorous2.default.code({ - fontSize: 15, - fontWeight: 600, - padding: '2px 5px', - border: '1px solid #eae9e9', - borderRadius: 4, - backgroundColor: '#f3f2f2', - color: '#3a3a3a' -}); - -var Link = _glamorous2.default.a({ - color: '#1474f3', - textDecoration: 'none', - borderBottom: '1px solid #1474f3', - paddingBottom: 2 -}); - -var Welcome = function Welcome(props) { - return _react2.default.createElement( - Main, - null, - _react2.default.createElement( - Title, - null, - 'Welcome to storybook' - ), - _react2.default.createElement( - 'p', - null, - 'This is a UI component dev environment for your app.' - ), - _react2.default.createElement( - 'p', - null, - 'We\'ve added some basic stories inside the', - ' ', - _react2.default.createElement( - InlineCode, - null, - 'src/stories' - ), - ' ', - 'directory.', - _react2.default.createElement('br', null), - 'A story is a single state of one or more UI components. You can have as many stories as you want.', - _react2.default.createElement('br', null), - '(Basically a story is like a visual test case.)' - ), - _react2.default.createElement( - 'p', - null, - 'See these sample', - ' ', - _react2.default.createElement( - Link, - { onClick: props.showApp, role: 'button', tabIndex: '0' }, - 'stories' - ), - ' ', - 'for a component called', - ' ', - _react2.default.createElement( - InlineCode, - null, - 'Button' - ), - '.' - ), - _react2.default.createElement( - 'p', - null, - 'Just like that, you can add your own components as stories.', - _react2.default.createElement('br', null), - 'You can also edit those components and see changes right away.', - _react2.default.createElement('br', null), - '(Try editing the ', - _react2.default.createElement( - InlineCode, - null, - 'Button' - ), - ' stories located at ', - _react2.default.createElement( - InlineCode, - null, - 'src/stories/index.js' - ), - '.)' - ), - _react2.default.createElement( - 'p', - null, - 'Usually we create stories with smaller UI components in the app.', - _react2.default.createElement('br', null), - 'Have a look at the', - ' ', - _react2.default.createElement( - Link, - { - href: 'https://storybook.js.org/basics/writing-stories', - target: '_blank', - rel: 'noopener noreferrer' - }, - 'Writing Stories' - ), - ' ', - 'section in our documentation.' - ), - _react2.default.createElement( - Note, - null, - _react2.default.createElement( - 'b', - null, - 'NOTE:' - ), - _react2.default.createElement('br', null), - 'Have a look at the', - ' ', - _react2.default.createElement( - InlineCode, - null, - '.storybook/webpack.config.js' - ), - ' ', - 'to add webpack loaders and plugins you are using in this project.' - ) - ); -}; - -Welcome.displayName = 'Welcome'; -Welcome.propTypes = { - showApp: _propTypes2.default.func -}; -Welcome.defaultProps = { - // eslint-disable-next-line no-console - showApp: function showApp() { - return console.log('Welcome to storybook!'); - } -}; - -exports.default = Welcome; - -/***/ }), -/* 886 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _objectWithoutProperties2 = __webpack_require__(49); - -var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _glamorous = __webpack_require__(241); - -var _glamorous2 = _interopRequireDefault(_glamorous); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Button = (0, _glamorous2.default)(function (_ref) { - var children = _ref.children, - rest = (0, _objectWithoutProperties3.default)(_ref, ['children']); - return _react2.default.createElement( - 'button', - rest, - children - ); -})({ - border: '1px solid #eee', - borderRadius: 3, - backgroundColor: '#FFFFFF', - cursor: 'pointer', - fontSize: 15, - padding: '3px 10px', - margin: 10 -}); - -Button.displayName = 'Button'; -Button.propTypes = { - children: _propTypes2.default.node.isRequired, - onClick: _propTypes2.default.func -}; - -exports.default = Button; - -/***/ }), -/* 887 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(3); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); - - - -var DELAY_URL_PREFIX = 'http://www.deelay.me'; - -var Logo = function Logo(_ref) { - var delay = _ref.delay, - logoUrl = _ref.logoUrl; - return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('img', { - style: { width: 75, height: 75 }, - alt: '', - src: delay ? DELAY_URL_PREFIX + '/' + delay + '/' + logoUrl : logoUrl - }); -}; - -Logo.propTypes = { - delay: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.number, - logoUrl: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string -}; - -Logo.defaultProps = { - delay: 0, - logoUrl: 'https://loki.js.org/favicon.png' -}; - -/* unused harmony default export */ var _unused_webpack_default_export = (Logo); -Logo.__docgenInfo = { - 'description': '', - 'props': { - 'delay': { - 'type': { - 'name': 'number' - }, - 'required': false, - 'description': '', - 'defaultValue': { - 'value': '0', - 'computed': false - } - }, - 'logoUrl': { - 'type': { - 'name': 'string' - }, - 'required': false, - 'description': '', - 'defaultValue': { - 'value': '\'https://loki.js.org/favicon.png\'', - 'computed': false - } - } - } -}; - -if (typeof STORYBOOK_REACT_CLASSES !== 'undefined') { - STORYBOOK_REACT_CLASSES['src/Logo.js'] = { - name: 'Logo', - docgenInfo: Logo.__docgenInfo, - path: 'src/Logo.js' - }; -} - -/***/ }), -/* 888 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* unused harmony export CSSTransition */ -/* unused harmony export CSSAnimation */ -/* unused harmony export ReactMotion */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of__ = __webpack_require__(18); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__ = __webpack_require__(5); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__ = __webpack_require__(6); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__ = __webpack_require__(11); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react__ = __webpack_require__(0); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_motion__ = __webpack_require__(889); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_motion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_motion__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__AnimatedComponent_css__ = __webpack_require__(897); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__AnimatedComponent_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__AnimatedComponent_css__); - - - - - - - - - -var withAlternatingState = function withAlternatingState(WrappedComponent) { - var interval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000; - return function (_Component) { - __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(AlternatingStateComponent, _Component); - - function AlternatingStateComponent(props) { - __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, AlternatingStateComponent); - - var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (AlternatingStateComponent.__proto__ || __WEBPACK_IMPORTED_MODULE_0_babel_runtime_core_js_object_get_prototype_of___default()(AlternatingStateComponent)).call(this, props)); - - _this.render = function () { - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(WrappedComponent, { on: _this.state.on }); - }; - - _this.state = { on: false }; - return _this; - } - - __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(AlternatingStateComponent, [{ - key: 'componentDidMount', - value: function componentDidMount() { - var _this2 = this; - - var toggle = function toggle() { - return _this2.setState(function (state) { - return { - on: !state.on - }; - }); - }; - setTimeout(toggle, 1); - this.interval = setInterval(toggle, interval); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - clearInterval(this.interval); - } - }]); - - return AlternatingStateComponent; - }(__WEBPACK_IMPORTED_MODULE_5_react__["Component"]); -}; - -var CSSTransition = withAlternatingState(function (_ref) { - var on = _ref.on; - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('div', { className: 'AnimatedComponent CSSTransition ' + (on ? 'CSSTransition-on' : '') }); -}); - -var CSSAnimation = function CSSAnimation() { - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('div', { className: 'AnimatedComponent CSSAnimation' }); -}; - -var ReactMotion = withAlternatingState(function (_ref2) { - var on = _ref2.on; - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement( - __WEBPACK_IMPORTED_MODULE_6_react_motion__["Motion"], - { defaultStyle: { rotate: 45 }, style: { rotate: Object(__WEBPACK_IMPORTED_MODULE_6_react_motion__["spring"])(on ? 0 : 45) } }, - function (value) { - return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('div', { - className: 'AnimatedComponent', - style: { transform: 'rotate(' + value.rotate + 'deg)' } - }); - } - ); -}); - -/***/ }), -/* 889 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } - -var _Motion = __webpack_require__(890); - -exports.Motion = _interopRequire(_Motion); - -var _StaggeredMotion = __webpack_require__(892); - -exports.StaggeredMotion = _interopRequire(_StaggeredMotion); - -var _TransitionMotion = __webpack_require__(893); - -exports.TransitionMotion = _interopRequire(_TransitionMotion); - -var _spring = __webpack_require__(895); - -exports.spring = _interopRequire(_spring); - -var _presets = __webpack_require__(569); - -exports.presets = _interopRequire(_presets); - -var _stripStyle = __webpack_require__(248); - -exports.stripStyle = _interopRequire(_stripStyle); - -// deprecated, dummy warning function - -var _reorderKeys = __webpack_require__(896); - -exports.reorderKeys = _interopRequire(_reorderKeys); - -/***/ }), -/* 890 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _mapToZero = __webpack_require__(503); - -var _mapToZero2 = _interopRequireDefault(_mapToZero); - -var _stripStyle = __webpack_require__(248); - -var _stripStyle2 = _interopRequireDefault(_stripStyle); - -var _stepper3 = __webpack_require__(504); - -var _stepper4 = _interopRequireDefault(_stepper3); - -var _performanceNow = __webpack_require__(505); - -var _performanceNow2 = _interopRequireDefault(_performanceNow); - -var _raf = __webpack_require__(506); - -var _raf2 = _interopRequireDefault(_raf); - -var _shouldStopAnimation = __webpack_require__(507); - -var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var msPerFrame = 1000 / 60; - -var Motion = (function (_React$Component) { - _inherits(Motion, _React$Component); - - _createClass(Motion, null, [{ - key: 'propTypes', - value: { - // TOOD: warn against putting a config in here - defaultStyle: _propTypes2['default'].objectOf(_propTypes2['default'].number), - style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired, - children: _propTypes2['default'].func.isRequired, - onRest: _propTypes2['default'].func - }, - enumerable: true - }]); - - function Motion(props) { - var _this = this; - - _classCallCheck(this, Motion); - - _React$Component.call(this, props); - this.wasAnimating = false; - this.animationID = null; - this.prevTime = 0; - this.accumulatedTime = 0; - this.unreadPropStyle = null; - - this.clearUnreadPropStyle = function (destStyle) { - var dirty = false; - var _state = _this.state; - var currentStyle = _state.currentStyle; - var currentVelocity = _state.currentVelocity; - var lastIdealStyle = _state.lastIdealStyle; - var lastIdealVelocity = _state.lastIdealVelocity; - - for (var key in destStyle) { - if (!Object.prototype.hasOwnProperty.call(destStyle, key)) { - continue; - } - - var styleValue = destStyle[key]; - if (typeof styleValue === 'number') { - if (!dirty) { - dirty = true; - currentStyle = _extends({}, currentStyle); - currentVelocity = _extends({}, currentVelocity); - lastIdealStyle = _extends({}, lastIdealStyle); - lastIdealVelocity = _extends({}, lastIdealVelocity); - } - - currentStyle[key] = styleValue; - currentVelocity[key] = 0; - lastIdealStyle[key] = styleValue; - lastIdealVelocity[key] = 0; - } - } - - if (dirty) { - _this.setState({ currentStyle: currentStyle, currentVelocity: currentVelocity, lastIdealStyle: lastIdealStyle, lastIdealVelocity: lastIdealVelocity }); - } - }; - - this.startAnimationIfNecessary = function () { - // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and - // call cb? No, otherwise accidental parent rerender causes cb trigger - _this.animationID = _raf2['default'](function (timestamp) { - // check if we need to animate in the first place - var propsStyle = _this.props.style; - if (_shouldStopAnimation2['default'](_this.state.currentStyle, propsStyle, _this.state.currentVelocity)) { - if (_this.wasAnimating && _this.props.onRest) { - _this.props.onRest(); - } - - // no need to cancel animationID here; shouldn't have any in flight - _this.animationID = null; - _this.wasAnimating = false; - _this.accumulatedTime = 0; - return; - } - - _this.wasAnimating = true; - - var currentTime = timestamp || _performanceNow2['default'](); - var timeDelta = currentTime - _this.prevTime; - _this.prevTime = currentTime; - _this.accumulatedTime = _this.accumulatedTime + timeDelta; - // more than 10 frames? prolly switched browser tab. Restart - if (_this.accumulatedTime > msPerFrame * 10) { - _this.accumulatedTime = 0; - } - - if (_this.accumulatedTime === 0) { - // no need to cancel animationID here; shouldn't have any in flight - _this.animationID = null; - _this.startAnimationIfNecessary(); - return; - } - - var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame; - var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame); - - var newLastIdealStyle = {}; - var newLastIdealVelocity = {}; - var newCurrentStyle = {}; - var newCurrentVelocity = {}; - - for (var key in propsStyle) { - if (!Object.prototype.hasOwnProperty.call(propsStyle, key)) { - continue; - } - - var styleValue = propsStyle[key]; - if (typeof styleValue === 'number') { - newCurrentStyle[key] = styleValue; - newCurrentVelocity[key] = 0; - newLastIdealStyle[key] = styleValue; - newLastIdealVelocity[key] = 0; - } else { - var newLastIdealStyleValue = _this.state.lastIdealStyle[key]; - var newLastIdealVelocityValue = _this.state.lastIdealVelocity[key]; - for (var i = 0; i < framesToCatchUp; i++) { - var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision); - - newLastIdealStyleValue = _stepper[0]; - newLastIdealVelocityValue = _stepper[1]; - } - - var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision); - - var nextIdealX = _stepper2[0]; - var nextIdealV = _stepper2[1]; - - newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion; - newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion; - newLastIdealStyle[key] = newLastIdealStyleValue; - newLastIdealVelocity[key] = newLastIdealVelocityValue; - } - } - - _this.animationID = null; - // the amount we're looped over above - _this.accumulatedTime -= framesToCatchUp * msPerFrame; - - _this.setState({ - currentStyle: newCurrentStyle, - currentVelocity: newCurrentVelocity, - lastIdealStyle: newLastIdealStyle, - lastIdealVelocity: newLastIdealVelocity - }); - - _this.unreadPropStyle = null; - - _this.startAnimationIfNecessary(); - }); - }; - - this.state = this.defaultState(); - } - - Motion.prototype.defaultState = function defaultState() { - var _props = this.props; - var defaultStyle = _props.defaultStyle; - var style = _props.style; - - var currentStyle = defaultStyle || _stripStyle2['default'](style); - var currentVelocity = _mapToZero2['default'](currentStyle); - return { - currentStyle: currentStyle, - currentVelocity: currentVelocity, - lastIdealStyle: currentStyle, - lastIdealVelocity: currentVelocity - }; - }; - - // it's possible that currentStyle's value is stale: if props is immediately - // changed from 0 to 400 to spring(0) again, the async currentStyle is still - // at 0 (didn't have time to tick and interpolate even once). If we naively - // compare currentStyle with destVal it'll be 0 === 0 (no animation, stop). - // In reality currentStyle should be 400 - - Motion.prototype.componentDidMount = function componentDidMount() { - this.prevTime = _performanceNow2['default'](); - this.startAnimationIfNecessary(); - }; - - Motion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) { - if (this.unreadPropStyle != null) { - // previous props haven't had the chance to be set yet; set them here - this.clearUnreadPropStyle(this.unreadPropStyle); - } - - this.unreadPropStyle = props.style; - if (this.animationID == null) { - this.prevTime = _performanceNow2['default'](); - this.startAnimationIfNecessary(); - } - }; - - Motion.prototype.componentWillUnmount = function componentWillUnmount() { - if (this.animationID != null) { - _raf2['default'].cancel(this.animationID); - this.animationID = null; - } - }; - - Motion.prototype.render = function render() { - var renderedChildren = this.props.children(this.state.currentStyle); - return renderedChildren && _react2['default'].Children.only(renderedChildren); - }; - - return Motion; -})(_react2['default'].Component); - -exports['default'] = Motion; -module.exports = exports['default']; - -// after checking for unreadPropStyle != null, we manually go set the -// non-interpolating values (those that are a number, without a spring -// config) - -/***/ }), -/* 891 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {// Generated by CoffeeScript 1.12.2 -(function() { - var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; - - if ((typeof performance !== "undefined" && performance !== null) && performance.now) { - module.exports = function() { - return performance.now(); - }; - } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { - module.exports = function() { - return (getNanoSeconds() - nodeLoadTime) / 1e6; - }; - hrtime = process.hrtime; - getNanoSeconds = function() { - var hr; - hr = hrtime(); - return hr[0] * 1e9 + hr[1]; - }; - moduleLoadTime = getNanoSeconds(); - upTime = process.uptime() * 1e9; - nodeLoadTime = moduleLoadTime - upTime; - } else if (Date.now) { - module.exports = function() { - return Date.now() - loadTime; - }; - loadTime = Date.now(); - } else { - module.exports = function() { - return new Date().getTime() - loadTime; - }; - loadTime = new Date().getTime(); - } - -}).call(this); - -//# sourceMappingURL=performance-now.js.map - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(44))) - -/***/ }), -/* 892 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _mapToZero = __webpack_require__(503); - -var _mapToZero2 = _interopRequireDefault(_mapToZero); - -var _stripStyle = __webpack_require__(248); - -var _stripStyle2 = _interopRequireDefault(_stripStyle); - -var _stepper3 = __webpack_require__(504); - -var _stepper4 = _interopRequireDefault(_stepper3); - -var _performanceNow = __webpack_require__(505); - -var _performanceNow2 = _interopRequireDefault(_performanceNow); - -var _raf = __webpack_require__(506); - -var _raf2 = _interopRequireDefault(_raf); - -var _shouldStopAnimation = __webpack_require__(507); - -var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var msPerFrame = 1000 / 60; - -function shouldStopAnimationAll(currentStyles, styles, currentVelocities) { - for (var i = 0; i < currentStyles.length; i++) { - if (!_shouldStopAnimation2['default'](currentStyles[i], styles[i], currentVelocities[i])) { - return false; - } - } - return true; -} - -var StaggeredMotion = (function (_React$Component) { - _inherits(StaggeredMotion, _React$Component); - - _createClass(StaggeredMotion, null, [{ - key: 'propTypes', - value: { - // TOOD: warn against putting a config in here - defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].objectOf(_propTypes2['default'].number)), - styles: _propTypes2['default'].func.isRequired, - children: _propTypes2['default'].func.isRequired - }, - enumerable: true - }]); - - function StaggeredMotion(props) { - var _this = this; - - _classCallCheck(this, StaggeredMotion); - - _React$Component.call(this, props); - this.animationID = null; - this.prevTime = 0; - this.accumulatedTime = 0; - this.unreadPropStyles = null; - - this.clearUnreadPropStyle = function (unreadPropStyles) { - var _state = _this.state; - var currentStyles = _state.currentStyles; - var currentVelocities = _state.currentVelocities; - var lastIdealStyles = _state.lastIdealStyles; - var lastIdealVelocities = _state.lastIdealVelocities; - - var someDirty = false; - for (var i = 0; i < unreadPropStyles.length; i++) { - var unreadPropStyle = unreadPropStyles[i]; - var dirty = false; - - for (var key in unreadPropStyle) { - if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) { - continue; - } - - var styleValue = unreadPropStyle[key]; - if (typeof styleValue === 'number') { - if (!dirty) { - dirty = true; - someDirty = true; - currentStyles[i] = _extends({}, currentStyles[i]); - currentVelocities[i] = _extends({}, currentVelocities[i]); - lastIdealStyles[i] = _extends({}, lastIdealStyles[i]); - lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]); - } - currentStyles[i][key] = styleValue; - currentVelocities[i][key] = 0; - lastIdealStyles[i][key] = styleValue; - lastIdealVelocities[i][key] = 0; - } - } - } - - if (someDirty) { - _this.setState({ currentStyles: currentStyles, currentVelocities: currentVelocities, lastIdealStyles: lastIdealStyles, lastIdealVelocities: lastIdealVelocities }); - } - }; - - this.startAnimationIfNecessary = function () { - // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and - // call cb? No, otherwise accidental parent rerender causes cb trigger - _this.animationID = _raf2['default'](function (timestamp) { - var destStyles = _this.props.styles(_this.state.lastIdealStyles); - - // check if we need to animate in the first place - if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities)) { - // no need to cancel animationID here; shouldn't have any in flight - _this.animationID = null; - _this.accumulatedTime = 0; - return; - } - - var currentTime = timestamp || _performanceNow2['default'](); - var timeDelta = currentTime - _this.prevTime; - _this.prevTime = currentTime; - _this.accumulatedTime = _this.accumulatedTime + timeDelta; - // more than 10 frames? prolly switched browser tab. Restart - if (_this.accumulatedTime > msPerFrame * 10) { - _this.accumulatedTime = 0; - } - - if (_this.accumulatedTime === 0) { - // no need to cancel animationID here; shouldn't have any in flight - _this.animationID = null; - _this.startAnimationIfNecessary(); - return; - } - - var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame; - var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame); - - var newLastIdealStyles = []; - var newLastIdealVelocities = []; - var newCurrentStyles = []; - var newCurrentVelocities = []; - - for (var i = 0; i < destStyles.length; i++) { - var destStyle = destStyles[i]; - var newCurrentStyle = {}; - var newCurrentVelocity = {}; - var newLastIdealStyle = {}; - var newLastIdealVelocity = {}; - - for (var key in destStyle) { - if (!Object.prototype.hasOwnProperty.call(destStyle, key)) { - continue; - } - - var styleValue = destStyle[key]; - if (typeof styleValue === 'number') { - newCurrentStyle[key] = styleValue; - newCurrentVelocity[key] = 0; - newLastIdealStyle[key] = styleValue; - newLastIdealVelocity[key] = 0; - } else { - var newLastIdealStyleValue = _this.state.lastIdealStyles[i][key]; - var newLastIdealVelocityValue = _this.state.lastIdealVelocities[i][key]; - for (var j = 0; j < framesToCatchUp; j++) { - var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision); - - newLastIdealStyleValue = _stepper[0]; - newLastIdealVelocityValue = _stepper[1]; - } - - var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision); - - var nextIdealX = _stepper2[0]; - var nextIdealV = _stepper2[1]; - - newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion; - newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion; - newLastIdealStyle[key] = newLastIdealStyleValue; - newLastIdealVelocity[key] = newLastIdealVelocityValue; - } - } - - newCurrentStyles[i] = newCurrentStyle; - newCurrentVelocities[i] = newCurrentVelocity; - newLastIdealStyles[i] = newLastIdealStyle; - newLastIdealVelocities[i] = newLastIdealVelocity; - } - - _this.animationID = null; - // the amount we're looped over above - _this.accumulatedTime -= framesToCatchUp * msPerFrame; - - _this.setState({ - currentStyles: newCurrentStyles, - currentVelocities: newCurrentVelocities, - lastIdealStyles: newLastIdealStyles, - lastIdealVelocities: newLastIdealVelocities - }); - - _this.unreadPropStyles = null; - - _this.startAnimationIfNecessary(); - }); - }; - - this.state = this.defaultState(); - } - - StaggeredMotion.prototype.defaultState = function defaultState() { - var _props = this.props; - var defaultStyles = _props.defaultStyles; - var styles = _props.styles; - - var currentStyles = defaultStyles || styles().map(_stripStyle2['default']); - var currentVelocities = currentStyles.map(function (currentStyle) { - return _mapToZero2['default'](currentStyle); - }); - return { - currentStyles: currentStyles, - currentVelocities: currentVelocities, - lastIdealStyles: currentStyles, - lastIdealVelocities: currentVelocities - }; - }; - - StaggeredMotion.prototype.componentDidMount = function componentDidMount() { - this.prevTime = _performanceNow2['default'](); - this.startAnimationIfNecessary(); - }; - - StaggeredMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) { - if (this.unreadPropStyles != null) { - // previous props haven't had the chance to be set yet; set them here - this.clearUnreadPropStyle(this.unreadPropStyles); - } - - this.unreadPropStyles = props.styles(this.state.lastIdealStyles); - if (this.animationID == null) { - this.prevTime = _performanceNow2['default'](); - this.startAnimationIfNecessary(); - } - }; - - StaggeredMotion.prototype.componentWillUnmount = function componentWillUnmount() { - if (this.animationID != null) { - _raf2['default'].cancel(this.animationID); - this.animationID = null; - } - }; - - StaggeredMotion.prototype.render = function render() { - var renderedChildren = this.props.children(this.state.currentStyles); - return renderedChildren && _react2['default'].Children.only(renderedChildren); - }; - - return StaggeredMotion; -})(_react2['default'].Component); - -exports['default'] = StaggeredMotion; -module.exports = exports['default']; - -// it's possible that currentStyle's value is stale: if props is immediately -// changed from 0 to 400 to spring(0) again, the async currentStyle is still -// at 0 (didn't have time to tick and interpolate even once). If we naively -// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop). -// In reality currentStyle should be 400 - -// after checking for unreadPropStyles != null, we manually go set the -// non-interpolating values (those that are a number, without a spring -// config) - -/***/ }), -/* 893 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _mapToZero = __webpack_require__(503); - -var _mapToZero2 = _interopRequireDefault(_mapToZero); - -var _stripStyle = __webpack_require__(248); - -var _stripStyle2 = _interopRequireDefault(_stripStyle); - -var _stepper3 = __webpack_require__(504); - -var _stepper4 = _interopRequireDefault(_stepper3); - -var _mergeDiff = __webpack_require__(894); - -var _mergeDiff2 = _interopRequireDefault(_mergeDiff); - -var _performanceNow = __webpack_require__(505); - -var _performanceNow2 = _interopRequireDefault(_performanceNow); - -var _raf = __webpack_require__(506); - -var _raf2 = _interopRequireDefault(_raf); - -var _shouldStopAnimation = __webpack_require__(507); - -var _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = __webpack_require__(3); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var msPerFrame = 1000 / 60; - -// the children function & (potential) styles function asks as param an -// Array<TransitionPlainStyle>, where each TransitionPlainStyle is of the format -// {key: string, data?: any, style: PlainStyle}. However, the way we keep -// internal states doesn't contain such a data structure (check the state and -// TransitionMotionState). So when children function and others ask for such -// data we need to generate them on the fly by combining mergedPropsStyles and -// currentStyles/lastIdealStyles -function rehydrateStyles(mergedPropsStyles, unreadPropStyles, plainStyles) { - // Copy the value to a `const` so that Flow understands that the const won't - // change and will be non-nullable in the callback below. - var cUnreadPropStyles = unreadPropStyles; - if (cUnreadPropStyles == null) { - return mergedPropsStyles.map(function (mergedPropsStyle, i) { - return { - key: mergedPropsStyle.key, - data: mergedPropsStyle.data, - style: plainStyles[i] - }; - }); - } - return mergedPropsStyles.map(function (mergedPropsStyle, i) { - for (var j = 0; j < cUnreadPropStyles.length; j++) { - if (cUnreadPropStyles[j].key === mergedPropsStyle.key) { - return { - key: cUnreadPropStyles[j].key, - data: cUnreadPropStyles[j].data, - style: plainStyles[i] - }; - } - } - return { key: mergedPropsStyle.key, data: mergedPropsStyle.data, style: plainStyles[i] }; - }); -} - -function shouldStopAnimationAll(currentStyles, destStyles, currentVelocities, mergedPropsStyles) { - if (mergedPropsStyles.length !== destStyles.length) { - return false; - } - - for (var i = 0; i < mergedPropsStyles.length; i++) { - if (mergedPropsStyles[i].key !== destStyles[i].key) { - return false; - } - } - - // we have the invariant that mergedPropsStyles and - // currentStyles/currentVelocities/last* are synced in terms of cells, see - // mergeAndSync comment for more info - for (var i = 0; i < mergedPropsStyles.length; i++) { - if (!_shouldStopAnimation2['default'](currentStyles[i], destStyles[i].style, currentVelocities[i])) { - return false; - } - } - - return true; -} - -// core key merging logic - -// things to do: say previously merged style is {a, b}, dest style (prop) is {b, -// c}, previous current (interpolating) style is {a, b} -// **invariant**: current[i] corresponds to merged[i] in terms of key - -// steps: -// turn merged style into {a?, b, c} -// add c, value of c is destStyles.c -// maybe remove a, aka call willLeave(a), then merged is either {b, c} or {a, b, c} -// turn current (interpolating) style from {a, b} into {a?, b, c} -// maybe remove a -// certainly add c, value of c is willEnter(c) -// loop over merged and construct new current -// dest doesn't change, that's owner's -function mergeAndSync(willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldLastIdealStyles, oldLastIdealVelocities) { - var newMergedPropsStyles = _mergeDiff2['default'](oldMergedPropsStyles, destStyles, function (oldIndex, oldMergedPropsStyle) { - var leavingStyle = willLeave(oldMergedPropsStyle); - if (leavingStyle == null) { - didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data }); - return null; - } - if (_shouldStopAnimation2['default'](oldCurrentStyles[oldIndex], leavingStyle, oldCurrentVelocities[oldIndex])) { - didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data }); - return null; - } - return { key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data, style: leavingStyle }; - }); - - var newCurrentStyles = []; - var newCurrentVelocities = []; - var newLastIdealStyles = []; - var newLastIdealVelocities = []; - for (var i = 0; i < newMergedPropsStyles.length; i++) { - var newMergedPropsStyleCell = newMergedPropsStyles[i]; - var foundOldIndex = null; - for (var j = 0; j < oldMergedPropsStyles.length; j++) { - if (oldMergedPropsStyles[j].key === newMergedPropsStyleCell.key) { - foundOldIndex = j; - break; - } - } - // TODO: key search code - if (foundOldIndex == null) { - var plainStyle = willEnter(newMergedPropsStyleCell); - newCurrentStyles[i] = plainStyle; - newLastIdealStyles[i] = plainStyle; - - var velocity = _mapToZero2['default'](newMergedPropsStyleCell.style); - newCurrentVelocities[i] = velocity; - newLastIdealVelocities[i] = velocity; - } else { - newCurrentStyles[i] = oldCurrentStyles[foundOldIndex]; - newLastIdealStyles[i] = oldLastIdealStyles[foundOldIndex]; - newCurrentVelocities[i] = oldCurrentVelocities[foundOldIndex]; - newLastIdealVelocities[i] = oldLastIdealVelocities[foundOldIndex]; - } - } - - return [newMergedPropsStyles, newCurrentStyles, newCurrentVelocities, newLastIdealStyles, newLastIdealVelocities]; -} - -var TransitionMotion = (function (_React$Component) { - _inherits(TransitionMotion, _React$Component); - - _createClass(TransitionMotion, null, [{ - key: 'propTypes', - value: { - defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].shape({ - key: _propTypes2['default'].string.isRequired, - data: _propTypes2['default'].any, - style: _propTypes2['default'].objectOf(_propTypes2['default'].number).isRequired - })), - styles: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].arrayOf(_propTypes2['default'].shape({ - key: _propTypes2['default'].string.isRequired, - data: _propTypes2['default'].any, - style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired - }))]).isRequired, - children: _propTypes2['default'].func.isRequired, - willEnter: _propTypes2['default'].func, - willLeave: _propTypes2['default'].func, - didLeave: _propTypes2['default'].func - }, - enumerable: true - }, { - key: 'defaultProps', - value: { - willEnter: function willEnter(styleThatEntered) { - return _stripStyle2['default'](styleThatEntered.style); - }, - // recall: returning null makes the current unmounting TransitionStyle - // disappear immediately - willLeave: function willLeave() { - return null; - }, - didLeave: function didLeave() {} - }, - enumerable: true - }]); - - function TransitionMotion(props) { - var _this = this; - - _classCallCheck(this, TransitionMotion); - - _React$Component.call(this, props); - this.unmounting = false; - this.animationID = null; - this.prevTime = 0; - this.accumulatedTime = 0; - this.unreadPropStyles = null; - - this.clearUnreadPropStyle = function (unreadPropStyles) { - var _mergeAndSync = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, unreadPropStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities); - - var mergedPropsStyles = _mergeAndSync[0]; - var currentStyles = _mergeAndSync[1]; - var currentVelocities = _mergeAndSync[2]; - var lastIdealStyles = _mergeAndSync[3]; - var lastIdealVelocities = _mergeAndSync[4]; - - for (var i = 0; i < unreadPropStyles.length; i++) { - var unreadPropStyle = unreadPropStyles[i].style; - var dirty = false; - - for (var key in unreadPropStyle) { - if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) { - continue; - } - - var styleValue = unreadPropStyle[key]; - if (typeof styleValue === 'number') { - if (!dirty) { - dirty = true; - currentStyles[i] = _extends({}, currentStyles[i]); - currentVelocities[i] = _extends({}, currentVelocities[i]); - lastIdealStyles[i] = _extends({}, lastIdealStyles[i]); - lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]); - mergedPropsStyles[i] = { - key: mergedPropsStyles[i].key, - data: mergedPropsStyles[i].data, - style: _extends({}, mergedPropsStyles[i].style) - }; - } - currentStyles[i][key] = styleValue; - currentVelocities[i][key] = 0; - lastIdealStyles[i][key] = styleValue; - lastIdealVelocities[i][key] = 0; - mergedPropsStyles[i].style[key] = styleValue; - } - } - } - - // unlike the other 2 components, we can't detect staleness and optionally - // opt out of setState here. each style object's data might contain new - // stuff we're not/cannot compare - _this.setState({ - currentStyles: currentStyles, - currentVelocities: currentVelocities, - mergedPropsStyles: mergedPropsStyles, - lastIdealStyles: lastIdealStyles, - lastIdealVelocities: lastIdealVelocities - }); - }; - - this.startAnimationIfNecessary = function () { - if (_this.unmounting) { - return; - } - - // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and - // call cb? No, otherwise accidental parent rerender causes cb trigger - _this.animationID = _raf2['default'](function (timestamp) { - // https://github.com/chenglou/react-motion/pull/420 - // > if execution passes the conditional if (this.unmounting), then - // executes async defaultRaf and after that component unmounts and after - // that the callback of defaultRaf is called, then setState will be called - // on unmounted component. - if (_this.unmounting) { - return; - } - - var propStyles = _this.props.styles; - var destStyles = typeof propStyles === 'function' ? propStyles(rehydrateStyles(_this.state.mergedPropsStyles, _this.unreadPropStyles, _this.state.lastIdealStyles)) : propStyles; - - // check if we need to animate in the first place - if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities, _this.state.mergedPropsStyles)) { - // no need to cancel animationID here; shouldn't have any in flight - _this.animationID = null; - _this.accumulatedTime = 0; - return; - } - - var currentTime = timestamp || _performanceNow2['default'](); - var timeDelta = currentTime - _this.prevTime; - _this.prevTime = currentTime; - _this.accumulatedTime = _this.accumulatedTime + timeDelta; - // more than 10 frames? prolly switched browser tab. Restart - if (_this.accumulatedTime > msPerFrame * 10) { - _this.accumulatedTime = 0; - } - - if (_this.accumulatedTime === 0) { - // no need to cancel animationID here; shouldn't have any in flight - _this.animationID = null; - _this.startAnimationIfNecessary(); - return; - } - - var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame; - var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame); - - var _mergeAndSync2 = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, destStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities); - - var newMergedPropsStyles = _mergeAndSync2[0]; - var newCurrentStyles = _mergeAndSync2[1]; - var newCurrentVelocities = _mergeAndSync2[2]; - var newLastIdealStyles = _mergeAndSync2[3]; - var newLastIdealVelocities = _mergeAndSync2[4]; - - for (var i = 0; i < newMergedPropsStyles.length; i++) { - var newMergedPropsStyle = newMergedPropsStyles[i].style; - var newCurrentStyle = {}; - var newCurrentVelocity = {}; - var newLastIdealStyle = {}; - var newLastIdealVelocity = {}; - - for (var key in newMergedPropsStyle) { - if (!Object.prototype.hasOwnProperty.call(newMergedPropsStyle, key)) { - continue; - } - - var styleValue = newMergedPropsStyle[key]; - if (typeof styleValue === 'number') { - newCurrentStyle[key] = styleValue; - newCurrentVelocity[key] = 0; - newLastIdealStyle[key] = styleValue; - newLastIdealVelocity[key] = 0; - } else { - var newLastIdealStyleValue = newLastIdealStyles[i][key]; - var newLastIdealVelocityValue = newLastIdealVelocities[i][key]; - for (var j = 0; j < framesToCatchUp; j++) { - var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision); - - newLastIdealStyleValue = _stepper[0]; - newLastIdealVelocityValue = _stepper[1]; - } - - var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision); - - var nextIdealX = _stepper2[0]; - var nextIdealV = _stepper2[1]; - - newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion; - newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion; - newLastIdealStyle[key] = newLastIdealStyleValue; - newLastIdealVelocity[key] = newLastIdealVelocityValue; - } - } - - newLastIdealStyles[i] = newLastIdealStyle; - newLastIdealVelocities[i] = newLastIdealVelocity; - newCurrentStyles[i] = newCurrentStyle; - newCurrentVelocities[i] = newCurrentVelocity; - } - - _this.animationID = null; - // the amount we're looped over above - _this.accumulatedTime -= framesToCatchUp * msPerFrame; - - _this.setState({ - currentStyles: newCurrentStyles, - currentVelocities: newCurrentVelocities, - lastIdealStyles: newLastIdealStyles, - lastIdealVelocities: newLastIdealVelocities, - mergedPropsStyles: newMergedPropsStyles - }); - - _this.unreadPropStyles = null; - - _this.startAnimationIfNecessary(); - }); - }; - - this.state = this.defaultState(); - } - - TransitionMotion.prototype.defaultState = function defaultState() { - var _props = this.props; - var defaultStyles = _props.defaultStyles; - var styles = _props.styles; - var willEnter = _props.willEnter; - var willLeave = _props.willLeave; - var didLeave = _props.didLeave; - - var destStyles = typeof styles === 'function' ? styles(defaultStyles) : styles; - - // this is special. for the first time around, we don't have a comparison - // between last (no last) and current merged props. we'll compute last so: - // say default is {a, b} and styles (dest style) is {b, c}, we'll - // fabricate last as {a, b} - var oldMergedPropsStyles = undefined; - if (defaultStyles == null) { - oldMergedPropsStyles = destStyles; - } else { - oldMergedPropsStyles = defaultStyles.map(function (defaultStyleCell) { - // TODO: key search code - for (var i = 0; i < destStyles.length; i++) { - if (destStyles[i].key === defaultStyleCell.key) { - return destStyles[i]; - } - } - return defaultStyleCell; - }); - } - var oldCurrentStyles = defaultStyles == null ? destStyles.map(function (s) { - return _stripStyle2['default'](s.style); - }) : defaultStyles.map(function (s) { - return _stripStyle2['default'](s.style); - }); - var oldCurrentVelocities = defaultStyles == null ? destStyles.map(function (s) { - return _mapToZero2['default'](s.style); - }) : defaultStyles.map(function (s) { - return _mapToZero2['default'](s.style); - }); - - var _mergeAndSync3 = mergeAndSync( - // Because this is an old-style createReactClass component, Flow doesn't - // understand that the willEnter and willLeave props have default values - // and will always be present. - willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldCurrentStyles, // oldLastIdealStyles really - oldCurrentVelocities); - - var mergedPropsStyles = _mergeAndSync3[0]; - var currentStyles = _mergeAndSync3[1]; - var currentVelocities = _mergeAndSync3[2]; - var lastIdealStyles = _mergeAndSync3[3]; - var lastIdealVelocities = _mergeAndSync3[4]; - // oldLastIdealVelocities really - - return { - currentStyles: currentStyles, - currentVelocities: currentVelocities, - lastIdealStyles: lastIdealStyles, - lastIdealVelocities: lastIdealVelocities, - mergedPropsStyles: mergedPropsStyles - }; - }; - - // after checking for unreadPropStyles != null, we manually go set the - // non-interpolating values (those that are a number, without a spring - // config) - - TransitionMotion.prototype.componentDidMount = function componentDidMount() { - this.prevTime = _performanceNow2['default'](); - this.startAnimationIfNecessary(); - }; - - TransitionMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) { - if (this.unreadPropStyles) { - // previous props haven't had the chance to be set yet; set them here - this.clearUnreadPropStyle(this.unreadPropStyles); - } - - var styles = props.styles; - if (typeof styles === 'function') { - this.unreadPropStyles = styles(rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.lastIdealStyles)); - } else { - this.unreadPropStyles = styles; - } - - if (this.animationID == null) { - this.prevTime = _performanceNow2['default'](); - this.startAnimationIfNecessary(); - } - }; - - TransitionMotion.prototype.componentWillUnmount = function componentWillUnmount() { - this.unmounting = true; - if (this.animationID != null) { - _raf2['default'].cancel(this.animationID); - this.animationID = null; - } - }; - - TransitionMotion.prototype.render = function render() { - var hydratedStyles = rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.currentStyles); - var renderedChildren = this.props.children(hydratedStyles); - return renderedChildren && _react2['default'].Children.only(renderedChildren); - }; - - return TransitionMotion; -})(_react2['default'].Component); - -exports['default'] = TransitionMotion; -module.exports = exports['default']; - -// list of styles, each containing interpolating values. Part of what's passed -// to children function. Notice that this is -// Array<ActualInterpolatingStyleObject>, without the wrapper that is {key: ..., -// data: ... style: ActualInterpolatingStyleObject}. Only mergedPropsStyles -// contains the key & data info (so that we only have a single source of truth -// for these, and to save space). Check the comment for `rehydrateStyles` to -// see how we regenerate the entirety of what's passed to children function - -// the array that keeps track of currently rendered stuff! Including stuff -// that you've unmounted but that's still animating. This is where it lives - -// it's possible that currentStyle's value is stale: if props is immediately -// changed from 0 to 400 to spring(0) again, the async currentStyle is still -// at 0 (didn't have time to tick and interpolate even once). If we naively -// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop). -// In reality currentStyle should be 400 - -/***/ }), -/* 894 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -// core keys merging algorithm. If previous render's keys are [a, b], and the -// next render's [c, b, d], what's the final merged keys and ordering? - -// - c and a must both be before b -// - b before d -// - ordering between a and c ambiguous - -// this reduces to merging two partially ordered lists (e.g. lists where not -// every item has a definite ordering, like comparing a and c above). For the -// ambiguous ordering we deterministically choose to place the next render's -// item after the previous'; so c after a - -// this is called a topological sorting. Except the existing algorithms don't -// work well with js bc of the amount of allocation, and isn't optimized for our -// current use-case bc the runtime is linear in terms of edges (see wiki for -// meaning), which is huge when two lists have many common elements - - -exports.__esModule = true; -exports['default'] = mergeDiff; - -function mergeDiff(prev, next, onRemove) { - // bookkeeping for easier access of a key's index below. This is 2 allocations + - // potentially triggering chrome hash map mode for objs (so it might be faster - - var prevKeyIndex = {}; - for (var i = 0; i < prev.length; i++) { - prevKeyIndex[prev[i].key] = i; - } - var nextKeyIndex = {}; - for (var i = 0; i < next.length; i++) { - nextKeyIndex[next[i].key] = i; - } - - // first, an overly elaborate way of merging prev and next, eliminating - // duplicates (in terms of keys). If there's dupe, keep the item in next). - // This way of writing it saves allocations - var ret = []; - for (var i = 0; i < next.length; i++) { - ret[i] = next[i]; - } - for (var i = 0; i < prev.length; i++) { - if (!Object.prototype.hasOwnProperty.call(nextKeyIndex, prev[i].key)) { - // this is called my TM's `mergeAndSync`, which calls willLeave. We don't - // merge in keys that the user desires to kill - var fill = onRemove(i, prev[i]); - if (fill != null) { - ret.push(fill); - } - } - } - - // now all the items all present. Core sorting logic to have the right order - return ret.sort(function (a, b) { - var nextOrderA = nextKeyIndex[a.key]; - var nextOrderB = nextKeyIndex[b.key]; - var prevOrderA = prevKeyIndex[a.key]; - var prevOrderB = prevKeyIndex[b.key]; - - if (nextOrderA != null && nextOrderB != null) { - // both keys in next - return nextKeyIndex[a.key] - nextKeyIndex[b.key]; - } else if (prevOrderA != null && prevOrderB != null) { - // both keys in prev - return prevKeyIndex[a.key] - prevKeyIndex[b.key]; - } else if (nextOrderA != null) { - // key a in next, key b in prev - - // how to determine the order between a and b? We find a "pivot" (term - // abuse), a key present in both prev and next, that is sandwiched between - // a and b. In the context of our above example, if we're comparing a and - // d, b's (the only) pivot - for (var i = 0; i < next.length; i++) { - var pivot = next[i].key; - if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) { - continue; - } - - if (nextOrderA < nextKeyIndex[pivot] && prevOrderB > prevKeyIndex[pivot]) { - return -1; - } else if (nextOrderA > nextKeyIndex[pivot] && prevOrderB < prevKeyIndex[pivot]) { - return 1; - } - } - // pluggable. default to: next bigger than prev - return 1; - } - // prevOrderA, nextOrderB - for (var i = 0; i < next.length; i++) { - var pivot = next[i].key; - if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) { - continue; - } - if (nextOrderB < nextKeyIndex[pivot] && prevOrderA > prevKeyIndex[pivot]) { - return 1; - } else if (nextOrderB > nextKeyIndex[pivot] && prevOrderA < prevKeyIndex[pivot]) { - return -1; - } - } - // pluggable. default to: next bigger than prev - return -1; - }); -} - -module.exports = exports['default']; -// to loop through and find a key's index each time), but I no longer care - -/***/ }), -/* 895 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - -exports['default'] = spring; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _presets = __webpack_require__(569); - -var _presets2 = _interopRequireDefault(_presets); - -var defaultConfig = _extends({}, _presets2['default'].noWobble, { - precision: 0.01 -}); - -function spring(val, config) { - return _extends({}, defaultConfig, config, { val: val }); -} - -module.exports = exports['default']; - -/***/ }), -/* 896 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports['default'] = reorderKeys; - -var hasWarned = false; - -function reorderKeys() { - if (true) { - if (!hasWarned) { - hasWarned = true; - console.error('`reorderKeys` has been removed, since it is no longer needed for TransitionMotion\'s new styles array API.'); - } - } -} - -module.exports = exports['default']; - -/***/ }), -/* 897 */ -/***/ (function(module, exports, __webpack_require__) { - -// style-loader: Adds some css to the DOM by adding a <style> tag - -// load the styles -var content = __webpack_require__(508); -if(typeof content === 'string') content = [[module.i, content, '']]; -// Prepare cssTransformation -var transform; - -var options = {} -options.transform = transform -// add the styles to the DOM -var update = __webpack_require__(899)(content, options); -if(content.locals) module.exports = content.locals; -// Hot Module Replacement -if(true) { - // When the styles change, update the <style> tags - if(!content.locals) { - module.hot.accept(508, function() { - var newContent = __webpack_require__(508); - if(typeof newContent === 'string') newContent = [[module.i, newContent, '']]; - update(newContent); - }); - } - // When the module is disposed, remove the <style> tags - module.hot.dispose(function() { update(); }); -} - -/***/ }), -/* 898 */ -/***/ (function(module, exports) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function(useSourceMap) { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - return this.map(function (item) { - var content = cssWithMappingToString(item, useSourceMap); - if(item[2]) { - return "@media " + item[2] + "{" + content + "}"; - } else { - return content; - } - }).join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; -}; - -function cssWithMappingToString(item, useSourceMap) { - var content = item[1] || ''; - var cssMapping = item[3]; - if (!cssMapping) { - return content; - } - - if (useSourceMap && typeof btoa === 'function') { - var sourceMapping = toComment(cssMapping); - var sourceURLs = cssMapping.sources.map(function (source) { - return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' - }); - - return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); - } - - return [content].join('\n'); -} - -// Adapted from convert-source-map (MIT) -function toComment(sourceMap) { - // eslint-disable-next-line no-undef - var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); - var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - - return '/*# ' + data + ' */'; -} - - -/***/ }), -/* 899 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -var stylesInDom = {}, - memoize = function(fn) { - var memo; - return function () { - if (typeof memo === "undefined") memo = fn.apply(this, arguments); - return memo; - }; - }, - isOldIE = memoize(function() { - // Test for IE <= 9 as proposed by Browserhacks - // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 - // Tests for existence of standard globals is to allow style-loader - // to operate correctly into non-standard environments - // @see https://github.com/webpack-contrib/style-loader/issues/177 - return window && document && document.all && !window.atob; - }), - getElement = (function(fn) { - var memo = {}; - return function(selector) { - if (typeof memo[selector] === "undefined") { - memo[selector] = fn.call(this, selector); - } - return memo[selector] - }; - })(function (styleTarget) { - return document.querySelector(styleTarget) - }), - singletonElement = null, - singletonCounter = 0, - styleElementsInsertedAtTop = [], - fixUrls = __webpack_require__(900); - -module.exports = function(list, options) { - if(typeof DEBUG !== "undefined" && DEBUG) { - if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); - } - - options = options || {}; - options.attrs = typeof options.attrs === "object" ? options.attrs : {}; - - // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> - // tags it will allow on a page - if (typeof options.singleton === "undefined") options.singleton = isOldIE(); - - // By default, add <style> tags to the <head> element - if (typeof options.insertInto === "undefined") options.insertInto = "head"; - - // By default, add <style> tags to the bottom of the target - if (typeof options.insertAt === "undefined") options.insertAt = "bottom"; - - var styles = listToStyles(list, options); - addStylesToDom(styles, options); - - return function update(newList) { - var mayRemove = []; - for(var i = 0; i < styles.length; i++) { - var item = styles[i]; - var domStyle = stylesInDom[item.id]; - domStyle.refs--; - mayRemove.push(domStyle); - } - if(newList) { - var newStyles = listToStyles(newList, options); - addStylesToDom(newStyles, options); - } - for(var i = 0; i < mayRemove.length; i++) { - var domStyle = mayRemove[i]; - if(domStyle.refs === 0) { - for(var j = 0; j < domStyle.parts.length; j++) - domStyle.parts[j](); - delete stylesInDom[domStyle.id]; - } - } - }; -}; - -function addStylesToDom(styles, options) { - for(var i = 0; i < styles.length; i++) { - var item = styles[i]; - var domStyle = stylesInDom[item.id]; - if(domStyle) { - domStyle.refs++; - for(var j = 0; j < domStyle.parts.length; j++) { - domStyle.parts[j](item.parts[j]); - } - for(; j < item.parts.length; j++) { - domStyle.parts.push(addStyle(item.parts[j], options)); - } - } else { - var parts = []; - for(var j = 0; j < item.parts.length; j++) { - parts.push(addStyle(item.parts[j], options)); - } - stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; - } - } -} - -function listToStyles(list, options) { - var styles = []; - var newStyles = {}; - for(var i = 0; i < list.length; i++) { - var item = list[i]; - var id = options.base ? item[0] + options.base : item[0]; - var css = item[1]; - var media = item[2]; - var sourceMap = item[3]; - var part = {css: css, media: media, sourceMap: sourceMap}; - if(!newStyles[id]) - styles.push(newStyles[id] = {id: id, parts: [part]}); - else - newStyles[id].parts.push(part); - } - return styles; -} - -function insertStyleElement(options, styleElement) { - var styleTarget = getElement(options.insertInto) - if (!styleTarget) { - throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid."); - } - var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1]; - if (options.insertAt === "top") { - if(!lastStyleElementInsertedAtTop) { - styleTarget.insertBefore(styleElement, styleTarget.firstChild); - } else if(lastStyleElementInsertedAtTop.nextSibling) { - styleTarget.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling); - } else { - styleTarget.appendChild(styleElement); - } - styleElementsInsertedAtTop.push(styleElement); - } else if (options.insertAt === "bottom") { - styleTarget.appendChild(styleElement); - } else { - throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'."); - } -} - -function removeStyleElement(styleElement) { - styleElement.parentNode.removeChild(styleElement); - var idx = styleElementsInsertedAtTop.indexOf(styleElement); - if(idx >= 0) { - styleElementsInsertedAtTop.splice(idx, 1); - } -} - -function createStyleElement(options) { - var styleElement = document.createElement("style"); - options.attrs.type = "text/css"; - - attachTagAttrs(styleElement, options.attrs); - insertStyleElement(options, styleElement); - return styleElement; -} - -function createLinkElement(options) { - var linkElement = document.createElement("link"); - options.attrs.type = "text/css"; - options.attrs.rel = "stylesheet"; - - attachTagAttrs(linkElement, options.attrs); - insertStyleElement(options, linkElement); - return linkElement; -} - -function attachTagAttrs(element, attrs) { - Object.keys(attrs).forEach(function (key) { - element.setAttribute(key, attrs[key]); - }); -} - -function addStyle(obj, options) { - var styleElement, update, remove, transformResult; - - // If a transform function was defined, run it on the css - if (options.transform && obj.css) { - transformResult = options.transform(obj.css); - - if (transformResult) { - // If transform returns a value, use that instead of the original css. - // This allows running runtime transformations on the css. - obj.css = transformResult; - } else { - // If the transform function returns a falsy value, don't add this css. - // This allows conditional loading of css - return function() { - // noop - }; - } - } - - if (options.singleton) { - var styleIndex = singletonCounter++; - styleElement = singletonElement || (singletonElement = createStyleElement(options)); - update = applyToSingletonTag.bind(null, styleElement, styleIndex, false); - remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true); - } else if(obj.sourceMap && - typeof URL === "function" && - typeof URL.createObjectURL === "function" && - typeof URL.revokeObjectURL === "function" && - typeof Blob === "function" && - typeof btoa === "function") { - styleElement = createLinkElement(options); - update = updateLink.bind(null, styleElement, options); - remove = function() { - removeStyleElement(styleElement); - if(styleElement.href) - URL.revokeObjectURL(styleElement.href); - }; - } else { - styleElement = createStyleElement(options); - update = applyToTag.bind(null, styleElement); - remove = function() { - removeStyleElement(styleElement); - }; - } - - update(obj); - - return function updateStyle(newObj) { - if(newObj) { - if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) - return; - update(obj = newObj); - } else { - remove(); - } - }; -} - -var replaceText = (function () { - var textStore = []; - - return function (index, replacement) { - textStore[index] = replacement; - return textStore.filter(Boolean).join('\n'); - }; -})(); - -function applyToSingletonTag(styleElement, index, remove, obj) { - var css = remove ? "" : obj.css; - - if (styleElement.styleSheet) { - styleElement.styleSheet.cssText = replaceText(index, css); - } else { - var cssNode = document.createTextNode(css); - var childNodes = styleElement.childNodes; - if (childNodes[index]) styleElement.removeChild(childNodes[index]); - if (childNodes.length) { - styleElement.insertBefore(cssNode, childNodes[index]); - } else { - styleElement.appendChild(cssNode); - } - } -} - -function applyToTag(styleElement, obj) { - var css = obj.css; - var media = obj.media; - - if(media) { - styleElement.setAttribute("media", media) - } - - if(styleElement.styleSheet) { - styleElement.styleSheet.cssText = css; - } else { - while(styleElement.firstChild) { - styleElement.removeChild(styleElement.firstChild); - } - styleElement.appendChild(document.createTextNode(css)); - } -} - -function updateLink(linkElement, options, obj) { - var css = obj.css; - var sourceMap = obj.sourceMap; - - /* If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled - and there is no publicPath defined then lets turn convertToAbsoluteUrls - on by default. Otherwise default to the convertToAbsoluteUrls option - directly - */ - var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap; - - if (options.convertToAbsoluteUrls || autoFixUrls){ - css = fixUrls(css); - } - - if(sourceMap) { - // http://stackoverflow.com/a/26603875 - css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; - } - - var blob = new Blob([css], { type: "text/css" }); - - var oldSrc = linkElement.href; - - linkElement.href = URL.createObjectURL(blob); - - if(oldSrc) - URL.revokeObjectURL(oldSrc); -} - - -/***/ }), -/* 900 */ -/***/ (function(module, exports) { - - -/** - * When source maps are enabled, `style-loader` uses a link element with a data-uri to - * embed the css on the page. This breaks all relative urls because now they are relative to a - * bundle instead of the current page. - * - * One solution is to only use full urls, but that may be impossible. - * - * Instead, this function "fixes" the relative urls to be absolute according to the current page location. - * - * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command. - * - */ - -module.exports = function (css) { - // get current location - var location = typeof window !== "undefined" && window.location; - - if (!location) { - throw new Error("fixUrls requires window.location"); - } - - // blank or null? - if (!css || typeof css !== "string") { - return css; - } - - var baseUrl = location.protocol + "//" + location.host; - var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/"); - - // convert each url(...) - /* - This regular expression is just a way to recursively match brackets within - a string. - - /url\s*\( = Match on the word "url" with any whitespace after it and then a parens - ( = Start a capturing group - (?: = Start a non-capturing group - [^)(] = Match anything that isn't a parentheses - | = OR - \( = Match a start parentheses - (?: = Start another non-capturing groups - [^)(]+ = Match anything that isn't a parentheses - | = OR - \( = Match a start parentheses - [^)(]* = Match anything that isn't a parentheses - \) = Match a end parentheses - ) = End Group - *\) = Match anything and then a close parens - ) = Close non-capturing group - * = Match anything - ) = Close capturing group - \) = Match a close parens - - /gi = Get all matches, not the first. Be case insensitive. - */ - var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) { - // strip quotes (if they exist) - var unquotedOrigUrl = origUrl - .trim() - .replace(/^"(.*)"$/, function(o, $1){ return $1; }) - .replace(/^'(.*)'$/, function(o, $1){ return $1; }); - - // already a full url? no change - if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) { - return fullMatch; - } - - // convert the url to a full url - var newUrl; - - if (unquotedOrigUrl.indexOf("//") === 0) { - //TODO: should we add protocol? - newUrl = unquotedOrigUrl; - } else if (unquotedOrigUrl.indexOf("/") === 0) { - // path should be relative to the base url - newUrl = baseUrl + unquotedOrigUrl; // already starts with '/' - } else { - // path should be relative to current directory - newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './' - } - - // send back the fixed url(...) - return "url(" + JSON.stringify(newUrl) + ")"; - }); - - // send back the fixed css - return fixedCss; -}; - - -/***/ }) -/******/ ]); -//# sourceMappingURL=preview.bundle.js.map \ No newline at end of file diff --git a/fixtures/storybook-dynamic/vendors~main.cf4424013badd87a0545.bundle.js b/fixtures/storybook-dynamic/vendors~main.cf4424013badd87a0545.bundle.js new file mode 100644 index 00000000..de7cabbd --- /dev/null +++ b/fixtures/storybook-dynamic/vendors~main.cf4424013badd87a0545.bundle.js @@ -0,0 +1,80407 @@ +(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["vendors~main"],{ + +/***/ "../../node_modules/@storybook/addon-actions/dist/constants.js": +/*!***********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/constants.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.CYCLIC_KEY = exports.EVENT_ID = exports.PANEL_ID = exports.ADDON_ID = exports.PARAM_KEY = void 0; +var PARAM_KEY = 'actions'; +exports.PARAM_KEY = PARAM_KEY; +var ADDON_ID = 'storybook/actions'; +exports.ADDON_ID = ADDON_ID; +var PANEL_ID = "".concat(ADDON_ID, "/panel"); +exports.PANEL_ID = PANEL_ID; +var EVENT_ID = "".concat(ADDON_ID, "/action-event"); +exports.EVENT_ID = EVENT_ID; +var CYCLIC_KEY = '$___storybook.isCyclic'; +exports.CYCLIC_KEY = CYCLIC_KEY; + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/index.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/index.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _constants = __webpack_require__(/*! ./constants */ "../../node_modules/@storybook/addon-actions/dist/constants.js"); + +Object.keys(_constants).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _constants[key]; + } + }); +}); + +var _models = __webpack_require__(/*! ./models */ "../../node_modules/@storybook/addon-actions/dist/models/index.js"); + +Object.keys(_models).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _models[key]; + } + }); +}); + +var _preview = __webpack_require__(/*! ./preview */ "../../node_modules/@storybook/addon-actions/dist/preview/index.js"); + +Object.keys(_preview).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _preview[key]; + } + }); +}); + +if (module && module.hot && module.hot.decline) { + module.hot.decline(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../examples/react/node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/models/ActionDisplay.js": +/*!**********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/models/ActionDisplay.js ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/models/ActionOptions.js": +/*!**********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/models/ActionOptions.js ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/models/ActionsFunction.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/models/ActionsFunction.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/models/ActionsMap.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/models/ActionsMap.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/models/DecoratorFunction.js": +/*!**************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/models/DecoratorFunction.js ***! + \**************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/models/HandlerFunction.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/models/HandlerFunction.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/models/index.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/models/index.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _ActionDisplay = __webpack_require__(/*! ./ActionDisplay */ "../../node_modules/@storybook/addon-actions/dist/models/ActionDisplay.js"); + +Object.keys(_ActionDisplay).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _ActionDisplay[key]; + } + }); +}); + +var _ActionsFunction = __webpack_require__(/*! ./ActionsFunction */ "../../node_modules/@storybook/addon-actions/dist/models/ActionsFunction.js"); + +Object.keys(_ActionsFunction).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _ActionsFunction[key]; + } + }); +}); + +var _ActionOptions = __webpack_require__(/*! ./ActionOptions */ "../../node_modules/@storybook/addon-actions/dist/models/ActionOptions.js"); + +Object.keys(_ActionOptions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _ActionOptions[key]; + } + }); +}); + +var _ActionsMap = __webpack_require__(/*! ./ActionsMap */ "../../node_modules/@storybook/addon-actions/dist/models/ActionsMap.js"); + +Object.keys(_ActionsMap).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _ActionsMap[key]; + } + }); +}); + +var _DecoratorFunction = __webpack_require__(/*! ./DecoratorFunction */ "../../node_modules/@storybook/addon-actions/dist/models/DecoratorFunction.js"); + +Object.keys(_DecoratorFunction).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _DecoratorFunction[key]; + } + }); +}); + +var _HandlerFunction = __webpack_require__(/*! ./HandlerFunction */ "../../node_modules/@storybook/addon-actions/dist/models/HandlerFunction.js"); + +Object.keys(_HandlerFunction).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _HandlerFunction[key]; + } + }); +}); + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/preview/action.js": +/*!****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/preview/action.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.action = action; + +var _v = _interopRequireDefault(__webpack_require__(/*! uuid/v4 */ "../../node_modules/uuid/v4.js")); + +var _addons = __webpack_require__(/*! @storybook/addons */ "../../node_modules/@storybook/addons/dist/public_api.js"); + +var _constants = __webpack_require__(/*! ../constants */ "../../node_modules/@storybook/addon-actions/dist/constants.js"); + +var _configureActions = __webpack_require__(/*! ./configureActions */ "../../node_modules/@storybook/addon-actions/dist/preview/configureActions.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function action(name) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var actionOptions = Object.assign({}, _configureActions.config, {}, options); + + var handler = function actionHandler() { + var channel = _addons.addons.getChannel(); + + var id = (0, _v["default"])(); + var minDepth = 5; // anything less is really just storybook internals + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var actionDisplayToEmit = { + id: id, + count: 0, + data: { + name: name, + args: args + }, + options: Object.assign({}, actionOptions, { + depth: minDepth + (actionOptions.depth || 3), + allowFunction: actionOptions.allowFunction || false + }) + }; + channel.emit(_constants.EVENT_ID, actionDisplayToEmit); + }; + + return handler; +} + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/preview/actions.js": +/*!*****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/preview/actions.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.actions = void 0; + +var _action = __webpack_require__(/*! ./action */ "../../node_modules/@storybook/addon-actions/dist/preview/action.js"); + +var _configureActions = __webpack_require__(/*! ./configureActions */ "../../node_modules/@storybook/addon-actions/dist/preview/configureActions.js"); + +var actions = function actions() { + var options = _configureActions.config; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var names = args; // last argument can be options + + if (names.length !== 1 && typeof args[args.length - 1] !== 'string') { + options = Object.assign({}, _configureActions.config, {}, names.pop()); + } + + var namesObject = names[0]; + + if (names.length !== 1 || typeof namesObject === 'string') { + namesObject = {}; + names.forEach(function (name) { + namesObject[name] = name; + }); + } + + var actionsObject = {}; + Object.keys(namesObject).forEach(function (name) { + actionsObject[name] = (0, _action.action)(namesObject[name], options); + }); + return actionsObject; +}; + +exports.actions = actions; + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/preview/configureActions.js": +/*!**************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/preview/configureActions.js ***! + \**************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.configureActions = exports.config = void 0; +var config = { + depth: 10, + clearOnStoryChange: true, + limit: 50 +}; +exports.config = config; + +var configureActions = function configureActions() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + Object.assign(config, options); +}; + +exports.configureActions = configureActions; + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/preview/decorateAction.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/preview/decorateAction.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.from */ "../../node_modules/core-js/modules/es.array.from.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.reduce */ "../../node_modules/core-js/modules/es.array.reduce.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.decorate = exports.decorateAction = void 0; + +var _action = __webpack_require__(/*! ./action */ "../../node_modules/@storybook/addon-actions/dist/preview/action.js"); + +var _actions = __webpack_require__(/*! ./actions */ "../../node_modules/@storybook/addon-actions/dist/preview/actions.js"); + +var _withActions = __webpack_require__(/*! ./withActions */ "../../node_modules/@storybook/addon-actions/dist/preview/withActions.js"); + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +var applyDecorators = function applyDecorators(decorators, actionCallback) { + return function () { + for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) { + _args[_key] = arguments[_key]; + } + + var decorated = decorators.reduce(function (args, storyFn) { + return storyFn(args); + }, _args); + actionCallback.apply(void 0, _toConsumableArray(decorated)); + }; +}; + +var decorateAction = function decorateAction(decorators) { + return function (name, options) { + var callAction = (0, _action.action)(name, options); + return applyDecorators(decorators, callAction); + }; +}; + +exports.decorateAction = decorateAction; + +var decorate = function decorate(decorators) { + var decorated = decorateAction(decorators); + + var decoratedActions = function decoratedActions() { + var rawActions = _actions.actions.apply(void 0, arguments); + + var actionsObject = {}; + Object.keys(rawActions).forEach(function (name) { + actionsObject[name] = applyDecorators(decorators, rawActions[name]); + }); + return actionsObject; + }; + + return { + action: decorated, + actions: decoratedActions, + withActions: (0, _withActions.createDecorator)(decoratedActions) + }; +}; + +exports.decorate = decorate; + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/preview/index.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/preview/index.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _action = __webpack_require__(/*! ./action */ "../../node_modules/@storybook/addon-actions/dist/preview/action.js"); + +Object.keys(_action).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _action[key]; + } + }); +}); + +var _actions = __webpack_require__(/*! ./actions */ "../../node_modules/@storybook/addon-actions/dist/preview/actions.js"); + +Object.keys(_actions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _actions[key]; + } + }); +}); + +var _configureActions = __webpack_require__(/*! ./configureActions */ "../../node_modules/@storybook/addon-actions/dist/preview/configureActions.js"); + +Object.keys(_configureActions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _configureActions[key]; + } + }); +}); + +var _decorateAction = __webpack_require__(/*! ./decorateAction */ "../../node_modules/@storybook/addon-actions/dist/preview/decorateAction.js"); + +Object.keys(_decorateAction).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _decorateAction[key]; + } + }); +}); + +var _withActions = __webpack_require__(/*! ./withActions */ "../../node_modules/@storybook/addon-actions/dist/preview/withActions.js"); + +Object.keys(_withActions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _withActions[key]; + } + }); +}); + +/***/ }), + +/***/ "../../node_modules/@storybook/addon-actions/dist/preview/withActions.js": +/*!*********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addon-actions/dist/preview/withActions.js ***! + \*********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.map */ "../../node_modules/core-js/modules/es.array.map.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.object.entries */ "../../node_modules/core-js/modules/es.object.entries.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.string.match */ "../../node_modules/core-js/modules/es.string.match.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.withActions = exports.createDecorator = void 0; + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _clientApi = __webpack_require__(/*! @storybook/client-api */ "../../node_modules/@storybook/client-api/dist/index.js"); + +var _actions = __webpack_require__(/*! ./actions */ "../../node_modules/@storybook/addon-actions/dist/preview/actions.js"); + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +var delegateEventSplitter = /^(\S+)\s*(.*)$/; +var isIE = _global.Element != null && !_global.Element.prototype.matches; +var matchesMethod = isIE ? 'msMatchesSelector' : 'matches'; + +var root = _global.document && _global.document.getElementById('root'); + +var hasMatchInAncestry = function hasMatchInAncestry(element, selector) { + if (element[matchesMethod](selector)) { + return true; + } + + var parent = element.parentElement; + + if (!parent) { + return false; + } + + return hasMatchInAncestry(parent, selector); +}; + +var createHandlers = function createHandlers(actionsFn) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var actionsObject = actionsFn.apply(void 0, args); + return Object.entries(actionsObject).map(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + action = _ref2[1]; + + var _key$match = key.match(delegateEventSplitter), + _key$match2 = _slicedToArray(_key$match, 3), + _ = _key$match2[0], + eventName = _key$match2[1], + selector = _key$match2[2]; + + return { + eventName: eventName, + handler: function handler(e) { + if (!selector || hasMatchInAncestry(e.target, selector)) { + action(e); + } + } + }; + }); +}; + +var createDecorator = function createDecorator(actionsFn) { + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return function (storyFn) { + (0, _clientApi.useEffect)(function () { + if (root != null) { + var handlers = createHandlers.apply(void 0, [actionsFn].concat(args)); + handlers.forEach(function (_ref3) { + var eventName = _ref3.eventName, + handler = _ref3.handler; + return root.addEventListener(eventName, handler); + }); + return function () { + return handlers.forEach(function (_ref4) { + var eventName = _ref4.eventName, + handler = _ref4.handler; + return root.removeEventListener(eventName, handler); + }); + }; + } + + return undefined; + }, [root, actionsFn, args]); + return storyFn(); + }; + }; +}; + +exports.createDecorator = createDecorator; +var withActions = createDecorator(_actions.actions); +exports.withActions = withActions; + +/***/ }), + +/***/ "../../node_modules/@storybook/addons/dist/hooks.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addons/dist/hooks.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.every */ "../../node_modules/core-js/modules/es.array.every.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.from */ "../../node_modules/core-js/modules/es.array.from.js"); + +__webpack_require__(/*! core-js/modules/es.array.includes */ "../../node_modules/core-js/modules/es.array.includes.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.map */ "../../node_modules/core-js/modules/es.array.map.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.function.bind */ "../../node_modules/core-js/modules/es.function.bind.js"); + +__webpack_require__(/*! core-js/modules/es.function.name */ "../../node_modules/core-js/modules/es.function.name.js"); + +__webpack_require__(/*! core-js/modules/es.object.define-property */ "../../node_modules/core-js/modules/es.object.define-property.js"); + +__webpack_require__(/*! core-js/modules/es.object.entries */ "../../node_modules/core-js/modules/es.object.entries.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.set */ "../../node_modules/core-js/modules/es.set.js"); + +__webpack_require__(/*! core-js/modules/es.string.includes */ "../../node_modules/core-js/modules/es.string.includes.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.weak-map */ "../../node_modules/core-js/modules/es.weak-map.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.useMemo = useMemo; +exports.useCallback = useCallback; +exports.useRef = useRef; +exports.useState = useState; +exports.useReducer = useReducer; +exports.useEffect = useEffect; +exports.useChannel = useChannel; +exports.useStoryContext = useStoryContext; +exports.useParameter = useParameter; +exports.applyHooks = exports.HooksContext = void 0; + +var _global = _interopRequireDefault(__webpack_require__(/*! global */ "../../node_modules/global/window.js")); + +var _clientLogger = __webpack_require__(/*! @storybook/client-logger */ "../../node_modules/@storybook/client-logger/dist/index.js"); + +var _coreEvents = __webpack_require__(/*! @storybook/core-events */ "../../node_modules/@storybook/core-events/dist/index.js"); + +var _index = __webpack_require__(/*! ./index */ "../../node_modules/@storybook/addons/dist/index.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var RenderEvents = [_coreEvents.STORY_RENDERED, _coreEvents.DOCS_RENDERED]; + +var HooksContext = +/*#__PURE__*/ +function () { + function HooksContext() { + var _this = this; + + _classCallCheck(this, HooksContext); + + this.hookListsMap = void 0; + this.mountedDecorators = void 0; + this.prevMountedDecorators = void 0; + this.currentHooks = void 0; + this.nextHookIndex = void 0; + this.currentPhase = void 0; + this.currentEffects = void 0; + this.prevEffects = void 0; + this.currentDecoratorName = void 0; + this.hasUpdates = void 0; + this.currentContext = void 0; + + this.renderListener = function () { + _this.triggerEffects(); + + _this.currentContext = null; + + _this.removeRenderListeners(); + }; + + this.init(); + } + + _createClass(HooksContext, [{ + key: "init", + value: function init() { + this.hookListsMap = new WeakMap(); + this.mountedDecorators = new Set(); + this.prevMountedDecorators = this.mountedDecorators; + this.currentHooks = []; + this.nextHookIndex = 0; + this.currentPhase = 'NONE'; + this.currentEffects = []; + this.prevEffects = []; + this.currentDecoratorName = null; + this.hasUpdates = false; + this.currentContext = null; + } + }, { + key: "clean", + value: function clean() { + this.prevEffects.forEach(function (effect) { + if (effect.destroy) { + effect.destroy(); + } + }); + this.init(); + this.removeRenderListeners(); + } + }, { + key: "getNextHook", + value: function getNextHook() { + var hook = this.currentHooks[this.nextHookIndex]; + this.nextHookIndex += 1; + return hook; + } + }, { + key: "triggerEffects", + value: function triggerEffects() { + var _this2 = this; + + // destroy removed effects + this.prevEffects.forEach(function (effect) { + if (!_this2.currentEffects.includes(effect) && effect.destroy) { + effect.destroy(); + } + }); // trigger added effects + + this.currentEffects.forEach(function (effect) { + if (!_this2.prevEffects.includes(effect)) { + // eslint-disable-next-line no-param-reassign + effect.destroy = effect.create(); + } + }); + this.prevEffects = this.currentEffects; + this.currentEffects = []; + } + }, { + key: "addRenderListeners", + value: function addRenderListeners() { + var _this3 = this; + + this.removeRenderListeners(); + + var channel = _index.addons.getChannel(); + + RenderEvents.forEach(function (e) { + return channel.on(e, _this3.renderListener); + }); + } + }, { + key: "removeRenderListeners", + value: function removeRenderListeners() { + var _this4 = this; + + var channel = _index.addons.getChannel(); + + RenderEvents.forEach(function (e) { + return channel.removeListener(e, _this4.renderListener); + }); + } + }]); + + return HooksContext; +}(); + +exports.HooksContext = HooksContext; + +var hookify = function hookify(fn) { + return function () { + var _ref = typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'function' ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 0 ? undefined : arguments[0], + hooks = _ref.hooks; + + var prevPhase = hooks.currentPhase; + var prevHooks = hooks.currentHooks; + var prevNextHookIndex = hooks.nextHookIndex; + var prevDecoratorName = hooks.currentDecoratorName; + hooks.currentDecoratorName = fn.name; + + if (hooks.prevMountedDecorators.has(fn)) { + hooks.currentPhase = 'UPDATE'; + hooks.currentHooks = hooks.hookListsMap.get(fn) || []; + } else { + hooks.currentPhase = 'MOUNT'; + hooks.currentHooks = []; + hooks.hookListsMap.set(fn, hooks.currentHooks); + hooks.prevMountedDecorators.add(fn); + } + + hooks.nextHookIndex = 0; + var prevContext = _global["default"].STORYBOOK_HOOKS_CONTEXT; + _global["default"].STORYBOOK_HOOKS_CONTEXT = hooks; + var result = fn.apply(void 0, arguments); + _global["default"].STORYBOOK_HOOKS_CONTEXT = prevContext; + + if (hooks.currentPhase === 'UPDATE' && hooks.getNextHook() != null) { + throw new Error('Rendered fewer hooks than expected. This may be caused by an accidental early return statement.'); + } + + hooks.currentPhase = prevPhase; + hooks.currentHooks = prevHooks; + hooks.nextHookIndex = prevNextHookIndex; + hooks.currentDecoratorName = prevDecoratorName; + return result; + }; +}; // Counter to prevent infinite loops. + + +var numberOfRenders = 0; +var RENDER_LIMIT = 25; + +var applyHooks = function applyHooks(applyDecorators) { + return function (getStory, decorators) { + var decorated = applyDecorators(hookify(getStory), decorators.map(hookify)); + return function (context) { + var hooks = context.hooks; + hooks.prevMountedDecorators = hooks.mountedDecorators; + hooks.mountedDecorators = new Set([getStory].concat(_toConsumableArray(decorators))); + hooks.currentContext = context; + hooks.hasUpdates = false; + var result = decorated(context); + numberOfRenders = 1; + + while (hooks.hasUpdates) { + hooks.hasUpdates = false; + hooks.currentEffects = []; + result = decorated(context); + numberOfRenders += 1; + + if (numberOfRenders > RENDER_LIMIT) { + throw new Error('Too many re-renders. Storybook limits the number of renders to prevent an infinite loop.'); + } + } + + hooks.addRenderListeners(); + return result; + }; + }; +}; + +exports.applyHooks = applyHooks; + +var areDepsEqual = function areDepsEqual(deps, nextDeps) { + return deps.length === nextDeps.length && deps.every(function (dep, i) { + return dep === nextDeps[i]; + }); +}; + +var invalidHooksError = function invalidHooksError() { + return new Error('Storybook preview hooks can only be called inside decorators and story functions.'); +}; + +function getHooksContextOrNull() { + return _global["default"].STORYBOOK_HOOKS_CONTEXT || null; +} + +function getHooksContextOrThrow() { + var hooks = getHooksContextOrNull(); + + if (hooks == null) { + throw invalidHooksError(); + } + + return hooks; +} + +function useHook(name, callback, deps) { + var hooks = getHooksContextOrThrow(); + + if (hooks.currentPhase === 'MOUNT') { + if (deps != null && !Array.isArray(deps)) { + _clientLogger.logger.warn("".concat(name, " received a final argument that is not an array (instead, received ").concat(deps, "). When specified, the final argument must be an array.")); + } + + var _hook = { + name: name, + deps: deps + }; + hooks.currentHooks.push(_hook); + callback(_hook); + return _hook; + } + + if (hooks.currentPhase === 'UPDATE') { + var _hook2 = hooks.getNextHook(); + + if (_hook2 == null) { + throw new Error('Rendered more hooks than during the previous render.'); + } + + if (_hook2.name !== name) { + _clientLogger.logger.warn("Storybook has detected a change in the order of Hooks".concat(hooks.currentDecoratorName ? " called by ".concat(hooks.currentDecoratorName) : '', ". This will lead to bugs and errors if not fixed.")); + } + + if (deps != null && _hook2.deps == null) { + _clientLogger.logger.warn("".concat(name, " received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.")); + } + + if (deps != null && _hook2.deps != null && deps.length !== _hook2.deps.length) { + _clientLogger.logger.warn("The final argument passed to ".concat(name, " changed size between renders. The order and size of this array must remain constant.\nPrevious: ").concat(_hook2.deps, "\nIncoming: ").concat(deps)); + } + + if (deps == null || _hook2.deps == null || !areDepsEqual(deps, _hook2.deps)) { + callback(_hook2); + _hook2.deps = deps; + } + + return _hook2; + } + + throw invalidHooksError(); +} + +function useMemoLike(name, nextCreate, deps) { + var _useHook = useHook(name, function (hook) { + // eslint-disable-next-line no-param-reassign + hook.memoizedState = nextCreate(); + }, deps), + memoizedState = _useHook.memoizedState; + + return memoizedState; +} +/* Returns a memoized value, see https://reactjs.org/docs/hooks-reference.html#usememo */ + + +function useMemo(nextCreate, deps) { + return useMemoLike('useMemo', nextCreate, deps); +} +/* Returns a memoized callback, see https://reactjs.org/docs/hooks-reference.html#usecallback */ + + +function useCallback(callback, deps) { + return useMemoLike('useCallback', function () { + return callback; + }, deps); +} + +function useRefLike(name, initialValue) { + return useMemoLike(name, function () { + return { + current: initialValue + }; + }, []); +} +/* Returns a mutable ref object, see https://reactjs.org/docs/hooks-reference.html#useref */ + + +function useRef(initialValue) { + return useRefLike('useRef', initialValue); +} + +function triggerUpdate() { + var hooks = getHooksContextOrNull(); // Rerun getStory if updates were triggered synchronously, force rerender otherwise + + if (hooks != null && hooks.currentPhase !== 'NONE') { + hooks.hasUpdates = true; + } else { + try { + _index.addons.getChannel().emit(_coreEvents.FORCE_RE_RENDER); + } catch (e) { + _clientLogger.logger.warn('State updates of Storybook preview hooks work only in browser'); + } + } +} + +function useStateLike(name, initialState) { + var stateRef = useRefLike(name, // @ts-ignore S type should never be function, but there's no way to tell that to TypeScript + typeof initialState === 'function' ? initialState() : initialState); + + var setState = function setState(update) { + // @ts-ignore S type should never be function, but there's no way to tell that to TypeScript + stateRef.current = typeof update === 'function' ? update(stateRef.current) : update; + triggerUpdate(); + }; + + return [stateRef.current, setState]; +} +/* Returns a stateful value, and a function to update it, see https://reactjs.org/docs/hooks-reference.html#usestate */ + + +function useState(initialState) { + return useStateLike('useState', initialState); +} +/* A redux-like alternative to useState, see https://reactjs.org/docs/hooks-reference.html#usereducer */ + + +function useReducer(reducer, initialArg, init) { + var initialState = init != null ? function () { + return init(initialArg); + } : initialArg; + + var _useStateLike = useStateLike('useReducer', initialState), + _useStateLike2 = _slicedToArray(_useStateLike, 2), + state = _useStateLike2[0], + setState = _useStateLike2[1]; + + var dispatch = function dispatch(action) { + return setState(function (prevState) { + return reducer(prevState, action); + }); + }; + + return [state, dispatch]; +} +/* + Triggers a side effect, see https://reactjs.org/docs/hooks-reference.html#usestate + Effects are triggered synchronously after rendering the story +*/ + + +function useEffect(create, deps) { + var hooks = getHooksContextOrThrow(); + var effect = useMemoLike('useEffect', function () { + return { + create: create + }; + }, deps); + + if (!hooks.currentEffects.includes(effect)) { + hooks.currentEffects.push(effect); + } +} + +/* Accepts a map of Storybook channel event listeners, returns an emit function */ +function useChannel(eventMap) { + var deps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + var channel = _index.addons.getChannel(); + + useEffect(function () { + Object.entries(eventMap).forEach(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + type = _ref3[0], + listener = _ref3[1]; + + return channel.on(type, listener); + }); + return function () { + Object.entries(eventMap).forEach(function (_ref4) { + var _ref5 = _slicedToArray(_ref4, 2), + type = _ref5[0], + listener = _ref5[1]; + + return channel.removeListener(type, listener); + }); + }; + }, [].concat(_toConsumableArray(Object.keys(eventMap)), _toConsumableArray(deps))); + return channel.emit.bind(channel); +} +/* Returns current story context */ + + +function useStoryContext() { + var _getHooksContextOrThr = getHooksContextOrThrow(), + currentContext = _getHooksContextOrThr.currentContext; + + if (currentContext == null) { + throw invalidHooksError(); + } + + return currentContext; +} +/* Returns current value of a story parameter */ + + +function useParameter(parameterKey, defaultValue) { + var _useStoryContext = useStoryContext(), + parameters = _useStoryContext.parameters; + + if (parameterKey) { + return parameters[parameterKey] || defaultValue; + } + + return undefined; +} + +/***/ }), + +/***/ "../../node_modules/@storybook/addons/dist/index.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addons/dist/index.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.object.values */ "../../node_modules/core-js/modules/es.object.values.js"); + +__webpack_require__(/*! core-js/modules/es.promise */ "../../node_modules/core-js/modules/es.promise.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addons = exports.AddonStore = void 0; + +var _global = _interopRequireDefault(__webpack_require__(/*! global */ "../../node_modules/global/window.js")); + +var _clientLogger = __webpack_require__(/*! @storybook/client-logger */ "../../node_modules/@storybook/client-logger/dist/index.js"); + +var _types = __webpack_require__(/*! ./types */ "../../node_modules/@storybook/addons/dist/types.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var AddonStore = function AddonStore() { + var _this = this; + + _classCallCheck(this, AddonStore); + + this.loaders = {}; + this.elements = {}; + this.config = {}; + this.channel = void 0; + this.promise = void 0; + this.resolve = void 0; + + this.getChannel = function () { + // this.channel should get overwritten by setChannel. If it wasn't called (e.g. in non-browser environment), throw. + if (!_this.channel) { + throw new Error('Accessing non-existent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel'); + } + + return _this.channel; + }; + + this.ready = function () { + return _this.promise; + }; + + this.hasChannel = function () { + return !!_this.channel; + }; + + this.setChannel = function (channel) { + _this.channel = channel; + + _this.resolve(); + }; + + this.getElements = function (type) { + if (!_this.elements[type]) { + _this.elements[type] = {}; + } + + return _this.elements[type]; + }; + + this.addPanel = function (name, options) { + _this.add(name, Object.assign({ + type: _types.types.PANEL + }, options)); + }; + + this.add = function (name, addon) { + var type = addon.type; + + var collection = _this.getElements(type); + + collection[name] = Object.assign({ + id: name + }, addon); + }; + + this.setConfig = function (value) { + Object.assign(_this.config, value); + }; + + this.getConfig = function () { + return _this.config; + }; + + this.register = function (name, registerCallback) { + if (_this.loaders[name]) { + _clientLogger.logger.warn("".concat(name, " was loaded twice, this could have bad side-effects")); + } + + _this.loaders[name] = registerCallback; + }; + + this.loadAddons = function (api) { + Object.values(_this.loaders).forEach(function (value) { + return value(api); + }); + }; + + this.promise = new Promise(function (res) { + _this.resolve = function () { + return res(_this.getChannel()); + }; + }); +}; // Enforce addons store to be a singleton + + +exports.AddonStore = AddonStore; +var KEY = '__STORYBOOK_ADDONS'; + +function getAddonsStore() { + if (!_global["default"][KEY]) { + _global["default"][KEY] = new AddonStore(); + } + + return _global["default"][KEY]; +} // Exporting this twice in order to to be able to import it like { addons } instead of 'addons' +// prefer import { addons } from '@storybook/addons' over import addons from '@storybook/addons' +// +// See public_api.ts + + +var addons = getAddonsStore(); +exports.addons = addons; + +/***/ }), + +/***/ "../../node_modules/@storybook/addons/dist/make-decorator.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addons/dist/make-decorator.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.function.name */ "../../node_modules/core-js/modules/es.function.name.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.makeDecorator = void 0; + +var _utilDeprecate = _interopRequireDefault(__webpack_require__(/*! util-deprecate */ "../../node_modules/util-deprecate/browser.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var makeDecorator = function makeDecorator(_ref) { + var name = _ref.name, + parameterName = _ref.parameterName, + wrapper = _ref.wrapper, + _ref$skipIfNoParamete = _ref.skipIfNoParametersOrOptions, + skipIfNoParametersOrOptions = _ref$skipIfNoParamete === void 0 ? false : _ref$skipIfNoParamete, + _ref$allowDeprecatedU = _ref.allowDeprecatedUsage, + allowDeprecatedUsage = _ref$allowDeprecatedU === void 0 ? false : _ref$allowDeprecatedU; + + var decorator = function decorator(options) { + return function (getStory, context) { + var parameters = context.parameters && context.parameters[parameterName]; + + if (parameters && parameters.disable) { + return getStory(context); + } + + if (skipIfNoParametersOrOptions && !options && !parameters) { + return getStory(context); + } + + return wrapper(getStory, context, { + options: options, + parameters: parameters + }); + }; + }; + + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + // Used without options as .addDecorator(decorator) + if (typeof args[0] === 'function') { + return decorator().apply(void 0, args); + } + + return function () { + for (var _len2 = arguments.length, innerArgs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + innerArgs[_key2] = arguments[_key2]; + } + + // Used as [.]addDecorator(decorator(options)) + if (innerArgs.length > 1) { + return decorator.apply(void 0, args).apply(void 0, innerArgs); + } + + if (allowDeprecatedUsage) { + // Used to wrap a story directly .add('story', decorator(options)(() => <Story />)) + // This is now deprecated: + return (0, _utilDeprecate["default"])(function (context) { + return decorator.apply(void 0, args)(innerArgs[0], context); + }, "Passing stories directly into ".concat(name, "() is deprecated,\n instead use addDecorator(").concat(name, ") and pass options with the '").concat(parameterName, "' parameter")); + } + + throw new Error("Passing stories directly into ".concat(name, "() is not allowed,\n instead use addDecorator(").concat(name, ") and pass options with the '").concat(parameterName, "' parameter")); + }; + }; +}; + +exports.makeDecorator = makeDecorator; + +/***/ }), + +/***/ "../../node_modules/@storybook/addons/dist/public_api.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addons/dist/public_api.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = {}; +exports["default"] = void 0; + +var _index = __webpack_require__(/*! ./index */ "../../node_modules/@storybook/addons/dist/index.js"); + +Object.keys(_index).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _index[key]; + } + }); +}); + +var _makeDecorator = __webpack_require__(/*! ./make-decorator */ "../../node_modules/@storybook/addons/dist/make-decorator.js"); + +Object.keys(_makeDecorator).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _makeDecorator[key]; + } + }); +}); + +var _types = __webpack_require__(/*! ./types */ "../../node_modules/@storybook/addons/dist/types.js"); + +Object.keys(_types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _types[key]; + } + }); +}); + +var _storybookChannelMock = __webpack_require__(/*! ./storybook-channel-mock */ "../../node_modules/@storybook/addons/dist/storybook-channel-mock.js"); + +Object.keys(_storybookChannelMock).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _storybookChannelMock[key]; + } + }); +}); + +var _hooks = __webpack_require__(/*! ./hooks */ "../../node_modules/@storybook/addons/dist/hooks.js"); + +Object.keys(_hooks).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _hooks[key]; + } + }); +}); +// There can only be 1 default export per entry point and it has to be directly from public_api +// Exporting this twice in order to to be able to import it like { addons } instead of 'addons' +// prefer import { addons } from '@storybook/addons' over import addons from '@storybook/addons' +// +// See index.ts +var _default = _index.addons; +exports["default"] = _default; + +/***/ }), + +/***/ "../../node_modules/@storybook/addons/dist/storybook-channel-mock.js": +/*!*****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addons/dist/storybook-channel-mock.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.mockChannel = mockChannel; + +var _channels = _interopRequireDefault(__webpack_require__(/*! @storybook/channels */ "../../node_modules/@storybook/channels/dist/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function mockChannel() { + var transport = { + setHandler: function setHandler() {}, + send: function send() {} + }; + return new _channels["default"]({ + transport: transport + }); +} + +/***/ }), + +/***/ "../../node_modules/@storybook/addons/dist/types.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/addons/dist/types.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.array.find */ "../../node_modules/core-js/modules/es.array.find.js"); + +__webpack_require__(/*! core-js/modules/es.object.values */ "../../node_modules/core-js/modules/es.object.values.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isSupportedType = isSupportedType; +exports.types = void 0; +var types; +exports.types = types; + +(function (types) { + types["TAB"] = "tab"; + types["PANEL"] = "panel"; + types["TOOL"] = "tool"; + types["PREVIEW"] = "preview"; + types["NOTES_ELEMENT"] = "notes-element"; +})(types || (exports.types = types = {})); + +function isSupportedType(type) { + return !!Object.values(types).find(function (typeVal) { + return typeVal === type; + }); +} + +/***/ }), + +/***/ "../../node_modules/@storybook/channel-postmessage/dist/index.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/channel-postmessage/dist/index.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.from */ "../../node_modules/core-js/modules/es.array.from.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.function.bind */ "../../node_modules/core-js/modules/es.function.bind.js"); + +__webpack_require__(/*! core-js/modules/es.number.constructor */ "../../node_modules/core-js/modules/es.number.constructor.js"); + +__webpack_require__(/*! core-js/modules/es.number.is-integer */ "../../node_modules/core-js/modules/es.number.is-integer.js"); + +__webpack_require__(/*! core-js/modules/es.object.define-property */ "../../node_modules/core-js/modules/es.object.define-property.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.promise */ "../../node_modules/core-js/modules/es.promise.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = createChannel; +exports.PostmsgTransport = exports.KEY = void 0; + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _channels = _interopRequireDefault(__webpack_require__(/*! @storybook/channels */ "../../node_modules/@storybook/channels/dist/index.js")); + +var _clientLogger = __webpack_require__(/*! @storybook/client-logger */ "../../node_modules/@storybook/client-logger/dist/index.js"); + +var _telejson = __webpack_require__(/*! telejson */ "../../node_modules/telejson/dist/index.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var KEY = 'storybook-channel'; // TODO: we should export a method for opening child windows here and keep track of em. +// that way we can send postMessage to child windows as well, not just iframe +// https://stackoverflow.com/questions/6340160/how-to-get-the-references-of-all-already-opened-child-windows + +exports.KEY = KEY; + +var PostmsgTransport = +/*#__PURE__*/ +function () { + function PostmsgTransport(config) { + _classCallCheck(this, PostmsgTransport); + + this.config = config; + this.buffer = void 0; + this.handler = void 0; + this.connected = void 0; + this.buffer = []; + this.handler = null; + + _global.window.addEventListener('message', this.handleEvent.bind(this), false); // Check whether the config.page parameter has a valid value + + + if (config.page !== 'manager' && config.page !== 'preview') { + throw new Error("postmsg-channel: \"config.page\" cannot be \"".concat(config.page, "\"")); + } + } + + _createClass(PostmsgTransport, [{ + key: "setHandler", + value: function setHandler(handler) { + var _this = this; + + this.handler = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + handler.apply(_this, args); + + if (!_this.connected && _this.getWindow()) { + _this.flush(); + + _this.connected = true; + } + }; + } + /** + * Sends `event` to the associated window. If the window does not yet exist + * the event will be stored in a buffer and sent when the window exists. + * @param event + */ + + }, { + key: "send", + value: function send(event, options) { + var _this2 = this; + + var iframeWindow = this.getWindow(); + + if (!iframeWindow) { + return new Promise(function (resolve, reject) { + _this2.buffer.push({ + event: event, + resolve: resolve, + reject: reject + }); + }); + } + + var depth = 15; + var allowFunction = true; + + if (options && typeof options.allowFunction === 'boolean') { + allowFunction = options.allowFunction; + } + + if (options && Number.isInteger(options.depth)) { + depth = options.depth; + } + + var data = (0, _telejson.stringify)({ + key: KEY, + event: event + }, { + maxDepth: depth, + allowFunction: allowFunction + }); // TODO: investigate http://blog.teamtreehouse.com/cross-domain-messaging-with-postmessage + // might replace '*' with document.location ? + + iframeWindow.postMessage(data, '*'); + return Promise.resolve(null); + } + }, { + key: "flush", + value: function flush() { + var _this3 = this; + + var buffer = this.buffer; + this.buffer = []; + buffer.forEach(function (item) { + _this3.send(item.event).then(item.resolve)["catch"](item.reject); + }); + } + }, { + key: "getWindow", + value: function getWindow() { + if (this.config.page === 'manager') { + // FIXME this is a really bad idea! use a better way to do this. + // This finds the storybook preview iframe to send messages to. + var iframe = _global.document.getElementById('storybook-preview-iframe'); + + if (!iframe) { + return null; + } + + return iframe.contentWindow; + } + + return _global.window.parent; + } + }, { + key: "handleEvent", + value: function handleEvent(rawEvent) { + try { + var data = rawEvent.data; + + var _ref = typeof data === 'string' && (0, _telejson.isJSON)(data) ? (0, _telejson.parse)(data) : data, + key = _ref.key, + event = _ref.event; + + if (key === KEY) { + _clientLogger.logger.debug.apply(_clientLogger.logger, ["message arrived at ".concat(this.config.page), event.type].concat(_toConsumableArray(event.args))); + + this.handler(event); + } + } catch (error) { + _clientLogger.logger.error(error); // debugger; + + } + } + }]); + + return PostmsgTransport; +}(); +/** + * Creates a channel which communicates with an iframe or child window. + */ + + +exports.PostmsgTransport = PostmsgTransport; + +function createChannel(_ref2) { + var page = _ref2.page; + var transport = new PostmsgTransport({ + page: page + }); + return new _channels["default"]({ + transport: transport + }); +} + +/***/ }), + +/***/ "../../node_modules/@storybook/channels/dist/index.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/channels/dist/index.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(setImmediate) { + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.filter */ "../../node_modules/core-js/modules/es.array.filter.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.from */ "../../node_modules/core-js/modules/es.array.from.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.slice */ "../../node_modules/core-js/modules/es.array.slice.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.object.define-property */ "../../node_modules/core-js/modules/es.object.define-property.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.immediate */ "../../node_modules/core-js/modules/web.immediate.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = exports.Channel = void 0; + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var generateRandomId = function generateRandomId() { + // generates a random 13 character string + return Math.random().toString(16).slice(2); +}; + +var Channel = +/*#__PURE__*/ +function () { + function Channel() { + var _this = this; + + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + transport = _ref.transport, + _ref$async = _ref.async, + async = _ref$async === void 0 ? false : _ref$async; + + _classCallCheck(this, Channel); + + this.isAsync = void 0; + this.sender = generateRandomId(); + this.events = {}; + this.transport = void 0; + this.isAsync = async; + + if (transport) { + this.transport = transport; + this.transport.setHandler(function (event) { + return _this.handleEvent(event); + }); + } + } + + _createClass(Channel, [{ + key: "addListener", + value: function addListener(eventName, listener) { + this.events[eventName] = this.events[eventName] || []; + this.events[eventName].push(listener); + } + }, { + key: "addPeerListener", + value: function addPeerListener(eventName, listener) { + var peerListener = listener; + peerListener.ignorePeer = true; + this.addListener(eventName, peerListener); + } + }, { + key: "emit", + value: function emit(eventName) { + var _this2 = this; + + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var event = { + type: eventName, + args: args, + from: this.sender + }; + var options = {}; + + if (args.length >= 1 && args[0] && args[0].options) { + options = args[0].options; + } + + var handler = function handler() { + if (_this2.transport) { + _this2.transport.send(event, options); + } + + _this2.handleEvent(event, true); + }; + + if (this.isAsync) { + // todo I'm not sure how to test this + setImmediate(handler); + } else { + handler(); + } + } + }, { + key: "eventNames", + value: function eventNames() { + return Object.keys(this.events); + } + }, { + key: "listenerCount", + value: function listenerCount(eventName) { + var listeners = this.listeners(eventName); + return listeners ? listeners.length : 0; + } + }, { + key: "listeners", + value: function listeners(eventName) { + var listeners = this.events[eventName]; + return listeners || undefined; + } + }, { + key: "once", + value: function once(eventName, listener) { + var onceListener = this.onceListener(eventName, listener); + this.addListener(eventName, onceListener); + } + }, { + key: "removeAllListeners", + value: function removeAllListeners(eventName) { + if (!eventName) { + this.events = {}; + } else if (this.events[eventName]) { + delete this.events[eventName]; + } + } + }, { + key: "removeListener", + value: function removeListener(eventName, listener) { + var listeners = this.listeners(eventName); + + if (listeners) { + this.events[eventName] = listeners.filter(function (l) { + return l !== listener; + }); + } + } + }, { + key: "on", + value: function on(eventName, listener) { + this.addListener(eventName, listener); + } + }, { + key: "off", + value: function off(eventName, listener) { + this.removeListener(eventName, listener); + } + }, { + key: "handleEvent", + value: function handleEvent(event) { + var isPeer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var listeners = this.listeners(event.type); + + if (listeners && (isPeer || event.from !== this.sender)) { + listeners.forEach(function (fn) { + return !(isPeer && fn.ignorePeer) && fn.apply(void 0, _toConsumableArray(event.args)); + }); + } + } + }, { + key: "onceListener", + value: function onceListener(eventName, listener) { + var _this3 = this; + + var onceListener = function onceListener() { + _this3.removeListener(eventName, onceListener); + + return listener.apply(void 0, arguments); + }; + + return onceListener; + } + }, { + key: "hasTransport", + get: function get() { + return !!this.transport; + } + }]); + + return Channel; +}(); + +exports.Channel = Channel; +var _default = Channel; +exports["default"] = _default; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../timers-browserify/main.js */ "../../node_modules/timers-browserify/main.js").setImmediate)) + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/dist/client_api.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/dist/client_api.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.find */ "../../node_modules/core-js/modules/es.array.find.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.from */ "../../node_modules/core-js/modules/es.array.from.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.map */ "../../node_modules/core-js/modules/es.array.map.js"); + +__webpack_require__(/*! core-js/modules/es.array.reduce */ "../../node_modules/core-js/modules/es.array.reduce.js"); + +__webpack_require__(/*! core-js/modules/es.array.some */ "../../node_modules/core-js/modules/es.array.some.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.entries */ "../../node_modules/core-js/modules/es.object.entries.js"); + +__webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "../../node_modules/core-js/modules/es.object.get-prototype-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.string.match */ "../../node_modules/core-js/modules/es.string.match.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = exports.addParameters = exports.addDecorator = exports.defaultDecorateStory = void 0; + +var _utilDeprecate = _interopRequireDefault(__webpack_require__(/*! util-deprecate */ "../../node_modules/util-deprecate/browser.js")); + +var _isPlainObject = _interopRequireDefault(__webpack_require__(/*! is-plain-object */ "../../node_modules/@storybook/client-api/node_modules/is-plain-object/index.js")); + +var _clientLogger = __webpack_require__(/*! @storybook/client-logger */ "../../node_modules/@storybook/client-logger/dist/index.js"); + +var _addons = _interopRequireDefault(__webpack_require__(/*! @storybook/addons */ "../../node_modules/@storybook/addons/dist/public_api.js")); + +var _coreEvents = _interopRequireDefault(__webpack_require__(/*! @storybook/core-events */ "../../node_modules/@storybook/core-events/dist/index.js")); + +var _csf = __webpack_require__(/*! @storybook/csf */ "../../node_modules/@storybook/csf/dist/index.js"); + +var _mergeWith = _interopRequireDefault(__webpack_require__(/*! lodash/mergeWith */ "../../node_modules/lodash/mergeWith.js")); + +var _isEqual = _interopRequireDefault(__webpack_require__(/*! lodash/isEqual */ "../../node_modules/lodash/isEqual.js")); + +var _get = _interopRequireDefault(__webpack_require__(/*! lodash/get */ "../../node_modules/lodash/get.js")); + +var _subscriptions_store = _interopRequireDefault(__webpack_require__(/*! ./subscriptions_store */ "../../node_modules/@storybook/client-api/dist/subscriptions_store.js")); + +var _hooks = __webpack_require__(/*! ./hooks */ "../../node_modules/@storybook/client-api/dist/hooks.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// merge with concatenating arrays, but no duplicates +var merge = function merge(a, b) { + return (0, _mergeWith["default"])({}, a, b, function (objValue, srcValue) { + if (Array.isArray(srcValue) && Array.isArray(objValue)) { + srcValue.forEach(function (s) { + var existing = objValue.find(function (o) { + return o === s || (0, _isEqual["default"])(o, s); + }); + + if (!existing) { + objValue.push(s); + } + }); + return objValue; + } + + if (Array.isArray(objValue)) { + _clientLogger.logger.log('the types mismatch, picking', objValue); + + return objValue; + } + + return undefined; + }); +}; + +var defaultContext = { + id: 'unspecified', + name: 'unspecified', + kind: 'unspecified', + parameters: {} +}; + +var defaultDecorateStory = function defaultDecorateStory(storyFn, decorators) { + return decorators.reduce(function (decorated, decorator) { + return function () { + var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultContext; + return decorator(function (p) { + return decorated(p ? Object.assign({}, context, {}, p, { + parameters: Object.assign({}, context.parameters, {}, p.parameters) + }) : context); + }, context); + }; + }, storyFn); +}; + +exports.defaultDecorateStory = defaultDecorateStory; +var metaSubscriptionHandler = (0, _utilDeprecate["default"])(_subscriptions_store["default"].register, 'Events.REGISTER_SUBSCRIPTION is deprecated and will be removed in 6.0. Please use useEffect from @storybook/client-api instead.'); + +var metaSubscription = function metaSubscription() { + _addons["default"].getChannel().on(_coreEvents["default"].REGISTER_SUBSCRIPTION, metaSubscriptionHandler); + + return function () { + return _addons["default"].getChannel().removeListener(_coreEvents["default"].REGISTER_SUBSCRIPTION, metaSubscriptionHandler); + }; +}; + +var withSubscriptionTracking = function withSubscriptionTracking(storyFn) { + if (!_addons["default"].hasChannel()) { + return storyFn(); + } + + _subscriptions_store["default"].markAllAsUnused(); + + _subscriptions_store["default"].register(metaSubscription); + + var result = storyFn(); + + _subscriptions_store["default"].clearUnused(); + + return result; +}; + +var _globalDecorators = []; +var _globalParameters = {}; + +var addDecorator = function addDecorator(decoratorFn) { + _globalDecorators.push(decoratorFn); +}; + +exports.addDecorator = addDecorator; + +var addParameters = function addParameters(parameters) { + _globalParameters = Object.assign({}, _globalParameters, {}, parameters, { + options: Object.assign({}, merge((0, _get["default"])(_globalParameters, 'options', {}), (0, _get["default"])(parameters, 'options', {}))), + // FIXME: https://github.com/storybookjs/storybook/issues/7872 + docs: Object.assign({}, merge((0, _get["default"])(_globalParameters, 'docs', {}), (0, _get["default"])(parameters, 'docs', {}))) + }); +}; + +exports.addParameters = addParameters; + +var ClientApi = function ClientApi(_ref) { + var _this = this; + + var storyStore = _ref.storyStore, + _ref$decorateStory = _ref.decorateStory, + decorateStory = _ref$decorateStory === void 0 ? defaultDecorateStory : _ref$decorateStory; + + _classCallCheck(this, ClientApi); + + this._storyStore = void 0; + this._addons = void 0; + this._decorateStory = void 0; + + this.setAddon = function (addon) { + _this._addons = Object.assign({}, _this._addons, {}, addon); + }; + + this.getSeparators = function () { + var _ref2 = _globalParameters.options || {}, + hierarchySeparator = _ref2.hierarchySeparator, + hierarchyRootSeparator = _ref2.hierarchyRootSeparator, + showRoots = _ref2.showRoots; // Note these checks will be removed in 6.0, leaving this much simpler + + + if (typeof hierarchySeparator !== 'undefined' || typeof hierarchyRootSeparator !== 'undefined') { + return { + hierarchySeparator: hierarchySeparator, + hierarchyRootSeparator: hierarchyRootSeparator + }; + } + + if (typeof showRoots === 'undefined' && _this.store().getStoryKinds().some(function (kind) { + return kind.match(/\.|\|/); + })) { + return { + hierarchyRootSeparator: '|', + hierarchySeparator: /\/|\./ + }; + } + + return { + hierarchySeparator: '/' + }; + }; + + this.addDecorator = function (decorator) { + addDecorator(decorator); + }; + + this.addParameters = function (parameters) { + addParameters(parameters); + }; + + this.clearDecorators = function () { + _globalDecorators = []; + }; + + this.clearParameters = function () { + // Utility function FOR TESTING USE ONLY + _globalParameters = {}; + }; + + this.storiesOf = function (kind, m) { + if (!kind && typeof kind !== 'string') { + throw new Error('Invalid or missing kind provided for stories, should be a string'); + } + + if (!m) { + _clientLogger.logger.warn("Missing 'module' parameter for story with a kind of '".concat(kind, "'. It will break your HMR")); + } + + if (m) { + var proto = Object.getPrototypeOf(m); + + if (proto.exports && proto.exports["default"]) { + // FIXME: throw an error in SB6.0 + _clientLogger.logger.error("Illegal mix of CSF default export and storiesOf calls in a single file: ".concat(proto.i)); + } + } + + if (m && m.hot && m.hot.dispose) { + m.hot.dispose(function () { + var _storyStore = _this._storyStore; + + _storyStore.removeStoryKind(kind); + + _storyStore.incrementRevision(); + }); + } + + var localDecorators = []; + var localParameters = {}; + var hasAdded = false; + var api = { + kind: kind.toString(), + add: function add() { + return api; + }, + addDecorator: function addDecorator() { + return api; + }, + addParameters: function addParameters() { + return api; + } + }; // apply addons + + Object.keys(_this._addons).forEach(function (name) { + var addon = _this._addons[name]; + + api[name] = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + addon.apply(api, args); + return api; + }; + }); + + api.add = function (storyName, storyFn) { + var parameters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + hasAdded = true; + var id = parameters.__id || (0, _csf.toId)(kind, storyName); + + if (typeof storyName !== 'string') { + throw new Error("Invalid or missing storyName provided for a \"".concat(kind, "\" story.")); + } + + if (m && m.hot && m.hot.dispose) { + m.hot.dispose(function () { + var _storyStore = _this._storyStore; + + _storyStore.remove(id); + }); + } + + var fileName = m && m.id ? "".concat(m.id) : undefined; + var allParam = [_globalParameters, localParameters, parameters].reduce(function (acc, p) { + if (p) { + Object.entries(p).forEach(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + key = _ref4[0], + value = _ref4[1]; + + var existingValue = acc[key]; + + if (Array.isArray(value)) { + acc[key] = value; + } else if ((0, _isPlainObject["default"])(value) && (0, _isPlainObject["default"])(existingValue)) { + acc[key] = merge(existingValue, value); + } else { + acc[key] = value; + } + }); + } + + return acc; + }, { + fileName: fileName + }); + + _this._storyStore.addStory({ + id: id, + kind: kind, + name: storyName, + storyFn: storyFn, + parameters: allParam + }, { + applyDecorators: (0, _hooks.applyHooks)(_this._decorateStory), + getDecorators: function getDecorators() { + return [].concat(_toConsumableArray(allParam.decorators || []), localDecorators, _toConsumableArray(_globalDecorators), [withSubscriptionTracking]); + } + }); + + return api; + }; + + api.addDecorator = function (decorator) { + if (hasAdded) { + _clientLogger.logger.warn("You have added a decorator to the kind '".concat(kind, "' after a story has already been added.\nIn Storybook 4 this applied the decorator only to subsequent stories. In Storybook 5+ it applies to all stories.\nThis is probably not what you intended. Read more here: https://github.com/storybookjs/storybook/blob/master/MIGRATION.md")); + } + + localDecorators.push(decorator); + return api; + }; + + api.addParameters = function (parameters) { + localParameters = Object.assign({}, localParameters, {}, parameters); + return api; + }; + + return api; + }; + + this.getStorybook = function () { + return _this._storyStore.getStoryKinds().map(function (kind) { + var fileName = _this._storyStore.getStoryFileName(kind); + + var stories = _this._storyStore.getStories(kind).map(function (name) { + var render = _this._storyStore.getStoryWithContext(kind, name); + + return { + name: name, + render: render + }; + }); + + return { + kind: kind, + fileName: fileName, + stories: stories + }; + }); + }; + + this.raw = function () { + return _this._storyStore.raw(); + }; + + this.store = function () { + return _this._storyStore; + }; + + this._storyStore = storyStore; + this._addons = {}; + this._decorateStory = decorateStory; + + if (!storyStore) { + throw new Error('storyStore is required'); + } +}; + +exports["default"] = ClientApi; + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/dist/config_api.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/dist/config_api.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.object.define-property */ "../../node_modules/core-js/modules/es.object.define-property.js"); + +__webpack_require__(/*! core-js/modules/web.timers */ "../../node_modules/core-js/modules/web.timers.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _coreEvents = _interopRequireDefault(__webpack_require__(/*! @storybook/core-events */ "../../node_modules/@storybook/core-events/dist/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var ConfigApi = +/*#__PURE__*/ +function () { + function ConfigApi(_ref) { + var _this = this; + + var channel = _ref.channel, + storyStore = _ref.storyStore, + clientApi = _ref.clientApi, + clearDecorators = _ref.clearDecorators; + + _classCallCheck(this, ConfigApi); + + this._channel = void 0; + this._storyStore = void 0; + this._clearDecorators = void 0; + this.clientApi = void 0; + + this.configure = function (loaders, module) { + var render = function render() { + var errors = []; + + try { + if (loaders) { + loaders(); + } + } catch (e) { + errors.push(e); + } + + if (!errors.length) { + try { + _this._renderMain(); + } catch (e) { + errors.push(e); + } + } + + if (errors.length) { + _this._storyStore.setSelection(undefined, errors[0]); + + throw errors[0]; + } else { + _this._storyStore.setSelection(undefined, null); + } + }; + + if (module.hot) { + module.hot.accept(); // @ts-ignore + + if (!module._StorybookPreserveDecorators) { + module.hot.dispose(function () { + _this._clearDecorators(); + }); + } + } + + if (_this._channel) { + // in Browser + render(); // Send a signal to the manager that configure() is done. We do this in a timeout + // because the story_store sends stories in a debounced function, which results in + // as setTimeout. We want to ensure this happens after, to avoid a FOUC. + + setTimeout(function () { + return _this._channel.emit(_coreEvents["default"].STORIES_CONFIGURED); + }, 0); + } else { + // in NodeJS + loaders(); + } + }; + + // channel can be null when running in node + // always check whether channel is available + this._channel = channel; + this._storyStore = storyStore; + this._clearDecorators = clearDecorators; + this.clientApi = clientApi; + } + + _createClass(ConfigApi, [{ + key: "_renderMain", + value: function _renderMain() { + // do initial render of story + this._storyStore.emit(_coreEvents["default"].STORY_INIT); + } + }, { + key: "_renderError", + value: function _renderError(err) { + var stack = err.stack, + message = err.message; + var error = { + stack: stack, + message: message + }; + + this._storyStore.setSelection(undefined, error); + } + }]); + + return ConfigApi; +}(); + +exports["default"] = ConfigApi; + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/dist/hooks.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/dist/hooks.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "HooksContext", { + enumerable: true, + get: function get() { + return _addons.HooksContext; + } +}); +Object.defineProperty(exports, "applyHooks", { + enumerable: true, + get: function get() { + return _addons.applyHooks; + } +}); +Object.defineProperty(exports, "useMemo", { + enumerable: true, + get: function get() { + return _addons.useMemo; + } +}); +Object.defineProperty(exports, "useCallback", { + enumerable: true, + get: function get() { + return _addons.useCallback; + } +}); +Object.defineProperty(exports, "useRef", { + enumerable: true, + get: function get() { + return _addons.useRef; + } +}); +Object.defineProperty(exports, "useState", { + enumerable: true, + get: function get() { + return _addons.useState; + } +}); +Object.defineProperty(exports, "useReducer", { + enumerable: true, + get: function get() { + return _addons.useReducer; + } +}); +Object.defineProperty(exports, "useEffect", { + enumerable: true, + get: function get() { + return _addons.useEffect; + } +}); +Object.defineProperty(exports, "useChannel", { + enumerable: true, + get: function get() { + return _addons.useChannel; + } +}); +Object.defineProperty(exports, "useStoryContext", { + enumerable: true, + get: function get() { + return _addons.useStoryContext; + } +}); +Object.defineProperty(exports, "useParameter", { + enumerable: true, + get: function get() { + return _addons.useParameter; + } +}); + +var _addons = __webpack_require__(/*! @storybook/addons */ "../../node_modules/@storybook/addons/dist/public_api.js"); + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/dist/index.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/dist/index.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var _exportNames = { + ClientApi: true, + defaultDecorateStory: true, + addDecorator: true, + addParameters: true, + StoryStore: true, + ConfigApi: true, + subscriptionsStore: true, + pathToId: true, + getQueryParams: true, + getQueryParam: true +}; +Object.defineProperty(exports, "ClientApi", { + enumerable: true, + get: function get() { + return _client_api["default"]; + } +}); +Object.defineProperty(exports, "defaultDecorateStory", { + enumerable: true, + get: function get() { + return _client_api.defaultDecorateStory; + } +}); +Object.defineProperty(exports, "addDecorator", { + enumerable: true, + get: function get() { + return _client_api.addDecorator; + } +}); +Object.defineProperty(exports, "addParameters", { + enumerable: true, + get: function get() { + return _client_api.addParameters; + } +}); +Object.defineProperty(exports, "StoryStore", { + enumerable: true, + get: function get() { + return _story_store["default"]; + } +}); +Object.defineProperty(exports, "ConfigApi", { + enumerable: true, + get: function get() { + return _config_api["default"]; + } +}); +Object.defineProperty(exports, "subscriptionsStore", { + enumerable: true, + get: function get() { + return _subscriptions_store["default"]; + } +}); +Object.defineProperty(exports, "pathToId", { + enumerable: true, + get: function get() { + return _pathToId["default"]; + } +}); +Object.defineProperty(exports, "getQueryParams", { + enumerable: true, + get: function get() { + return _queryparams.getQueryParams; + } +}); +Object.defineProperty(exports, "getQueryParam", { + enumerable: true, + get: function get() { + return _queryparams.getQueryParam; + } +}); + +var _client_api = _interopRequireWildcard(__webpack_require__(/*! ./client_api */ "../../node_modules/@storybook/client-api/dist/client_api.js")); + +var _story_store = _interopRequireDefault(__webpack_require__(/*! ./story_store */ "../../node_modules/@storybook/client-api/dist/story_store.js")); + +var _config_api = _interopRequireDefault(__webpack_require__(/*! ./config_api */ "../../node_modules/@storybook/client-api/dist/config_api.js")); + +var _subscriptions_store = _interopRequireDefault(__webpack_require__(/*! ./subscriptions_store */ "../../node_modules/@storybook/client-api/dist/subscriptions_store.js")); + +var _pathToId = _interopRequireDefault(__webpack_require__(/*! ./pathToId */ "../../node_modules/@storybook/client-api/dist/pathToId.js")); + +var _queryparams = __webpack_require__(/*! ./queryparams */ "../../node_modules/@storybook/client-api/dist/queryparams.js"); + +var _hooks = __webpack_require__(/*! ./hooks */ "../../node_modules/@storybook/client-api/dist/hooks.js"); + +Object.keys(_hooks).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _hooks[key]; + } + }); +}); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/dist/pathToId.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/dist/pathToId.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js"); + +__webpack_require__(/*! core-js/modules/es.string.match */ "../../node_modules/core-js/modules/es.string.match.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = pathToId; + +function pathToId(path) { + var match = (path || '').match(/^\/story\/(.+)/); + + if (!match) { + throw new Error("Invalid path '".concat(path, "', must start with '/story/'")); + } + + return match[1]; +} + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/dist/queryparams.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/dist/queryparams.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js"); + +__webpack_require__(/*! core-js/modules/es.string.search */ "../../node_modules/core-js/modules/es.string.search.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getQueryParam = exports.getQueryParams = void 0; + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "../../node_modules/qs/lib/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var getQueryParams = function getQueryParams() { + // document.location is not defined in react-native + if (_global.document && _global.document.location && _global.document.location.search) { + return _qs["default"].parse(_global.document.location.search, { + ignoreQueryPrefix: true + }); + } + + return {}; +}; + +exports.getQueryParams = getQueryParams; + +var getQueryParam = function getQueryParam(key) { + var params = getQueryParams(); + return params[key]; +}; + +exports.getQueryParam = getQueryParam; + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/dist/story_store.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/dist/story_store.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.filter */ "../../node_modules/core-js/modules/es.array.filter.js"); + +__webpack_require__(/*! core-js/modules/es.array.find */ "../../node_modules/core-js/modules/es.array.find.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.map */ "../../node_modules/core-js/modules/es.array.map.js"); + +__webpack_require__(/*! core-js/modules/es.array.reduce */ "../../node_modules/core-js/modules/es.array.reduce.js"); + +__webpack_require__(/*! core-js/modules/es.array.slice */ "../../node_modules/core-js/modules/es.array.slice.js"); + +__webpack_require__(/*! core-js/modules/es.array.sort */ "../../node_modules/core-js/modules/es.array.sort.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.function.name */ "../../node_modules/core-js/modules/es.function.name.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.create */ "../../node_modules/core-js/modules/es.object.create.js"); + +__webpack_require__(/*! core-js/modules/es.object.define-properties */ "../../node_modules/core-js/modules/es.object.define-properties.js"); + +__webpack_require__(/*! core-js/modules/es.object.define-property */ "../../node_modules/core-js/modules/es.object.define-property.js"); + +__webpack_require__(/*! core-js/modules/es.object.entries */ "../../node_modules/core-js/modules/es.object.entries.js"); + +__webpack_require__(/*! core-js/modules/es.object.freeze */ "../../node_modules/core-js/modules/es.object.freeze.js"); + +__webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "../../node_modules/core-js/modules/es.object.get-prototype-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.object.set-prototype-of */ "../../node_modules/core-js/modules/es.object.set-prototype-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.object.values */ "../../node_modules/core-js/modules/es.object.values.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.string.replace */ "../../node_modules/core-js/modules/es.string.replace.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.timers */ "../../node_modules/core-js/modules/web.timers.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _eventemitter = _interopRequireDefault(__webpack_require__(/*! eventemitter3 */ "../../node_modules/eventemitter3/index.js")); + +var _memoizerific = _interopRequireDefault(__webpack_require__(/*! memoizerific */ "../../node_modules/memoizerific/memoizerific.js")); + +var _debounce = _interopRequireDefault(__webpack_require__(/*! lodash/debounce */ "../../node_modules/lodash/debounce.js")); + +var _tsDedent = _interopRequireDefault(__webpack_require__(/*! ts-dedent */ "../../node_modules/ts-dedent/dist/index.js")); + +var _stable = _interopRequireDefault(__webpack_require__(/*! stable */ "../../node_modules/stable/stable.js")); + +var _coreEvents = _interopRequireDefault(__webpack_require__(/*! @storybook/core-events */ "../../node_modules/@storybook/core-events/dist/index.js")); + +var _clientLogger = __webpack_require__(/*! @storybook/client-logger */ "../../node_modules/@storybook/client-logger/dist/index.js"); + +var _hooks = __webpack_require__(/*! ./hooks */ "../../node_modules/@storybook/client-api/dist/hooks.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _templateObject() { + var data = _taggedTemplateLiteral(["\n Story with id ", " already exists in the store!\n\n Perhaps you added the same story twice, or you have a name collision?\n Story ids need to be unique -- ensure you aren't using the same names modulo url-sanitization.\n "]); + + _templateObject = function _templateObject() { + return data; + }; + + return data; +} + +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +// TODO: these are copies from components/nav/lib +// refactor to DRY +var toKey = function toKey(input) { + return input.replace(/[^a-z0-9]+([a-z0-9])/gi, function () { + for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) { + params[_key] = arguments[_key]; + } + + return params[1].toUpperCase(); + }); +}; + +var count = 0; + +var getId = function getId() { + count += 1; + return count; +}; + +var toExtracted = function toExtracted(obj) { + return Object.entries(obj).reduce(function (acc, _ref) { + var _ref2 = _slicedToArray(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + + if (typeof value === 'function') { + return acc; + } + + if (key === 'hooks') { + return acc; + } + + if (Array.isArray(value)) { + return Object.assign(acc, _defineProperty({}, key, value.slice().sort())); + } + + return Object.assign(acc, _defineProperty({}, key, value)); + }, {}); +}; + +var isStoryDocsOnly = function isStoryDocsOnly(parameters) { + return parameters && parameters.docsOnly; +}; + +var includeStory = function includeStory(story) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + includeDocsOnly: false + }; + + if (options.includeDocsOnly) { + return true; + } + + return !isStoryDocsOnly(story.parameters); +}; + +var StoryStore = +/*#__PURE__*/ +function (_EventEmitter) { + _inherits(StoryStore, _EventEmitter); + + function StoryStore(params) { + var _this; + + _classCallCheck(this, StoryStore); + + _this = _possibleConstructorReturn(this, _getPrototypeOf(StoryStore).call(this)); + _this._error = void 0; + _this._channel = void 0; + _this._data = void 0; + _this._legacyData = void 0; + _this._legacydata = void 0; + _this._revision = void 0; + _this._selection = void 0; + _this._kindOrder = void 0; + + _this.setChannel = function (channel) { + _this._channel = channel; + }; + + _this.fromId = function (id) { + try { + var data = _this._data[id]; + + if (!data || !data.getDecorated) { + return null; + } + + return data; + } catch (e) { + _clientLogger.logger.warn('failed to get story:', _this._data); + + _clientLogger.logger.error(e); + + return null; + } + }; + + _this.getSelection = function () { + return _this._selection; + }; + + _this.getError = function () { + return _this._error; + }; + + _this.remove = function (id) { + var _assertThisInitialize = _assertThisInitialized(_this), + _data = _assertThisInitialize._data; + + var story = _data[id]; + delete _data[id]; + + if (story) { + story.hooks.clean(); + var kind = story.kind, + name = story.name; + + var kindData = _this._legacydata[toKey(kind)]; + + if (kindData) { + delete kindData.stories[toKey(name)]; + } + } + }; + + _this.getStoriesForManager = function () { + return _this.extract({ + includeDocsOnly: true + }); + }; + + _this.pushToManager = (0, _debounce["default"])(function () { + if (_this._channel) { + var stories = _this.getStoriesForManager(); // send to the parent frame. + + + _this._channel.emit(_coreEvents["default"].SET_STORIES, { + stories: stories + }); + } + }, 0); + _this._legacydata = {}; + _this._data = {}; + _this._revision = 0; + _this._selection = {}; + _this._channel = params.channel; + _this._error = undefined; + _this._kindOrder = {}; + return _this; + } + + _createClass(StoryStore, [{ + key: "raw", + value: function raw(options) { + var _this2 = this; + + return Object.values(this._data).filter(function (i) { + return !!i.getDecorated; + }).filter(function (i) { + return includeStory(i, options); + }).map(function (_ref3) { + var id = _ref3.id; + return _this2.fromId(id); + }); + } + }, { + key: "extract", + value: function extract(options) { + var _this3 = this; + + var stories = Object.entries(this._data); // determine if we should apply a sort to the stories or use default import order + + if (Object.values(this._data).length > 0) { + var index = Object.keys(this._data).find(function (key) { + return !!(_this3._data[key] && _this3._data[key].parameters && _this3._data[key].parameters.options); + }); + + if (index && this._data[index].parameters.options.storySort) { + var sortFn = this._data[index].parameters.options.storySort; + + _stable["default"].inplace(stories, sortFn); + } else { + // NOTE: when kinds are HMR'ed they get temporarily removed from the `_data` array + // and thus lose order. However `_kindOrder` preservers the original load order + _stable["default"].inplace(stories, function (s1, s2) { + return _this3._kindOrder[s1[1].kind] - _this3._kindOrder[s2[1].kind]; + }); + } + } // removes function values from all stories so they are safe to transport over the channel + + + return stories.reduce(function (a, _ref4) { + var _ref5 = _slicedToArray(_ref4, 2), + k = _ref5[0], + v = _ref5[1]; + + return includeStory(v, options) ? Object.assign(a, _defineProperty({}, k, toExtracted(v))) : a; + }, {}); + } + }, { + key: "setSelection", + value: function setSelection(data, error) { + var _this4 = this; + + this._selection = data === undefined ? this._selection : { + storyId: data.storyId, + viewMode: data.viewMode + }; + this._error = error === undefined ? this._error : error; // Try and emit the STORY_RENDER event synchronously, but if the channel is not ready (RN), + // we'll try again later. + + var isStarted = false; + + if (this._channel) { + this._channel.emit(_coreEvents["default"].STORY_RENDER); + + isStarted = true; + } + + setTimeout(function () { + if (_this4._channel && !isStarted) { + _this4._channel.emit(_coreEvents["default"].STORY_RENDER); + } // should be deprecated in future. + + + _this4.emit(_coreEvents["default"].STORY_RENDER); + }, 1); + } + }, { + key: "addStory", + value: function addStory(_ref6, _ref7) { + var id = _ref6.id, + kind = _ref6.kind, + name = _ref6.name, + original = _ref6.storyFn, + _ref6$parameters = _ref6.parameters, + parameters = _ref6$parameters === void 0 ? {} : _ref6$parameters; + var getDecorators = _ref7.getDecorators, + applyDecorators = _ref7.applyDecorators; + var _data = this._data; + + if (_data[id]) { + _clientLogger.logger.warn((0, _tsDedent["default"])(_templateObject(), id)); + } + + var identification = { + id: id, + kind: kind, + name: name, + story: name // legacy + + }; // immutable original storyFn + + var getOriginal = function getOriginal() { + return original; + }; // lazily decorate the story when it's loaded + + + var getDecorated = (0, _memoizerific["default"])(1)(function () { + return applyDecorators(getOriginal(), getDecorators()); + }); + var hooks = new _hooks.HooksContext(); + + var storyFn = function storyFn(p) { + return getDecorated()(Object.assign({}, identification, {}, p, { + hooks: hooks, + parameters: Object.assign({}, parameters, {}, p && p.parameters) + })); + }; + + _data[id] = Object.assign({}, identification, { + hooks: hooks, + getDecorated: getDecorated, + getOriginal: getOriginal, + storyFn: storyFn, + parameters: parameters + }); // Don't store docs-only stories in legacy data because + // existing clients (at the time?!), e.g. storyshots/chromatic + // are not necessarily equipped to process them + + if (!isStoryDocsOnly(parameters)) { + this.addLegacyStory({ + kind: kind, + name: name, + storyFn: storyFn, + parameters: parameters + }); + } // Store 1-based order of kind loading to preserve sorting on HMR + + + if (!this._kindOrder[kind]) { + this._kindOrder[kind] = 1 + Object.keys(this._kindOrder).length; + } // LET'S SEND IT TO THE MANAGER + + + this.pushToManager(); + } + }, { + key: "getStoriesForKind", + // Unlike a bunch of deprecated APIs below, these lookup functions + // use the `_data` member, which is the new data structure. They should + // be the preferred way of looking up stories in the future. + value: function getStoriesForKind(kind) { + return this.raw().filter(function (story) { + return story.kind === kind; + }); + } + }, { + key: "getRawStory", + value: function getRawStory(kind, name) { + return this.getStoriesForKind(kind).find(function (s) { + return s.name === name; + }); + } // OLD apis + + }, { + key: "getRevision", + value: function getRevision() { + return this._revision; + } + }, { + key: "incrementRevision", + value: function incrementRevision() { + this._revision += 1; + } + }, { + key: "addLegacyStory", + value: function addLegacyStory(_ref8) { + var kind = _ref8.kind, + name = _ref8.name, + storyFn = _ref8.storyFn, + parameters = _ref8.parameters; + var k = toKey(kind); + + if (!this._legacydata[k]) { + this._legacydata[k] = { + kind: kind, + fileName: parameters.fileName, + index: getId(), + stories: {} + }; + } + + this._legacydata[k].stories[toKey(name)] = { + name: name, + // kind, + index: getId(), + story: storyFn, + parameters: parameters + }; + } + }, { + key: "getStoryKinds", + value: function getStoryKinds() { + return Object.values(this._legacydata).filter(function (kind) { + return Object.keys(kind.stories).length > 0; + }).sort(function (info1, info2) { + return info1.index - info2.index; + }).map(function (info) { + return info.kind; + }); + } + }, { + key: "getStories", + value: function getStories(kind) { + var _this5 = this; + + var key = toKey(kind); + + if (!this._legacydata[key]) { + return []; + } + + return Object.keys(this._legacydata[key].stories).map(function (name) { + return _this5._legacydata[key].stories[name]; + }).sort(function (info1, info2) { + return info1.index - info2.index; + }).map(function (info) { + return info.name; + }); + } + }, { + key: "getStoryFileName", + value: function getStoryFileName(kind) { + var key = toKey(kind); + var storiesKind = this._legacydata[key]; + + if (!storiesKind) { + return null; + } + + return storiesKind.fileName; + } + }, { + key: "getStoryAndParameters", + value: function getStoryAndParameters(kind, name) { + if (!kind || !name) { + return null; + } + + var storiesKind = this._legacydata[toKey(kind)]; + + if (!storiesKind) { + return null; + } + + var storyInfo = storiesKind.stories[toKey(name)]; + + if (!storyInfo) { + return null; + } + + var story = storyInfo.story, + parameters = storyInfo.parameters; + return { + story: story, + parameters: parameters + }; + } + }, { + key: "getStory", + value: function getStory(kind, name) { + var data = this.getStoryAndParameters(kind, name); + return data && data.story; + } + }, { + key: "getStoryWithContext", + value: function getStoryWithContext(kind, name) { + var data = this.getStoryAndParameters(kind, name); + + if (!data) { + return null; + } + + var story = data.story; + return story; + } + }, { + key: "removeStoryKind", + value: function removeStoryKind(kind) { + if (this.hasStoryKind(kind)) { + this._legacydata[toKey(kind)].stories = {}; + this.cleanHooksForKind(kind); + this._data = Object.entries(this._data).reduce(function (acc, _ref9) { + var _ref10 = _slicedToArray(_ref9, 2), + id = _ref10[0], + story = _ref10[1]; + + if (story.kind !== kind) { + Object.assign(acc, _defineProperty({}, id, story)); + } + + return acc; + }, {}); + this.pushToManager(); + } + } + }, { + key: "hasStoryKind", + value: function hasStoryKind(kind) { + return Boolean(this._legacydata[toKey(kind)]); + } + }, { + key: "hasStory", + value: function hasStory(kind, name) { + return Boolean(this.getStory(kind, name)); + } + }, { + key: "dumpStoryBook", + value: function dumpStoryBook() { + var _this6 = this; + + var data = this.getStoryKinds().map(function (kind) { + return { + kind: kind, + stories: _this6.getStories(kind) + }; + }); + return data; + } + }, { + key: "size", + value: function size() { + return Object.keys(this._legacydata).length; + } + }, { + key: "clean", + value: function clean() { + var _this7 = this; + + this.getStoryKinds().forEach(function (kind) { + return delete _this7._legacydata[toKey(kind)]; + }); + } + }, { + key: "cleanHooks", + value: function cleanHooks(id) { + if (this._data[id]) { + this._data[id].hooks.clean(); + } + } + }, { + key: "cleanHooksForKind", + value: function cleanHooksForKind(kind) { + var _this8 = this; + + this.getStoriesForKind(kind).map(function (story) { + return _this8.cleanHooks(story.id); + }); + } + }]); + + return StoryStore; +}(_eventemitter["default"]); + +exports["default"] = StoryStore; + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/dist/subscriptions_store.js": +/*!******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/dist/subscriptions_store.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.map */ "../../node_modules/core-js/modules/es.map.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = exports.createSubscriptionsStore = void 0; + +var createSubscriptionsStore = function createSubscriptionsStore() { + var subscriptions = new Map(); + return { + register: function register(subscribe) { + var subscription = subscriptions.get(subscribe); + + if (!subscription) { + subscription = { + unsubscribe: subscribe() + }; + subscriptions.set(subscribe, subscription); + } + + subscription.used = true; + }, + markAllAsUnused: function markAllAsUnused() { + subscriptions.forEach(function (subscription) { + // eslint-disable-next-line no-param-reassign + subscription.used = false; + }); + }, + clearUnused: function clearUnused() { + subscriptions.forEach(function (subscription, key) { + if (subscription.used) return; + subscription.unsubscribe(); + subscriptions["delete"](key); + }); + } + }; +}; + +exports.createSubscriptionsStore = createSubscriptionsStore; + +var _default = createSubscriptionsStore(); + +exports["default"] = _default; + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/node_modules/is-plain-object/index.js": +/*!****************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/node_modules/is-plain-object/index.js ***! + \****************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isPlainObject; }); +/* harmony import */ var isobject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! isobject */ "../../node_modules/@storybook/client-api/node_modules/isobject/index.js"); +/*! + * is-plain-object <https://github.com/jonschlinkert/is-plain-object> + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + + + +function isObjectObject(o) { + return Object(isobject__WEBPACK_IMPORTED_MODULE_0__["default"])(o) === true + && Object.prototype.toString.call(o) === '[object Object]'; +} + +function isPlainObject(o) { + var ctor,prot; + + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/@storybook/client-api/node_modules/isobject/index.js": +/*!*********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-api/node_modules/isobject/index.js ***! + \*********************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isObject; }); +/*! + * isobject <https://github.com/jonschlinkert/isobject> + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; + + +/***/ }), + +/***/ "../../node_modules/@storybook/client-logger/dist/index.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/client-logger/dist/index.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.logger = void 0; +var _global = global, + console = _global.console; +/* tslint:disable: no-console */ + +var logger = { + debug: function debug(message) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + + return console.debug.apply(console, [message].concat(rest)); + }, + log: function log(message) { + for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + rest[_key2 - 1] = arguments[_key2]; + } + + return console.log.apply(console, [message].concat(rest)); + }, + info: function info(message) { + for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + rest[_key3 - 1] = arguments[_key3]; + } + + return console.info.apply(console, [message].concat(rest)); + }, + warn: function warn(message) { + for (var _len4 = arguments.length, rest = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { + rest[_key4 - 1] = arguments[_key4]; + } + + return console.warn.apply(console, [message].concat(rest)); + }, + error: function error(message) { + for (var _len5 = arguments.length, rest = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { + rest[_key5 - 1] = arguments[_key5]; + } + + return console.error.apply(console, [message].concat(rest)); + } +}; +exports.logger = logger; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/@storybook/core-events/dist/index.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/core-events/dist/index.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NAVIGATE_URL = exports.DOCS_RENDERED = exports.STORY_THREW_EXCEPTION = exports.STORIES_EXPAND_ALL = exports.STORIES_COLLAPSE_ALL = exports.STORY_CHANGED = exports.STORY_ERRORED = exports.STORY_MISSING = exports.STORY_RENDERED = exports.STORY_RENDER = exports.STORY_ADDED = exports.STORY_INIT = exports.REGISTER_SUBSCRIPTION = exports.FORCE_RE_RENDER = exports.PREVIEW_KEYDOWN = exports.SELECT_STORY = exports.STORIES_CONFIGURED = exports.SET_STORIES = exports.GET_STORIES = exports.SET_CURRENT_STORY = exports.GET_CURRENT_STORY = exports.CHANNEL_CREATED = exports["default"] = void 0; +var events; // Enables: `import Events from ...` + +(function (events) { + events["CHANNEL_CREATED"] = "channelCreated"; + events["GET_CURRENT_STORY"] = "getCurrentStory"; + events["SET_CURRENT_STORY"] = "setCurrentStory"; + events["GET_STORIES"] = "getStories"; + events["SET_STORIES"] = "setStories"; + events["STORIES_CONFIGURED"] = "storiesConfigured"; + events["SELECT_STORY"] = "selectStory"; + events["PREVIEW_KEYDOWN"] = "previewKeydown"; + events["STORY_ADDED"] = "storyAdded"; + events["STORY_CHANGED"] = "storyChanged"; + events["STORY_UNCHANGED"] = "storyUnchanged"; + events["FORCE_RE_RENDER"] = "forceReRender"; + events["REGISTER_SUBSCRIPTION"] = "registerSubscription"; + events["STORY_INIT"] = "storyInit"; + events["STORY_RENDER"] = "storyRender"; + events["STORY_RENDERED"] = "storyRendered"; + events["STORY_MISSING"] = "storyMissing"; + events["STORY_ERRORED"] = "storyErrored"; + events["STORY_THREW_EXCEPTION"] = "storyThrewException"; + events["STORIES_COLLAPSE_ALL"] = "storiesCollapseAll"; + events["STORIES_EXPAND_ALL"] = "storiesExpandAll"; + events["DOCS_RENDERED"] = "docsRendered"; + events["NAVIGATE_URL"] = "navigateUrl"; +})(events || (events = {})); + +var _default = events; // Enables: `import * as Events from ...` or `import { CHANNEL_CREATED } as Events from ...` +// This is the preferred method + +exports["default"] = _default; +var CHANNEL_CREATED = events.CHANNEL_CREATED, + GET_CURRENT_STORY = events.GET_CURRENT_STORY, + SET_CURRENT_STORY = events.SET_CURRENT_STORY, + GET_STORIES = events.GET_STORIES, + SET_STORIES = events.SET_STORIES, + STORIES_CONFIGURED = events.STORIES_CONFIGURED, + SELECT_STORY = events.SELECT_STORY, + PREVIEW_KEYDOWN = events.PREVIEW_KEYDOWN, + FORCE_RE_RENDER = events.FORCE_RE_RENDER, + REGISTER_SUBSCRIPTION = events.REGISTER_SUBSCRIPTION, + STORY_INIT = events.STORY_INIT, + STORY_ADDED = events.STORY_ADDED, + STORY_RENDER = events.STORY_RENDER, + STORY_RENDERED = events.STORY_RENDERED, + STORY_MISSING = events.STORY_MISSING, + STORY_ERRORED = events.STORY_ERRORED, + STORY_CHANGED = events.STORY_CHANGED, + STORIES_COLLAPSE_ALL = events.STORIES_COLLAPSE_ALL, + STORIES_EXPAND_ALL = events.STORIES_EXPAND_ALL, + STORY_THREW_EXCEPTION = events.STORY_THREW_EXCEPTION, + DOCS_RENDERED = events.DOCS_RENDERED, + NAVIGATE_URL = events.NAVIGATE_URL; +exports.NAVIGATE_URL = NAVIGATE_URL; +exports.DOCS_RENDERED = DOCS_RENDERED; +exports.STORY_THREW_EXCEPTION = STORY_THREW_EXCEPTION; +exports.STORIES_EXPAND_ALL = STORIES_EXPAND_ALL; +exports.STORIES_COLLAPSE_ALL = STORIES_COLLAPSE_ALL; +exports.STORY_CHANGED = STORY_CHANGED; +exports.STORY_ERRORED = STORY_ERRORED; +exports.STORY_MISSING = STORY_MISSING; +exports.STORY_RENDERED = STORY_RENDERED; +exports.STORY_RENDER = STORY_RENDER; +exports.STORY_ADDED = STORY_ADDED; +exports.STORY_INIT = STORY_INIT; +exports.REGISTER_SUBSCRIPTION = REGISTER_SUBSCRIPTION; +exports.FORCE_RE_RENDER = FORCE_RE_RENDER; +exports.PREVIEW_KEYDOWN = PREVIEW_KEYDOWN; +exports.SELECT_STORY = SELECT_STORY; +exports.STORIES_CONFIGURED = STORIES_CONFIGURED; +exports.SET_STORIES = SET_STORIES; +exports.GET_STORIES = GET_STORIES; +exports.SET_CURRENT_STORY = SET_CURRENT_STORY; +exports.GET_CURRENT_STORY = GET_CURRENT_STORY; +exports.CHANNEL_CREATED = CHANNEL_CREATED; + +/***/ }), + +/***/ "../../node_modules/@storybook/csf/dist/index.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/csf/dist/index.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.isExportStory = isExportStory; +exports.parseKind = exports.storyNameFromExport = exports.toId = exports.sanitize = void 0; + +var _startCase = _interopRequireDefault(__webpack_require__(/*! lodash/startCase */ "../../node_modules/lodash/startCase.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/** + * Remove punctuation and illegal characters from a story ID. + * + * See https://gist.github.com/davidjrice/9d2af51100e41c6c4b4a + */ +var sanitize = function sanitize(string) { + return string.toLowerCase() // eslint-disable-next-line no-useless-escape + .replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '-').replace(/-+/g, '-').replace(/^-+/, '').replace(/-+$/, ''); +}; + +exports.sanitize = sanitize; + +var sanitizeSafe = function sanitizeSafe(string, part) { + var sanitized = sanitize(string); + + if (sanitized === '') { + throw new Error("Invalid ".concat(part, " '").concat(string, "', must include alphanumeric characters")); + } + + return sanitized; +}; +/** + * Generate a storybook ID from a component/kind and story name. + */ + + +var toId = function toId(kind, name) { + return "".concat(sanitizeSafe(kind, 'kind'), "--").concat(sanitizeSafe(name, 'name')); +}; +/** + * Transform a CSF named export into a readable story name + */ + + +exports.toId = toId; + +var storyNameFromExport = function storyNameFromExport(key) { + return (0, _startCase["default"])(key); +}; + +exports.storyNameFromExport = storyNameFromExport; + +function matches(storyKey, arrayOrRegex) { + if (Array.isArray(arrayOrRegex)) { + return arrayOrRegex.includes(storyKey); + } + + return storyKey.match(arrayOrRegex); +} +/** + * Does a named export match CSF inclusion/exclusion options? + */ + + +function isExportStory(key, _ref) { + var includeStories = _ref.includeStories, + excludeStories = _ref.excludeStories; + return (// https://babeljs.io/docs/en/babel-plugin-transform-modules-commonjs + key !== '__esModule' && (!includeStories || matches(key, includeStories)) && (!excludeStories || !matches(key, excludeStories)) + ); +} + +/** + * Parse out the component/kind name from a path, using the given separator config. + */ +var parseKind = function parseKind(kind, _ref2) { + var rootSeparator = _ref2.rootSeparator, + groupSeparator = _ref2.groupSeparator; + + var _kind$split = kind.split(rootSeparator, 2), + _kind$split2 = _slicedToArray(_kind$split, 2), + root = _kind$split2[0], + remainder = _kind$split2[1]; + + var groups = (remainder || kind).split(groupSeparator).filter(function (i) { + return !!i; + }); // when there's no remainder, it means the root wasn't found/split + + return { + root: remainder ? root : null, + groups: groups + }; +}; + +exports.parseKind = parseKind; + +/***/ }), + +/***/ "../../node_modules/@storybook/react/dist/client/index.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/dist/client/index.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "storiesOf", { + enumerable: true, + get: function get() { + return _preview.storiesOf; + } +}); +Object.defineProperty(exports, "setAddon", { + enumerable: true, + get: function get() { + return _preview.setAddon; + } +}); +Object.defineProperty(exports, "addDecorator", { + enumerable: true, + get: function get() { + return _preview.addDecorator; + } +}); +Object.defineProperty(exports, "DecoratorFn", { + enumerable: true, + get: function get() { + return _preview.DecoratorFn; + } +}); +Object.defineProperty(exports, "addParameters", { + enumerable: true, + get: function get() { + return _preview.addParameters; + } +}); +Object.defineProperty(exports, "configure", { + enumerable: true, + get: function get() { + return _preview.configure; + } +}); +Object.defineProperty(exports, "getStorybook", { + enumerable: true, + get: function get() { + return _preview.getStorybook; + } +}); +Object.defineProperty(exports, "raw", { + enumerable: true, + get: function get() { + return _preview.raw; + } +}); +Object.defineProperty(exports, "forceReRender", { + enumerable: true, + get: function get() { + return _preview.forceReRender; + } +}); + +var _preview = __webpack_require__(/*! ./preview */ "../../node_modules/@storybook/react/dist/client/preview/index.js"); + +if (module && module.hot && module.hot.decline) { + module.hot.decline(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../examples/react/node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "../../node_modules/@storybook/react/dist/client/preview/globals.js": +/*!****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/dist/client/preview/globals.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +if (_global.window) { + _global.window.STORYBOOK_ENV = 'react'; +} + +/***/ }), + +/***/ "../../node_modules/@storybook/react/dist/client/preview/index.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/dist/client/preview/index.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.raw = exports.getStorybook = exports.forceReRender = exports.setAddon = exports.clearDecorators = exports.addParameters = exports.addDecorator = exports.configure = exports.storiesOf = void 0; + +var _client = __webpack_require__(/*! @storybook/core/client */ "../../node_modules/@storybook/react/node_modules/@storybook/core/client.js"); + +__webpack_require__(/*! ./globals */ "../../node_modules/@storybook/react/dist/client/preview/globals.js"); + +var _render = _interopRequireDefault(__webpack_require__(/*! ./render */ "../../node_modules/@storybook/react/dist/client/preview/render.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/* eslint-disable prefer-destructuring */ +var framework = 'react'; +var api = (0, _client.start)(_render["default"]); + +var storiesOf = function storiesOf(kind, m) { + return api.clientApi.storiesOf(kind, m).addParameters({ + framework: framework + }); +}; + +exports.storiesOf = storiesOf; + +var configure = function configure() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return api.configure.apply(api, args.concat([framework])); +}; + +exports.configure = configure; +var addDecorator = api.clientApi.addDecorator; +exports.addDecorator = addDecorator; +var addParameters = api.clientApi.addParameters; +exports.addParameters = addParameters; +var clearDecorators = api.clientApi.clearDecorators; +exports.clearDecorators = clearDecorators; +var setAddon = api.clientApi.setAddon; +exports.setAddon = setAddon; +var forceReRender = api.forceReRender; +exports.forceReRender = forceReRender; +var getStorybook = api.clientApi.getStorybook; +exports.getStorybook = getStorybook; +var raw = api.clientApi.raw; +exports.raw = raw; + +/***/ }), + +/***/ "../../node_modules/@storybook/react/dist/client/preview/render.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/dist/client/preview/render.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.object.create */ "../../node_modules/core-js/modules/es.object.create.js"); + +__webpack_require__(/*! core-js/modules/es.object.define-property */ "../../node_modules/core-js/modules/es.object.define-property.js"); + +__webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "../../node_modules/core-js/modules/es.object.get-prototype-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.set-prototype-of */ "../../node_modules/core-js/modules/es.object.set-prototype-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.promise */ "../../node_modules/core-js/modules/es.promise.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = renderMain; + +__webpack_require__(/*! regenerator-runtime/runtime */ "../../node_modules/regenerator-runtime/runtime.js"); + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/react/index.js")); + +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } + +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var rootEl = _global.document ? _global.document.getElementById('root') : null; + +var render = function render(node, el) { + return new Promise(function (resolve) { + _reactDom["default"].render(Object({"NODE_ENV":"development","NODE_PATH":"","PUBLIC_URL":"."}).STORYBOOK_EXAMPLE_APP ? _react["default"].createElement(_react.StrictMode, null, node) : node, el, resolve); + }); +}; + +var ErrorBoundary = +/*#__PURE__*/ +function (_Component) { + _inherits(ErrorBoundary, _Component); + + function ErrorBoundary() { + var _getPrototypeOf2; + + var _this; + + _classCallCheck(this, ErrorBoundary); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ErrorBoundary)).call.apply(_getPrototypeOf2, [this].concat(args))); + _this.state = { + hasError: false + }; + return _this; + } + + _createClass(ErrorBoundary, [{ + key: "componentDidMount", + value: function componentDidMount() { + var hasError = this.state.hasError; + var showMain = this.props.showMain; + + if (!hasError) { + showMain(); + } + } + }, { + key: "componentDidCatch", + value: function componentDidCatch(err) { + var showException = this.props.showException; // message partially duplicates stack, strip it + + showException(err); + } + }, { + key: "render", + value: function render() { + var hasError = this.state.hasError; + var children = this.props.children; + return hasError ? null : children; + } + }], [{ + key: "getDerivedStateFromError", + value: function getDerivedStateFromError() { + return { + hasError: true + }; + } + }]); + + return ErrorBoundary; +}(_react.Component); + +function renderMain(_x) { + return _renderMain.apply(this, arguments); +} + +function _renderMain() { + _renderMain = _asyncToGenerator( + /*#__PURE__*/ + regeneratorRuntime.mark(function _callee(_ref) { + var StoryFn, showMain, showException, forceRender, element; + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + StoryFn = _ref.storyFn, showMain = _ref.showMain, showException = _ref.showException, forceRender = _ref.forceRender; + element = _react["default"].createElement(ErrorBoundary, { + showMain: showMain, + showException: showException + }, _react["default"].createElement(StoryFn, null)); // We need to unmount the existing set of components in the DOM node. + // Otherwise, React may not recreate instances for every story run. + // This could leads to issues like below: + // https://github.com/storybookjs/react-storybook/issues/81 + // But forceRender means that it's the same story, so we want too keep the state in that case. + + if (!forceRender) { + _reactDom["default"].unmountComponentAtNode(rootEl); + } + + _context.next = 5; + return render(element, rootEl); + + case 5: + case "end": + return _context.stop(); + } + } + }, _callee); + })); + return _renderMain.apply(this, arguments); +} + +/***/ }), + +/***/ "../../node_modules/@storybook/react/node_modules/@storybook/core/client.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/node_modules/@storybook/core/client.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./dist/client */ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/index.js").default; + + +/***/ }), + +/***/ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/index.js": +/*!***********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/node_modules/@storybook/core/dist/client/index.js ***! + \***********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _preview = _interopRequireDefault(__webpack_require__(/*! ./preview */ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _default = _preview["default"]; +exports["default"] = _default; + +/***/ }), + +/***/ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/NoDocs.js": +/*!********************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/NoDocs.js ***! + \********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NoDocs = void 0; + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var wrapper = { + fontSize: '14px', + letterSpacing: '0.2px', + margin: '10px 0' +}; +var main = { + margin: 'auto', + padding: 30, + borderRadius: 10, + background: 'rgba(0,0,0,0.03)' +}; +var heading = { + textAlign: 'center' +}; + +var _ref = +/*#__PURE__*/ +_react["default"].createElement("div", { + style: wrapper, + className: "sb-nodocs sb-wrapper" +}, _react["default"].createElement("div", { + style: main +}, _react["default"].createElement("h1", { + style: heading +}, "No Docs"), _react["default"].createElement("p", null, "Sorry, but there are no docs for the selected story. To add them, set the story's\xA0", _react["default"].createElement("code", null, "docs"), " parameter. If you think this is an error:"), _react["default"].createElement("ul", null, _react["default"].createElement("li", null, "Please check the story definition."), _react["default"].createElement("li", null, "Please check the Storybook config."), _react["default"].createElement("li", null, "Try reloading the page.")), _react["default"].createElement("p", null, "If the problem persists, check the browser console, or the terminal you've run Storybook from."))); + +var NoDocs = function NoDocs() { + return _ref; +}; + +exports.NoDocs = NoDocs; +NoDocs.displayName = "NoDocs"; + +/***/ }), + +/***/ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/index.js": +/*!*******************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/index.js ***! + \*******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _clientApi = __webpack_require__(/*! @storybook/client-api */ "../../node_modules/@storybook/client-api/dist/index.js"); + +var _csf = __webpack_require__(/*! @storybook/csf */ "../../node_modules/@storybook/csf/dist/index.js"); + +var _start = _interopRequireDefault(__webpack_require__(/*! ./start */ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/start.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _default = { + start: _start["default"], + toId: _csf.toId, + ClientApi: _clientApi.ClientApi, + ConfigApi: _clientApi.ConfigApi, + StoryStore: _clientApi.StoryStore +}; +exports["default"] = _default; + +/***/ }), + +/***/ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/start.js": +/*!*******************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/start.js ***! + \*******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.every */ "../../node_modules/core-js/modules/es.array.every.js"); + +__webpack_require__(/*! core-js/modules/es.array.filter */ "../../node_modules/core-js/modules/es.array.filter.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.from */ "../../node_modules/core-js/modules/es.array.from.js"); + +__webpack_require__(/*! core-js/modules/es.array.index-of */ "../../node_modules/core-js/modules/es.array.index-of.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.map */ "../../node_modules/core-js/modules/es.array.map.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.function.name */ "../../node_modules/core-js/modules/es.function.name.js"); + +__webpack_require__(/*! core-js/modules/es.map */ "../../node_modules/core-js/modules/es.map.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.promise */ "../../node_modules/core-js/modules/es.promise.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = start; +exports.getContext = void 0; + +__webpack_require__(/*! regenerator-runtime/runtime */ "../../node_modules/regenerator-runtime/runtime.js"); + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js")); + +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js")); + +var _utilDeprecate = _interopRequireDefault(__webpack_require__(/*! util-deprecate */ "../../node_modules/util-deprecate/browser.js")); + +var _ansiToHtml = _interopRequireDefault(__webpack_require__(/*! ansi-to-html */ "../../node_modules/ansi-to-html/lib/ansi_to_html.js")); + +var _addons = _interopRequireDefault(__webpack_require__(/*! @storybook/addons */ "../../node_modules/@storybook/addons/dist/public_api.js")); + +var _channelPostmessage = _interopRequireDefault(__webpack_require__(/*! @storybook/channel-postmessage */ "../../node_modules/@storybook/channel-postmessage/dist/index.js")); + +var _clientApi2 = __webpack_require__(/*! @storybook/client-api */ "../../node_modules/@storybook/client-api/dist/index.js"); + +var _csf = __webpack_require__(/*! @storybook/csf */ "../../node_modules/@storybook/csf/dist/index.js"); + +var _clientLogger = __webpack_require__(/*! @storybook/client-logger */ "../../node_modules/@storybook/client-logger/dist/index.js"); + +var _coreEvents = _interopRequireDefault(__webpack_require__(/*! @storybook/core-events */ "../../node_modules/@storybook/core-events/dist/index.js")); + +var _url = __webpack_require__(/*! ./url */ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/url.js"); + +var _NoDocs = __webpack_require__(/*! ./NoDocs */ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/NoDocs.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } + +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + +var ansiConverter = new _ansiToHtml["default"]({ + escapeXML: true +}); +var classes = { + MAIN: 'sb-show-main', + NOPREVIEW: 'sb-show-nopreview', + ERROR: 'sb-show-errordisplay' +}; + +function showMain() { + _global.document.body.classList.remove(classes.NOPREVIEW); + + _global.document.body.classList.remove(classes.ERROR); + + _global.document.body.classList.add(classes.MAIN); +} + +function showNopreview() { + _global.document.body.classList.remove(classes.MAIN); + + _global.document.body.classList.remove(classes.ERROR); + + _global.document.body.classList.add(classes.NOPREVIEW); +} + +function showErrorDisplay(_ref) { + var _ref$message = _ref.message, + message = _ref$message === void 0 ? '' : _ref$message, + _ref$stack = _ref.stack, + stack = _ref$stack === void 0 ? '' : _ref$stack; + _global.document.getElementById('error-message').innerHTML = ansiConverter.toHtml(message); + _global.document.getElementById('error-stack').innerHTML = ansiConverter.toHtml(stack); + + _global.document.body.classList.remove(classes.MAIN); + + _global.document.body.classList.remove(classes.NOPREVIEW); + + _global.document.body.classList.add(classes.ERROR); +} // showError is used by the various app layers to inform the user they have done something +// wrong -- for instance returned the wrong thing from a story + + +function showError(_ref2) { + var title = _ref2.title, + description = _ref2.description; + + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_ERRORED, { + title: title, + description: description + }); + + showErrorDisplay({ + message: title, + stack: description + }); +} // showException is used if we fail to render the story and it is uncaught by the app layer + + +function showException(exception) { + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_THREW_EXCEPTION, exception); + + showErrorDisplay(exception); // Log the stack to the console. So, user could check the source code. + + _clientLogger.logger.error(exception); +} + +var isBrowser = _global.navigator && _global.navigator.userAgent && _global.navigator.userAgent !== 'storyshots' && !(_global.navigator.userAgent.indexOf('Node.js') > -1) && !(_global.navigator.userAgent.indexOf('jsdom') > -1); + +var getContext = function () { + var cache; + return function (decorateStory) { + if (cache) { + return cache; + } + + var channel = null; + + if (isBrowser) { + try { + channel = _addons["default"].getChannel(); + } catch (e) { + channel = (0, _channelPostmessage["default"])({ + page: 'preview' + }); + + _addons["default"].setChannel(channel); + } + } + + var storyStore; + var clientApi; + + if (typeof _global.window !== 'undefined' && _global.window.__STORYBOOK_CLIENT_API__) { + clientApi = _global.window.__STORYBOOK_CLIENT_API__; // eslint-disable-next-line no-underscore-dangle + + storyStore = clientApi._storyStore; + } else { + storyStore = new _clientApi2.StoryStore({ + channel: channel + }); + clientApi = new _clientApi2.ClientApi({ + storyStore: storyStore, + decorateStory: decorateStory + }); + } + + var _clientApi = clientApi, + clearDecorators = _clientApi.clearDecorators; + var configApi = new _clientApi2.ConfigApi({ + clearDecorators: clearDecorators, + storyStore: storyStore, + channel: channel, + clientApi: clientApi + }); + return { + configApi: configApi, + storyStore: storyStore, + channel: channel, + clientApi: clientApi, + showMain: showMain, + showError: showError, + showException: showException + }; + }; +}(); + +exports.getContext = getContext; + +function focusInInput(event) { + return /input|textarea/i.test(event.target.tagName) || event.target.getAttribute('contenteditable') !== null; +} + +function start(render) { + var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + decorateStory = _ref3.decorateStory; + + var context = getContext(decorateStory); + var clientApi = context.clientApi, + channel = context.channel, + configApi = context.configApi, + storyStore = context.storyStore; // Provide access to external scripts if `window` is defined. + // NOTE this is different to isBrowser, primarily for the JSDOM use case + + var previousKind = ''; + var previousStory = ''; + var previousRevision = -1; + var previousViewMode = ''; + var previousId = null; + + var renderMain = function renderMain(forceRender) { + var revision = storyStore.getRevision(); + var loadError = storyStore.getError(); + + var _storyStore$getSelect = storyStore.getSelection(), + storyId = _storyStore$getSelect.storyId, + urlViewMode = _storyStore$getSelect.viewMode; + + var data = storyStore.fromId(storyId); + + var _ref4 = data || {}, + kind = _ref4.kind, + name = _ref4.name, + getDecorated = _ref4.getDecorated, + id = _ref4.id, + parameters = _ref4.parameters, + error = _ref4.error; + + var viewMode = parameters && parameters.docsOnly ? 'docs' : urlViewMode; + var renderContext = Object.assign({}, context, {}, data, { + selectedKind: kind, + selectedStory: name, + parameters: parameters, + forceRender: forceRender + }); + + if (loadError || error) { + showErrorDisplay(loadError || error); + return; + } // Render story only if selectedKind or selectedStory have changed. + // However, we DO want the story to re-render if the store itself has changed + // (which happens at the moment when HMR occurs) + + + if (!forceRender && revision === previousRevision && viewMode === previousViewMode && kind === previousKind && name === previousStory) { + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_UNCHANGED, { + id: id, + revision: revision, + kind: kind, + name: name, + viewMode: viewMode + }); + + return; + } + + if (!forceRender && previousKind && previousStory) { + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_CHANGED, id); + } + + switch (previousViewMode) { + case 'docs': + if (previousKind != null && (kind !== previousKind || viewMode !== previousViewMode)) { + storyStore.cleanHooksForKind(previousKind); + + _reactDom["default"].unmountComponentAtNode(_global.document.getElementById('docs-root')); + } + + break; + + case 'story': + default: + if (previousId != null && (id !== previousId || viewMode !== previousViewMode)) { + storyStore.cleanHooks(previousId); + + _reactDom["default"].unmountComponentAtNode(_global.document.getElementById('root')); + } + + } // Docs view renders into a different root ID to avoid conflicts + // with the user's view layer. Therefore we need to clean up whenever + // we transition between view modes + + + if (viewMode !== previousViewMode) { + switch (viewMode) { + case 'docs': + { + showMain(); + + _global.document.getElementById('root').setAttribute('hidden', true); + + _global.document.getElementById('docs-root').removeAttribute('hidden'); + + break; + } + + case 'story': + default: + { + if (previousViewMode === 'docs') { + _global.document.getElementById('docs-root').setAttribute('hidden', true); + + _global.document.getElementById('root').removeAttribute('hidden'); + } + } + } + } // Given a cleaned up state, render the appropriate view mode + + + switch (viewMode) { + case 'docs': + { + var docs = parameters && parameters.docs || {}; + + var DocsContainer = docs.container || function (_ref5) { + var children = _ref5.children; + return _react["default"].createElement(_react["default"].Fragment, null, children); + }; + + var Page = docs.page || _NoDocs.NoDocs; + + _reactDom["default"].render(_react["default"].createElement(DocsContainer, { + context: renderContext + }, _react["default"].createElement(Page, null)), _global.document.getElementById('docs-root'), function () { + return _addons["default"].getChannel().emit(_coreEvents["default"].DOCS_RENDERED, kind); + }); + + break; + } + + case 'story': + default: + { + if (getDecorated) { + _asyncToGenerator( + /*#__PURE__*/ + regeneratorRuntime.mark(function _callee() { + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return render(renderContext); + + case 3: + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_RENDERED, id); + + _context.next = 9; + break; + + case 6: + _context.prev = 6; + _context.t0 = _context["catch"](0); + showException(_context.t0); + + case 9: + case "end": + return _context.stop(); + } + } + }, _callee, null, [[0, 6]]); + }))(); + } else { + showNopreview(); + + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_MISSING, id); + } + + break; + } + } + + previousRevision = revision; + previousKind = kind; + previousStory = name; + previousViewMode = viewMode; + previousId = id; + + if (!forceRender && viewMode !== 'docs') { + _global.document.documentElement.scrollTop = 0; + _global.document.documentElement.scrollLeft = 0; + } + }; // initialize the UI + + + var renderUI = function renderUI(forceRender) { + if (isBrowser) { + try { + renderMain(forceRender); + } catch (ex) { + showException(ex); + } + } + }; + + var forceReRender = function forceReRender() { + return renderUI(true); + }; // channel can be null in NodeJS + + + if (isBrowser) { + var deprecatedToId = (0, _utilDeprecate["default"])(_csf.toId, "Passing name+kind to the SET_CURRENT_STORY event is deprecated, use a storyId instead"); + channel.on(_coreEvents["default"].FORCE_RE_RENDER, forceReRender); + channel.on(_coreEvents["default"].SET_CURRENT_STORY, function (_ref7) { + var inputStoryId = _ref7.storyId, + name = _ref7.name, + kind = _ref7.kind, + viewMode = _ref7.viewMode; + var storyId = inputStoryId; // For backwards compatibility + + if (!storyId) { + if (!name || !kind) { + throw new Error('You should pass `storyId` into SET_CURRENT_STORY'); + } + + storyId = deprecatedToId(kind, name); + } + + storyStore.setSelection({ + storyId: storyId, + viewMode: viewMode + }); + (0, _url.setPath)({ + storyId: storyId, + viewMode: viewMode + }); + }); // Handle keyboard shortcuts + + _global.window.onkeydown = function (event) { + if (!focusInInput(event)) { + // We have to pick off the keys of the event that we need on the other side + var altKey = event.altKey, + ctrlKey = event.ctrlKey, + metaKey = event.metaKey, + shiftKey = event.shiftKey, + key = event.key, + code = event.code, + keyCode = event.keyCode; + channel.emit(_coreEvents["default"].PREVIEW_KEYDOWN, { + event: { + altKey: altKey, + ctrlKey: ctrlKey, + metaKey: metaKey, + shiftKey: shiftKey, + key: key, + code: code, + keyCode: keyCode + } + }); + } + }; + } + + storyStore.on(_coreEvents["default"].STORY_INIT, function () { + var _initializePath = (0, _url.initializePath)(storyStore), + storyId = _initializePath.storyId, + viewMode = _initializePath.viewMode; + + storyStore.setSelection({ + storyId: storyId, + viewMode: viewMode + }); + }); + storyStore.on(_coreEvents["default"].STORY_RENDER, renderUI); + + if (typeof _global.window !== 'undefined') { + _global.window.__STORYBOOK_CLIENT_API__ = clientApi; + _global.window.__STORYBOOK_STORY_STORE__ = storyStore; + _global.window.__STORYBOOK_ADDONS_CHANNEL__ = channel; // may not be defined + } + + var previousExports = new Map(); + + var loadStories = function loadStories(loadable, framework) { + return function () { + var reqs = null; + + if (Array.isArray(loadable)) { + reqs = loadable; + } else if (loadable.keys) { + reqs = [loadable]; + } + + var currentExports = new Map(); + + if (reqs) { + reqs.forEach(function (req) { + req.keys().forEach(function (filename) { + var fileExports = req(filename); + currentExports.set(fileExports, typeof req.resolve === 'function' ? req.resolve(filename) : null); + }); + }); + } else { + var exported = loadable(); + + if (Array.isArray(exported) && exported.every(function (obj) { + return obj["default"] != null; + })) { + currentExports = new Map(exported.map(function (fileExports) { + return [fileExports, null]; + })); + } else if (exported) { + _clientLogger.logger.warn("Loader function passed to 'configure' should return void or an array of module exports that all contain a 'default' export. Received: ".concat(JSON.stringify(exported))); + } + } + + var removed = _toConsumableArray(previousExports.keys()).filter(function (exp) { + return !currentExports.has(exp); + }); + + removed.forEach(function (exp) { + if (exp["default"]) { + storyStore.removeStoryKind(exp["default"].title); + } + }); + + if (removed.length > 0) { + storyStore.incrementRevision(); + } + + var added = _toConsumableArray(currentExports.keys()).filter(function (exp) { + return !previousExports.has(exp); + }); + + added.forEach(function (fileExports) { + // An old-style story file + if (!fileExports["default"]) { + return; + } + + if (!fileExports["default"].title) { + throw new Error("Unexpected default export without title: ".concat(JSON.stringify(fileExports["default"]))); + } + + var meta = fileExports["default"], + __namedExportsOrder = fileExports.__namedExportsOrder, + namedExports = _objectWithoutProperties(fileExports, ["default", "__namedExportsOrder"]); + + var exports = namedExports; // prefer a user/loader provided `__namedExportsOrder` array if supplied + // we do this as es module exports are always ordered alphabetically + // see https://github.com/storybookjs/storybook/issues/9136 + + if (Array.isArray(__namedExportsOrder)) { + exports = {}; + + __namedExportsOrder.forEach(function (name) { + if (namedExports[name]) { + exports[name] = namedExports[name]; + } + }); + } + + var kindName = meta.title, + componentId = meta.id, + params = meta.parameters, + decos = meta.decorators, + component = meta.component, + subcomponents = meta.subcomponents; // We pass true here to avoid the warning about HMR. It's cool clientApi, we got this + + var kind = clientApi.storiesOf(kindName, true); // we should always have a framework, rest optional + + kind.addParameters(Object.assign({ + framework: framework, + component: component, + subcomponents: subcomponents, + fileName: currentExports.get(fileExports) + }, params)); + (decos || []).forEach(function (decorator) { + kind.addDecorator(decorator); + }); + Object.keys(exports).forEach(function (key) { + if ((0, _csf.isExportStory)(key, meta)) { + var storyFn = exports[key]; + + var _ref8 = storyFn.story || {}, + name = _ref8.name, + parameters = _ref8.parameters, + decorators = _ref8.decorators; + + if (parameters && parameters.decorators) { + (0, _utilDeprecate["default"])(function () {}, "".concat(kindName, " => ").concat(name || key, ": story.parameters.decorators is deprecated; use story.decorators instead."))(); + } + + var decoratorParams = decorators ? { + decorators: decorators + } : null; + var exportName = (0, _csf.storyNameFromExport)(key); + var idParams = { + __id: (0, _csf.toId)(componentId || kindName, exportName) + }; + kind.add(name || exportName, storyFn, Object.assign({}, parameters, {}, decoratorParams, {}, idParams)); + } + }); + }); + previousExports = currentExports; + }; + }; + + var loaded = false; + /** + * Load a collection of stories. If it has a default export, assume that it is a module-style + * file and process its named exports as stories. If not, assume it's an old-style + * storiesof file and require it. + * + * @param {*} loadable a require.context `req`, an array of `req`s, or a loader function that returns void or an array of exports + * @param {*} m - ES module object for hot-module-reloading (HMR) + * @param {*} framework - name of framework in use, e.g. "react" + */ + + var configure = function configure(loadable, m, framework) { + if (typeof m === 'string') { + throw new Error("Invalid module '".concat(m, "'. Did you forget to pass `module` as the second argument to `configure`\"?")); + } + + if (m && m.hot && m.hot.dispose) { + var _ref9 = m.hot.data || {}; + + var _ref9$previousExports = _ref9.previousExports; + previousExports = _ref9$previousExports === void 0 ? new Map() : _ref9$previousExports; + m.hot.dispose(function (data) { + loaded = false; // eslint-disable-next-line no-param-reassign + + data.previousExports = previousExports; + }); + } + + if (loaded) { + _clientLogger.logger.warn('Unexpected loaded state. Did you call `load` twice?'); + } + + loaded = true; + configApi.configure(loadStories(loadable, framework), m); + }; + + return { + configure: configure, + context: context, + clientApi: clientApi, + configApi: configApi, + forceReRender: forceReRender + }; +} + +/***/ }), + +/***/ "../../node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/url.js": +/*!*****************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/@storybook/react/node_modules/@storybook/core/dist/client/preview/url.js ***! + \*****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.index-of */ "../../node_modules/core-js/modules/es.array.index-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js"); + +__webpack_require__(/*! core-js/modules/es.string.match */ "../../node_modules/core-js/modules/es.string.match.js"); + +__webpack_require__(/*! core-js/modules/es.string.search */ "../../node_modules/core-js/modules/es.string.search.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.pathToId = pathToId; +exports.initializePath = exports.parseQueryParameters = exports.getIdFromLegacyQuery = exports.setPath = void 0; + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "../../node_modules/qs/lib/index.js")); + +var _csf = __webpack_require__(/*! @storybook/csf */ "../../node_modules/@storybook/csf/dist/index.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function pathToId(path) { + var match = (path || '').match(/^\/story\/(.+)/); + + if (!match) { + throw new Error("Invalid path '".concat(path, "', must start with '/story/'")); + } + + return match[1]; +} + +var setPath = function setPath(_ref) { + var storyId = _ref.storyId, + viewMode = _ref.viewMode; + + var _qs$parse = _qs["default"].parse(_global.document.location.search, { + ignoreQueryPrefix: true + }), + path = _qs$parse.path, + selectedKind = _qs$parse.selectedKind, + selectedStory = _qs$parse.selectedStory, + rest = _objectWithoutProperties(_qs$parse, ["path", "selectedKind", "selectedStory"]); + + var newPath = "".concat(_global.document.location.pathname, "?").concat(_qs["default"].stringify(Object.assign({}, rest, { + id: storyId, + viewMode: viewMode + }))); + + _global.history.replaceState({}, '', newPath); +}; + +exports.setPath = setPath; + +var getIdFromLegacyQuery = function getIdFromLegacyQuery(_ref2, storyStore) { + var path = _ref2.path, + selectedKind = _ref2.selectedKind, + selectedStory = _ref2.selectedStory; + + if (path) { + return pathToId(path); + } + + if (selectedKind && selectedStory) { + // Look up the story ID inside the story store, since as of 5.3, the + // Story ID is not necessarily a direct function of its kind/name. + var story = storyStore.getRawStory(selectedKind, selectedStory); + + if (story) { + return story.id; + } // this will preserve existing behavior of showing a "not found" screen, + // but the inputs will be preserved in the query param to help debugging + + + return (0, _csf.toId)(selectedKind, selectedStory); + } + + return undefined; +}; + +exports.getIdFromLegacyQuery = getIdFromLegacyQuery; + +var parseQueryParameters = function parseQueryParameters(search) { + var _qs$parse2 = _qs["default"].parse(search, { + ignoreQueryPrefix: true + }), + id = _qs$parse2.id; + + return id; +}; + +exports.parseQueryParameters = parseQueryParameters; + +var initializePath = function initializePath(storyStore) { + var query = _qs["default"].parse(_global.document.location.search, { + ignoreQueryPrefix: true + }); + + var storyId = query.id, + viewMode = query.viewMode; // eslint-disable-line prefer-const + + if (!storyId) { + storyId = getIdFromLegacyQuery(query, storyStore); + + if (storyId) { + setPath({ + storyId: storyId, + viewMode: viewMode + }); + } + } + + return { + storyId: storyId, + viewMode: viewMode + }; +}; + +exports.initializePath = initializePath; + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/index.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/index.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./target/es5 */ "../../node_modules/airbnb-js-shims/target/es5.js"); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/object.fromentries/auto.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/object.fromentries/auto.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./shim */ "../../node_modules/airbnb-js-shims/node_modules/object.fromentries/shim.js")(); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/object.fromentries/implementation.js": +/*!**********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/object.fromentries/implementation.js ***! + \**********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES = __webpack_require__(/*! es-abstract/es2019 */ "../../node_modules/es-abstract/es2019.js"); + +var adder = function addDataProperty(key, value) { + var O = this; // eslint-disable-line no-invalid-this + var propertyKey = ES.ToPropertyKey(key); + ES.CreateDataPropertyOrThrow(O, propertyKey, value); +}; + +var legacyAssign = function assign(obj, entries) { + for (var i = 0; i < entries.length; ++i) { + var entry = entries[i]; + if (ES.Type(entry) !== 'Object') { + throw new TypeError('iterator returned a non-object; entry expected'); + } + + var key = ES.Get(entry, '0'); + var value = ES.Get(entry, '1'); + var propertyKey = ES.ToPropertyKey(key); + ES.CreateDataPropertyOrThrow(obj, propertyKey, value); + } +}; + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + +module.exports = function fromEntries(iterable) { + ES.RequireObjectCoercible(iterable); + + var obj = {}; + + // this part isn't in the spec, it's for a reasonable fallback for pre-ES6 environments + if (!hasSymbols) { + if (!ES.IsArray(iterable)) { + throw new TypeError('this environment lacks native Symbols, and can not support non-Array iterables'); + } + legacyAssign(obj, iterable); + return obj; + } + + return ES.AddEntriesFromIterable(obj, iterable, adder); +}; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/object.fromentries/polyfill.js": +/*!****************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/object.fromentries/polyfill.js ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/airbnb-js-shims/node_modules/object.fromentries/implementation.js"); + +module.exports = function getPolyfill() { + return typeof Object.fromEntries === 'function' ? Object.fromEntries : implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/object.fromentries/shim.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/object.fromentries/shim.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/airbnb-js-shims/node_modules/object.fromentries/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function shimEntries() { + var polyfill = getPolyfill(); + define(Object, { fromEntries: polyfill }, { + fromEntries: function testEntries() { + return Object.fromEntries !== polyfill; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/auto.js": +/*!*******************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/auto.js ***! + \*******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./shim */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/shim.js")(); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/helpers/RegExpStringIterator.js": +/*!*******************************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/helpers/RegExpStringIterator.js ***! + \*******************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); +var ES = __webpack_require__(/*! es-abstract/es2019 */ "../../node_modules/es-abstract/es2019.js"); +var GetIntrinsic = __webpack_require__(/*! es-abstract/GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var hidden = __webpack_require__(/*! ./hidden */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/helpers/hidden.js")(); +var undefined; + +var RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) { + if (ES.Type(S) !== 'String') { + throw new TypeError('S must be a string'); + } + if (ES.Type(global) !== 'Boolean') { + throw new TypeError('global must be a boolean'); + } + if (ES.Type(fullUnicode) !== 'Boolean') { + throw new TypeError('fullUnicode must be a boolean'); + } + hidden.set(this, '[[IteratingRegExp]]', R); + hidden.set(this, '[[IteratedString]]', S); + hidden.set(this, '[[Global]]', global); + hidden.set(this, '[[Unicode]]', fullUnicode); + hidden.set(this, '[[Done]]', false); +}; + +var IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true); +if (IteratorPrototype) { + RegExpStringIterator.prototype = ES.ObjectCreate(IteratorPrototype); +} + +define(RegExpStringIterator.prototype, { + next: function next() { + var O = this; + if (ES.Type(O) !== 'Object') { + throw new TypeError('receiver must be an object'); + } + if ( + !(O instanceof RegExpStringIterator) + || !hidden.has(O, '[[IteratingRegExp]]') + || !hidden.has(O, '[[IteratedString]]') + || !hidden.has(O, '[[Global]]') + || !hidden.has(O, '[[Unicode]]') + || !hidden.has(O, '[[Done]]') + ) { + throw new TypeError('"this" value must be a RegExpStringIterator instance'); + } + if (hidden.get(O, '[[Done]]')) { + return ES.CreateIterResultObject(undefined, true); + } + var R = hidden.get(O, '[[IteratingRegExp]]'); + var S = hidden.get(O, '[[IteratedString]]'); + var global = hidden.get(O, '[[Global]]'); + var fullUnicode = hidden.get(O, '[[Unicode]]'); + var match = ES.RegExpExec(R, S); + if (match === null) { + hidden.set(O, '[[Done]]', true); + return ES.CreateIterResultObject(undefined, true); + } + if (global) { + var matchStr = ES.ToString(ES.Get(match, '0')); + if (matchStr === '') { + var thisIndex = ES.ToLength(ES.Get(R, 'lastIndex')); + var nextIndex = ES.AdvanceStringIndex(S, thisIndex, fullUnicode); + ES.Set(R, 'lastIndex', nextIndex, true); + } + return ES.CreateIterResultObject(match, false); + } + hidden.set(O, '[[Done]]', true); + return ES.CreateIterResultObject(match, false); + } +}); +if (hasSymbols) { + var defineP = Object.defineProperty; + if (Symbol.toStringTag) { + if (defineP) { + defineP(RegExpStringIterator.prototype, Symbol.toStringTag, { + configurable: true, + enumerable: false, + value: 'RegExp String Iterator', + writable: false + }); + } else { + RegExpStringIterator.prototype[Symbol.toStringTag] = 'RegExp String Iterator'; + } + } + + if (!IteratorPrototype && Symbol.iterator) { + var func = {}; + func[Symbol.iterator] = RegExpStringIterator.prototype[Symbol.iterator] || function SymbolIterator() { + return this; + }; + var predicate = {}; + predicate[Symbol.iterator] = function () { + return RegExpStringIterator.prototype[Symbol.iterator] !== func[Symbol.iterator]; + }; + define(RegExpStringIterator.prototype, func, predicate); + } +} + +module.exports = RegExpStringIterator; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/helpers/hidden.js": +/*!*****************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/helpers/hidden.js ***! + \*****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function getHiddenKeyManager() { + var symbolCache = {}; + var makeKey = function key(prop) { + if (symbolCache['$' + prop]) { + return symbolCache['$' + prop]; + } + if (typeof Symbol === 'function') { + symbolCache['$' + prop] = Symbol(prop); + return symbolCache['$' + prop]; + } + return '___ ' + prop + ' ___'; + }; + return { + get: function get(obj, prop) { + return obj[makeKey(prop)]; + }, + has: function has(obj, prop) { + return makeKey(prop) in obj; + }, + set: function set(obj, prop, value) { + var key = makeKey(prop); + if (define.supportsDescriptors) { + Object.defineProperty(obj, key, { + configurable: false, + enumerable: false, + value: value, + writable: true + }); + } else { + obj[key] = value; + } + } + }; +}; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/implementation.js": +/*!*****************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/implementation.js ***! + \*****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES = __webpack_require__(/*! es-abstract/es2019 */ "../../node_modules/es-abstract/es2019.js"); +var callBound = __webpack_require__(/*! es-abstract/helpers/callBound */ "../../node_modules/es-abstract/helpers/callBound.js"); +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); +var flagsGetter = __webpack_require__(/*! regexp.prototype.flags */ "../../node_modules/regexp.prototype.flags/index.js"); + +var $indexOf = callBound('String.prototype.indexOf'); + +var regexpMatchAllPolyfill = __webpack_require__(/*! ./polyfill-regexp-matchall */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js"); + +var getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return + var matcherPolyfill = regexpMatchAllPolyfill(); + if (hasSymbols && typeof Symbol.matchAll === 'symbol') { + var matcher = ES.GetMethod(regexp, Symbol.matchAll); + if (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) { + return matcherPolyfill; + } + return matcher; + } + // fallback for pre-Symbol.matchAll environments + if (ES.IsRegExp(regexp)) { + return matcherPolyfill; + } +}; + +module.exports = function matchAll(regexp) { + var O = ES.RequireObjectCoercible(this); + + if (typeof regexp !== 'undefined' && regexp !== null) { + var isRegExp = ES.IsRegExp(regexp); + if (isRegExp) { + // workaround for older engines that lack RegExp.prototype.flags + var flags = 'flags' in regexp ? ES.Get(regexp, 'flags') : flagsGetter(regexp); + ES.RequireObjectCoercible(flags); + if ($indexOf(ES.ToString(flags), 'g') < 0) { + throw new TypeError('matchAll requires a non-global regular expression'); + } + } + + var matcher = getMatcher(regexp); + if (typeof matcher !== 'undefined') { + return ES.Call(matcher, regexp, [O]); + } + } + + var S = ES.ToString(O); + // var rx = ES.RegExpCreate(regexp, 'g'); + var rx = new RegExp(regexp, 'g'); + return ES.Call(getMatcher(rx), rx, [S]); +}; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js": +/*!***************************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js ***! + \***************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); +var regexpMatchAll = __webpack_require__(/*! ./regexp-matchall */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/regexp-matchall.js"); + +module.exports = function getRegExpMatchAllPolyfill() { + if (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') { + return regexpMatchAll; + } + return RegExp.prototype[Symbol.matchAll]; +}; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/polyfill.js": +/*!***********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/polyfill.js ***! + \***********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/implementation.js"); + +module.exports = function getPolyfill() { + if (String.prototype.matchAll) { + try { + ''.matchAll(RegExp.prototype); + } catch (e) { + return String.prototype.matchAll; + } + } + return implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/regexp-matchall.js": +/*!******************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/regexp-matchall.js ***! + \******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES = __webpack_require__(/*! es-abstract/es2019 */ "../../node_modules/es-abstract/es2019.js"); +var flagsGetter = __webpack_require__(/*! regexp.prototype.flags */ "../../node_modules/regexp.prototype.flags/index.js"); + +var RegExpStringIterator = __webpack_require__(/*! ./helpers/RegExpStringIterator */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/helpers/RegExpStringIterator.js"); +var OrigRegExp = RegExp; + +var CreateRegExpStringIterator = function CreateRegExpStringIterator(R, S, global, fullUnicode) { + if (ES.Type(S) !== 'String') { + throw new TypeError('"S" value must be a String'); + } + if (ES.Type(global) !== 'Boolean') { + throw new TypeError('"global" value must be a Boolean'); + } + if (ES.Type(fullUnicode) !== 'Boolean') { + throw new TypeError('"fullUnicode" value must be a Boolean'); + } + + var iterator = new RegExpStringIterator(R, S, global, fullUnicode); + return iterator; +}; + +var supportsConstructingWithFlags = 'flags' in RegExp.prototype; + +var constructRegexWithFlags = function constructRegex(C, R) { + var matcher; + // workaround for older engines that lack RegExp.prototype.flags + var flags = 'flags' in R ? ES.Get(R, 'flags') : ES.ToString(flagsGetter(R)); + if (supportsConstructingWithFlags && typeof flags === 'string') { + matcher = new C(R, flags); + } else if (C === OrigRegExp) { + // workaround for older engines that can not construct a RegExp with flags + matcher = new C(R.source, flags); + } else { + matcher = new C(R, flags); + } + return { flags: flags, matcher: matcher }; +}; + +var regexMatchAll = function SymbolMatchAll(string) { + var R = this; + if (ES.Type(R) !== 'Object') { + throw new TypeError('"this" value must be an Object'); + } + var S = ES.ToString(string); + var C = ES.SpeciesConstructor(R, OrigRegExp); + + var tmp = constructRegexWithFlags(C, R); + // var flags = ES.ToString(ES.Get(R, 'flags')); + var flags = tmp.flags; + // var matcher = ES.Construct(C, [R, flags]); + var matcher = tmp.matcher; + + var lastIndex = ES.ToLength(ES.Get(R, 'lastIndex')); + ES.Set(matcher, 'lastIndex', lastIndex, true); + var global = flags.indexOf('g') > -1; + var fullUnicode = flags.indexOf('u') > -1; + return CreateRegExpStringIterator(matcher, S, global, fullUnicode); +}; + +var defineP = Object.defineProperty; +var gOPD = Object.getOwnPropertyDescriptor; + +if (defineP && gOPD) { + var desc = gOPD(regexMatchAll, 'name'); + if (desc && desc.configurable) { + defineP(regexMatchAll, 'name', { value: '[Symbol.matchAll]' }); + } +} + +module.exports = regexMatchAll; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/shim.js": +/*!*******************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/shim.js ***! + \*******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/polyfill.js"); +var regexpMatchAllPolyfill = __webpack_require__(/*! ./polyfill-regexp-matchall */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js"); + +var defineP = Object.defineProperty; +var gOPD = Object.getOwnPropertyDescriptor; + +module.exports = function shimMatchAll() { + var polyfill = getPolyfill(); + define( + String.prototype, + { matchAll: polyfill }, + { matchAll: function () { return String.prototype.matchAll !== polyfill; } } + ); + if (hasSymbols) { + // eslint-disable-next-line no-restricted-properties + var symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll')); + define( + Symbol, + { matchAll: symbol }, + { matchAll: function () { return Symbol.matchAll !== symbol; } } + ); + + if (defineP && gOPD) { + var desc = gOPD(Symbol, symbol); + if (!desc || desc.configurable) { + defineP(Symbol, symbol, { + configurable: false, + enumerable: false, + value: symbol, + writable: false + }); + } + } + + var regexpMatchAll = regexpMatchAllPolyfill(); + var func = {}; + func[symbol] = regexpMatchAll; + var predicate = {}; + predicate[symbol] = function () { + return RegExp.prototype[symbol] !== regexpMatchAll; + }; + define(RegExp.prototype, func, predicate); + } + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/target/es2015.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/target/es2015.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! es6-shim */ "../../node_modules/es6-shim/es6-shim.js"); + +__webpack_require__(/*! function.prototype.name/shim */ "../../node_modules/function.prototype.name/shim.js")(); + +__webpack_require__(/*! ./es2016 */ "../../node_modules/airbnb-js-shims/target/es2016.js"); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/target/es2016.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/target/es2016.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Array#includes is stage 4, in ES7/ES2016 +__webpack_require__(/*! array-includes/shim */ "../../node_modules/array-includes/shim.js")(); + +__webpack_require__(/*! ./es2017 */ "../../node_modules/airbnb-js-shims/target/es2017.js"); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/target/es2017.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/target/es2017.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +// Object.values/Object.entries are stage 4, in ES2017 +__webpack_require__(/*! object.values/shim */ "../../node_modules/object.values/shim.js")(); +__webpack_require__(/*! object.entries/shim */ "../../node_modules/object.entries/shim.js")(); + +// String#padStart/String#padEnd are stage 4, in ES2017 +__webpack_require__(/*! string.prototype.padstart/shim */ "../../node_modules/string.prototype.padstart/shim.js")(); +__webpack_require__(/*! string.prototype.padend/shim */ "../../node_modules/string.prototype.padend/shim.js")(); + +// Object.getOwnPropertyDescriptors is stage 4, in ES2017 +__webpack_require__(/*! object.getownpropertydescriptors/shim */ "../../node_modules/object.getownpropertydescriptors/shim.js")(); + +__webpack_require__(/*! ./es2018 */ "../../node_modules/airbnb-js-shims/target/es2018.js"); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/target/es2018.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/target/es2018.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +if (typeof Promise === 'function') { + __webpack_require__(/*! promise.prototype.finally/auto */ "../../node_modules/promise.prototype.finally/auto.js"); // eslint-disable-line global-require +} + +__webpack_require__(/*! ./es2019 */ "../../node_modules/airbnb-js-shims/target/es2019.js"); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/target/es2019.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/target/es2019.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! array.prototype.flat/auto */ "../../node_modules/array.prototype.flat/auto.js"); +__webpack_require__(/*! array.prototype.flatmap/auto */ "../../node_modules/array.prototype.flatmap/auto.js"); + +__webpack_require__(/*! symbol.prototype.description/auto */ "../../node_modules/symbol.prototype.description/auto.js"); + +__webpack_require__(/*! object.fromentries/auto */ "../../node_modules/airbnb-js-shims/node_modules/object.fromentries/auto.js"); + +__webpack_require__(/*! ./es2020 */ "../../node_modules/airbnb-js-shims/target/es2020.js"); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/target/es2020.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/target/es2020.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! string.prototype.matchall/auto */ "../../node_modules/airbnb-js-shims/node_modules/string.prototype.matchall/auto.js"); + +__webpack_require__(/*! globalthis/auto */ "../../node_modules/globalthis/auto.js"); + +__webpack_require__(/*! promise.allsettled/auto */ "../../node_modules/promise.allsettled/auto.js"); + + +/***/ }), + +/***/ "../../node_modules/airbnb-js-shims/target/es5.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/airbnb-js-shims/target/es5.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! es5-shim */ "../../node_modules/es5-shim/es5-shim.js"); +__webpack_require__(/*! es5-shim/es5-sham */ "../../node_modules/es5-shim/es5-sham.js"); + +__webpack_require__(/*! ./es2015 */ "../../node_modules/airbnb-js-shims/target/es2015.js"); + + +/***/ }), + +/***/ "../../node_modules/ansi-html/index.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/ansi-html/index.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = ansiHTML + +// Reference to https://github.com/sindresorhus/ansi-regex +var _regANSI = /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/ + +var _defColors = { + reset: ['fff', '000'], // [FOREGROUD_COLOR, BACKGROUND_COLOR] + black: '000', + red: 'ff0000', + green: '209805', + yellow: 'e8bf03', + blue: '0000ff', + magenta: 'ff00ff', + cyan: '00ffee', + lightgrey: 'f0f0f0', + darkgrey: '888' +} +var _styles = { + 30: 'black', + 31: 'red', + 32: 'green', + 33: 'yellow', + 34: 'blue', + 35: 'magenta', + 36: 'cyan', + 37: 'lightgrey' +} +var _openTags = { + '1': 'font-weight:bold', // bold + '2': 'opacity:0.5', // dim + '3': '<i>', // italic + '4': '<u>', // underscore + '8': 'display:none', // hidden + '9': '<del>' // delete +} +var _closeTags = { + '23': '</i>', // reset italic + '24': '</u>', // reset underscore + '29': '</del>' // reset delete +} + +;[0, 21, 22, 27, 28, 39, 49].forEach(function (n) { + _closeTags[n] = '</span>' +}) + +/** + * Converts text with ANSI color codes to HTML markup. + * @param {String} text + * @returns {*} + */ +function ansiHTML (text) { + // Returns the text if the string has no ANSI escape code. + if (!_regANSI.test(text)) { + return text + } + + // Cache opened sequence. + var ansiCodes = [] + // Replace with markup. + var ret = text.replace(/\033\[(\d+)*m/g, function (match, seq) { + var ot = _openTags[seq] + if (ot) { + // If current sequence has been opened, close it. + if (!!~ansiCodes.indexOf(seq)) { // eslint-disable-line no-extra-boolean-cast + ansiCodes.pop() + return '</span>' + } + // Open tag. + ansiCodes.push(seq) + return ot[0] === '<' ? ot : '<span style="' + ot + ';">' + } + + var ct = _closeTags[seq] + if (ct) { + // Pop sequence + ansiCodes.pop() + return ct + } + return '' + }) + + // Make sure tags are closed. + var l = ansiCodes.length + ;(l > 0) && (ret += Array(l + 1).join('</span>')) + + return ret +} + +/** + * Customize colors. + * @param {Object} colors reference to _defColors + */ +ansiHTML.setColors = function (colors) { + if (typeof colors !== 'object') { + throw new Error('`colors` parameter must be an Object.') + } + + var _finalColors = {} + for (var key in _defColors) { + var hex = colors.hasOwnProperty(key) ? colors[key] : null + if (!hex) { + _finalColors[key] = _defColors[key] + continue + } + if ('reset' === key) { + if (typeof hex === 'string') { + hex = [hex] + } + if (!Array.isArray(hex) || hex.length === 0 || hex.some(function (h) { + return typeof h !== 'string' + })) { + throw new Error('The value of `' + key + '` property must be an Array and each item could only be a hex string, e.g.: FF0000') + } + var defHexColor = _defColors[key] + if (!hex[0]) { + hex[0] = defHexColor[0] + } + if (hex.length === 1 || !hex[1]) { + hex = [hex[0]] + hex.push(defHexColor[1]) + } + + hex = hex.slice(0, 2) + } else if (typeof hex !== 'string') { + throw new Error('The value of `' + key + '` property must be a hex string, e.g.: FF0000') + } + _finalColors[key] = hex + } + _setTags(_finalColors) +} + +/** + * Reset colors. + */ +ansiHTML.reset = function () { + _setTags(_defColors) +} + +/** + * Expose tags, including open and close. + * @type {Object} + */ +ansiHTML.tags = {} + +if (Object.defineProperty) { + Object.defineProperty(ansiHTML.tags, 'open', { + get: function () { return _openTags } + }) + Object.defineProperty(ansiHTML.tags, 'close', { + get: function () { return _closeTags } + }) +} else { + ansiHTML.tags.open = _openTags + ansiHTML.tags.close = _closeTags +} + +function _setTags (colors) { + // reset all + _openTags['0'] = 'font-weight:normal;opacity:1;color:#' + colors.reset[0] + ';background:#' + colors.reset[1] + // inverse + _openTags['7'] = 'color:#' + colors.reset[1] + ';background:#' + colors.reset[0] + // dark grey + _openTags['90'] = 'color:#' + colors.darkgrey + + for (var code in _styles) { + var color = _styles[code] + var oriColor = colors[color] || '000' + _openTags[code] = 'color:#' + oriColor + code = parseInt(code) + _openTags[(code + 10).toString()] = 'background:#' + oriColor + } +} + +ansiHTML.reset() + + +/***/ }), + +/***/ "../../node_modules/ansi-regex/index.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/ansi-regex/index.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; + + +/***/ }), + +/***/ "../../node_modules/ansi-to-html/lib/ansi_to_html.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/ansi-to-html/lib/ansi_to_html.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +var entities = __webpack_require__(/*! entities */ "../../node_modules/entities/index.js"); + +var defaults = { + fg: '#FFF', + bg: '#000', + newline: false, + escapeXML: false, + stream: false, + colors: getDefaultColors() +}; + +function getDefaultColors() { + var colors = { + 0: '#000', + 1: '#A00', + 2: '#0A0', + 3: '#A50', + 4: '#00A', + 5: '#A0A', + 6: '#0AA', + 7: '#AAA', + 8: '#555', + 9: '#F55', + 10: '#5F5', + 11: '#FF5', + 12: '#55F', + 13: '#F5F', + 14: '#5FF', + 15: '#FFF' + }; + range(0, 5).forEach(function (red) { + range(0, 5).forEach(function (green) { + range(0, 5).forEach(function (blue) { + return setStyleColor(red, green, blue, colors); + }); + }); + }); + range(0, 23).forEach(function (gray) { + var c = gray + 232; + var l = toHexString(gray * 10 + 8); + colors[c] = '#' + l + l + l; + }); + return colors; +} +/** + * @param {number} red + * @param {number} green + * @param {number} blue + * @param {object} colors + */ + + +function setStyleColor(red, green, blue, colors) { + var c = 16 + red * 36 + green * 6 + blue; + var r = red > 0 ? red * 40 + 55 : 0; + var g = green > 0 ? green * 40 + 55 : 0; + var b = blue > 0 ? blue * 40 + 55 : 0; + colors[c] = toColorHexString([r, g, b]); +} +/** + * Converts from a number like 15 to a hex string like 'F' + * @param {number} num + * @returns {string} + */ + + +function toHexString(num) { + var str = num.toString(16); + + while (str.length < 2) { + str = '0' + str; + } + + return str; +} +/** + * Converts from an array of numbers like [15, 15, 15] to a hex string like 'FFF' + * @param {[red, green, blue]} ref + * @returns {string} + */ + + +function toColorHexString(ref) { + var results = []; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = ref[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var r = _step.value; + results.push(toHexString(r)); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator["return"] != null) { + _iterator["return"](); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + return '#' + results.join(''); +} +/** + * @param {Array} stack + * @param {string} token + * @param {*} data + * @param {object} options + */ + + +function generateOutput(stack, token, data, options) { + var result; + + if (token === 'text') { + result = pushText(data, options); + } else if (token === 'display') { + result = handleDisplay(stack, data, options); + } else if (token === 'xterm256') { + result = pushForegroundColor(stack, options.colors[data]); + } else if (token === 'rgb') { + result = handleRgb(stack, data); + } + + return result; +} +/** + * @param {Array} stack + * @param {string} data + * @returns {*} + */ + + +function handleRgb(stack, data) { + data = data.substring(2).slice(0, -1); + var operation = +data.substr(0, 2); + var color = data.substring(5).split(';'); + var rgb = color.map(function (value) { + return ('0' + Number(value).toString(16)).substr(-2); + }).join(''); + return pushStyle(stack, (operation === 38 ? 'color:#' : 'background-color:#') + rgb); +} +/** + * @param {Array} stack + * @param {number} code + * @param {object} options + * @returns {*} + */ + + +function handleDisplay(stack, code, options) { + code = parseInt(code, 10); + var codeMap = { + '-1': function _() { + return '<br/>'; + }, + 0: function _() { + return stack.length && resetStyles(stack); + }, + 1: function _() { + return pushTag(stack, 'b'); + }, + 3: function _() { + return pushTag(stack, 'i'); + }, + 4: function _() { + return pushTag(stack, 'u'); + }, + 8: function _() { + return pushStyle(stack, 'display:none'); + }, + 9: function _() { + return pushTag(stack, 'strike'); + }, + 22: function _() { + return pushStyle(stack, 'font-weight:normal;text-decoration:none;font-style:normal'); + }, + 23: function _() { + return closeTag(stack, 'i'); + }, + 24: function _() { + return closeTag(stack, 'u'); + }, + 39: function _() { + return pushForegroundColor(stack, options.fg); + }, + 49: function _() { + return pushBackgroundColor(stack, options.bg); + }, + 53: function _() { + return pushStyle(stack, 'text-decoration:overline'); + } + }; + var result; + + if (codeMap[code]) { + result = codeMap[code](); + } else if (4 < code && code < 7) { + result = pushTag(stack, 'blink'); + } else if (29 < code && code < 38) { + result = pushForegroundColor(stack, options.colors[code - 30]); + } else if (39 < code && code < 48) { + result = pushBackgroundColor(stack, options.colors[code - 40]); + } else if (89 < code && code < 98) { + result = pushForegroundColor(stack, options.colors[8 + (code - 90)]); + } else if (99 < code && code < 108) { + result = pushBackgroundColor(stack, options.colors[8 + (code - 100)]); + } + + return result; +} +/** + * Clear all the styles + * @returns {string} + */ + + +function resetStyles(stack) { + var stackClone = stack.slice(0); + stack.length = 0; + return stackClone.reverse().map(function (tag) { + return '</' + tag + '>'; + }).join(''); +} +/** + * Creates an array of numbers ranging from low to high + * @param {number} low + * @param {number} high + * @returns {Array} + * @example range(3, 7); // creates [3, 4, 5, 6, 7] + */ + + +function range(low, high) { + var results = []; + + for (var j = low; j <= high; j++) { + results.push(j); + } + + return results; +} +/** + * Returns a new function that is true if value is NOT the same category + * @param {string} category + * @returns {function} + */ + + +function notCategory(category) { + return function (e) { + return (category === null || e.category !== category) && category !== 'all'; + }; +} +/** + * Converts a code into an ansi token type + * @param {number} code + * @returns {string} + */ + + +function categoryForCode(code) { + code = parseInt(code, 10); + var result = null; + + if (code === 0) { + result = 'all'; + } else if (code === 1) { + result = 'bold'; + } else if (2 < code && code < 5) { + result = 'underline'; + } else if (4 < code && code < 7) { + result = 'blink'; + } else if (code === 8) { + result = 'hide'; + } else if (code === 9) { + result = 'strike'; + } else if (29 < code && code < 38 || code === 39 || 89 < code && code < 98) { + result = 'foreground-color'; + } else if (39 < code && code < 48 || code === 49 || 99 < code && code < 108) { + result = 'background-color'; + } + + return result; +} +/** + * @param {string} text + * @param {object} options + * @returns {string} + */ + + +function pushText(text, options) { + if (options.escapeXML) { + return entities.encodeXML(text); + } + + return text; +} +/** + * @param {Array} stack + * @param {string} tag + * @param {string} [style=''] + * @returns {string} + */ + + +function pushTag(stack, tag, style) { + if (!style) { + style = ''; + } + + stack.push(tag); + return ['<' + tag, style ? ' style="' + style + '"' : void 0, '>'].join(''); +} +/** + * @param {Array} stack + * @param {string} style + * @returns {string} + */ + + +function pushStyle(stack, style) { + return pushTag(stack, 'span', style); +} + +function pushForegroundColor(stack, color) { + return pushTag(stack, 'span', 'color:' + color); +} + +function pushBackgroundColor(stack, color) { + return pushTag(stack, 'span', 'background-color:' + color); +} +/** + * @param {Array} stack + * @param {string} style + * @returns {string} + */ + + +function closeTag(stack, style) { + var last; + + if (stack.slice(-1)[0] === style) { + last = stack.pop(); + } + + if (last) { + return '</' + style + '>'; + } +} +/** + * @param {string} text + * @param {object} options + * @param {function} callback + * @returns {Array} + */ + + +function tokenize(text, options, callback) { + var ansiMatch = false; + var ansiHandler = 3; + + function remove() { + return ''; + } + + function removeXterm256(m, g1) { + callback('xterm256', g1); + return ''; + } + + function newline(m) { + if (options.newline) { + callback('display', -1); + } else { + callback('text', m); + } + + return ''; + } + + function ansiMess(m, g1) { + ansiMatch = true; + + if (g1.trim().length === 0) { + g1 = '0'; + } + + g1 = g1.trimRight(';').split(';'); + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = g1[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var g = _step2.value; + callback('display', g); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) { + _iterator2["return"](); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + return ''; + } + + function realText(m) { + callback('text', m); + return ''; + } + + function rgb(m) { + callback('rgb', m); + return ''; + } + /* eslint no-control-regex:0 */ + + + var tokens = [{ + pattern: /^\x08+/, + sub: remove + }, { + pattern: /^\x1b\[[012]?K/, + sub: remove + }, { + pattern: /^\x1b\[\(B/, + sub: remove + }, { + pattern: /^\x1b\[[34]8;2;\d+;\d+;\d+m/, + sub: rgb + }, { + pattern: /^\x1b\[38;5;(\d+)m/, + sub: removeXterm256 + }, { + pattern: /^\n/, + sub: newline + }, { + pattern: /^\r\n/, + sub: newline + }, { + pattern: /^\x1b\[((?:\d{1,3};?)+|)m/, + sub: ansiMess + }, { + // CSI n J + // ED - Erase in Display Clears part of the screen. + // If n is 0 (or missing), clear from cursor to end of screen. + // If n is 1, clear from cursor to beginning of the screen. + // If n is 2, clear entire screen (and moves cursor to upper left on DOS ANSI.SYS). + // If n is 3, clear entire screen and delete all lines saved in the scrollback buffer + // (this feature was added for xterm and is supported by other terminal applications). + pattern: /^\x1b\[\d?J/, + sub: remove + }, { + // CSI n ; m f + // HVP - Horizontal Vertical Position Same as CUP + pattern: /^\x1b\[\d{0,3};\d{0,3}f/, + sub: remove + }, { + // catch-all for CSI sequences? + pattern: /^\x1b\[?[\d;]{0,3}/, + sub: remove + }, { + /** + * extracts real text - not containing: + * - `\x1b' - ESC - escape (Ascii 27) + * - '\x08' - BS - backspace (Ascii 8) + * - `\n` - Newline - linefeed (LF) (ascii 10) + * - `\r` - Windows Carriage Return (CR) + */ + pattern: /^(([^\x1b\x08\r\n])+)/, + sub: realText + }]; + + function process(handler, i) { + if (i > ansiHandler && ansiMatch) { + return; + } + + ansiMatch = false; + text = text.replace(handler.pattern, handler.sub); + } + + var results1 = []; + var _text = text, + length = _text.length; + + outer: while (length > 0) { + for (var i = 0, o = 0, len = tokens.length; o < len; i = ++o) { + var handler = tokens[i]; + process(handler, i); + + if (text.length !== length) { + // We matched a token and removed it from the text. We need to + // start matching *all* tokens against the new text. + length = text.length; + continue outer; + } + } + + if (text.length === length) { + break; + } + + results1.push(0); + length = text.length; + } + + return results1; +} +/** + * If streaming, then the stack is "sticky" + * + * @param {Array} stickyStack + * @param {string} token + * @param {*} data + * @returns {Array} + */ + + +function updateStickyStack(stickyStack, token, data) { + if (token !== 'text') { + stickyStack = stickyStack.filter(notCategory(categoryForCode(data))); + stickyStack.push({ + token: token, + data: data, + category: categoryForCode(data) + }); + } + + return stickyStack; +} + +var Filter = +/*#__PURE__*/ +function () { + /** + * @param {object} options + * @param {string=} options.fg The default foreground color used when reset color codes are encountered. + * @param {string=} options.bg The default background color used when reset color codes are encountered. + * @param {boolean=} options.newline Convert newline characters to `<br/>`. + * @param {boolean=} options.escapeXML Generate HTML/XML entities. + * @param {boolean=} options.stream Save style state across invocations of `toHtml()`. + * @param {(string[] | {[code: number]: string})=} options.colors Can override specific colors or the entire ANSI palette. + */ + function Filter(options) { + _classCallCheck(this, Filter); + + options = options || {}; + + if (options.colors) { + options.colors = Object.assign({}, defaults.colors, options.colors); + } + + this.options = Object.assign({}, defaults, options); + this.stack = []; + this.stickyStack = []; + } + /** + * @param {string | string[]} input + * @returns {string} + */ + + + _createClass(Filter, [{ + key: "toHtml", + value: function toHtml(input) { + var _this = this; + + input = typeof input === 'string' ? [input] : input; + var stack = this.stack, + options = this.options; + var buf = []; + this.stickyStack.forEach(function (element) { + var output = generateOutput(stack, element.token, element.data, options); + + if (output) { + buf.push(output); + } + }); + tokenize(input.join(''), options, function (token, data) { + var output = generateOutput(stack, token, data, options); + + if (output) { + buf.push(output); + } + + if (options.stream) { + _this.stickyStack = updateStickyStack(_this.stickyStack, token, data); + } + }); + + if (stack.length) { + buf.push(resetStyles(stack)); + } + + return buf.join(''); + } + }]); + + return Filter; +}(); + +module.exports = Filter; + +/***/ }), + +/***/ "../../node_modules/array-includes/implementation.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/implementation.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var ES = __webpack_require__(/*! es-abstract/es6 */ "../../node_modules/array-includes/node_modules/es-abstract/es6.js"); +var $isNaN = Number.isNaN || function isNaN(a) { + return a !== a; +}; +var $isFinite = Number.isFinite || function isFinite(n) { + return typeof n === 'number' && global.isFinite(n); +}; +var indexOf = Array.prototype.indexOf; + +module.exports = function includes(searchElement) { + var fromIndex = arguments.length > 1 ? ES.ToInteger(arguments[1]) : 0; + if (indexOf && !$isNaN(searchElement) && $isFinite(fromIndex) && typeof searchElement !== 'undefined') { + return indexOf.apply(this, arguments) > -1; + } + + var O = ES.ToObject(this); + var length = ES.ToLength(O.length); + if (length === 0) { + return false; + } + var k = fromIndex >= 0 ? fromIndex : Math.max(0, length + fromIndex); + while (k < length) { + if (ES.SameValueZero(searchElement, O[k])) { + return true; + } + k += 1; + } + return false; +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; // eslint-disable-line no-shadow-restricted-names + +var ThrowTypeError = Object.getOwnPropertyDescriptor + ? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }()) + : function () { throw new TypeError(); }; + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '$ %Array%': Array, + '$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '$ %ArrayPrototype%': Array.prototype, + '$ %ArrayProto_entries%': Array.prototype.entries, + '$ %ArrayProto_forEach%': Array.prototype.forEach, + '$ %ArrayProto_keys%': Array.prototype.keys, + '$ %ArrayProto_values%': Array.prototype.values, + '$ %AsyncFromSyncIteratorPrototype%': undefined, + '$ %AsyncFunction%': asyncFunction, + '$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '$ %AsyncGeneratorFunction%': asyncGenFunction, + '$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '$ %Boolean%': Boolean, + '$ %BooleanPrototype%': Boolean.prototype, + '$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '$ %Date%': Date, + '$ %DatePrototype%': Date.prototype, + '$ %decodeURI%': decodeURI, + '$ %decodeURIComponent%': decodeURIComponent, + '$ %encodeURI%': encodeURI, + '$ %encodeURIComponent%': encodeURIComponent, + '$ %Error%': Error, + '$ %ErrorPrototype%': Error.prototype, + '$ %eval%': eval, // eslint-disable-line no-eval + '$ %EvalError%': EvalError, + '$ %EvalErrorPrototype%': EvalError.prototype, + '$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '$ %Function%': Function, + '$ %FunctionPrototype%': Function.prototype, + '$ %Generator%': generator ? getProto(generator()) : undefined, + '$ %GeneratorFunction%': generatorFunction, + '$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '$ %isFinite%': isFinite, + '$ %isNaN%': isNaN, + '$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '$ %JSON%': JSON, + '$ %JSONParse%': JSON.parse, + '$ %Map%': typeof Map === 'undefined' ? undefined : Map, + '$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '$ %Math%': Math, + '$ %Number%': Number, + '$ %NumberPrototype%': Number.prototype, + '$ %Object%': Object, + '$ %ObjectPrototype%': Object.prototype, + '$ %ObjProto_toString%': Object.prototype.toString, + '$ %ObjProto_valueOf%': Object.prototype.valueOf, + '$ %parseFloat%': parseFloat, + '$ %parseInt%': parseInt, + '$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '$ %RangeError%': RangeError, + '$ %RangeErrorPrototype%': RangeError.prototype, + '$ %ReferenceError%': ReferenceError, + '$ %ReferenceErrorPrototype%': ReferenceError.prototype, + '$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '$ %RegExp%': RegExp, + '$ %RegExpPrototype%': RegExp.prototype, + '$ %Set%': typeof Set === 'undefined' ? undefined : Set, + '$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '$ %String%': String, + '$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '$ %StringPrototype%': String.prototype, + '$ %Symbol%': hasSymbols ? Symbol : undefined, + '$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '$ %SyntaxError%': SyntaxError, + '$ %SyntaxErrorPrototype%': SyntaxError.prototype, + '$ %ThrowTypeError%': ThrowTypeError, + '$ %TypedArray%': TypedArray, + '$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '$ %TypeError%': TypeError, + '$ %TypeErrorPrototype%': TypeError.prototype, + '$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '$ %URIError%': URIError, + '$ %URIErrorPrototype%': URIError.prototype, + '$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var key = '$ ' + name; + if (!(key in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) { + throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + return INTRINSICS[key]; +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/es2015.js": +/*!******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/es2015.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es6 */ "../../node_modules/array-includes/node_modules/es-to-primitive/es6.js"); +var keys = __webpack_require__(/*! object-keys */ "../../node_modules/object-keys/index.js"); +var inspect = __webpack_require__(/*! object-inspect */ "../../node_modules/array-includes/node_modules/object-inspect/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $Array = GetIntrinsic('%Array%'); +var $ArrayPrototype = $Array.prototype; +var $String = GetIntrinsic('%String%'); +var $Object = GetIntrinsic('%Object%'); +var $Number = GetIntrinsic('%Number%'); +var $Symbol = GetIntrinsic('%Symbol%', true); +var $RegExp = GetIntrinsic('%RegExp%'); +var $Promise = GetIntrinsic('%Promise%', true); +var $preventExtensions = $Object.preventExtensions; + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/assertRecord.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isFinite.js"); +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; +var MAX_SAFE_INTEGER = $Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/assign.js"); +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/mod.js"); +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isPrimitive.js"); +var forEach = __webpack_require__(/*! ./helpers/forEach */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/forEach.js"); +var every = __webpack_require__(/*! ./helpers/every */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/every.js"); +var isSamePropertyDescriptor = __webpack_require__(/*! ./helpers/isSamePropertyDescriptor */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var parseInteger = parseInt; +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/callBind.js"); +var $PromiseThen = $Promise ? callBind(GetIntrinsic('%PromiseProto_then%')) : null; +var arraySlice = callBind($Array.prototype.slice); +var strSlice = callBind($String.prototype.slice); +var isBinary = callBind($RegExp.prototype.test, /^0b[01]+$/i); +var isOctal = callBind($RegExp.prototype.test, /^0o[0-7]+$/i); +var isDigit = callBind($RegExp.prototype.test, /^[0-9]$/); +var regexExec = callBind($RegExp.prototype.exec); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = callBind($RegExp.prototype.test, nonWSregex); +var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i; +var isInvalidHexLiteral = callBind($RegExp.prototype.test, invalidHexLiteral); +var $charCodeAt = callBind($String.prototype.charCodeAt); +var $isEnumerable = callBind($Object.prototype.propertyIsEnumerable); + +var toStr = callBind($Object.prototype.toString); + +var $NumberValueOf = callBind(GetIntrinsic('%NumberPrototype%').valueOf); +var $BooleanValueOf = callBind(GetIntrinsic('%BooleanPrototype%').valueOf); +var $StringValueOf = callBind(GetIntrinsic('%StringPrototype%').valueOf); +var $DateValueOf = callBind(GetIntrinsic('%DatePrototype%').valueOf); +var $SymbolToString = hasSymbols && callBind(GetIntrinsic('%SymbolPrototype%').toString); + +var $floor = Math.floor; +var $abs = Math.abs; + +var $ObjectCreate = $Object.create; +var $gOPD = $Object.getOwnPropertyDescriptor; +var $gOPN = $Object.getOwnPropertyNames; +var $gOPS = $Object.getOwnPropertySymbols; +var $isExtensible = $Object.isExtensible; +var $defineProperty = $Object.defineProperty; +var $setProto = Object.setPrototypeOf || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== Array.prototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto + return O; + } +); + +var DefineOwnProperty = function DefineOwnProperty(ES, O, P, desc) { + if (!$defineProperty) { + if (!ES.IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + O[P] = V; // will use [[Define]] + return ES.SameValue(O[P], V); + } + $defineProperty(O, P, ES.FromPropertyDescriptor(desc)); + return true; +}; + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBind($String.prototype.replace); +var trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ES5 = __webpack_require__(/*! ./es5 */ "../../node_modules/array-includes/node_modules/es-abstract/es5.js"); + +var hasRegExpMatcher = __webpack_require__(/*! is-regex */ "../../node_modules/is-regex/index.js"); + +// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations +var ES6 = assign(assign({}, ES5), { + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args + Call: function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + if (!this.IsCallable(F)) { + throw new $TypeError(inspect(F) + ' is not a function'); + } + return F.apply(V, args); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive + ToPrimitive: toPrimitive, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean + // ToBoolean: ES5.ToBoolean, + + // https://ecma-international.org/ecma-262/6.0/#sec-tonumber + ToNumber: function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : toPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = trim(value); + if (trimmed !== value) { + return this.ToNumber(trimmed); + } + } + } + return $Number(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger + // ToInteger: ES5.ToNumber, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32 + // ToInt32: ES5.ToInt32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32 + // ToUint32: ES5.ToUint32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16 + ToInt16: function ToInt16(argument) { + var int16bit = this.ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16 + // ToUint16: ES5.ToUint16, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8 + ToInt8: function ToInt8(argument) { + var int8bit = this.ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8 + ToUint8: function ToUint8(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * $floor($abs(number)); + return mod(posInt, 0x100); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp + ToUint8Clamp: function ToUint8Clamp(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring + ToString: function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject + ToObject: function ToObject(value) { + this.RequireObjectCoercible(value); + return $Object(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + ToPropertyKey: function ToPropertyKey(argument) { + var key = this.ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : this.ToString(key); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + ToLength: function ToLength(argument) { + var len = this.ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) { + if (toStr(argument) !== '[object String]') { + throw new $TypeError('must be a string'); + } + if (argument === '-0') { return -0; } + var n = this.ToNumber(argument); + if (this.SameValue(this.ToString(n), argument)) { return n; } + return void 0; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible + RequireObjectCoercible: ES5.CheckObjectCoercible, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + IsArray: $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable + // IsCallable: ES5.IsCallable, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + IsConstructor: function IsConstructor(argument) { + return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument` + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o + IsExtensible: $preventExtensions + ? function IsExtensible(obj) { + if (isPrimitive(obj)) { + return false; + } + return $isExtensible(obj); + } + : function isExtensible(obj) { return true; }, // eslint-disable-line no-unused-vars + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger + IsInteger: function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey + IsPropertyKey: function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isregexp + IsRegExp: function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if (hasSymbols) { + var isRegExp = argument[$Symbol.match]; + if (typeof isRegExp !== 'undefined') { + return ES5.ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue + // SameValue: ES5.SameValue, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero + SameValueZero: function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); + }, + + /** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + GetV: function GetV(V, P) { + // 7.3.2.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = this.ToObject(V); + + // 7.3.2.4 + return O[P]; + }, + + /** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + GetMethod: function GetMethod(O, P) { + // 7.3.9.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = this.GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!this.IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; + }, + + /** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + Get: function Get(O, P) { + // 7.3.1.1 + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; + }, + + Type: function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5.Type(x); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (this.Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (this.IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) { + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + Set: function Set(O, P, V, Throw) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + if (this.Type(Throw) !== 'Boolean') { + throw new $TypeError('Throw must be a Boolean'); + } + if (Throw) { + O[P] = V; + return true; + } else { + try { + O[P] = V; + } catch (e) { + return false; + } + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + HasOwnProperty: function HasOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return has(O, P); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + HasProperty: function HasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return P in O; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + IsConcatSpreadable: function IsConcatSpreadable(O) { + if (this.Type(O) !== 'Object') { + return false; + } + if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') { + var spreadable = this.Get(O, Symbol.isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return this.ToBoolean(spreadable); + } + } + return this.IsArray(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-invoke + Invoke: function Invoke(O, P) { + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = arraySlice(arguments, 2); + var func = this.GetV(O, P); + return this.Call(func, O, argumentsList); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-getiterator + GetIterator: function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + if (!hasSymbols) { + throw new SyntaxError('GetIterator depends on native Symbol support when `method` is not passed'); + } + actualMethod = this.GetMethod(obj, $Symbol.iterator); + } + var iterator = this.Call(actualMethod, obj); + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + IteratorNext: function IteratorNext(iterator, value) { + var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (this.Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + IteratorComplete: function IteratorComplete(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.ToBoolean(this.Get(iterResult, 'done')); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + IteratorValue: function IteratorValue(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.Get(iterResult, 'value'); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + IteratorStep: function IteratorStep(iterator) { + var result = this.IteratorNext(iterator); + var done = this.IteratorComplete(result); + return done === true ? false : result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + IteratorClose: function IteratorClose(iterator, completion) { + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!this.IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = this.GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = this.Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionRecord = completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (this.Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + CreateIterResultObject: function CreateIterResultObject(value, done) { + if (this.Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + RegExpExec: function RegExpExec(R, S) { + if (this.Type(R) !== 'Object') { + throw new $TypeError('R must be an Object'); + } + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + var exec = this.Get(R, 'exec'); + if (this.IsCallable(exec)) { + var result = this.Call(exec, R, [S]); + if (result === null || this.Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = this.IsArray(originalArray); + if (isArray) { + C = this.Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (this.IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) { + C = this.Get(C, $Symbol.species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!this.IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // this.Construct(C, len); + }, + + CreateDataProperty: function CreateDataProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = $gOPD(O, P); + var extensible = oldDesc || this.IsExtensible(O); + var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty(this, O, P, { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + }); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = this.CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + ObjectCreate: function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && this.Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: proto must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if (proto === null && !$ObjectCreate) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + + return $ObjectCreate(proto); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) { + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53'); + } + if (this.Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: unicode must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + CreateMethodProperty: function CreateMethodProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty(this, O, P, newDesc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + DefinePropertyOrThrow: function DefinePropertyOrThrow(O, P, desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor(this, desc) ? desc : this.ToPropertyDescriptor(desc); + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty(this, O, P, Desc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + DeletePropertyOrThrow: function DeletePropertyOrThrow(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var success = delete O[P]; + if (!success) { + throw new TypeError('Attempt to delete property failed.'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + EnumerableOwnNames: function EnumerableOwnNames(O) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + thisNumberValue: function thisNumberValue(value) { + if (this.Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + thisBooleanValue: function thisBooleanValue(value) { + if (this.Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + thisStringValue: function thisStringValue(value) { + if (this.Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + thisTimeValue: function thisTimeValue(value) { + return $DateValueOf(value); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + SetIntegrityLevel: function SetIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + var ES = this; + if (level === 'sealed') { + forEach(theKeys, function (k) { + ES.DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (ES.IsAccessorDescriptor(ES.ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + ES.DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + TestIntegrityLevel: function TestIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = this.IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + var ES = this; + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && ES.IsDataDescriptor(ES.ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + OrdinaryHasInstance: function OrdinaryHasInstance(C, O) { + if (this.IsCallable(C) === false) { + return false; + } + if (this.Type(O) !== 'Object') { + return false; + } + var P = this.Get(C, 'prototype'); + if (this.Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + OrdinaryHasProperty: function OrdinaryHasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + InstanceofOperator: function InstanceofOperator(O, C) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = hasSymbols && $Symbol.hasInstance ? this.GetMethod(C, $Symbol.hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return this.ToBoolean(this.Call(instOfHandler, C, [O])); + } + if (!this.IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return this.OrdinaryHasInstance(C, O); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + IsPromise: function IsPromise(x) { + if (this.Type(x) !== 'Object') { + return false; + } + if (!$Promise) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // eslint-disable-next-line max-lines-per-function, max-statements, id-length, max-params + ValidateAndApplyPropertyDescriptor: function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = this.Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (this.Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (this.Type(current) !== 'Undefined' && !isPropertyDescriptor(this, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (this.Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + }); + } + } else { + if (!this.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + } + return true; + } + if (this.IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor(this, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (this.IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (this.IsDataDescriptor(current) !== this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (this.IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + }); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + }); + } + } else if (this.IsDataDescriptor(current) && this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !this.SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (this.IsAccessorDescriptor(current) && this.IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !this.SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !this.SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + OrdinaryDefineOwnProperty: function OrdinaryDefineOwnProperty(O, P, Desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + var desc = $gOPD(O, P); + var current = desc && this.ToPropertyDescriptor(desc); + var extensible = this.IsExtensible(O); + return this.ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + OrdinaryGetOwnProperty: function OrdinaryGetOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 fallback + var arrayLength = this.IsArray(O) && P === 'length'; + var regexLastIndex = this.IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return this.ToPropertyDescriptor($gOPD(O, P)); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + ArrayCreate: function ArrayCreate(length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + this.OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; + }, + + // eslint-disable-next-line max-statements, max-lines-per-function + ArraySetLength: function ArraySetLength(A, Desc) { + if (!this.IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return this.OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = this.ToUint32(Desc['[[Value]]']); + var numberLen = this.ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = this.OrdinaryGetOwnProperty(A, 'length'); + if (!this.IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + var deleteSucceeded = delete A[this.ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return this.OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + CreateHTML: function CreateHTML(string, tag, attribute, value) { + if (this.Type(tag) !== 'String' || this.Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = this.RequireObjectCoercible(string); + var S = this.ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = this.ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + '</' + tag + '>'; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + GetOwnPropertyKeys: function GetOwnPropertyKeys(O, Type) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return hasSymbols && $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + SymbolDescriptiveString: function SymbolDescriptiveString(sym) { + if (this.Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + // eslint-disable-next-line max-statements, max-params, max-lines-per-function + GetSubstitution: function GetSubstitution(matched, str, position, captures, replacement) { + if (this.Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (this.Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!this.IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + var ES = this; + var isStringOrHole = function (capture, index, arr) { return ES.Type(capture) === 'String' || !(index in arr); }; + if (!this.IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (this.Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = replacement[i]; + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = replacement[i + 1]; + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : replacement[i + 2]; + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = parseInteger(next, 10); + // if (n > m, impl-defined) + result += (n <= m && this.Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = parseInteger(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && this.Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += replacement[i]; + } + } + return result; + } +}); + +delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible + +module.exports = ES6; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/es5.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/es5.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js"); + +var $Object = GetIntrinsic('%Object%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $String = GetIntrinsic('%String%'); +var $Number = GetIntrinsic('%Number%'); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/assertRecord.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isFinite.js"); + +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/mod.js"); + +var IsCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es5 */ "../../node_modules/array-includes/node_modules/es-to-primitive/es5.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/callBind.js"); +var strSlice = callBind($String.prototype.slice); + +var isPrefixOf = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return strSlice(string, 0, prefix.length) === prefix; +}; + +// https://es5.github.io/#x9 +var ES5 = { + ToPrimitive: toPrimitive, + + ToBoolean: function ToBoolean(value) { + return !!value; + }, + ToNumber: function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion + }, + ToInteger: function ToInteger(value) { + var number = this.ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return sign(number) * Math.floor(Math.abs(number)); + }, + ToInt32: function ToInt32(x) { + return this.ToNumber(x) >> 0; + }, + ToUint32: function ToUint32(x) { + return this.ToNumber(x) >>> 0; + }, + ToUint16: function ToUint16(value) { + var number = this.ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * Math.floor(Math.abs(number)); + return mod(posInt, 0x10000); + }, + ToString: function ToString(value) { + return $String(value); + }, + ToObject: function ToObject(value) { + this.CheckObjectCoercible(value); + return $Object(value); + }, + CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { + /* jshint eqnull:true */ + if (value == null) { + throw new $TypeError(optMessage || 'Cannot call method on ' + value); + } + return value; + }, + IsCallable: IsCallable, + SameValue: function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-8 + Type: function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + IsPropertyDescriptor: function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor(this, Desc); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + IsAccessorDescriptor: function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + IsDataDescriptor: function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + IsGenericDescriptor: function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) { + return true; + } + + return false; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (this.IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + ToPropertyDescriptor: function ToPropertyDescriptor(Obj) { + if (this.Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = this.ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !this.IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !this.IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + 'Strict Equality Comparison': function StrictEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + // eslint-disable-next-line max-statements + 'Abstract Relational Comparison': function AbstractRelationalComparison(x, y, LeftFirst) { + if (this.Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = this.ToPrimitive(x, $Number); + py = this.ToPrimitive(y, $Number); + } else { + py = this.ToPrimitive(y, $Number); + px = this.ToPrimitive(x, $Number); + } + var bothStrings = this.Type(px) === 'String' && this.Type(py) === 'String'; + if (!bothStrings) { + var nx = this.ToNumber(px); + var ny = this.ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f + } +}; + +module.exports = ES5; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/es6.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/es6.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2015 */ "../../node_modules/array-includes/node_modules/es-abstract/es2015.js"); + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/assertRecord.js": +/*!********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/assertRecord.js ***! + \********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(ES, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(ES, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/assign.js": +/*!**************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/assign.js ***! + \**************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + target[key] = source[key]; + } + } + return target; +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/callBind.js": +/*!****************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/callBind.js ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js"); + +var $Function = GetIntrinsic('%Function%'); +var $apply = $Function.apply; +var $call = $Function.call; + +module.exports = function callBind() { + return bind.apply($call, arguments); +}; + +module.exports.apply = function applyBind() { + return bind.apply($apply, arguments); +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/every.js": +/*!*************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/every.js ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/forEach.js": +/*!***************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/forEach.js ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isFinite.js": +/*!****************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/isFinite.js ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isNaN.js": +/*!*************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/isNaN.js ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isPrimitive.js": +/*!*******************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/isPrimitive.js ***! + \*******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isPropertyDescriptor.js": +/*!****************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/isPropertyDescriptor.js ***! + \****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/array-includes/node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js": +/*!********************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js ***! + \********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var every = __webpack_require__(/*! ./every */ "../../node_modules/array-includes/node_modules/es-abstract/helpers/every.js"); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/mod.js": +/*!***********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/mod.js ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return Math.floor(remain >= 0 ? remain : remain + modulo); +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-abstract/helpers/sign.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-abstract/helpers/sign.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-to-primitive/es2015.js": +/*!**********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-to-primitive/es2015.js ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/array-includes/node_modules/es-to-primitive/helpers/isPrimitive.js"); +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var isDate = __webpack_require__(/*! is-date-object */ "../../node_modules/is-date-object/index.js"); +var isSymbol = __webpack_require__(/*! is-symbol */ "../../node_modules/is-symbol/index.js"); + +var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { + if (typeof O === 'undefined' || O === null) { + throw new TypeError('Cannot call method on ' + O); + } + if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { + throw new TypeError('hint must be "string" or "number"'); + } + var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var method, result, i; + for (i = 0; i < methodNames.length; ++i) { + method = O[methodNames[i]]; + if (isCallable(method)) { + result = method.call(O); + if (isPrimitive(result)) { + return result; + } + } + } + throw new TypeError('No default value'); +}; + +var GetMethod = function GetMethod(O, P) { + var func = O[P]; + if (func !== null && typeof func !== 'undefined') { + if (!isCallable(func)) { + throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); + } + return func; + } + return void 0; +}; + +// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + var hint = 'default'; + if (arguments.length > 1) { + if (arguments[1] === String) { + hint = 'string'; + } else if (arguments[1] === Number) { + hint = 'number'; + } + } + + var exoticToPrim; + if (hasSymbols) { + if (Symbol.toPrimitive) { + exoticToPrim = GetMethod(input, Symbol.toPrimitive); + } else if (isSymbol(input)) { + exoticToPrim = Symbol.prototype.valueOf; + } + } + if (typeof exoticToPrim !== 'undefined') { + var result = exoticToPrim.call(input, hint); + if (isPrimitive(result)) { + return result; + } + throw new TypeError('unable to convert exotic object to primitive'); + } + if (hint === 'default' && (isDate(input) || isSymbol(input))) { + hint = 'string'; + } + return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-to-primitive/es5.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-to-primitive/es5.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/array-includes/node_modules/es-to-primitive/helpers/isPrimitive.js"); + +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); + +// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 +var ES5internalSlots = { + '[[DefaultValue]]': function (O) { + var actualHint; + if (arguments.length > 1) { + actualHint = arguments[1]; + } else { + actualHint = toStr.call(O) === '[object Date]' ? String : Number; + } + + if (actualHint === String || actualHint === Number) { + var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var value, i; + for (i = 0; i < methods.length; ++i) { + if (isCallable(O[methods[i]])) { + value = O[methods[i]](); + if (isPrimitive(value)) { + return value; + } + } + } + throw new TypeError('No default value'); + } + throw new TypeError('invalid [[DefaultValue]] hint supplied'); + } +}; + +// http://ecma-international.org/ecma-262/5.1/#sec-9.1 +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + if (arguments.length > 1) { + return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]); + } + return ES5internalSlots['[[DefaultValue]]'](input); +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-to-primitive/es6.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-to-primitive/es6.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2015 */ "../../node_modules/array-includes/node_modules/es-to-primitive/es2015.js"); + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/es-to-primitive/helpers/isPrimitive.js": +/*!***********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/es-to-primitive/helpers/isPrimitive.js ***! + \***********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/node_modules/object-inspect/index.js": +/*!********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/node_modules/object-inspect/index.js ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; + +var inspectCustom = __webpack_require__(/*! ./util.inspect */ 1).custom; +var inspectSymbol = (inspectCustom && isSymbol(inspectCustom)) ? inspectCustom : null; + +module.exports = function inspect_ (obj, opts, depth, seen) { + if (!opts) opts = {}; + + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + return String(obj); + } + if (typeof obj === 'bigint') { + return String(obj) + 'n'; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') depth = 0; + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return '[Object]'; + } + + if (typeof seen === 'undefined') seen = []; + else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect (value, from) { + if (from) { + seen = seen.slice(); + seen.push(from); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function') { + var name = nameOf(obj); + return '[Function' + (name ? ': ' + name : '') + ']'; + } + if (isSymbol(obj)) { + var symString = Symbol.prototype.toString.call(obj); + return typeof obj === 'object' ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + String(obj.nodeName).toLowerCase(); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) s += '...'; + s += '</' + String(obj.nodeName).toLowerCase() + '>'; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) return '[]'; + return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (parts.length === 0) return '[' + String(obj) + ']'; + return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; + } + if (typeof obj === 'object') { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { + return obj[inspectSymbol](); + } else if (typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var parts = []; + mapForEach.call(obj, function (value, key) { + parts.push(inspect(key, obj) + ' => ' + inspect(value, obj)); + }); + return collectionOf('Map', mapSize.call(obj), parts); + } + if (isSet(obj)) { + var parts = []; + setForEach.call(obj, function (value ) { + parts.push(inspect(value, obj)); + }); + return collectionOf('Set', setSize.call(obj), parts); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + if (!isDate(obj) && !isRegExp(obj)) { + var xs = arrObjKeys(obj, inspect); + if (xs.length === 0) return '{}'; + return '{ ' + xs.join(', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes (s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; +} + +function quote (s) { + return String(s).replace(/"/g, '"'); +} + +function isArray (obj) { return toStr(obj) === '[object Array]'; } +function isDate (obj) { return toStr(obj) === '[object Date]'; } +function isRegExp (obj) { return toStr(obj) === '[object RegExp]'; } +function isError (obj) { return toStr(obj) === '[object Error]'; } +function isSymbol (obj) { return toStr(obj) === '[object Symbol]'; } +function isString (obj) { return toStr(obj) === '[object String]'; } +function isNumber (obj) { return toStr(obj) === '[object Number]'; } +function isBigInt (obj) { return toStr(obj) === '[object BigInt]'; } +function isBoolean (obj) { return toStr(obj) === '[object Boolean]'; } + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has (obj, key) { + return hasOwn.call(obj, key); +} + +function toStr (obj) { + return objectToString.call(obj); +} + +function nameOf (f) { + if (f.name) return f.name; + var m = String(f).match(/^function\s*([\w$]+)/); + if (m) return m[1]; +} + +function indexOf (xs, x) { + if (xs.indexOf) return xs.indexOf(x); + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} + +function isMap (x) { + if (!mapSize) { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isSet (x) { + if (!setSize) { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement (x) { + if (!x || typeof x !== 'object') return false; + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' + && typeof x.getAttribute === 'function' + ; +} + +function inspectString (str, opts) { + var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte (c) { + var n = c.charCodeAt(0); + var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n]; + if (x) return '\\' + x; + return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); +} + +function markBoxed (str) { + return 'Object(' + str + ')'; +} + +function collectionOf (type, size, entries) { + return type + ' (' + size + ') {' + entries.join(', ') + '}'; +} + +function arrObjKeys (obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + for (var key in obj) { + if (!has(obj, key)) continue; + if (isArr && String(Number(key)) === key && key < obj.length) continue; + if (/[^\w$]/.test(key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + return xs; +} + + +/***/ }), + +/***/ "../../node_modules/array-includes/polyfill.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/polyfill.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/array-includes/implementation.js"); + +module.exports = function getPolyfill() { + return Array.prototype.includes || implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/array-includes/shim.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array-includes/shim.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/array-includes/polyfill.js"); + +module.exports = function shimArrayPrototypeIncludes() { + var polyfill = getPolyfill(); + define( + Array.prototype, + { includes: polyfill }, + { includes: function () { return Array.prototype.includes !== polyfill; } } + ); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/array.prototype.flat/auto.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array.prototype.flat/auto.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./shim */ "../../node_modules/array.prototype.flat/shim.js")(); + + +/***/ }), + +/***/ "../../node_modules/array.prototype.flat/implementation.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array.prototype.flat/implementation.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES = __webpack_require__(/*! es-abstract/es2019 */ "../../node_modules/es-abstract/es2019.js"); + +module.exports = function flat() { + var O = ES.ToObject(this); + var sourceLen = ES.ToLength(ES.Get(O, 'length')); + + var depthNum = 1; + if (arguments.length > 0 && typeof arguments[0] !== 'undefined') { + depthNum = ES.ToInteger(arguments[0]); + } + + var A = ES.ArraySpeciesCreate(O, 0); + ES.FlattenIntoArray(A, O, sourceLen, 0, depthNum); + return A; +}; + + +/***/ }), + +/***/ "../../node_modules/array.prototype.flat/polyfill.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array.prototype.flat/polyfill.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/array.prototype.flat/implementation.js"); + +module.exports = function getPolyfill() { + return Array.prototype.flat || implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/array.prototype.flat/shim.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array.prototype.flat/shim.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/array.prototype.flat/polyfill.js"); + +module.exports = function shimFlat() { + var polyfill = getPolyfill(); + define( + Array.prototype, + { flat: polyfill }, + { flat: function () { return Array.prototype.flat !== polyfill; } } + ); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/array.prototype.flatmap/auto.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array.prototype.flatmap/auto.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./shim */ "../../node_modules/array.prototype.flatmap/shim.js")(); + + +/***/ }), + +/***/ "../../node_modules/array.prototype.flatmap/implementation.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array.prototype.flatmap/implementation.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES = __webpack_require__(/*! es-abstract/es2019 */ "../../node_modules/es-abstract/es2019.js"); + +module.exports = function flatMap(mapperFunction) { + var O = ES.ToObject(this); + var sourceLen = ES.ToLength(ES.Get(O, 'length')); + + if (!ES.IsCallable(mapperFunction)) { + throw new TypeError('mapperFunction must be a function'); + } + + var T; + if (arguments.length > 1) { + T = arguments[1]; + } + + var A = ES.ArraySpeciesCreate(O, 0); + ES.FlattenIntoArray(A, O, sourceLen, 0, 1, mapperFunction, T); + return A; +}; + + +/***/ }), + +/***/ "../../node_modules/array.prototype.flatmap/polyfill.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array.prototype.flatmap/polyfill.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/array.prototype.flatmap/implementation.js"); + +module.exports = function getPolyfill() { + return Array.prototype.flatMap || implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/array.prototype.flatmap/shim.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/array.prototype.flatmap/shim.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/array.prototype.flatmap/polyfill.js"); + +module.exports = function shimFlatMap() { + var polyfill = getPolyfill(); + define( + Array.prototype, + { flatMap: polyfill }, + { flatMap: function () { return Array.prototype.flatMap !== polyfill; } } + ); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/es/symbol/index.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/es/symbol/index.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); +__webpack_require__(/*! ../../modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); +__webpack_require__(/*! ../../modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); +__webpack_require__(/*! ../../modules/es.symbol.async-iterator */ "../../node_modules/core-js/modules/es.symbol.async-iterator.js"); +__webpack_require__(/*! ../../modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); +__webpack_require__(/*! ../../modules/es.symbol.has-instance */ "../../node_modules/core-js/modules/es.symbol.has-instance.js"); +__webpack_require__(/*! ../../modules/es.symbol.is-concat-spreadable */ "../../node_modules/core-js/modules/es.symbol.is-concat-spreadable.js"); +__webpack_require__(/*! ../../modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); +__webpack_require__(/*! ../../modules/es.symbol.match */ "../../node_modules/core-js/modules/es.symbol.match.js"); +__webpack_require__(/*! ../../modules/es.symbol.match-all */ "../../node_modules/core-js/modules/es.symbol.match-all.js"); +__webpack_require__(/*! ../../modules/es.symbol.replace */ "../../node_modules/core-js/modules/es.symbol.replace.js"); +__webpack_require__(/*! ../../modules/es.symbol.search */ "../../node_modules/core-js/modules/es.symbol.search.js"); +__webpack_require__(/*! ../../modules/es.symbol.species */ "../../node_modules/core-js/modules/es.symbol.species.js"); +__webpack_require__(/*! ../../modules/es.symbol.split */ "../../node_modules/core-js/modules/es.symbol.split.js"); +__webpack_require__(/*! ../../modules/es.symbol.to-primitive */ "../../node_modules/core-js/modules/es.symbol.to-primitive.js"); +__webpack_require__(/*! ../../modules/es.symbol.to-string-tag */ "../../node_modules/core-js/modules/es.symbol.to-string-tag.js"); +__webpack_require__(/*! ../../modules/es.symbol.unscopables */ "../../node_modules/core-js/modules/es.symbol.unscopables.js"); +__webpack_require__(/*! ../../modules/es.math.to-string-tag */ "../../node_modules/core-js/modules/es.math.to-string-tag.js"); +__webpack_require__(/*! ../../modules/es.json.to-string-tag */ "../../node_modules/core-js/modules/es.json.to-string-tag.js"); +var path = __webpack_require__(/*! ../../internals/path */ "../../node_modules/core-js/internals/path.js"); + +module.exports = path.Symbol; + + +/***/ }), + +/***/ "../../node_modules/core-js/features/symbol/index.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/features/symbol/index.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var parent = __webpack_require__(/*! ../../es/symbol */ "../../node_modules/core-js/es/symbol/index.js"); +__webpack_require__(/*! ../../modules/esnext.symbol.async-dispose */ "../../node_modules/core-js/modules/esnext.symbol.async-dispose.js"); +__webpack_require__(/*! ../../modules/esnext.symbol.dispose */ "../../node_modules/core-js/modules/esnext.symbol.dispose.js"); +__webpack_require__(/*! ../../modules/esnext.symbol.observable */ "../../node_modules/core-js/modules/esnext.symbol.observable.js"); +__webpack_require__(/*! ../../modules/esnext.symbol.pattern-match */ "../../node_modules/core-js/modules/esnext.symbol.pattern-match.js"); +// TODO: Remove from `core-js@4` +__webpack_require__(/*! ../../modules/esnext.symbol.replace-all */ "../../node_modules/core-js/modules/esnext.symbol.replace-all.js"); + +module.exports = parent; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/a-function.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/a-function.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') { + throw TypeError(String(it) + ' is not a function'); + } return it; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/a-possible-prototype.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/a-possible-prototype.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); + +module.exports = function (it) { + if (!isObject(it) && it !== null) { + throw TypeError("Can't set " + String(it) + ' as a prototype'); + } return it; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/add-to-unscopables.js": +/*!********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/add-to-unscopables.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); + +var UNSCOPABLES = wellKnownSymbol('unscopables'); +var ArrayPrototype = Array.prototype; + +// Array.prototype[@@unscopables] +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +if (ArrayPrototype[UNSCOPABLES] == undefined) { + createNonEnumerableProperty(ArrayPrototype, UNSCOPABLES, create(null)); +} + +// add a key to Array.prototype[@@unscopables] +module.exports = function (key) { + ArrayPrototype[UNSCOPABLES][key] = true; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/advance-string-index.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/advance-string-index.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "../../node_modules/core-js/internals/string-multibyte.js").charAt; + +// `AdvanceStringIndex` abstract operation +// https://tc39.github.io/ecma262/#sec-advancestringindex +module.exports = function (S, index, unicode) { + return index + (unicode ? charAt(S, index).length : 1); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/an-instance.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/an-instance.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it, Constructor, name) { + if (!(it instanceof Constructor)) { + throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); + } return it; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/an-object.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/an-object.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); + +module.exports = function (it) { + if (!isObject(it)) { + throw TypeError(String(it) + ' is not an object'); + } return it; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/array-for-each.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/array-for-each.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "../../node_modules/core-js/internals/array-iteration.js").forEach; +var sloppyArrayMethod = __webpack_require__(/*! ../internals/sloppy-array-method */ "../../node_modules/core-js/internals/sloppy-array-method.js"); + +// `Array.prototype.forEach` method implementation +// https://tc39.github.io/ecma262/#sec-array.prototype.foreach +module.exports = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); +} : [].forEach; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/array-from.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/array-from.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var bind = __webpack_require__(/*! ../internals/bind-context */ "../../node_modules/core-js/internals/bind-context.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ "../../node_modules/core-js/internals/call-with-safe-iteration-closing.js"); +var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "../../node_modules/core-js/internals/is-array-iterator-method.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); +var createProperty = __webpack_require__(/*! ../internals/create-property */ "../../node_modules/core-js/internals/create-property.js"); +var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "../../node_modules/core-js/internals/get-iterator-method.js"); + +// `Array.from` method implementation +// https://tc39.github.io/ecma262/#sec-array.from +module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var argumentsLength = arguments.length; + var mapfn = argumentsLength > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iteratorMethod = getIteratorMethod(O); + var length, result, step, iterator, next; + if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); + // if the target is not iterable or it's an array with the default iterator - use a simple case + if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { + iterator = iteratorMethod.call(O); + next = iterator.next; + result = new C(); + for (;!(step = next.call(iterator)).done; index++) { + createProperty(result, index, mapping + ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) + : step.value + ); + } + } else { + length = toLength(O.length); + result = new C(length); + for (;length > index; index++) { + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/array-includes.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/array-includes.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); +var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "../../node_modules/core-js/internals/to-absolute-index.js"); + +// `Array.prototype.{ indexOf, includes }` methods implementation +var createMethod = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIndexedObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) { + if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + +module.exports = { + // `Array.prototype.includes` method + // https://tc39.github.io/ecma262/#sec-array.prototype.includes + includes: createMethod(true), + // `Array.prototype.indexOf` method + // https://tc39.github.io/ecma262/#sec-array.prototype.indexof + indexOf: createMethod(false) +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/array-iteration.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/array-iteration.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var bind = __webpack_require__(/*! ../internals/bind-context */ "../../node_modules/core-js/internals/bind-context.js"); +var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "../../node_modules/core-js/internals/indexed-object.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); +var arraySpeciesCreate = __webpack_require__(/*! ../internals/array-species-create */ "../../node_modules/core-js/internals/array-species-create.js"); + +var push = [].push; + +// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation +var createMethod = function (TYPE) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + return function ($this, callbackfn, that, specificCreate) { + var O = toObject($this); + var self = IndexedObject(O); + var boundFunction = bind(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var create = specificCreate || arraySpeciesCreate; + var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var value, result; + for (;length > index; index++) if (NO_HOLES || index in self) { + value = self[index]; + result = boundFunction(value, index, O); + if (TYPE) { + if (IS_MAP) target[index] = result; // map + else if (result) switch (TYPE) { + case 3: return true; // some + case 5: return value; // find + case 6: return index; // findIndex + case 2: push.call(target, value); // filter + } else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; + }; +}; + +module.exports = { + // `Array.prototype.forEach` method + // https://tc39.github.io/ecma262/#sec-array.prototype.foreach + forEach: createMethod(0), + // `Array.prototype.map` method + // https://tc39.github.io/ecma262/#sec-array.prototype.map + map: createMethod(1), + // `Array.prototype.filter` method + // https://tc39.github.io/ecma262/#sec-array.prototype.filter + filter: createMethod(2), + // `Array.prototype.some` method + // https://tc39.github.io/ecma262/#sec-array.prototype.some + some: createMethod(3), + // `Array.prototype.every` method + // https://tc39.github.io/ecma262/#sec-array.prototype.every + every: createMethod(4), + // `Array.prototype.find` method + // https://tc39.github.io/ecma262/#sec-array.prototype.find + find: createMethod(5), + // `Array.prototype.findIndex` method + // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex + findIndex: createMethod(6) +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/array-method-has-species-support.js": +/*!**********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/array-method-has-species-support.js ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var V8_VERSION = __webpack_require__(/*! ../internals/v8-version */ "../../node_modules/core-js/internals/v8-version.js"); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return V8_VERSION >= 51 || !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/array-reduce.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/array-reduce.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__(/*! ../internals/a-function */ "../../node_modules/core-js/internals/a-function.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "../../node_modules/core-js/internals/indexed-object.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); + +// `Array.prototype.{ reduce, reduceRight }` methods implementation +var createMethod = function (IS_RIGHT) { + return function (that, callbackfn, argumentsLength, memo) { + aFunction(callbackfn); + var O = toObject(that); + var self = IndexedObject(O); + var length = toLength(O.length); + var index = IS_RIGHT ? length - 1 : 0; + var i = IS_RIGHT ? -1 : 1; + if (argumentsLength < 2) while (true) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (IS_RIGHT ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; + }; +}; + +module.exports = { + // `Array.prototype.reduce` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduce + left: createMethod(false), + // `Array.prototype.reduceRight` method + // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright + right: createMethod(true) +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/array-species-create.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/array-species-create.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var isArray = __webpack_require__(/*! ../internals/is-array */ "../../node_modules/core-js/internals/is-array.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var SPECIES = wellKnownSymbol('species'); + +// `ArraySpeciesCreate` abstract operation +// https://tc39.github.io/ecma262/#sec-arrayspeciescreate +module.exports = function (originalArray, length) { + var C; + if (isArray(originalArray)) { + C = originalArray.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + else if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/bind-context.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/bind-context.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__(/*! ../internals/a-function */ "../../node_modules/core-js/internals/a-function.js"); + +// optional / simple context binding +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 0: return function () { + return fn.call(that); + }; + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/call-with-safe-iteration-closing.js": +/*!**********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/call-with-safe-iteration-closing.js ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); + +// call something on iterator step with safe closing on error +module.exports = function (iterator, fn, value, ENTRIES) { + try { + return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (error) { + var returnMethod = iterator['return']; + if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); + throw error; + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/check-correctness-of-iteration.js": +/*!********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/check-correctness-of-iteration.js ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var ITERATOR = wellKnownSymbol('iterator'); +var SAFE_CLOSING = false; + +try { + var called = 0; + var iteratorWithReturn = { + next: function () { + return { done: !!called++ }; + }, + 'return': function () { + SAFE_CLOSING = true; + } + }; + iteratorWithReturn[ITERATOR] = function () { + return this; + }; + // eslint-disable-next-line no-throw-literal + Array.from(iteratorWithReturn, function () { throw 2; }); +} catch (error) { /* empty */ } + +module.exports = function (exec, SKIP_CLOSING) { + if (!SKIP_CLOSING && !SAFE_CLOSING) return false; + var ITERATION_SUPPORT = false; + try { + var object = {}; + object[ITERATOR] = function () { + return { + next: function () { + return { done: ITERATION_SUPPORT = true }; + } + }; + }; + exec(object); + } catch (error) { /* empty */ } + return ITERATION_SUPPORT; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/classof-raw.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/classof-raw.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/classof.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/classof.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "../../node_modules/core-js/internals/to-string-tag-support.js"); +var classofRaw = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +// ES3 wrong here +var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (error) { /* empty */ } +}; + +// getting tag from ES6+ `Object.prototype.toString` +module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { + var O, tag, result; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag + // builtinTag case + : CORRECT_ARGUMENTS ? classofRaw(O) + // ES3 arguments fallback + : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/collection-strong.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/collection-strong.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f; +var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js"); +var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "../../node_modules/core-js/internals/redefine-all.js"); +var bind = __webpack_require__(/*! ../internals/bind-context */ "../../node_modules/core-js/internals/bind-context.js"); +var anInstance = __webpack_require__(/*! ../internals/an-instance */ "../../node_modules/core-js/internals/an-instance.js"); +var iterate = __webpack_require__(/*! ../internals/iterate */ "../../node_modules/core-js/internals/iterate.js"); +var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "../../node_modules/core-js/internals/define-iterator.js"); +var setSpecies = __webpack_require__(/*! ../internals/set-species */ "../../node_modules/core-js/internals/set-species.js"); +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var fastKey = __webpack_require__(/*! ../internals/internal-metadata */ "../../node_modules/core-js/internals/internal-metadata.js").fastKey; +var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js"); + +var setInternalState = InternalStateModule.set; +var internalStateGetterFor = InternalStateModule.getterFor; + +module.exports = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + index: create(null), + first: undefined, + last: undefined, + size: 0 + }); + if (!DESCRIPTORS) that.size = 0; + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + }); + + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + + var define = function (that, key, value) { + var state = getInternalState(that); + var entry = getEntry(that, key); + var previous, index; + // change existing entry + if (entry) { + entry.value = value; + // create new entry + } else { + state.last = entry = { + index: index = fastKey(key, true), + key: key, + value: value, + previous: previous = state.last, + next: undefined, + removed: false + }; + if (!state.first) state.first = entry; + if (previous) previous.next = entry; + if (DESCRIPTORS) state.size++; + else that.size++; + // add to index + if (index !== 'F') state.index[index] = entry; + } return that; + }; + + var getEntry = function (that, key) { + var state = getInternalState(that); + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return state.index[index]; + // frozen object case + for (entry = state.first; entry; entry = entry.next) { + if (entry.key == key) return entry; + } + }; + + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + var that = this; + var state = getInternalState(that); + var data = state.index; + var entry = state.first; + while (entry) { + entry.removed = true; + if (entry.previous) entry.previous = entry.previous.next = undefined; + delete data[entry.index]; + entry = entry.next; + } + state.first = state.last = undefined; + if (DESCRIPTORS) state.size = 0; + else that.size = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = this; + var state = getInternalState(that); + var entry = getEntry(that, key); + if (entry) { + var next = entry.next; + var prev = entry.previous; + delete state.index[entry.index]; + entry.removed = true; + if (prev) prev.next = next; + if (next) next.previous = prev; + if (state.first == entry) state.first = next; + if (state.last == entry) state.last = prev; + if (DESCRIPTORS) state.size--; + else that.size--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + var state = getInternalState(this); + var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.next : state.first) { + boundFunction(entry.value, entry.key, this); + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(this, key); + } + }); + + redefineAll(C.prototype, IS_MAP ? { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = getEntry(this, key); + return entry && entry.value; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return define(this, key === 0 ? 0 : key, value); + } + } : { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return define(this, value = value === 0 ? 0 : value, value); + } + }); + if (DESCRIPTORS) defineProperty(C.prototype, 'size', { + get: function () { + return getInternalState(this).size; + } + }); + return C; + }, + setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) { + var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; + var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); + var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) { + setInternalState(this, { + type: ITERATOR_NAME, + target: iterated, + state: getInternalCollectionState(iterated), + kind: kind, + last: undefined + }); + }, function () { + var state = getInternalIteratorState(this); + var kind = state.kind; + var entry = state.last; + // revert to the last existing entry + while (entry && entry.removed) entry = entry.previous; + // get next entry + if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { + // or finish the iteration + state.target = undefined; + return { value: undefined, done: true }; + } + // return step by kind + if (kind == 'keys') return { value: entry.key, done: false }; + if (kind == 'values') return { value: entry.value, done: false }; + return { value: [entry.key, entry.value], done: false }; + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(CONSTRUCTOR_NAME); + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/collection-weak.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/collection-weak.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "../../node_modules/core-js/internals/redefine-all.js"); +var getWeakData = __webpack_require__(/*! ../internals/internal-metadata */ "../../node_modules/core-js/internals/internal-metadata.js").getWeakData; +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var anInstance = __webpack_require__(/*! ../internals/an-instance */ "../../node_modules/core-js/internals/an-instance.js"); +var iterate = __webpack_require__(/*! ../internals/iterate */ "../../node_modules/core-js/internals/iterate.js"); +var ArrayIterationModule = __webpack_require__(/*! ../internals/array-iteration */ "../../node_modules/core-js/internals/array-iteration.js"); +var $has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js"); + +var setInternalState = InternalStateModule.set; +var internalStateGetterFor = InternalStateModule.getterFor; +var find = ArrayIterationModule.find; +var findIndex = ArrayIterationModule.findIndex; +var id = 0; + +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function (store) { + return store.frozen || (store.frozen = new UncaughtFrozenStore()); +}; + +var UncaughtFrozenStore = function () { + this.entries = []; +}; + +var findUncaughtFrozen = function (store, key) { + return find(store.entries, function (it) { + return it[0] === key; + }); +}; + +UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.entries.push([key, value]); + }, + 'delete': function (key) { + var index = findIndex(this.entries, function (it) { + return it[0] === key; + }); + if (~index) this.entries.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, CONSTRUCTOR_NAME); + setInternalState(that, { + type: CONSTRUCTOR_NAME, + id: id++, + frozen: undefined + }); + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + }); + + var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); + + var define = function (that, key, value) { + var state = getInternalState(that); + var data = getWeakData(anObject(key), true); + if (data === true) uncaughtFrozenStore(state).set(key, value); + else data[state.id] = value; + return that; + }; + + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + var state = getInternalState(this); + if (!isObject(key)) return false; + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state)['delete'](key); + return data && $has(data, state.id) && delete data[state.id]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + var state = getInternalState(this); + if (!isObject(key)) return false; + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state).has(key); + return data && $has(data, state.id); + } + }); + + redefineAll(C.prototype, IS_MAP ? { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + var state = getInternalState(this); + if (isObject(key)) { + var data = getWeakData(key); + if (data === true) return uncaughtFrozenStore(state).get(key); + return data ? data[state.id] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return define(this, key, value); + } + } : { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value) { + return define(this, value, true); + } + }); + + return C; + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/collection.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/collection.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var isForced = __webpack_require__(/*! ../internals/is-forced */ "../../node_modules/core-js/internals/is-forced.js"); +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var InternalMetadataModule = __webpack_require__(/*! ../internals/internal-metadata */ "../../node_modules/core-js/internals/internal-metadata.js"); +var iterate = __webpack_require__(/*! ../internals/iterate */ "../../node_modules/core-js/internals/iterate.js"); +var anInstance = __webpack_require__(/*! ../internals/an-instance */ "../../node_modules/core-js/internals/an-instance.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "../../node_modules/core-js/internals/check-correctness-of-iteration.js"); +var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js"); +var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "../../node_modules/core-js/internals/inherit-if-required.js"); + +module.exports = function (CONSTRUCTOR_NAME, wrapper, common) { + var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; + var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; + var ADDER = IS_MAP ? 'set' : 'add'; + var NativeConstructor = global[CONSTRUCTOR_NAME]; + var NativePrototype = NativeConstructor && NativeConstructor.prototype; + var Constructor = NativeConstructor; + var exported = {}; + + var fixMethod = function (KEY) { + var nativeMethod = NativePrototype[KEY]; + redefine(NativePrototype, KEY, + KEY == 'add' ? function add(value) { + nativeMethod.call(this, value === 0 ? 0 : value); + return this; + } : KEY == 'delete' ? function (key) { + return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); + } : KEY == 'get' ? function get(key) { + return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key); + } : KEY == 'has' ? function has(key) { + return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); + } : function set(key, value) { + nativeMethod.call(this, key === 0 ? 0 : key, value); + return this; + } + ); + }; + + // eslint-disable-next-line max-len + if (isForced(CONSTRUCTOR_NAME, typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () { + new NativeConstructor().entries().next(); + })))) { + // create collection constructor + Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); + InternalMetadataModule.REQUIRED = true; + } else if (isForced(CONSTRUCTOR_NAME, true)) { + var instance = new Constructor(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + // eslint-disable-next-line no-new + var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new NativeConstructor(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + + if (!ACCEPT_ITERABLES) { + Constructor = wrapper(function (dummy, iterable) { + anInstance(dummy, Constructor, CONSTRUCTOR_NAME); + var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); + if (iterable != undefined) iterate(iterable, that[ADDER], that, IS_MAP); + return that; + }); + Constructor.prototype = NativePrototype; + NativePrototype.constructor = Constructor; + } + + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + + // weak collections should not contains .clear method + if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; + } + + exported[CONSTRUCTOR_NAME] = Constructor; + $({ global: true, forced: Constructor != NativeConstructor }, exported); + + setToStringTag(Constructor, CONSTRUCTOR_NAME); + + if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); + + return Constructor; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/copy-constructor-properties.js": +/*!*****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/copy-constructor-properties.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var ownKeys = __webpack_require__(/*! ../internals/own-keys */ "../../node_modules/core-js/internals/own-keys.js"); +var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js"); +var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js"); + +module.exports = function (target, source) { + var keys = ownKeys(source); + var defineProperty = definePropertyModule.f; + var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/correct-is-regexp-logic.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/correct-is-regexp-logic.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var MATCH = wellKnownSymbol('match'); + +module.exports = function (METHOD_NAME) { + var regexp = /./; + try { + '/./'[METHOD_NAME](regexp); + } catch (e) { + try { + regexp[MATCH] = false; + return '/./'[METHOD_NAME](regexp); + } catch (f) { /* empty */ } + } return false; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/correct-prototype-getter.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/correct-prototype-getter.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); + +module.exports = !fails(function () { + function F() { /* empty */ } + F.prototype.constructor = null; + return Object.getPrototypeOf(new F()) !== F.prototype; +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/create-iterator-constructor.js": +/*!*****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/create-iterator-constructor.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var IteratorPrototype = __webpack_require__(/*! ../internals/iterators-core */ "../../node_modules/core-js/internals/iterators-core.js").IteratorPrototype; +var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js"); +var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "../../node_modules/core-js/internals/create-property-descriptor.js"); +var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js"); +var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js"); + +var returnThis = function () { return this; }; + +module.exports = function (IteratorConstructor, NAME, next) { + var TO_STRING_TAG = NAME + ' Iterator'; + IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); + setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); + Iterators[TO_STRING_TAG] = returnThis; + return IteratorConstructor; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/create-non-enumerable-property.js": +/*!********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/create-non-enumerable-property.js ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js"); +var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "../../node_modules/core-js/internals/create-property-descriptor.js"); + +module.exports = DESCRIPTORS ? function (object, key, value) { + return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/create-property-descriptor.js": +/*!****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/create-property-descriptor.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/create-property.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/create-property.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "../../node_modules/core-js/internals/to-primitive.js"); +var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js"); +var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "../../node_modules/core-js/internals/create-property-descriptor.js"); + +module.exports = function (object, key, value) { + var propertyKey = toPrimitive(key); + if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); + else object[propertyKey] = value; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/define-iterator.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/define-iterator.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var createIteratorConstructor = __webpack_require__(/*! ../internals/create-iterator-constructor */ "../../node_modules/core-js/internals/create-iterator-constructor.js"); +var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "../../node_modules/core-js/internals/object-get-prototype-of.js"); +var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "../../node_modules/core-js/internals/object-set-prototype-of.js"); +var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js"); +var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js"); +var IteratorsCore = __webpack_require__(/*! ../internals/iterators-core */ "../../node_modules/core-js/internals/iterators-core.js"); + +var IteratorPrototype = IteratorsCore.IteratorPrototype; +var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; +var ITERATOR = wellKnownSymbol('iterator'); +var KEYS = 'keys'; +var VALUES = 'values'; +var ENTRIES = 'entries'; + +var returnThis = function () { return this; }; + +module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { + createIteratorConstructor(IteratorConstructor, NAME, next); + + var getIterationMethod = function (KIND) { + if (KIND === DEFAULT && defaultIterator) return defaultIterator; + if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; + switch (KIND) { + case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; + case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; + case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; + } return function () { return new IteratorConstructor(this); }; + }; + + var TO_STRING_TAG = NAME + ' Iterator'; + var INCORRECT_VALUES_NAME = false; + var IterablePrototype = Iterable.prototype; + var nativeIterator = IterablePrototype[ITERATOR] + || IterablePrototype['@@iterator'] + || DEFAULT && IterablePrototype[DEFAULT]; + var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); + var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; + var CurrentIteratorPrototype, methods, KEY; + + // fix native + if (anyNativeIterator) { + CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); + if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { + if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { + if (setPrototypeOf) { + setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); + } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { + createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); + } + } + // Set @@toStringTag to native iterators + setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); + if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; + } + } + + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { + INCORRECT_VALUES_NAME = true; + defaultIterator = function values() { return nativeIterator.call(this); }; + } + + // define iterator + if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { + createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); + } + Iterators[NAME] = defaultIterator; + + // export additional methods + if (DEFAULT) { + methods = { + values: getIterationMethod(VALUES), + keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), + entries: getIterationMethod(ENTRIES) + }; + if (FORCED) for (KEY in methods) { + if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { + redefine(IterablePrototype, KEY, methods[KEY]); + } + } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); + } + + return methods; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/define-well-known-symbol.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/define-well-known-symbol.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(/*! ../internals/path */ "../../node_modules/core-js/internals/path.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var wrappedWellKnownSymbolModule = __webpack_require__(/*! ../internals/wrapped-well-known-symbol */ "../../node_modules/core-js/internals/wrapped-well-known-symbol.js"); +var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f; + +module.exports = function (NAME) { + var Symbol = path.Symbol || (path.Symbol = {}); + if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, { + value: wrappedWellKnownSymbolModule.f(NAME) + }); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/descriptors.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/descriptors.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); + +// Thank's IE8 for his funny defineProperty +module.exports = !fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/document-create-element.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/document-create-element.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); + +var document = global.document; +// typeof document.createElement is 'object' in old IE +var EXISTS = isObject(document) && isObject(document.createElement); + +module.exports = function (it) { + return EXISTS ? document.createElement(it) : {}; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/dom-iterables.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/dom-iterables.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// iterable DOM collections +// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods +module.exports = { + CSSRuleList: 0, + CSSStyleDeclaration: 0, + CSSValueList: 0, + ClientRectList: 0, + DOMRectList: 0, + DOMStringList: 0, + DOMTokenList: 1, + DataTransferItemList: 0, + FileList: 0, + HTMLAllCollection: 0, + HTMLCollection: 0, + HTMLFormElement: 0, + HTMLSelectElement: 0, + MediaList: 0, + MimeTypeArray: 0, + NamedNodeMap: 0, + NodeList: 1, + PaintRequestList: 0, + Plugin: 0, + PluginArray: 0, + SVGLengthList: 0, + SVGNumberList: 0, + SVGPathSegList: 0, + SVGPointList: 0, + SVGStringList: 0, + SVGTransformList: 0, + SourceBufferList: 0, + StyleSheetList: 0, + TextTrackCueList: 0, + TextTrackList: 0, + TouchList: 0 +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/enum-bug-keys.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/enum-bug-keys.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// IE8- don't enum bug keys +module.exports = [ + 'constructor', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'toLocaleString', + 'toString', + 'valueOf' +]; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/export.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/export.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js").f; +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var setGlobal = __webpack_require__(/*! ../internals/set-global */ "../../node_modules/core-js/internals/set-global.js"); +var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "../../node_modules/core-js/internals/copy-constructor-properties.js"); +var isForced = __webpack_require__(/*! ../internals/is-forced */ "../../node_modules/core-js/internals/is-forced.js"); + +/* + options.target - name of the target object + options.global - target is the global object + options.stat - export as static methods of target + options.proto - export as prototype methods of target + options.real - real prototype method for the `pure` version + options.forced - export even if the native feature is available + options.bind - bind methods to the target, required for the `pure` version + options.wrap - wrap constructors to preventing global pollution, required for the `pure` version + options.unsafe - use the simple assignment of property instead of delete + defineProperty + options.sham - add a flag to not completely full polyfills + options.enumerable - export as enumerable property + options.noTargetGet - prevent calling a getter on target +*/ +module.exports = function (options, source) { + var TARGET = options.target; + var GLOBAL = options.global; + var STATIC = options.stat; + var FORCED, target, key, targetProperty, sourceProperty, descriptor; + if (GLOBAL) { + target = global; + } else if (STATIC) { + target = global[TARGET] || setGlobal(TARGET, {}); + } else { + target = (global[TARGET] || {}).prototype; + } + if (target) for (key in source) { + sourceProperty = source[key]; + if (options.noTargetGet) { + descriptor = getOwnPropertyDescriptor(target, key); + targetProperty = descriptor && descriptor.value; + } else targetProperty = target[key]; + FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); + // contained in target + if (!FORCED && targetProperty !== undefined) { + if (typeof sourceProperty === typeof targetProperty) continue; + copyConstructorProperties(sourceProperty, targetProperty); + } + // add a flag to not completely full polyfills + if (options.sham || (targetProperty && targetProperty.sham)) { + createNonEnumerableProperty(sourceProperty, 'sham', true); + } + // extend global + redefine(target, key, sourceProperty, options); + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/fails.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/fails.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (error) { + return true; + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var regexpExec = __webpack_require__(/*! ../internals/regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js"); + +var SPECIES = wellKnownSymbol('species'); + +var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { + // #replace needs built-in support for named groups. + // #match works fine because it just return the exec results, even if it has + // a "grops" property. + var re = /./; + re.exec = function () { + var result = []; + result.groups = { a: '7' }; + return result; + }; + return ''.replace(re, '$<a>') !== '7'; +}); + +// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec +// Weex JS has frozen built-in prototypes, so use try / catch wrapper +var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { + var re = /(?:)/; + var originalExec = re.exec; + re.exec = function () { return originalExec.apply(this, arguments); }; + var result = 'ab'.split(re); + return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; +}); + +module.exports = function (KEY, length, exec, sham) { + var SYMBOL = wellKnownSymbol(KEY); + + var DELEGATES_TO_SYMBOL = !fails(function () { + // String methods call symbol-named RegEp methods + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + }); + + var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { + // Symbol-named RegExp methods call .exec + var execCalled = false; + var re = /a/; + + if (KEY === 'split') { + // We can't use real regex here since it causes deoptimization + // and serious performance degradation in V8 + // https://github.com/zloirock/core-js/issues/306 + re = {}; + // RegExp[@@split] doesn't call the regex's exec method, but first creates + // a new one. We need to return the patched regex when creating the new one. + re.constructor = {}; + re.constructor[SPECIES] = function () { return re; }; + re.flags = ''; + re[SYMBOL] = /./[SYMBOL]; + } + + re.exec = function () { execCalled = true; return null; }; + + re[SYMBOL](''); + return !execCalled; + }); + + if ( + !DELEGATES_TO_SYMBOL || + !DELEGATES_TO_EXEC || + (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || + (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) + ) { + var nativeRegExpMethod = /./[SYMBOL]; + var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { + if (regexp.exec === regexpExec) { + if (DELEGATES_TO_SYMBOL && !forceStringMethod) { + // The native String method already delegates to @@method (this + // polyfilled function), leasing to infinite recursion. + // We avoid it by directly calling the native @@method method. + return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; + } + return { done: true, value: nativeMethod.call(str, regexp, arg2) }; + } + return { done: false }; + }); + var stringMethod = methods[0]; + var regexMethod = methods[1]; + + redefine(String.prototype, KEY, stringMethod); + redefine(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return regexMethod.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return regexMethod.call(string, this); } + ); + if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true); + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/freezing.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/freezing.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); + +module.exports = !fails(function () { + return Object.isExtensible(Object.preventExtensions({})); +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/function-bind.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/function-bind.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var aFunction = __webpack_require__(/*! ../internals/a-function */ "../../node_modules/core-js/internals/a-function.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); + +var slice = [].slice; +var factories = {}; + +var construct = function (C, argsLength, args) { + if (!(argsLength in factories)) { + for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); + } return factories[argsLength](C, args); +}; + +// `Function.prototype.bind` method implementation +// https://tc39.github.io/ecma262/#sec-function.prototype.bind +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = slice.call(arguments, 1); + var boundFunction = function bound(/* args... */) { + var args = partArgs.concat(slice.call(arguments)); + return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); + }; + if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype; + return boundFunction; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/get-built-in.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/get-built-in.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var path = __webpack_require__(/*! ../internals/path */ "../../node_modules/core-js/internals/path.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); + +var aFunction = function (variable) { + return typeof variable == 'function' ? variable : undefined; +}; + +module.exports = function (namespace, method) { + return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) + : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/get-iterator-method.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/get-iterator-method.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(/*! ../internals/classof */ "../../node_modules/core-js/internals/classof.js"); +var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var ITERATOR = wellKnownSymbol('iterator'); + +module.exports = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/global.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/global.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) { + return it && it.Math == Math && it; +}; + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +module.exports = + // eslint-disable-next-line no-undef + check(typeof globalThis == 'object' && globalThis) || + check(typeof window == 'object' && window) || + check(typeof self == 'object' && self) || + check(typeof global == 'object' && global) || + // eslint-disable-next-line no-new-func + Function('return this')(); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/core-js/internals/has.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/has.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; + +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/hidden-keys.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/hidden-keys.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/host-report-errors.js": +/*!********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/host-report-errors.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); + +module.exports = function (a, b) { + var console = global.console; + if (console && console.error) { + arguments.length === 1 ? console.error(a) : console.error(a, b); + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/html.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/html.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js"); + +module.exports = getBuiltIn('document', 'documentElement'); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/ie8-dom-define.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/ie8-dom-define.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var createElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js"); + +// Thank's IE8 for his funny defineProperty +module.exports = !DESCRIPTORS && !fails(function () { + return Object.defineProperty(createElement('div'), 'a', { + get: function () { return 7; } + }).a != 7; +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/indexed-object.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/indexed-object.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); + +var split = ''.split; + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +module.exports = fails(function () { + // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 + // eslint-disable-next-line no-prototype-builtins + return !Object('z').propertyIsEnumerable(0); +}) ? function (it) { + return classof(it) == 'String' ? split.call(it, '') : Object(it); +} : Object; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/inherit-if-required.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/inherit-if-required.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "../../node_modules/core-js/internals/object-set-prototype-of.js"); + +// makes subclassing work correct for wrapped built-ins +module.exports = function ($this, dummy, Wrapper) { + var NewTarget, NewTargetPrototype; + if ( + // it can work only with native `setPrototypeOf` + setPrototypeOf && + // we haven't completely correct pre-ES6 way for getting `new.target`, so use this + typeof (NewTarget = dummy.constructor) == 'function' && + NewTarget !== Wrapper && + isObject(NewTargetPrototype = NewTarget.prototype) && + NewTargetPrototype !== Wrapper.prototype + ) setPrototypeOf($this, NewTargetPrototype); + return $this; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/inspect-source.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/inspect-source.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(/*! ../internals/shared */ "../../node_modules/core-js/internals/shared.js"); + +var functionToString = Function.toString; + +module.exports = shared('inspectSource', function (it) { + return functionToString.call(it); +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/internal-metadata.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/internal-metadata.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "../../node_modules/core-js/internals/hidden-keys.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f; +var uid = __webpack_require__(/*! ../internals/uid */ "../../node_modules/core-js/internals/uid.js"); +var FREEZING = __webpack_require__(/*! ../internals/freezing */ "../../node_modules/core-js/internals/freezing.js"); + +var METADATA = uid('meta'); +var id = 0; + +var isExtensible = Object.isExtensible || function () { + return true; +}; + +var setMetadata = function (it) { + defineProperty(it, METADATA, { value: { + objectID: 'O' + ++id, // object ID + weakData: {} // weak collections IDs + } }); +}; + +var fastKey = function (it, create) { + // return a primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMetadata(it); + // return object ID + } return it[METADATA].objectID; +}; + +var getWeakData = function (it, create) { + if (!has(it, METADATA)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMetadata(it); + // return the store of weak collections IDs + } return it[METADATA].weakData; +}; + +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it); + return it; +}; + +var meta = module.exports = { + REQUIRED: false, + fastKey: fastKey, + getWeakData: getWeakData, + onFreeze: onFreeze +}; + +hiddenKeys[METADATA] = true; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/internal-state.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/internal-state.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/native-weak-map */ "../../node_modules/core-js/internals/native-weak-map.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); +var objectHas = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "../../node_modules/core-js/internals/shared-key.js"); +var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "../../node_modules/core-js/internals/hidden-keys.js"); + +var WeakMap = global.WeakMap; +var set, get, has; + +var enforce = function (it) { + return has(it) ? get(it) : set(it, {}); +}; + +var getterFor = function (TYPE) { + return function (it) { + var state; + if (!isObject(it) || (state = get(it)).type !== TYPE) { + throw TypeError('Incompatible receiver, ' + TYPE + ' required'); + } return state; + }; +}; + +if (NATIVE_WEAK_MAP) { + var store = new WeakMap(); + var wmget = store.get; + var wmhas = store.has; + var wmset = store.set; + set = function (it, metadata) { + wmset.call(store, it, metadata); + return metadata; + }; + get = function (it) { + return wmget.call(store, it) || {}; + }; + has = function (it) { + return wmhas.call(store, it); + }; +} else { + var STATE = sharedKey('state'); + hiddenKeys[STATE] = true; + set = function (it, metadata) { + createNonEnumerableProperty(it, STATE, metadata); + return metadata; + }; + get = function (it) { + return objectHas(it, STATE) ? it[STATE] : {}; + }; + has = function (it) { + return objectHas(it, STATE); + }; +} + +module.exports = { + set: set, + get: get, + has: has, + enforce: enforce, + getterFor: getterFor +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/is-array-iterator-method.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/is-array-iterator-method.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js"); + +var ITERATOR = wellKnownSymbol('iterator'); +var ArrayPrototype = Array.prototype; + +// check on default Array iterator +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/is-array.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/is-array.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); + +// `IsArray` abstract operation +// https://tc39.github.io/ecma262/#sec-isarray +module.exports = Array.isArray || function isArray(arg) { + return classof(arg) == 'Array'; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/is-forced.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/is-forced.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); + +var replacement = /#|\.prototype\./; + +var isForced = function (feature, detection) { + var value = data[normalize(feature)]; + return value == POLYFILL ? true + : value == NATIVE ? false + : typeof detection == 'function' ? fails(detection) + : !!detection; +}; + +var normalize = isForced.normalize = function (string) { + return String(string).replace(replacement, '.').toLowerCase(); +}; + +var data = isForced.data = {}; +var NATIVE = isForced.NATIVE = 'N'; +var POLYFILL = isForced.POLYFILL = 'P'; + +module.exports = isForced; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/is-integer.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/is-integer.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); + +var floor = Math.floor; + +// `Number.isInteger` method implementation +// https://tc39.github.io/ecma262/#sec-number.isinteger +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/is-ios.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/is-ios.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var userAgent = __webpack_require__(/*! ../internals/user-agent */ "../../node_modules/core-js/internals/user-agent.js"); + +module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/is-object.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/is-object.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/is-pure.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/is-pure.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = false; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/is-regexp.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/is-regexp.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var MATCH = wellKnownSymbol('match'); + +// `IsRegExp` abstract operation +// https://tc39.github.io/ecma262/#sec-isregexp +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/iterate.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/iterate.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var isArrayIteratorMethod = __webpack_require__(/*! ../internals/is-array-iterator-method */ "../../node_modules/core-js/internals/is-array-iterator-method.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); +var bind = __webpack_require__(/*! ../internals/bind-context */ "../../node_modules/core-js/internals/bind-context.js"); +var getIteratorMethod = __webpack_require__(/*! ../internals/get-iterator-method */ "../../node_modules/core-js/internals/get-iterator-method.js"); +var callWithSafeIterationClosing = __webpack_require__(/*! ../internals/call-with-safe-iteration-closing */ "../../node_modules/core-js/internals/call-with-safe-iteration-closing.js"); + +var Result = function (stopped, result) { + this.stopped = stopped; + this.result = result; +}; + +var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) { + var boundFunction = bind(fn, that, AS_ENTRIES ? 2 : 1); + var iterator, iterFn, index, length, result, next, step; + + if (IS_ITERATOR) { + iterator = iterable; + } else { + iterFn = getIteratorMethod(iterable); + if (typeof iterFn != 'function') throw TypeError('Target is not iterable'); + // optimisation for array iterators + if (isArrayIteratorMethod(iterFn)) { + for (index = 0, length = toLength(iterable.length); length > index; index++) { + result = AS_ENTRIES + ? boundFunction(anObject(step = iterable[index])[0], step[1]) + : boundFunction(iterable[index]); + if (result && result instanceof Result) return result; + } return new Result(false); + } + iterator = iterFn.call(iterable); + } + + next = iterator.next; + while (!(step = next.call(iterator)).done) { + result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES); + if (typeof result == 'object' && result && result instanceof Result) return result; + } return new Result(false); +}; + +iterate.stop = function (result) { + return new Result(true, result); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/iterators-core.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/iterators-core.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var getPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "../../node_modules/core-js/internals/object-get-prototype-of.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js"); + +var ITERATOR = wellKnownSymbol('iterator'); +var BUGGY_SAFARI_ITERATORS = false; + +var returnThis = function () { return this; }; + +// `%IteratorPrototype%` object +// https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object +var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; + +if ([].keys) { + arrayIterator = [].keys(); + // Safari 8 has buggy iterators w/o `next` + if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; + else { + PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); + if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; + } +} + +if (IteratorPrototype == undefined) IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) { + createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis); +} + +module.exports = { + IteratorPrototype: IteratorPrototype, + BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/iterators.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/iterators.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/microtask.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/microtask.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js").f; +var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); +var macrotask = __webpack_require__(/*! ../internals/task */ "../../node_modules/core-js/internals/task.js").set; +var IS_IOS = __webpack_require__(/*! ../internals/is-ios */ "../../node_modules/core-js/internals/is-ios.js"); + +var MutationObserver = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var IS_NODE = classof(process) == 'process'; +// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask` +var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask'); +var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value; + +var flush, head, last, notify, toggle, node, promise, then; + +// modern engines have queueMicrotask method +if (!queueMicrotask) { + flush = function () { + var parent, fn; + if (IS_NODE && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (error) { + if (head) notify(); + else last = undefined; + throw error; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (IS_NODE) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339 + } else if (MutationObserver && !IS_IOS) { + toggle = true; + node = document.createTextNode(''); + new MutationObserver(flush).observe(node, { characterData: true }); + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + promise = Promise.resolve(undefined); + then = promise.then; + notify = function () { + then.call(promise, flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } +} + +module.exports = queueMicrotask || function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/native-promise-constructor.js": +/*!****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/native-promise-constructor.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); + +module.exports = global.Promise; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/native-symbol.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/native-symbol.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); + +module.exports = !!Object.getOwnPropertySymbols && !fails(function () { + // Chrome 38 Symbol has incorrect toString conversion + // eslint-disable-next-line no-undef + return !String(Symbol()); +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/native-weak-map.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/native-weak-map.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "../../node_modules/core-js/internals/inspect-source.js"); + +var WeakMap = global.WeakMap; + +module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/new-promise-capability.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/new-promise-capability.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var aFunction = __webpack_require__(/*! ../internals/a-function */ "../../node_modules/core-js/internals/a-function.js"); + +var PromiseCapability = function (C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +}; + +// 25.4.1.5 NewPromiseCapability(C) +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/not-a-regexp.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/not-a-regexp.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "../../node_modules/core-js/internals/is-regexp.js"); + +module.exports = function (it) { + if (isRegExp(it)) { + throw TypeError("The method doesn't accept regular expressions"); + } return it; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-assign.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-assign.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "../../node_modules/core-js/internals/object-keys.js"); +var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "../../node_modules/core-js/internals/object-get-own-property-symbols.js"); +var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "../../node_modules/core-js/internals/object-property-is-enumerable.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "../../node_modules/core-js/internals/indexed-object.js"); + +var nativeAssign = Object.assign; +var defineProperty = Object.defineProperty; + +// `Object.assign` method +// https://tc39.github.io/ecma262/#sec-object.assign +module.exports = !nativeAssign || fails(function () { + // should have correct order of operations (Edge bug) + if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', { + enumerable: true, + get: function () { + defineProperty(this, 'b', { + value: 3, + enumerable: false + }); + } + }), { b: 2 })).b !== 1) return true; + // should work with symbols and should have deterministic property order (V8 bug) + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var symbol = Symbol(); + var alphabet = 'abcdefghijklmnopqrst'; + A[symbol] = 7; + alphabet.split('').forEach(function (chr) { B[chr] = chr; }); + return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = toObject(target); + var argumentsLength = arguments.length; + var index = 1; + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + var propertyIsEnumerable = propertyIsEnumerableModule.f; + while (argumentsLength > index) { + var S = IndexedObject(arguments[index++]); + var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) { + key = keys[j++]; + if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; + } + } return T; +} : nativeAssign; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-create.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-create.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var defineProperties = __webpack_require__(/*! ../internals/object-define-properties */ "../../node_modules/core-js/internals/object-define-properties.js"); +var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "../../node_modules/core-js/internals/enum-bug-keys.js"); +var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "../../node_modules/core-js/internals/hidden-keys.js"); +var html = __webpack_require__(/*! ../internals/html */ "../../node_modules/core-js/internals/html.js"); +var documentCreateElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js"); +var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "../../node_modules/core-js/internals/shared-key.js"); +var IE_PROTO = sharedKey('IE_PROTO'); + +var PROTOTYPE = 'prototype'; +var Empty = function () { /* empty */ }; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = documentCreateElement('iframe'); + var length = enumBugKeys.length; + var lt = '<'; + var script = 'script'; + var gt = '>'; + var js = 'java' + script + ':'; + var iframeDocument; + iframe.style.display = 'none'; + html.appendChild(iframe); + iframe.src = String(js); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]]; + return createDict(); +}; + +// `Object.create` method +// https://tc39.github.io/ecma262/#sec-object.create +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : defineProperties(result, Properties); +}; + +hiddenKeys[IE_PROTO] = true; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-define-properties.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-define-properties.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js"); +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "../../node_modules/core-js/internals/object-keys.js"); + +// `Object.defineProperties` method +// https://tc39.github.io/ecma262/#sec-object.defineproperties +module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = objectKeys(Properties); + var length = keys.length; + var index = 0; + var key; + while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); + return O; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-define-property.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-define-property.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "../../node_modules/core-js/internals/ie8-dom-define.js"); +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "../../node_modules/core-js/internals/to-primitive.js"); + +var nativeDefineProperty = Object.defineProperty; + +// `Object.defineProperty` method +// https://tc39.github.io/ecma262/#sec-object.defineproperty +exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return nativeDefineProperty(O, P, Attributes); + } catch (error) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-get-own-property-descriptor.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "../../node_modules/core-js/internals/object-property-is-enumerable.js"); +var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "../../node_modules/core-js/internals/create-property-descriptor.js"); +var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js"); +var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "../../node_modules/core-js/internals/to-primitive.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ "../../node_modules/core-js/internals/ie8-dom-define.js"); + +var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// `Object.getOwnPropertyDescriptor` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor +exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { + O = toIndexedObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return nativeGetOwnPropertyDescriptor(O, P); + } catch (error) { /* empty */ } + if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-get-own-property-names-external.js": +/*!****************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-get-own-property-names-external.js ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js"); +var nativeGetOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "../../node_modules/core-js/internals/object-get-own-property-names.js").f; + +var toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function (it) { + try { + return nativeGetOwnPropertyNames(it); + } catch (error) { + return windowNames.slice(); + } +}; + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' + ? getWindowNames(it) + : nativeGetOwnPropertyNames(toIndexedObject(it)); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-get-own-property-names.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-get-own-property-names.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "../../node_modules/core-js/internals/object-keys-internal.js"); +var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "../../node_modules/core-js/internals/enum-bug-keys.js"); + +var hiddenKeys = enumBugKeys.concat('length', 'prototype'); + +// `Object.getOwnPropertyNames` method +// https://tc39.github.io/ecma262/#sec-object.getownpropertynames +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return internalObjectKeys(O, hiddenKeys); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-get-own-property-symbols.js": +/*!*********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-get-own-property-symbols.js ***! + \*********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-get-prototype-of.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-get-prototype-of.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "../../node_modules/core-js/internals/shared-key.js"); +var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "../../node_modules/core-js/internals/correct-prototype-getter.js"); + +var IE_PROTO = sharedKey('IE_PROTO'); +var ObjectPrototype = Object.prototype; + +// `Object.getPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.getprototypeof +module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectPrototype : null; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-keys-internal.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-keys-internal.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js"); +var indexOf = __webpack_require__(/*! ../internals/array-includes */ "../../node_modules/core-js/internals/array-includes.js").indexOf; +var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "../../node_modules/core-js/internals/hidden-keys.js"); + +module.exports = function (object, names) { + var O = toIndexedObject(object); + var i = 0; + var result = []; + var key; + for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~indexOf(result, key) || result.push(key); + } + return result; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-keys.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-keys.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var internalObjectKeys = __webpack_require__(/*! ../internals/object-keys-internal */ "../../node_modules/core-js/internals/object-keys-internal.js"); +var enumBugKeys = __webpack_require__(/*! ../internals/enum-bug-keys */ "../../node_modules/core-js/internals/enum-bug-keys.js"); + +// `Object.keys` method +// https://tc39.github.io/ecma262/#sec-object.keys +module.exports = Object.keys || function keys(O) { + return internalObjectKeys(O, enumBugKeys); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-property-is-enumerable.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-property-is-enumerable.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var nativePropertyIsEnumerable = {}.propertyIsEnumerable; +var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + +// Nashorn ~ JDK8 bug +var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); + +// `Object.prototype.propertyIsEnumerable` method implementation +// https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable +exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { + var descriptor = getOwnPropertyDescriptor(this, V); + return !!descriptor && descriptor.enumerable; +} : nativePropertyIsEnumerable; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-set-prototype-of.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-set-prototype-of.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var aPossiblePrototype = __webpack_require__(/*! ../internals/a-possible-prototype */ "../../node_modules/core-js/internals/a-possible-prototype.js"); + +// `Object.setPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.setprototypeof +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { + var CORRECT_SETTER = false; + var test = {}; + var setter; + try { + setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; + setter.call(test, []); + CORRECT_SETTER = test instanceof Array; + } catch (error) { /* empty */ } + return function setPrototypeOf(O, proto) { + anObject(O); + aPossiblePrototype(proto); + if (CORRECT_SETTER) setter.call(O, proto); + else O.__proto__ = proto; + return O; + }; +}() : undefined); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-to-array.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-to-array.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "../../node_modules/core-js/internals/object-keys.js"); +var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js"); +var propertyIsEnumerable = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "../../node_modules/core-js/internals/object-property-is-enumerable.js").f; + +// `Object.{ entries, values }` methods implementation +var createMethod = function (TO_ENTRIES) { + return function (it) { + var O = toIndexedObject(it); + var keys = objectKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) { + key = keys[i++]; + if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) { + result.push(TO_ENTRIES ? [key, O[key]] : O[key]); + } + } + return result; + }; +}; + +module.exports = { + // `Object.entries` method + // https://tc39.github.io/ecma262/#sec-object.entries + entries: createMethod(true), + // `Object.values` method + // https://tc39.github.io/ecma262/#sec-object.values + values: createMethod(false) +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/object-to-string.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/object-to-string.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "../../node_modules/core-js/internals/to-string-tag-support.js"); +var classof = __webpack_require__(/*! ../internals/classof */ "../../node_modules/core-js/internals/classof.js"); + +// `Object.prototype.toString` method implementation +// https://tc39.github.io/ecma262/#sec-object.prototype.tostring +module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { + return '[object ' + classof(this) + ']'; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/own-keys.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/own-keys.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js"); +var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "../../node_modules/core-js/internals/object-get-own-property-names.js"); +var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "../../node_modules/core-js/internals/object-get-own-property-symbols.js"); +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); + +// all object keys, includes non-enumerable and symbols +module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { + var keys = getOwnPropertyNamesModule.f(anObject(it)); + var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; + return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/path.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/path.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); + +module.exports = global; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/perform.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/perform.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { error: false, value: exec() }; + } catch (error) { + return { error: true, value: error }; + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/promise-resolve.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/promise-resolve.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var newPromiseCapability = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js"); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/redefine-all.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/redefine-all.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); + +module.exports = function (target, src, options) { + for (var key in src) redefine(target, key, src[key], options); + return target; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/redefine.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/redefine.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var setGlobal = __webpack_require__(/*! ../internals/set-global */ "../../node_modules/core-js/internals/set-global.js"); +var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "../../node_modules/core-js/internals/inspect-source.js"); +var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js"); + +var getInternalState = InternalStateModule.get; +var enforceInternalState = InternalStateModule.enforce; +var TEMPLATE = String(String).split('String'); + +(module.exports = function (O, key, value, options) { + var unsafe = options ? !!options.unsafe : false; + var simple = options ? !!options.enumerable : false; + var noTargetGet = options ? !!options.noTargetGet : false; + if (typeof value == 'function') { + if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key); + enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); + } + if (O === global) { + if (simple) O[key] = value; + else setGlobal(key, value); + return; + } else if (!unsafe) { + delete O[key]; + } else if (!noTargetGet && O[key]) { + simple = true; + } + if (simple) O[key] = value; + else createNonEnumerableProperty(O, key, value); +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, 'toString', function toString() { + return typeof this == 'function' && getInternalState(this).source || inspectSource(this); +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/regexp-exec-abstract.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/regexp-exec-abstract.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(/*! ./classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); +var regexpExec = __webpack_require__(/*! ./regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js"); + +// `RegExpExec` abstract operation +// https://tc39.github.io/ecma262/#sec-regexpexec +module.exports = function (R, S) { + var exec = R.exec; + if (typeof exec === 'function') { + var result = exec.call(R, S); + if (typeof result !== 'object') { + throw TypeError('RegExp exec method returned something other than an Object or null'); + } + return result; + } + + if (classof(R) !== 'RegExp') { + throw TypeError('RegExp#exec called on incompatible receiver'); + } + + return regexpExec.call(R, S); +}; + + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/regexp-exec.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/regexp-exec.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var regexpFlags = __webpack_require__(/*! ./regexp-flags */ "../../node_modules/core-js/internals/regexp-flags.js"); + +var nativeExec = RegExp.prototype.exec; +// This always refers to the native implementation, because the +// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, +// which loads this file before patching the method. +var nativeReplace = String.prototype.replace; + +var patchedExec = nativeExec; + +var UPDATES_LAST_INDEX_WRONG = (function () { + var re1 = /a/; + var re2 = /b*/g; + nativeExec.call(re1, 'a'); + nativeExec.call(re2, 'a'); + return re1.lastIndex !== 0 || re2.lastIndex !== 0; +})(); + +// nonparticipating capturing group, copied from es5-shim's String#split patch. +var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; + +var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; + +if (PATCH) { + patchedExec = function exec(str) { + var re = this; + var lastIndex, reCopy, match, i; + + if (NPCG_INCLUDED) { + reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); + } + if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; + + match = nativeExec.call(re, str); + + if (UPDATES_LAST_INDEX_WRONG && match) { + re.lastIndex = re.global ? match.index + match[0].length : lastIndex; + } + if (NPCG_INCLUDED && match && match.length > 1) { + // Fix browsers whose `exec` methods don't consistently return `undefined` + // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ + nativeReplace.call(match[0], reCopy, function () { + for (i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undefined) match[i] = undefined; + } + }); + } + + return match; + }; +} + +module.exports = patchedExec; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/regexp-flags.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/regexp-flags.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); + +// `RegExp.prototype.flags` getter implementation +// https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.dotAll) result += 's'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/require-object-coercible.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/require-object-coercible.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// `RequireObjectCoercible` abstract operation +// https://tc39.github.io/ecma262/#sec-requireobjectcoercible +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/same-value.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/same-value.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// `SameValue` abstract operation +// https://tc39.github.io/ecma262/#sec-samevalue +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/set-global.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/set-global.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); + +module.exports = function (key, value) { + try { + createNonEnumerableProperty(global, key, value); + } catch (error) { + global[key] = value; + } return value; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/set-species.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/set-species.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js"); +var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (CONSTRUCTOR_NAME) { + var Constructor = getBuiltIn(CONSTRUCTOR_NAME); + var defineProperty = definePropertyModule.f; + + if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { + defineProperty(Constructor, SPECIES, { + configurable: true, + get: function () { return this; } + }); + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/set-to-string-tag.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/set-to-string-tag.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f; +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); + +module.exports = function (it, TAG, STATIC) { + if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { + defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); + } +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/shared-key.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/shared-key.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(/*! ../internals/shared */ "../../node_modules/core-js/internals/shared.js"); +var uid = __webpack_require__(/*! ../internals/uid */ "../../node_modules/core-js/internals/uid.js"); + +var keys = shared('keys'); + +module.exports = function (key) { + return keys[key] || (keys[key] = uid(key)); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/shared-store.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/shared-store.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var setGlobal = __webpack_require__(/*! ../internals/set-global */ "../../node_modules/core-js/internals/set-global.js"); + +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || setGlobal(SHARED, {}); + +module.exports = store; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/shared.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/shared.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js"); +var store = __webpack_require__(/*! ../internals/shared-store */ "../../node_modules/core-js/internals/shared-store.js"); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: '3.4.7', + mode: IS_PURE ? 'pure' : 'global', + copyright: '© 2019 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/sloppy-array-method.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/sloppy-array-method.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); + +module.exports = function (METHOD_NAME, argument) { + var method = [][METHOD_NAME]; + return !method || !fails(function () { + // eslint-disable-next-line no-useless-call,no-throw-literal + method.call(null, argument || function () { throw 1; }, 1); + }); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/species-constructor.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/species-constructor.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var aFunction = __webpack_require__(/*! ../internals/a-function */ "../../node_modules/core-js/internals/a-function.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var SPECIES = wellKnownSymbol('species'); + +// `SpeciesConstructor` abstract operation +// https://tc39.github.io/ecma262/#sec-speciesconstructor +module.exports = function (O, defaultConstructor) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/string-multibyte.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/string-multibyte.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ../internals/to-integer */ "../../node_modules/core-js/internals/to-integer.js"); +var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js"); + +// `String.prototype.{ codePointAt, at }` methods implementation +var createMethod = function (CONVERT_TO_STRING) { + return function ($this, pos) { + var S = String(requireObjectCoercible($this)); + var position = toInteger(pos); + var size = S.length; + var first, second; + if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; + first = S.charCodeAt(position); + return first < 0xD800 || first > 0xDBFF || position + 1 === size + || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF + ? CONVERT_TO_STRING ? S.charAt(position) : first + : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; + }; +}; + +module.exports = { + // `String.prototype.codePointAt` method + // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat + codeAt: createMethod(false), + // `String.prototype.at` method + // https://github.com/mathiasbynens/String.prototype.at + charAt: createMethod(true) +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/string-trim.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/string-trim.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js"); +var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "../../node_modules/core-js/internals/whitespaces.js"); + +var whitespace = '[' + whitespaces + ']'; +var ltrim = RegExp('^' + whitespace + whitespace + '*'); +var rtrim = RegExp(whitespace + whitespace + '*$'); + +// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation +var createMethod = function (TYPE) { + return function ($this) { + var string = String(requireObjectCoercible($this)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; + }; +}; + +module.exports = { + // `String.prototype.{ trimLeft, trimStart }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart + start: createMethod(1), + // `String.prototype.{ trimRight, trimEnd }` methods + // https://tc39.github.io/ecma262/#sec-string.prototype.trimend + end: createMethod(2), + // `String.prototype.trim` method + // https://tc39.github.io/ecma262/#sec-string.prototype.trim + trim: createMethod(3) +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/task.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/task.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); +var bind = __webpack_require__(/*! ../internals/bind-context */ "../../node_modules/core-js/internals/bind-context.js"); +var html = __webpack_require__(/*! ../internals/html */ "../../node_modules/core-js/internals/html.js"); +var createElement = __webpack_require__(/*! ../internals/document-create-element */ "../../node_modules/core-js/internals/document-create-element.js"); +var IS_IOS = __webpack_require__(/*! ../internals/is-ios */ "../../node_modules/core-js/internals/is-ios.js"); + +var location = global.location; +var set = global.setImmediate; +var clear = global.clearImmediate; +var process = global.process; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; + +var run = function (id) { + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; + +var runner = function (id) { + return function () { + run(id); + }; +}; + +var listener = function (event) { + run(event.data); +}; + +var post = function (id) { + // old engines have not location.origin + global.postMessage(id + '', location.protocol + '//' + location.host); +}; + +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!set || !clear) { + set = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args); + }; + defer(counter); + return counter; + }; + clear = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (classof(process) == 'process') { + defer = function (id) { + process.nextTick(runner(id)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(runner(id)); + }; + // Browsers with MessageChannel, includes WebWorkers + // except iOS - https://github.com/zloirock/core-js/issues/624 + } else if (MessageChannel && !IS_IOS) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = bind(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts && !fails(post)) { + defer = post; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in createElement('script')) { + defer = function (id) { + html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(runner(id), 0); + }; + } +} + +module.exports = { + set: set, + clear: clear +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/to-absolute-index.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/to-absolute-index.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ../internals/to-integer */ "../../node_modules/core-js/internals/to-integer.js"); + +var max = Math.max; +var min = Math.min; + +// Helper for a popular repeating case of the spec: +// Let integer be ? ToInteger(index). +// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). +module.exports = function (index, length) { + var integer = toInteger(index); + return integer < 0 ? max(integer + length, 0) : min(integer, length); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/to-indexed-object.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/to-indexed-object.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// toObject with fallback for non-array-like ES3 strings +var IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ "../../node_modules/core-js/internals/indexed-object.js"); +var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js"); + +module.exports = function (it) { + return IndexedObject(requireObjectCoercible(it)); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/to-integer.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/to-integer.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var ceil = Math.ceil; +var floor = Math.floor; + +// `ToInteger` abstract operation +// https://tc39.github.io/ecma262/#sec-tointeger +module.exports = function (argument) { + return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/to-length.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/to-length.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ../internals/to-integer */ "../../node_modules/core-js/internals/to-integer.js"); + +var min = Math.min; + +// `ToLength` abstract operation +// https://tc39.github.io/ecma262/#sec-tolength +module.exports = function (argument) { + return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/to-object.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/to-object.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js"); + +// `ToObject` abstract operation +// https://tc39.github.io/ecma262/#sec-toobject +module.exports = function (argument) { + return Object(requireObjectCoercible(argument)); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/to-primitive.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/to-primitive.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); + +// `ToPrimitive` abstract operation +// https://tc39.github.io/ecma262/#sec-toprimitive +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (input, PREFERRED_STRING) { + if (!isObject(input)) return input; + var fn, val; + if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; + if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/to-string-tag-support.js": +/*!***********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/to-string-tag-support.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var test = {}; + +test[TO_STRING_TAG] = 'z'; + +module.exports = String(test) === '[object z]'; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/uid.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/uid.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var id = 0; +var postfix = Math.random(); + +module.exports = function (key) { + return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/use-symbol-as-uid.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/use-symbol-as-uid.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "../../node_modules/core-js/internals/native-symbol.js"); + +module.exports = NATIVE_SYMBOL + // eslint-disable-next-line no-undef + && !Symbol.sham + // eslint-disable-next-line no-undef + && typeof Symbol() == 'symbol'; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/user-agent.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/user-agent.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js"); + +module.exports = getBuiltIn('navigator', 'userAgent') || ''; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/v8-version.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/v8-version.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var userAgent = __webpack_require__(/*! ../internals/user-agent */ "../../node_modules/core-js/internals/user-agent.js"); + +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8; +var match, version; + +if (v8) { + match = v8.split('.'); + version = match[0] + match[1]; +} else if (userAgent) { + match = userAgent.match(/Edge\/(\d+)/); + if (!match || match[1] >= 74) { + match = userAgent.match(/Chrome\/(\d+)/); + if (match) version = match[1]; + } +} + +module.exports = version && +version; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/well-known-symbol.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/well-known-symbol.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var shared = __webpack_require__(/*! ../internals/shared */ "../../node_modules/core-js/internals/shared.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var uid = __webpack_require__(/*! ../internals/uid */ "../../node_modules/core-js/internals/uid.js"); +var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "../../node_modules/core-js/internals/native-symbol.js"); +var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "../../node_modules/core-js/internals/use-symbol-as-uid.js"); + +var WellKnownSymbolsStore = shared('wks'); +var Symbol = global.Symbol; +var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : uid; + +module.exports = function (name) { + if (!has(WellKnownSymbolsStore, name)) { + if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name]; + else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); + } return WellKnownSymbolsStore[name]; +}; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/whitespaces.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/whitespaces.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// a string of all valid unicode whitespaces +// eslint-disable-next-line max-len +module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), + +/***/ "../../node_modules/core-js/internals/wrapped-well-known-symbol.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/internals/wrapped-well-known-symbol.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +exports.f = wellKnownSymbol; + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.concat.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.concat.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var isArray = __webpack_require__(/*! ../internals/is-array */ "../../node_modules/core-js/internals/is-array.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); +var createProperty = __webpack_require__(/*! ../internals/create-property */ "../../node_modules/core-js/internals/create-property.js"); +var arraySpeciesCreate = __webpack_require__(/*! ../internals/array-species-create */ "../../node_modules/core-js/internals/array-species-create.js"); +var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "../../node_modules/core-js/internals/array-method-has-species-support.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var V8_VERSION = __webpack_require__(/*! ../internals/v8-version */ "../../node_modules/core-js/internals/v8-version.js"); + +var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable'); +var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; +var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded'; + +// We can't use this feature detection in V8 since it causes +// deoptimization and serious performance degradation +// https://github.com/zloirock/core-js/issues/679 +var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () { + var array = []; + array[IS_CONCAT_SPREADABLE] = false; + return array.concat()[0] !== array; +}); + +var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat'); + +var isConcatSpreadable = function (O) { + if (!isObject(O)) return false; + var spreadable = O[IS_CONCAT_SPREADABLE]; + return spreadable !== undefined ? !!spreadable : isArray(O); +}; + +var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; + +// `Array.prototype.concat` method +// https://tc39.github.io/ecma262/#sec-array.prototype.concat +// with adding support of @@isConcatSpreadable and @@species +$({ target: 'Array', proto: true, forced: FORCED }, { + concat: function concat(arg) { // eslint-disable-line no-unused-vars + var O = toObject(this); + var A = arraySpeciesCreate(O, 0); + var n = 0; + var i, k, length, len, E; + for (i = -1, length = arguments.length; i < length; i++) { + E = i === -1 ? O : arguments[i]; + if (isConcatSpreadable(E)) { + len = toLength(E.length); + if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]); + } else { + if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED); + createProperty(A, n++, E); + } + } + A.length = n; + return A; + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.every.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.every.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $every = __webpack_require__(/*! ../internals/array-iteration */ "../../node_modules/core-js/internals/array-iteration.js").every; +var sloppyArrayMethod = __webpack_require__(/*! ../internals/sloppy-array-method */ "../../node_modules/core-js/internals/sloppy-array-method.js"); + +// `Array.prototype.every` method +// https://tc39.github.io/ecma262/#sec-array.prototype.every +$({ target: 'Array', proto: true, forced: sloppyArrayMethod('every') }, { + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.filter.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.filter.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $filter = __webpack_require__(/*! ../internals/array-iteration */ "../../node_modules/core-js/internals/array-iteration.js").filter; +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "../../node_modules/core-js/internals/array-method-has-species-support.js"); + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter'); +// Edge 14- issue +var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () { + [].filter.call({ length: -1, 0: 1 }, function (it) { throw it; }); +}); + +// `Array.prototype.filter` method +// https://tc39.github.io/ecma262/#sec-array.prototype.filter +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, { + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.find.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.find.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $find = __webpack_require__(/*! ../internals/array-iteration */ "../../node_modules/core-js/internals/array-iteration.js").find; +var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "../../node_modules/core-js/internals/add-to-unscopables.js"); + +var FIND = 'find'; +var SKIPS_HOLES = true; + +// Shouldn't skip holes +if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; }); + +// `Array.prototype.find` method +// https://tc39.github.io/ecma262/#sec-array.prototype.find +$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables(FIND); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.for-each.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.for-each.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var forEach = __webpack_require__(/*! ../internals/array-for-each */ "../../node_modules/core-js/internals/array-for-each.js"); + +// `Array.prototype.forEach` method +// https://tc39.github.io/ecma262/#sec-array.prototype.foreach +$({ target: 'Array', proto: true, forced: [].forEach != forEach }, { + forEach: forEach +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.from.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.from.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var from = __webpack_require__(/*! ../internals/array-from */ "../../node_modules/core-js/internals/array-from.js"); +var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "../../node_modules/core-js/internals/check-correctness-of-iteration.js"); + +var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) { + Array.from(iterable); +}); + +// `Array.from` method +// https://tc39.github.io/ecma262/#sec-array.from +$({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, { + from: from +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.includes.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.includes.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $includes = __webpack_require__(/*! ../internals/array-includes */ "../../node_modules/core-js/internals/array-includes.js").includes; +var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "../../node_modules/core-js/internals/add-to-unscopables.js"); + +// `Array.prototype.includes` method +// https://tc39.github.io/ecma262/#sec-array.prototype.includes +$({ target: 'Array', proto: true }, { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('includes'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.index-of.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.index-of.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $indexOf = __webpack_require__(/*! ../internals/array-includes */ "../../node_modules/core-js/internals/array-includes.js").indexOf; +var sloppyArrayMethod = __webpack_require__(/*! ../internals/sloppy-array-method */ "../../node_modules/core-js/internals/sloppy-array-method.js"); + +var nativeIndexOf = [].indexOf; + +var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; +var SLOPPY_METHOD = sloppyArrayMethod('indexOf'); + +// `Array.prototype.indexOf` method +// https://tc39.github.io/ecma262/#sec-array.prototype.indexof +$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, { + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? nativeIndexOf.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.is-array.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.is-array.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var isArray = __webpack_require__(/*! ../internals/is-array */ "../../node_modules/core-js/internals/is-array.js"); + +// `Array.isArray` method +// https://tc39.github.io/ecma262/#sec-array.isarray +$({ target: 'Array', stat: true }, { + isArray: isArray +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.iterator.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.iterator.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js"); +var addToUnscopables = __webpack_require__(/*! ../internals/add-to-unscopables */ "../../node_modules/core-js/internals/add-to-unscopables.js"); +var Iterators = __webpack_require__(/*! ../internals/iterators */ "../../node_modules/core-js/internals/iterators.js"); +var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js"); +var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "../../node_modules/core-js/internals/define-iterator.js"); + +var ARRAY_ITERATOR = 'Array Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); + +// `Array.prototype.entries` method +// https://tc39.github.io/ecma262/#sec-array.prototype.entries +// `Array.prototype.keys` method +// https://tc39.github.io/ecma262/#sec-array.prototype.keys +// `Array.prototype.values` method +// https://tc39.github.io/ecma262/#sec-array.prototype.values +// `Array.prototype[@@iterator]` method +// https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator +// `CreateArrayIterator` internal method +// https://tc39.github.io/ecma262/#sec-createarrayiterator +module.exports = defineIterator(Array, 'Array', function (iterated, kind) { + setInternalState(this, { + type: ARRAY_ITERATOR, + target: toIndexedObject(iterated), // target + index: 0, // next index + kind: kind // kind + }); +// `%ArrayIteratorPrototype%.next` method +// https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next +}, function () { + var state = getInternalState(this); + var target = state.target; + var kind = state.kind; + var index = state.index++; + if (!target || index >= target.length) { + state.target = undefined; + return { value: undefined, done: true }; + } + if (kind == 'keys') return { value: index, done: false }; + if (kind == 'values') return { value: target[index], done: false }; + return { value: [index, target[index]], done: false }; +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% +// https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject +// https://tc39.github.io/ecma262/#sec-createmappedargumentsobject +Iterators.Arguments = Iterators.Array; + +// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.map.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.map.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $map = __webpack_require__(/*! ../internals/array-iteration */ "../../node_modules/core-js/internals/array-iteration.js").map; +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "../../node_modules/core-js/internals/array-method-has-species-support.js"); + +var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map'); +// FF49- issue +var USES_TO_LENGTH = HAS_SPECIES_SUPPORT && !fails(function () { + [].map.call({ length: -1, 0: 1 }, function (it) { throw it; }); +}); + +// `Array.prototype.map` method +// https://tc39.github.io/ecma262/#sec-array.prototype.map +// with adding support of @@species +$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, { + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.reduce.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.reduce.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $reduce = __webpack_require__(/*! ../internals/array-reduce */ "../../node_modules/core-js/internals/array-reduce.js").left; +var sloppyArrayMethod = __webpack_require__(/*! ../internals/sloppy-array-method */ "../../node_modules/core-js/internals/sloppy-array-method.js"); + +// `Array.prototype.reduce` method +// https://tc39.github.io/ecma262/#sec-array.prototype.reduce +$({ target: 'Array', proto: true, forced: sloppyArrayMethod('reduce') }, { + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.slice.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.slice.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var isArray = __webpack_require__(/*! ../internals/is-array */ "../../node_modules/core-js/internals/is-array.js"); +var toAbsoluteIndex = __webpack_require__(/*! ../internals/to-absolute-index */ "../../node_modules/core-js/internals/to-absolute-index.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); +var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js"); +var createProperty = __webpack_require__(/*! ../internals/create-property */ "../../node_modules/core-js/internals/create-property.js"); +var arrayMethodHasSpeciesSupport = __webpack_require__(/*! ../internals/array-method-has-species-support */ "../../node_modules/core-js/internals/array-method-has-species-support.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var SPECIES = wellKnownSymbol('species'); +var nativeSlice = [].slice; +var max = Math.max; + +// `Array.prototype.slice` method +// https://tc39.github.io/ecma262/#sec-array.prototype.slice +// fallback for not array-like ES3 strings and DOM objects +$({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('slice') }, { + slice: function slice(start, end) { + var O = toIndexedObject(this); + var length = toLength(O.length); + var k = toAbsoluteIndex(start, length); + var fin = toAbsoluteIndex(end === undefined ? length : end, length); + // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible + var Constructor, result, n; + if (isArray(O)) { + Constructor = O.constructor; + // cross-realm fallback + if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) { + Constructor = undefined; + } else if (isObject(Constructor)) { + Constructor = Constructor[SPECIES]; + if (Constructor === null) Constructor = undefined; + } + if (Constructor === Array || Constructor === undefined) { + return nativeSlice.call(O, k, fin); + } + } + result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0)); + for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]); + result.length = n; + return result; + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.some.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.some.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $some = __webpack_require__(/*! ../internals/array-iteration */ "../../node_modules/core-js/internals/array-iteration.js").some; +var sloppyArrayMethod = __webpack_require__(/*! ../internals/sloppy-array-method */ "../../node_modules/core-js/internals/sloppy-array-method.js"); + +// `Array.prototype.some` method +// https://tc39.github.io/ecma262/#sec-array.prototype.some +$({ target: 'Array', proto: true, forced: sloppyArrayMethod('some') }, { + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.array.sort.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.array.sort.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var aFunction = __webpack_require__(/*! ../internals/a-function */ "../../node_modules/core-js/internals/a-function.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var sloppyArrayMethod = __webpack_require__(/*! ../internals/sloppy-array-method */ "../../node_modules/core-js/internals/sloppy-array-method.js"); + +var test = []; +var nativeSort = test.sort; + +// IE8- +var FAILS_ON_UNDEFINED = fails(function () { + test.sort(undefined); +}); +// V8 bug +var FAILS_ON_NULL = fails(function () { + test.sort(null); +}); +// Old WebKit +var SLOPPY_METHOD = sloppyArrayMethod('sort'); + +var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || SLOPPY_METHOD; + +// `Array.prototype.sort` method +// https://tc39.github.io/ecma262/#sec-array.prototype.sort +$({ target: 'Array', proto: true, forced: FORCED }, { + sort: function sort(comparefn) { + return comparefn === undefined + ? nativeSort.call(toObject(this)) + : nativeSort.call(toObject(this), aFunction(comparefn)); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.date.to-string.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.date.to-string.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); + +var DatePrototype = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var nativeDateToString = DatePrototype[TO_STRING]; +var getTime = DatePrototype.getTime; + +// `Date.prototype.toString` method +// https://tc39.github.io/ecma262/#sec-date.prototype.tostring +if (new Date(NaN) + '' != INVALID_DATE) { + redefine(DatePrototype, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare + return value === value ? nativeDateToString.call(this) : INVALID_DATE; + }); +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.function.bind.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.function.bind.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var bind = __webpack_require__(/*! ../internals/function-bind */ "../../node_modules/core-js/internals/function-bind.js"); + +// `Function.prototype.bind` method +// https://tc39.github.io/ecma262/#sec-function.prototype.bind +$({ target: 'Function', proto: true }, { + bind: bind +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.function.name.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.function.name.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f; + +var FunctionPrototype = Function.prototype; +var FunctionPrototypeToString = FunctionPrototype.toString; +var nameRE = /^\s*function ([^ (]*)/; +var NAME = 'name'; + +// Function instances `.name` property +// https://tc39.github.io/ecma262/#sec-function-instances-name +if (DESCRIPTORS && !(NAME in FunctionPrototype)) { + defineProperty(FunctionPrototype, NAME, { + configurable: true, + get: function () { + try { + return FunctionPrototypeToString.call(this).match(nameRE)[1]; + } catch (error) { + return ''; + } + } + }); +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.json.to-string-tag.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.json.to-string-tag.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js"); + +// JSON[@@toStringTag] property +// https://tc39.github.io/ecma262/#sec-json-@@tostringtag +setToStringTag(global.JSON, 'JSON', true); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.map.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.map.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var collection = __webpack_require__(/*! ../internals/collection */ "../../node_modules/core-js/internals/collection.js"); +var collectionStrong = __webpack_require__(/*! ../internals/collection-strong */ "../../node_modules/core-js/internals/collection-strong.js"); + +// `Map` constructor +// https://tc39.github.io/ecma262/#sec-map-objects +module.exports = collection('Map', function (init) { + return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; +}, collectionStrong); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.math.to-string-tag.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.math.to-string-tag.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js"); + +// Math[@@toStringTag] property +// https://tc39.github.io/ecma262/#sec-math-@@tostringtag +setToStringTag(Math, 'Math', true); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.number.constructor.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.number.constructor.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var isForced = __webpack_require__(/*! ../internals/is-forced */ "../../node_modules/core-js/internals/is-forced.js"); +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); +var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "../../node_modules/core-js/internals/inherit-if-required.js"); +var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "../../node_modules/core-js/internals/to-primitive.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js"); +var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "../../node_modules/core-js/internals/object-get-own-property-names.js").f; +var getOwnPropertyDescriptor = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js").f; +var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f; +var trim = __webpack_require__(/*! ../internals/string-trim */ "../../node_modules/core-js/internals/string-trim.js").trim; + +var NUMBER = 'Number'; +var NativeNumber = global[NUMBER]; +var NumberPrototype = NativeNumber.prototype; + +// Opera ~12 has broken Object#toString +var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER; + +// `ToNumber` abstract operation +// https://tc39.github.io/ecma262/#sec-tonumber +var toNumber = function (argument) { + var it = toPrimitive(argument, false); + var first, third, radix, maxCode, digits, length, index, code; + if (typeof it == 'string' && it.length > 2) { + it = trim(it); + first = it.charCodeAt(0); + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i + default: return +it; + } + digits = it.slice(2); + length = digits.length; + for (index = 0; index < length; index++) { + code = digits.charCodeAt(index); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +// `Number` constructor +// https://tc39.github.io/ecma262/#sec-number-constructor +if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) { + var NumberWrapper = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var dummy = this; + return dummy instanceof NumberWrapper + // check on 1..constructor(foo) case + && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER) + ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it); + }; + for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES2015 (in case, if modules with ES2015 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++) { + if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) { + defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key)); + } + } + NumberWrapper.prototype = NumberPrototype; + NumberPrototype.constructor = NumberWrapper; + redefine(global, NUMBER, NumberWrapper); +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.number.is-integer.js": +/*!********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.number.is-integer.js ***! + \********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var isInteger = __webpack_require__(/*! ../internals/is-integer */ "../../node_modules/core-js/internals/is-integer.js"); + +// `Number.isInteger` method +// https://tc39.github.io/ecma262/#sec-number.isinteger +$({ target: 'Number', stat: true }, { + isInteger: isInteger +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.assign.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.assign.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var assign = __webpack_require__(/*! ../internals/object-assign */ "../../node_modules/core-js/internals/object-assign.js"); + +// `Object.assign` method +// https://tc39.github.io/ecma262/#sec-object.assign +$({ target: 'Object', stat: true, forced: Object.assign !== assign }, { + assign: assign +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.create.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.create.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var create = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js"); + +// `Object.create` method +// https://tc39.github.io/ecma262/#sec-object.create +$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, { + create: create +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.define-properties.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.define-properties.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var defineProperties = __webpack_require__(/*! ../internals/object-define-properties */ "../../node_modules/core-js/internals/object-define-properties.js"); + +// `Object.defineProperties` method +// https://tc39.github.io/ecma262/#sec-object.defineproperties +$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, { + defineProperties: defineProperties +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.define-property.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.define-property.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var objectDefinePropertyModile = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js"); + +// `Object.defineProperty` method +// https://tc39.github.io/ecma262/#sec-object.defineproperty +$({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, { + defineProperty: objectDefinePropertyModile.f +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.entries.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.entries.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $entries = __webpack_require__(/*! ../internals/object-to-array */ "../../node_modules/core-js/internals/object-to-array.js").entries; + +// `Object.entries` method +// https://tc39.github.io/ecma262/#sec-object.entries +$({ target: 'Object', stat: true }, { + entries: function entries(O) { + return $entries(O); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.freeze.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.freeze.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var FREEZING = __webpack_require__(/*! ../internals/freezing */ "../../node_modules/core-js/internals/freezing.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var onFreeze = __webpack_require__(/*! ../internals/internal-metadata */ "../../node_modules/core-js/internals/internal-metadata.js").onFreeze; + +var nativeFreeze = Object.freeze; +var FAILS_ON_PRIMITIVES = fails(function () { nativeFreeze(1); }); + +// `Object.freeze` method +// https://tc39.github.io/ecma262/#sec-object.freeze +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, { + freeze: function freeze(it) { + return nativeFreeze && isObject(it) ? nativeFreeze(onFreeze(it)) : it; + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.get-prototype-of.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.get-prototype-of.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var nativeGetPrototypeOf = __webpack_require__(/*! ../internals/object-get-prototype-of */ "../../node_modules/core-js/internals/object-get-prototype-of.js"); +var CORRECT_PROTOTYPE_GETTER = __webpack_require__(/*! ../internals/correct-prototype-getter */ "../../node_modules/core-js/internals/correct-prototype-getter.js"); + +var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); }); + +// `Object.getPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.getprototypeof +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, { + getPrototypeOf: function getPrototypeOf(it) { + return nativeGetPrototypeOf(toObject(it)); + } +}); + + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.keys.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.keys.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var nativeKeys = __webpack_require__(/*! ../internals/object-keys */ "../../node_modules/core-js/internals/object-keys.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); + +var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); }); + +// `Object.keys` method +// https://tc39.github.io/ecma262/#sec-object.keys +$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { + keys: function keys(it) { + return nativeKeys(toObject(it)); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.set-prototype-of.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.set-prototype-of.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "../../node_modules/core-js/internals/object-set-prototype-of.js"); + +// `Object.setPrototypeOf` method +// https://tc39.github.io/ecma262/#sec-object.setprototypeof +$({ target: 'Object', stat: true }, { + setPrototypeOf: setPrototypeOf +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.to-string.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.to-string.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ "../../node_modules/core-js/internals/to-string-tag-support.js"); +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var toString = __webpack_require__(/*! ../internals/object-to-string */ "../../node_modules/core-js/internals/object-to-string.js"); + +// `Object.prototype.toString` method +// https://tc39.github.io/ecma262/#sec-object.prototype.tostring +if (!TO_STRING_TAG_SUPPORT) { + redefine(Object.prototype, 'toString', toString, { unsafe: true }); +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.object.values.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.object.values.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var $values = __webpack_require__(/*! ../internals/object-to-array */ "../../node_modules/core-js/internals/object-to-array.js").values; + +// `Object.values` method +// https://tc39.github.io/ecma262/#sec-object.values +$({ target: 'Object', stat: true }, { + values: function values(O) { + return $values(O); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.promise.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.promise.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js"); +var NativePromise = __webpack_require__(/*! ../internals/native-promise-constructor */ "../../node_modules/core-js/internals/native-promise-constructor.js"); +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "../../node_modules/core-js/internals/redefine-all.js"); +var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js"); +var setSpecies = __webpack_require__(/*! ../internals/set-species */ "../../node_modules/core-js/internals/set-species.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var aFunction = __webpack_require__(/*! ../internals/a-function */ "../../node_modules/core-js/internals/a-function.js"); +var anInstance = __webpack_require__(/*! ../internals/an-instance */ "../../node_modules/core-js/internals/an-instance.js"); +var classof = __webpack_require__(/*! ../internals/classof-raw */ "../../node_modules/core-js/internals/classof-raw.js"); +var inspectSource = __webpack_require__(/*! ../internals/inspect-source */ "../../node_modules/core-js/internals/inspect-source.js"); +var iterate = __webpack_require__(/*! ../internals/iterate */ "../../node_modules/core-js/internals/iterate.js"); +var checkCorrectnessOfIteration = __webpack_require__(/*! ../internals/check-correctness-of-iteration */ "../../node_modules/core-js/internals/check-correctness-of-iteration.js"); +var speciesConstructor = __webpack_require__(/*! ../internals/species-constructor */ "../../node_modules/core-js/internals/species-constructor.js"); +var task = __webpack_require__(/*! ../internals/task */ "../../node_modules/core-js/internals/task.js").set; +var microtask = __webpack_require__(/*! ../internals/microtask */ "../../node_modules/core-js/internals/microtask.js"); +var promiseResolve = __webpack_require__(/*! ../internals/promise-resolve */ "../../node_modules/core-js/internals/promise-resolve.js"); +var hostReportErrors = __webpack_require__(/*! ../internals/host-report-errors */ "../../node_modules/core-js/internals/host-report-errors.js"); +var newPromiseCapabilityModule = __webpack_require__(/*! ../internals/new-promise-capability */ "../../node_modules/core-js/internals/new-promise-capability.js"); +var perform = __webpack_require__(/*! ../internals/perform */ "../../node_modules/core-js/internals/perform.js"); +var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js"); +var isForced = __webpack_require__(/*! ../internals/is-forced */ "../../node_modules/core-js/internals/is-forced.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var V8_VERSION = __webpack_require__(/*! ../internals/v8-version */ "../../node_modules/core-js/internals/v8-version.js"); + +var SPECIES = wellKnownSymbol('species'); +var PROMISE = 'Promise'; +var getInternalState = InternalStateModule.get; +var setInternalState = InternalStateModule.set; +var getInternalPromiseState = InternalStateModule.getterFor(PROMISE); +var PromiseConstructor = NativePromise; +var TypeError = global.TypeError; +var document = global.document; +var process = global.process; +var $fetch = getBuiltIn('fetch'); +var newPromiseCapability = newPromiseCapabilityModule.f; +var newGenericPromiseCapability = newPromiseCapability; +var IS_NODE = classof(process) == 'process'; +var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent); +var UNHANDLED_REJECTION = 'unhandledrejection'; +var REJECTION_HANDLED = 'rejectionhandled'; +var PENDING = 0; +var FULFILLED = 1; +var REJECTED = 2; +var HANDLED = 1; +var UNHANDLED = 2; +var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen; + +var FORCED = isForced(PROMISE, function () { + var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor); + if (!GLOBAL_CORE_JS_PROMISE) { + // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // We can't detect it synchronously, so just check versions + if (V8_VERSION === 66) return true; + // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test + if (!IS_NODE && typeof PromiseRejectionEvent != 'function') return true; + } + // We need Promise#finally in the pure version for preventing prototype pollution + if (IS_PURE && !PromiseConstructor.prototype['finally']) return true; + // We can't use @@species feature detection in V8 since it causes + // deoptimization and performance degradation + // https://github.com/zloirock/core-js/issues/679 + if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false; + // Detect correctness of subclassing with @@species support + var promise = PromiseConstructor.resolve(1); + var FakePromise = function (exec) { + exec(function () { /* empty */ }, function () { /* empty */ }); + }; + var constructor = promise.constructor = {}; + constructor[SPECIES] = FakePromise; + return !(promise.then(function () { /* empty */ }) instanceof FakePromise); +}); + +var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) { + PromiseConstructor.all(iterable)['catch'](function () { /* empty */ }); +}); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; + +var notify = function (promise, state, isReject) { + if (state.notified) return; + state.notified = true; + var chain = state.reactions; + microtask(function () { + var value = state.value; + var ok = state.state == FULFILLED; + var index = 0; + // variable length - can't use forEach + while (chain.length > index) { + var reaction = chain[index++]; + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state); + state.rejection = HANDLED; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // can throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (error) { + if (domain && !exited) domain.exit(); + reject(error); + } + } + state.reactions = []; + state.notified = false; + if (isReject && !state.rejection) onUnhandled(promise, state); + }); +}; + +var dispatchEvent = function (name, promise, reason) { + var event, handler; + if (DISPATCH_EVENT) { + event = document.createEvent('Event'); + event.promise = promise; + event.reason = reason; + event.initEvent(name, false, true); + global.dispatchEvent(event); + } else event = { promise: promise, reason: reason }; + if (handler = global['on' + name]) handler(event); + else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason); +}; + +var onUnhandled = function (promise, state) { + task.call(global, function () { + var value = state.value; + var IS_UNHANDLED = isUnhandled(state); + var result; + if (IS_UNHANDLED) { + result = perform(function () { + if (IS_NODE) { + process.emit('unhandledRejection', value, promise); + } else dispatchEvent(UNHANDLED_REJECTION, promise, value); + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED; + if (result.error) throw result.value; + } + }); +}; + +var isUnhandled = function (state) { + return state.rejection !== HANDLED && !state.parent; +}; + +var onHandleUnhandled = function (promise, state) { + task.call(global, function () { + if (IS_NODE) { + process.emit('rejectionHandled', promise); + } else dispatchEvent(REJECTION_HANDLED, promise, state.value); + }); +}; + +var bind = function (fn, promise, state, unwrap) { + return function (value) { + fn(promise, state, value, unwrap); + }; +}; + +var internalReject = function (promise, state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + state.value = value; + state.state = REJECTED; + notify(promise, state, true); +}; + +var internalResolve = function (promise, state, value, unwrap) { + if (state.done) return; + state.done = true; + if (unwrap) state = unwrap; + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + var then = isThenable(value); + if (then) { + microtask(function () { + var wrapper = { done: false }; + try { + then.call(value, + bind(internalResolve, promise, wrapper, state), + bind(internalReject, promise, wrapper, state) + ); + } catch (error) { + internalReject(promise, wrapper, error, state); + } + }); + } else { + state.value = value; + state.state = FULFILLED; + notify(promise, state, false); + } + } catch (error) { + internalReject(promise, { done: false }, error, state); + } +}; + +// constructor polyfill +if (FORCED) { + // 25.4.3.1 Promise(executor) + PromiseConstructor = function Promise(executor) { + anInstance(this, PromiseConstructor, PROMISE); + aFunction(executor); + Internal.call(this); + var state = getInternalState(this); + try { + executor(bind(internalResolve, this, state), bind(internalReject, this, state)); + } catch (error) { + internalReject(this, state, error); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + setInternalState(this, { + type: PROMISE, + done: false, + notified: false, + parent: false, + reactions: [], + rejection: false, + state: PENDING, + value: undefined + }); + }; + Internal.prototype = redefineAll(PromiseConstructor.prototype, { + // `Promise.prototype.then` method + // https://tc39.github.io/ecma262/#sec-promise.prototype.then + then: function then(onFulfilled, onRejected) { + var state = getInternalPromiseState(this); + var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = IS_NODE ? process.domain : undefined; + state.parent = true; + state.reactions.push(reaction); + if (state.state != PENDING) notify(this, state, false); + return reaction.promise; + }, + // `Promise.prototype.catch` method + // https://tc39.github.io/ecma262/#sec-promise.prototype.catch + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + var state = getInternalState(promise); + this.promise = promise; + this.resolve = bind(internalResolve, promise, state); + this.reject = bind(internalReject, promise, state); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === PromiseConstructor || C === PromiseWrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; + + if (!IS_PURE && typeof NativePromise == 'function') { + nativeThen = NativePromise.prototype.then; + + // wrap native Promise#then for native async functions + redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) { + var that = this; + return new PromiseConstructor(function (resolve, reject) { + nativeThen.call(that, resolve, reject); + }).then(onFulfilled, onRejected); + // https://github.com/zloirock/core-js/issues/640 + }, { unsafe: true }); + + // wrap fetch result + if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, { + // eslint-disable-next-line no-unused-vars + fetch: function fetch(input /* , init */) { + return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments)); + } + }); + } +} + +$({ global: true, wrap: true, forced: FORCED }, { + Promise: PromiseConstructor +}); + +setToStringTag(PromiseConstructor, PROMISE, false, true); +setSpecies(PROMISE); + +PromiseWrapper = getBuiltIn(PROMISE); + +// statics +$({ target: PROMISE, stat: true, forced: FORCED }, { + // `Promise.reject` method + // https://tc39.github.io/ecma262/#sec-promise.reject + reject: function reject(r) { + var capability = newPromiseCapability(this); + capability.reject.call(undefined, r); + return capability.promise; + } +}); + +$({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, { + // `Promise.resolve` method + // https://tc39.github.io/ecma262/#sec-promise.resolve + resolve: function resolve(x) { + return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x); + } +}); + +$({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, { + // `Promise.all` method + // https://tc39.github.io/ecma262/#sec-promise.all + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aFunction(C.resolve); + var values = []; + var counter = 0; + var remaining = 1; + iterate(iterable, function (promise) { + var index = counter++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + $promiseResolve.call(C, promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.error) reject(result.value); + return capability.promise; + }, + // `Promise.race` method + // https://tc39.github.io/ecma262/#sec-promise.race + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + var $promiseResolve = aFunction(C.resolve); + iterate(iterable, function (promise) { + $promiseResolve.call(C, promise).then(capability.resolve, reject); + }); + }); + if (result.error) reject(result.value); + return capability.promise; + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.regexp.exec.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.regexp.exec.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var exec = __webpack_require__(/*! ../internals/regexp-exec */ "../../node_modules/core-js/internals/regexp-exec.js"); + +$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, { + exec: exec +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.regexp.to-string.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.regexp.to-string.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var flags = __webpack_require__(/*! ../internals/regexp-flags */ "../../node_modules/core-js/internals/regexp-flags.js"); + +var TO_STRING = 'toString'; +var RegExpPrototype = RegExp.prototype; +var nativeToString = RegExpPrototype[TO_STRING]; + +var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); +// FF44- RegExp#toString has a wrong name +var INCORRECT_NAME = nativeToString.name != TO_STRING; + +// `RegExp.prototype.toString` method +// https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring +if (NOT_GENERIC || INCORRECT_NAME) { + redefine(RegExp.prototype, TO_STRING, function toString() { + var R = anObject(this); + var p = String(R.source); + var rf = R.flags; + var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); + return '/' + p + '/' + f; + }, { unsafe: true }); +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.set.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.set.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var collection = __webpack_require__(/*! ../internals/collection */ "../../node_modules/core-js/internals/collection.js"); +var collectionStrong = __webpack_require__(/*! ../internals/collection-strong */ "../../node_modules/core-js/internals/collection-strong.js"); + +// `Set` constructor +// https://tc39.github.io/ecma262/#sec-set-objects +module.exports = collection('Set', function (init) { + return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; +}, collectionStrong); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.string.includes.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.string.includes.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var notARegExp = __webpack_require__(/*! ../internals/not-a-regexp */ "../../node_modules/core-js/internals/not-a-regexp.js"); +var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js"); +var correctIsRegExpLogic = __webpack_require__(/*! ../internals/correct-is-regexp-logic */ "../../node_modules/core-js/internals/correct-is-regexp-logic.js"); + +// `String.prototype.includes` method +// https://tc39.github.io/ecma262/#sec-string.prototype.includes +$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { + includes: function includes(searchString /* , position = 0 */) { + return !!~String(requireObjectCoercible(this)) + .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.string.iterator.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.string.iterator.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var charAt = __webpack_require__(/*! ../internals/string-multibyte */ "../../node_modules/core-js/internals/string-multibyte.js").charAt; +var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js"); +var defineIterator = __webpack_require__(/*! ../internals/define-iterator */ "../../node_modules/core-js/internals/define-iterator.js"); + +var STRING_ITERATOR = 'String Iterator'; +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); + +// `String.prototype[@@iterator]` method +// https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator +defineIterator(String, 'String', function (iterated) { + setInternalState(this, { + type: STRING_ITERATOR, + string: String(iterated), + index: 0 + }); +// `%StringIteratorPrototype%.next` method +// https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next +}, function next() { + var state = getInternalState(this); + var string = state.string; + var index = state.index; + var point; + if (index >= string.length) return { value: undefined, done: true }; + point = charAt(string, index); + state.index += point.length; + return { value: point, done: false }; +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.string.match.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.string.match.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"); +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); +var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js"); +var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "../../node_modules/core-js/internals/advance-string-index.js"); +var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js"); + +// @@match logic +fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { + return [ + // `String.prototype.match` method + // https://tc39.github.io/ecma262/#sec-string.prototype.match + function match(regexp) { + var O = requireObjectCoercible(this); + var matcher = regexp == undefined ? undefined : regexp[MATCH]; + return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, + // `RegExp.prototype[@@match]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match + function (regexp) { + var res = maybeCallNative(nativeMatch, regexp, this); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + if (!rx.global) return regExpExec(rx, S); + + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + var A = []; + var n = 0; + var result; + while ((result = regExpExec(rx, S)) !== null) { + var matchStr = String(result[0]); + A[n] = matchStr; + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + n++; + } + return n === 0 ? null : A; + } + ]; +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.string.replace.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.string.replace.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"); +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var toLength = __webpack_require__(/*! ../internals/to-length */ "../../node_modules/core-js/internals/to-length.js"); +var toInteger = __webpack_require__(/*! ../internals/to-integer */ "../../node_modules/core-js/internals/to-integer.js"); +var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js"); +var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "../../node_modules/core-js/internals/advance-string-index.js"); +var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js"); + +var max = Math.max; +var min = Math.min; +var floor = Math.floor; +var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; +var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; + +var maybeToString = function (it) { + return it === undefined ? it : String(it); +}; + +// @@replace logic +fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) { + return [ + // `String.prototype.replace` method + // https://tc39.github.io/ecma262/#sec-string.prototype.replace + function replace(searchValue, replaceValue) { + var O = requireObjectCoercible(this); + var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; + return replacer !== undefined + ? replacer.call(searchValue, O, replaceValue) + : nativeReplace.call(String(O), searchValue, replaceValue); + }, + // `RegExp.prototype[@@replace]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace + function (regexp, replaceValue) { + var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + var functionalReplace = typeof replaceValue === 'function'; + if (!functionalReplace) replaceValue = String(replaceValue); + + var global = rx.global; + if (global) { + var fullUnicode = rx.unicode; + rx.lastIndex = 0; + } + var results = []; + while (true) { + var result = regExpExec(rx, S); + if (result === null) break; + + results.push(result); + if (!global) break; + + var matchStr = String(result[0]); + if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); + } + + var accumulatedResult = ''; + var nextSourcePosition = 0; + for (var i = 0; i < results.length; i++) { + result = results[i]; + + var matched = String(result[0]); + var position = max(min(toInteger(result.index), S.length), 0); + var captures = []; + // NOTE: This is equivalent to + // captures = result.slice(1).map(maybeToString) + // but for some reason `nativeSlice.call(result, 1, result.length)` (called in + // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and + // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. + for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); + var namedCaptures = result.groups; + if (functionalReplace) { + var replacerArgs = [matched].concat(captures, position, S); + if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); + var replacement = String(replaceValue.apply(undefined, replacerArgs)); + } else { + replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); + } + if (position >= nextSourcePosition) { + accumulatedResult += S.slice(nextSourcePosition, position) + replacement; + nextSourcePosition = position + matched.length; + } + } + return accumulatedResult + S.slice(nextSourcePosition); + } + ]; + + // https://tc39.github.io/ecma262/#sec-getsubstitution + function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { + var tailPos = position + matched.length; + var m = captures.length; + var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; + if (namedCaptures !== undefined) { + namedCaptures = toObject(namedCaptures); + symbols = SUBSTITUTION_SYMBOLS; + } + return nativeReplace.call(replacement, symbols, function (match, ch) { + var capture; + switch (ch.charAt(0)) { + case '$': return '$'; + case '&': return matched; + case '`': return str.slice(0, position); + case "'": return str.slice(tailPos); + case '<': + capture = namedCaptures[ch.slice(1, -1)]; + break; + default: // \d\d? + var n = +ch; + if (n === 0) return match; + if (n > m) { + var f = floor(n / 10); + if (f === 0) return match; + if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); + return match; + } + capture = captures[n - 1]; + } + return capture === undefined ? '' : capture; + }); + } +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.string.search.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.string.search.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "../../node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"); +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "../../node_modules/core-js/internals/require-object-coercible.js"); +var sameValue = __webpack_require__(/*! ../internals/same-value */ "../../node_modules/core-js/internals/same-value.js"); +var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "../../node_modules/core-js/internals/regexp-exec-abstract.js"); + +// @@search logic +fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) { + return [ + // `String.prototype.search` method + // https://tc39.github.io/ecma262/#sec-string.prototype.search + function search(regexp) { + var O = requireObjectCoercible(this); + var searcher = regexp == undefined ? undefined : regexp[SEARCH]; + return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, + // `RegExp.prototype[@@search]` method + // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search + function (regexp) { + var res = maybeCallNative(nativeSearch, regexp, this); + if (res.done) return res.value; + + var rx = anObject(regexp); + var S = String(this); + + var previousLastIndex = rx.lastIndex; + if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; + var result = regExpExec(rx, S); + if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; + return result === null ? -1 : result.index; + } + ]; +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.async-iterator.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.async-iterator.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.asyncIterator` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.asynciterator +defineWellKnownSymbol('asyncIterator'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.description.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.description.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// `Symbol.prototype.description` getter +// https://tc39.github.io/ecma262/#sec-symbol.prototype.description + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js").f; +var copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ "../../node_modules/core-js/internals/copy-constructor-properties.js"); + +var NativeSymbol = global.Symbol; + +if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) || + // Safari 12 bug + NativeSymbol().description !== undefined +)) { + var EmptyStringDescriptionStore = {}; + // wrap Symbol constructor for correct work with undefined description + var SymbolWrapper = function Symbol() { + var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]); + var result = this instanceof SymbolWrapper + ? new NativeSymbol(description) + // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' + : description === undefined ? NativeSymbol() : NativeSymbol(description); + if (description === '') EmptyStringDescriptionStore[result] = true; + return result; + }; + copyConstructorProperties(SymbolWrapper, NativeSymbol); + var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype; + symbolPrototype.constructor = SymbolWrapper; + + var symbolToString = symbolPrototype.toString; + var native = String(NativeSymbol('test')) == 'Symbol(test)'; + var regexp = /^Symbol\((.*)\)[^)]+$/; + defineProperty(symbolPrototype, 'description', { + configurable: true, + get: function description() { + var symbol = isObject(this) ? this.valueOf() : this; + var string = symbolToString.call(symbol); + if (has(EmptyStringDescriptionStore, symbol)) return ''; + var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1'); + return desc === '' ? undefined : desc; + } + }); + + $({ global: true, forced: true }, { + Symbol: SymbolWrapper + }); +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.has-instance.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.has-instance.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.hasInstance` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.hasinstance +defineWellKnownSymbol('hasInstance'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.is-concat-spreadable.js": +/*!******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.is-concat-spreadable.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.isConcatSpreadable` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.isconcatspreadable +defineWellKnownSymbol('isConcatSpreadable'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.iterator.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.iterator.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.iterator` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.iterator +defineWellKnownSymbol('iterator'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "../../node_modules/core-js/internals/get-built-in.js"); +var IS_PURE = __webpack_require__(/*! ../internals/is-pure */ "../../node_modules/core-js/internals/is-pure.js"); +var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "../../node_modules/core-js/internals/descriptors.js"); +var NATIVE_SYMBOL = __webpack_require__(/*! ../internals/native-symbol */ "../../node_modules/core-js/internals/native-symbol.js"); +var USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ "../../node_modules/core-js/internals/use-symbol-as-uid.js"); +var fails = __webpack_require__(/*! ../internals/fails */ "../../node_modules/core-js/internals/fails.js"); +var has = __webpack_require__(/*! ../internals/has */ "../../node_modules/core-js/internals/has.js"); +var isArray = __webpack_require__(/*! ../internals/is-array */ "../../node_modules/core-js/internals/is-array.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var anObject = __webpack_require__(/*! ../internals/an-object */ "../../node_modules/core-js/internals/an-object.js"); +var toObject = __webpack_require__(/*! ../internals/to-object */ "../../node_modules/core-js/internals/to-object.js"); +var toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ "../../node_modules/core-js/internals/to-indexed-object.js"); +var toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ "../../node_modules/core-js/internals/to-primitive.js"); +var createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ "../../node_modules/core-js/internals/create-property-descriptor.js"); +var nativeObjectCreate = __webpack_require__(/*! ../internals/object-create */ "../../node_modules/core-js/internals/object-create.js"); +var objectKeys = __webpack_require__(/*! ../internals/object-keys */ "../../node_modules/core-js/internals/object-keys.js"); +var getOwnPropertyNamesModule = __webpack_require__(/*! ../internals/object-get-own-property-names */ "../../node_modules/core-js/internals/object-get-own-property-names.js"); +var getOwnPropertyNamesExternal = __webpack_require__(/*! ../internals/object-get-own-property-names-external */ "../../node_modules/core-js/internals/object-get-own-property-names-external.js"); +var getOwnPropertySymbolsModule = __webpack_require__(/*! ../internals/object-get-own-property-symbols */ "../../node_modules/core-js/internals/object-get-own-property-symbols.js"); +var getOwnPropertyDescriptorModule = __webpack_require__(/*! ../internals/object-get-own-property-descriptor */ "../../node_modules/core-js/internals/object-get-own-property-descriptor.js"); +var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "../../node_modules/core-js/internals/object-define-property.js"); +var propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ "../../node_modules/core-js/internals/object-property-is-enumerable.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); +var redefine = __webpack_require__(/*! ../internals/redefine */ "../../node_modules/core-js/internals/redefine.js"); +var shared = __webpack_require__(/*! ../internals/shared */ "../../node_modules/core-js/internals/shared.js"); +var sharedKey = __webpack_require__(/*! ../internals/shared-key */ "../../node_modules/core-js/internals/shared-key.js"); +var hiddenKeys = __webpack_require__(/*! ../internals/hidden-keys */ "../../node_modules/core-js/internals/hidden-keys.js"); +var uid = __webpack_require__(/*! ../internals/uid */ "../../node_modules/core-js/internals/uid.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); +var wrappedWellKnownSymbolModule = __webpack_require__(/*! ../internals/wrapped-well-known-symbol */ "../../node_modules/core-js/internals/wrapped-well-known-symbol.js"); +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); +var setToStringTag = __webpack_require__(/*! ../internals/set-to-string-tag */ "../../node_modules/core-js/internals/set-to-string-tag.js"); +var InternalStateModule = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js"); +var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "../../node_modules/core-js/internals/array-iteration.js").forEach; + +var HIDDEN = sharedKey('hidden'); +var SYMBOL = 'Symbol'; +var PROTOTYPE = 'prototype'; +var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); +var setInternalState = InternalStateModule.set; +var getInternalState = InternalStateModule.getterFor(SYMBOL); +var ObjectPrototype = Object[PROTOTYPE]; +var $Symbol = global.Symbol; +var $stringify = getBuiltIn('JSON', 'stringify'); +var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; +var nativeDefineProperty = definePropertyModule.f; +var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; +var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; +var AllSymbols = shared('symbols'); +var ObjectPrototypeSymbols = shared('op-symbols'); +var StringToSymbolRegistry = shared('string-to-symbol-registry'); +var SymbolToStringRegistry = shared('symbol-to-string-registry'); +var WellKnownSymbolsStore = shared('wks'); +var QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDescriptor = DESCRIPTORS && fails(function () { + return nativeObjectCreate(nativeDefineProperty({}, 'a', { + get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } + })).a != 7; +}) ? function (O, P, Attributes) { + var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); + if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; + nativeDefineProperty(O, P, Attributes); + if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { + nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); + } +} : nativeDefineProperty; + +var wrap = function (tag, description) { + var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]); + setInternalState(symbol, { + type: SYMBOL, + tag: tag, + description: description + }); + if (!DESCRIPTORS) symbol.description = description; + return symbol; +}; + +var isSymbol = NATIVE_SYMBOL && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return Object(it) instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(O, P, Attributes) { + if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); + anObject(O); + var key = toPrimitive(P, true); + anObject(Attributes); + if (has(AllSymbols, key)) { + if (!Attributes.enumerable) { + if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); + O[HIDDEN][key] = true; + } else { + if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; + Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); + } return setSymbolDescriptor(O, key, Attributes); + } return nativeDefineProperty(O, key, Attributes); +}; + +var $defineProperties = function defineProperties(O, Properties) { + anObject(O); + var properties = toIndexedObject(Properties); + var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); + $forEach(keys, function (key) { + if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]); + }); + return O; +}; + +var $create = function create(O, Properties) { + return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); +}; + +var $propertyIsEnumerable = function propertyIsEnumerable(V) { + var P = toPrimitive(V, true); + var enumerable = nativePropertyIsEnumerable.call(this, P); + if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; + return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; +}; + +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { + var it = toIndexedObject(O); + var key = toPrimitive(P, true); + if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; + var descriptor = nativeGetOwnPropertyDescriptor(it, key); + if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { + descriptor.enumerable = true; + } + return descriptor; +}; + +var $getOwnPropertyNames = function getOwnPropertyNames(O) { + var names = nativeGetOwnPropertyNames(toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key); + }); + return result; +}; + +var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { + var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; + var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); + var result = []; + $forEach(names, function (key) { + if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) { + result.push(AllSymbols[key]); + } + }); + return result; +}; + +// `Symbol` constructor +// https://tc39.github.io/ecma262/#sec-symbol-constructor +if (!NATIVE_SYMBOL) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); + var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); + var tag = uid(description); + var setter = function (value) { + if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); + }; + if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); + return wrap(tag, description); + }; + + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return getInternalState(this).tag; + }); + + propertyIsEnumerableModule.f = $propertyIsEnumerable; + definePropertyModule.f = $defineProperty; + getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; + getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; + getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; + + if (DESCRIPTORS) { + // https://github.com/tc39/proposal-Symbol-description + nativeDefineProperty($Symbol[PROTOTYPE], 'description', { + configurable: true, + get: function description() { + return getInternalState(this).description; + } + }); + if (!IS_PURE) { + redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); + } + } +} + +if (!USE_SYMBOL_AS_UID) { + wrappedWellKnownSymbolModule.f = function (name) { + return wrap(wellKnownSymbol(name), name); + }; +} + +$({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { + Symbol: $Symbol +}); + +$forEach(objectKeys(WellKnownSymbolsStore), function (name) { + defineWellKnownSymbol(name); +}); + +$({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { + // `Symbol.for` method + // https://tc39.github.io/ecma262/#sec-symbol.for + 'for': function (key) { + var string = String(key); + if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; + var symbol = $Symbol(string); + StringToSymbolRegistry[string] = symbol; + SymbolToStringRegistry[symbol] = string; + return symbol; + }, + // `Symbol.keyFor` method + // https://tc39.github.io/ecma262/#sec-symbol.keyfor + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol'); + if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; + }, + useSetter: function () { USE_SETTER = true; }, + useSimple: function () { USE_SETTER = false; } +}); + +$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { + // `Object.create` method + // https://tc39.github.io/ecma262/#sec-object.create + create: $create, + // `Object.defineProperty` method + // https://tc39.github.io/ecma262/#sec-object.defineproperty + defineProperty: $defineProperty, + // `Object.defineProperties` method + // https://tc39.github.io/ecma262/#sec-object.defineproperties + defineProperties: $defineProperties, + // `Object.getOwnPropertyDescriptor` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + getOwnPropertyDescriptor: $getOwnPropertyDescriptor +}); + +$({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { + // `Object.getOwnPropertyNames` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertynames + getOwnPropertyNames: $getOwnPropertyNames, + // `Object.getOwnPropertySymbols` method + // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives +// https://bugs.chromium.org/p/v8/issues/detail?id=3443 +$({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, { + getOwnPropertySymbols: function getOwnPropertySymbols(it) { + return getOwnPropertySymbolsModule.f(toObject(it)); + } +}); + +// `JSON.stringify` method behavior with symbols +// https://tc39.github.io/ecma262/#sec-json.stringify +if ($stringify) { + var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () { + var symbol = $Symbol(); + // MS Edge converts symbol values to JSON as {} + return $stringify([symbol]) != '[null]' + // WebKit converts symbol values to JSON as null + || $stringify({ a: symbol }) != '{}' + // V8 throws on boxed symbols + || $stringify(Object(symbol)) != '{}'; + }); + + $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, { + // eslint-disable-next-line no-unused-vars + stringify: function stringify(it, replacer, space) { + var args = [it]; + var index = 1; + var $replacer; + while (arguments.length > index) args.push(arguments[index++]); + $replacer = replacer; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return $stringify.apply(null, args); + } + }); +} + +// `Symbol.prototype[@@toPrimitive]` method +// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive +if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) { + createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +} +// `Symbol.prototype[@@toStringTag]` property +// https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag +setToStringTag($Symbol, SYMBOL); + +hiddenKeys[HIDDEN] = true; + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.match-all.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.match-all.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.matchAll` well-known symbol +defineWellKnownSymbol('matchAll'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.match.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.match.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.match` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.match +defineWellKnownSymbol('match'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.replace.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.replace.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.replace` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.replace +defineWellKnownSymbol('replace'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.search.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.search.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.search` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.search +defineWellKnownSymbol('search'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.species.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.species.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.species` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.species +defineWellKnownSymbol('species'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.split.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.split.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.split` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.split +defineWellKnownSymbol('split'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.to-primitive.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.to-primitive.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.toPrimitive` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.toprimitive +defineWellKnownSymbol('toPrimitive'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.to-string-tag.js": +/*!***********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.to-string-tag.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.toStringTag` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.tostringtag +defineWellKnownSymbol('toStringTag'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.symbol.unscopables.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.symbol.unscopables.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.unscopables` well-known symbol +// https://tc39.github.io/ecma262/#sec-symbol.unscopables +defineWellKnownSymbol('unscopables'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/es.weak-map.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/es.weak-map.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var redefineAll = __webpack_require__(/*! ../internals/redefine-all */ "../../node_modules/core-js/internals/redefine-all.js"); +var InternalMetadataModule = __webpack_require__(/*! ../internals/internal-metadata */ "../../node_modules/core-js/internals/internal-metadata.js"); +var collection = __webpack_require__(/*! ../internals/collection */ "../../node_modules/core-js/internals/collection.js"); +var collectionWeak = __webpack_require__(/*! ../internals/collection-weak */ "../../node_modules/core-js/internals/collection-weak.js"); +var isObject = __webpack_require__(/*! ../internals/is-object */ "../../node_modules/core-js/internals/is-object.js"); +var enforceIternalState = __webpack_require__(/*! ../internals/internal-state */ "../../node_modules/core-js/internals/internal-state.js").enforce; +var NATIVE_WEAK_MAP = __webpack_require__(/*! ../internals/native-weak-map */ "../../node_modules/core-js/internals/native-weak-map.js"); + +var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global; +var isExtensible = Object.isExtensible; +var InternalWeakMap; + +var wrapper = function (init) { + return function WeakMap() { + return init(this, arguments.length ? arguments[0] : undefined); + }; +}; + +// `WeakMap` constructor +// https://tc39.github.io/ecma262/#sec-weakmap-constructor +var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak); + +// IE11 WeakMap frozen keys fix +// We can't use feature detection because it crash some old IE builds +// https://github.com/zloirock/core-js/issues/485 +if (NATIVE_WEAK_MAP && IS_IE11) { + InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true); + InternalMetadataModule.REQUIRED = true; + var WeakMapPrototype = $WeakMap.prototype; + var nativeDelete = WeakMapPrototype['delete']; + var nativeHas = WeakMapPrototype.has; + var nativeGet = WeakMapPrototype.get; + var nativeSet = WeakMapPrototype.set; + redefineAll(WeakMapPrototype, { + 'delete': function (key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeDelete.call(this, key) || state.frozen['delete'](key); + } return nativeDelete.call(this, key); + }, + has: function has(key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeHas.call(this, key) || state.frozen.has(key); + } return nativeHas.call(this, key); + }, + get: function get(key) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key); + } return nativeGet.call(this, key); + }, + set: function set(key, value) { + if (isObject(key) && !isExtensible(key)) { + var state = enforceIternalState(this); + if (!state.frozen) state.frozen = new InternalWeakMap(); + nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value); + } else nativeSet.call(this, key, value); + return this; + } + }); +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/esnext.symbol.async-dispose.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/esnext.symbol.async-dispose.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.asyncDispose` well-known symbol +// https://github.com/tc39/proposal-using-statement +defineWellKnownSymbol('asyncDispose'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/esnext.symbol.dispose.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/esnext.symbol.dispose.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.dispose` well-known symbol +// https://github.com/tc39/proposal-using-statement +defineWellKnownSymbol('dispose'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/esnext.symbol.observable.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/esnext.symbol.observable.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.observable` well-known symbol +// https://github.com/tc39/proposal-observable +defineWellKnownSymbol('observable'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/esnext.symbol.pattern-match.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/esnext.symbol.pattern-match.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +// `Symbol.patternMatch` well-known symbol +// https://github.com/tc39/proposal-pattern-matching +defineWellKnownSymbol('patternMatch'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/esnext.symbol.replace-all.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/esnext.symbol.replace-all.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// TODO: remove from `core-js@4` +var defineWellKnownSymbol = __webpack_require__(/*! ../internals/define-well-known-symbol */ "../../node_modules/core-js/internals/define-well-known-symbol.js"); + +defineWellKnownSymbol('replaceAll'); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/web.dom-collections.for-each.js": +/*!****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/web.dom-collections.for-each.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "../../node_modules/core-js/internals/dom-iterables.js"); +var forEach = __webpack_require__(/*! ../internals/array-for-each */ "../../node_modules/core-js/internals/array-for-each.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); + +for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try { + createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach); + } catch (error) { + CollectionPrototype.forEach = forEach; + } +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/web.dom-collections.iterator.js": +/*!****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/web.dom-collections.iterator.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var DOMIterables = __webpack_require__(/*! ../internals/dom-iterables */ "../../node_modules/core-js/internals/dom-iterables.js"); +var ArrayIteratorMethods = __webpack_require__(/*! ../modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); +var createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ "../../node_modules/core-js/internals/create-non-enumerable-property.js"); +var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "../../node_modules/core-js/internals/well-known-symbol.js"); + +var ITERATOR = wellKnownSymbol('iterator'); +var TO_STRING_TAG = wellKnownSymbol('toStringTag'); +var ArrayValues = ArrayIteratorMethods.values; + +for (var COLLECTION_NAME in DOMIterables) { + var Collection = global[COLLECTION_NAME]; + var CollectionPrototype = Collection && Collection.prototype; + if (CollectionPrototype) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[ITERATOR] !== ArrayValues) try { + createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues); + } catch (error) { + CollectionPrototype[ITERATOR] = ArrayValues; + } + if (!CollectionPrototype[TO_STRING_TAG]) { + createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); + } + if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) { + // some Chrome versions have non-configurable methods on DOMTokenList + if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try { + createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]); + } catch (error) { + CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME]; + } + } + } +} + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/web.immediate.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/web.immediate.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var task = __webpack_require__(/*! ../internals/task */ "../../node_modules/core-js/internals/task.js"); + +var FORCED = !global.setImmediate || !global.clearImmediate; + +// http://w3c.github.io/setImmediate/ +$({ global: true, bind: true, enumerable: true, forced: FORCED }, { + // `setImmediate` method + // http://w3c.github.io/setImmediate/#si-setImmediate + setImmediate: task.set, + // `clearImmediate` method + // http://w3c.github.io/setImmediate/#si-clearImmediate + clearImmediate: task.clear +}); + + +/***/ }), + +/***/ "../../node_modules/core-js/modules/web.timers.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/core-js/modules/web.timers.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $ = __webpack_require__(/*! ../internals/export */ "../../node_modules/core-js/internals/export.js"); +var global = __webpack_require__(/*! ../internals/global */ "../../node_modules/core-js/internals/global.js"); +var userAgent = __webpack_require__(/*! ../internals/user-agent */ "../../node_modules/core-js/internals/user-agent.js"); + +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check + +var wrap = function (scheduler) { + return function (handler, timeout /* , ...arguments */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : undefined; + return scheduler(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof handler == 'function' ? handler : Function(handler)).apply(this, args); + } : handler, timeout); + }; +}; + +// ie9- setTimeout & setInterval additional parameters fix +// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers +$({ global: true, bind: true, forced: MSIE }, { + // `setTimeout` method + // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout + setTimeout: wrap(global.setTimeout), + // `setInterval` method + // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval + setInterval: wrap(global.setInterval) +}); + + +/***/ }), + +/***/ "../../node_modules/define-properties/index.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/define-properties/index.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var keys = __webpack_require__(/*! object-keys */ "../../node_modules/object-keys/index.js"); +var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; + +var toStr = Object.prototype.toString; +var concat = Array.prototype.concat; +var origDefineProperty = Object.defineProperty; + +var isFunction = function (fn) { + return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; +}; + +var arePropertyDescriptorsSupported = function () { + var obj = {}; + try { + origDefineProperty(obj, 'x', { enumerable: false, value: obj }); + // eslint-disable-next-line no-unused-vars, no-restricted-syntax + for (var _ in obj) { // jscs:ignore disallowUnusedVariables + return false; + } + return obj.x === obj; + } catch (e) { /* this is IE 8. */ + return false; + } +}; +var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); + +var defineProperty = function (object, name, value, predicate) { + if (name in object && (!isFunction(predicate) || !predicate())) { + return; + } + if (supportsDescriptors) { + origDefineProperty(object, name, { + configurable: true, + enumerable: false, + value: value, + writable: true + }); + } else { + object[name] = value; + } +}; + +var defineProperties = function (object, map) { + var predicates = arguments.length > 2 ? arguments[2] : {}; + var props = keys(map); + if (hasSymbols) { + props = concat.call(props, Object.getOwnPropertySymbols(map)); + } + for (var i = 0; i < props.length; i += 1) { + defineProperty(object, props[i], map[props[i]], predicates[props[i]]); + } +}; + +defineProperties.supportsDescriptors = !!supportsDescriptors; + +module.exports = defineProperties; + + +/***/ }), + +/***/ "../../node_modules/entities/index.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/entities/index.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var encode = __webpack_require__(/*! ./lib/encode.js */ "../../node_modules/entities/lib/encode.js"), + decode = __webpack_require__(/*! ./lib/decode.js */ "../../node_modules/entities/lib/decode.js"); + +exports.decode = function(data, level) { + return (!level || level <= 0 ? decode.XML : decode.HTML)(data); +}; + +exports.decodeStrict = function(data, level) { + return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data); +}; + +exports.encode = function(data, level) { + return (!level || level <= 0 ? encode.XML : encode.HTML)(data); +}; + +exports.encodeXML = encode.XML; + +exports.encodeHTML4 = exports.encodeHTML5 = exports.encodeHTML = encode.HTML; + +exports.decodeXML = exports.decodeXMLStrict = decode.XML; + +exports.decodeHTML4 = exports.decodeHTML5 = exports.decodeHTML = decode.HTML; + +exports.decodeHTML4Strict = exports.decodeHTML5Strict = exports.decodeHTMLStrict = decode.HTMLStrict; + +exports.escape = encode.escape; + + +/***/ }), + +/***/ "../../node_modules/entities/lib/decode.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/entities/lib/decode.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var entityMap = __webpack_require__(/*! ../maps/entities.json */ "../../node_modules/entities/maps/entities.json"), + legacyMap = __webpack_require__(/*! ../maps/legacy.json */ "../../node_modules/entities/maps/legacy.json"), + xmlMap = __webpack_require__(/*! ../maps/xml.json */ "../../node_modules/entities/maps/xml.json"), + decodeCodePoint = __webpack_require__(/*! ./decode_codepoint.js */ "../../node_modules/entities/lib/decode_codepoint.js"); + +var decodeXMLStrict = getStrictDecoder(xmlMap), + decodeHTMLStrict = getStrictDecoder(entityMap); + +function getStrictDecoder(map) { + var keys = Object.keys(map).join("|"), + replace = getReplacer(map); + + keys += "|#[xX][\\da-fA-F]+|#\\d+"; + + var re = new RegExp("&(?:" + keys + ");", "g"); + + return function(str) { + return String(str).replace(re, replace); + }; +} + +var decodeHTML = (function() { + var legacy = Object.keys(legacyMap).sort(sorter); + + var keys = Object.keys(entityMap).sort(sorter); + + for (var i = 0, j = 0; i < keys.length; i++) { + if (legacy[j] === keys[i]) { + keys[i] += ";?"; + j++; + } else { + keys[i] += ";"; + } + } + + var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), + replace = getReplacer(entityMap); + + function replacer(str) { + if (str.substr(-1) !== ";") str += ";"; + return replace(str); + } + + //TODO consider creating a merged map + return function(str) { + return String(str).replace(re, replacer); + }; +})(); + +function sorter(a, b) { + return a < b ? 1 : -1; +} + +function getReplacer(map) { + return function replace(str) { + if (str.charAt(1) === "#") { + if (str.charAt(2) === "X" || str.charAt(2) === "x") { + return decodeCodePoint(parseInt(str.substr(3), 16)); + } + return decodeCodePoint(parseInt(str.substr(2), 10)); + } + return map[str.slice(1, -1)]; + }; +} + +module.exports = { + XML: decodeXMLStrict, + HTML: decodeHTML, + HTMLStrict: decodeHTMLStrict +}; + + +/***/ }), + +/***/ "../../node_modules/entities/lib/decode_codepoint.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/entities/lib/decode_codepoint.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var decodeMap = __webpack_require__(/*! ../maps/decode.json */ "../../node_modules/entities/maps/decode.json"); + +module.exports = decodeCodePoint; + +// modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119 +function decodeCodePoint(codePoint) { + if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) { + return "\uFFFD"; + } + + if (codePoint in decodeMap) { + codePoint = decodeMap[codePoint]; + } + + var output = ""; + + if (codePoint > 0xffff) { + codePoint -= 0x10000; + output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800); + codePoint = 0xdc00 | (codePoint & 0x3ff); + } + + output += String.fromCharCode(codePoint); + return output; +} + + +/***/ }), + +/***/ "../../node_modules/entities/lib/encode.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/entities/lib/encode.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var inverseXML = getInverseObj(__webpack_require__(/*! ../maps/xml.json */ "../../node_modules/entities/maps/xml.json")), + xmlReplacer = getInverseReplacer(inverseXML); + +exports.XML = getInverse(inverseXML, xmlReplacer); + +var inverseHTML = getInverseObj(__webpack_require__(/*! ../maps/entities.json */ "../../node_modules/entities/maps/entities.json")), + htmlReplacer = getInverseReplacer(inverseHTML); + +exports.HTML = getInverse(inverseHTML, htmlReplacer); + +function getInverseObj(obj) { + return Object.keys(obj) + .sort() + .reduce(function(inverse, name) { + inverse[obj[name]] = "&" + name + ";"; + return inverse; + }, {}); +} + +function getInverseReplacer(inverse) { + var single = [], + multiple = []; + + Object.keys(inverse).forEach(function(k) { + if (k.length === 1) { + single.push("\\" + k); + } else { + multiple.push(k); + } + }); + + //TODO add ranges + multiple.unshift("[" + single.join("") + "]"); + + return new RegExp(multiple.join("|"), "g"); +} + +var re_nonASCII = /[^\0-\x7F]/g, + re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + +function singleCharReplacer(c) { + return ( + "&#x" + + c + .charCodeAt(0) + .toString(16) + .toUpperCase() + + ";" + ); +} + +function astralReplacer(c) { + // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae + var high = c.charCodeAt(0); + var low = c.charCodeAt(1); + var codePoint = (high - 0xd800) * 0x400 + low - 0xdc00 + 0x10000; + return "&#x" + codePoint.toString(16).toUpperCase() + ";"; +} + +function getInverse(inverse, re) { + function func(name) { + return inverse[name]; + } + + return function(data) { + return data + .replace(re, func) + .replace(re_astralSymbols, astralReplacer) + .replace(re_nonASCII, singleCharReplacer); + }; +} + +var re_xmlChars = getInverseReplacer(inverseXML); + +function escapeXML(data) { + return data + .replace(re_xmlChars, singleCharReplacer) + .replace(re_astralSymbols, astralReplacer) + .replace(re_nonASCII, singleCharReplacer); +} + +exports.escape = escapeXML; + + +/***/ }), + +/***/ "../../node_modules/entities/maps/decode.json": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/entities/maps/decode.json ***! + \******************************************************************************/ +/*! exports provided: 0, 128, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 142, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 158, 159, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"0\":65533,\"128\":8364,\"130\":8218,\"131\":402,\"132\":8222,\"133\":8230,\"134\":8224,\"135\":8225,\"136\":710,\"137\":8240,\"138\":352,\"139\":8249,\"140\":338,\"142\":381,\"145\":8216,\"146\":8217,\"147\":8220,\"148\":8221,\"149\":8226,\"150\":8211,\"151\":8212,\"152\":732,\"153\":8482,\"154\":353,\"155\":8250,\"156\":339,\"158\":382,\"159\":376}"); + +/***/ }), + +/***/ "../../node_modules/entities/maps/entities.json": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/entities/maps/entities.json ***! + \********************************************************************************/ +/*! exports provided: Aacute, aacute, Abreve, abreve, ac, acd, acE, Acirc, acirc, acute, Acy, acy, AElig, aelig, af, Afr, afr, Agrave, agrave, alefsym, aleph, Alpha, alpha, Amacr, amacr, amalg, amp, AMP, andand, And, and, andd, andslope, andv, ang, ange, angle, angmsdaa, angmsdab, angmsdac, angmsdad, angmsdae, angmsdaf, angmsdag, angmsdah, angmsd, angrt, angrtvb, angrtvbd, angsph, angst, angzarr, Aogon, aogon, Aopf, aopf, apacir, ap, apE, ape, apid, apos, ApplyFunction, approx, approxeq, Aring, aring, Ascr, ascr, Assign, ast, asymp, asympeq, Atilde, atilde, Auml, auml, awconint, awint, backcong, backepsilon, backprime, backsim, backsimeq, Backslash, Barv, barvee, barwed, Barwed, barwedge, bbrk, bbrktbrk, bcong, Bcy, bcy, bdquo, becaus, because, Because, bemptyv, bepsi, bernou, Bernoullis, Beta, beta, beth, between, Bfr, bfr, bigcap, bigcirc, bigcup, bigodot, bigoplus, bigotimes, bigsqcup, bigstar, bigtriangledown, bigtriangleup, biguplus, bigvee, bigwedge, bkarow, blacklozenge, blacksquare, blacktriangle, blacktriangledown, blacktriangleleft, blacktriangleright, blank, blk12, blk14, blk34, block, bne, bnequiv, bNot, bnot, Bopf, bopf, bot, bottom, bowtie, boxbox, boxdl, boxdL, boxDl, boxDL, boxdr, boxdR, boxDr, boxDR, boxh, boxH, boxhd, boxHd, boxhD, boxHD, boxhu, boxHu, boxhU, boxHU, boxminus, boxplus, boxtimes, boxul, boxuL, boxUl, boxUL, boxur, boxuR, boxUr, boxUR, boxv, boxV, boxvh, boxvH, boxVh, boxVH, boxvl, boxvL, boxVl, boxVL, boxvr, boxvR, boxVr, boxVR, bprime, breve, Breve, brvbar, bscr, Bscr, bsemi, bsim, bsime, bsolb, bsol, bsolhsub, bull, bullet, bump, bumpE, bumpe, Bumpeq, bumpeq, Cacute, cacute, capand, capbrcup, capcap, cap, Cap, capcup, capdot, CapitalDifferentialD, caps, caret, caron, Cayleys, ccaps, Ccaron, ccaron, Ccedil, ccedil, Ccirc, ccirc, Cconint, ccups, ccupssm, Cdot, cdot, cedil, Cedilla, cemptyv, cent, centerdot, CenterDot, cfr, Cfr, CHcy, chcy, check, checkmark, Chi, chi, circ, circeq, circlearrowleft, circlearrowright, circledast, circledcirc, circleddash, CircleDot, circledR, circledS, CircleMinus, CirclePlus, CircleTimes, cir, cirE, cire, cirfnint, cirmid, cirscir, ClockwiseContourIntegral, CloseCurlyDoubleQuote, CloseCurlyQuote, clubs, clubsuit, colon, Colon, Colone, colone, coloneq, comma, commat, comp, compfn, complement, complexes, cong, congdot, Congruent, conint, Conint, ContourIntegral, copf, Copf, coprod, Coproduct, copy, COPY, copysr, CounterClockwiseContourIntegral, crarr, cross, Cross, Cscr, cscr, csub, csube, csup, csupe, ctdot, cudarrl, cudarrr, cuepr, cuesc, cularr, cularrp, cupbrcap, cupcap, CupCap, cup, Cup, cupcup, cupdot, cupor, cups, curarr, curarrm, curlyeqprec, curlyeqsucc, curlyvee, curlywedge, curren, curvearrowleft, curvearrowright, cuvee, cuwed, cwconint, cwint, cylcty, dagger, Dagger, daleth, darr, Darr, dArr, dash, Dashv, dashv, dbkarow, dblac, Dcaron, dcaron, Dcy, dcy, ddagger, ddarr, DD, dd, DDotrahd, ddotseq, deg, Del, Delta, delta, demptyv, dfisht, Dfr, dfr, dHar, dharl, dharr, DiacriticalAcute, DiacriticalDot, DiacriticalDoubleAcute, DiacriticalGrave, DiacriticalTilde, diam, diamond, Diamond, diamondsuit, diams, die, DifferentialD, digamma, disin, div, divide, divideontimes, divonx, DJcy, djcy, dlcorn, dlcrop, dollar, Dopf, dopf, Dot, dot, DotDot, doteq, doteqdot, DotEqual, dotminus, dotplus, dotsquare, doublebarwedge, DoubleContourIntegral, DoubleDot, DoubleDownArrow, DoubleLeftArrow, DoubleLeftRightArrow, DoubleLeftTee, DoubleLongLeftArrow, DoubleLongLeftRightArrow, DoubleLongRightArrow, DoubleRightArrow, DoubleRightTee, DoubleUpArrow, DoubleUpDownArrow, DoubleVerticalBar, DownArrowBar, downarrow, DownArrow, Downarrow, DownArrowUpArrow, DownBreve, downdownarrows, downharpoonleft, downharpoonright, DownLeftRightVector, DownLeftTeeVector, DownLeftVectorBar, DownLeftVector, DownRightTeeVector, DownRightVectorBar, DownRightVector, DownTeeArrow, DownTee, drbkarow, drcorn, drcrop, Dscr, dscr, DScy, dscy, dsol, Dstrok, dstrok, dtdot, dtri, dtrif, duarr, duhar, dwangle, DZcy, dzcy, dzigrarr, Eacute, eacute, easter, Ecaron, ecaron, Ecirc, ecirc, ecir, ecolon, Ecy, ecy, eDDot, Edot, edot, eDot, ee, efDot, Efr, efr, eg, Egrave, egrave, egs, egsdot, el, Element, elinters, ell, els, elsdot, Emacr, emacr, empty, emptyset, EmptySmallSquare, emptyv, EmptyVerySmallSquare, emsp13, emsp14, emsp, ENG, eng, ensp, Eogon, eogon, Eopf, eopf, epar, eparsl, eplus, epsi, Epsilon, epsilon, epsiv, eqcirc, eqcolon, eqsim, eqslantgtr, eqslantless, Equal, equals, EqualTilde, equest, Equilibrium, equiv, equivDD, eqvparsl, erarr, erDot, escr, Escr, esdot, Esim, esim, Eta, eta, ETH, eth, Euml, euml, euro, excl, exist, Exists, expectation, exponentiale, ExponentialE, fallingdotseq, Fcy, fcy, female, ffilig, fflig, ffllig, Ffr, ffr, filig, FilledSmallSquare, FilledVerySmallSquare, fjlig, flat, fllig, fltns, fnof, Fopf, fopf, forall, ForAll, fork, forkv, Fouriertrf, fpartint, frac12, frac13, frac14, frac15, frac16, frac18, frac23, frac25, frac34, frac35, frac38, frac45, frac56, frac58, frac78, frasl, frown, fscr, Fscr, gacute, Gamma, gamma, Gammad, gammad, gap, Gbreve, gbreve, Gcedil, Gcirc, gcirc, Gcy, gcy, Gdot, gdot, ge, gE, gEl, gel, geq, geqq, geqslant, gescc, ges, gesdot, gesdoto, gesdotol, gesl, gesles, Gfr, gfr, gg, Gg, ggg, gimel, GJcy, gjcy, gla, gl, glE, glj, gnap, gnapprox, gne, gnE, gneq, gneqq, gnsim, Gopf, gopf, grave, GreaterEqual, GreaterEqualLess, GreaterFullEqual, GreaterGreater, GreaterLess, GreaterSlantEqual, GreaterTilde, Gscr, gscr, gsim, gsime, gsiml, gtcc, gtcir, gt, GT, Gt, gtdot, gtlPar, gtquest, gtrapprox, gtrarr, gtrdot, gtreqless, gtreqqless, gtrless, gtrsim, gvertneqq, gvnE, Hacek, hairsp, half, hamilt, HARDcy, hardcy, harrcir, harr, hArr, harrw, Hat, hbar, Hcirc, hcirc, hearts, heartsuit, hellip, hercon, hfr, Hfr, HilbertSpace, hksearow, hkswarow, hoarr, homtht, hookleftarrow, hookrightarrow, hopf, Hopf, horbar, HorizontalLine, hscr, Hscr, hslash, Hstrok, hstrok, HumpDownHump, HumpEqual, hybull, hyphen, Iacute, iacute, ic, Icirc, icirc, Icy, icy, Idot, IEcy, iecy, iexcl, iff, ifr, Ifr, Igrave, igrave, ii, iiiint, iiint, iinfin, iiota, IJlig, ijlig, Imacr, imacr, image, ImaginaryI, imagline, imagpart, imath, Im, imof, imped, Implies, incare, in, infin, infintie, inodot, intcal, int, Int, integers, Integral, intercal, Intersection, intlarhk, intprod, InvisibleComma, InvisibleTimes, IOcy, iocy, Iogon, iogon, Iopf, iopf, Iota, iota, iprod, iquest, iscr, Iscr, isin, isindot, isinE, isins, isinsv, isinv, it, Itilde, itilde, Iukcy, iukcy, Iuml, iuml, Jcirc, jcirc, Jcy, jcy, Jfr, jfr, jmath, Jopf, jopf, Jscr, jscr, Jsercy, jsercy, Jukcy, jukcy, Kappa, kappa, kappav, Kcedil, kcedil, Kcy, kcy, Kfr, kfr, kgreen, KHcy, khcy, KJcy, kjcy, Kopf, kopf, Kscr, kscr, lAarr, Lacute, lacute, laemptyv, lagran, Lambda, lambda, lang, Lang, langd, langle, lap, Laplacetrf, laquo, larrb, larrbfs, larr, Larr, lArr, larrfs, larrhk, larrlp, larrpl, larrsim, larrtl, latail, lAtail, lat, late, lates, lbarr, lBarr, lbbrk, lbrace, lbrack, lbrke, lbrksld, lbrkslu, Lcaron, lcaron, Lcedil, lcedil, lceil, lcub, Lcy, lcy, ldca, ldquo, ldquor, ldrdhar, ldrushar, ldsh, le, lE, LeftAngleBracket, LeftArrowBar, leftarrow, LeftArrow, Leftarrow, LeftArrowRightArrow, leftarrowtail, LeftCeiling, LeftDoubleBracket, LeftDownTeeVector, LeftDownVectorBar, LeftDownVector, LeftFloor, leftharpoondown, leftharpoonup, leftleftarrows, leftrightarrow, LeftRightArrow, Leftrightarrow, leftrightarrows, leftrightharpoons, leftrightsquigarrow, LeftRightVector, LeftTeeArrow, LeftTee, LeftTeeVector, leftthreetimes, LeftTriangleBar, LeftTriangle, LeftTriangleEqual, LeftUpDownVector, LeftUpTeeVector, LeftUpVectorBar, LeftUpVector, LeftVectorBar, LeftVector, lEg, leg, leq, leqq, leqslant, lescc, les, lesdot, lesdoto, lesdotor, lesg, lesges, lessapprox, lessdot, lesseqgtr, lesseqqgtr, LessEqualGreater, LessFullEqual, LessGreater, lessgtr, LessLess, lesssim, LessSlantEqual, LessTilde, lfisht, lfloor, Lfr, lfr, lg, lgE, lHar, lhard, lharu, lharul, lhblk, LJcy, ljcy, llarr, ll, Ll, llcorner, Lleftarrow, llhard, lltri, Lmidot, lmidot, lmoustache, lmoust, lnap, lnapprox, lne, lnE, lneq, lneqq, lnsim, loang, loarr, lobrk, longleftarrow, LongLeftArrow, Longleftarrow, longleftrightarrow, LongLeftRightArrow, Longleftrightarrow, longmapsto, longrightarrow, LongRightArrow, Longrightarrow, looparrowleft, looparrowright, lopar, Lopf, lopf, loplus, lotimes, lowast, lowbar, LowerLeftArrow, LowerRightArrow, loz, lozenge, lozf, lpar, lparlt, lrarr, lrcorner, lrhar, lrhard, lrm, lrtri, lsaquo, lscr, Lscr, lsh, Lsh, lsim, lsime, lsimg, lsqb, lsquo, lsquor, Lstrok, lstrok, ltcc, ltcir, lt, LT, Lt, ltdot, lthree, ltimes, ltlarr, ltquest, ltri, ltrie, ltrif, ltrPar, lurdshar, luruhar, lvertneqq, lvnE, macr, male, malt, maltese, Map, map, mapsto, mapstodown, mapstoleft, mapstoup, marker, mcomma, Mcy, mcy, mdash, mDDot, measuredangle, MediumSpace, Mellintrf, Mfr, mfr, mho, micro, midast, midcir, mid, middot, minusb, minus, minusd, minusdu, MinusPlus, mlcp, mldr, mnplus, models, Mopf, mopf, mp, mscr, Mscr, mstpos, Mu, mu, multimap, mumap, nabla, Nacute, nacute, nang, nap, napE, napid, napos, napprox, natural, naturals, natur, nbsp, nbump, nbumpe, ncap, Ncaron, ncaron, Ncedil, ncedil, ncong, ncongdot, ncup, Ncy, ncy, ndash, nearhk, nearr, neArr, nearrow, ne, nedot, NegativeMediumSpace, NegativeThickSpace, NegativeThinSpace, NegativeVeryThinSpace, nequiv, nesear, nesim, NestedGreaterGreater, NestedLessLess, NewLine, nexist, nexists, Nfr, nfr, ngE, nge, ngeq, ngeqq, ngeqslant, nges, nGg, ngsim, nGt, ngt, ngtr, nGtv, nharr, nhArr, nhpar, ni, nis, nisd, niv, NJcy, njcy, nlarr, nlArr, nldr, nlE, nle, nleftarrow, nLeftarrow, nleftrightarrow, nLeftrightarrow, nleq, nleqq, nleqslant, nles, nless, nLl, nlsim, nLt, nlt, nltri, nltrie, nLtv, nmid, NoBreak, NonBreakingSpace, nopf, Nopf, Not, not, NotCongruent, NotCupCap, NotDoubleVerticalBar, NotElement, NotEqual, NotEqualTilde, NotExists, NotGreater, NotGreaterEqual, NotGreaterFullEqual, NotGreaterGreater, NotGreaterLess, NotGreaterSlantEqual, NotGreaterTilde, NotHumpDownHump, NotHumpEqual, notin, notindot, notinE, notinva, notinvb, notinvc, NotLeftTriangleBar, NotLeftTriangle, NotLeftTriangleEqual, NotLess, NotLessEqual, NotLessGreater, NotLessLess, NotLessSlantEqual, NotLessTilde, NotNestedGreaterGreater, NotNestedLessLess, notni, notniva, notnivb, notnivc, NotPrecedes, NotPrecedesEqual, NotPrecedesSlantEqual, NotReverseElement, NotRightTriangleBar, NotRightTriangle, NotRightTriangleEqual, NotSquareSubset, NotSquareSubsetEqual, NotSquareSuperset, NotSquareSupersetEqual, NotSubset, NotSubsetEqual, NotSucceeds, NotSucceedsEqual, NotSucceedsSlantEqual, NotSucceedsTilde, NotSuperset, NotSupersetEqual, NotTilde, NotTildeEqual, NotTildeFullEqual, NotTildeTilde, NotVerticalBar, nparallel, npar, nparsl, npart, npolint, npr, nprcue, nprec, npreceq, npre, nrarrc, nrarr, nrArr, nrarrw, nrightarrow, nRightarrow, nrtri, nrtrie, nsc, nsccue, nsce, Nscr, nscr, nshortmid, nshortparallel, nsim, nsime, nsimeq, nsmid, nspar, nsqsube, nsqsupe, nsub, nsubE, nsube, nsubset, nsubseteq, nsubseteqq, nsucc, nsucceq, nsup, nsupE, nsupe, nsupset, nsupseteq, nsupseteqq, ntgl, Ntilde, ntilde, ntlg, ntriangleleft, ntrianglelefteq, ntriangleright, ntrianglerighteq, Nu, nu, num, numero, numsp, nvap, nvdash, nvDash, nVdash, nVDash, nvge, nvgt, nvHarr, nvinfin, nvlArr, nvle, nvlt, nvltrie, nvrArr, nvrtrie, nvsim, nwarhk, nwarr, nwArr, nwarrow, nwnear, Oacute, oacute, oast, Ocirc, ocirc, ocir, Ocy, ocy, odash, Odblac, odblac, odiv, odot, odsold, OElig, oelig, ofcir, Ofr, ofr, ogon, Ograve, ograve, ogt, ohbar, ohm, oint, olarr, olcir, olcross, oline, olt, Omacr, omacr, Omega, omega, Omicron, omicron, omid, ominus, Oopf, oopf, opar, OpenCurlyDoubleQuote, OpenCurlyQuote, operp, oplus, orarr, Or, or, ord, order, orderof, ordf, ordm, origof, oror, orslope, orv, oS, Oscr, oscr, Oslash, oslash, osol, Otilde, otilde, otimesas, Otimes, otimes, Ouml, ouml, ovbar, OverBar, OverBrace, OverBracket, OverParenthesis, para, parallel, par, parsim, parsl, part, PartialD, Pcy, pcy, percnt, period, permil, perp, pertenk, Pfr, pfr, Phi, phi, phiv, phmmat, phone, Pi, pi, pitchfork, piv, planck, planckh, plankv, plusacir, plusb, pluscir, plus, plusdo, plusdu, pluse, PlusMinus, plusmn, plussim, plustwo, pm, Poincareplane, pointint, popf, Popf, pound, prap, Pr, pr, prcue, precapprox, prec, preccurlyeq, Precedes, PrecedesEqual, PrecedesSlantEqual, PrecedesTilde, preceq, precnapprox, precneqq, precnsim, pre, prE, precsim, prime, Prime, primes, prnap, prnE, prnsim, prod, Product, profalar, profline, profsurf, prop, Proportional, Proportion, propto, prsim, prurel, Pscr, pscr, Psi, psi, puncsp, Qfr, qfr, qint, qopf, Qopf, qprime, Qscr, qscr, quaternions, quatint, quest, questeq, quot, QUOT, rAarr, race, Racute, racute, radic, raemptyv, rang, Rang, rangd, range, rangle, raquo, rarrap, rarrb, rarrbfs, rarrc, rarr, Rarr, rArr, rarrfs, rarrhk, rarrlp, rarrpl, rarrsim, Rarrtl, rarrtl, rarrw, ratail, rAtail, ratio, rationals, rbarr, rBarr, RBarr, rbbrk, rbrace, rbrack, rbrke, rbrksld, rbrkslu, Rcaron, rcaron, Rcedil, rcedil, rceil, rcub, Rcy, rcy, rdca, rdldhar, rdquo, rdquor, rdsh, real, realine, realpart, reals, Re, rect, reg, REG, ReverseElement, ReverseEquilibrium, ReverseUpEquilibrium, rfisht, rfloor, rfr, Rfr, rHar, rhard, rharu, rharul, Rho, rho, rhov, RightAngleBracket, RightArrowBar, rightarrow, RightArrow, Rightarrow, RightArrowLeftArrow, rightarrowtail, RightCeiling, RightDoubleBracket, RightDownTeeVector, RightDownVectorBar, RightDownVector, RightFloor, rightharpoondown, rightharpoonup, rightleftarrows, rightleftharpoons, rightrightarrows, rightsquigarrow, RightTeeArrow, RightTee, RightTeeVector, rightthreetimes, RightTriangleBar, RightTriangle, RightTriangleEqual, RightUpDownVector, RightUpTeeVector, RightUpVectorBar, RightUpVector, RightVectorBar, RightVector, ring, risingdotseq, rlarr, rlhar, rlm, rmoustache, rmoust, rnmid, roang, roarr, robrk, ropar, ropf, Ropf, roplus, rotimes, RoundImplies, rpar, rpargt, rppolint, rrarr, Rrightarrow, rsaquo, rscr, Rscr, rsh, Rsh, rsqb, rsquo, rsquor, rthree, rtimes, rtri, rtrie, rtrif, rtriltri, RuleDelayed, ruluhar, rx, Sacute, sacute, sbquo, scap, Scaron, scaron, Sc, sc, sccue, sce, scE, Scedil, scedil, Scirc, scirc, scnap, scnE, scnsim, scpolint, scsim, Scy, scy, sdotb, sdot, sdote, searhk, searr, seArr, searrow, sect, semi, seswar, setminus, setmn, sext, Sfr, sfr, sfrown, sharp, SHCHcy, shchcy, SHcy, shcy, ShortDownArrow, ShortLeftArrow, shortmid, shortparallel, ShortRightArrow, ShortUpArrow, shy, Sigma, sigma, sigmaf, sigmav, sim, simdot, sime, simeq, simg, simgE, siml, simlE, simne, simplus, simrarr, slarr, SmallCircle, smallsetminus, smashp, smeparsl, smid, smile, smt, smte, smtes, SOFTcy, softcy, solbar, solb, sol, Sopf, sopf, spades, spadesuit, spar, sqcap, sqcaps, sqcup, sqcups, Sqrt, sqsub, sqsube, sqsubset, sqsubseteq, sqsup, sqsupe, sqsupset, sqsupseteq, square, Square, SquareIntersection, SquareSubset, SquareSubsetEqual, SquareSuperset, SquareSupersetEqual, SquareUnion, squarf, squ, squf, srarr, Sscr, sscr, ssetmn, ssmile, sstarf, Star, star, starf, straightepsilon, straightphi, strns, sub, Sub, subdot, subE, sube, subedot, submult, subnE, subne, subplus, subrarr, subset, Subset, subseteq, subseteqq, SubsetEqual, subsetneq, subsetneqq, subsim, subsub, subsup, succapprox, succ, succcurlyeq, Succeeds, SucceedsEqual, SucceedsSlantEqual, SucceedsTilde, succeq, succnapprox, succneqq, succnsim, succsim, SuchThat, sum, Sum, sung, sup1, sup2, sup3, sup, Sup, supdot, supdsub, supE, supe, supedot, Superset, SupersetEqual, suphsol, suphsub, suplarr, supmult, supnE, supne, supplus, supset, Supset, supseteq, supseteqq, supsetneq, supsetneqq, supsim, supsub, supsup, swarhk, swarr, swArr, swarrow, swnwar, szlig, Tab, target, Tau, tau, tbrk, Tcaron, tcaron, Tcedil, tcedil, Tcy, tcy, tdot, telrec, Tfr, tfr, there4, therefore, Therefore, Theta, theta, thetasym, thetav, thickapprox, thicksim, ThickSpace, ThinSpace, thinsp, thkap, thksim, THORN, thorn, tilde, Tilde, TildeEqual, TildeFullEqual, TildeTilde, timesbar, timesb, times, timesd, tint, toea, topbot, topcir, top, Topf, topf, topfork, tosa, tprime, trade, TRADE, triangle, triangledown, triangleleft, trianglelefteq, triangleq, triangleright, trianglerighteq, tridot, trie, triminus, TripleDot, triplus, trisb, tritime, trpezium, Tscr, tscr, TScy, tscy, TSHcy, tshcy, Tstrok, tstrok, twixt, twoheadleftarrow, twoheadrightarrow, Uacute, uacute, uarr, Uarr, uArr, Uarrocir, Ubrcy, ubrcy, Ubreve, ubreve, Ucirc, ucirc, Ucy, ucy, udarr, Udblac, udblac, udhar, ufisht, Ufr, ufr, Ugrave, ugrave, uHar, uharl, uharr, uhblk, ulcorn, ulcorner, ulcrop, ultri, Umacr, umacr, uml, UnderBar, UnderBrace, UnderBracket, UnderParenthesis, Union, UnionPlus, Uogon, uogon, Uopf, uopf, UpArrowBar, uparrow, UpArrow, Uparrow, UpArrowDownArrow, updownarrow, UpDownArrow, Updownarrow, UpEquilibrium, upharpoonleft, upharpoonright, uplus, UpperLeftArrow, UpperRightArrow, upsi, Upsi, upsih, Upsilon, upsilon, UpTeeArrow, UpTee, upuparrows, urcorn, urcorner, urcrop, Uring, uring, urtri, Uscr, uscr, utdot, Utilde, utilde, utri, utrif, uuarr, Uuml, uuml, uwangle, vangrt, varepsilon, varkappa, varnothing, varphi, varpi, varpropto, varr, vArr, varrho, varsigma, varsubsetneq, varsubsetneqq, varsupsetneq, varsupsetneqq, vartheta, vartriangleleft, vartriangleright, vBar, Vbar, vBarv, Vcy, vcy, vdash, vDash, Vdash, VDash, Vdashl, veebar, vee, Vee, veeeq, vellip, verbar, Verbar, vert, Vert, VerticalBar, VerticalLine, VerticalSeparator, VerticalTilde, VeryThinSpace, Vfr, vfr, vltri, vnsub, vnsup, Vopf, vopf, vprop, vrtri, Vscr, vscr, vsubnE, vsubne, vsupnE, vsupne, Vvdash, vzigzag, Wcirc, wcirc, wedbar, wedge, Wedge, wedgeq, weierp, Wfr, wfr, Wopf, wopf, wp, wr, wreath, Wscr, wscr, xcap, xcirc, xcup, xdtri, Xfr, xfr, xharr, xhArr, Xi, xi, xlarr, xlArr, xmap, xnis, xodot, Xopf, xopf, xoplus, xotime, xrarr, xrArr, Xscr, xscr, xsqcup, xuplus, xutri, xvee, xwedge, Yacute, yacute, YAcy, yacy, Ycirc, ycirc, Ycy, ycy, yen, Yfr, yfr, YIcy, yicy, Yopf, yopf, Yscr, yscr, YUcy, yucy, yuml, Yuml, Zacute, zacute, Zcaron, zcaron, Zcy, zcy, Zdot, zdot, zeetrf, ZeroWidthSpace, Zeta, zeta, zfr, Zfr, ZHcy, zhcy, zigrarr, zopf, Zopf, Zscr, zscr, zwj, zwnj, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Abreve\":\"Ă\",\"abreve\":\"ă\",\"ac\":\"∾\",\"acd\":\"∿\",\"acE\":\"∾̳\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"Acy\":\"А\",\"acy\":\"а\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"af\":\"⁡\",\"Afr\":\"𝔄\",\"afr\":\"𝔞\",\"Agrave\":\"À\",\"agrave\":\"à\",\"alefsym\":\"ℵ\",\"aleph\":\"ℵ\",\"Alpha\":\"Α\",\"alpha\":\"α\",\"Amacr\":\"Ā\",\"amacr\":\"ā\",\"amalg\":\"⨿\",\"amp\":\"&\",\"AMP\":\"&\",\"andand\":\"⩕\",\"And\":\"⩓\",\"and\":\"∧\",\"andd\":\"⩜\",\"andslope\":\"⩘\",\"andv\":\"⩚\",\"ang\":\"∠\",\"ange\":\"⦤\",\"angle\":\"∠\",\"angmsdaa\":\"⦨\",\"angmsdab\":\"⦩\",\"angmsdac\":\"⦪\",\"angmsdad\":\"⦫\",\"angmsdae\":\"⦬\",\"angmsdaf\":\"⦭\",\"angmsdag\":\"⦮\",\"angmsdah\":\"⦯\",\"angmsd\":\"∡\",\"angrt\":\"∟\",\"angrtvb\":\"⊾\",\"angrtvbd\":\"⦝\",\"angsph\":\"∢\",\"angst\":\"Å\",\"angzarr\":\"⍼\",\"Aogon\":\"Ą\",\"aogon\":\"ą\",\"Aopf\":\"𝔸\",\"aopf\":\"𝕒\",\"apacir\":\"⩯\",\"ap\":\"≈\",\"apE\":\"⩰\",\"ape\":\"≊\",\"apid\":\"≋\",\"apos\":\"'\",\"ApplyFunction\":\"⁡\",\"approx\":\"≈\",\"approxeq\":\"≊\",\"Aring\":\"Å\",\"aring\":\"å\",\"Ascr\":\"𝒜\",\"ascr\":\"𝒶\",\"Assign\":\"≔\",\"ast\":\"*\",\"asymp\":\"≈\",\"asympeq\":\"≍\",\"Atilde\":\"Ã\",\"atilde\":\"ã\",\"Auml\":\"Ä\",\"auml\":\"ä\",\"awconint\":\"∳\",\"awint\":\"⨑\",\"backcong\":\"≌\",\"backepsilon\":\"϶\",\"backprime\":\"‵\",\"backsim\":\"∽\",\"backsimeq\":\"⋍\",\"Backslash\":\"∖\",\"Barv\":\"⫧\",\"barvee\":\"⊽\",\"barwed\":\"⌅\",\"Barwed\":\"⌆\",\"barwedge\":\"⌅\",\"bbrk\":\"⎵\",\"bbrktbrk\":\"⎶\",\"bcong\":\"≌\",\"Bcy\":\"Б\",\"bcy\":\"б\",\"bdquo\":\"„\",\"becaus\":\"∵\",\"because\":\"∵\",\"Because\":\"∵\",\"bemptyv\":\"⦰\",\"bepsi\":\"϶\",\"bernou\":\"ℬ\",\"Bernoullis\":\"ℬ\",\"Beta\":\"Β\",\"beta\":\"β\",\"beth\":\"ℶ\",\"between\":\"≬\",\"Bfr\":\"𝔅\",\"bfr\":\"𝔟\",\"bigcap\":\"⋂\",\"bigcirc\":\"◯\",\"bigcup\":\"⋃\",\"bigodot\":\"⨀\",\"bigoplus\":\"⨁\",\"bigotimes\":\"⨂\",\"bigsqcup\":\"⨆\",\"bigstar\":\"★\",\"bigtriangledown\":\"▽\",\"bigtriangleup\":\"△\",\"biguplus\":\"⨄\",\"bigvee\":\"⋁\",\"bigwedge\":\"⋀\",\"bkarow\":\"⤍\",\"blacklozenge\":\"⧫\",\"blacksquare\":\"▪\",\"blacktriangle\":\"▴\",\"blacktriangledown\":\"▾\",\"blacktriangleleft\":\"◂\",\"blacktriangleright\":\"▸\",\"blank\":\"␣\",\"blk12\":\"▒\",\"blk14\":\"░\",\"blk34\":\"▓\",\"block\":\"█\",\"bne\":\"=⃥\",\"bnequiv\":\"≡⃥\",\"bNot\":\"⫭\",\"bnot\":\"⌐\",\"Bopf\":\"𝔹\",\"bopf\":\"𝕓\",\"bot\":\"⊥\",\"bottom\":\"⊥\",\"bowtie\":\"⋈\",\"boxbox\":\"⧉\",\"boxdl\":\"┐\",\"boxdL\":\"╕\",\"boxDl\":\"╖\",\"boxDL\":\"╗\",\"boxdr\":\"┌\",\"boxdR\":\"╒\",\"boxDr\":\"╓\",\"boxDR\":\"╔\",\"boxh\":\"─\",\"boxH\":\"═\",\"boxhd\":\"┬\",\"boxHd\":\"╤\",\"boxhD\":\"╥\",\"boxHD\":\"╦\",\"boxhu\":\"┴\",\"boxHu\":\"╧\",\"boxhU\":\"╨\",\"boxHU\":\"╩\",\"boxminus\":\"⊟\",\"boxplus\":\"⊞\",\"boxtimes\":\"⊠\",\"boxul\":\"┘\",\"boxuL\":\"╛\",\"boxUl\":\"╜\",\"boxUL\":\"╝\",\"boxur\":\"└\",\"boxuR\":\"╘\",\"boxUr\":\"╙\",\"boxUR\":\"╚\",\"boxv\":\"│\",\"boxV\":\"║\",\"boxvh\":\"┼\",\"boxvH\":\"╪\",\"boxVh\":\"╫\",\"boxVH\":\"╬\",\"boxvl\":\"┤\",\"boxvL\":\"╡\",\"boxVl\":\"╢\",\"boxVL\":\"╣\",\"boxvr\":\"├\",\"boxvR\":\"╞\",\"boxVr\":\"╟\",\"boxVR\":\"╠\",\"bprime\":\"‵\",\"breve\":\"˘\",\"Breve\":\"˘\",\"brvbar\":\"¦\",\"bscr\":\"𝒷\",\"Bscr\":\"ℬ\",\"bsemi\":\"⁏\",\"bsim\":\"∽\",\"bsime\":\"⋍\",\"bsolb\":\"⧅\",\"bsol\":\"\\\\\",\"bsolhsub\":\"⟈\",\"bull\":\"•\",\"bullet\":\"•\",\"bump\":\"≎\",\"bumpE\":\"⪮\",\"bumpe\":\"≏\",\"Bumpeq\":\"≎\",\"bumpeq\":\"≏\",\"Cacute\":\"Ć\",\"cacute\":\"ć\",\"capand\":\"⩄\",\"capbrcup\":\"⩉\",\"capcap\":\"⩋\",\"cap\":\"∩\",\"Cap\":\"⋒\",\"capcup\":\"⩇\",\"capdot\":\"⩀\",\"CapitalDifferentialD\":\"ⅅ\",\"caps\":\"∩︀\",\"caret\":\"⁁\",\"caron\":\"ˇ\",\"Cayleys\":\"ℭ\",\"ccaps\":\"⩍\",\"Ccaron\":\"Č\",\"ccaron\":\"č\",\"Ccedil\":\"Ç\",\"ccedil\":\"ç\",\"Ccirc\":\"Ĉ\",\"ccirc\":\"ĉ\",\"Cconint\":\"∰\",\"ccups\":\"⩌\",\"ccupssm\":\"⩐\",\"Cdot\":\"Ċ\",\"cdot\":\"ċ\",\"cedil\":\"¸\",\"Cedilla\":\"¸\",\"cemptyv\":\"⦲\",\"cent\":\"¢\",\"centerdot\":\"·\",\"CenterDot\":\"·\",\"cfr\":\"𝔠\",\"Cfr\":\"ℭ\",\"CHcy\":\"Ч\",\"chcy\":\"ч\",\"check\":\"✓\",\"checkmark\":\"✓\",\"Chi\":\"Χ\",\"chi\":\"χ\",\"circ\":\"ˆ\",\"circeq\":\"≗\",\"circlearrowleft\":\"↺\",\"circlearrowright\":\"↻\",\"circledast\":\"⊛\",\"circledcirc\":\"⊚\",\"circleddash\":\"⊝\",\"CircleDot\":\"⊙\",\"circledR\":\"®\",\"circledS\":\"Ⓢ\",\"CircleMinus\":\"⊖\",\"CirclePlus\":\"⊕\",\"CircleTimes\":\"⊗\",\"cir\":\"○\",\"cirE\":\"⧃\",\"cire\":\"≗\",\"cirfnint\":\"⨐\",\"cirmid\":\"⫯\",\"cirscir\":\"⧂\",\"ClockwiseContourIntegral\":\"∲\",\"CloseCurlyDoubleQuote\":\"”\",\"CloseCurlyQuote\":\"’\",\"clubs\":\"♣\",\"clubsuit\":\"♣\",\"colon\":\":\",\"Colon\":\"∷\",\"Colone\":\"⩴\",\"colone\":\"≔\",\"coloneq\":\"≔\",\"comma\":\",\",\"commat\":\"@\",\"comp\":\"∁\",\"compfn\":\"∘\",\"complement\":\"∁\",\"complexes\":\"ℂ\",\"cong\":\"≅\",\"congdot\":\"⩭\",\"Congruent\":\"≡\",\"conint\":\"∮\",\"Conint\":\"∯\",\"ContourIntegral\":\"∮\",\"copf\":\"𝕔\",\"Copf\":\"ℂ\",\"coprod\":\"∐\",\"Coproduct\":\"∐\",\"copy\":\"©\",\"COPY\":\"©\",\"copysr\":\"℗\",\"CounterClockwiseContourIntegral\":\"∳\",\"crarr\":\"↵\",\"cross\":\"✗\",\"Cross\":\"⨯\",\"Cscr\":\"𝒞\",\"cscr\":\"𝒸\",\"csub\":\"⫏\",\"csube\":\"⫑\",\"csup\":\"⫐\",\"csupe\":\"⫒\",\"ctdot\":\"⋯\",\"cudarrl\":\"⤸\",\"cudarrr\":\"⤵\",\"cuepr\":\"⋞\",\"cuesc\":\"⋟\",\"cularr\":\"↶\",\"cularrp\":\"⤽\",\"cupbrcap\":\"⩈\",\"cupcap\":\"⩆\",\"CupCap\":\"≍\",\"cup\":\"∪\",\"Cup\":\"⋓\",\"cupcup\":\"⩊\",\"cupdot\":\"⊍\",\"cupor\":\"⩅\",\"cups\":\"∪︀\",\"curarr\":\"↷\",\"curarrm\":\"⤼\",\"curlyeqprec\":\"⋞\",\"curlyeqsucc\":\"⋟\",\"curlyvee\":\"⋎\",\"curlywedge\":\"⋏\",\"curren\":\"¤\",\"curvearrowleft\":\"↶\",\"curvearrowright\":\"↷\",\"cuvee\":\"⋎\",\"cuwed\":\"⋏\",\"cwconint\":\"∲\",\"cwint\":\"∱\",\"cylcty\":\"⌭\",\"dagger\":\"†\",\"Dagger\":\"‡\",\"daleth\":\"ℸ\",\"darr\":\"↓\",\"Darr\":\"↡\",\"dArr\":\"⇓\",\"dash\":\"‐\",\"Dashv\":\"⫤\",\"dashv\":\"⊣\",\"dbkarow\":\"⤏\",\"dblac\":\"˝\",\"Dcaron\":\"Ď\",\"dcaron\":\"ď\",\"Dcy\":\"Д\",\"dcy\":\"д\",\"ddagger\":\"‡\",\"ddarr\":\"⇊\",\"DD\":\"ⅅ\",\"dd\":\"ⅆ\",\"DDotrahd\":\"⤑\",\"ddotseq\":\"⩷\",\"deg\":\"°\",\"Del\":\"∇\",\"Delta\":\"Δ\",\"delta\":\"δ\",\"demptyv\":\"⦱\",\"dfisht\":\"⥿\",\"Dfr\":\"𝔇\",\"dfr\":\"𝔡\",\"dHar\":\"⥥\",\"dharl\":\"⇃\",\"dharr\":\"⇂\",\"DiacriticalAcute\":\"´\",\"DiacriticalDot\":\"˙\",\"DiacriticalDoubleAcute\":\"˝\",\"DiacriticalGrave\":\"`\",\"DiacriticalTilde\":\"˜\",\"diam\":\"⋄\",\"diamond\":\"⋄\",\"Diamond\":\"⋄\",\"diamondsuit\":\"♦\",\"diams\":\"♦\",\"die\":\"¨\",\"DifferentialD\":\"ⅆ\",\"digamma\":\"ϝ\",\"disin\":\"⋲\",\"div\":\"÷\",\"divide\":\"÷\",\"divideontimes\":\"⋇\",\"divonx\":\"⋇\",\"DJcy\":\"Ђ\",\"djcy\":\"ђ\",\"dlcorn\":\"⌞\",\"dlcrop\":\"⌍\",\"dollar\":\"$\",\"Dopf\":\"𝔻\",\"dopf\":\"𝕕\",\"Dot\":\"¨\",\"dot\":\"˙\",\"DotDot\":\"⃜\",\"doteq\":\"≐\",\"doteqdot\":\"≑\",\"DotEqual\":\"≐\",\"dotminus\":\"∸\",\"dotplus\":\"∔\",\"dotsquare\":\"⊡\",\"doublebarwedge\":\"⌆\",\"DoubleContourIntegral\":\"∯\",\"DoubleDot\":\"¨\",\"DoubleDownArrow\":\"⇓\",\"DoubleLeftArrow\":\"⇐\",\"DoubleLeftRightArrow\":\"⇔\",\"DoubleLeftTee\":\"⫤\",\"DoubleLongLeftArrow\":\"⟸\",\"DoubleLongLeftRightArrow\":\"⟺\",\"DoubleLongRightArrow\":\"⟹\",\"DoubleRightArrow\":\"⇒\",\"DoubleRightTee\":\"⊨\",\"DoubleUpArrow\":\"⇑\",\"DoubleUpDownArrow\":\"⇕\",\"DoubleVerticalBar\":\"∥\",\"DownArrowBar\":\"⤓\",\"downarrow\":\"↓\",\"DownArrow\":\"↓\",\"Downarrow\":\"⇓\",\"DownArrowUpArrow\":\"⇵\",\"DownBreve\":\"̑\",\"downdownarrows\":\"⇊\",\"downharpoonleft\":\"⇃\",\"downharpoonright\":\"⇂\",\"DownLeftRightVector\":\"⥐\",\"DownLeftTeeVector\":\"⥞\",\"DownLeftVectorBar\":\"⥖\",\"DownLeftVector\":\"↽\",\"DownRightTeeVector\":\"⥟\",\"DownRightVectorBar\":\"⥗\",\"DownRightVector\":\"⇁\",\"DownTeeArrow\":\"↧\",\"DownTee\":\"⊤\",\"drbkarow\":\"⤐\",\"drcorn\":\"⌟\",\"drcrop\":\"⌌\",\"Dscr\":\"𝒟\",\"dscr\":\"𝒹\",\"DScy\":\"Ѕ\",\"dscy\":\"ѕ\",\"dsol\":\"⧶\",\"Dstrok\":\"Đ\",\"dstrok\":\"đ\",\"dtdot\":\"⋱\",\"dtri\":\"▿\",\"dtrif\":\"▾\",\"duarr\":\"⇵\",\"duhar\":\"⥯\",\"dwangle\":\"⦦\",\"DZcy\":\"Џ\",\"dzcy\":\"џ\",\"dzigrarr\":\"⟿\",\"Eacute\":\"É\",\"eacute\":\"é\",\"easter\":\"⩮\",\"Ecaron\":\"Ě\",\"ecaron\":\"ě\",\"Ecirc\":\"Ê\",\"ecirc\":\"ê\",\"ecir\":\"≖\",\"ecolon\":\"≕\",\"Ecy\":\"Э\",\"ecy\":\"э\",\"eDDot\":\"⩷\",\"Edot\":\"Ė\",\"edot\":\"ė\",\"eDot\":\"≑\",\"ee\":\"ⅇ\",\"efDot\":\"≒\",\"Efr\":\"𝔈\",\"efr\":\"𝔢\",\"eg\":\"⪚\",\"Egrave\":\"È\",\"egrave\":\"è\",\"egs\":\"⪖\",\"egsdot\":\"⪘\",\"el\":\"⪙\",\"Element\":\"∈\",\"elinters\":\"⏧\",\"ell\":\"ℓ\",\"els\":\"⪕\",\"elsdot\":\"⪗\",\"Emacr\":\"Ē\",\"emacr\":\"ē\",\"empty\":\"∅\",\"emptyset\":\"∅\",\"EmptySmallSquare\":\"◻\",\"emptyv\":\"∅\",\"EmptyVerySmallSquare\":\"▫\",\"emsp13\":\" \",\"emsp14\":\" \",\"emsp\":\" \",\"ENG\":\"Ŋ\",\"eng\":\"ŋ\",\"ensp\":\" \",\"Eogon\":\"Ę\",\"eogon\":\"ę\",\"Eopf\":\"𝔼\",\"eopf\":\"𝕖\",\"epar\":\"⋕\",\"eparsl\":\"⧣\",\"eplus\":\"⩱\",\"epsi\":\"ε\",\"Epsilon\":\"Ε\",\"epsilon\":\"ε\",\"epsiv\":\"ϵ\",\"eqcirc\":\"≖\",\"eqcolon\":\"≕\",\"eqsim\":\"≂\",\"eqslantgtr\":\"⪖\",\"eqslantless\":\"⪕\",\"Equal\":\"⩵\",\"equals\":\"=\",\"EqualTilde\":\"≂\",\"equest\":\"≟\",\"Equilibrium\":\"⇌\",\"equiv\":\"≡\",\"equivDD\":\"⩸\",\"eqvparsl\":\"⧥\",\"erarr\":\"⥱\",\"erDot\":\"≓\",\"escr\":\"ℯ\",\"Escr\":\"ℰ\",\"esdot\":\"≐\",\"Esim\":\"⩳\",\"esim\":\"≂\",\"Eta\":\"Η\",\"eta\":\"η\",\"ETH\":\"Ð\",\"eth\":\"ð\",\"Euml\":\"Ë\",\"euml\":\"ë\",\"euro\":\"€\",\"excl\":\"!\",\"exist\":\"∃\",\"Exists\":\"∃\",\"expectation\":\"ℰ\",\"exponentiale\":\"ⅇ\",\"ExponentialE\":\"ⅇ\",\"fallingdotseq\":\"≒\",\"Fcy\":\"Ф\",\"fcy\":\"ф\",\"female\":\"♀\",\"ffilig\":\"ffi\",\"fflig\":\"ff\",\"ffllig\":\"ffl\",\"Ffr\":\"𝔉\",\"ffr\":\"𝔣\",\"filig\":\"fi\",\"FilledSmallSquare\":\"◼\",\"FilledVerySmallSquare\":\"▪\",\"fjlig\":\"fj\",\"flat\":\"♭\",\"fllig\":\"fl\",\"fltns\":\"▱\",\"fnof\":\"ƒ\",\"Fopf\":\"𝔽\",\"fopf\":\"𝕗\",\"forall\":\"∀\",\"ForAll\":\"∀\",\"fork\":\"⋔\",\"forkv\":\"⫙\",\"Fouriertrf\":\"ℱ\",\"fpartint\":\"⨍\",\"frac12\":\"½\",\"frac13\":\"⅓\",\"frac14\":\"¼\",\"frac15\":\"⅕\",\"frac16\":\"⅙\",\"frac18\":\"⅛\",\"frac23\":\"⅔\",\"frac25\":\"⅖\",\"frac34\":\"¾\",\"frac35\":\"⅗\",\"frac38\":\"⅜\",\"frac45\":\"⅘\",\"frac56\":\"⅚\",\"frac58\":\"⅝\",\"frac78\":\"⅞\",\"frasl\":\"⁄\",\"frown\":\"⌢\",\"fscr\":\"𝒻\",\"Fscr\":\"ℱ\",\"gacute\":\"ǵ\",\"Gamma\":\"Γ\",\"gamma\":\"γ\",\"Gammad\":\"Ϝ\",\"gammad\":\"ϝ\",\"gap\":\"⪆\",\"Gbreve\":\"Ğ\",\"gbreve\":\"ğ\",\"Gcedil\":\"Ģ\",\"Gcirc\":\"Ĝ\",\"gcirc\":\"ĝ\",\"Gcy\":\"Г\",\"gcy\":\"г\",\"Gdot\":\"Ġ\",\"gdot\":\"ġ\",\"ge\":\"≥\",\"gE\":\"≧\",\"gEl\":\"⪌\",\"gel\":\"⋛\",\"geq\":\"≥\",\"geqq\":\"≧\",\"geqslant\":\"⩾\",\"gescc\":\"⪩\",\"ges\":\"⩾\",\"gesdot\":\"⪀\",\"gesdoto\":\"⪂\",\"gesdotol\":\"⪄\",\"gesl\":\"⋛︀\",\"gesles\":\"⪔\",\"Gfr\":\"𝔊\",\"gfr\":\"𝔤\",\"gg\":\"≫\",\"Gg\":\"⋙\",\"ggg\":\"⋙\",\"gimel\":\"ℷ\",\"GJcy\":\"Ѓ\",\"gjcy\":\"ѓ\",\"gla\":\"⪥\",\"gl\":\"≷\",\"glE\":\"⪒\",\"glj\":\"⪤\",\"gnap\":\"⪊\",\"gnapprox\":\"⪊\",\"gne\":\"⪈\",\"gnE\":\"≩\",\"gneq\":\"⪈\",\"gneqq\":\"≩\",\"gnsim\":\"⋧\",\"Gopf\":\"𝔾\",\"gopf\":\"𝕘\",\"grave\":\"`\",\"GreaterEqual\":\"≥\",\"GreaterEqualLess\":\"⋛\",\"GreaterFullEqual\":\"≧\",\"GreaterGreater\":\"⪢\",\"GreaterLess\":\"≷\",\"GreaterSlantEqual\":\"⩾\",\"GreaterTilde\":\"≳\",\"Gscr\":\"𝒢\",\"gscr\":\"ℊ\",\"gsim\":\"≳\",\"gsime\":\"⪎\",\"gsiml\":\"⪐\",\"gtcc\":\"⪧\",\"gtcir\":\"⩺\",\"gt\":\">\",\"GT\":\">\",\"Gt\":\"≫\",\"gtdot\":\"⋗\",\"gtlPar\":\"⦕\",\"gtquest\":\"⩼\",\"gtrapprox\":\"⪆\",\"gtrarr\":\"⥸\",\"gtrdot\":\"⋗\",\"gtreqless\":\"⋛\",\"gtreqqless\":\"⪌\",\"gtrless\":\"≷\",\"gtrsim\":\"≳\",\"gvertneqq\":\"≩︀\",\"gvnE\":\"≩︀\",\"Hacek\":\"ˇ\",\"hairsp\":\" \",\"half\":\"½\",\"hamilt\":\"ℋ\",\"HARDcy\":\"Ъ\",\"hardcy\":\"ъ\",\"harrcir\":\"⥈\",\"harr\":\"↔\",\"hArr\":\"⇔\",\"harrw\":\"↭\",\"Hat\":\"^\",\"hbar\":\"ℏ\",\"Hcirc\":\"Ĥ\",\"hcirc\":\"ĥ\",\"hearts\":\"♥\",\"heartsuit\":\"♥\",\"hellip\":\"…\",\"hercon\":\"⊹\",\"hfr\":\"𝔥\",\"Hfr\":\"ℌ\",\"HilbertSpace\":\"ℋ\",\"hksearow\":\"⤥\",\"hkswarow\":\"⤦\",\"hoarr\":\"⇿\",\"homtht\":\"∻\",\"hookleftarrow\":\"↩\",\"hookrightarrow\":\"↪\",\"hopf\":\"𝕙\",\"Hopf\":\"ℍ\",\"horbar\":\"―\",\"HorizontalLine\":\"─\",\"hscr\":\"𝒽\",\"Hscr\":\"ℋ\",\"hslash\":\"ℏ\",\"Hstrok\":\"Ħ\",\"hstrok\":\"ħ\",\"HumpDownHump\":\"≎\",\"HumpEqual\":\"≏\",\"hybull\":\"⁃\",\"hyphen\":\"‐\",\"Iacute\":\"Í\",\"iacute\":\"í\",\"ic\":\"⁣\",\"Icirc\":\"Î\",\"icirc\":\"î\",\"Icy\":\"И\",\"icy\":\"и\",\"Idot\":\"İ\",\"IEcy\":\"Е\",\"iecy\":\"е\",\"iexcl\":\"¡\",\"iff\":\"⇔\",\"ifr\":\"𝔦\",\"Ifr\":\"ℑ\",\"Igrave\":\"Ì\",\"igrave\":\"ì\",\"ii\":\"ⅈ\",\"iiiint\":\"⨌\",\"iiint\":\"∭\",\"iinfin\":\"⧜\",\"iiota\":\"℩\",\"IJlig\":\"IJ\",\"ijlig\":\"ij\",\"Imacr\":\"Ī\",\"imacr\":\"ī\",\"image\":\"ℑ\",\"ImaginaryI\":\"ⅈ\",\"imagline\":\"ℐ\",\"imagpart\":\"ℑ\",\"imath\":\"ı\",\"Im\":\"ℑ\",\"imof\":\"⊷\",\"imped\":\"Ƶ\",\"Implies\":\"⇒\",\"incare\":\"℅\",\"in\":\"∈\",\"infin\":\"∞\",\"infintie\":\"⧝\",\"inodot\":\"ı\",\"intcal\":\"⊺\",\"int\":\"∫\",\"Int\":\"∬\",\"integers\":\"ℤ\",\"Integral\":\"∫\",\"intercal\":\"⊺\",\"Intersection\":\"⋂\",\"intlarhk\":\"⨗\",\"intprod\":\"⨼\",\"InvisibleComma\":\"⁣\",\"InvisibleTimes\":\"⁢\",\"IOcy\":\"Ё\",\"iocy\":\"ё\",\"Iogon\":\"Į\",\"iogon\":\"į\",\"Iopf\":\"𝕀\",\"iopf\":\"𝕚\",\"Iota\":\"Ι\",\"iota\":\"ι\",\"iprod\":\"⨼\",\"iquest\":\"¿\",\"iscr\":\"𝒾\",\"Iscr\":\"ℐ\",\"isin\":\"∈\",\"isindot\":\"⋵\",\"isinE\":\"⋹\",\"isins\":\"⋴\",\"isinsv\":\"⋳\",\"isinv\":\"∈\",\"it\":\"⁢\",\"Itilde\":\"Ĩ\",\"itilde\":\"ĩ\",\"Iukcy\":\"І\",\"iukcy\":\"і\",\"Iuml\":\"Ï\",\"iuml\":\"ï\",\"Jcirc\":\"Ĵ\",\"jcirc\":\"ĵ\",\"Jcy\":\"Й\",\"jcy\":\"й\",\"Jfr\":\"𝔍\",\"jfr\":\"𝔧\",\"jmath\":\"ȷ\",\"Jopf\":\"𝕁\",\"jopf\":\"𝕛\",\"Jscr\":\"𝒥\",\"jscr\":\"𝒿\",\"Jsercy\":\"Ј\",\"jsercy\":\"ј\",\"Jukcy\":\"Є\",\"jukcy\":\"є\",\"Kappa\":\"Κ\",\"kappa\":\"κ\",\"kappav\":\"ϰ\",\"Kcedil\":\"Ķ\",\"kcedil\":\"ķ\",\"Kcy\":\"К\",\"kcy\":\"к\",\"Kfr\":\"𝔎\",\"kfr\":\"𝔨\",\"kgreen\":\"ĸ\",\"KHcy\":\"Х\",\"khcy\":\"х\",\"KJcy\":\"Ќ\",\"kjcy\":\"ќ\",\"Kopf\":\"𝕂\",\"kopf\":\"𝕜\",\"Kscr\":\"𝒦\",\"kscr\":\"𝓀\",\"lAarr\":\"⇚\",\"Lacute\":\"Ĺ\",\"lacute\":\"ĺ\",\"laemptyv\":\"⦴\",\"lagran\":\"ℒ\",\"Lambda\":\"Λ\",\"lambda\":\"λ\",\"lang\":\"⟨\",\"Lang\":\"⟪\",\"langd\":\"⦑\",\"langle\":\"⟨\",\"lap\":\"⪅\",\"Laplacetrf\":\"ℒ\",\"laquo\":\"«\",\"larrb\":\"⇤\",\"larrbfs\":\"⤟\",\"larr\":\"←\",\"Larr\":\"↞\",\"lArr\":\"⇐\",\"larrfs\":\"⤝\",\"larrhk\":\"↩\",\"larrlp\":\"↫\",\"larrpl\":\"⤹\",\"larrsim\":\"⥳\",\"larrtl\":\"↢\",\"latail\":\"⤙\",\"lAtail\":\"⤛\",\"lat\":\"⪫\",\"late\":\"⪭\",\"lates\":\"⪭︀\",\"lbarr\":\"⤌\",\"lBarr\":\"⤎\",\"lbbrk\":\"❲\",\"lbrace\":\"{\",\"lbrack\":\"[\",\"lbrke\":\"⦋\",\"lbrksld\":\"⦏\",\"lbrkslu\":\"⦍\",\"Lcaron\":\"Ľ\",\"lcaron\":\"ľ\",\"Lcedil\":\"Ļ\",\"lcedil\":\"ļ\",\"lceil\":\"⌈\",\"lcub\":\"{\",\"Lcy\":\"Л\",\"lcy\":\"л\",\"ldca\":\"⤶\",\"ldquo\":\"“\",\"ldquor\":\"„\",\"ldrdhar\":\"⥧\",\"ldrushar\":\"⥋\",\"ldsh\":\"↲\",\"le\":\"≤\",\"lE\":\"≦\",\"LeftAngleBracket\":\"⟨\",\"LeftArrowBar\":\"⇤\",\"leftarrow\":\"←\",\"LeftArrow\":\"←\",\"Leftarrow\":\"⇐\",\"LeftArrowRightArrow\":\"⇆\",\"leftarrowtail\":\"↢\",\"LeftCeiling\":\"⌈\",\"LeftDoubleBracket\":\"⟦\",\"LeftDownTeeVector\":\"⥡\",\"LeftDownVectorBar\":\"⥙\",\"LeftDownVector\":\"⇃\",\"LeftFloor\":\"⌊\",\"leftharpoondown\":\"↽\",\"leftharpoonup\":\"↼\",\"leftleftarrows\":\"⇇\",\"leftrightarrow\":\"↔\",\"LeftRightArrow\":\"↔\",\"Leftrightarrow\":\"⇔\",\"leftrightarrows\":\"⇆\",\"leftrightharpoons\":\"⇋\",\"leftrightsquigarrow\":\"↭\",\"LeftRightVector\":\"⥎\",\"LeftTeeArrow\":\"↤\",\"LeftTee\":\"⊣\",\"LeftTeeVector\":\"⥚\",\"leftthreetimes\":\"⋋\",\"LeftTriangleBar\":\"⧏\",\"LeftTriangle\":\"⊲\",\"LeftTriangleEqual\":\"⊴\",\"LeftUpDownVector\":\"⥑\",\"LeftUpTeeVector\":\"⥠\",\"LeftUpVectorBar\":\"⥘\",\"LeftUpVector\":\"↿\",\"LeftVectorBar\":\"⥒\",\"LeftVector\":\"↼\",\"lEg\":\"⪋\",\"leg\":\"⋚\",\"leq\":\"≤\",\"leqq\":\"≦\",\"leqslant\":\"⩽\",\"lescc\":\"⪨\",\"les\":\"⩽\",\"lesdot\":\"⩿\",\"lesdoto\":\"⪁\",\"lesdotor\":\"⪃\",\"lesg\":\"⋚︀\",\"lesges\":\"⪓\",\"lessapprox\":\"⪅\",\"lessdot\":\"⋖\",\"lesseqgtr\":\"⋚\",\"lesseqqgtr\":\"⪋\",\"LessEqualGreater\":\"⋚\",\"LessFullEqual\":\"≦\",\"LessGreater\":\"≶\",\"lessgtr\":\"≶\",\"LessLess\":\"⪡\",\"lesssim\":\"≲\",\"LessSlantEqual\":\"⩽\",\"LessTilde\":\"≲\",\"lfisht\":\"⥼\",\"lfloor\":\"⌊\",\"Lfr\":\"𝔏\",\"lfr\":\"𝔩\",\"lg\":\"≶\",\"lgE\":\"⪑\",\"lHar\":\"⥢\",\"lhard\":\"↽\",\"lharu\":\"↼\",\"lharul\":\"⥪\",\"lhblk\":\"▄\",\"LJcy\":\"Љ\",\"ljcy\":\"љ\",\"llarr\":\"⇇\",\"ll\":\"≪\",\"Ll\":\"⋘\",\"llcorner\":\"⌞\",\"Lleftarrow\":\"⇚\",\"llhard\":\"⥫\",\"lltri\":\"◺\",\"Lmidot\":\"Ŀ\",\"lmidot\":\"ŀ\",\"lmoustache\":\"⎰\",\"lmoust\":\"⎰\",\"lnap\":\"⪉\",\"lnapprox\":\"⪉\",\"lne\":\"⪇\",\"lnE\":\"≨\",\"lneq\":\"⪇\",\"lneqq\":\"≨\",\"lnsim\":\"⋦\",\"loang\":\"⟬\",\"loarr\":\"⇽\",\"lobrk\":\"⟦\",\"longleftarrow\":\"⟵\",\"LongLeftArrow\":\"⟵\",\"Longleftarrow\":\"⟸\",\"longleftrightarrow\":\"⟷\",\"LongLeftRightArrow\":\"⟷\",\"Longleftrightarrow\":\"⟺\",\"longmapsto\":\"⟼\",\"longrightarrow\":\"⟶\",\"LongRightArrow\":\"⟶\",\"Longrightarrow\":\"⟹\",\"looparrowleft\":\"↫\",\"looparrowright\":\"↬\",\"lopar\":\"⦅\",\"Lopf\":\"𝕃\",\"lopf\":\"𝕝\",\"loplus\":\"⨭\",\"lotimes\":\"⨴\",\"lowast\":\"∗\",\"lowbar\":\"_\",\"LowerLeftArrow\":\"↙\",\"LowerRightArrow\":\"↘\",\"loz\":\"◊\",\"lozenge\":\"◊\",\"lozf\":\"⧫\",\"lpar\":\"(\",\"lparlt\":\"⦓\",\"lrarr\":\"⇆\",\"lrcorner\":\"⌟\",\"lrhar\":\"⇋\",\"lrhard\":\"⥭\",\"lrm\":\"‎\",\"lrtri\":\"⊿\",\"lsaquo\":\"‹\",\"lscr\":\"𝓁\",\"Lscr\":\"ℒ\",\"lsh\":\"↰\",\"Lsh\":\"↰\",\"lsim\":\"≲\",\"lsime\":\"⪍\",\"lsimg\":\"⪏\",\"lsqb\":\"[\",\"lsquo\":\"‘\",\"lsquor\":\"‚\",\"Lstrok\":\"Ł\",\"lstrok\":\"ł\",\"ltcc\":\"⪦\",\"ltcir\":\"⩹\",\"lt\":\"<\",\"LT\":\"<\",\"Lt\":\"≪\",\"ltdot\":\"⋖\",\"lthree\":\"⋋\",\"ltimes\":\"⋉\",\"ltlarr\":\"⥶\",\"ltquest\":\"⩻\",\"ltri\":\"◃\",\"ltrie\":\"⊴\",\"ltrif\":\"◂\",\"ltrPar\":\"⦖\",\"lurdshar\":\"⥊\",\"luruhar\":\"⥦\",\"lvertneqq\":\"≨︀\",\"lvnE\":\"≨︀\",\"macr\":\"¯\",\"male\":\"♂\",\"malt\":\"✠\",\"maltese\":\"✠\",\"Map\":\"⤅\",\"map\":\"↦\",\"mapsto\":\"↦\",\"mapstodown\":\"↧\",\"mapstoleft\":\"↤\",\"mapstoup\":\"↥\",\"marker\":\"▮\",\"mcomma\":\"⨩\",\"Mcy\":\"М\",\"mcy\":\"м\",\"mdash\":\"—\",\"mDDot\":\"∺\",\"measuredangle\":\"∡\",\"MediumSpace\":\" \",\"Mellintrf\":\"ℳ\",\"Mfr\":\"𝔐\",\"mfr\":\"𝔪\",\"mho\":\"℧\",\"micro\":\"µ\",\"midast\":\"*\",\"midcir\":\"⫰\",\"mid\":\"∣\",\"middot\":\"·\",\"minusb\":\"⊟\",\"minus\":\"−\",\"minusd\":\"∸\",\"minusdu\":\"⨪\",\"MinusPlus\":\"∓\",\"mlcp\":\"⫛\",\"mldr\":\"…\",\"mnplus\":\"∓\",\"models\":\"⊧\",\"Mopf\":\"𝕄\",\"mopf\":\"𝕞\",\"mp\":\"∓\",\"mscr\":\"𝓂\",\"Mscr\":\"ℳ\",\"mstpos\":\"∾\",\"Mu\":\"Μ\",\"mu\":\"μ\",\"multimap\":\"⊸\",\"mumap\":\"⊸\",\"nabla\":\"∇\",\"Nacute\":\"Ń\",\"nacute\":\"ń\",\"nang\":\"∠⃒\",\"nap\":\"≉\",\"napE\":\"⩰̸\",\"napid\":\"≋̸\",\"napos\":\"ʼn\",\"napprox\":\"≉\",\"natural\":\"♮\",\"naturals\":\"ℕ\",\"natur\":\"♮\",\"nbsp\":\" \",\"nbump\":\"≎̸\",\"nbumpe\":\"≏̸\",\"ncap\":\"⩃\",\"Ncaron\":\"Ň\",\"ncaron\":\"ň\",\"Ncedil\":\"Ņ\",\"ncedil\":\"ņ\",\"ncong\":\"≇\",\"ncongdot\":\"⩭̸\",\"ncup\":\"⩂\",\"Ncy\":\"Н\",\"ncy\":\"н\",\"ndash\":\"–\",\"nearhk\":\"⤤\",\"nearr\":\"↗\",\"neArr\":\"⇗\",\"nearrow\":\"↗\",\"ne\":\"≠\",\"nedot\":\"≐̸\",\"NegativeMediumSpace\":\"​\",\"NegativeThickSpace\":\"​\",\"NegativeThinSpace\":\"​\",\"NegativeVeryThinSpace\":\"​\",\"nequiv\":\"≢\",\"nesear\":\"⤨\",\"nesim\":\"≂̸\",\"NestedGreaterGreater\":\"≫\",\"NestedLessLess\":\"≪\",\"NewLine\":\"\\n\",\"nexist\":\"∄\",\"nexists\":\"∄\",\"Nfr\":\"𝔑\",\"nfr\":\"𝔫\",\"ngE\":\"≧̸\",\"nge\":\"≱\",\"ngeq\":\"≱\",\"ngeqq\":\"≧̸\",\"ngeqslant\":\"⩾̸\",\"nges\":\"⩾̸\",\"nGg\":\"⋙̸\",\"ngsim\":\"≵\",\"nGt\":\"≫⃒\",\"ngt\":\"≯\",\"ngtr\":\"≯\",\"nGtv\":\"≫̸\",\"nharr\":\"↮\",\"nhArr\":\"⇎\",\"nhpar\":\"⫲\",\"ni\":\"∋\",\"nis\":\"⋼\",\"nisd\":\"⋺\",\"niv\":\"∋\",\"NJcy\":\"Њ\",\"njcy\":\"њ\",\"nlarr\":\"↚\",\"nlArr\":\"⇍\",\"nldr\":\"‥\",\"nlE\":\"≦̸\",\"nle\":\"≰\",\"nleftarrow\":\"↚\",\"nLeftarrow\":\"⇍\",\"nleftrightarrow\":\"↮\",\"nLeftrightarrow\":\"⇎\",\"nleq\":\"≰\",\"nleqq\":\"≦̸\",\"nleqslant\":\"⩽̸\",\"nles\":\"⩽̸\",\"nless\":\"≮\",\"nLl\":\"⋘̸\",\"nlsim\":\"≴\",\"nLt\":\"≪⃒\",\"nlt\":\"≮\",\"nltri\":\"⋪\",\"nltrie\":\"⋬\",\"nLtv\":\"≪̸\",\"nmid\":\"∤\",\"NoBreak\":\"⁠\",\"NonBreakingSpace\":\" \",\"nopf\":\"𝕟\",\"Nopf\":\"ℕ\",\"Not\":\"⫬\",\"not\":\"¬\",\"NotCongruent\":\"≢\",\"NotCupCap\":\"≭\",\"NotDoubleVerticalBar\":\"∦\",\"NotElement\":\"∉\",\"NotEqual\":\"≠\",\"NotEqualTilde\":\"≂̸\",\"NotExists\":\"∄\",\"NotGreater\":\"≯\",\"NotGreaterEqual\":\"≱\",\"NotGreaterFullEqual\":\"≧̸\",\"NotGreaterGreater\":\"≫̸\",\"NotGreaterLess\":\"≹\",\"NotGreaterSlantEqual\":\"⩾̸\",\"NotGreaterTilde\":\"≵\",\"NotHumpDownHump\":\"≎̸\",\"NotHumpEqual\":\"≏̸\",\"notin\":\"∉\",\"notindot\":\"⋵̸\",\"notinE\":\"⋹̸\",\"notinva\":\"∉\",\"notinvb\":\"⋷\",\"notinvc\":\"⋶\",\"NotLeftTriangleBar\":\"⧏̸\",\"NotLeftTriangle\":\"⋪\",\"NotLeftTriangleEqual\":\"⋬\",\"NotLess\":\"≮\",\"NotLessEqual\":\"≰\",\"NotLessGreater\":\"≸\",\"NotLessLess\":\"≪̸\",\"NotLessSlantEqual\":\"⩽̸\",\"NotLessTilde\":\"≴\",\"NotNestedGreaterGreater\":\"⪢̸\",\"NotNestedLessLess\":\"⪡̸\",\"notni\":\"∌\",\"notniva\":\"∌\",\"notnivb\":\"⋾\",\"notnivc\":\"⋽\",\"NotPrecedes\":\"⊀\",\"NotPrecedesEqual\":\"⪯̸\",\"NotPrecedesSlantEqual\":\"⋠\",\"NotReverseElement\":\"∌\",\"NotRightTriangleBar\":\"⧐̸\",\"NotRightTriangle\":\"⋫\",\"NotRightTriangleEqual\":\"⋭\",\"NotSquareSubset\":\"⊏̸\",\"NotSquareSubsetEqual\":\"⋢\",\"NotSquareSuperset\":\"⊐̸\",\"NotSquareSupersetEqual\":\"⋣\",\"NotSubset\":\"⊂⃒\",\"NotSubsetEqual\":\"⊈\",\"NotSucceeds\":\"⊁\",\"NotSucceedsEqual\":\"⪰̸\",\"NotSucceedsSlantEqual\":\"⋡\",\"NotSucceedsTilde\":\"≿̸\",\"NotSuperset\":\"⊃⃒\",\"NotSupersetEqual\":\"⊉\",\"NotTilde\":\"≁\",\"NotTildeEqual\":\"≄\",\"NotTildeFullEqual\":\"≇\",\"NotTildeTilde\":\"≉\",\"NotVerticalBar\":\"∤\",\"nparallel\":\"∦\",\"npar\":\"∦\",\"nparsl\":\"⫽⃥\",\"npart\":\"∂̸\",\"npolint\":\"⨔\",\"npr\":\"⊀\",\"nprcue\":\"⋠\",\"nprec\":\"⊀\",\"npreceq\":\"⪯̸\",\"npre\":\"⪯̸\",\"nrarrc\":\"⤳̸\",\"nrarr\":\"↛\",\"nrArr\":\"⇏\",\"nrarrw\":\"↝̸\",\"nrightarrow\":\"↛\",\"nRightarrow\":\"⇏\",\"nrtri\":\"⋫\",\"nrtrie\":\"⋭\",\"nsc\":\"⊁\",\"nsccue\":\"⋡\",\"nsce\":\"⪰̸\",\"Nscr\":\"𝒩\",\"nscr\":\"𝓃\",\"nshortmid\":\"∤\",\"nshortparallel\":\"∦\",\"nsim\":\"≁\",\"nsime\":\"≄\",\"nsimeq\":\"≄\",\"nsmid\":\"∤\",\"nspar\":\"∦\",\"nsqsube\":\"⋢\",\"nsqsupe\":\"⋣\",\"nsub\":\"⊄\",\"nsubE\":\"⫅̸\",\"nsube\":\"⊈\",\"nsubset\":\"⊂⃒\",\"nsubseteq\":\"⊈\",\"nsubseteqq\":\"⫅̸\",\"nsucc\":\"⊁\",\"nsucceq\":\"⪰̸\",\"nsup\":\"⊅\",\"nsupE\":\"⫆̸\",\"nsupe\":\"⊉\",\"nsupset\":\"⊃⃒\",\"nsupseteq\":\"⊉\",\"nsupseteqq\":\"⫆̸\",\"ntgl\":\"≹\",\"Ntilde\":\"Ñ\",\"ntilde\":\"ñ\",\"ntlg\":\"≸\",\"ntriangleleft\":\"⋪\",\"ntrianglelefteq\":\"⋬\",\"ntriangleright\":\"⋫\",\"ntrianglerighteq\":\"⋭\",\"Nu\":\"Ν\",\"nu\":\"ν\",\"num\":\"#\",\"numero\":\"№\",\"numsp\":\" \",\"nvap\":\"≍⃒\",\"nvdash\":\"⊬\",\"nvDash\":\"⊭\",\"nVdash\":\"⊮\",\"nVDash\":\"⊯\",\"nvge\":\"≥⃒\",\"nvgt\":\">⃒\",\"nvHarr\":\"⤄\",\"nvinfin\":\"⧞\",\"nvlArr\":\"⤂\",\"nvle\":\"≤⃒\",\"nvlt\":\"<⃒\",\"nvltrie\":\"⊴⃒\",\"nvrArr\":\"⤃\",\"nvrtrie\":\"⊵⃒\",\"nvsim\":\"∼⃒\",\"nwarhk\":\"⤣\",\"nwarr\":\"↖\",\"nwArr\":\"⇖\",\"nwarrow\":\"↖\",\"nwnear\":\"⤧\",\"Oacute\":\"Ó\",\"oacute\":\"ó\",\"oast\":\"⊛\",\"Ocirc\":\"Ô\",\"ocirc\":\"ô\",\"ocir\":\"⊚\",\"Ocy\":\"О\",\"ocy\":\"о\",\"odash\":\"⊝\",\"Odblac\":\"Ő\",\"odblac\":\"ő\",\"odiv\":\"⨸\",\"odot\":\"⊙\",\"odsold\":\"⦼\",\"OElig\":\"Œ\",\"oelig\":\"œ\",\"ofcir\":\"⦿\",\"Ofr\":\"𝔒\",\"ofr\":\"𝔬\",\"ogon\":\"˛\",\"Ograve\":\"Ò\",\"ograve\":\"ò\",\"ogt\":\"⧁\",\"ohbar\":\"⦵\",\"ohm\":\"Ω\",\"oint\":\"∮\",\"olarr\":\"↺\",\"olcir\":\"⦾\",\"olcross\":\"⦻\",\"oline\":\"‾\",\"olt\":\"⧀\",\"Omacr\":\"Ō\",\"omacr\":\"ō\",\"Omega\":\"Ω\",\"omega\":\"ω\",\"Omicron\":\"Ο\",\"omicron\":\"ο\",\"omid\":\"⦶\",\"ominus\":\"⊖\",\"Oopf\":\"𝕆\",\"oopf\":\"𝕠\",\"opar\":\"⦷\",\"OpenCurlyDoubleQuote\":\"“\",\"OpenCurlyQuote\":\"‘\",\"operp\":\"⦹\",\"oplus\":\"⊕\",\"orarr\":\"↻\",\"Or\":\"⩔\",\"or\":\"∨\",\"ord\":\"⩝\",\"order\":\"ℴ\",\"orderof\":\"ℴ\",\"ordf\":\"ª\",\"ordm\":\"º\",\"origof\":\"⊶\",\"oror\":\"⩖\",\"orslope\":\"⩗\",\"orv\":\"⩛\",\"oS\":\"Ⓢ\",\"Oscr\":\"𝒪\",\"oscr\":\"ℴ\",\"Oslash\":\"Ø\",\"oslash\":\"ø\",\"osol\":\"⊘\",\"Otilde\":\"Õ\",\"otilde\":\"õ\",\"otimesas\":\"⨶\",\"Otimes\":\"⨷\",\"otimes\":\"⊗\",\"Ouml\":\"Ö\",\"ouml\":\"ö\",\"ovbar\":\"⌽\",\"OverBar\":\"‾\",\"OverBrace\":\"⏞\",\"OverBracket\":\"⎴\",\"OverParenthesis\":\"⏜\",\"para\":\"¶\",\"parallel\":\"∥\",\"par\":\"∥\",\"parsim\":\"⫳\",\"parsl\":\"⫽\",\"part\":\"∂\",\"PartialD\":\"∂\",\"Pcy\":\"П\",\"pcy\":\"п\",\"percnt\":\"%\",\"period\":\".\",\"permil\":\"‰\",\"perp\":\"⊥\",\"pertenk\":\"‱\",\"Pfr\":\"𝔓\",\"pfr\":\"𝔭\",\"Phi\":\"Φ\",\"phi\":\"φ\",\"phiv\":\"ϕ\",\"phmmat\":\"ℳ\",\"phone\":\"☎\",\"Pi\":\"Π\",\"pi\":\"π\",\"pitchfork\":\"⋔\",\"piv\":\"ϖ\",\"planck\":\"ℏ\",\"planckh\":\"ℎ\",\"plankv\":\"ℏ\",\"plusacir\":\"⨣\",\"plusb\":\"⊞\",\"pluscir\":\"⨢\",\"plus\":\"+\",\"plusdo\":\"∔\",\"plusdu\":\"⨥\",\"pluse\":\"⩲\",\"PlusMinus\":\"±\",\"plusmn\":\"±\",\"plussim\":\"⨦\",\"plustwo\":\"⨧\",\"pm\":\"±\",\"Poincareplane\":\"ℌ\",\"pointint\":\"⨕\",\"popf\":\"𝕡\",\"Popf\":\"ℙ\",\"pound\":\"£\",\"prap\":\"⪷\",\"Pr\":\"⪻\",\"pr\":\"≺\",\"prcue\":\"≼\",\"precapprox\":\"⪷\",\"prec\":\"≺\",\"preccurlyeq\":\"≼\",\"Precedes\":\"≺\",\"PrecedesEqual\":\"⪯\",\"PrecedesSlantEqual\":\"≼\",\"PrecedesTilde\":\"≾\",\"preceq\":\"⪯\",\"precnapprox\":\"⪹\",\"precneqq\":\"⪵\",\"precnsim\":\"⋨\",\"pre\":\"⪯\",\"prE\":\"⪳\",\"precsim\":\"≾\",\"prime\":\"′\",\"Prime\":\"″\",\"primes\":\"ℙ\",\"prnap\":\"⪹\",\"prnE\":\"⪵\",\"prnsim\":\"⋨\",\"prod\":\"∏\",\"Product\":\"∏\",\"profalar\":\"⌮\",\"profline\":\"⌒\",\"profsurf\":\"⌓\",\"prop\":\"∝\",\"Proportional\":\"∝\",\"Proportion\":\"∷\",\"propto\":\"∝\",\"prsim\":\"≾\",\"prurel\":\"⊰\",\"Pscr\":\"𝒫\",\"pscr\":\"𝓅\",\"Psi\":\"Ψ\",\"psi\":\"ψ\",\"puncsp\":\" \",\"Qfr\":\"𝔔\",\"qfr\":\"𝔮\",\"qint\":\"⨌\",\"qopf\":\"𝕢\",\"Qopf\":\"ℚ\",\"qprime\":\"⁗\",\"Qscr\":\"𝒬\",\"qscr\":\"𝓆\",\"quaternions\":\"ℍ\",\"quatint\":\"⨖\",\"quest\":\"?\",\"questeq\":\"≟\",\"quot\":\"\\\"\",\"QUOT\":\"\\\"\",\"rAarr\":\"⇛\",\"race\":\"∽̱\",\"Racute\":\"Ŕ\",\"racute\":\"ŕ\",\"radic\":\"√\",\"raemptyv\":\"⦳\",\"rang\":\"⟩\",\"Rang\":\"⟫\",\"rangd\":\"⦒\",\"range\":\"⦥\",\"rangle\":\"⟩\",\"raquo\":\"»\",\"rarrap\":\"⥵\",\"rarrb\":\"⇥\",\"rarrbfs\":\"⤠\",\"rarrc\":\"⤳\",\"rarr\":\"→\",\"Rarr\":\"↠\",\"rArr\":\"⇒\",\"rarrfs\":\"⤞\",\"rarrhk\":\"↪\",\"rarrlp\":\"↬\",\"rarrpl\":\"⥅\",\"rarrsim\":\"⥴\",\"Rarrtl\":\"⤖\",\"rarrtl\":\"↣\",\"rarrw\":\"↝\",\"ratail\":\"⤚\",\"rAtail\":\"⤜\",\"ratio\":\"∶\",\"rationals\":\"ℚ\",\"rbarr\":\"⤍\",\"rBarr\":\"⤏\",\"RBarr\":\"⤐\",\"rbbrk\":\"❳\",\"rbrace\":\"}\",\"rbrack\":\"]\",\"rbrke\":\"⦌\",\"rbrksld\":\"⦎\",\"rbrkslu\":\"⦐\",\"Rcaron\":\"Ř\",\"rcaron\":\"ř\",\"Rcedil\":\"Ŗ\",\"rcedil\":\"ŗ\",\"rceil\":\"⌉\",\"rcub\":\"}\",\"Rcy\":\"Р\",\"rcy\":\"р\",\"rdca\":\"⤷\",\"rdldhar\":\"⥩\",\"rdquo\":\"”\",\"rdquor\":\"”\",\"rdsh\":\"↳\",\"real\":\"ℜ\",\"realine\":\"ℛ\",\"realpart\":\"ℜ\",\"reals\":\"ℝ\",\"Re\":\"ℜ\",\"rect\":\"▭\",\"reg\":\"®\",\"REG\":\"®\",\"ReverseElement\":\"∋\",\"ReverseEquilibrium\":\"⇋\",\"ReverseUpEquilibrium\":\"⥯\",\"rfisht\":\"⥽\",\"rfloor\":\"⌋\",\"rfr\":\"𝔯\",\"Rfr\":\"ℜ\",\"rHar\":\"⥤\",\"rhard\":\"⇁\",\"rharu\":\"⇀\",\"rharul\":\"⥬\",\"Rho\":\"Ρ\",\"rho\":\"ρ\",\"rhov\":\"ϱ\",\"RightAngleBracket\":\"⟩\",\"RightArrowBar\":\"⇥\",\"rightarrow\":\"→\",\"RightArrow\":\"→\",\"Rightarrow\":\"⇒\",\"RightArrowLeftArrow\":\"⇄\",\"rightarrowtail\":\"↣\",\"RightCeiling\":\"⌉\",\"RightDoubleBracket\":\"⟧\",\"RightDownTeeVector\":\"⥝\",\"RightDownVectorBar\":\"⥕\",\"RightDownVector\":\"⇂\",\"RightFloor\":\"⌋\",\"rightharpoondown\":\"⇁\",\"rightharpoonup\":\"⇀\",\"rightleftarrows\":\"⇄\",\"rightleftharpoons\":\"⇌\",\"rightrightarrows\":\"⇉\",\"rightsquigarrow\":\"↝\",\"RightTeeArrow\":\"↦\",\"RightTee\":\"⊢\",\"RightTeeVector\":\"⥛\",\"rightthreetimes\":\"⋌\",\"RightTriangleBar\":\"⧐\",\"RightTriangle\":\"⊳\",\"RightTriangleEqual\":\"⊵\",\"RightUpDownVector\":\"⥏\",\"RightUpTeeVector\":\"⥜\",\"RightUpVectorBar\":\"⥔\",\"RightUpVector\":\"↾\",\"RightVectorBar\":\"⥓\",\"RightVector\":\"⇀\",\"ring\":\"˚\",\"risingdotseq\":\"≓\",\"rlarr\":\"⇄\",\"rlhar\":\"⇌\",\"rlm\":\"‏\",\"rmoustache\":\"⎱\",\"rmoust\":\"⎱\",\"rnmid\":\"⫮\",\"roang\":\"⟭\",\"roarr\":\"⇾\",\"robrk\":\"⟧\",\"ropar\":\"⦆\",\"ropf\":\"𝕣\",\"Ropf\":\"ℝ\",\"roplus\":\"⨮\",\"rotimes\":\"⨵\",\"RoundImplies\":\"⥰\",\"rpar\":\")\",\"rpargt\":\"⦔\",\"rppolint\":\"⨒\",\"rrarr\":\"⇉\",\"Rrightarrow\":\"⇛\",\"rsaquo\":\"›\",\"rscr\":\"𝓇\",\"Rscr\":\"ℛ\",\"rsh\":\"↱\",\"Rsh\":\"↱\",\"rsqb\":\"]\",\"rsquo\":\"’\",\"rsquor\":\"’\",\"rthree\":\"⋌\",\"rtimes\":\"⋊\",\"rtri\":\"▹\",\"rtrie\":\"⊵\",\"rtrif\":\"▸\",\"rtriltri\":\"⧎\",\"RuleDelayed\":\"⧴\",\"ruluhar\":\"⥨\",\"rx\":\"℞\",\"Sacute\":\"Ś\",\"sacute\":\"ś\",\"sbquo\":\"‚\",\"scap\":\"⪸\",\"Scaron\":\"Š\",\"scaron\":\"š\",\"Sc\":\"⪼\",\"sc\":\"≻\",\"sccue\":\"≽\",\"sce\":\"⪰\",\"scE\":\"⪴\",\"Scedil\":\"Ş\",\"scedil\":\"ş\",\"Scirc\":\"Ŝ\",\"scirc\":\"ŝ\",\"scnap\":\"⪺\",\"scnE\":\"⪶\",\"scnsim\":\"⋩\",\"scpolint\":\"⨓\",\"scsim\":\"≿\",\"Scy\":\"С\",\"scy\":\"с\",\"sdotb\":\"⊡\",\"sdot\":\"⋅\",\"sdote\":\"⩦\",\"searhk\":\"⤥\",\"searr\":\"↘\",\"seArr\":\"⇘\",\"searrow\":\"↘\",\"sect\":\"§\",\"semi\":\";\",\"seswar\":\"⤩\",\"setminus\":\"∖\",\"setmn\":\"∖\",\"sext\":\"✶\",\"Sfr\":\"𝔖\",\"sfr\":\"𝔰\",\"sfrown\":\"⌢\",\"sharp\":\"♯\",\"SHCHcy\":\"Щ\",\"shchcy\":\"щ\",\"SHcy\":\"Ш\",\"shcy\":\"ш\",\"ShortDownArrow\":\"↓\",\"ShortLeftArrow\":\"←\",\"shortmid\":\"∣\",\"shortparallel\":\"∥\",\"ShortRightArrow\":\"→\",\"ShortUpArrow\":\"↑\",\"shy\":\"­\",\"Sigma\":\"Σ\",\"sigma\":\"σ\",\"sigmaf\":\"ς\",\"sigmav\":\"ς\",\"sim\":\"∼\",\"simdot\":\"⩪\",\"sime\":\"≃\",\"simeq\":\"≃\",\"simg\":\"⪞\",\"simgE\":\"⪠\",\"siml\":\"⪝\",\"simlE\":\"⪟\",\"simne\":\"≆\",\"simplus\":\"⨤\",\"simrarr\":\"⥲\",\"slarr\":\"←\",\"SmallCircle\":\"∘\",\"smallsetminus\":\"∖\",\"smashp\":\"⨳\",\"smeparsl\":\"⧤\",\"smid\":\"∣\",\"smile\":\"⌣\",\"smt\":\"⪪\",\"smte\":\"⪬\",\"smtes\":\"⪬︀\",\"SOFTcy\":\"Ь\",\"softcy\":\"ь\",\"solbar\":\"⌿\",\"solb\":\"⧄\",\"sol\":\"/\",\"Sopf\":\"𝕊\",\"sopf\":\"𝕤\",\"spades\":\"♠\",\"spadesuit\":\"♠\",\"spar\":\"∥\",\"sqcap\":\"⊓\",\"sqcaps\":\"⊓︀\",\"sqcup\":\"⊔\",\"sqcups\":\"⊔︀\",\"Sqrt\":\"√\",\"sqsub\":\"⊏\",\"sqsube\":\"⊑\",\"sqsubset\":\"⊏\",\"sqsubseteq\":\"⊑\",\"sqsup\":\"⊐\",\"sqsupe\":\"⊒\",\"sqsupset\":\"⊐\",\"sqsupseteq\":\"⊒\",\"square\":\"□\",\"Square\":\"□\",\"SquareIntersection\":\"⊓\",\"SquareSubset\":\"⊏\",\"SquareSubsetEqual\":\"⊑\",\"SquareSuperset\":\"⊐\",\"SquareSupersetEqual\":\"⊒\",\"SquareUnion\":\"⊔\",\"squarf\":\"▪\",\"squ\":\"□\",\"squf\":\"▪\",\"srarr\":\"→\",\"Sscr\":\"𝒮\",\"sscr\":\"𝓈\",\"ssetmn\":\"∖\",\"ssmile\":\"⌣\",\"sstarf\":\"⋆\",\"Star\":\"⋆\",\"star\":\"☆\",\"starf\":\"★\",\"straightepsilon\":\"ϵ\",\"straightphi\":\"ϕ\",\"strns\":\"¯\",\"sub\":\"⊂\",\"Sub\":\"⋐\",\"subdot\":\"⪽\",\"subE\":\"⫅\",\"sube\":\"⊆\",\"subedot\":\"⫃\",\"submult\":\"⫁\",\"subnE\":\"⫋\",\"subne\":\"⊊\",\"subplus\":\"⪿\",\"subrarr\":\"⥹\",\"subset\":\"⊂\",\"Subset\":\"⋐\",\"subseteq\":\"⊆\",\"subseteqq\":\"⫅\",\"SubsetEqual\":\"⊆\",\"subsetneq\":\"⊊\",\"subsetneqq\":\"⫋\",\"subsim\":\"⫇\",\"subsub\":\"⫕\",\"subsup\":\"⫓\",\"succapprox\":\"⪸\",\"succ\":\"≻\",\"succcurlyeq\":\"≽\",\"Succeeds\":\"≻\",\"SucceedsEqual\":\"⪰\",\"SucceedsSlantEqual\":\"≽\",\"SucceedsTilde\":\"≿\",\"succeq\":\"⪰\",\"succnapprox\":\"⪺\",\"succneqq\":\"⪶\",\"succnsim\":\"⋩\",\"succsim\":\"≿\",\"SuchThat\":\"∋\",\"sum\":\"∑\",\"Sum\":\"∑\",\"sung\":\"♪\",\"sup1\":\"¹\",\"sup2\":\"²\",\"sup3\":\"³\",\"sup\":\"⊃\",\"Sup\":\"⋑\",\"supdot\":\"⪾\",\"supdsub\":\"⫘\",\"supE\":\"⫆\",\"supe\":\"⊇\",\"supedot\":\"⫄\",\"Superset\":\"⊃\",\"SupersetEqual\":\"⊇\",\"suphsol\":\"⟉\",\"suphsub\":\"⫗\",\"suplarr\":\"⥻\",\"supmult\":\"⫂\",\"supnE\":\"⫌\",\"supne\":\"⊋\",\"supplus\":\"⫀\",\"supset\":\"⊃\",\"Supset\":\"⋑\",\"supseteq\":\"⊇\",\"supseteqq\":\"⫆\",\"supsetneq\":\"⊋\",\"supsetneqq\":\"⫌\",\"supsim\":\"⫈\",\"supsub\":\"⫔\",\"supsup\":\"⫖\",\"swarhk\":\"⤦\",\"swarr\":\"↙\",\"swArr\":\"⇙\",\"swarrow\":\"↙\",\"swnwar\":\"⤪\",\"szlig\":\"ß\",\"Tab\":\"\\t\",\"target\":\"⌖\",\"Tau\":\"Τ\",\"tau\":\"τ\",\"tbrk\":\"⎴\",\"Tcaron\":\"Ť\",\"tcaron\":\"ť\",\"Tcedil\":\"Ţ\",\"tcedil\":\"ţ\",\"Tcy\":\"Т\",\"tcy\":\"т\",\"tdot\":\"⃛\",\"telrec\":\"⌕\",\"Tfr\":\"𝔗\",\"tfr\":\"𝔱\",\"there4\":\"∴\",\"therefore\":\"∴\",\"Therefore\":\"∴\",\"Theta\":\"Θ\",\"theta\":\"θ\",\"thetasym\":\"ϑ\",\"thetav\":\"ϑ\",\"thickapprox\":\"≈\",\"thicksim\":\"∼\",\"ThickSpace\":\"  \",\"ThinSpace\":\" \",\"thinsp\":\" \",\"thkap\":\"≈\",\"thksim\":\"∼\",\"THORN\":\"Þ\",\"thorn\":\"þ\",\"tilde\":\"˜\",\"Tilde\":\"∼\",\"TildeEqual\":\"≃\",\"TildeFullEqual\":\"≅\",\"TildeTilde\":\"≈\",\"timesbar\":\"⨱\",\"timesb\":\"⊠\",\"times\":\"×\",\"timesd\":\"⨰\",\"tint\":\"∭\",\"toea\":\"⤨\",\"topbot\":\"⌶\",\"topcir\":\"⫱\",\"top\":\"⊤\",\"Topf\":\"𝕋\",\"topf\":\"𝕥\",\"topfork\":\"⫚\",\"tosa\":\"⤩\",\"tprime\":\"‴\",\"trade\":\"™\",\"TRADE\":\"™\",\"triangle\":\"▵\",\"triangledown\":\"▿\",\"triangleleft\":\"◃\",\"trianglelefteq\":\"⊴\",\"triangleq\":\"≜\",\"triangleright\":\"▹\",\"trianglerighteq\":\"⊵\",\"tridot\":\"◬\",\"trie\":\"≜\",\"triminus\":\"⨺\",\"TripleDot\":\"⃛\",\"triplus\":\"⨹\",\"trisb\":\"⧍\",\"tritime\":\"⨻\",\"trpezium\":\"⏢\",\"Tscr\":\"𝒯\",\"tscr\":\"𝓉\",\"TScy\":\"Ц\",\"tscy\":\"ц\",\"TSHcy\":\"Ћ\",\"tshcy\":\"ћ\",\"Tstrok\":\"Ŧ\",\"tstrok\":\"ŧ\",\"twixt\":\"≬\",\"twoheadleftarrow\":\"↞\",\"twoheadrightarrow\":\"↠\",\"Uacute\":\"Ú\",\"uacute\":\"ú\",\"uarr\":\"↑\",\"Uarr\":\"↟\",\"uArr\":\"⇑\",\"Uarrocir\":\"⥉\",\"Ubrcy\":\"Ў\",\"ubrcy\":\"ў\",\"Ubreve\":\"Ŭ\",\"ubreve\":\"ŭ\",\"Ucirc\":\"Û\",\"ucirc\":\"û\",\"Ucy\":\"У\",\"ucy\":\"у\",\"udarr\":\"⇅\",\"Udblac\":\"Ű\",\"udblac\":\"ű\",\"udhar\":\"⥮\",\"ufisht\":\"⥾\",\"Ufr\":\"𝔘\",\"ufr\":\"𝔲\",\"Ugrave\":\"Ù\",\"ugrave\":\"ù\",\"uHar\":\"⥣\",\"uharl\":\"↿\",\"uharr\":\"↾\",\"uhblk\":\"▀\",\"ulcorn\":\"⌜\",\"ulcorner\":\"⌜\",\"ulcrop\":\"⌏\",\"ultri\":\"◸\",\"Umacr\":\"Ū\",\"umacr\":\"ū\",\"uml\":\"¨\",\"UnderBar\":\"_\",\"UnderBrace\":\"⏟\",\"UnderBracket\":\"⎵\",\"UnderParenthesis\":\"⏝\",\"Union\":\"⋃\",\"UnionPlus\":\"⊎\",\"Uogon\":\"Ų\",\"uogon\":\"ų\",\"Uopf\":\"𝕌\",\"uopf\":\"𝕦\",\"UpArrowBar\":\"⤒\",\"uparrow\":\"↑\",\"UpArrow\":\"↑\",\"Uparrow\":\"⇑\",\"UpArrowDownArrow\":\"⇅\",\"updownarrow\":\"↕\",\"UpDownArrow\":\"↕\",\"Updownarrow\":\"⇕\",\"UpEquilibrium\":\"⥮\",\"upharpoonleft\":\"↿\",\"upharpoonright\":\"↾\",\"uplus\":\"⊎\",\"UpperLeftArrow\":\"↖\",\"UpperRightArrow\":\"↗\",\"upsi\":\"υ\",\"Upsi\":\"ϒ\",\"upsih\":\"ϒ\",\"Upsilon\":\"Υ\",\"upsilon\":\"υ\",\"UpTeeArrow\":\"↥\",\"UpTee\":\"⊥\",\"upuparrows\":\"⇈\",\"urcorn\":\"⌝\",\"urcorner\":\"⌝\",\"urcrop\":\"⌎\",\"Uring\":\"Ů\",\"uring\":\"ů\",\"urtri\":\"◹\",\"Uscr\":\"𝒰\",\"uscr\":\"𝓊\",\"utdot\":\"⋰\",\"Utilde\":\"Ũ\",\"utilde\":\"ũ\",\"utri\":\"▵\",\"utrif\":\"▴\",\"uuarr\":\"⇈\",\"Uuml\":\"Ü\",\"uuml\":\"ü\",\"uwangle\":\"⦧\",\"vangrt\":\"⦜\",\"varepsilon\":\"ϵ\",\"varkappa\":\"ϰ\",\"varnothing\":\"∅\",\"varphi\":\"ϕ\",\"varpi\":\"ϖ\",\"varpropto\":\"∝\",\"varr\":\"↕\",\"vArr\":\"⇕\",\"varrho\":\"ϱ\",\"varsigma\":\"ς\",\"varsubsetneq\":\"⊊︀\",\"varsubsetneqq\":\"⫋︀\",\"varsupsetneq\":\"⊋︀\",\"varsupsetneqq\":\"⫌︀\",\"vartheta\":\"ϑ\",\"vartriangleleft\":\"⊲\",\"vartriangleright\":\"⊳\",\"vBar\":\"⫨\",\"Vbar\":\"⫫\",\"vBarv\":\"⫩\",\"Vcy\":\"В\",\"vcy\":\"в\",\"vdash\":\"⊢\",\"vDash\":\"⊨\",\"Vdash\":\"⊩\",\"VDash\":\"⊫\",\"Vdashl\":\"⫦\",\"veebar\":\"⊻\",\"vee\":\"∨\",\"Vee\":\"⋁\",\"veeeq\":\"≚\",\"vellip\":\"⋮\",\"verbar\":\"|\",\"Verbar\":\"‖\",\"vert\":\"|\",\"Vert\":\"‖\",\"VerticalBar\":\"∣\",\"VerticalLine\":\"|\",\"VerticalSeparator\":\"❘\",\"VerticalTilde\":\"≀\",\"VeryThinSpace\":\" \",\"Vfr\":\"𝔙\",\"vfr\":\"𝔳\",\"vltri\":\"⊲\",\"vnsub\":\"⊂⃒\",\"vnsup\":\"⊃⃒\",\"Vopf\":\"𝕍\",\"vopf\":\"𝕧\",\"vprop\":\"∝\",\"vrtri\":\"⊳\",\"Vscr\":\"𝒱\",\"vscr\":\"𝓋\",\"vsubnE\":\"⫋︀\",\"vsubne\":\"⊊︀\",\"vsupnE\":\"⫌︀\",\"vsupne\":\"⊋︀\",\"Vvdash\":\"⊪\",\"vzigzag\":\"⦚\",\"Wcirc\":\"Ŵ\",\"wcirc\":\"ŵ\",\"wedbar\":\"⩟\",\"wedge\":\"∧\",\"Wedge\":\"⋀\",\"wedgeq\":\"≙\",\"weierp\":\"℘\",\"Wfr\":\"𝔚\",\"wfr\":\"𝔴\",\"Wopf\":\"𝕎\",\"wopf\":\"𝕨\",\"wp\":\"℘\",\"wr\":\"≀\",\"wreath\":\"≀\",\"Wscr\":\"𝒲\",\"wscr\":\"𝓌\",\"xcap\":\"⋂\",\"xcirc\":\"◯\",\"xcup\":\"⋃\",\"xdtri\":\"▽\",\"Xfr\":\"𝔛\",\"xfr\":\"𝔵\",\"xharr\":\"⟷\",\"xhArr\":\"⟺\",\"Xi\":\"Ξ\",\"xi\":\"ξ\",\"xlarr\":\"⟵\",\"xlArr\":\"⟸\",\"xmap\":\"⟼\",\"xnis\":\"⋻\",\"xodot\":\"⨀\",\"Xopf\":\"𝕏\",\"xopf\":\"𝕩\",\"xoplus\":\"⨁\",\"xotime\":\"⨂\",\"xrarr\":\"⟶\",\"xrArr\":\"⟹\",\"Xscr\":\"𝒳\",\"xscr\":\"𝓍\",\"xsqcup\":\"⨆\",\"xuplus\":\"⨄\",\"xutri\":\"△\",\"xvee\":\"⋁\",\"xwedge\":\"⋀\",\"Yacute\":\"Ý\",\"yacute\":\"ý\",\"YAcy\":\"Я\",\"yacy\":\"я\",\"Ycirc\":\"Ŷ\",\"ycirc\":\"ŷ\",\"Ycy\":\"Ы\",\"ycy\":\"ы\",\"yen\":\"¥\",\"Yfr\":\"𝔜\",\"yfr\":\"𝔶\",\"YIcy\":\"Ї\",\"yicy\":\"ї\",\"Yopf\":\"𝕐\",\"yopf\":\"𝕪\",\"Yscr\":\"𝒴\",\"yscr\":\"𝓎\",\"YUcy\":\"Ю\",\"yucy\":\"ю\",\"yuml\":\"ÿ\",\"Yuml\":\"Ÿ\",\"Zacute\":\"Ź\",\"zacute\":\"ź\",\"Zcaron\":\"Ž\",\"zcaron\":\"ž\",\"Zcy\":\"З\",\"zcy\":\"з\",\"Zdot\":\"Ż\",\"zdot\":\"ż\",\"zeetrf\":\"ℨ\",\"ZeroWidthSpace\":\"​\",\"Zeta\":\"Ζ\",\"zeta\":\"ζ\",\"zfr\":\"𝔷\",\"Zfr\":\"ℨ\",\"ZHcy\":\"Ж\",\"zhcy\":\"ж\",\"zigrarr\":\"⇝\",\"zopf\":\"𝕫\",\"Zopf\":\"ℤ\",\"Zscr\":\"𝒵\",\"zscr\":\"𝓏\",\"zwj\":\"‍\",\"zwnj\":\"‌\"}"); + +/***/ }), + +/***/ "../../node_modules/entities/maps/legacy.json": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/entities/maps/legacy.json ***! + \******************************************************************************/ +/*! exports provided: Aacute, aacute, Acirc, acirc, acute, AElig, aelig, Agrave, agrave, amp, AMP, Aring, aring, Atilde, atilde, Auml, auml, brvbar, Ccedil, ccedil, cedil, cent, copy, COPY, curren, deg, divide, Eacute, eacute, Ecirc, ecirc, Egrave, egrave, ETH, eth, Euml, euml, frac12, frac14, frac34, gt, GT, Iacute, iacute, Icirc, icirc, iexcl, Igrave, igrave, iquest, Iuml, iuml, laquo, lt, LT, macr, micro, middot, nbsp, not, Ntilde, ntilde, Oacute, oacute, Ocirc, ocirc, Ograve, ograve, ordf, ordm, Oslash, oslash, Otilde, otilde, Ouml, ouml, para, plusmn, pound, quot, QUOT, raquo, reg, REG, sect, shy, sup1, sup2, sup3, szlig, THORN, thorn, times, Uacute, uacute, Ucirc, ucirc, Ugrave, ugrave, uml, Uuml, uuml, Yacute, yacute, yen, yuml, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"Aacute\":\"Á\",\"aacute\":\"á\",\"Acirc\":\"Â\",\"acirc\":\"â\",\"acute\":\"´\",\"AElig\":\"Æ\",\"aelig\":\"æ\",\"Agrave\":\"À\",\"agrave\":\"à\",\"amp\":\"&\",\"AMP\":\"&\",\"Aring\":\"Å\",\"aring\":\"å\",\"Atilde\":\"Ã\",\"atilde\":\"ã\",\"Auml\":\"Ä\",\"auml\":\"ä\",\"brvbar\":\"¦\",\"Ccedil\":\"Ç\",\"ccedil\":\"ç\",\"cedil\":\"¸\",\"cent\":\"¢\",\"copy\":\"©\",\"COPY\":\"©\",\"curren\":\"¤\",\"deg\":\"°\",\"divide\":\"÷\",\"Eacute\":\"É\",\"eacute\":\"é\",\"Ecirc\":\"Ê\",\"ecirc\":\"ê\",\"Egrave\":\"È\",\"egrave\":\"è\",\"ETH\":\"Ð\",\"eth\":\"ð\",\"Euml\":\"Ë\",\"euml\":\"ë\",\"frac12\":\"½\",\"frac14\":\"¼\",\"frac34\":\"¾\",\"gt\":\">\",\"GT\":\">\",\"Iacute\":\"Í\",\"iacute\":\"í\",\"Icirc\":\"Î\",\"icirc\":\"î\",\"iexcl\":\"¡\",\"Igrave\":\"Ì\",\"igrave\":\"ì\",\"iquest\":\"¿\",\"Iuml\":\"Ï\",\"iuml\":\"ï\",\"laquo\":\"«\",\"lt\":\"<\",\"LT\":\"<\",\"macr\":\"¯\",\"micro\":\"µ\",\"middot\":\"·\",\"nbsp\":\" \",\"not\":\"¬\",\"Ntilde\":\"Ñ\",\"ntilde\":\"ñ\",\"Oacute\":\"Ó\",\"oacute\":\"ó\",\"Ocirc\":\"Ô\",\"ocirc\":\"ô\",\"Ograve\":\"Ò\",\"ograve\":\"ò\",\"ordf\":\"ª\",\"ordm\":\"º\",\"Oslash\":\"Ø\",\"oslash\":\"ø\",\"Otilde\":\"Õ\",\"otilde\":\"õ\",\"Ouml\":\"Ö\",\"ouml\":\"ö\",\"para\":\"¶\",\"plusmn\":\"±\",\"pound\":\"£\",\"quot\":\"\\\"\",\"QUOT\":\"\\\"\",\"raquo\":\"»\",\"reg\":\"®\",\"REG\":\"®\",\"sect\":\"§\",\"shy\":\"­\",\"sup1\":\"¹\",\"sup2\":\"²\",\"sup3\":\"³\",\"szlig\":\"ß\",\"THORN\":\"Þ\",\"thorn\":\"þ\",\"times\":\"×\",\"Uacute\":\"Ú\",\"uacute\":\"ú\",\"Ucirc\":\"Û\",\"ucirc\":\"û\",\"Ugrave\":\"Ù\",\"ugrave\":\"ù\",\"uml\":\"¨\",\"Uuml\":\"Ü\",\"uuml\":\"ü\",\"Yacute\":\"Ý\",\"yacute\":\"ý\",\"yen\":\"¥\",\"yuml\":\"ÿ\"}"); + +/***/ }), + +/***/ "../../node_modules/entities/maps/xml.json": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/entities/maps/xml.json ***! + \***************************************************************************/ +/*! exports provided: amp, apos, gt, lt, quot, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"amp\":\"&\",\"apos\":\"'\",\"gt\":\">\",\"lt\":\"<\",\"quot\":\"\\\"\"}"); + +/***/ }), + +/***/ "../../node_modules/es-abstract/GetIntrinsic.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/GetIntrinsic.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; + +var $TypeError = TypeError; + +var throwTypeError = function () { throw new $TypeError(); }; +var ThrowTypeError = Object.getOwnPropertyDescriptor + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return Object.getOwnPropertyDescriptor(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/es-abstract/node_modules/has-symbols/index.js")(); + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '$ %Array%': Array, + '$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '$ %ArrayPrototype%': Array.prototype, + '$ %ArrayProto_entries%': Array.prototype.entries, + '$ %ArrayProto_forEach%': Array.prototype.forEach, + '$ %ArrayProto_keys%': Array.prototype.keys, + '$ %ArrayProto_values%': Array.prototype.values, + '$ %AsyncFromSyncIteratorPrototype%': undefined, + '$ %AsyncFunction%': asyncFunction, + '$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '$ %AsyncGeneratorFunction%': asyncGenFunction, + '$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '$ %Boolean%': Boolean, + '$ %BooleanPrototype%': Boolean.prototype, + '$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '$ %Date%': Date, + '$ %DatePrototype%': Date.prototype, + '$ %decodeURI%': decodeURI, + '$ %decodeURIComponent%': decodeURIComponent, + '$ %encodeURI%': encodeURI, + '$ %encodeURIComponent%': encodeURIComponent, + '$ %Error%': Error, + '$ %ErrorPrototype%': Error.prototype, + '$ %eval%': eval, // eslint-disable-line no-eval + '$ %EvalError%': EvalError, + '$ %EvalErrorPrototype%': EvalError.prototype, + '$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '$ %Function%': Function, + '$ %FunctionPrototype%': Function.prototype, + '$ %Generator%': generator ? getProto(generator()) : undefined, + '$ %GeneratorFunction%': generatorFunction, + '$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '$ %isFinite%': isFinite, + '$ %isNaN%': isNaN, + '$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '$ %JSON%': typeof JSON === 'object' ? JSON : undefined, + '$ %JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, + '$ %Map%': typeof Map === 'undefined' ? undefined : Map, + '$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '$ %Math%': Math, + '$ %Number%': Number, + '$ %NumberPrototype%': Number.prototype, + '$ %Object%': Object, + '$ %ObjectPrototype%': Object.prototype, + '$ %ObjProto_toString%': Object.prototype.toString, + '$ %ObjProto_valueOf%': Object.prototype.valueOf, + '$ %parseFloat%': parseFloat, + '$ %parseInt%': parseInt, + '$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '$ %RangeError%': RangeError, + '$ %RangeErrorPrototype%': RangeError.prototype, + '$ %ReferenceError%': ReferenceError, + '$ %ReferenceErrorPrototype%': ReferenceError.prototype, + '$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '$ %RegExp%': RegExp, + '$ %RegExpPrototype%': RegExp.prototype, + '$ %Set%': typeof Set === 'undefined' ? undefined : Set, + '$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '$ %String%': String, + '$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '$ %StringPrototype%': String.prototype, + '$ %Symbol%': hasSymbols ? Symbol : undefined, + '$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '$ %SyntaxError%': SyntaxError, + '$ %SyntaxErrorPrototype%': SyntaxError.prototype, + '$ %ThrowTypeError%': ThrowTypeError, + '$ %TypedArray%': TypedArray, + '$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '$ %TypeError%': $TypeError, + '$ %TypeErrorPrototype%': $TypeError.prototype, + '$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '$ %URIError%': URIError, + '$ %URIErrorPrototype%': URIError.prototype, + '$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var $replace = bind.call(Function.call, String.prototype.replace); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +var stringToPath = function stringToPath(string) { + var result = []; + $replace(string, rePropName, function (match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); + }); + return result; +}; +/* end adaptation */ + +var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { + var key = '$ ' + name; + if (!(key in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) { + throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + + return INTRINSICS[key]; +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var parts = stringToPath(name); + + if (parts.length === 0) { + return getBaseIntrinsic(name, allowMissing); + } + + var value = getBaseIntrinsic('%' + parts[0] + '%', allowMissing); + for (var i = 1; i < parts.length; i += 1) { + if (value != null) { + value = value[parts[i]]; + } + } + return value; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/es2015.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/es2015.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es6 */ "../../node_modules/es-to-primitive/es6.js"); +var keys = __webpack_require__(/*! object-keys */ "../../node_modules/object-keys/index.js"); +var inspect = __webpack_require__(/*! object-inspect */ "../../node_modules/object-inspect/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $Array = GetIntrinsic('%Array%'); +var $ArrayPrototype = $Array.prototype; +var $String = GetIntrinsic('%String%'); +var $Object = GetIntrinsic('%Object%'); +var $Number = GetIntrinsic('%Number%'); +var $Symbol = GetIntrinsic('%Symbol%', true); +var $RegExp = GetIntrinsic('%RegExp%'); +var $Date = GetIntrinsic('%Date%'); +var $Function = GetIntrinsic('%Function%'); +var $preventExtensions = $Object.preventExtensions; + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/es-abstract/node_modules/has-symbols/index.js")(); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/es-abstract/helpers/assertRecord.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/es-abstract/helpers/isFinite.js"); +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; +var MAX_SAFE_INTEGER = __webpack_require__(/*! ./helpers/maxSafeInteger */ "../../node_modules/es-abstract/helpers/maxSafeInteger.js"); + +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/es-abstract/helpers/assign.js"); +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/es-abstract/helpers/mod.js"); +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/es-abstract/helpers/isPrimitive.js"); +var forEach = __webpack_require__(/*! ./helpers/forEach */ "../../node_modules/es-abstract/helpers/forEach.js"); +var every = __webpack_require__(/*! ./helpers/every */ "../../node_modules/es-abstract/helpers/every.js"); +var isSamePropertyDescriptor = __webpack_require__(/*! ./helpers/isSamePropertyDescriptor */ "../../node_modules/es-abstract/helpers/isSamePropertyDescriptor.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var parseInteger = parseInt; +var callBound = __webpack_require__(/*! ./helpers/callBound */ "../../node_modules/es-abstract/helpers/callBound.js"); +var regexTester = __webpack_require__(/*! ./helpers/regexTester */ "../../node_modules/es-abstract/helpers/regexTester.js"); +var getIteratorMethod = __webpack_require__(/*! ./helpers/getIteratorMethod */ "../../node_modules/es-abstract/helpers/getIteratorMethod.js"); +var getSymbolDescription = __webpack_require__(/*! ./helpers/getSymbolDescription */ "../../node_modules/es-abstract/helpers/getSymbolDescription.js"); + +var $PromiseThen = callBound('Promise.prototype.then', true); +var arraySlice = callBound('Array.prototype.slice'); +var strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('Array.prototype.indexOf'); +var $push = callBound('Array.prototype.push'); + +var isBinary = regexTester(/^0b[01]+$/i); +var isOctal = regexTester(/^0o[0-7]+$/i); +var isDigit = regexTester(/^[0-9]$/); +var regexExec = callBound('RegExp.prototype.exec'); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = regexTester(nonWSregex); +var isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i); +var $charCodeAt = callBound('String.prototype.charCodeAt'); +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); + +var toStr = callBound('Object.prototype.toString'); + +var $NumberValueOf = callBound('Number.prototype.valueOf'); +var $BooleanValueOf = callBound('Boolean.prototype.valueOf'); +var $StringValueOf = callBound('String.prototype.valueOf'); +var $DateValueOf = callBound('Date.prototype.valueOf'); +var $SymbolToString = callBound('Symbol.prototype.toString', true); + +var $floor = Math.floor; +var $abs = Math.abs; + +var $ObjectCreate = $Object.create; +var $gOPD = $Object.getOwnPropertyDescriptor; +var $gOPN = $Object.getOwnPropertyNames; +var $gOPS = $Object.getOwnPropertySymbols; +var $isExtensible = $Object.isExtensible; +var $defineProperty = $Object.defineProperty; +var $setProto = __webpack_require__(/*! ./helpers/setProto */ "../../node_modules/es-abstract/helpers/setProto.js"); + +var DefineOwnProperty = function DefineOwnProperty(ES, O, P, desc) { + if (!$defineProperty) { + if (!ES.IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + // eslint-disable-next-line no-param-reassign + O[P] = V; // will use [[Define]] + return ES.SameValue(O[P], V); + } + $defineProperty(O, P, ES.FromPropertyDescriptor(desc)); + return true; +}; + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBound('String.prototype.replace'); +var trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ES5 = __webpack_require__(/*! ./es5 */ "../../node_modules/es-abstract/es5.js"); + +var hasRegExpMatcher = __webpack_require__(/*! is-regex */ "../../node_modules/is-regex/index.js"); + +// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations +var ES6 = assign(assign({}, ES5), { + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args + Call: function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + if (!this.IsCallable(F)) { + throw new $TypeError(inspect(F) + ' is not a function'); + } + return F.apply(V, args); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive + ToPrimitive: toPrimitive, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean + // ToBoolean: ES5.ToBoolean, + + // https://ecma-international.org/ecma-262/6.0/#sec-tonumber + ToNumber: function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : toPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = trim(value); + if (trimmed !== value) { + return this.ToNumber(trimmed); + } + } + } + return $Number(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger + // ToInteger: ES5.ToNumber, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32 + // ToInt32: ES5.ToInt32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32 + // ToUint32: ES5.ToUint32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16 + ToInt16: function ToInt16(argument) { + var int16bit = this.ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16 + // ToUint16: ES5.ToUint16, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8 + ToInt8: function ToInt8(argument) { + var int8bit = this.ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8 + ToUint8: function ToUint8(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * $floor($abs(number)); + return mod(posInt, 0x100); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp + ToUint8Clamp: function ToUint8Clamp(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring + ToString: function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject + ToObject: function ToObject(value) { + this.RequireObjectCoercible(value); + return $Object(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + ToPropertyKey: function ToPropertyKey(argument) { + var key = this.ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : this.ToString(key); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + ToLength: function ToLength(argument) { + var len = this.ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) { + if (toStr(argument) !== '[object String]') { + throw new $TypeError('must be a string'); + } + if (argument === '-0') { return -0; } + var n = this.ToNumber(argument); + if (this.SameValue(this.ToString(n), argument)) { return n; } + return void 0; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible + RequireObjectCoercible: ES5.CheckObjectCoercible, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + IsArray: $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable + // IsCallable: ES5.IsCallable, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + IsConstructor: function IsConstructor(argument) { + return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument` or Proxy + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o + IsExtensible: $preventExtensions + ? function IsExtensible(obj) { + if (isPrimitive(obj)) { + return false; + } + return $isExtensible(obj); + } + : function isExtensible(obj) { return true; }, // eslint-disable-line no-unused-vars + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger + IsInteger: function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey + IsPropertyKey: function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isregexp + IsRegExp: function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if (hasSymbols) { + var isRegExp = argument[$Symbol.match]; + if (typeof isRegExp !== 'undefined') { + return ES5.ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue + // SameValue: ES5.SameValue, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero + SameValueZero: function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); + }, + + /** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + GetV: function GetV(V, P) { + // 7.3.2.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = this.ToObject(V); + + // 7.3.2.4 + return O[P]; + }, + + /** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + GetMethod: function GetMethod(O, P) { + // 7.3.9.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = this.GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!this.IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; + }, + + /** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + Get: function Get(O, P) { + // 7.3.1.1 + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; + }, + + Type: function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5.Type(x); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (this.Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (this.IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) { + /* eslint no-param-reassign: 0 */ + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + Set: function Set(O, P, V, Throw) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + if (this.Type(Throw) !== 'Boolean') { + throw new $TypeError('Throw must be a Boolean'); + } + if (Throw) { + O[P] = V; + return true; + } else { + try { + O[P] = V; + } catch (e) { + return false; + } + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + HasOwnProperty: function HasOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return has(O, P); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + HasProperty: function HasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return P in O; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + IsConcatSpreadable: function IsConcatSpreadable(O) { + if (this.Type(O) !== 'Object') { + return false; + } + if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') { + var spreadable = this.Get(O, Symbol.isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return this.ToBoolean(spreadable); + } + } + return this.IsArray(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-invoke + Invoke: function Invoke(O, P) { + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = arraySlice(arguments, 2); + var func = this.GetV(O, P); + return this.Call(func, O, argumentsList); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-getiterator + GetIterator: function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + actualMethod = getIteratorMethod(this, obj); + } + var iterator = this.Call(actualMethod, obj); + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + IteratorNext: function IteratorNext(iterator, value) { + var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (this.Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + IteratorComplete: function IteratorComplete(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.ToBoolean(this.Get(iterResult, 'done')); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + IteratorValue: function IteratorValue(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.Get(iterResult, 'value'); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + IteratorStep: function IteratorStep(iterator) { + var result = this.IteratorNext(iterator); + var done = this.IteratorComplete(result); + return done === true ? false : result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + IteratorClose: function IteratorClose(iterator, completion) { + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!this.IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = this.GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = this.Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionRecord = completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (this.Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + CreateIterResultObject: function CreateIterResultObject(value, done) { + if (this.Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + RegExpExec: function RegExpExec(R, S) { + if (this.Type(R) !== 'Object') { + throw new $TypeError('R must be an Object'); + } + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + var exec = this.Get(R, 'exec'); + if (this.IsCallable(exec)) { + var result = this.Call(exec, R, [S]); + if (result === null || this.Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = this.IsArray(originalArray); + if (isArray) { + C = this.Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (this.IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) { + C = this.Get(C, $Symbol.species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!this.IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // this.Construct(C, len); + }, + + CreateDataProperty: function CreateDataProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = $gOPD(O, P); + var extensible = oldDesc || this.IsExtensible(O); + var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty(this, O, P, { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + }); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = this.CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + ObjectCreate: function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && this.Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: proto must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if (proto === null && !$ObjectCreate) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + + return $ObjectCreate(proto); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) { + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53'); + } + if (this.Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: unicode must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + CreateMethodProperty: function CreateMethodProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty(this, O, P, newDesc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + DefinePropertyOrThrow: function DefinePropertyOrThrow(O, P, desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor(this, desc) ? desc : this.ToPropertyDescriptor(desc); + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty(this, O, P, Desc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + DeletePropertyOrThrow: function DeletePropertyOrThrow(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var success = delete O[P]; + if (!success) { + throw new TypeError('Attempt to delete property failed.'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + EnumerableOwnNames: function EnumerableOwnNames(O) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + thisNumberValue: function thisNumberValue(value) { + if (this.Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + thisBooleanValue: function thisBooleanValue(value) { + if (this.Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + thisStringValue: function thisStringValue(value) { + if (this.Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + thisTimeValue: function thisTimeValue(value) { + return $DateValueOf(value); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + SetIntegrityLevel: function SetIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + var ES = this; + if (level === 'sealed') { + forEach(theKeys, function (k) { + ES.DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (ES.IsAccessorDescriptor(ES.ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + ES.DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + TestIntegrityLevel: function TestIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = this.IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + var ES = this; + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && ES.IsDataDescriptor(ES.ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + OrdinaryHasInstance: function OrdinaryHasInstance(C, O) { + if (this.IsCallable(C) === false) { + return false; + } + if (this.Type(O) !== 'Object') { + return false; + } + var P = this.Get(C, 'prototype'); + if (this.Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + OrdinaryHasProperty: function OrdinaryHasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + InstanceofOperator: function InstanceofOperator(O, C) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = hasSymbols && $Symbol.hasInstance ? this.GetMethod(C, $Symbol.hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return this.ToBoolean(this.Call(instOfHandler, C, [O])); + } + if (!this.IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return this.OrdinaryHasInstance(C, O); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + IsPromise: function IsPromise(x) { + if (this.Type(x) !== 'Object') { + return false; + } + if (!$PromiseThen) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // eslint-disable-next-line max-lines-per-function, max-statements, id-length, max-params + ValidateAndApplyPropertyDescriptor: function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = this.Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (this.Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (this.Type(current) !== 'Undefined' && !isPropertyDescriptor(this, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (this.Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + }); + } + } else { + if (!this.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + } + return true; + } + if (this.IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor(this, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (this.IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (this.IsDataDescriptor(current) !== this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (this.IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + }); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + }); + } + } else if (this.IsDataDescriptor(current) && this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !this.SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (this.IsAccessorDescriptor(current) && this.IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !this.SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !this.SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + OrdinaryDefineOwnProperty: function OrdinaryDefineOwnProperty(O, P, Desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + var desc = $gOPD(O, P); + var current = desc && this.ToPropertyDescriptor(desc); + var extensible = this.IsExtensible(O); + return this.ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + OrdinaryGetOwnProperty: function OrdinaryGetOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 fallback + var arrayLength = this.IsArray(O) && P === 'length'; + var regexLastIndex = this.IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return this.ToPropertyDescriptor($gOPD(O, P)); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + ArrayCreate: function ArrayCreate(length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + this.OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; + }, + + // eslint-disable-next-line max-statements, max-lines-per-function + ArraySetLength: function ArraySetLength(A, Desc) { + if (!this.IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return this.OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = this.ToUint32(Desc['[[Value]]']); + var numberLen = this.ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = this.OrdinaryGetOwnProperty(A, 'length'); + if (!this.IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + var deleteSucceeded = delete A[this.ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return this.OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + CreateHTML: function CreateHTML(string, tag, attribute, value) { + if (this.Type(tag) !== 'String' || this.Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = this.RequireObjectCoercible(string); + var S = this.ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = this.ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + '</' + tag + '>'; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + GetOwnPropertyKeys: function GetOwnPropertyKeys(O, Type) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return hasSymbols && $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + SymbolDescriptiveString: function SymbolDescriptiveString(sym) { + if (this.Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + // eslint-disable-next-line max-statements, max-params, max-lines-per-function + GetSubstitution: function GetSubstitution(matched, str, position, captures, replacement) { + if (this.Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (this.Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!this.IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + var ES = this; + var isStringOrHole = function (capture, index, arr) { return ES.Type(capture) === 'String' || !(index in arr); }; + if (!this.IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (this.Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = replacement[i]; + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = replacement[i + 1]; + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : replacement[i + 2]; + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = parseInteger(next, 10); + // if (n > m, impl-defined) + result += (n <= m && this.Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = parseInteger(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && this.Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += replacement[i]; + } + } + return result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-todatestring + ToDateString: function ToDateString(tv) { + if (this.Type(tv) !== 'Number') { + throw new $TypeError('Assertion failed: `tv` must be a Number'); + } + if ($isNaN(tv)) { + return 'Invalid Date'; + } + return $Date(tv); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createlistfromarraylike + CreateListFromArrayLike: function CreateListFromArrayLike(obj) { + var elementTypes = arguments.length > 1 + ? arguments[1] + : ['Undefined', 'Null', 'Boolean', 'String', 'Symbol', 'Number', 'Object']; + + if (this.Type(obj) !== 'Object') { + throw new $TypeError('Assertion failed: `obj` must be an Object'); + } + if (!this.IsArray(elementTypes)) { + throw new $TypeError('Assertion failed: `elementTypes`, if provided, must be an array'); + } + var len = this.ToLength(this.Get(obj, 'length')); + var list = []; + var index = 0; + while (index < len) { + var indexName = this.ToString(index); + var next = this.Get(obj, indexName); + var nextType = this.Type(next); + if ($indexOf(elementTypes, nextType) < 0) { + throw new $TypeError('item type ' + nextType + ' is not a valid elementType'); + } + $push(list, next); + index += 1; + } + return list; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-getprototypefromconstructor + GetPrototypeFromConstructor: function GetPrototypeFromConstructor(constructor, intrinsicDefaultProto) { + var intrinsic = GetIntrinsic(intrinsicDefaultProto); // throws if not a valid intrinsic + if (!this.IsConstructor(constructor)) { + throw new $TypeError('Assertion failed: `constructor` must be a constructor'); + } + var proto = this.Get(constructor, 'prototype'); + if (this.Type(proto) !== 'Object') { + if (!(constructor instanceof $Function)) { + // ignore other realms, for now + throw new $TypeError('cross-realm constructors not currently supported'); + } + proto = intrinsic; + } + return proto; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-setfunctionname + SetFunctionName: function SetFunctionName(F, name) { + if (typeof F !== 'function') { + throw new $TypeError('Assertion failed: `F` must be a function'); + } + if (!this.IsExtensible(F) || has(F, 'name')) { + throw new $TypeError('Assertion failed: `F` must be extensible, and must not have a `name` own property'); + } + var nameType = this.Type(name); + if (nameType !== 'Symbol' && nameType !== 'String') { + throw new $TypeError('Assertion failed: `name` must be a Symbol or a String'); + } + if (nameType === 'Symbol') { + var description = getSymbolDescription(name); + // eslint-disable-next-line no-param-reassign + name = typeof description === 'undefined' ? '' : '[' + description + ']'; + } + if (arguments.length > 2) { + var prefix = arguments[2]; + // eslint-disable-next-line no-param-reassign + name = prefix + ' ' + name; + } + return this.DefinePropertyOrThrow(F, 'name', { + '[[Value]]': name, + '[[Writable]]': false, + '[[Enumerable]]': false, + '[[Configurable]]': true + }); + } +}); + +delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible + +module.exports = ES6; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/es2016.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/es2016.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES2015 = __webpack_require__(/*! ./es2015 */ "../../node_modules/es-abstract/es2015.js"); +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/es-abstract/helpers/assign.js"); +var $setProto = __webpack_require__(/*! ./helpers/setProto */ "../../node_modules/es-abstract/helpers/setProto.js"); + +var callBound = __webpack_require__(/*! ./helpers/callBound */ "../../node_modules/es-abstract/helpers/callBound.js"); +var getIteratorMethod = __webpack_require__(/*! ./helpers/getIteratorMethod */ "../../node_modules/es-abstract/helpers/getIteratorMethod.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $arrayPush = callBound('Array.prototype.push'); +var $getProto = __webpack_require__(/*! ./helpers/getProto */ "../../node_modules/es-abstract/helpers/getProto.js"); + +var ES2016 = assign(assign({}, ES2015), { + // https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + SameValueNonNumber: function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return this.SameValue(x, y); + }, + + // https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike + IterableToArrayLike: function IterableToArrayLike(items) { + var usingIterator = getIteratorMethod(this, items); + if (typeof usingIterator !== 'undefined') { + var iterator = this.GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = this.IteratorStep(iterator); + if (next) { + var nextValue = this.IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return this.ToObject(items); + }, + + // https://ecma-international.org/ecma-262/7.0/#sec-ordinarygetprototypeof + OrdinaryGetPrototypeOf: function (O) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!$getProto) { + throw new $TypeError('This environment does not support fetching prototypes.'); + } + return $getProto(O); + }, + + // https://ecma-international.org/ecma-262/7.0/#sec-ordinarysetprototypeof + OrdinarySetPrototypeOf: function (O, V) { + if (this.Type(V) !== 'Object' && this.Type(V) !== 'Null') { + throw new $TypeError('Assertion failed: V must be Object or Null'); + } + /* + var extensible = this.IsExtensible(O); + var current = this.OrdinaryGetPrototypeOf(O); + if (this.SameValue(V, current)) { + return true; + } + if (!extensible) { + return false; + } + */ + try { + $setProto(O, V); + } catch (e) { + return false; + } + return this.OrdinaryGetPrototypeOf(O) === V; + /* + var p = V; + var done = false; + while (!done) { + if (p === null) { + done = true; + } else if (this.SameValue(p, O)) { + return false; + } else { + if (wat) { + done = true; + } else { + p = p.[[Prototype]]; + } + } + } + O.[[Prototype]] = V; + return true; + */ + } +}); + +module.exports = ES2016; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/es2017.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/es2017.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var ES2016 = __webpack_require__(/*! ./es2016 */ "../../node_modules/es-abstract/es2016.js"); +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/es-abstract/helpers/assign.js"); +var forEach = __webpack_require__(/*! ./helpers/forEach */ "../../node_modules/es-abstract/helpers/forEach.js"); +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/es-abstract/helpers/callBind.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var callBound = __webpack_require__(/*! ./helpers/callBound */ "../../node_modules/es-abstract/helpers/callBound.js"); +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); +var $arrayPush = callBound('Array.prototype.push'); + +var ES2017 = assign(assign({}, ES2016), { + ToIndex: function ToIndex(value) { + if (typeof value === 'undefined') { + return 0; + } + var integerIndex = this.ToInteger(value); + if (integerIndex < 0) { + throw new RangeError('index must be >= 0'); + } + var index = this.ToLength(integerIndex); + if (!this.SameValueZero(integerIndex, index)) { + throw new RangeError('index must be >= 0 and < 2 ** 53 - 1'); + } + return index; + }, + + // https://www.ecma-international.org/ecma-262/8.0/#sec-enumerableownproperties + EnumerableOwnProperties: function EnumerableOwnProperties(O, kind) { + var keys = ES2016.EnumerableOwnNames(O); + if (kind === 'key') { + return keys; + } + if (kind === 'value' || kind === 'key+value') { + var results = []; + forEach(keys, function (key) { + if ($isEnumerable(O, key)) { + $pushApply(results, [ + kind === 'value' ? O[key] : [key, O[key]] + ]); + } + }); + return results; + } + throw new $TypeError('Assertion failed: "kind" is not "key", "value", or "key+value": ' + kind); + }, + + // https://www.ecma-international.org/ecma-262/8.0/#sec-iterabletolist + IterableToList: function IterableToList(items, method) { + var iterator = this.GetIterator(items, method); + var values = []; + var next = true; + while (next) { + next = this.IteratorStep(iterator); + if (next) { + var nextValue = this.IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } +}); + +delete ES2017.EnumerableOwnNames; // replaced with EnumerableOwnProperties +delete ES2017.IterableToArrayLike; // replaced with IterableToList + +module.exports = ES2017; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/es2018.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/es2018.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var keys = __webpack_require__(/*! object-keys */ "../../node_modules/object-keys/index.js"); +var inspect = __webpack_require__(/*! object-inspect */ "../../node_modules/object-inspect/index.js"); + +var ES2017 = __webpack_require__(/*! ./es2017 */ "../../node_modules/es-abstract/es2017.js"); +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/es-abstract/helpers/assign.js"); +var forEach = __webpack_require__(/*! ./helpers/forEach */ "../../node_modules/es-abstract/helpers/forEach.js"); +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/es-abstract/helpers/callBind.js"); +var every = __webpack_require__(/*! ./helpers/every */ "../../node_modules/es-abstract/helpers/every.js"); +var isPrefixOf = __webpack_require__(/*! ./helpers/isPrefixOf */ "../../node_modules/es-abstract/helpers/isPrefixOf.js"); + +var $String = GetIntrinsic('%String%'); +var $TypeError = GetIntrinsic('%TypeError%'); + +var callBound = __webpack_require__(/*! ./helpers/callBound */ "../../node_modules/es-abstract/helpers/callBound.js"); +var regexTester = __webpack_require__(/*! ./helpers/regexTester */ "../../node_modules/es-abstract/helpers/regexTester.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/es-abstract/helpers/isNaN.js"); + +var $SymbolValueOf = callBound('Symbol.prototype.valueOf', true); +// var $charAt = callBound('String.prototype.charAt'); +var $strSlice = callBound('String.prototype.slice'); +var $indexOf = callBound('String.prototype.indexOf'); +var $parseInt = parseInt; + +var isDigit = regexTester(/^[0-9]$/); + +var $PromiseResolve = callBound('Promise.resolve', true); + +var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); +var $pushApply = callBind.apply(GetIntrinsic('%Array.prototype.push%')); +var $gOPS = $SymbolValueOf ? GetIntrinsic('%Object.getOwnPropertySymbols%') : null; + +var padTimeComponent = function padTimeComponent(c, count) { + return $strSlice('00' + c, -(count || 2)); +}; + +var weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + +var OwnPropertyKeys = function OwnPropertyKeys(ES, source) { + var ownKeys = keys(source); + if ($gOPS) { + $pushApply(ownKeys, $gOPS(source)); + } + return ownKeys; +}; + +var ES2018 = assign(assign({}, ES2017), { + EnumerableOwnPropertyNames: ES2017.EnumerableOwnProperties, + + // https://ecma-international.org/ecma-262/9.0/#sec-thissymbolvalue + thisSymbolValue: function thisSymbolValue(value) { + if (!$SymbolValueOf) { + throw new SyntaxError('Symbols are not supported; thisSymbolValue requires that `value` be a Symbol or a Symbol object'); + } + if (this.Type(value) === 'Symbol') { + return value; + } + return $SymbolValueOf(value); + }, + + // https://www.ecma-international.org/ecma-262/9.0/#sec-isstringprefix + IsStringPrefix: function IsStringPrefix(p, q) { + if (this.Type(p) !== 'String') { + throw new TypeError('Assertion failed: "p" must be a String'); + } + + if (this.Type(q) !== 'String') { + throw new TypeError('Assertion failed: "q" must be a String'); + } + + return isPrefixOf(p, q); + /* + if (p === q || p === '') { + return true; + } + + var pLength = p.length; + var qLength = q.length; + if (pLength >= qLength) { + return false; + } + + // assert: pLength < qLength + + for (var i = 0; i < pLength; i += 1) { + if ($charAt(p, i) !== $charAt(q, i)) { + return false; + } + } + return true; + */ + }, + + // https://www.ecma-international.org/ecma-262/9.0/#sec-tostring-applied-to-the-number-type + NumberToString: function NumberToString(m) { + if (this.Type(m) !== 'Number') { + throw new TypeError('Assertion failed: "m" must be a String'); + } + + return $String(m); + }, + + // https://www.ecma-international.org/ecma-262/9.0/#sec-copydataproperties + CopyDataProperties: function CopyDataProperties(target, source, excludedItems) { + if (this.Type(target) !== 'Object') { + throw new TypeError('Assertion failed: "target" must be an Object'); + } + + if (!this.IsArray(excludedItems)) { + throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + for (var i = 0; i < excludedItems.length; i += 1) { + if (!this.IsPropertyKey(excludedItems[i])) { + throw new TypeError('Assertion failed: "excludedItems" must be a List of Property Keys'); + } + } + + if (typeof source === 'undefined' || source === null) { + return target; + } + + var ES = this; + + var fromObj = ES.ToObject(source); + + var sourceKeys = OwnPropertyKeys(ES, fromObj); + forEach(sourceKeys, function (nextKey) { + var excluded = false; + + forEach(excludedItems, function (e) { + if (ES.SameValue(e, nextKey) === true) { + excluded = true; + } + }); + + var enumerable = $isEnumerable(fromObj, nextKey) || ( + // this is to handle string keys being non-enumerable in older engines + typeof source === 'string' + && nextKey >= 0 + && ES.IsInteger(ES.ToNumber(nextKey)) + ); + if (excluded === false && enumerable) { + var propValue = ES.Get(fromObj, nextKey); + ES.CreateDataProperty(target, nextKey, propValue); + } + }); + + return target; + }, + + // https://ecma-international.org/ecma-262/9.0/#sec-promise-resolve + PromiseResolve: function PromiseResolve(C, x) { + if (!$PromiseResolve) { + throw new SyntaxError('This environment does not support Promises.'); + } + return $PromiseResolve(C, x); + }, + + // http://www.ecma-international.org/ecma-262/9.0/#sec-getsubstitution + // eslint-disable-next-line max-statements, max-params, max-lines-per-function + GetSubstitution: function GetSubstitution(matched, str, position, captures, namedCaptures, replacement) { + if (this.Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (this.Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!this.IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + var ES = this; + var isStringOrHole = function (capture, index, arr) { return ES.Type(capture) === 'String' || !(index in arr); }; + if (!this.IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (this.Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + if (this.Type(namedCaptures) !== 'Undefined') { + namedCaptures = this.ToObject(namedCaptures); // eslint-disable-line no-param-reassign + } + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = replacement[i]; + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = replacement[i + 1]; + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : $strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : $strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : replacement[i + 2]; + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = $parseInt(next, 10); + // if (n > m, impl-defined) + result += (n <= m && this.Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = $parseInt(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && this.Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else if (next === '<') { + // eslint-disable-next-line max-depth + if (this.Type(namedCaptures) === 'Undefined') { + result += '$<'; + i += 2; + } else { + var endIndex = $indexOf(replacement, '>', i); + // eslint-disable-next-line max-depth + if (endIndex > -1) { + var groupName = $strSlice(replacement, i, endIndex); + var capture = this.Get(namedCaptures, groupName); + // eslint-disable-next-line max-depth + if (this.Type(capture) !== 'Undefined') { + result += this.ToString(capture); + } + i += '$<' + groupName + '>'.length; + } + } + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += replacement[i]; + } + } + return result; + }, + + // https://www.ecma-international.org/ecma-262/9.0/#sec-datestring + DateString: function DateString(tv) { + if (this.Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var weekday = weekdays[this.WeekDay(tv)]; + var month = months[this.MonthFromTime(tv)]; + var day = padTimeComponent(this.DateFromTime(tv)); + var year = padTimeComponent(this.YearFromTime(tv), 4); + return weekday + '\x20' + month + '\x20' + day + '\x20' + year; + }, + + // https://www.ecma-international.org/ecma-262/9.0/#sec-timestring + TimeString: function TimeString(tv) { + if (this.Type(tv) !== 'Number' || $isNaN(tv)) { + throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number'); + } + var hour = this.HourFromTime(tv); + var minute = this.MinFromTime(tv); + var second = this.SecFromTime(tv); + return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT'; + } +}); + +delete ES2018.EnumerableOwnProperties; // replaced with EnumerableOwnPropertyNames + +delete ES2018.IsPropertyDescriptor; // not an actual abstract operation + +module.exports = ES2018; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/es2019.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/es2019.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var trimStart = __webpack_require__(/*! string.prototype.trimleft */ "../../node_modules/string.prototype.trimleft/index.js"); +var trimEnd = __webpack_require__(/*! string.prototype.trimright */ "../../node_modules/string.prototype.trimright/index.js"); +var inspect = __webpack_require__(/*! object-inspect */ "../../node_modules/object-inspect/index.js"); + +var ES2018 = __webpack_require__(/*! ./es2018 */ "../../node_modules/es-abstract/es2018.js"); +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/es-abstract/helpers/assign.js"); +var MAX_SAFE_INTEGER = __webpack_require__(/*! ./helpers/maxSafeInteger */ "../../node_modules/es-abstract/helpers/maxSafeInteger.js"); + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); + +var ES2019 = assign(assign({}, ES2018), { + // https://tc39.es/ecma262/#sec-add-entries-from-iterable + AddEntriesFromIterable: function AddEntriesFromIterable(target, iterable, adder) { + if (!this.IsCallable(adder)) { + throw new $TypeError('Assertion failed: `adder` is not callable'); + } + if (iterable == null) { + throw new $TypeError('Assertion failed: `iterable` is present, and not nullish'); + } + var iteratorRecord = this.GetIterator(iterable); + while (true) { // eslint-disable-line no-constant-condition + var next = this.IteratorStep(iteratorRecord); + if (!next) { + return target; + } + var nextItem = this.IteratorValue(next); + if (this.Type(nextItem) !== 'Object') { + var error = new $TypeError('iterator next must return an Object, got ' + inspect(nextItem)); + return this.IteratorClose( + iteratorRecord, + function () { throw error; } // eslint-disable-line no-loop-func + ); + } + try { + var k = this.Get(nextItem, '0'); + var v = this.Get(nextItem, '1'); + this.Call(adder, target, [k, v]); + } catch (e) { + return this.IteratorClose( + iteratorRecord, + function () { throw e; } + ); + } + } + }, + + // https://ecma-international.org/ecma-262/10.0/#sec-flattenintoarray + // eslint-disable-next-line max-params, max-statements + FlattenIntoArray: function FlattenIntoArray(target, source, sourceLen, start, depth) { + var mapperFunction; + if (arguments.length > 5) { + mapperFunction = arguments[5]; + } + + var targetIndex = start; + var sourceIndex = 0; + while (sourceIndex < sourceLen) { + var P = this.ToString(sourceIndex); + var exists = this.HasProperty(source, P); + if (exists === true) { + var element = this.Get(source, P); + if (typeof mapperFunction !== 'undefined') { + if (arguments.length <= 6) { + throw new $TypeError('Assertion failed: thisArg is required when mapperFunction is provided'); + } + element = this.Call(mapperFunction, arguments[6], [element, sourceIndex, source]); + } + var shouldFlatten = false; + if (depth > 0) { + shouldFlatten = this.IsArray(element); + } + if (shouldFlatten) { + var elementLen = this.ToLength(this.Get(element, 'length')); + targetIndex = this.FlattenIntoArray(target, element, elementLen, targetIndex, depth - 1); + } else { + if (targetIndex >= MAX_SAFE_INTEGER) { + throw new $TypeError('index too large'); + } + this.CreateDataPropertyOrThrow(target, this.ToString(targetIndex), element); + targetIndex += 1; + } + } + sourceIndex += 1; + } + + return targetIndex; + }, + + // https://ecma-international.org/ecma-262/10.0/#sec-trimstring + TrimString: function TrimString(string, where) { + var str = this.RequireObjectCoercible(string); + var S = this.ToString(str); + var T; + if (where === 'start') { + T = trimStart(S); + } else if (where === 'end') { + T = trimEnd(S); + } else if (where === 'start+end') { + T = trimStart(trimEnd(S)); + } else { + throw new $TypeError('Assertion failed: invalid `where` value; must be "start", "end", or "start+end"'); + } + return T; + } +}); + +module.exports = ES2019; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/es5.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/es5.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var $Object = GetIntrinsic('%Object%'); +var $EvalError = GetIntrinsic('%EvalError%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $String = GetIntrinsic('%String%'); +var $Date = GetIntrinsic('%Date%'); +var $Number = GetIntrinsic('%Number%'); +var $floor = GetIntrinsic('%Math.floor%'); +var $DateUTC = GetIntrinsic('%Date.UTC%'); +var $abs = GetIntrinsic('%Math.abs%'); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/es-abstract/helpers/assertRecord.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/es-abstract/helpers/isFinite.js"); +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/es-abstract/helpers/mod.js"); +var isPrefixOf = __webpack_require__(/*! ./helpers/isPrefixOf */ "../../node_modules/es-abstract/helpers/isPrefixOf.js"); +var callBound = __webpack_require__(/*! ./helpers/callBound */ "../../node_modules/es-abstract/helpers/callBound.js"); + +var IsCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es5 */ "../../node_modules/es-to-primitive/es5.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var $getUTCFullYear = callBound('Date.prototype.getUTCFullYear'); + +var HoursPerDay = 24; +var MinutesPerHour = 60; +var SecondsPerMinute = 60; +var msPerSecond = 1e3; +var msPerMinute = msPerSecond * SecondsPerMinute; +var msPerHour = msPerMinute * MinutesPerHour; +var msPerDay = 86400000; + +// https://es5.github.io/#x9 +var ES5 = { + ToPrimitive: toPrimitive, + + ToBoolean: function ToBoolean(value) { + return !!value; + }, + ToNumber: function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion + }, + ToInteger: function ToInteger(value) { + var number = this.ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return sign(number) * Math.floor(Math.abs(number)); + }, + ToInt32: function ToInt32(x) { + return this.ToNumber(x) >> 0; + }, + ToUint32: function ToUint32(x) { + return this.ToNumber(x) >>> 0; + }, + ToUint16: function ToUint16(value) { + var number = this.ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * Math.floor(Math.abs(number)); + return mod(posInt, 0x10000); + }, + ToString: function ToString(value) { + return $String(value); + }, + ToObject: function ToObject(value) { + this.CheckObjectCoercible(value); + return $Object(value); + }, + CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { + /* jshint eqnull:true */ + if (value == null) { + throw new $TypeError(optMessage || 'Cannot call method on ' + value); + } + return value; + }, + IsCallable: IsCallable, + SameValue: function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8 + Type: function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + IsPropertyDescriptor: function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor(this, Desc); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + IsAccessorDescriptor: function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + IsDataDescriptor: function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + IsGenericDescriptor: function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) { + return true; + } + + return false; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (this.IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + ToPropertyDescriptor: function ToPropertyDescriptor(Obj) { + if (this.Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = this.ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !this.IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !this.IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-11.9.3 + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-11.9.6 + 'Strict Equality Comparison': function StrictEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-11.8.5 + // eslint-disable-next-line max-statements + 'Abstract Relational Comparison': function AbstractRelationalComparison(x, y, LeftFirst) { + if (this.Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = this.ToPrimitive(x, $Number); + py = this.ToPrimitive(y, $Number); + } else { + py = this.ToPrimitive(y, $Number); + px = this.ToPrimitive(x, $Number); + } + var bothStrings = this.Type(px) === 'String' && this.Type(py) === 'String'; + if (!bothStrings) { + var nx = this.ToNumber(px); + var ny = this.ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + msFromTime: function msFromTime(t) { + return mod(t, msPerSecond); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + SecFromTime: function SecFromTime(t) { + return mod($floor(t / msPerSecond), SecondsPerMinute); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + MinFromTime: function MinFromTime(t) { + return mod($floor(t / msPerMinute), MinutesPerHour); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.10 + HourFromTime: function HourFromTime(t) { + return mod($floor(t / msPerHour), HoursPerDay); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + Day: function Day(t) { + return $floor(t / msPerDay); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.2 + TimeWithinDay: function TimeWithinDay(t) { + return mod(t, msPerDay); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + DayFromYear: function DayFromYear(y) { + return (365 * (y - 1970)) + $floor((y - 1969) / 4) - $floor((y - 1901) / 100) + $floor((y - 1601) / 400); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + TimeFromYear: function TimeFromYear(y) { + return msPerDay * this.DayFromYear(y); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + YearFromTime: function YearFromTime(t) { + // largest y such that this.TimeFromYear(y) <= t + return $getUTCFullYear(new $Date(t)); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.6 + WeekDay: function WeekDay(t) { + return mod(this.Day(t) + 4, 7); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + DaysInYear: function DaysInYear(y) { + if (mod(y, 4) !== 0) { + return 365; + } + if (mod(y, 100) !== 0) { + return 366; + } + if (mod(y, 400) !== 0) { + return 365; + } + return 366; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.3 + InLeapYear: function InLeapYear(t) { + var days = this.DaysInYear(this.YearFromTime(t)); + if (days === 365) { + return 0; + } + if (days === 366) { + return 1; + } + throw new $EvalError('Assertion failed: there are not 365 or 366 days in a year, got: ' + days); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + DayWithinYear: function DayWithinYear(t) { + return this.Day(t) - this.DayFromYear(this.YearFromTime(t)); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.4 + MonthFromTime: function MonthFromTime(t) { + var day = this.DayWithinYear(t); + if (0 <= day && day < 31) { + return 0; + } + var leap = this.InLeapYear(t); + if (31 <= day && day < (59 + leap)) { + return 1; + } + if ((59 + leap) <= day && day < (90 + leap)) { + return 2; + } + if ((90 + leap) <= day && day < (120 + leap)) { + return 3; + } + if ((120 + leap) <= day && day < (151 + leap)) { + return 4; + } + if ((151 + leap) <= day && day < (181 + leap)) { + return 5; + } + if ((181 + leap) <= day && day < (212 + leap)) { + return 6; + } + if ((212 + leap) <= day && day < (243 + leap)) { + return 7; + } + if ((243 + leap) <= day && day < (273 + leap)) { + return 8; + } + if ((273 + leap) <= day && day < (304 + leap)) { + return 9; + } + if ((304 + leap) <= day && day < (334 + leap)) { + return 10; + } + if ((334 + leap) <= day && day < (365 + leap)) { + return 11; + } + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.5 + DateFromTime: function DateFromTime(t) { + var m = this.MonthFromTime(t); + var d = this.DayWithinYear(t); + if (m === 0) { + return d + 1; + } + if (m === 1) { + return d - 30; + } + var leap = this.InLeapYear(t); + if (m === 2) { + return d - 58 - leap; + } + if (m === 3) { + return d - 89 - leap; + } + if (m === 4) { + return d - 119 - leap; + } + if (m === 5) { + return d - 150 - leap; + } + if (m === 6) { + return d - 180 - leap; + } + if (m === 7) { + return d - 211 - leap; + } + if (m === 8) { + return d - 242 - leap; + } + if (m === 9) { + return d - 272 - leap; + } + if (m === 10) { + return d - 303 - leap; + } + if (m === 11) { + return d - 333 - leap; + } + throw new $EvalError('Assertion failed: MonthFromTime returned an impossible value: ' + m); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.12 + MakeDay: function MakeDay(year, month, date) { + if (!$isFinite(year) || !$isFinite(month) || !$isFinite(date)) { + return NaN; + } + var y = this.ToInteger(year); + var m = this.ToInteger(month); + var dt = this.ToInteger(date); + var ym = y + $floor(m / 12); + var mn = mod(m, 12); + var t = $DateUTC(ym, mn, 1); + if (this.YearFromTime(t) !== ym || this.MonthFromTime(t) !== mn || this.DateFromTime(t) !== 1) { + return NaN; + } + return this.Day(t) + dt - 1; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.13 + MakeDate: function MakeDate(day, time) { + if (!$isFinite(day) || !$isFinite(time)) { + return NaN; + } + return (day * msPerDay) + time; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.11 + MakeTime: function MakeTime(hour, min, sec, ms) { + if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) { + return NaN; + } + var h = this.ToInteger(hour); + var m = this.ToInteger(min); + var s = this.ToInteger(sec); + var milli = this.ToInteger(ms); + var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli; + return t; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.14 + TimeClip: function TimeClip(time) { + if (!$isFinite(time) || $abs(time) > 8.64e15) { + return NaN; + } + return $Number(new $Date(this.ToNumber(time))); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-5.2 + modulo: function modulo(x, y) { + return mod(x, y); + } +}; + +module.exports = ES5; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/es7.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/es7.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2016 */ "../../node_modules/es-abstract/es2016.js"); + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/assertRecord.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/assertRecord.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(ES, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(ES, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/assign.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/assign.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + // eslint-disable-next-line no-param-reassign + target[key] = source[key]; + } + } + return target; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/callBind.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/callBind.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var $Function = GetIntrinsic('%Function%'); +var $apply = $Function.apply; +var $call = $Function.call; + +module.exports = function callBind() { + return bind.apply($call, arguments); +}; + +module.exports.apply = function applyBind() { + return bind.apply($apply, arguments); +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/callBound.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/callBound.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var callBind = __webpack_require__(/*! ./callBind */ "../../node_modules/es-abstract/helpers/callBind.js"); + +var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); + +module.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { + return callBind(intrinsic); + } + return intrinsic; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/every.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/every.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/forEach.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/forEach.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/getInferredName.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/getInferredName.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getInferredName; +try { + // eslint-disable-next-line no-new-func + getInferredName = Function('s', 'return { [s]() {} }[s].name;'); +} catch (e) {} + +var inferred = function () {}; +module.exports = getInferredName && inferred.name === 'inferred' ? getInferredName : null; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/getIteratorMethod.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/getIteratorMethod.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/es-abstract/node_modules/has-symbols/index.js")(); +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); +var callBound = __webpack_require__(/*! ./callBound */ "../../node_modules/es-abstract/helpers/callBound.js"); + +var $iterator = GetIntrinsic('%Symbol.iterator%', true); +var $stringSlice = callBound('String.prototype.slice'); + +module.exports = function getIteratorMethod(ES, iterable) { + var usingIterator; + if (hasSymbols) { + usingIterator = ES.GetMethod(iterable, $iterator); + } else if (ES.IsArray(iterable)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (ES.Type(iterable) === 'String') { + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(iterable, i, true); + var value = $stringSlice(iterable, i, nextIndex); + i = nextIndex; + return { + done: nextIndex > iterable.length, + value: value + }; + } + }; + }; + } + return usingIterator; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/getProto.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/getProto.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var originalGetProto = GetIntrinsic('%Object.getPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalGetProto || ( + // eslint-disable-next-line no-proto + [].__proto__ === $ArrayProto + ? function (O) { + return O.__proto__; // eslint-disable-line no-proto + } + : null +); + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/getSymbolDescription.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/getSymbolDescription.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var callBound = __webpack_require__(/*! ./callBound */ "../../node_modules/es-abstract/helpers/callBound.js"); + +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var symToStr = callBound('Symbol.prototype.toString', true); + +var getInferredName = __webpack_require__(/*! ./getInferredName */ "../../node_modules/es-abstract/helpers/getInferredName.js"); + +module.exports = function getSymbolDescription(symbol) { + if (!symToStr) { + throw new $SyntaxError('Symbols are not supported in this environment'); + } + var str = symToStr(symbol); // will throw if not a symbol + + if (getInferredName) { + var name = getInferredName(symbol); + if (name === '') { return; } + // eslint-disable-next-line consistent-return + return name.slice(1, -1); // name.slice('['.length, -']'.length); + } + + var desc = str.slice(7, -1); // str.slice('Symbol('.length, -')'.length); + if (desc) { + // eslint-disable-next-line consistent-return + return desc; + } +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/isFinite.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/isFinite.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/isNaN.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/isNaN.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/isPrefixOf.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/isPrefixOf.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var $strSlice = __webpack_require__(/*! ../helpers/callBound */ "../../node_modules/es-abstract/helpers/callBound.js")('String.prototype.slice'); + +module.exports = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return $strSlice(string, 0, prefix.length) === prefix; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/isPrimitive.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/isPrimitive.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/isPropertyDescriptor.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/isPropertyDescriptor.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/isSamePropertyDescriptor.js": +/*!****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js ***! + \****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var every = __webpack_require__(/*! ./every */ "../../node_modules/es-abstract/helpers/every.js"); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/maxSafeInteger.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/maxSafeInteger.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var $Math = GetIntrinsic('%Math%'); +var $Number = GetIntrinsic('%Number%'); + +module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/mod.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/mod.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return Math.floor(remain >= 0 ? remain : remain + modulo); +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/regexTester.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/regexTester.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var $test = GetIntrinsic('RegExp.prototype.test'); + +var callBind = __webpack_require__(/*! ./callBind */ "../../node_modules/es-abstract/helpers/callBind.js"); + +module.exports = function regexTester(regex) { + return callBind($test, regex); +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/setProto.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/setProto.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); + +var originalSetProto = GetIntrinsic('%Object.setPrototypeOf%', true); +var $ArrayProto = GetIntrinsic('%Array.prototype%'); + +module.exports = originalSetProto || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== $ArrayProto + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto, no-param-reassign + return O; + } +); + + +/***/ }), + +/***/ "../../node_modules/es-abstract/helpers/sign.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/helpers/sign.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; + + +/***/ }), + +/***/ "../../node_modules/es-abstract/node_modules/has-symbols/index.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/node_modules/has-symbols/index.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var origSymbol = global.Symbol; +var hasSymbolSham = __webpack_require__(/*! ./shams */ "../../node_modules/es-abstract/node_modules/has-symbols/shams.js"); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/es-abstract/node_modules/has-symbols/shams.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-abstract/node_modules/has-symbols/shams.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/es-to-primitive/es2015.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-to-primitive/es2015.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/es-to-primitive/helpers/isPrimitive.js"); +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var isDate = __webpack_require__(/*! is-date-object */ "../../node_modules/is-date-object/index.js"); +var isSymbol = __webpack_require__(/*! is-symbol */ "../../node_modules/is-symbol/index.js"); + +var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { + if (typeof O === 'undefined' || O === null) { + throw new TypeError('Cannot call method on ' + O); + } + if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { + throw new TypeError('hint must be "string" or "number"'); + } + var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var method, result, i; + for (i = 0; i < methodNames.length; ++i) { + method = O[methodNames[i]]; + if (isCallable(method)) { + result = method.call(O); + if (isPrimitive(result)) { + return result; + } + } + } + throw new TypeError('No default value'); +}; + +var GetMethod = function GetMethod(O, P) { + var func = O[P]; + if (func !== null && typeof func !== 'undefined') { + if (!isCallable(func)) { + throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); + } + return func; + } + return void 0; +}; + +// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + var hint = 'default'; + if (arguments.length > 1) { + if (arguments[1] === String) { + hint = 'string'; + } else if (arguments[1] === Number) { + hint = 'number'; + } + } + + var exoticToPrim; + if (hasSymbols) { + if (Symbol.toPrimitive) { + exoticToPrim = GetMethod(input, Symbol.toPrimitive); + } else if (isSymbol(input)) { + exoticToPrim = Symbol.prototype.valueOf; + } + } + if (typeof exoticToPrim !== 'undefined') { + var result = exoticToPrim.call(input, hint); + if (isPrimitive(result)) { + return result; + } + throw new TypeError('unable to convert exotic object to primitive'); + } + if (hint === 'default' && (isDate(input) || isSymbol(input))) { + hint = 'string'; + } + return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); +}; + + +/***/ }), + +/***/ "../../node_modules/es-to-primitive/es5.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-to-primitive/es5.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/es-to-primitive/helpers/isPrimitive.js"); + +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); + +// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 +var ES5internalSlots = { + '[[DefaultValue]]': function (O) { + var actualHint; + if (arguments.length > 1) { + actualHint = arguments[1]; + } else { + actualHint = toStr.call(O) === '[object Date]' ? String : Number; + } + + if (actualHint === String || actualHint === Number) { + var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var value, i; + for (i = 0; i < methods.length; ++i) { + if (isCallable(O[methods[i]])) { + value = O[methods[i]](); + if (isPrimitive(value)) { + return value; + } + } + } + throw new TypeError('No default value'); + } + throw new TypeError('invalid [[DefaultValue]] hint supplied'); + } +}; + +// http://ecma-international.org/ecma-262/5.1/#sec-9.1 +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + if (arguments.length > 1) { + return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]); + } + return ES5internalSlots['[[DefaultValue]]'](input); +}; + + +/***/ }), + +/***/ "../../node_modules/es-to-primitive/es6.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-to-primitive/es6.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2015 */ "../../node_modules/es-to-primitive/es2015.js"); + + +/***/ }), + +/***/ "../../node_modules/es-to-primitive/helpers/isPrimitive.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es-to-primitive/helpers/isPrimitive.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/es5-shim/es5-sham.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es5-shim/es5-sham.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * https://github.com/es-shims/es5-shim + * @license es5-shim Copyright 2009-2015 by contributors, MIT License + * see https://github.com/es-shims/es5-shim/blob/master/LICENSE + */ + +// vim: ts=4 sts=4 sw=4 expandtab + +// Add semicolon to prevent IIFE from being passed as argument to concatenated code. +; + +// UMD (Universal Module Definition) +// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js +(function (root, factory) { + 'use strict'; + + /* global define, exports, module */ + if (true) { + // AMD. Register as an anonymous module. + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(this, function () { + + var call = Function.call; + var prototypeOfObject = Object.prototype; + var owns = call.bind(prototypeOfObject.hasOwnProperty); + var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable); + var toStr = call.bind(prototypeOfObject.toString); + + // If JS engine supports accessors creating shortcuts. + var defineGetter; + var defineSetter; + var lookupGetter; + var lookupSetter; + var supportsAccessors = owns(prototypeOfObject, '__defineGetter__'); + if (supportsAccessors) { + /* eslint-disable no-underscore-dangle, no-restricted-properties */ + defineGetter = call.bind(prototypeOfObject.__defineGetter__); + defineSetter = call.bind(prototypeOfObject.__defineSetter__); + lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); + lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); + /* eslint-enable no-underscore-dangle, no-restricted-properties */ + } + + var isPrimitive = function isPrimitive(o) { + return o == null || (typeof o !== 'object' && typeof o !== 'function'); + }; + + // ES5 15.2.3.2 + // http://es5.github.com/#x15.2.3.2 + if (!Object.getPrototypeOf) { + // https://github.com/es-shims/es5-shim/issues#issue/2 + // http://ejohn.org/blog/objectgetprototypeof/ + // recommended by fschaefer on github + // + // sure, and webreflection says ^_^ + // ... this will nerever possibly return null + // ... Opera Mini breaks here with infinite loops + Object.getPrototypeOf = function getPrototypeOf(object) { + // eslint-disable-next-line no-proto + var proto = object.__proto__; + if (proto || proto === null) { + return proto; + } else if (toStr(object.constructor) === '[object Function]') { + return object.constructor.prototype; + } else if (object instanceof Object) { + return prototypeOfObject; + } else { + // Correctly return null for Objects created with `Object.create(null)` + // (shammed or native) or `{ __proto__: null}`. Also returns null for + // cross-realm objects on browsers that lack `__proto__` support (like + // IE <11), but that's the best we can do. + return null; + } + }; + } + + // ES5 15.2.3.3 + // http://es5.github.com/#x15.2.3.3 + + var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) { + try { + object.sentinel = 0; + return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0; + } catch (exception) { + return false; + } + }; + + // check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially. + if (Object.defineProperty) { + var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({}); + var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' + || doesGetOwnPropertyDescriptorWork(document.createElement('div')); + if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) { + var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor; + } + } + + if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) { + var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: '; + + /* eslint-disable no-proto */ + Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { + if (isPrimitive(object)) { + throw new TypeError(ERR_NON_OBJECT + object); + } + + // make a valiant attempt to use the real getOwnPropertyDescriptor + // for I8's DOM elements. + if (getOwnPropertyDescriptorFallback) { + try { + return getOwnPropertyDescriptorFallback.call(Object, object, property); + } catch (exception) { + // try the shim if the real one doesn't work + } + } + + var descriptor; + + // If object does not owns property return undefined immediately. + if (!owns(object, property)) { + return descriptor; + } + + // If object has a property then it's for sure `configurable`, and + // probably `enumerable`. Detect enumerability though. + descriptor = { + enumerable: isEnumerable(object, property), + configurable: true + }; + + // If JS engine supports accessor properties then property may be a + // getter or setter. + if (supportsAccessors) { + // Unfortunately `__lookupGetter__` will return a getter even + // if object has own non getter property along with a same named + // inherited getter. To avoid misbehavior we temporary remove + // `__proto__` so that `__lookupGetter__` will return getter only + // if it's owned by an object. + var prototype = object.__proto__; + var notPrototypeOfObject = object !== prototypeOfObject; + // avoid recursion problem, breaking in Opera Mini when + // Object.getOwnPropertyDescriptor(Object.prototype, 'toString') + // or any other Object.prototype accessor + if (notPrototypeOfObject) { + object.__proto__ = prototypeOfObject; + } + + var getter = lookupGetter(object, property); + var setter = lookupSetter(object, property); + + if (notPrototypeOfObject) { + // Once we have getter and setter we can put values back. + object.__proto__ = prototype; + } + + if (getter || setter) { + if (getter) { + descriptor.get = getter; + } + if (setter) { + descriptor.set = setter; + } + // If it was accessor property we're done and return here + // in order to avoid adding `value` to the descriptor. + return descriptor; + } + } + + // If we got this far we know that object has an own property that is + // not an accessor so we set it as a value and return descriptor. + descriptor.value = object[property]; + descriptor.writable = true; + return descriptor; + }; + /* eslint-enable no-proto */ + } + + // ES5 15.2.3.4 + // http://es5.github.com/#x15.2.3.4 + if (!Object.getOwnPropertyNames) { + Object.getOwnPropertyNames = function getOwnPropertyNames(object) { + return Object.keys(object); + }; + } + + // ES5 15.2.3.5 + // http://es5.github.com/#x15.2.3.5 + if (!Object.create) { + + // Contributed by Brandon Benvie, October, 2012 + var createEmpty; + var supportsProto = !({ __proto__: null } instanceof Object); + // the following produces false positives + // in Opera Mini => not a reliable check + // Object.prototype.__proto__ === null + + // Check for document.domain and active x support + // No need to use active x approach when document.domain is not set + // see https://github.com/es-shims/es5-shim/issues/150 + // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 + /* global ActiveXObject */ + var shouldUseActiveX = function shouldUseActiveX() { + // return early if document.domain not set + if (!document.domain) { + return false; + } + + try { + return !!new ActiveXObject('htmlfile'); + } catch (exception) { + return false; + } + }; + + // This supports IE8 when document.domain is used + // see https://github.com/es-shims/es5-shim/issues/150 + // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 + var getEmptyViaActiveX = function getEmptyViaActiveX() { + var empty; + var xDoc; + + xDoc = new ActiveXObject('htmlfile'); + + var script = 'script'; + xDoc.write('<' + script + '></' + script + '>'); + xDoc.close(); + + empty = xDoc.parentWindow.Object.prototype; + xDoc = null; + + return empty; + }; + + // The original implementation using an iframe + // before the activex approach was added + // see https://github.com/es-shims/es5-shim/issues/150 + var getEmptyViaIFrame = function getEmptyViaIFrame() { + var iframe = document.createElement('iframe'); + var parent = document.body || document.documentElement; + var empty; + + iframe.style.display = 'none'; + parent.appendChild(iframe); + // eslint-disable-next-line no-script-url + iframe.src = 'javascript:'; + + empty = iframe.contentWindow.Object.prototype; + parent.removeChild(iframe); + iframe = null; + + return empty; + }; + + /* global document */ + if (supportsProto || typeof document === 'undefined') { + createEmpty = function () { + return { __proto__: null }; + }; + } else { + // In old IE __proto__ can't be used to manually set `null`, nor does + // any other method exist to make an object that inherits from nothing, + // aside from Object.prototype itself. Instead, create a new global + // object and *steal* its Object.prototype and strip it bare. This is + // used as the prototype to create nullary objects. + createEmpty = function () { + // Determine which approach to use + // see https://github.com/es-shims/es5-shim/issues/150 + var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame(); + + delete empty.constructor; + delete empty.hasOwnProperty; + delete empty.propertyIsEnumerable; + delete empty.isPrototypeOf; + delete empty.toLocaleString; + delete empty.toString; + delete empty.valueOf; + + var Empty = function Empty() {}; + Empty.prototype = empty; + // short-circuit future calls + createEmpty = function () { + return new Empty(); + }; + return new Empty(); + }; + } + + Object.create = function create(prototype, properties) { + + var object; + var Type = function Type() {}; // An empty constructor. + + if (prototype === null) { + object = createEmpty(); + } else { + if (prototype !== null && isPrimitive(prototype)) { + // In the native implementation `parent` can be `null` + // OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc) + // Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object` + // like they are in modern browsers. Using `Object.create` on DOM elements + // is...err...probably inappropriate, but the native version allows for it. + throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome + } + Type.prototype = prototype; + object = new Type(); + // IE has no built-in implementation of `Object.getPrototypeOf` + // neither `__proto__`, but this manually setting `__proto__` will + // guarantee that `Object.getPrototypeOf` will work as expected with + // objects created using `Object.create` + // eslint-disable-next-line no-proto + object.__proto__ = prototype; + } + + if (properties !== void 0) { + Object.defineProperties(object, properties); + } + + return object; + }; + } + + // ES5 15.2.3.6 + // http://es5.github.com/#x15.2.3.6 + + // Patch for WebKit and IE8 standard mode + // Designed by hax <hax.github.com> + // related issue: https://github.com/es-shims/es5-shim/issues#issue/5 + // IE8 Reference: + // http://msdn.microsoft.com/en-us/library/dd282900.aspx + // http://msdn.microsoft.com/en-us/library/dd229916.aspx + // WebKit Bugs: + // https://bugs.webkit.org/show_bug.cgi?id=36423 + + var doesDefinePropertyWork = function doesDefinePropertyWork(object) { + try { + Object.defineProperty(object, 'sentinel', {}); + return 'sentinel' in object; + } catch (exception) { + return false; + } + }; + + // check whether defineProperty works if it's given. Otherwise, + // shim partially. + if (Object.defineProperty) { + var definePropertyWorksOnObject = doesDefinePropertyWork({}); + var definePropertyWorksOnDom = typeof document === 'undefined' + || doesDefinePropertyWork(document.createElement('div')); + if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { + var definePropertyFallback = Object.defineProperty, + definePropertiesFallback = Object.defineProperties; + } + } + + if (!Object.defineProperty || definePropertyFallback) { + var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: '; + var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: '; + var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine'; + + Object.defineProperty = function defineProperty(object, property, descriptor) { + if (isPrimitive(object)) { + throw new TypeError(ERR_NON_OBJECT_TARGET + object); + } + if (isPrimitive(descriptor)) { + throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); + } + // make a valiant attempt to use the real defineProperty + // for I8's DOM elements. + if (definePropertyFallback) { + try { + return definePropertyFallback.call(Object, object, property, descriptor); + } catch (exception) { + // try the shim if the real one doesn't work + } + } + + // If it's a data property. + if ('value' in descriptor) { + // fail silently if 'writable', 'enumerable', or 'configurable' + // are requested but not supported + /* + // alternate approach: + if ( // can't implement these features; allow false but not true + ('writable' in descriptor && !descriptor.writable) || + ('enumerable' in descriptor && !descriptor.enumerable) || + ('configurable' in descriptor && !descriptor.configurable) + )) + throw new RangeError( + 'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.' + ); + */ + + if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) { + // As accessors are supported only on engines implementing + // `__proto__` we can safely override `__proto__` while defining + // a property to make sure that we don't hit an inherited + // accessor. + /* eslint-disable no-proto */ + var prototype = object.__proto__; + object.__proto__ = prototypeOfObject; + // Deleting a property anyway since getter / setter may be + // defined on object itself. + delete object[property]; + object[property] = descriptor.value; + // Setting original `__proto__` back now. + object.__proto__ = prototype; + /* eslint-enable no-proto */ + } else { + object[property] = descriptor.value; + } + } else { + var hasGetter = 'get' in descriptor; + var hasSetter = 'set' in descriptor; + if (!supportsAccessors && (hasGetter || hasSetter)) { + throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); + } + // If we got that far then getters and setters can be defined !! + if (hasGetter) { + defineGetter(object, property, descriptor.get); + } + if (hasSetter) { + defineSetter(object, property, descriptor.set); + } + } + return object; + }; + } + + // ES5 15.2.3.7 + // http://es5.github.com/#x15.2.3.7 + if (!Object.defineProperties || definePropertiesFallback) { + Object.defineProperties = function defineProperties(object, properties) { + // make a valiant attempt to use the real defineProperties + if (definePropertiesFallback) { + try { + return definePropertiesFallback.call(Object, object, properties); + } catch (exception) { + // try the shim if the real one doesn't work + } + } + + Object.keys(properties).forEach(function (property) { + if (property !== '__proto__') { + Object.defineProperty(object, property, properties[property]); + } + }); + return object; + }; + } + + // ES5 15.2.3.8 + // http://es5.github.com/#x15.2.3.8 + if (!Object.seal) { + Object.seal = function seal(object) { + if (Object(object) !== object) { + throw new TypeError('Object.seal can only be called on Objects.'); + } + // this is misleading and breaks feature-detection, but + // allows "securable" code to "gracefully" degrade to working + // but insecure code. + return object; + }; + } + + // ES5 15.2.3.9 + // http://es5.github.com/#x15.2.3.9 + if (!Object.freeze) { + Object.freeze = function freeze(object) { + if (Object(object) !== object) { + throw new TypeError('Object.freeze can only be called on Objects.'); + } + // this is misleading and breaks feature-detection, but + // allows "securable" code to "gracefully" degrade to working + // but insecure code. + return object; + }; + } + + // detect a Rhino bug and patch it + try { + Object.freeze(function () {}); + } catch (exception) { + Object.freeze = (function (freezeObject) { + return function freeze(object) { + if (typeof object === 'function') { + return object; + } else { + return freezeObject(object); + } + }; + }(Object.freeze)); + } + + // ES5 15.2.3.10 + // http://es5.github.com/#x15.2.3.10 + if (!Object.preventExtensions) { + Object.preventExtensions = function preventExtensions(object) { + if (Object(object) !== object) { + throw new TypeError('Object.preventExtensions can only be called on Objects.'); + } + // this is misleading and breaks feature-detection, but + // allows "securable" code to "gracefully" degrade to working + // but insecure code. + return object; + }; + } + + // ES5 15.2.3.11 + // http://es5.github.com/#x15.2.3.11 + if (!Object.isSealed) { + Object.isSealed = function isSealed(object) { + if (Object(object) !== object) { + throw new TypeError('Object.isSealed can only be called on Objects.'); + } + return false; + }; + } + + // ES5 15.2.3.12 + // http://es5.github.com/#x15.2.3.12 + if (!Object.isFrozen) { + Object.isFrozen = function isFrozen(object) { + if (Object(object) !== object) { + throw new TypeError('Object.isFrozen can only be called on Objects.'); + } + return false; + }; + } + + // ES5 15.2.3.13 + // http://es5.github.com/#x15.2.3.13 + if (!Object.isExtensible) { + Object.isExtensible = function isExtensible(object) { + // 1. If Type(O) is not Object throw a TypeError exception. + if (Object(object) !== object) { + throw new TypeError('Object.isExtensible can only be called on Objects.'); + } + // 2. Return the Boolean value of the [[Extensible]] internal property of O. + var name = ''; + while (owns(object, name)) { + name += '?'; + } + object[name] = true; + var returnValue = owns(object, name); + delete object[name]; + return returnValue; + }; + } + +})); + + +/***/ }), + +/***/ "../../node_modules/es5-shim/es5-shim.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es5-shim/es5-shim.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * https://github.com/es-shims/es5-shim + * @license es5-shim Copyright 2009-2015 by contributors, MIT License + * see https://github.com/es-shims/es5-shim/blob/master/LICENSE + */ + +// vim: ts=4 sts=4 sw=4 expandtab + +// Add semicolon to prevent IIFE from being passed as argument to concatenated code. +; + +// UMD (Universal Module Definition) +// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js +(function (root, factory) { + 'use strict'; + + /* global define, exports, module */ + if (true) { + // AMD. Register as an anonymous module. + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(this, function () { + /** + * Brings an environment as close to ECMAScript 5 compliance + * as is possible with the facilities of erstwhile engines. + * + * Annotated ES5: http://es5.github.com/ (specific links below) + * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf + * Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/ + */ + + // Shortcut to an often accessed properties, in order to avoid multiple + // dereference that costs universally. This also holds a reference to known-good + // functions. + var $Array = Array; + var ArrayPrototype = $Array.prototype; + var $Object = Object; + var ObjectPrototype = $Object.prototype; + var $Function = Function; + var FunctionPrototype = $Function.prototype; + var $String = String; + var StringPrototype = $String.prototype; + var $Number = Number; + var NumberPrototype = $Number.prototype; + var array_slice = ArrayPrototype.slice; + var array_splice = ArrayPrototype.splice; + var array_push = ArrayPrototype.push; + var array_unshift = ArrayPrototype.unshift; + var array_concat = ArrayPrototype.concat; + var array_join = ArrayPrototype.join; + var call = FunctionPrototype.call; + var apply = FunctionPrototype.apply; + var max = Math.max; + var min = Math.min; + + // Having a toString local variable name breaks in Opera so use to_string. + var to_string = ObjectPrototype.toString; + + /* global Symbol */ + /* eslint-disable one-var-declaration-per-line, no-redeclare, max-statements-per-line */ + var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; }; + + var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; }; + var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; }; + /* eslint-enable one-var-declaration-per-line, no-redeclare, max-statements-per-line */ + + /* inlined from http://npmjs.com/define-properties */ + var supportsDescriptors = $Object.defineProperty && (function () { + try { + var obj = {}; + $Object.defineProperty(obj, 'x', { enumerable: false, value: obj }); + for (var _ in obj) { // jscs:ignore disallowUnusedVariables + return false; + } + return obj.x === obj; + } catch (e) { /* this is ES3 */ + return false; + } + }()); + var defineProperties = (function (has) { + // Define configurable, writable, and non-enumerable props + // if they don't exist. + var defineProperty; + if (supportsDescriptors) { + defineProperty = function (object, name, method, forceAssign) { + if (!forceAssign && (name in object)) { + return; + } + $Object.defineProperty(object, name, { + configurable: true, + enumerable: false, + writable: true, + value: method + }); + }; + } else { + defineProperty = function (object, name, method, forceAssign) { + if (!forceAssign && (name in object)) { + return; + } + object[name] = method; + }; + } + return function defineProperties(object, map, forceAssign) { + for (var name in map) { + if (has.call(map, name)) { + defineProperty(object, name, map[name], forceAssign); + } + } + }; + }(ObjectPrototype.hasOwnProperty)); + + // + // Util + // ====== + // + + /* replaceable with https://npmjs.com/package/es-abstract /helpers/isPrimitive */ + var isPrimitive = function isPrimitive(input) { + var type = typeof input; + return input === null || (type !== 'object' && type !== 'function'); + }; + + var isActualNaN = $Number.isNaN || function isActualNaN(x) { + return x !== x; + }; + + var ES = { + // ES5 9.4 + // http://es5.github.com/#x9.4 + // http://jsperf.com/to-integer + /* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */ + ToInteger: function ToInteger(num) { + var n = +num; + if (isActualNaN(n)) { + n = 0; + } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + return n; + }, + + /* replaceable with https://npmjs.com/package/es-abstract ES5.ToPrimitive */ + ToPrimitive: function ToPrimitive(input) { + var val, valueOf, toStr; + if (isPrimitive(input)) { + return input; + } + valueOf = input.valueOf; + if (isCallable(valueOf)) { + val = valueOf.call(input); + if (isPrimitive(val)) { + return val; + } + } + toStr = input.toString; + if (isCallable(toStr)) { + val = toStr.call(input); + if (isPrimitive(val)) { + return val; + } + } + throw new TypeError(); + }, + + // ES5 9.9 + // http://es5.github.com/#x9.9 + /* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */ + ToObject: function (o) { + if (o == null) { // this matches both null and undefined + throw new TypeError("can't convert " + o + ' to object'); + } + return $Object(o); + }, + + /* replaceable with https://npmjs.com/package/es-abstract ES5.ToUint32 */ + ToUint32: function ToUint32(x) { + return x >>> 0; + } + }; + + // + // Function + // ======== + // + + // ES-5 15.3.4.5 + // http://es5.github.com/#x15.3.4.5 + + var Empty = function Empty() {}; + + defineProperties(FunctionPrototype, { + bind: function bind(that) { // .length is 1 + // 1. Let Target be the this value. + var target = this; + // 2. If IsCallable(Target) is false, throw a TypeError exception. + if (!isCallable(target)) { + throw new TypeError('Function.prototype.bind called on incompatible ' + target); + } + // 3. Let A be a new (possibly empty) internal list of all of the + // argument values provided after thisArg (arg1, arg2 etc), in order. + // XXX slicedArgs will stand in for "A" if used + var args = array_slice.call(arguments, 1); // for normal call + // 4. Let F be a new native ECMAScript object. + // 11. Set the [[Prototype]] internal property of F to the standard + // built-in Function prototype object as specified in 15.3.3.1. + // 12. Set the [[Call]] internal property of F as described in + // 15.3.4.5.1. + // 13. Set the [[Construct]] internal property of F as described in + // 15.3.4.5.2. + // 14. Set the [[HasInstance]] internal property of F as described in + // 15.3.4.5.3. + var bound; + var binder = function () { + + if (this instanceof bound) { + // 15.3.4.5.2 [[Construct]] + // When the [[Construct]] internal method of a function object, + // F that was created using the bind function is called with a + // list of arguments ExtraArgs, the following steps are taken: + // 1. Let target be the value of F's [[TargetFunction]] + // internal property. + // 2. If target has no [[Construct]] internal method, a + // TypeError exception is thrown. + // 3. Let boundArgs be the value of F's [[BoundArgs]] internal + // property. + // 4. Let args be a new list containing the same values as the + // list boundArgs in the same order followed by the same + // values as the list ExtraArgs in the same order. + // 5. Return the result of calling the [[Construct]] internal + // method of target providing args as the arguments. + + var result = apply.call( + target, + this, + array_concat.call(args, array_slice.call(arguments)) + ); + if ($Object(result) === result) { + return result; + } + return this; + + } else { + // 15.3.4.5.1 [[Call]] + // When the [[Call]] internal method of a function object, F, + // which was created using the bind function is called with a + // this value and a list of arguments ExtraArgs, the following + // steps are taken: + // 1. Let boundArgs be the value of F's [[BoundArgs]] internal + // property. + // 2. Let boundThis be the value of F's [[BoundThis]] internal + // property. + // 3. Let target be the value of F's [[TargetFunction]] internal + // property. + // 4. Let args be a new list containing the same values as the + // list boundArgs in the same order followed by the same + // values as the list ExtraArgs in the same order. + // 5. Return the result of calling the [[Call]] internal method + // of target providing boundThis as the this value and + // providing args as the arguments. + + // equiv: target.call(this, ...boundArgs, ...args) + return apply.call( + target, + that, + array_concat.call(args, array_slice.call(arguments)) + ); + + } + + }; + + // 15. If the [[Class]] internal property of Target is "Function", then + // a. Let L be the length property of Target minus the length of A. + // b. Set the length own property of F to either 0 or L, whichever is + // larger. + // 16. Else set the length own property of F to 0. + + var boundLength = max(0, target.length - args.length); + + // 17. Set the attributes of the length own property of F to the values + // specified in 15.3.5.1. + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + array_push.call(boundArgs, '$' + i); + } + + // XXX Build a dynamic function with desired amount of arguments is the only + // way to set the length property of a function. + // In environments where Content Security Policies enabled (Chrome extensions, + // for ex.) all use of eval or Function costructor throws an exception. + // However in all of these environments Function.prototype.bind exists + // and so this code will never be executed. + bound = $Function('binder', 'return function (' + array_join.call(boundArgs, ',') + '){ return binder.apply(this, arguments); }')(binder); + + if (target.prototype) { + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + // Clean up dangling references. + Empty.prototype = null; + } + + // TODO + // 18. Set the [[Extensible]] internal property of F to true. + + // TODO + // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3). + // 20. Call the [[DefineOwnProperty]] internal method of F with + // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]: + // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and + // false. + // 21. Call the [[DefineOwnProperty]] internal method of F with + // arguments "arguments", PropertyDescriptor {[[Get]]: thrower, + // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false}, + // and false. + + // TODO + // NOTE Function objects created using Function.prototype.bind do not + // have a prototype property or the [[Code]], [[FormalParameters]], and + // [[Scope]] internal properties. + // XXX can't delete prototype in pure-js. + + // 22. Return F. + return bound; + } + }); + + // _Please note: Shortcuts are defined after `Function.prototype.bind` as we + // use it in defining shortcuts. + var owns = call.bind(ObjectPrototype.hasOwnProperty); + var toStr = call.bind(ObjectPrototype.toString); + var arraySlice = call.bind(array_slice); + var arraySliceApply = apply.bind(array_slice); + /* globals document */ + if (typeof document === 'object' && document && document.documentElement) { + try { + arraySlice(document.documentElement.childNodes); + } catch (e) { + var origArraySlice = arraySlice; + var origArraySliceApply = arraySliceApply; + arraySlice = function arraySliceIE(arr) { + var r = []; + var i = arr.length; + while (i-- > 0) { + r[i] = arr[i]; + } + return origArraySliceApply(r, origArraySlice(arguments, 1)); + }; + arraySliceApply = function arraySliceApplyIE(arr, args) { + return origArraySliceApply(arraySlice(arr), args); + }; + } + } + var strSlice = call.bind(StringPrototype.slice); + var strSplit = call.bind(StringPrototype.split); + var strIndexOf = call.bind(StringPrototype.indexOf); + var pushCall = call.bind(array_push); + var isEnum = call.bind(ObjectPrototype.propertyIsEnumerable); + var arraySort = call.bind(ArrayPrototype.sort); + + // + // Array + // ===== + // + + var isArray = $Array.isArray || function isArray(obj) { + return toStr(obj) === '[object Array]'; + }; + + // ES5 15.4.4.12 + // http://es5.github.com/#x15.4.4.13 + // Return len+argCount. + // [bugfix, ielt8] + // IE < 8 bug: [].unshift(0) === undefined but should be "1" + var hasUnshiftReturnValueBug = [].unshift(0) !== 1; + defineProperties(ArrayPrototype, { + unshift: function () { + array_unshift.apply(this, arguments); + return this.length; + } + }, hasUnshiftReturnValueBug); + + // ES5 15.4.3.2 + // http://es5.github.com/#x15.4.3.2 + // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray + defineProperties($Array, { isArray: isArray }); + + // The IsCallable() check in the Array functions + // has been replaced with a strict check on the + // internal class of the object to trap cases where + // the provided function was actually a regular + // expression literal, which in V8 and + // JavaScriptCore is a typeof "function". Only in + // V8 are regular expression literals permitted as + // reduce parameters, so it is desirable in the + // general case for the shim to match the more + // strict and common behavior of rejecting regular + // expressions. + + // ES5 15.4.4.18 + // http://es5.github.com/#x15.4.4.18 + // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach + + // Check failure of by-index access of string characters (IE < 9) + // and failure of `0 in boxedString` (Rhino) + var boxedString = $Object('a'); + var splitString = boxedString[0] !== 'a' || !(0 in boxedString); + + var properlyBoxesContext = function properlyBoxed(method) { + // Check node 0.6.21 bug where third parameter is not boxed + var properlyBoxesNonStrict = true; + var properlyBoxesStrict = true; + var threwException = false; + if (method) { + try { + method.call('foo', function (_, __, context) { + if (typeof context !== 'object') { + properlyBoxesNonStrict = false; + } + }); + + method.call([1], function () { + 'use strict'; + + properlyBoxesStrict = typeof this === 'string'; + }, 'x'); + } catch (e) { + threwException = true; + } + } + return !!method && !threwException && properlyBoxesNonStrict && properlyBoxesStrict; + }; + + defineProperties(ArrayPrototype, { + forEach: function forEach(callbackfn/*, thisArg*/) { + var object = ES.ToObject(this); + var self = splitString && isString(this) ? strSplit(this, '') : object; + var i = -1; + var length = ES.ToUint32(self.length); + var T; + if (arguments.length > 1) { + T = arguments[1]; + } + + // If no callback function or if callback is not a callable function + if (!isCallable(callbackfn)) { + throw new TypeError('Array.prototype.forEach callback must be a function'); + } + + while (++i < length) { + if (i in self) { + // Invoke the callback function with call, passing arguments: + // context, property value, property key, thisArg object + if (typeof T === 'undefined') { + callbackfn(self[i], i, object); + } else { + callbackfn.call(T, self[i], i, object); + } + } + } + } + }, !properlyBoxesContext(ArrayPrototype.forEach)); + + // ES5 15.4.4.19 + // http://es5.github.com/#x15.4.4.19 + // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map + defineProperties(ArrayPrototype, { + map: function map(callbackfn/*, thisArg*/) { + var object = ES.ToObject(this); + var self = splitString && isString(this) ? strSplit(this, '') : object; + var length = ES.ToUint32(self.length); + var result = $Array(length); + var T; + if (arguments.length > 1) { + T = arguments[1]; + } + + // If no callback function or if callback is not a callable function + if (!isCallable(callbackfn)) { + throw new TypeError('Array.prototype.map callback must be a function'); + } + + for (var i = 0; i < length; i++) { + if (i in self) { + if (typeof T === 'undefined') { + result[i] = callbackfn(self[i], i, object); + } else { + result[i] = callbackfn.call(T, self[i], i, object); + } + } + } + return result; + } + }, !properlyBoxesContext(ArrayPrototype.map)); + + // ES5 15.4.4.20 + // http://es5.github.com/#x15.4.4.20 + // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter + defineProperties(ArrayPrototype, { + filter: function filter(callbackfn/*, thisArg*/) { + var object = ES.ToObject(this); + var self = splitString && isString(this) ? strSplit(this, '') : object; + var length = ES.ToUint32(self.length); + var result = []; + var value; + var T; + if (arguments.length > 1) { + T = arguments[1]; + } + + // If no callback function or if callback is not a callable function + if (!isCallable(callbackfn)) { + throw new TypeError('Array.prototype.filter callback must be a function'); + } + + for (var i = 0; i < length; i++) { + if (i in self) { + value = self[i]; + if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) { + pushCall(result, value); + } + } + } + return result; + } + }, !properlyBoxesContext(ArrayPrototype.filter)); + + // ES5 15.4.4.16 + // http://es5.github.com/#x15.4.4.16 + // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every + defineProperties(ArrayPrototype, { + every: function every(callbackfn/*, thisArg*/) { + var object = ES.ToObject(this); + var self = splitString && isString(this) ? strSplit(this, '') : object; + var length = ES.ToUint32(self.length); + var T; + if (arguments.length > 1) { + T = arguments[1]; + } + + // If no callback function or if callback is not a callable function + if (!isCallable(callbackfn)) { + throw new TypeError('Array.prototype.every callback must be a function'); + } + + for (var i = 0; i < length; i++) { + if (i in self && !(typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) { + return false; + } + } + return true; + } + }, !properlyBoxesContext(ArrayPrototype.every)); + + // ES5 15.4.4.17 + // http://es5.github.com/#x15.4.4.17 + // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some + defineProperties(ArrayPrototype, { + some: function some(callbackfn/*, thisArg */) { + var object = ES.ToObject(this); + var self = splitString && isString(this) ? strSplit(this, '') : object; + var length = ES.ToUint32(self.length); + var T; + if (arguments.length > 1) { + T = arguments[1]; + } + + // If no callback function or if callback is not a callable function + if (!isCallable(callbackfn)) { + throw new TypeError('Array.prototype.some callback must be a function'); + } + + for (var i = 0; i < length; i++) { + if (i in self && (typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) { + return true; + } + } + return false; + } + }, !properlyBoxesContext(ArrayPrototype.some)); + + // ES5 15.4.4.21 + // http://es5.github.com/#x15.4.4.21 + // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce + var reduceCoercesToObject = false; + if (ArrayPrototype.reduce) { + reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) { + return list; + }) === 'object'; + } + defineProperties(ArrayPrototype, { + reduce: function reduce(callbackfn/*, initialValue*/) { + var object = ES.ToObject(this); + var self = splitString && isString(this) ? strSplit(this, '') : object; + var length = ES.ToUint32(self.length); + + // If no callback function or if callback is not a callable function + if (!isCallable(callbackfn)) { + throw new TypeError('Array.prototype.reduce callback must be a function'); + } + + // no value to return if no initial value and an empty array + if (length === 0 && arguments.length === 1) { + throw new TypeError('reduce of empty array with no initial value'); + } + + var i = 0; + var result; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i++]; + break; + } + + // if array contains no values, no initial value to return + if (++i >= length) { + throw new TypeError('reduce of empty array with no initial value'); + } + } while (true); + } + + for (; i < length; i++) { + if (i in self) { + result = callbackfn(result, self[i], i, object); + } + } + + return result; + } + }, !reduceCoercesToObject); + + // ES5 15.4.4.22 + // http://es5.github.com/#x15.4.4.22 + // https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight + var reduceRightCoercesToObject = false; + if (ArrayPrototype.reduceRight) { + reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) { + return list; + }) === 'object'; + } + defineProperties(ArrayPrototype, { + reduceRight: function reduceRight(callbackfn/*, initial*/) { + var object = ES.ToObject(this); + var self = splitString && isString(this) ? strSplit(this, '') : object; + var length = ES.ToUint32(self.length); + + // If no callback function or if callback is not a callable function + if (!isCallable(callbackfn)) { + throw new TypeError('Array.prototype.reduceRight callback must be a function'); + } + + // no value to return if no initial value, empty array + if (length === 0 && arguments.length === 1) { + throw new TypeError('reduceRight of empty array with no initial value'); + } + + var result; + var i = length - 1; + if (arguments.length >= 2) { + result = arguments[1]; + } else { + do { + if (i in self) { + result = self[i--]; + break; + } + + // if array contains no values, no initial value to return + if (--i < 0) { + throw new TypeError('reduceRight of empty array with no initial value'); + } + } while (true); + } + + if (i < 0) { + return result; + } + + do { + if (i in self) { + result = callbackfn(result, self[i], i, object); + } + } while (i--); + + return result; + } + }, !reduceRightCoercesToObject); + + // ES5 15.4.4.14 + // http://es5.github.com/#x15.4.4.14 + // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf + var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1; + defineProperties(ArrayPrototype, { + indexOf: function indexOf(searchElement/*, fromIndex */) { + var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this); + var length = ES.ToUint32(self.length); + + if (length === 0) { + return -1; + } + + var i = 0; + if (arguments.length > 1) { + i = ES.ToInteger(arguments[1]); + } + + // handle negative indices + i = i >= 0 ? i : max(0, length + i); + for (; i < length; i++) { + if (i in self && self[i] === searchElement) { + return i; + } + } + return -1; + } + }, hasFirefox2IndexOfBug); + + // ES5 15.4.4.15 + // http://es5.github.com/#x15.4.4.15 + // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf + var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1; + defineProperties(ArrayPrototype, { + lastIndexOf: function lastIndexOf(searchElement/*, fromIndex */) { + var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this); + var length = ES.ToUint32(self.length); + + if (length === 0) { + return -1; + } + var i = length - 1; + if (arguments.length > 1) { + i = min(i, ES.ToInteger(arguments[1])); + } + // handle negative indices + i = i >= 0 ? i : length - Math.abs(i); + for (; i >= 0; i--) { + if (i in self && searchElement === self[i]) { + return i; + } + } + return -1; + } + }, hasFirefox2LastIndexOfBug); + + // ES5 15.4.4.12 + // http://es5.github.com/#x15.4.4.12 + var spliceNoopReturnsEmptyArray = (function () { + var a = [1, 2]; + var result = a.splice(); + return a.length === 2 && isArray(result) && result.length === 0; + }()); + defineProperties(ArrayPrototype, { + // Safari 5.0 bug where .splice() returns undefined + splice: function splice(start, deleteCount) { + if (arguments.length === 0) { + return []; + } else { + return array_splice.apply(this, arguments); + } + } + }, !spliceNoopReturnsEmptyArray); + + var spliceWorksWithEmptyObject = (function () { + var obj = {}; + ArrayPrototype.splice.call(obj, 0, 0, 1); + return obj.length === 1; + }()); + defineProperties(ArrayPrototype, { + splice: function splice(start, deleteCount) { + if (arguments.length === 0) { + return []; + } + var args = arguments; + this.length = max(ES.ToInteger(this.length), 0); + if (arguments.length > 0 && typeof deleteCount !== 'number') { + args = arraySlice(arguments); + if (args.length < 2) { + pushCall(args, this.length - start); + } else { + args[1] = ES.ToInteger(deleteCount); + } + } + return array_splice.apply(this, args); + } + }, !spliceWorksWithEmptyObject); + var spliceWorksWithLargeSparseArrays = (function () { + // Per https://github.com/es-shims/es5-shim/issues/295 + // Safari 7/8 breaks with sparse arrays of size 1e5 or greater + var arr = new $Array(1e5); + // note: the index MUST be 8 or larger or the test will false pass + arr[8] = 'x'; + arr.splice(1, 1); + // note: this test must be defined *after* the indexOf shim + // per https://github.com/es-shims/es5-shim/issues/313 + return arr.indexOf('x') === 7; + }()); + var spliceWorksWithSmallSparseArrays = (function () { + // Per https://github.com/es-shims/es5-shim/issues/295 + // Opera 12.15 breaks on this, no idea why. + var n = 256; + var arr = []; + arr[n] = 'a'; + arr.splice(n + 1, 0, 'b'); + return arr[n] === 'a'; + }()); + defineProperties(ArrayPrototype, { + splice: function splice(start, deleteCount) { + var O = ES.ToObject(this); + var A = []; + var len = ES.ToUint32(O.length); + var relativeStart = ES.ToInteger(start); + var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len); + var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart); + + var k = 0; + var from; + while (k < actualDeleteCount) { + from = $String(actualStart + k); + if (owns(O, from)) { + A[k] = O[from]; + } + k += 1; + } + + var items = arraySlice(arguments, 2); + var itemCount = items.length; + var to; + if (itemCount < actualDeleteCount) { + k = actualStart; + var maxK = len - actualDeleteCount; + while (k < maxK) { + from = $String(k + actualDeleteCount); + to = $String(k + itemCount); + if (owns(O, from)) { + O[to] = O[from]; + } else { + delete O[to]; + } + k += 1; + } + k = len; + var minK = len - actualDeleteCount + itemCount; + while (k > minK) { + delete O[k - 1]; + k -= 1; + } + } else if (itemCount > actualDeleteCount) { + k = len - actualDeleteCount; + while (k > actualStart) { + from = $String(k + actualDeleteCount - 1); + to = $String(k + itemCount - 1); + if (owns(O, from)) { + O[to] = O[from]; + } else { + delete O[to]; + } + k -= 1; + } + } + k = actualStart; + for (var i = 0; i < items.length; ++i) { + O[k] = items[i]; + k += 1; + } + O.length = len - actualDeleteCount + itemCount; + + return A; + } + }, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays); + + var originalJoin = ArrayPrototype.join; + var hasStringJoinBug; + try { + hasStringJoinBug = Array.prototype.join.call('123', ',') !== '1,2,3'; + } catch (e) { + hasStringJoinBug = true; + } + if (hasStringJoinBug) { + defineProperties(ArrayPrototype, { + join: function join(separator) { + var sep = typeof separator === 'undefined' ? ',' : separator; + return originalJoin.call(isString(this) ? strSplit(this, '') : this, sep); + } + }, hasStringJoinBug); + } + + var hasJoinUndefinedBug = [1, 2].join(undefined) !== '1,2'; + if (hasJoinUndefinedBug) { + defineProperties(ArrayPrototype, { + join: function join(separator) { + var sep = typeof separator === 'undefined' ? ',' : separator; + return originalJoin.call(this, sep); + } + }, hasJoinUndefinedBug); + } + + var pushShim = function push(item) { + var O = ES.ToObject(this); + var n = ES.ToUint32(O.length); + var i = 0; + while (i < arguments.length) { + O[n + i] = arguments[i]; + i += 1; + } + O.length = n + i; + return n + i; + }; + + var pushIsNotGeneric = (function () { + var obj = {}; + var result = Array.prototype.push.call(obj, undefined); + return result !== 1 || obj.length !== 1 || typeof obj[0] !== 'undefined' || !owns(obj, 0); + }()); + defineProperties(ArrayPrototype, { + push: function push(item) { + if (isArray(this)) { + return array_push.apply(this, arguments); + } + return pushShim.apply(this, arguments); + } + }, pushIsNotGeneric); + + // This fixes a very weird bug in Opera 10.6 when pushing `undefined + var pushUndefinedIsWeird = (function () { + var arr = []; + var result = arr.push(undefined); + return result !== 1 || arr.length !== 1 || typeof arr[0] !== 'undefined' || !owns(arr, 0); + }()); + defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird); + + // ES5 15.2.3.14 + // http://es5.github.io/#x15.4.4.10 + // Fix boxed string bug + defineProperties(ArrayPrototype, { + slice: function (start, end) { + var arr = isString(this) ? strSplit(this, '') : this; + return arraySliceApply(arr, arguments); + } + }, splitString); + + var sortIgnoresNonFunctions = (function () { + try { + [1, 2].sort(null); + } catch (e) { + try { + [1, 2].sort({}); + } catch (e2) { + return false; + } + } + return true; + }()); + var sortThrowsOnRegex = (function () { + // this is a problem in Firefox 4, in which `typeof /a/ === 'function'` + try { + [1, 2].sort(/a/); + return false; + } catch (e) {} + return true; + }()); + var sortIgnoresUndefined = (function () { + // applies in IE 8, for one. + try { + [1, 2].sort(undefined); + return true; + } catch (e) {} + return false; + }()); + defineProperties(ArrayPrototype, { + sort: function sort(compareFn) { + if (typeof compareFn === 'undefined') { + return arraySort(this); + } + if (!isCallable(compareFn)) { + throw new TypeError('Array.prototype.sort callback must be a function'); + } + return arraySort(this, compareFn); + } + }, sortIgnoresNonFunctions || !sortIgnoresUndefined || !sortThrowsOnRegex); + + // + // Object + // ====== + // + + // ES5 15.2.3.14 + // http://es5.github.com/#x15.2.3.14 + + // http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + var hasDontEnumBug = !isEnum({ 'toString': null }, 'toString'); // jscs:ignore disallowQuotedKeysInObjects + var hasProtoEnumBug = isEnum(function () {}, 'prototype'); + var hasStringEnumBug = !owns('x', '0'); + var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true, + + $width: true, + $height: true, + $top: true, + $localStorage: true + }; + var hasAutomationEqualityBug = (function () { + /* globals window */ + if (typeof window === 'undefined') { + return false; + } + for (var k in window) { + try { + if (!excludedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') { + equalsConstructorPrototype(window[k]); + } + } catch (e) { + return true; + } + } + return false; + }()); + var equalsConstructorPrototypeIfNotBuggy = function (object) { + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(object); + } + try { + return equalsConstructorPrototype(object); + } catch (e) { + return false; + } + }; + var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + var dontEnumsLength = dontEnums.length; + + // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js + // can be replaced with require('is-arguments') if we ever use a build process instead + var isStandardArguments = function isArguments(value) { + return toStr(value) === '[object Arguments]'; + }; + var isLegacyArguments = function isArguments(value) { + return value !== null + && typeof value === 'object' + && typeof value.length === 'number' + && value.length >= 0 + && !isArray(value) + && isCallable(value.callee); + }; + var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments; + + defineProperties($Object, { + keys: function keys(object) { + var isFn = isCallable(object); + var isArgs = isArguments(object); + var isObject = object !== null && typeof object === 'object'; + var isStr = isObject && isString(object); + + if (!isObject && !isFn && !isArgs) { + throw new TypeError('Object.keys called on a non-object'); + } + + var theKeys = []; + var skipProto = hasProtoEnumBug && isFn; + if ((isStr && hasStringEnumBug) || isArgs) { + for (var i = 0; i < object.length; ++i) { + pushCall(theKeys, $String(i)); + } + } + + if (!isArgs) { + for (var name in object) { + if (!(skipProto && name === 'prototype') && owns(object, name)) { + pushCall(theKeys, $String(name)); + } + } + } + + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + for (var j = 0; j < dontEnumsLength; j++) { + var dontEnum = dontEnums[j]; + if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) { + pushCall(theKeys, dontEnum); + } + } + } + return theKeys; + } + }); + + var keysWorksWithArguments = $Object.keys && (function () { + // Safari 5.0 bug + return $Object.keys(arguments).length === 2; + }(1, 2)); + var keysHasArgumentsLengthBug = $Object.keys && (function () { + var argKeys = $Object.keys(arguments); + return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1; + }(1)); + var originalKeys = $Object.keys; + defineProperties($Object, { + keys: function keys(object) { + if (isArguments(object)) { + return originalKeys(arraySlice(object)); + } else { + return originalKeys(object); + } + } + }, !keysWorksWithArguments || keysHasArgumentsLengthBug); + + // + // Date + // ==== + // + + var hasNegativeMonthYearBug = new Date(-3509827329600292).getUTCMonth() !== 0; + var aNegativeTestDate = new Date(-1509842289600292); + var aPositiveTestDate = new Date(1449662400000); + var hasToUTCStringFormatBug = aNegativeTestDate.toUTCString() !== 'Mon, 01 Jan -45875 11:59:59 GMT'; + var hasToDateStringFormatBug; + var hasToStringFormatBug; + var timeZoneOffset = aNegativeTestDate.getTimezoneOffset(); + if (timeZoneOffset < -720) { + hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875'; + hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/).test(String(aPositiveTestDate)); + } else { + hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875'; + hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-+]\d\d\d\d(?: |$)/).test(String(aPositiveTestDate)); + } + + var originalGetFullYear = call.bind(Date.prototype.getFullYear); + var originalGetMonth = call.bind(Date.prototype.getMonth); + var originalGetDate = call.bind(Date.prototype.getDate); + var originalGetUTCFullYear = call.bind(Date.prototype.getUTCFullYear); + var originalGetUTCMonth = call.bind(Date.prototype.getUTCMonth); + var originalGetUTCDate = call.bind(Date.prototype.getUTCDate); + var originalGetUTCDay = call.bind(Date.prototype.getUTCDay); + var originalGetUTCHours = call.bind(Date.prototype.getUTCHours); + var originalGetUTCMinutes = call.bind(Date.prototype.getUTCMinutes); + var originalGetUTCSeconds = call.bind(Date.prototype.getUTCSeconds); + var originalGetUTCMilliseconds = call.bind(Date.prototype.getUTCMilliseconds); + var dayName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; + var monthName = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; + var daysInMonth = function daysInMonth(month, year) { + return originalGetDate(new Date(year, month, 0)); + }; + + defineProperties(Date.prototype, { + getFullYear: function getFullYear() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var year = originalGetFullYear(this); + if (year < 0 && originalGetMonth(this) > 11) { + return year + 1; + } + return year; + }, + getMonth: function getMonth() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var year = originalGetFullYear(this); + var month = originalGetMonth(this); + if (year < 0 && month > 11) { + return 0; + } + return month; + }, + getDate: function getDate() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var year = originalGetFullYear(this); + var month = originalGetMonth(this); + var date = originalGetDate(this); + if (year < 0 && month > 11) { + if (month === 12) { + return date; + } + var days = daysInMonth(0, year + 1); + return (days - date) + 1; + } + return date; + }, + getUTCFullYear: function getUTCFullYear() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var year = originalGetUTCFullYear(this); + if (year < 0 && originalGetUTCMonth(this) > 11) { + return year + 1; + } + return year; + }, + getUTCMonth: function getUTCMonth() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var year = originalGetUTCFullYear(this); + var month = originalGetUTCMonth(this); + if (year < 0 && month > 11) { + return 0; + } + return month; + }, + getUTCDate: function getUTCDate() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var year = originalGetUTCFullYear(this); + var month = originalGetUTCMonth(this); + var date = originalGetUTCDate(this); + if (year < 0 && month > 11) { + if (month === 12) { + return date; + } + var days = daysInMonth(0, year + 1); + return (days - date) + 1; + } + return date; + } + }, hasNegativeMonthYearBug); + + defineProperties(Date.prototype, { + toUTCString: function toUTCString() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var day = originalGetUTCDay(this); + var date = originalGetUTCDate(this); + var month = originalGetUTCMonth(this); + var year = originalGetUTCFullYear(this); + var hour = originalGetUTCHours(this); + var minute = originalGetUTCMinutes(this); + var second = originalGetUTCSeconds(this); + return dayName[day] + ', ' + + (date < 10 ? '0' + date : date) + ' ' + + monthName[month] + ' ' + + year + ' ' + + (hour < 10 ? '0' + hour : hour) + ':' + + (minute < 10 ? '0' + minute : minute) + ':' + + (second < 10 ? '0' + second : second) + ' GMT'; + } + }, hasNegativeMonthYearBug || hasToUTCStringFormatBug); + + // Opera 12 has `,` + defineProperties(Date.prototype, { + toDateString: function toDateString() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var day = this.getDay(); + var date = this.getDate(); + var month = this.getMonth(); + var year = this.getFullYear(); + return dayName[day] + ' ' + + monthName[month] + ' ' + + (date < 10 ? '0' + date : date) + ' ' + + year; + } + }, hasNegativeMonthYearBug || hasToDateStringFormatBug); + + // can't use defineProperties here because of toString enumeration issue in IE <= 8 + if (hasNegativeMonthYearBug || hasToStringFormatBug) { + Date.prototype.toString = function toString() { + if (!this || !(this instanceof Date)) { + throw new TypeError('this is not a Date object.'); + } + var day = this.getDay(); + var date = this.getDate(); + var month = this.getMonth(); + var year = this.getFullYear(); + var hour = this.getHours(); + var minute = this.getMinutes(); + var second = this.getSeconds(); + var timezoneOffset = this.getTimezoneOffset(); + var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60); + var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60); + return dayName[day] + ' ' + + monthName[month] + ' ' + + (date < 10 ? '0' + date : date) + ' ' + + year + ' ' + + (hour < 10 ? '0' + hour : hour) + ':' + + (minute < 10 ? '0' + minute : minute) + ':' + + (second < 10 ? '0' + second : second) + ' GMT' + + (timezoneOffset > 0 ? '-' : '+') + + (hoursOffset < 10 ? '0' + hoursOffset : hoursOffset) + + (minutesOffset < 10 ? '0' + minutesOffset : minutesOffset); + }; + if (supportsDescriptors) { + $Object.defineProperty(Date.prototype, 'toString', { + configurable: true, + enumerable: false, + writable: true + }); + } + } + + // ES5 15.9.5.43 + // http://es5.github.com/#x15.9.5.43 + // This function returns a String value represent the instance in time + // represented by this Date object. The format of the String is the Date Time + // string format defined in 15.9.1.15. All fields are present in the String. + // The time zone is always UTC, denoted by the suffix Z. If the time value of + // this object is not a finite Number a RangeError exception is thrown. + var negativeDate = -62198755200000; + var negativeYearString = '-000001'; + var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1; // eslint-disable-line max-len + var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z'; + + var getTime = call.bind(Date.prototype.getTime); + + defineProperties(Date.prototype, { + toISOString: function toISOString() { + if (!isFinite(this) || !isFinite(getTime(this))) { + // Adope Photoshop requires the second check. + throw new RangeError('Date.prototype.toISOString called on non-finite value.'); + } + + var year = originalGetUTCFullYear(this); + + var month = originalGetUTCMonth(this); + // see https://github.com/es-shims/es5-shim/issues/111 + year += Math.floor(month / 12); + month = ((month % 12) + 12) % 12; + + // the date time string format is specified in 15.9.1.15. + var result = [ + month + 1, + originalGetUTCDate(this), + originalGetUTCHours(this), + originalGetUTCMinutes(this), + originalGetUTCSeconds(this) + ]; + year = ( + (year < 0 ? '-' : (year > 9999 ? '+' : '')) + + strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6) + ); + + for (var i = 0; i < result.length; ++i) { + // pad months, days, hours, minutes, and seconds to have two digits. + result[i] = strSlice('00' + result[i], -2); + } + // pad milliseconds to have three digits. + return ( + year + '-' + arraySlice(result, 0, 2).join('-') + + 'T' + arraySlice(result, 2).join(':') + '.' + + strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z' + ); + } + }, hasNegativeDateBug || hasSafari51DateBug); + + // ES5 15.9.5.44 + // http://es5.github.com/#x15.9.5.44 + // This function provides a String representation of a Date object for use by + // JSON.stringify (15.12.3). + var dateToJSONIsSupported = (function () { + try { + return Date.prototype.toJSON + && new Date(NaN).toJSON() === null + && new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 + && Date.prototype.toJSON.call({ // generic + toISOString: function () { return true; } + }); + } catch (e) { + return false; + } + }()); + if (!dateToJSONIsSupported) { + Date.prototype.toJSON = function toJSON(key) { + // When the toJSON method is called with argument key, the following + // steps are taken: + + // 1. Let O be the result of calling ToObject, giving it the this + // value as its argument. + // 2. Let tv be ES.ToPrimitive(O, hint Number). + var O = $Object(this); + var tv = ES.ToPrimitive(O); + // 3. If tv is a Number and is not finite, return null. + if (typeof tv === 'number' && !isFinite(tv)) { + return null; + } + // 4. Let toISO be the result of calling the [[Get]] internal method of + // O with argument "toISOString". + var toISO = O.toISOString; + // 5. If IsCallable(toISO) is false, throw a TypeError exception. + if (!isCallable(toISO)) { + throw new TypeError('toISOString property is not callable'); + } + // 6. Return the result of calling the [[Call]] internal method of + // toISO with O as the this value and an empty argument list. + return toISO.call(O); + + // NOTE 1 The argument is ignored. + + // NOTE 2 The toJSON function is intentionally generic; it does not + // require that its this value be a Date object. Therefore, it can be + // transferred to other kinds of objects for use as a method. However, + // it does require that any such object have a toISOString method. An + // object is free to use the argument key to filter its + // stringification. + }; + } + + // ES5 15.9.4.2 + // http://es5.github.com/#x15.9.4.2 + // based on work shared by Daniel Friesen (dantman) + // http://gist.github.com/303249 + var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15; + var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z')); + var doesNotParseY2KNewYear = isNaN(Date.parse('2000-01-01T00:00:00.000Z')); + if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) { + // XXX global assignment won't work in embeddings that use + // an alternate object for the context. + /* global Date: true */ + var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1; + var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime()); + // eslint-disable-next-line no-implicit-globals, no-global-assign + Date = (function (NativeDate) { + // Date.length === 7 + var DateShim = function Date(Y, M, D, h, m, s, ms) { + var length = arguments.length; + var date; + if (this instanceof NativeDate) { + var seconds = s; + var millis = ms; + if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) { + // work around a Safari 8/9 bug where it treats the seconds as signed + var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit; + var sToShift = Math.floor(msToShift / 1e3); + seconds += sToShift; + millis -= sToShift * 1e3; + } + date = length === 1 && $String(Y) === Y // isString(Y) + // We explicitly pass it through parse: + ? new NativeDate(DateShim.parse(Y)) + // We have to manually make calls depending on argument + // length here + : length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) + : length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) + : length >= 5 ? new NativeDate(Y, M, D, h, m) + : length >= 4 ? new NativeDate(Y, M, D, h) + : length >= 3 ? new NativeDate(Y, M, D) + : length >= 2 ? new NativeDate(Y, M) + : length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) + : new NativeDate(); + } else { + date = NativeDate.apply(this, arguments); + } + if (!isPrimitive(date)) { + // Prevent mixups with unfixed Date object + defineProperties(date, { constructor: DateShim }, true); + } + return date; + }; + + // 15.9.1.15 Date Time String Format. + var isoDateExpression = new RegExp('^' + + '(\\d{4}|[+-]\\d{6})' // four-digit year capture or sign + 6-digit extended year + + '(?:-(\\d{2})' // optional month capture + + '(?:-(\\d{2})' // optional day capture + + '(?:' // capture hours:minutes:seconds.milliseconds + + 'T(\\d{2})' // hours capture + + ':(\\d{2})' // minutes capture + + '(?:' // optional :seconds.milliseconds + + ':(\\d{2})' // seconds capture + + '(?:(\\.\\d{1,}))?' // milliseconds capture + + ')?' + + '(' // capture UTC offset component + + 'Z|' // UTC capture + + '(?:' // offset specifier +/-hours:minutes + + '([-+])' // sign capture + + '(\\d{2})' // hours offset capture + + ':(\\d{2})' // minutes offset capture + + ')' + + ')?)?)?)?' + + '$'); + + var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]; + + var dayFromMonth = function dayFromMonth(year, month) { + var t = month > 1 ? 1 : 0; + return ( + months[month] + + Math.floor((year - 1969 + t) / 4) + - Math.floor((year - 1901 + t) / 100) + + Math.floor((year - 1601 + t) / 400) + + (365 * (year - 1970)) + ); + }; + + var toUTC = function toUTC(t) { + var s = 0; + var ms = t; + if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) { + // work around a Safari 8/9 bug where it treats the seconds as signed + var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit; + var sToShift = Math.floor(msToShift / 1e3); + s += sToShift; + ms -= sToShift * 1e3; + } + return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms)); + }; + + // Copy any custom methods a 3rd party library may have added + for (var key in NativeDate) { + if (owns(NativeDate, key)) { + DateShim[key] = NativeDate[key]; + } + } + + // Copy "native" methods explicitly; they may be non-enumerable + defineProperties(DateShim, { + now: NativeDate.now, + UTC: NativeDate.UTC + }, true); + DateShim.prototype = NativeDate.prototype; + defineProperties(DateShim.prototype, { constructor: DateShim }, true); + + // Upgrade Date.parse to handle simplified ISO 8601 strings + var parseShim = function parse(string) { + var match = isoDateExpression.exec(string); + if (match) { + // parse months, days, hours, minutes, seconds, and milliseconds + // provide default values if necessary + // parse the UTC offset component + var year = $Number(match[1]), + month = $Number(match[2] || 1) - 1, + day = $Number(match[3] || 1) - 1, + hour = $Number(match[4] || 0), + minute = $Number(match[5] || 0), + second = $Number(match[6] || 0), + millisecond = Math.floor($Number(match[7] || 0) * 1000), + // When time zone is missed, local offset should be used + // (ES 5.1 bug) + // see https://bugs.ecmascript.org/show_bug.cgi?id=112 + isLocalTime = Boolean(match[4] && !match[8]), + signOffset = match[9] === '-' ? 1 : -1, + hourOffset = $Number(match[10] || 0), + minuteOffset = $Number(match[11] || 0), + result; + var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0; + if ( + hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) + && minute < 60 && second < 60 && millisecond < 1000 + && month > -1 && month < 12 && hourOffset < 24 + && minuteOffset < 60 // detect invalid offsets + && day > -1 + && day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month)) + ) { + result = ( + ((dayFromMonth(year, month) + day) * 24) + + hour + + (hourOffset * signOffset) + ) * 60; + result = (( + ((result + minute + (minuteOffset * signOffset)) * 60) + + second + ) * 1000) + millisecond; + if (isLocalTime) { + result = toUTC(result); + } + if (-8.64e15 <= result && result <= 8.64e15) { + return result; + } + } + return NaN; + } + return NativeDate.parse.apply(this, arguments); + }; + defineProperties(DateShim, { parse: parseShim }); + + return DateShim; + }(Date)); + /* global Date: false */ + } + + // ES5 15.9.4.4 + // http://es5.github.com/#x15.9.4.4 + if (!Date.now) { + Date.now = function now() { + return new Date().getTime(); + }; + } + + // + // Number + // ====== + // + + // ES5.1 15.7.4.5 + // http://es5.github.com/#x15.7.4.5 + var hasToFixedBugs = NumberPrototype.toFixed && ( + (0.00008).toFixed(3) !== '0.000' + || (0.9).toFixed(0) !== '1' + || (1.255).toFixed(2) !== '1.25' + || (1000000000000000128).toFixed(0) !== '1000000000000000128' + ); + + var toFixedHelpers = { + base: 1e7, + size: 6, + data: [0, 0, 0, 0, 0, 0], + multiply: function multiply(n, c) { + var i = -1; + var c2 = c; + while (++i < toFixedHelpers.size) { + c2 += n * toFixedHelpers.data[i]; + toFixedHelpers.data[i] = c2 % toFixedHelpers.base; + c2 = Math.floor(c2 / toFixedHelpers.base); + } + }, + divide: function divide(n) { + var i = toFixedHelpers.size; + var c = 0; + while (--i >= 0) { + c += toFixedHelpers.data[i]; + toFixedHelpers.data[i] = Math.floor(c / n); + c = (c % n) * toFixedHelpers.base; + } + }, + numToString: function numToString() { + var i = toFixedHelpers.size; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) { + var t = $String(toFixedHelpers.data[i]); + if (s === '') { + s = t; + } else { + s += strSlice('0000000', 0, 7 - t.length) + t; + } + } + } + return s; + }, + pow: function pow(x, n, acc) { + return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc))); + }, + log: function log(x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } + return n; + } + }; + + var toFixedShim = function toFixed(fractionDigits) { + var f, x, s, m, e, z, j, k; + + // Test for NaN and round fractionDigits down + f = $Number(fractionDigits); + f = isActualNaN(f) ? 0 : Math.floor(f); + + if (f < 0 || f > 20) { + throw new RangeError('Number.toFixed called with invalid number of decimals'); + } + + x = $Number(this); + + if (isActualNaN(x)) { + return 'NaN'; + } + + // If it is too big or small, return the string value of the number + if (x <= -1e21 || x >= 1e21) { + return $String(x); + } + + s = ''; + + if (x < 0) { + s = '-'; + x = -x; + } + + m = '0'; + + if (x > 1e-21) { + // 1e-21 < x < 1e21 + // -70 < log2(x) < 70 + e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69; + z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1)); + z *= 0x10000000000000; // Math.pow(2, 52); + e = 52 - e; + + // -18 < e < 122 + // x = z / 2 ^ e + if (e > 0) { + toFixedHelpers.multiply(0, z); + j = f; + + while (j >= 7) { + toFixedHelpers.multiply(1e7, 0); + j -= 7; + } + + toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0); + j = e - 1; + + while (j >= 23) { + toFixedHelpers.divide(1 << 23); + j -= 23; + } + + toFixedHelpers.divide(1 << j); + toFixedHelpers.multiply(1, 1); + toFixedHelpers.divide(2); + m = toFixedHelpers.numToString(); + } else { + toFixedHelpers.multiply(0, z); + toFixedHelpers.multiply(1 << (-e), 0); + m = toFixedHelpers.numToString() + strSlice('0.00000000000000000000', 2, 2 + f); + } + } + + if (f > 0) { + k = m.length; + + if (k <= f) { + m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m; + } else { + m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f); + } + } else { + m = s + m; + } + + return m; + }; + defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs); + + var hasToPrecisionUndefinedBug = (function () { + try { + return 1.0.toPrecision(undefined) === '1'; + } catch (e) { + return true; + } + }()); + var originalToPrecision = NumberPrototype.toPrecision; + defineProperties(NumberPrototype, { + toPrecision: function toPrecision(precision) { + return typeof precision === 'undefined' ? originalToPrecision.call(this) : originalToPrecision.call(this, precision); + } + }, hasToPrecisionUndefinedBug); + + // + // String + // ====== + // + + // ES5 15.5.4.14 + // http://es5.github.com/#x15.5.4.14 + + // [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers] + // Many browsers do not split properly with regular expressions or they + // do not perform the split correctly under obscure conditions. + // See http://blog.stevenlevithan.com/archives/cross-browser-split + // I've tested in many browsers and this seems to cover the deviant ones: + // 'ab'.split(/(?:ab)*/) should be ["", ""], not [""] + // '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""] + // 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not + // [undefined, "t", undefined, "e", ...] + // ''.split(/.?/) should be [], not [""] + // '.'.split(/()()/) should be ["."], not ["", "", "."] + + if ( + 'ab'.split(/(?:ab)*/).length !== 2 + || '.'.split(/(.?)(.?)/).length !== 4 + || 'tesst'.split(/(s)*/)[1] === 't' + || 'test'.split(/(?:)/, -1).length !== 4 + || ''.split(/.?/).length + || '.'.split(/()()/).length > 1 + ) { + (function () { + var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group + var maxSafe32BitInt = Math.pow(2, 32) - 1; + + StringPrototype.split = function (separator, limit) { + var string = String(this); + if (typeof separator === 'undefined' && limit === 0) { + return []; + } + + // If `separator` is not a regex, use native split + if (!isRegex(separator)) { + return strSplit(this, separator, limit); + } + + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') // in ES6 + + (separator.sticky ? 'y' : ''), // Firefox 3+ and ES6 + lastLastIndex = 0, + // Make `global` and avoid `lastIndex` issues by working with a copy + separator2, match, lastIndex, lastLength; + var separatorCopy = new RegExp(separator.source, flags + 'g'); + if (!compliantExecNpcg) { + // Doesn't need flags gy, but they don't hurt + separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + } + /* Values for `limit`, per the spec: + * If undefined: 4294967295 // maxSafe32BitInt + * If 0, Infinity, or NaN: 0 + * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296; + * If negative number: 4294967296 - Math.floor(Math.abs(limit)) + * If other: Type-convert, then use the above rules + */ + var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit); + match = separatorCopy.exec(string); + while (match) { + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0].length; + if (lastIndex > lastLastIndex) { + pushCall(output, strSlice(string, lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1) { + /* eslint-disable no-loop-func */ + match[0].replace(separator2, function () { + for (var i = 1; i < arguments.length - 2; i++) { + if (typeof arguments[i] === 'undefined') { + match[i] = void 0; + } + } + }); + /* eslint-enable no-loop-func */ + } + if (match.length > 1 && match.index < string.length) { + array_push.apply(output, arraySlice(match, 1)); + } + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= splitLimit) { + break; + } + } + if (separatorCopy.lastIndex === match.index) { + separatorCopy.lastIndex++; // Avoid an infinite loop + } + match = separatorCopy.exec(string); + } + if (lastLastIndex === string.length) { + if (lastLength || !separatorCopy.test('')) { + pushCall(output, ''); + } + } else { + pushCall(output, strSlice(string, lastLastIndex)); + } + return output.length > splitLimit ? arraySlice(output, 0, splitLimit) : output; + }; + }()); + + // [bugfix, chrome] + // If separator is undefined, then the result array contains just one String, + // which is the this value (converted to a String). If limit is not undefined, + // then the output array is truncated so that it contains no more than limit + // elements. + // "0".split(undefined, 0) -> [] + } else if ('0'.split(void 0, 0).length) { + StringPrototype.split = function split(separator, limit) { + if (typeof separator === 'undefined' && limit === 0) { + return []; + } + return strSplit(this, separator, limit); + }; + } + + var str_replace = StringPrototype.replace; + var replaceReportsGroupsCorrectly = (function () { + var groups = []; + 'x'.replace(/x(.)?/g, function (match, group) { + pushCall(groups, group); + }); + return groups.length === 1 && typeof groups[0] === 'undefined'; + }()); + + if (!replaceReportsGroupsCorrectly) { + StringPrototype.replace = function replace(searchValue, replaceValue) { + var isFn = isCallable(replaceValue); + var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source); + if (!isFn || !hasCapturingGroups) { + return str_replace.call(this, searchValue, replaceValue); + } else { + var wrappedReplaceValue = function (match) { + var length = arguments.length; + var originalLastIndex = searchValue.lastIndex; + searchValue.lastIndex = 0; + var args = searchValue.exec(match) || []; + searchValue.lastIndex = originalLastIndex; + pushCall(args, arguments[length - 2], arguments[length - 1]); + return replaceValue.apply(this, args); + }; + return str_replace.call(this, searchValue, wrappedReplaceValue); + } + }; + } + + // ECMA-262, 3rd B.2.3 + // Not an ECMAScript standard, although ECMAScript 3rd Edition has a + // non-normative section suggesting uniform semantics and it should be + // normalized across all browsers + // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE + var string_substr = StringPrototype.substr; + var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b'; + defineProperties(StringPrototype, { + substr: function substr(start, length) { + var normalizedStart = start; + if (start < 0) { + normalizedStart = max(this.length + start, 0); + } + return string_substr.call(this, normalizedStart, length); + } + }, hasNegativeSubstrBug); + + // ES5 15.5.4.20 + // whitespace from: http://es5.github.io/#x15.5.4.20 + var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028' + + '\u2029\uFEFF'; + var zeroWidth = '\u200b'; + var wsRegexChars = '[' + ws + ']'; + var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*'); + var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$'); + var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim()); + defineProperties(StringPrototype, { + // http://blog.stevenlevithan.com/archives/faster-trim-javascript + // http://perfectionkills.com/whitespace-deviations/ + trim: function trim() { + if (typeof this === 'undefined' || this === null) { + throw new TypeError("can't convert " + this + ' to object'); + } + return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, ''); + } + }, hasTrimWhitespaceBug); + var trim = call.bind(String.prototype.trim); + + var hasLastIndexBug = StringPrototype.lastIndexOf && 'abcあい'.lastIndexOf('あい', 2) !== -1; + defineProperties(StringPrototype, { + lastIndexOf: function lastIndexOf(searchString) { + if (typeof this === 'undefined' || this === null) { + throw new TypeError("can't convert " + this + ' to object'); + } + var S = $String(this); + var searchStr = $String(searchString); + var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN; + var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos); + var start = min(max(pos, 0), S.length); + var searchLen = searchStr.length; + var k = start + searchLen; + while (k > 0) { + k = max(0, k - searchLen); + var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr); + if (index !== -1) { + return k + index; + } + } + return -1; + } + }, hasLastIndexBug); + + var originalLastIndexOf = StringPrototype.lastIndexOf; + defineProperties(StringPrototype, { + lastIndexOf: function lastIndexOf(searchString) { + return originalLastIndexOf.apply(this, arguments); + } + }, StringPrototype.lastIndexOf.length !== 1); + + // ES-5 15.1.2.2 + // eslint-disable-next-line radix + if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) { + /* global parseInt: true */ + parseInt = (function (origParseInt) { + var hexRegex = /^[-+]?0[xX]/; + return function parseInt(str, radix) { + if (typeof str === 'symbol') { + // handle Symbols in node 8.3/8.4 + // eslint-disable-next-line no-implicit-coercion, no-unused-expressions + '' + str; // jscs:ignore disallowImplicitTypeConversion + } + + var string = trim(String(str)); + var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10); + return origParseInt(string, defaultedRadix); + }; + }(parseInt)); + } + + // https://es5.github.io/#x15.1.2.3 + if (1 / parseFloat('-0') !== -Infinity) { + /* global parseFloat: true */ + parseFloat = (function (origParseFloat) { + return function parseFloat(string) { + var inputString = trim(String(string)); + var result = origParseFloat(inputString); + return result === 0 && strSlice(inputString, 0, 1) === '-' ? -0 : result; + }; + }(parseFloat)); + } + + if (String(new RangeError('test')) !== 'RangeError: test') { + var errorToStringShim = function toString() { + if (typeof this === 'undefined' || this === null) { + throw new TypeError("can't convert " + this + ' to object'); + } + var name = this.name; + if (typeof name === 'undefined') { + name = 'Error'; + } else if (typeof name !== 'string') { + name = $String(name); + } + var msg = this.message; + if (typeof msg === 'undefined') { + msg = ''; + } else if (typeof msg !== 'string') { + msg = $String(msg); + } + if (!name) { + return msg; + } + if (!msg) { + return name; + } + return name + ': ' + msg; + }; + // can't use defineProperties here because of toString enumeration issue in IE <= 8 + Error.prototype.toString = errorToStringShim; + } + + if (supportsDescriptors) { + var ensureNonEnumerable = function (obj, prop) { + if (isEnum(obj, prop)) { + var desc = Object.getOwnPropertyDescriptor(obj, prop); + if (desc.configurable) { + desc.enumerable = false; + Object.defineProperty(obj, prop, desc); + } + } + }; + ensureNonEnumerable(Error.prototype, 'message'); + if (Error.prototype.message !== '') { + Error.prototype.message = ''; + } + ensureNonEnumerable(Error.prototype, 'name'); + } + + if (String(/a/mig) !== '/a/gim') { + var regexToString = function toString() { + var str = '/' + this.source + '/'; + if (this.global) { + str += 'g'; + } + if (this.ignoreCase) { + str += 'i'; + } + if (this.multiline) { + str += 'm'; + } + return str; + }; + // can't use defineProperties here because of toString enumeration issue in IE <= 8 + RegExp.prototype.toString = regexToString; + } +})); + + +/***/ }), + +/***/ "../../node_modules/es6-shim/es6-shim.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/es6-shim/es6-shim.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, process) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + * https://github.com/paulmillr/es6-shim + * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) + * and contributors, MIT License + * es6-shim: v0.35.4 + * see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE + * Details and documentation: + * https://github.com/paulmillr/es6-shim/ + */ + +// UMD (Universal Module Definition) +// see https://github.com/umdjs/umd/blob/master/returnExports.js +(function (root, factory) { + /*global define, module, exports */ + if (true) { + // AMD. Register as an anonymous module. + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(this, function () { + 'use strict'; + + var _apply = Function.call.bind(Function.apply); + var _call = Function.call.bind(Function.call); + var isArray = Array.isArray; + var keys = Object.keys; + + var not = function notThunker(func) { + return function notThunk() { + return !_apply(func, this, arguments); + }; + }; + var throwsError = function (func) { + try { + func(); + return false; + } catch (e) { + return true; + } + }; + var valueOrFalseIfThrows = function valueOrFalseIfThrows(func) { + try { + return func(); + } catch (e) { + return false; + } + }; + + var isCallableWithoutNew = not(throwsError); + var arePropertyDescriptorsSupported = function () { + // if Object.defineProperty exists but throws, it's IE 8 + return !throwsError(function () { + return Object.defineProperty({}, 'x', { get: function () { } }); // eslint-disable-line getter-return + }); + }; + var supportsDescriptors = !!Object.defineProperty && arePropertyDescriptorsSupported(); + var functionsHaveNames = (function foo() {}).name === 'foo'; // eslint-disable-line no-extra-parens + + var _forEach = Function.call.bind(Array.prototype.forEach); + var _reduce = Function.call.bind(Array.prototype.reduce); + var _filter = Function.call.bind(Array.prototype.filter); + var _some = Function.call.bind(Array.prototype.some); + + var defineProperty = function (object, name, value, force) { + if (!force && name in object) { return; } + if (supportsDescriptors) { + Object.defineProperty(object, name, { + configurable: true, + enumerable: false, + writable: true, + value: value + }); + } else { + object[name] = value; + } + }; + + // Define configurable, writable and non-enumerable props + // if they don’t exist. + var defineProperties = function (object, map, forceOverride) { + _forEach(keys(map), function (name) { + var method = map[name]; + defineProperty(object, name, method, !!forceOverride); + }); + }; + + var _toString = Function.call.bind(Object.prototype.toString); + var isCallable = false ? undefined : function IsCallableFast(x) { return typeof x === 'function'; }; + + var Value = { + getter: function (object, name, getter) { + if (!supportsDescriptors) { + throw new TypeError('getters require true ES5 support'); + } + Object.defineProperty(object, name, { + configurable: true, + enumerable: false, + get: getter + }); + }, + proxy: function (originalObject, key, targetObject) { + if (!supportsDescriptors) { + throw new TypeError('getters require true ES5 support'); + } + var originalDescriptor = Object.getOwnPropertyDescriptor(originalObject, key); + Object.defineProperty(targetObject, key, { + configurable: originalDescriptor.configurable, + enumerable: originalDescriptor.enumerable, + get: function getKey() { return originalObject[key]; }, + set: function setKey(value) { originalObject[key] = value; } + }); + }, + redefine: function (object, property, newValue) { + if (supportsDescriptors) { + var descriptor = Object.getOwnPropertyDescriptor(object, property); + descriptor.value = newValue; + Object.defineProperty(object, property, descriptor); + } else { + object[property] = newValue; + } + }, + defineByDescriptor: function (object, property, descriptor) { + if (supportsDescriptors) { + Object.defineProperty(object, property, descriptor); + } else if ('value' in descriptor) { + object[property] = descriptor.value; + } + }, + preserveToString: function (target, source) { + if (source && isCallable(source.toString)) { + defineProperty(target, 'toString', source.toString.bind(source), true); + } + } + }; + + // Simple shim for Object.create on ES3 browsers + // (unlike real shim, no attempt to support `prototype === null`) + var create = Object.create || function (prototype, properties) { + var Prototype = function Prototype() {}; + Prototype.prototype = prototype; + var object = new Prototype(); + if (typeof properties !== 'undefined') { + keys(properties).forEach(function (key) { + Value.defineByDescriptor(object, key, properties[key]); + }); + } + return object; + }; + + var supportsSubclassing = function (C, f) { + if (!Object.setPrototypeOf) { return false; /* skip test on IE < 11 */ } + return valueOrFalseIfThrows(function () { + var Sub = function Subclass(arg) { + var o = new C(arg); + Object.setPrototypeOf(o, Subclass.prototype); + return o; + }; + Object.setPrototypeOf(Sub, C); + Sub.prototype = create(C.prototype, { + constructor: { value: Sub } + }); + return f(Sub); + }); + }; + + var getGlobal = function () { + /* global self, window, global */ + // the only reliable means to get the global object is + // `Function('return this')()` + // However, this causes CSP violations in Chrome apps. + if (typeof self !== 'undefined') { return self; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + throw new Error('unable to locate global object'); + }; + + var globals = getGlobal(); + var globalIsFinite = globals.isFinite; + var _indexOf = Function.call.bind(String.prototype.indexOf); + var _arrayIndexOfApply = Function.apply.bind(Array.prototype.indexOf); + var _concat = Function.call.bind(Array.prototype.concat); + // var _sort = Function.call.bind(Array.prototype.sort); + var _strSlice = Function.call.bind(String.prototype.slice); + var _push = Function.call.bind(Array.prototype.push); + var _pushApply = Function.apply.bind(Array.prototype.push); + var _shift = Function.call.bind(Array.prototype.shift); + var _max = Math.max; + var _min = Math.min; + var _floor = Math.floor; + var _abs = Math.abs; + var _exp = Math.exp; + var _log = Math.log; + var _sqrt = Math.sqrt; + var _hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); + var ArrayIterator; // make our implementation private + var noop = function () {}; + + var OrigMap = globals.Map; + var origMapDelete = OrigMap && OrigMap.prototype['delete']; + var origMapGet = OrigMap && OrigMap.prototype.get; + var origMapHas = OrigMap && OrigMap.prototype.has; + var origMapSet = OrigMap && OrigMap.prototype.set; + + var Symbol = globals.Symbol || {}; + var symbolSpecies = Symbol.species || '@@species'; + + var numberIsNaN = Number.isNaN || function isNaN(value) { + // NaN !== NaN, but they are identical. + // NaNs are the only non-reflexive value, i.e., if x !== x, + // then x is NaN. + // isNaN is broken: it converts its argument to number, so + // isNaN('foo') => true + return value !== value; + }; + var numberIsFinite = Number.isFinite || function isFinite(value) { + return typeof value === 'number' && globalIsFinite(value); + }; + var _sign = isCallable(Math.sign) ? Math.sign : function sign(value) { + var number = Number(value); + if (number === 0) { return number; } + if (numberIsNaN(number)) { return number; } + return number < 0 ? -1 : 1; + }; + var _log1p = function log1p(value) { + var x = Number(value); + if (x < -1 || numberIsNaN(x)) { return NaN; } + if (x === 0 || x === Infinity) { return x; } + if (x === -1) { return -Infinity; } + + return (1 + x) - 1 === 0 ? x : x * (_log(1 + x) / ((1 + x) - 1)); + }; + + // taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js + // can be replaced with require('is-arguments') if we ever use a build process instead + var isStandardArguments = function isArguments(value) { + return _toString(value) === '[object Arguments]'; + }; + var isLegacyArguments = function isArguments(value) { + return value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + _toString(value) !== '[object Array]' && + _toString(value.callee) === '[object Function]'; + }; + var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments; + + var Type = { + primitive: function (x) { return x === null || (typeof x !== 'function' && typeof x !== 'object'); }, + string: function (x) { return _toString(x) === '[object String]'; }, + regex: function (x) { return _toString(x) === '[object RegExp]'; }, + symbol: function (x) { + return typeof globals.Symbol === 'function' && typeof x === 'symbol'; + } + }; + + var overrideNative = function overrideNative(object, property, replacement) { + var original = object[property]; + defineProperty(object, property, replacement, true); + Value.preserveToString(object[property], original); + }; + + // eslint-disable-next-line no-restricted-properties + var hasSymbols = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' && Type.symbol(Symbol()); + + // This is a private name in the es6 spec, equal to '[Symbol.iterator]' + // we're going to use an arbitrary _-prefixed name to make our shims + // work properly with each other, even though we don't have full Iterator + // support. That is, `Array.from(map.keys())` will work, but we don't + // pretend to export a "real" Iterator interface. + var $iterator$ = Type.symbol(Symbol.iterator) ? Symbol.iterator : '_es6-shim iterator_'; + // Firefox ships a partial implementation using the name @@iterator. + // https://bugzilla.mozilla.org/show_bug.cgi?id=907077#c14 + // So use that name if we detect it. + if (globals.Set && typeof new globals.Set()['@@iterator'] === 'function') { + $iterator$ = '@@iterator'; + } + + // Reflect + if (!globals.Reflect) { + defineProperty(globals, 'Reflect', {}, true); + } + var Reflect = globals.Reflect; + + var $String = String; + + /* global document */ + var domAll = (typeof document === 'undefined' || !document) ? null : document.all; + var isNullOrUndefined = domAll == null ? function isNullOrUndefined(x) { + return x == null; + } : function isNullOrUndefinedAndNotDocumentAll(x) { + return x == null && x !== domAll; + }; + + var ES = { + // http://www.ecma-international.org/ecma-262/6.0/#sec-call + Call: function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + if (!ES.IsCallable(F)) { + throw new TypeError(F + ' is not a function'); + } + return _apply(F, V, args); + }, + + RequireObjectCoercible: function (x, optMessage) { + if (isNullOrUndefined(x)) { + throw new TypeError(optMessage || 'Cannot call method on ' + x); + } + return x; + }, + + // This might miss the "(non-standard exotic and does not implement + // [[Call]])" case from + // http://www.ecma-international.org/ecma-262/6.0/#sec-typeof-operator-runtime-semantics-evaluation + // but we can't find any evidence these objects exist in practice. + // If we find some in the future, you could test `Object(x) === x`, + // which is reliable according to + // http://www.ecma-international.org/ecma-262/6.0/#sec-toobject + // but is not well optimized by runtimes and creates an object + // whenever it returns false, and thus is very slow. + TypeIsObject: function (x) { + if (x === void 0 || x === null || x === true || x === false) { + return false; + } + return typeof x === 'function' || typeof x === 'object' || x === domAll; + }, + + ToObject: function (o, optMessage) { + return Object(ES.RequireObjectCoercible(o, optMessage)); + }, + + IsCallable: isCallable, + + IsConstructor: function (x) { + // We can't tell callables from constructors in ES5 + return ES.IsCallable(x); + }, + + ToInt32: function (x) { + return ES.ToNumber(x) >> 0; + }, + + ToUint32: function (x) { + return ES.ToNumber(x) >>> 0; + }, + + ToNumber: function (value) { + if (_toString(value) === '[object Symbol]') { + throw new TypeError('Cannot convert a Symbol value to a number'); + } + return +value; + }, + + ToInteger: function (value) { + var number = ES.ToNumber(value); + if (numberIsNaN(number)) { return 0; } + if (number === 0 || !numberIsFinite(number)) { return number; } + return (number > 0 ? 1 : -1) * _floor(_abs(number)); + }, + + ToLength: function (value) { + var len = ES.ToInteger(value); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > Number.MAX_SAFE_INTEGER) { return Number.MAX_SAFE_INTEGER; } + return len; + }, + + SameValue: function (a, b) { + if (a === b) { + // 0 === -0, but they are not identical. + if (a === 0) { return 1 / a === 1 / b; } + return true; + } + return numberIsNaN(a) && numberIsNaN(b); + }, + + SameValueZero: function (a, b) { + // same as SameValue except for SameValueZero(+0, -0) == true + return (a === b) || (numberIsNaN(a) && numberIsNaN(b)); + }, + + IsIterable: function (o) { + return ES.TypeIsObject(o) && (typeof o[$iterator$] !== 'undefined' || isArguments(o)); + }, + + GetIterator: function (o) { + if (isArguments(o)) { + // special case support for `arguments` + return new ArrayIterator(o, 'value'); + } + var itFn = ES.GetMethod(o, $iterator$); + if (!ES.IsCallable(itFn)) { + // Better diagnostics if itFn is null or undefined + throw new TypeError('value is not an iterable'); + } + var it = ES.Call(itFn, o); + if (!ES.TypeIsObject(it)) { + throw new TypeError('bad iterator'); + } + return it; + }, + + GetMethod: function (o, p) { + var func = ES.ToObject(o)[p]; + if (isNullOrUndefined(func)) { + return void 0; + } + if (!ES.IsCallable(func)) { + throw new TypeError('Method not callable: ' + p); + } + return func; + }, + + IteratorComplete: function (iterResult) { + return !!iterResult.done; + }, + + IteratorClose: function (iterator, completionIsThrow) { + var returnMethod = ES.GetMethod(iterator, 'return'); + if (returnMethod === void 0) { + return; + } + var innerResult, innerException; + try { + innerResult = ES.Call(returnMethod, iterator); + } catch (e) { + innerException = e; + } + if (completionIsThrow) { + return; + } + if (innerException) { + throw innerException; + } + if (!ES.TypeIsObject(innerResult)) { + throw new TypeError("Iterator's return method returned a non-object."); + } + }, + + IteratorNext: function (it) { + var result = arguments.length > 1 ? it.next(arguments[1]) : it.next(); + if (!ES.TypeIsObject(result)) { + throw new TypeError('bad iterator'); + } + return result; + }, + + IteratorStep: function (it) { + var result = ES.IteratorNext(it); + var done = ES.IteratorComplete(result); + return done ? false : result; + }, + + Construct: function (C, args, newTarget, isES6internal) { + var target = typeof newTarget === 'undefined' ? C : newTarget; + + if (!isES6internal && Reflect.construct) { + // Try to use Reflect.construct if available + return Reflect.construct(C, args, target); + } + // OK, we have to fake it. This will only work if the + // C.[[ConstructorKind]] == "base" -- but that's the only + // kind we can make in ES5 code anyway. + + // OrdinaryCreateFromConstructor(target, "%ObjectPrototype%") + var proto = target.prototype; + if (!ES.TypeIsObject(proto)) { + proto = Object.prototype; + } + var obj = create(proto); + // Call the constructor. + var result = ES.Call(C, obj, args); + return ES.TypeIsObject(result) ? result : obj; + }, + + SpeciesConstructor: function (O, defaultConstructor) { + var C = O.constructor; + if (C === void 0) { + return defaultConstructor; + } + if (!ES.TypeIsObject(C)) { + throw new TypeError('Bad constructor'); + } + var S = C[symbolSpecies]; + if (isNullOrUndefined(S)) { + return defaultConstructor; + } + if (!ES.IsConstructor(S)) { + throw new TypeError('Bad @@species'); + } + return S; + }, + + CreateHTML: function (string, tag, attribute, value) { + var S = ES.ToString(string); + var p1 = '<' + tag; + if (attribute !== '') { + var V = ES.ToString(value); + var escapedV = V.replace(/"/g, '"'); + p1 += ' ' + attribute + '="' + escapedV + '"'; + } + var p2 = p1 + '>'; + var p3 = p2 + S; + return p3 + '</' + tag + '>'; + }, + + IsRegExp: function IsRegExp(argument) { + if (!ES.TypeIsObject(argument)) { + return false; + } + var isRegExp = argument[Symbol.match]; + if (typeof isRegExp !== 'undefined') { + return !!isRegExp; + } + return Type.regex(argument); + }, + + ToString: function ToString(string) { + return $String(string); + } + }; + + // Well-known Symbol shims + if (supportsDescriptors && hasSymbols) { + var defineWellKnownSymbol = function defineWellKnownSymbol(name) { + if (Type.symbol(Symbol[name])) { + return Symbol[name]; + } + // eslint-disable-next-line no-restricted-properties + var sym = Symbol['for']('Symbol.' + name); + Object.defineProperty(Symbol, name, { + configurable: false, + enumerable: false, + writable: false, + value: sym + }); + return sym; + }; + if (!Type.symbol(Symbol.search)) { + var symbolSearch = defineWellKnownSymbol('search'); + var originalSearch = String.prototype.search; + defineProperty(RegExp.prototype, symbolSearch, function search(string) { + return ES.Call(originalSearch, string, [this]); + }); + var searchShim = function search(regexp) { + var O = ES.RequireObjectCoercible(this); + if (!isNullOrUndefined(regexp)) { + var searcher = ES.GetMethod(regexp, symbolSearch); + if (typeof searcher !== 'undefined') { + return ES.Call(searcher, regexp, [O]); + } + } + return ES.Call(originalSearch, O, [ES.ToString(regexp)]); + }; + overrideNative(String.prototype, 'search', searchShim); + } + if (!Type.symbol(Symbol.replace)) { + var symbolReplace = defineWellKnownSymbol('replace'); + var originalReplace = String.prototype.replace; + defineProperty(RegExp.prototype, symbolReplace, function replace(string, replaceValue) { + return ES.Call(originalReplace, string, [this, replaceValue]); + }); + var replaceShim = function replace(searchValue, replaceValue) { + var O = ES.RequireObjectCoercible(this); + if (!isNullOrUndefined(searchValue)) { + var replacer = ES.GetMethod(searchValue, symbolReplace); + if (typeof replacer !== 'undefined') { + return ES.Call(replacer, searchValue, [O, replaceValue]); + } + } + return ES.Call(originalReplace, O, [ES.ToString(searchValue), replaceValue]); + }; + overrideNative(String.prototype, 'replace', replaceShim); + } + if (!Type.symbol(Symbol.split)) { + var symbolSplit = defineWellKnownSymbol('split'); + var originalSplit = String.prototype.split; + defineProperty(RegExp.prototype, symbolSplit, function split(string, limit) { + return ES.Call(originalSplit, string, [this, limit]); + }); + var splitShim = function split(separator, limit) { + var O = ES.RequireObjectCoercible(this); + if (!isNullOrUndefined(separator)) { + var splitter = ES.GetMethod(separator, symbolSplit); + if (typeof splitter !== 'undefined') { + return ES.Call(splitter, separator, [O, limit]); + } + } + return ES.Call(originalSplit, O, [ES.ToString(separator), limit]); + }; + overrideNative(String.prototype, 'split', splitShim); + } + var symbolMatchExists = Type.symbol(Symbol.match); + var stringMatchIgnoresSymbolMatch = symbolMatchExists && (function () { + // Firefox 41, through Nightly 45 has Symbol.match, but String#match ignores it. + // Firefox 40 and below have Symbol.match but String#match works fine. + var o = {}; + o[Symbol.match] = function () { return 42; }; + return 'a'.match(o) !== 42; + }()); + if (!symbolMatchExists || stringMatchIgnoresSymbolMatch) { + var symbolMatch = defineWellKnownSymbol('match'); + + var originalMatch = String.prototype.match; + defineProperty(RegExp.prototype, symbolMatch, function match(string) { + return ES.Call(originalMatch, string, [this]); + }); + + var matchShim = function match(regexp) { + var O = ES.RequireObjectCoercible(this); + if (!isNullOrUndefined(regexp)) { + var matcher = ES.GetMethod(regexp, symbolMatch); + if (typeof matcher !== 'undefined') { + return ES.Call(matcher, regexp, [O]); + } + } + return ES.Call(originalMatch, O, [ES.ToString(regexp)]); + }; + overrideNative(String.prototype, 'match', matchShim); + } + } + + var wrapConstructor = function wrapConstructor(original, replacement, keysToSkip) { + Value.preserveToString(replacement, original); + if (Object.setPrototypeOf) { + // sets up proper prototype chain where possible + Object.setPrototypeOf(original, replacement); + } + if (supportsDescriptors) { + _forEach(Object.getOwnPropertyNames(original), function (key) { + if (key in noop || keysToSkip[key]) { return; } + Value.proxy(original, key, replacement); + }); + } else { + _forEach(Object.keys(original), function (key) { + if (key in noop || keysToSkip[key]) { return; } + replacement[key] = original[key]; + }); + } + replacement.prototype = original.prototype; + Value.redefine(original.prototype, 'constructor', replacement); + }; + + var defaultSpeciesGetter = function () { return this; }; + var addDefaultSpecies = function (C) { + if (supportsDescriptors && !_hasOwnProperty(C, symbolSpecies)) { + Value.getter(C, symbolSpecies, defaultSpeciesGetter); + } + }; + + var addIterator = function (prototype, impl) { + var implementation = impl || function iterator() { return this; }; + defineProperty(prototype, $iterator$, implementation); + if (!prototype[$iterator$] && Type.symbol($iterator$)) { + // implementations are buggy when $iterator$ is a Symbol + prototype[$iterator$] = implementation; + } + }; + + var createDataProperty = function createDataProperty(object, name, value) { + if (supportsDescriptors) { + Object.defineProperty(object, name, { + configurable: true, + enumerable: true, + writable: true, + value: value + }); + } else { + object[name] = value; + } + }; + var createDataPropertyOrThrow = function createDataPropertyOrThrow(object, name, value) { + createDataProperty(object, name, value); + if (!ES.SameValue(object[name], value)) { + throw new TypeError('property is nonconfigurable'); + } + }; + + var emulateES6construct = function (o, defaultNewTarget, defaultProto, slots) { + // This is an es5 approximation to es6 construct semantics. in es6, + // 'new Foo' invokes Foo.[[Construct]] which (for almost all objects) + // just sets the internal variable NewTarget (in es6 syntax `new.target`) + // to Foo and then returns Foo(). + + // Many ES6 object then have constructors of the form: + // 1. If NewTarget is undefined, throw a TypeError exception + // 2. Let xxx by OrdinaryCreateFromConstructor(NewTarget, yyy, zzz) + + // So we're going to emulate those first two steps. + if (!ES.TypeIsObject(o)) { + throw new TypeError('Constructor requires `new`: ' + defaultNewTarget.name); + } + var proto = defaultNewTarget.prototype; + if (!ES.TypeIsObject(proto)) { + proto = defaultProto; + } + var obj = create(proto); + for (var name in slots) { + if (_hasOwnProperty(slots, name)) { + var value = slots[name]; + defineProperty(obj, name, value, true); + } + } + return obj; + }; + + // Firefox 31 reports this function's length as 0 + // https://bugzilla.mozilla.org/show_bug.cgi?id=1062484 + if (String.fromCodePoint && String.fromCodePoint.length !== 1) { + var originalFromCodePoint = String.fromCodePoint; + overrideNative(String, 'fromCodePoint', function fromCodePoint(codePoints) { + return ES.Call(originalFromCodePoint, this, arguments); + }); + } + + var StringShims = { + fromCodePoint: function fromCodePoint(codePoints) { + var result = []; + var next; + for (var i = 0, length = arguments.length; i < length; i++) { + next = Number(arguments[i]); + if (!ES.SameValue(next, ES.ToInteger(next)) || next < 0 || next > 0x10FFFF) { + throw new RangeError('Invalid code point ' + next); + } + + if (next < 0x10000) { + _push(result, String.fromCharCode(next)); + } else { + next -= 0x10000; + _push(result, String.fromCharCode((next >> 10) + 0xD800)); + _push(result, String.fromCharCode((next % 0x400) + 0xDC00)); + } + } + return result.join(''); + }, + + raw: function raw(callSite) { + var cooked = ES.ToObject(callSite, 'bad callSite'); + var rawString = ES.ToObject(cooked.raw, 'bad raw value'); + var len = rawString.length; + var literalsegments = ES.ToLength(len); + if (literalsegments <= 0) { + return ''; + } + + var stringElements = []; + var nextIndex = 0; + var nextKey, next, nextSeg, nextSub; + while (nextIndex < literalsegments) { + nextKey = ES.ToString(nextIndex); + nextSeg = ES.ToString(rawString[nextKey]); + _push(stringElements, nextSeg); + if (nextIndex + 1 >= literalsegments) { + break; + } + next = nextIndex + 1 < arguments.length ? arguments[nextIndex + 1] : ''; + nextSub = ES.ToString(next); + _push(stringElements, nextSub); + nextIndex += 1; + } + return stringElements.join(''); + } + }; + if (String.raw && String.raw({ raw: { 0: 'x', 1: 'y', length: 2 } }) !== 'xy') { + // IE 11 TP has a broken String.raw implementation + overrideNative(String, 'raw', StringShims.raw); + } + defineProperties(String, StringShims); + + // Fast repeat, uses the `Exponentiation by squaring` algorithm. + // Perf: http://jsperf.com/string-repeat2/2 + var stringRepeat = function repeat(s, times) { + if (times < 1) { return ''; } + if (times % 2) { return repeat(s, times - 1) + s; } + var half = repeat(s, times / 2); + return half + half; + }; + var stringMaxLength = Infinity; + + var StringPrototypeShims = { + repeat: function repeat(times) { + var thisStr = ES.ToString(ES.RequireObjectCoercible(this)); + var numTimes = ES.ToInteger(times); + if (numTimes < 0 || numTimes >= stringMaxLength) { + throw new RangeError('repeat count must be less than infinity and not overflow maximum string size'); + } + return stringRepeat(thisStr, numTimes); + }, + + startsWith: function startsWith(searchString) { + var S = ES.ToString(ES.RequireObjectCoercible(this)); + if (ES.IsRegExp(searchString)) { + throw new TypeError('Cannot call method "startsWith" with a regex'); + } + var searchStr = ES.ToString(searchString); + var position; + if (arguments.length > 1) { + position = arguments[1]; + } + var start = _max(ES.ToInteger(position), 0); + return _strSlice(S, start, start + searchStr.length) === searchStr; + }, + + endsWith: function endsWith(searchString) { + var S = ES.ToString(ES.RequireObjectCoercible(this)); + if (ES.IsRegExp(searchString)) { + throw new TypeError('Cannot call method "endsWith" with a regex'); + } + var searchStr = ES.ToString(searchString); + var len = S.length; + var endPosition; + if (arguments.length > 1) { + endPosition = arguments[1]; + } + var pos = typeof endPosition === 'undefined' ? len : ES.ToInteger(endPosition); + var end = _min(_max(pos, 0), len); + return _strSlice(S, end - searchStr.length, end) === searchStr; + }, + + includes: function includes(searchString) { + if (ES.IsRegExp(searchString)) { + throw new TypeError('"includes" does not accept a RegExp'); + } + var searchStr = ES.ToString(searchString); + var position; + if (arguments.length > 1) { + position = arguments[1]; + } + // Somehow this trick makes method 100% compat with the spec. + return _indexOf(this, searchStr, position) !== -1; + }, + + codePointAt: function codePointAt(pos) { + var thisStr = ES.ToString(ES.RequireObjectCoercible(this)); + var position = ES.ToInteger(pos); + var length = thisStr.length; + if (position >= 0 && position < length) { + var first = thisStr.charCodeAt(position); + var isEnd = position + 1 === length; + if (first < 0xD800 || first > 0xDBFF || isEnd) { return first; } + var second = thisStr.charCodeAt(position + 1); + if (second < 0xDC00 || second > 0xDFFF) { return first; } + return ((first - 0xD800) * 1024) + (second - 0xDC00) + 0x10000; + } + } + }; + if (String.prototype.includes && 'a'.includes('a', Infinity) !== false) { + overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); + } + + if (String.prototype.startsWith && String.prototype.endsWith) { + var startsWithRejectsRegex = throwsError(function () { + /* throws if spec-compliant */ + return '/a/'.startsWith(/a/); + }); + var startsWithHandlesInfinity = valueOrFalseIfThrows(function () { + return 'abc'.startsWith('a', Infinity) === false; + }); + if (!startsWithRejectsRegex || !startsWithHandlesInfinity) { + // Firefox (< 37?) and IE 11 TP have a noncompliant startsWith implementation + overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); + overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); + } + } + if (hasSymbols) { + var startsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () { + var re = /a/; + re[Symbol.match] = false; + return '/a/'.startsWith(re); + }); + if (!startsWithSupportsSymbolMatch) { + overrideNative(String.prototype, 'startsWith', StringPrototypeShims.startsWith); + } + var endsWithSupportsSymbolMatch = valueOrFalseIfThrows(function () { + var re = /a/; + re[Symbol.match] = false; + return '/a/'.endsWith(re); + }); + if (!endsWithSupportsSymbolMatch) { + overrideNative(String.prototype, 'endsWith', StringPrototypeShims.endsWith); + } + var includesSupportsSymbolMatch = valueOrFalseIfThrows(function () { + var re = /a/; + re[Symbol.match] = false; + return '/a/'.includes(re); + }); + if (!includesSupportsSymbolMatch) { + overrideNative(String.prototype, 'includes', StringPrototypeShims.includes); + } + } + + defineProperties(String.prototype, StringPrototypeShims); + + // whitespace from: http://es5.github.io/#x15.5.4.20 + // implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 + var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' + ].join(''); + var trimRegexp = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); + var trimShim = function trim() { + return ES.ToString(ES.RequireObjectCoercible(this)).replace(trimRegexp, ''); + }; + var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); + var nonWSregex = new RegExp('[' + nonWS + ']', 'g'); + var isBadHexRegex = /^[-+]0x[0-9a-f]+$/i; + var hasStringTrimBug = nonWS.trim().length !== nonWS.length; + defineProperty(String.prototype, 'trim', trimShim, hasStringTrimBug); + + // Given an argument x, it will return an IteratorResult object, + // with value set to x and done to false. + // Given no arguments, it will return an iterator completion object. + var iteratorResult = function (x) { + return { value: x, done: arguments.length === 0 }; + }; + + // see http://www.ecma-international.org/ecma-262/6.0/#sec-string.prototype-@@iterator + var StringIterator = function (s) { + ES.RequireObjectCoercible(s); + this._s = ES.ToString(s); + this._i = 0; + }; + StringIterator.prototype.next = function () { + var s = this._s; + var i = this._i; + if (typeof s === 'undefined' || i >= s.length) { + this._s = void 0; + return iteratorResult(); + } + var first = s.charCodeAt(i); + var second, len; + if (first < 0xD800 || first > 0xDBFF || (i + 1) === s.length) { + len = 1; + } else { + second = s.charCodeAt(i + 1); + len = (second < 0xDC00 || second > 0xDFFF) ? 1 : 2; + } + this._i = i + len; + return iteratorResult(s.substr(i, len)); + }; + addIterator(StringIterator.prototype); + addIterator(String.prototype, function () { + return new StringIterator(this); + }); + + var ArrayShims = { + from: function from(items) { + var C = this; + var mapFn; + if (arguments.length > 1) { + mapFn = arguments[1]; + } + var mapping, T; + if (typeof mapFn === 'undefined') { + mapping = false; + } else { + if (!ES.IsCallable(mapFn)) { + throw new TypeError('Array.from: when provided, the second argument must be a function'); + } + if (arguments.length > 2) { + T = arguments[2]; + } + mapping = true; + } + + // Note that that Arrays will use ArrayIterator: + // https://bugs.ecmascript.org/show_bug.cgi?id=2416 + var usingIterator = typeof (isArguments(items) || ES.GetMethod(items, $iterator$)) !== 'undefined'; + + var length, result, i; + if (usingIterator) { + result = ES.IsConstructor(C) ? Object(new C()) : []; + var iterator = ES.GetIterator(items); + var next, nextValue; + + i = 0; + while (true) { + next = ES.IteratorStep(iterator); + if (next === false) { + break; + } + nextValue = next.value; + try { + if (mapping) { + nextValue = typeof T === 'undefined' ? mapFn(nextValue, i) : _call(mapFn, T, nextValue, i); + } + result[i] = nextValue; + } catch (e) { + ES.IteratorClose(iterator, true); + throw e; + } + i += 1; + } + length = i; + } else { + var arrayLike = ES.ToObject(items); + length = ES.ToLength(arrayLike.length); + result = ES.IsConstructor(C) ? Object(new C(length)) : new Array(length); + var value; + for (i = 0; i < length; ++i) { + value = arrayLike[i]; + if (mapping) { + value = typeof T === 'undefined' ? mapFn(value, i) : _call(mapFn, T, value, i); + } + createDataPropertyOrThrow(result, i, value); + } + } + + result.length = length; + return result; + }, + + of: function of() { + var len = arguments.length; + var C = this; + var A = isArray(C) || !ES.IsCallable(C) ? new Array(len) : ES.Construct(C, [len]); + for (var k = 0; k < len; ++k) { + createDataPropertyOrThrow(A, k, arguments[k]); + } + A.length = len; + return A; + } + }; + defineProperties(Array, ArrayShims); + addDefaultSpecies(Array); + + // Our ArrayIterator is private; see + // https://github.com/paulmillr/es6-shim/issues/252 + ArrayIterator = function (array, kind) { + this.i = 0; + this.array = array; + this.kind = kind; + }; + + defineProperties(ArrayIterator.prototype, { + next: function () { + var i = this.i; + var array = this.array; + if (!(this instanceof ArrayIterator)) { + throw new TypeError('Not an ArrayIterator'); + } + if (typeof array !== 'undefined') { + var len = ES.ToLength(array.length); + for (; i < len; i++) { + var kind = this.kind; + var retval; + if (kind === 'key') { + retval = i; + } else if (kind === 'value') { + retval = array[i]; + } else if (kind === 'entry') { + retval = [i, array[i]]; + } + this.i = i + 1; + return iteratorResult(retval); + } + } + this.array = void 0; + return iteratorResult(); + } + }); + addIterator(ArrayIterator.prototype); + + /* + var orderKeys = function orderKeys(a, b) { + var aNumeric = String(ES.ToInteger(a)) === a; + var bNumeric = String(ES.ToInteger(b)) === b; + if (aNumeric && bNumeric) { + return b - a; + } else if (aNumeric && !bNumeric) { + return -1; + } else if (!aNumeric && bNumeric) { + return 1; + } else { + return a.localeCompare(b); + } + }; + + var getAllKeys = function getAllKeys(object) { + var ownKeys = []; + var keys = []; + + for (var key in object) { + _push(_hasOwnProperty(object, key) ? ownKeys : keys, key); + } + _sort(ownKeys, orderKeys); + _sort(keys, orderKeys); + + return _concat(ownKeys, keys); + }; + */ + + // note: this is positioned here because it depends on ArrayIterator + var arrayOfSupportsSubclassing = Array.of === ArrayShims.of || (function () { + // Detects a bug in Webkit nightly r181886 + var Foo = function Foo(len) { this.length = len; }; + Foo.prototype = []; + var fooArr = Array.of.apply(Foo, [1, 2]); + return fooArr instanceof Foo && fooArr.length === 2; + }()); + if (!arrayOfSupportsSubclassing) { + overrideNative(Array, 'of', ArrayShims.of); + } + + var ArrayPrototypeShims = { + copyWithin: function copyWithin(target, start) { + var o = ES.ToObject(this); + var len = ES.ToLength(o.length); + var relativeTarget = ES.ToInteger(target); + var relativeStart = ES.ToInteger(start); + var to = relativeTarget < 0 ? _max(len + relativeTarget, 0) : _min(relativeTarget, len); + var from = relativeStart < 0 ? _max(len + relativeStart, 0) : _min(relativeStart, len); + var end; + if (arguments.length > 2) { + end = arguments[2]; + } + var relativeEnd = typeof end === 'undefined' ? len : ES.ToInteger(end); + var finalItem = relativeEnd < 0 ? _max(len + relativeEnd, 0) : _min(relativeEnd, len); + var count = _min(finalItem - from, len - to); + var direction = 1; + if (from < to && to < (from + count)) { + direction = -1; + from += count - 1; + to += count - 1; + } + while (count > 0) { + if (from in o) { + o[to] = o[from]; + } else { + delete o[to]; + } + from += direction; + to += direction; + count -= 1; + } + return o; + }, + + fill: function fill(value) { + var start; + if (arguments.length > 1) { + start = arguments[1]; + } + var end; + if (arguments.length > 2) { + end = arguments[2]; + } + var O = ES.ToObject(this); + var len = ES.ToLength(O.length); + start = ES.ToInteger(typeof start === 'undefined' ? 0 : start); + end = ES.ToInteger(typeof end === 'undefined' ? len : end); + + var relativeStart = start < 0 ? _max(len + start, 0) : _min(start, len); + var relativeEnd = end < 0 ? len + end : end; + + for (var i = relativeStart; i < len && i < relativeEnd; ++i) { + O[i] = value; + } + return O; + }, + + find: function find(predicate) { + var list = ES.ToObject(this); + var length = ES.ToLength(list.length); + if (!ES.IsCallable(predicate)) { + throw new TypeError('Array#find: predicate must be a function'); + } + var thisArg = arguments.length > 1 ? arguments[1] : null; + for (var i = 0, value; i < length; i++) { + value = list[i]; + if (thisArg) { + if (_call(predicate, thisArg, value, i, list)) { + return value; + } + } else if (predicate(value, i, list)) { + return value; + } + } + }, + + findIndex: function findIndex(predicate) { + var list = ES.ToObject(this); + var length = ES.ToLength(list.length); + if (!ES.IsCallable(predicate)) { + throw new TypeError('Array#findIndex: predicate must be a function'); + } + var thisArg = arguments.length > 1 ? arguments[1] : null; + for (var i = 0; i < length; i++) { + if (thisArg) { + if (_call(predicate, thisArg, list[i], i, list)) { + return i; + } + } else if (predicate(list[i], i, list)) { + return i; + } + } + return -1; + }, + + keys: function keys() { + return new ArrayIterator(this, 'key'); + }, + + values: function values() { + return new ArrayIterator(this, 'value'); + }, + + entries: function entries() { + return new ArrayIterator(this, 'entry'); + } + }; + // Safari 7.1 defines Array#keys and Array#entries natively, + // but the resulting ArrayIterator objects don't have a "next" method. + if (Array.prototype.keys && !ES.IsCallable([1].keys().next)) { + delete Array.prototype.keys; + } + if (Array.prototype.entries && !ES.IsCallable([1].entries().next)) { + delete Array.prototype.entries; + } + + // Chrome 38 defines Array#keys and Array#entries, and Array#@@iterator, but not Array#values + if (Array.prototype.keys && Array.prototype.entries && !Array.prototype.values && Array.prototype[$iterator$]) { + defineProperties(Array.prototype, { + values: Array.prototype[$iterator$] + }); + if (Type.symbol(Symbol.unscopables)) { + Array.prototype[Symbol.unscopables].values = true; + } + } + // Chrome 40 defines Array#values with the incorrect name, although Array#{keys,entries} have the correct name + if (functionsHaveNames && Array.prototype.values && Array.prototype.values.name !== 'values') { + var originalArrayPrototypeValues = Array.prototype.values; + overrideNative(Array.prototype, 'values', function values() { return ES.Call(originalArrayPrototypeValues, this, arguments); }); + defineProperty(Array.prototype, $iterator$, Array.prototype.values, true); + } + defineProperties(Array.prototype, ArrayPrototypeShims); + + if (1 / [true].indexOf(true, -0) < 0) { + // indexOf when given a position arg of -0 should return +0. + // https://github.com/tc39/ecma262/pull/316 + defineProperty(Array.prototype, 'indexOf', function indexOf(searchElement) { + var value = _arrayIndexOfApply(this, arguments); + if (value === 0 && (1 / value) < 0) { + return 0; + } + return value; + }, true); + } + + addIterator(Array.prototype, function () { return this.values(); }); + // Chrome defines keys/values/entries on Array, but doesn't give us + // any way to identify its iterator. So add our own shimmed field. + if (Object.getPrototypeOf) { + addIterator(Object.getPrototypeOf([].values())); + } + + // note: this is positioned here because it relies on Array#entries + var arrayFromSwallowsNegativeLengths = (function () { + // Detects a Firefox bug in v32 + // https://bugzilla.mozilla.org/show_bug.cgi?id=1063993 + return valueOrFalseIfThrows(function () { + return Array.from({ length: -1 }).length === 0; + }); + }()); + var arrayFromHandlesIterables = (function () { + // Detects a bug in Webkit nightly r181886 + var arr = Array.from([0].entries()); + return arr.length === 1 && isArray(arr[0]) && arr[0][0] === 0 && arr[0][1] === 0; + }()); + if (!arrayFromSwallowsNegativeLengths || !arrayFromHandlesIterables) { + overrideNative(Array, 'from', ArrayShims.from); + } + var arrayFromHandlesUndefinedMapFunction = (function () { + // Microsoft Edge v0.11 throws if the mapFn argument is *provided* but undefined, + // but the spec doesn't care if it's provided or not - undefined doesn't throw. + return valueOrFalseIfThrows(function () { + return Array.from([0], void 0); + }); + }()); + if (!arrayFromHandlesUndefinedMapFunction) { + var origArrayFrom = Array.from; + overrideNative(Array, 'from', function from(items) { + if (arguments.length > 1 && typeof arguments[1] !== 'undefined') { + return ES.Call(origArrayFrom, this, arguments); + } else { + return _call(origArrayFrom, this, items); + } + }); + } + + var int32sAsOne = -(Math.pow(2, 32) - 1); + var toLengthsCorrectly = function (method, reversed) { + var obj = { length: int32sAsOne }; + obj[reversed ? (obj.length >>> 0) - 1 : 0] = true; + return valueOrFalseIfThrows(function () { + _call(method, obj, function () { + // note: in nonconforming browsers, this will be called + // -1 >>> 0 times, which is 4294967295, so the throw matters. + throw new RangeError('should not reach here'); + }, []); + return true; + }); + }; + if (!toLengthsCorrectly(Array.prototype.forEach)) { + var originalForEach = Array.prototype.forEach; + overrideNative(Array.prototype, 'forEach', function forEach(callbackFn) { + return ES.Call(originalForEach, this.length >= 0 ? this : [], arguments); + }, true); + } + if (!toLengthsCorrectly(Array.prototype.map)) { + var originalMap = Array.prototype.map; + overrideNative(Array.prototype, 'map', function map(callbackFn) { + return ES.Call(originalMap, this.length >= 0 ? this : [], arguments); + }, true); + } + if (!toLengthsCorrectly(Array.prototype.filter)) { + var originalFilter = Array.prototype.filter; + overrideNative(Array.prototype, 'filter', function filter(callbackFn) { + return ES.Call(originalFilter, this.length >= 0 ? this : [], arguments); + }, true); + } + if (!toLengthsCorrectly(Array.prototype.some)) { + var originalSome = Array.prototype.some; + overrideNative(Array.prototype, 'some', function some(callbackFn) { + return ES.Call(originalSome, this.length >= 0 ? this : [], arguments); + }, true); + } + if (!toLengthsCorrectly(Array.prototype.every)) { + var originalEvery = Array.prototype.every; + overrideNative(Array.prototype, 'every', function every(callbackFn) { + return ES.Call(originalEvery, this.length >= 0 ? this : [], arguments); + }, true); + } + if (!toLengthsCorrectly(Array.prototype.reduce)) { + var originalReduce = Array.prototype.reduce; + overrideNative(Array.prototype, 'reduce', function reduce(callbackFn) { + return ES.Call(originalReduce, this.length >= 0 ? this : [], arguments); + }, true); + } + if (!toLengthsCorrectly(Array.prototype.reduceRight, true)) { + var originalReduceRight = Array.prototype.reduceRight; + overrideNative(Array.prototype, 'reduceRight', function reduceRight(callbackFn) { + return ES.Call(originalReduceRight, this.length >= 0 ? this : [], arguments); + }, true); + } + + var lacksOctalSupport = Number('0o10') !== 8; + var lacksBinarySupport = Number('0b10') !== 2; + var trimsNonWhitespace = _some(nonWS, function (c) { + return Number(c + 0 + c) === 0; + }); + if (lacksOctalSupport || lacksBinarySupport || trimsNonWhitespace) { + var OrigNumber = Number; + var binaryRegex = /^0b[01]+$/i; + var octalRegex = /^0o[0-7]+$/i; + // Note that in IE 8, RegExp.prototype.test doesn't seem to exist: ie, "test" is an own property of regexes. wtf. + var isBinary = binaryRegex.test.bind(binaryRegex); + var isOctal = octalRegex.test.bind(octalRegex); + var toPrimitive = function (O) { // need to replace this with `es-to-primitive/es6` + var result; + if (typeof O.valueOf === 'function') { + result = O.valueOf(); + if (Type.primitive(result)) { + return result; + } + } + if (typeof O.toString === 'function') { + result = O.toString(); + if (Type.primitive(result)) { + return result; + } + } + throw new TypeError('No default value'); + }; + var hasNonWS = nonWSregex.test.bind(nonWSregex); + var isBadHex = isBadHexRegex.test.bind(isBadHexRegex); + var NumberShim = (function () { + // this is wrapped in an IIFE because of IE 6-8's wacky scoping issues with named function expressions. + var NumberShim = function Number(value) { + var primValue; + if (arguments.length > 0) { + primValue = Type.primitive(value) ? value : toPrimitive(value, 'number'); + } else { + primValue = 0; + } + if (typeof primValue === 'string') { + primValue = ES.Call(trimShim, primValue); + if (isBinary(primValue)) { + primValue = parseInt(_strSlice(primValue, 2), 2); + } else if (isOctal(primValue)) { + primValue = parseInt(_strSlice(primValue, 2), 8); + } else if (hasNonWS(primValue) || isBadHex(primValue)) { + primValue = NaN; + } + } + var receiver = this; + var valueOfSucceeds = valueOrFalseIfThrows(function () { + OrigNumber.prototype.valueOf.call(receiver); + return true; + }); + if (receiver instanceof NumberShim && !valueOfSucceeds) { + return new OrigNumber(primValue); + } + return OrigNumber(primValue); + }; + return NumberShim; + }()); + wrapConstructor(OrigNumber, NumberShim, {}); + // this is necessary for ES3 browsers, where these properties are non-enumerable. + defineProperties(NumberShim, { + NaN: OrigNumber.NaN, + MAX_VALUE: OrigNumber.MAX_VALUE, + MIN_VALUE: OrigNumber.MIN_VALUE, + NEGATIVE_INFINITY: OrigNumber.NEGATIVE_INFINITY, + POSITIVE_INFINITY: OrigNumber.POSITIVE_INFINITY + }); + /* globals Number: true */ + /* eslint-disable no-undef, no-global-assign */ + Number = NumberShim; + Value.redefine(globals, 'Number', NumberShim); + /* eslint-enable no-undef, no-global-assign */ + /* globals Number: false */ + } + + var maxSafeInteger = Math.pow(2, 53) - 1; + defineProperties(Number, { + MAX_SAFE_INTEGER: maxSafeInteger, + MIN_SAFE_INTEGER: -maxSafeInteger, + EPSILON: 2.220446049250313e-16, + + parseInt: globals.parseInt, + parseFloat: globals.parseFloat, + + isFinite: numberIsFinite, + + isInteger: function isInteger(value) { + return numberIsFinite(value) && ES.ToInteger(value) === value; + }, + + isSafeInteger: function isSafeInteger(value) { + return Number.isInteger(value) && _abs(value) <= Number.MAX_SAFE_INTEGER; + }, + + isNaN: numberIsNaN + }); + // Firefox 37 has a conforming Number.parseInt, but it's not === to the global parseInt (fixed in v40) + defineProperty(Number, 'parseInt', globals.parseInt, Number.parseInt !== globals.parseInt); + + // Work around bugs in Array#find and Array#findIndex -- early + // implementations skipped holes in sparse arrays. (Note that the + // implementations of find/findIndex indirectly use shimmed + // methods of Number, so this test has to happen down here.) + /* eslint-disable no-sparse-arrays */ + if ([, 1].find(function () { return true; }) === 1) { + overrideNative(Array.prototype, 'find', ArrayPrototypeShims.find); + } + if ([, 1].findIndex(function () { return true; }) !== 0) { + overrideNative(Array.prototype, 'findIndex', ArrayPrototypeShims.findIndex); + } + /* eslint-enable no-sparse-arrays */ + + var isEnumerableOn = Function.bind.call(Function.bind, Object.prototype.propertyIsEnumerable); + var ensureEnumerable = function ensureEnumerable(obj, prop) { + if (supportsDescriptors && isEnumerableOn(obj, prop)) { + Object.defineProperty(obj, prop, { enumerable: false }); + } + }; + var sliceArgs = function sliceArgs() { + // per https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments + // and https://gist.github.com/WebReflection/4327762cb87a8c634a29 + var initial = Number(this); + var len = arguments.length; + var desiredArgCount = len - initial; + var args = new Array(desiredArgCount < 0 ? 0 : desiredArgCount); + for (var i = initial; i < len; ++i) { + args[i - initial] = arguments[i]; + } + return args; + }; + var assignTo = function assignTo(source) { + return function assignToSource(target, key) { + target[key] = source[key]; + return target; + }; + }; + var assignReducer = function (target, source) { + var sourceKeys = keys(Object(source)); + var symbols; + if (ES.IsCallable(Object.getOwnPropertySymbols)) { + symbols = _filter(Object.getOwnPropertySymbols(Object(source)), isEnumerableOn(source)); + } + return _reduce(_concat(sourceKeys, symbols || []), assignTo(source), target); + }; + + var ObjectShims = { + // 19.1.3.1 + assign: function (target, source) { + var to = ES.ToObject(target, 'Cannot convert undefined or null to object'); + return _reduce(ES.Call(sliceArgs, 1, arguments), assignReducer, to); + }, + + // Added in WebKit in https://bugs.webkit.org/show_bug.cgi?id=143865 + is: function is(a, b) { + return ES.SameValue(a, b); + } + }; + var assignHasPendingExceptions = Object.assign && Object.preventExtensions && (function () { + // Firefox 37 still has "pending exception" logic in its Object.assign implementation, + // which is 72% slower than our shim, and Firefox 40's native implementation. + var thrower = Object.preventExtensions({ 1: 2 }); + try { + Object.assign(thrower, 'xy'); + } catch (e) { + return thrower[1] === 'y'; + } + }()); + if (assignHasPendingExceptions) { + overrideNative(Object, 'assign', ObjectShims.assign); + } + defineProperties(Object, ObjectShims); + + if (supportsDescriptors) { + var ES5ObjectShims = { + // 19.1.3.9 + // shim from https://gist.github.com/WebReflection/5593554 + setPrototypeOf: (function (Object, magic) { + var set; + + var checkArgs = function (O, proto) { + if (!ES.TypeIsObject(O)) { + throw new TypeError('cannot set prototype on a non-object'); + } + if (!(proto === null || ES.TypeIsObject(proto))) { + throw new TypeError('can only set prototype to an object or null' + proto); + } + }; + + var setPrototypeOf = function (O, proto) { + checkArgs(O, proto); + _call(set, O, proto); + return O; + }; + + try { + // this works already in Firefox and Safari + set = Object.getOwnPropertyDescriptor(Object.prototype, magic).set; + _call(set, {}, null); + } catch (e) { + if (Object.prototype !== {}[magic]) { + // IE < 11 cannot be shimmed + return; + } + // probably Chrome or some old Mobile stock browser + set = function (proto) { + this[magic] = proto; + }; + // please note that this will **not** work + // in those browsers that do not inherit + // __proto__ by mistake from Object.prototype + // in these cases we should probably throw an error + // or at least be informed about the issue + setPrototypeOf.polyfill = setPrototypeOf( + setPrototypeOf({}, null), + Object.prototype + ) instanceof Object; + // setPrototypeOf.polyfill === true means it works as meant + // setPrototypeOf.polyfill === false means it's not 100% reliable + // setPrototypeOf.polyfill === undefined + // or + // setPrototypeOf.polyfill == null means it's not a polyfill + // which means it works as expected + // we can even delete Object.prototype.__proto__; + } + return setPrototypeOf; + }(Object, '__proto__')) + }; + + defineProperties(Object, ES5ObjectShims); + } + + // Workaround bug in Opera 12 where setPrototypeOf(x, null) doesn't work, + // but Object.create(null) does. + if (Object.setPrototypeOf && Object.getPrototypeOf && + Object.getPrototypeOf(Object.setPrototypeOf({}, null)) !== null && + Object.getPrototypeOf(Object.create(null)) === null) { + (function () { + var FAKENULL = Object.create(null); + var gpo = Object.getPrototypeOf; + var spo = Object.setPrototypeOf; + Object.getPrototypeOf = function (o) { + var result = gpo(o); + return result === FAKENULL ? null : result; + }; + Object.setPrototypeOf = function (o, p) { + var proto = p === null ? FAKENULL : p; + return spo(o, proto); + }; + Object.setPrototypeOf.polyfill = false; + }()); + } + + var objectKeysAcceptsPrimitives = !throwsError(function () { return Object.keys('foo'); }); + if (!objectKeysAcceptsPrimitives) { + var originalObjectKeys = Object.keys; + overrideNative(Object, 'keys', function keys(value) { + return originalObjectKeys(ES.ToObject(value)); + }); + keys = Object.keys; + } + var objectKeysRejectsRegex = throwsError(function () { return Object.keys(/a/g); }); + if (objectKeysRejectsRegex) { + var regexRejectingObjectKeys = Object.keys; + overrideNative(Object, 'keys', function keys(value) { + if (Type.regex(value)) { + var regexKeys = []; + for (var k in value) { + if (_hasOwnProperty(value, k)) { + _push(regexKeys, k); + } + } + return regexKeys; + } + return regexRejectingObjectKeys(value); + }); + keys = Object.keys; + } + + if (Object.getOwnPropertyNames) { + var objectGOPNAcceptsPrimitives = !throwsError(function () { return Object.getOwnPropertyNames('foo'); }); + if (!objectGOPNAcceptsPrimitives) { + var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : []; + var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames; + overrideNative(Object, 'getOwnPropertyNames', function getOwnPropertyNames(value) { + var val = ES.ToObject(value); + if (_toString(val) === '[object Window]') { + try { + return originalObjectGetOwnPropertyNames(val); + } catch (e) { + // IE bug where layout engine calls userland gOPN for cross-domain `window` objects + return _concat([], cachedWindowNames); + } + } + return originalObjectGetOwnPropertyNames(val); + }); + } + } + if (Object.getOwnPropertyDescriptor) { + var objectGOPDAcceptsPrimitives = !throwsError(function () { return Object.getOwnPropertyDescriptor('foo', 'bar'); }); + if (!objectGOPDAcceptsPrimitives) { + var originalObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + overrideNative(Object, 'getOwnPropertyDescriptor', function getOwnPropertyDescriptor(value, property) { + return originalObjectGetOwnPropertyDescriptor(ES.ToObject(value), property); + }); + } + } + if (Object.seal) { + var objectSealAcceptsPrimitives = !throwsError(function () { return Object.seal('foo'); }); + if (!objectSealAcceptsPrimitives) { + var originalObjectSeal = Object.seal; + overrideNative(Object, 'seal', function seal(value) { + if (!ES.TypeIsObject(value)) { return value; } + return originalObjectSeal(value); + }); + } + } + if (Object.isSealed) { + var objectIsSealedAcceptsPrimitives = !throwsError(function () { return Object.isSealed('foo'); }); + if (!objectIsSealedAcceptsPrimitives) { + var originalObjectIsSealed = Object.isSealed; + overrideNative(Object, 'isSealed', function isSealed(value) { + if (!ES.TypeIsObject(value)) { return true; } + return originalObjectIsSealed(value); + }); + } + } + if (Object.freeze) { + var objectFreezeAcceptsPrimitives = !throwsError(function () { return Object.freeze('foo'); }); + if (!objectFreezeAcceptsPrimitives) { + var originalObjectFreeze = Object.freeze; + overrideNative(Object, 'freeze', function freeze(value) { + if (!ES.TypeIsObject(value)) { return value; } + return originalObjectFreeze(value); + }); + } + } + if (Object.isFrozen) { + var objectIsFrozenAcceptsPrimitives = !throwsError(function () { return Object.isFrozen('foo'); }); + if (!objectIsFrozenAcceptsPrimitives) { + var originalObjectIsFrozen = Object.isFrozen; + overrideNative(Object, 'isFrozen', function isFrozen(value) { + if (!ES.TypeIsObject(value)) { return true; } + return originalObjectIsFrozen(value); + }); + } + } + if (Object.preventExtensions) { + var objectPreventExtensionsAcceptsPrimitives = !throwsError(function () { return Object.preventExtensions('foo'); }); + if (!objectPreventExtensionsAcceptsPrimitives) { + var originalObjectPreventExtensions = Object.preventExtensions; + overrideNative(Object, 'preventExtensions', function preventExtensions(value) { + if (!ES.TypeIsObject(value)) { return value; } + return originalObjectPreventExtensions(value); + }); + } + } + if (Object.isExtensible) { + var objectIsExtensibleAcceptsPrimitives = !throwsError(function () { return Object.isExtensible('foo'); }); + if (!objectIsExtensibleAcceptsPrimitives) { + var originalObjectIsExtensible = Object.isExtensible; + overrideNative(Object, 'isExtensible', function isExtensible(value) { + if (!ES.TypeIsObject(value)) { return false; } + return originalObjectIsExtensible(value); + }); + } + } + if (Object.getPrototypeOf) { + var objectGetProtoAcceptsPrimitives = !throwsError(function () { return Object.getPrototypeOf('foo'); }); + if (!objectGetProtoAcceptsPrimitives) { + var originalGetProto = Object.getPrototypeOf; + overrideNative(Object, 'getPrototypeOf', function getPrototypeOf(value) { + return originalGetProto(ES.ToObject(value)); + }); + } + } + + var hasFlags = supportsDescriptors && (function () { + var desc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags'); + return desc && ES.IsCallable(desc.get); + }()); + if (supportsDescriptors && !hasFlags) { + var regExpFlagsGetter = function flags() { + if (!ES.TypeIsObject(this)) { + throw new TypeError('Method called on incompatible type: must be an object.'); + } + var result = ''; + if (this.global) { + result += 'g'; + } + if (this.ignoreCase) { + result += 'i'; + } + if (this.multiline) { + result += 'm'; + } + if (this.unicode) { + result += 'u'; + } + if (this.sticky) { + result += 'y'; + } + return result; + }; + + Value.getter(RegExp.prototype, 'flags', regExpFlagsGetter); + } + + var regExpSupportsFlagsWithRegex = supportsDescriptors && valueOrFalseIfThrows(function () { + return String(new RegExp(/a/g, 'i')) === '/a/i'; + }); + var regExpNeedsToSupportSymbolMatch = hasSymbols && supportsDescriptors && (function () { + // Edge 0.12 supports flags fully, but does not support Symbol.match + var regex = /./; + regex[Symbol.match] = false; + return RegExp(regex) === regex; + }()); + + var regexToStringIsGeneric = valueOrFalseIfThrows(function () { + return RegExp.prototype.toString.call({ source: 'abc' }) === '/abc/'; + }); + var regexToStringSupportsGenericFlags = regexToStringIsGeneric && valueOrFalseIfThrows(function () { + return RegExp.prototype.toString.call({ source: 'a', flags: 'b' }) === '/a/b'; + }); + if (!regexToStringIsGeneric || !regexToStringSupportsGenericFlags) { + var origRegExpToString = RegExp.prototype.toString; + defineProperty(RegExp.prototype, 'toString', function toString() { + var R = ES.RequireObjectCoercible(this); + if (Type.regex(R)) { + return _call(origRegExpToString, R); + } + var pattern = $String(R.source); + var flags = $String(R.flags); + return '/' + pattern + '/' + flags; + }, true); + Value.preserveToString(RegExp.prototype.toString, origRegExpToString); + } + + if (supportsDescriptors && (!regExpSupportsFlagsWithRegex || regExpNeedsToSupportSymbolMatch)) { + var flagsGetter = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get; + var sourceDesc = Object.getOwnPropertyDescriptor(RegExp.prototype, 'source') || {}; + var legacySourceGetter = function () { + // prior to it being a getter, it's own + nonconfigurable + return this.source; + }; + var sourceGetter = ES.IsCallable(sourceDesc.get) ? sourceDesc.get : legacySourceGetter; + + var OrigRegExp = RegExp; + var RegExpShim = (function () { + return function RegExp(pattern, flags) { + var patternIsRegExp = ES.IsRegExp(pattern); + var calledWithNew = this instanceof RegExp; + if (!calledWithNew && patternIsRegExp && typeof flags === 'undefined' && pattern.constructor === RegExp) { + return pattern; + } + + var P = pattern; + var F = flags; + if (Type.regex(pattern)) { + P = ES.Call(sourceGetter, pattern); + F = typeof flags === 'undefined' ? ES.Call(flagsGetter, pattern) : flags; + return new RegExp(P, F); + } else if (patternIsRegExp) { + P = pattern.source; + F = typeof flags === 'undefined' ? pattern.flags : flags; + } + return new OrigRegExp(pattern, flags); + }; + }()); + wrapConstructor(OrigRegExp, RegExpShim, { + $input: true // Chrome < v39 & Opera < 26 have a nonstandard "$input" property + }); + /* globals RegExp: true */ + /* eslint-disable no-undef, no-global-assign */ + RegExp = RegExpShim; + Value.redefine(globals, 'RegExp', RegExpShim); + /* eslint-enable no-undef, no-global-assign */ + /* globals RegExp: false */ + } + + if (supportsDescriptors) { + var regexGlobals = { + input: '$_', + lastMatch: '$&', + lastParen: '$+', + leftContext: '$`', + rightContext: '$\'' + }; + _forEach(keys(regexGlobals), function (prop) { + if (prop in RegExp && !(regexGlobals[prop] in RegExp)) { + Value.getter(RegExp, regexGlobals[prop], function get() { + return RegExp[prop]; + }); + } + }); + } + addDefaultSpecies(RegExp); + + var inverseEpsilon = 1 / Number.EPSILON; + var roundTiesToEven = function roundTiesToEven(n) { + // Even though this reduces down to `return n`, it takes advantage of built-in rounding. + return (n + inverseEpsilon) - inverseEpsilon; + }; + var BINARY_32_EPSILON = Math.pow(2, -23); + var BINARY_32_MAX_VALUE = Math.pow(2, 127) * (2 - BINARY_32_EPSILON); + var BINARY_32_MIN_VALUE = Math.pow(2, -126); + var E = Math.E; + var LOG2E = Math.LOG2E; + var LOG10E = Math.LOG10E; + var numberCLZ = Number.prototype.clz; + delete Number.prototype.clz; // Safari 8 has Number#clz + + var MathShims = { + acosh: function acosh(value) { + var x = Number(value); + if (numberIsNaN(x) || value < 1) { return NaN; } + if (x === 1) { return 0; } + if (x === Infinity) { return x; } + + var xInvSquared = 1 / (x * x); + if (x < 2) { + return _log1p(x - 1 + (_sqrt(1 - xInvSquared) * x)); + } + var halfX = x / 2; + return _log1p(halfX + (_sqrt(1 - xInvSquared) * halfX) - 1) + (1 / LOG2E); + }, + + asinh: function asinh(value) { + var x = Number(value); + if (x === 0 || !globalIsFinite(x)) { + return x; + } + + var a = _abs(x); + var aSquared = a * a; + var s = _sign(x); + if (a < 1) { + return s * _log1p(a + (aSquared / (_sqrt(aSquared + 1) + 1))); + } + return s * (_log1p((a / 2) + (_sqrt(1 + (1 / aSquared)) * a / 2) - 1) + (1 / LOG2E)); + }, + + atanh: function atanh(value) { + var x = Number(value); + + if (x === 0) { return x; } + if (x === -1) { return -Infinity; } + if (x === 1) { return Infinity; } + if (numberIsNaN(x) || x < -1 || x > 1) { + return NaN; + } + + var a = _abs(x); + return _sign(x) * _log1p(2 * a / (1 - a)) / 2; + }, + + cbrt: function cbrt(value) { + var x = Number(value); + if (x === 0) { return x; } + var negate = x < 0; + var result; + if (negate) { x = -x; } + if (x === Infinity) { + result = Infinity; + } else { + result = _exp(_log(x) / 3); + // from http://en.wikipedia.org/wiki/Cube_root#Numerical_methods + result = ((x / (result * result)) + (2 * result)) / 3; + } + return negate ? -result : result; + }, + + clz32: function clz32(value) { + // See https://bugs.ecmascript.org/show_bug.cgi?id=2465 + var x = Number(value); + var number = ES.ToUint32(x); + if (number === 0) { + return 32; + } + return numberCLZ ? ES.Call(numberCLZ, number) : 31 - _floor(_log(number + 0.5) * LOG2E); + }, + + cosh: function cosh(value) { + var x = Number(value); + if (x === 0) { return 1; } // +0 or -0 + if (numberIsNaN(x)) { return NaN; } + if (!globalIsFinite(x)) { return Infinity; } + + var t = _exp(_abs(x) - 1); + return (t + (1 / (t * E * E))) * (E / 2); + }, + + expm1: function expm1(value) { + var x = Number(value); + if (x === -Infinity) { return -1; } + if (!globalIsFinite(x) || x === 0) { return x; } + if (_abs(x) > 0.5) { + return _exp(x) - 1; + } + // A more precise approximation using Taylor series expansion + // from https://github.com/paulmillr/es6-shim/issues/314#issuecomment-70293986 + var t = x; + var sum = 0; + var n = 1; + while (sum + t !== sum) { + sum += t; + n += 1; + t *= x / n; + } + return sum; + }, + + hypot: function hypot(x, y) { + var result = 0; + var largest = 0; + for (var i = 0; i < arguments.length; ++i) { + var value = _abs(Number(arguments[i])); + if (largest < value) { + result *= (largest / value) * (largest / value); + result += 1; + largest = value; + } else { + result += value > 0 ? (value / largest) * (value / largest) : value; + } + } + return largest === Infinity ? Infinity : largest * _sqrt(result); + }, + + log2: function log2(value) { + return _log(value) * LOG2E; + }, + + log10: function log10(value) { + return _log(value) * LOG10E; + }, + + log1p: _log1p, + + sign: _sign, + + sinh: function sinh(value) { + var x = Number(value); + if (!globalIsFinite(x) || x === 0) { return x; } + + var a = _abs(x); + if (a < 1) { + var u = Math.expm1(a); + return _sign(x) * u * (1 + (1 / (u + 1))) / 2; + } + var t = _exp(a - 1); + return _sign(x) * (t - (1 / (t * E * E))) * (E / 2); + }, + + tanh: function tanh(value) { + var x = Number(value); + if (numberIsNaN(x) || x === 0) { return x; } + // can exit early at +-20 as JS loses precision for true value at this integer + if (x >= 20) { return 1; } + if (x <= -20) { return -1; } + + return (Math.expm1(x) - Math.expm1(-x)) / (_exp(x) + _exp(-x)); + }, + + trunc: function trunc(value) { + var x = Number(value); + return x < 0 ? -_floor(-x) : _floor(x); + }, + + imul: function imul(x, y) { + // taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul + var a = ES.ToUint32(x); + var b = ES.ToUint32(y); + var ah = (a >>> 16) & 0xffff; + var al = a & 0xffff; + var bh = (b >>> 16) & 0xffff; + var bl = b & 0xffff; + // the shift by 0 fixes the sign on the high part + // the final |0 converts the unsigned value into a signed value + return (al * bl) + ((((ah * bl) + (al * bh)) << 16) >>> 0) | 0; + }, + + fround: function fround(x) { + var v = Number(x); + if (v === 0 || v === Infinity || v === -Infinity || numberIsNaN(v)) { + return v; + } + var sign = _sign(v); + var abs = _abs(v); + if (abs < BINARY_32_MIN_VALUE) { + return sign * roundTiesToEven(abs / BINARY_32_MIN_VALUE / BINARY_32_EPSILON) * BINARY_32_MIN_VALUE * BINARY_32_EPSILON; + } + // Veltkamp's splitting (?) + var a = (1 + (BINARY_32_EPSILON / Number.EPSILON)) * abs; + var result = a - (a - abs); + if (result > BINARY_32_MAX_VALUE || numberIsNaN(result)) { + return sign * Infinity; + } + return sign * result; + } + }; + + var withinULPDistance = function withinULPDistance(result, expected, distance) { + return _abs(1 - (result / expected)) / Number.EPSILON < (distance || 8); + }; + + defineProperties(Math, MathShims); + // Chrome < 40 sinh returns ∞ for large numbers + defineProperty(Math, 'sinh', MathShims.sinh, Math.sinh(710) === Infinity); + // Chrome < 40 cosh returns ∞ for large numbers + defineProperty(Math, 'cosh', MathShims.cosh, Math.cosh(710) === Infinity); + // IE 11 TP has an imprecise log1p: reports Math.log1p(-1e-17) as 0 + defineProperty(Math, 'log1p', MathShims.log1p, Math.log1p(-1e-17) !== -1e-17); + // IE 11 TP has an imprecise asinh: reports Math.asinh(-1e7) as not exactly equal to -Math.asinh(1e7) + defineProperty(Math, 'asinh', MathShims.asinh, Math.asinh(-1e7) !== -Math.asinh(1e7)); + // Chrome < 54 asinh returns ∞ for large numbers and should not + defineProperty(Math, 'asinh', MathShims.asinh, Math.asinh(1e+300) === Infinity); + // Chrome < 54 atanh incorrectly returns 0 for large numbers + defineProperty(Math, 'atanh', MathShims.atanh, Math.atanh(1e-300) === 0); + // Chrome 40 has an imprecise Math.tanh with very small numbers + defineProperty(Math, 'tanh', MathShims.tanh, Math.tanh(-2e-17) !== -2e-17); + // Chrome 40 loses Math.acosh precision with high numbers + defineProperty(Math, 'acosh', MathShims.acosh, Math.acosh(Number.MAX_VALUE) === Infinity); + // Chrome < 54 has an inaccurate acosh for EPSILON deltas + defineProperty(Math, 'acosh', MathShims.acosh, !withinULPDistance(Math.acosh(1 + Number.EPSILON), Math.sqrt(2 * Number.EPSILON))); + // Firefox 38 on Windows + defineProperty(Math, 'cbrt', MathShims.cbrt, !withinULPDistance(Math.cbrt(1e-300), 1e-100)); + // node 0.11 has an imprecise Math.sinh with very small numbers + defineProperty(Math, 'sinh', MathShims.sinh, Math.sinh(-2e-17) !== -2e-17); + // FF 35 on Linux reports 22025.465794806725 for Math.expm1(10) + var expm1OfTen = Math.expm1(10); + defineProperty(Math, 'expm1', MathShims.expm1, expm1OfTen > 22025.465794806719 || expm1OfTen < 22025.4657948067165168); + + var origMathRound = Math.round; + // breaks in e.g. Safari 8, Internet Explorer 11, Opera 12 + var roundHandlesBoundaryConditions = Math.round(0.5 - (Number.EPSILON / 4)) === 0 && + Math.round(-0.5 + (Number.EPSILON / 3.99)) === 1; + + // When engines use Math.floor(x + 0.5) internally, Math.round can be buggy for large integers. + // This behavior should be governed by "round to nearest, ties to even mode" + // see http://www.ecma-international.org/ecma-262/6.0/#sec-terms-and-definitions-number-type + // These are the boundary cases where it breaks. + var smallestPositiveNumberWhereRoundBreaks = inverseEpsilon + 1; + var largestPositiveNumberWhereRoundBreaks = (2 * inverseEpsilon) - 1; + var roundDoesNotIncreaseIntegers = [ + smallestPositiveNumberWhereRoundBreaks, + largestPositiveNumberWhereRoundBreaks + ].every(function (num) { + return Math.round(num) === num; + }); + defineProperty(Math, 'round', function round(x) { + var floor = _floor(x); + var ceil = floor === -1 ? -0 : floor + 1; + return x - floor < 0.5 ? floor : ceil; + }, !roundHandlesBoundaryConditions || !roundDoesNotIncreaseIntegers); + Value.preserveToString(Math.round, origMathRound); + + var origImul = Math.imul; + if (Math.imul(0xffffffff, 5) !== -5) { + // Safari 6.1, at least, reports "0" for this value + Math.imul = MathShims.imul; + Value.preserveToString(Math.imul, origImul); + } + if (Math.imul.length !== 2) { + // Safari 8.0.4 has a length of 1 + // fixed in https://bugs.webkit.org/show_bug.cgi?id=143658 + overrideNative(Math, 'imul', function imul(x, y) { + return ES.Call(origImul, Math, arguments); + }); + } + + // Promises + // Simplest possible implementation; use a 3rd-party library if you + // want the best possible speed and/or long stack traces. + var PromiseShim = (function () { + var setTimeout = globals.setTimeout; + // some environments don't have setTimeout - no way to shim here. + if (typeof setTimeout !== 'function' && typeof setTimeout !== 'object') { return; } + + ES.IsPromise = function (promise) { + if (!ES.TypeIsObject(promise)) { + return false; + } + if (typeof promise._promise === 'undefined') { + return false; // uninitialized, or missing our hidden field. + } + return true; + }; + + // "PromiseCapability" in the spec is what most promise implementations + // call a "deferred". + var PromiseCapability = function (C) { + if (!ES.IsConstructor(C)) { + throw new TypeError('Bad promise constructor'); + } + var capability = this; + var resolver = function (resolve, reject) { + if (capability.resolve !== void 0 || capability.reject !== void 0) { + throw new TypeError('Bad Promise implementation!'); + } + capability.resolve = resolve; + capability.reject = reject; + }; + // Initialize fields to inform optimizers about the object shape. + capability.resolve = void 0; + capability.reject = void 0; + capability.promise = new C(resolver); + if (!(ES.IsCallable(capability.resolve) && ES.IsCallable(capability.reject))) { + throw new TypeError('Bad promise constructor'); + } + }; + + // find an appropriate setImmediate-alike + var makeZeroTimeout; + /*global window */ + if (typeof window !== 'undefined' && ES.IsCallable(window.postMessage)) { + makeZeroTimeout = function () { + // from http://dbaron.org/log/20100309-faster-timeouts + var timeouts = []; + var messageName = 'zero-timeout-message'; + var setZeroTimeout = function (fn) { + _push(timeouts, fn); + window.postMessage(messageName, '*'); + }; + var handleMessage = function (event) { + if (event.source === window && event.data === messageName) { + event.stopPropagation(); + if (timeouts.length === 0) { return; } + var fn = _shift(timeouts); + fn(); + } + }; + window.addEventListener('message', handleMessage, true); + return setZeroTimeout; + }; + } + var makePromiseAsap = function () { + // An efficient task-scheduler based on a pre-existing Promise + // implementation, which we can use even if we override the + // global Promise below (in order to workaround bugs) + // https://github.com/Raynos/observ-hash/issues/2#issuecomment-35857671 + var P = globals.Promise; + var pr = P && P.resolve && P.resolve(); + return pr && function (task) { + return pr.then(task); + }; + }; + /*global process */ + var enqueue = ES.IsCallable(globals.setImmediate) ? + globals.setImmediate : + typeof process === 'object' && process.nextTick ? process.nextTick : makePromiseAsap() || + (ES.IsCallable(makeZeroTimeout) ? makeZeroTimeout() : function (task) { setTimeout(task, 0); }); // fallback + + // Constants for Promise implementation + var PROMISE_IDENTITY = function (x) { return x; }; + var PROMISE_THROWER = function (e) { throw e; }; + var PROMISE_PENDING = 0; + var PROMISE_FULFILLED = 1; + var PROMISE_REJECTED = 2; + // We store fulfill/reject handlers and capabilities in a single array. + var PROMISE_FULFILL_OFFSET = 0; + var PROMISE_REJECT_OFFSET = 1; + var PROMISE_CAPABILITY_OFFSET = 2; + // This is used in an optimization for chaining promises via then. + var PROMISE_FAKE_CAPABILITY = {}; + + var enqueuePromiseReactionJob = function (handler, capability, argument) { + enqueue(function () { + promiseReactionJob(handler, capability, argument); + }); + }; + + var promiseReactionJob = function (handler, promiseCapability, argument) { + var handlerResult, f; + if (promiseCapability === PROMISE_FAKE_CAPABILITY) { + // Fast case, when we don't actually need to chain through to a + // (real) promiseCapability. + return handler(argument); + } + try { + handlerResult = handler(argument); + f = promiseCapability.resolve; + } catch (e) { + handlerResult = e; + f = promiseCapability.reject; + } + f(handlerResult); + }; + + var fulfillPromise = function (promise, value) { + var _promise = promise._promise; + var length = _promise.reactionLength; + if (length > 0) { + enqueuePromiseReactionJob( + _promise.fulfillReactionHandler0, + _promise.reactionCapability0, + value + ); + _promise.fulfillReactionHandler0 = void 0; + _promise.rejectReactions0 = void 0; + _promise.reactionCapability0 = void 0; + if (length > 1) { + for (var i = 1, idx = 0; i < length; i++, idx += 3) { + enqueuePromiseReactionJob( + _promise[idx + PROMISE_FULFILL_OFFSET], + _promise[idx + PROMISE_CAPABILITY_OFFSET], + value + ); + promise[idx + PROMISE_FULFILL_OFFSET] = void 0; + promise[idx + PROMISE_REJECT_OFFSET] = void 0; + promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0; + } + } + } + _promise.result = value; + _promise.state = PROMISE_FULFILLED; + _promise.reactionLength = 0; + }; + + var rejectPromise = function (promise, reason) { + var _promise = promise._promise; + var length = _promise.reactionLength; + if (length > 0) { + enqueuePromiseReactionJob( + _promise.rejectReactionHandler0, + _promise.reactionCapability0, + reason + ); + _promise.fulfillReactionHandler0 = void 0; + _promise.rejectReactions0 = void 0; + _promise.reactionCapability0 = void 0; + if (length > 1) { + for (var i = 1, idx = 0; i < length; i++, idx += 3) { + enqueuePromiseReactionJob( + _promise[idx + PROMISE_REJECT_OFFSET], + _promise[idx + PROMISE_CAPABILITY_OFFSET], + reason + ); + promise[idx + PROMISE_FULFILL_OFFSET] = void 0; + promise[idx + PROMISE_REJECT_OFFSET] = void 0; + promise[idx + PROMISE_CAPABILITY_OFFSET] = void 0; + } + } + } + _promise.result = reason; + _promise.state = PROMISE_REJECTED; + _promise.reactionLength = 0; + }; + + var createResolvingFunctions = function (promise) { + var alreadyResolved = false; + var resolve = function (resolution) { + var then; + if (alreadyResolved) { return; } + alreadyResolved = true; + if (resolution === promise) { + return rejectPromise(promise, new TypeError('Self resolution')); + } + if (!ES.TypeIsObject(resolution)) { + return fulfillPromise(promise, resolution); + } + try { + then = resolution.then; + } catch (e) { + return rejectPromise(promise, e); + } + if (!ES.IsCallable(then)) { + return fulfillPromise(promise, resolution); + } + enqueue(function () { + promiseResolveThenableJob(promise, resolution, then); + }); + }; + var reject = function (reason) { + if (alreadyResolved) { return; } + alreadyResolved = true; + return rejectPromise(promise, reason); + }; + return { resolve: resolve, reject: reject }; + }; + + var optimizedThen = function (then, thenable, resolve, reject) { + // Optimization: since we discard the result, we can pass our + // own then implementation a special hint to let it know it + // doesn't have to create it. (The PROMISE_FAKE_CAPABILITY + // object is local to this implementation and unforgeable outside.) + if (then === Promise$prototype$then) { + _call(then, thenable, resolve, reject, PROMISE_FAKE_CAPABILITY); + } else { + _call(then, thenable, resolve, reject); + } + }; + var promiseResolveThenableJob = function (promise, thenable, then) { + var resolvingFunctions = createResolvingFunctions(promise); + var resolve = resolvingFunctions.resolve; + var reject = resolvingFunctions.reject; + try { + optimizedThen(then, thenable, resolve, reject); + } catch (e) { + reject(e); + } + }; + + var Promise$prototype, Promise$prototype$then; + var Promise = (function () { + var PromiseShim = function Promise(resolver) { + if (!(this instanceof PromiseShim)) { + throw new TypeError('Constructor Promise requires "new"'); + } + if (this && this._promise) { + throw new TypeError('Bad construction'); + } + // see https://bugs.ecmascript.org/show_bug.cgi?id=2482 + if (!ES.IsCallable(resolver)) { + throw new TypeError('not a valid resolver'); + } + var promise = emulateES6construct(this, PromiseShim, Promise$prototype, { + _promise: { + result: void 0, + state: PROMISE_PENDING, + // The first member of the "reactions" array is inlined here, + // since most promises only have one reaction. + // We've also exploded the 'reaction' object to inline the + // "handler" and "capability" fields, since both fulfill and + // reject reactions share the same capability. + reactionLength: 0, + fulfillReactionHandler0: void 0, + rejectReactionHandler0: void 0, + reactionCapability0: void 0 + } + }); + var resolvingFunctions = createResolvingFunctions(promise); + var reject = resolvingFunctions.reject; + try { + resolver(resolvingFunctions.resolve, reject); + } catch (e) { + reject(e); + } + return promise; + }; + return PromiseShim; + }()); + Promise$prototype = Promise.prototype; + + var _promiseAllResolver = function (index, values, capability, remaining) { + var alreadyCalled = false; + return function (x) { + if (alreadyCalled) { return; } + alreadyCalled = true; + values[index] = x; + if ((--remaining.count) === 0) { + var resolve = capability.resolve; + resolve(values); // call w/ this===undefined + } + }; + }; + + var performPromiseAll = function (iteratorRecord, C, resultCapability) { + var it = iteratorRecord.iterator; + var values = []; + var remaining = { count: 1 }; + var next, nextValue; + var index = 0; + while (true) { + try { + next = ES.IteratorStep(it); + if (next === false) { + iteratorRecord.done = true; + break; + } + nextValue = next.value; + } catch (e) { + iteratorRecord.done = true; + throw e; + } + values[index] = void 0; + var nextPromise = C.resolve(nextValue); + var resolveElement = _promiseAllResolver( + index, + values, + resultCapability, + remaining + ); + remaining.count += 1; + optimizedThen(nextPromise.then, nextPromise, resolveElement, resultCapability.reject); + index += 1; + } + if ((--remaining.count) === 0) { + var resolve = resultCapability.resolve; + resolve(values); // call w/ this===undefined + } + return resultCapability.promise; + }; + + var performPromiseRace = function (iteratorRecord, C, resultCapability) { + var it = iteratorRecord.iterator; + var next, nextValue, nextPromise; + while (true) { + try { + next = ES.IteratorStep(it); + if (next === false) { + // NOTE: If iterable has no items, resulting promise will never + // resolve; see: + // https://github.com/domenic/promises-unwrapping/issues/75 + // https://bugs.ecmascript.org/show_bug.cgi?id=2515 + iteratorRecord.done = true; + break; + } + nextValue = next.value; + } catch (e) { + iteratorRecord.done = true; + throw e; + } + nextPromise = C.resolve(nextValue); + optimizedThen(nextPromise.then, nextPromise, resultCapability.resolve, resultCapability.reject); + } + return resultCapability.promise; + }; + + defineProperties(Promise, { + all: function all(iterable) { + var C = this; + if (!ES.TypeIsObject(C)) { + throw new TypeError('Promise is not object'); + } + var capability = new PromiseCapability(C); + var iterator, iteratorRecord; + try { + iterator = ES.GetIterator(iterable); + iteratorRecord = { iterator: iterator, done: false }; + return performPromiseAll(iteratorRecord, C, capability); + } catch (e) { + var exception = e; + if (iteratorRecord && !iteratorRecord.done) { + try { + ES.IteratorClose(iterator, true); + } catch (ee) { + exception = ee; + } + } + var reject = capability.reject; + reject(exception); + return capability.promise; + } + }, + + race: function race(iterable) { + var C = this; + if (!ES.TypeIsObject(C)) { + throw new TypeError('Promise is not object'); + } + var capability = new PromiseCapability(C); + var iterator, iteratorRecord; + try { + iterator = ES.GetIterator(iterable); + iteratorRecord = { iterator: iterator, done: false }; + return performPromiseRace(iteratorRecord, C, capability); + } catch (e) { + var exception = e; + if (iteratorRecord && !iteratorRecord.done) { + try { + ES.IteratorClose(iterator, true); + } catch (ee) { + exception = ee; + } + } + var reject = capability.reject; + reject(exception); + return capability.promise; + } + }, + + reject: function reject(reason) { + var C = this; + if (!ES.TypeIsObject(C)) { + throw new TypeError('Bad promise constructor'); + } + var capability = new PromiseCapability(C); + var rejectFunc = capability.reject; + rejectFunc(reason); // call with this===undefined + return capability.promise; + }, + + resolve: function resolve(v) { + // See https://esdiscuss.org/topic/fixing-promise-resolve for spec + var C = this; + if (!ES.TypeIsObject(C)) { + throw new TypeError('Bad promise constructor'); + } + if (ES.IsPromise(v)) { + var constructor = v.constructor; + if (constructor === C) { + return v; + } + } + var capability = new PromiseCapability(C); + var resolveFunc = capability.resolve; + resolveFunc(v); // call with this===undefined + return capability.promise; + } + }); + + defineProperties(Promise$prototype, { + 'catch': function (onRejected) { + return this.then(null, onRejected); + }, + + then: function then(onFulfilled, onRejected) { + var promise = this; + if (!ES.IsPromise(promise)) { throw new TypeError('not a promise'); } + var C = ES.SpeciesConstructor(promise, Promise); + var resultCapability; + var returnValueIsIgnored = arguments.length > 2 && arguments[2] === PROMISE_FAKE_CAPABILITY; + if (returnValueIsIgnored && C === Promise) { + resultCapability = PROMISE_FAKE_CAPABILITY; + } else { + resultCapability = new PromiseCapability(C); + } + // PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability) + // Note that we've split the 'reaction' object into its two + // components, "capabilities" and "handler" + // "capabilities" is always equal to `resultCapability` + var fulfillReactionHandler = ES.IsCallable(onFulfilled) ? onFulfilled : PROMISE_IDENTITY; + var rejectReactionHandler = ES.IsCallable(onRejected) ? onRejected : PROMISE_THROWER; + var _promise = promise._promise; + var value; + if (_promise.state === PROMISE_PENDING) { + if (_promise.reactionLength === 0) { + _promise.fulfillReactionHandler0 = fulfillReactionHandler; + _promise.rejectReactionHandler0 = rejectReactionHandler; + _promise.reactionCapability0 = resultCapability; + } else { + var idx = 3 * (_promise.reactionLength - 1); + _promise[idx + PROMISE_FULFILL_OFFSET] = fulfillReactionHandler; + _promise[idx + PROMISE_REJECT_OFFSET] = rejectReactionHandler; + _promise[idx + PROMISE_CAPABILITY_OFFSET] = resultCapability; + } + _promise.reactionLength += 1; + } else if (_promise.state === PROMISE_FULFILLED) { + value = _promise.result; + enqueuePromiseReactionJob( + fulfillReactionHandler, + resultCapability, + value + ); + } else if (_promise.state === PROMISE_REJECTED) { + value = _promise.result; + enqueuePromiseReactionJob( + rejectReactionHandler, + resultCapability, + value + ); + } else { + throw new TypeError('unexpected Promise state'); + } + return resultCapability.promise; + } + }); + // This helps the optimizer by ensuring that methods which take + // capabilities aren't polymorphic. + PROMISE_FAKE_CAPABILITY = new PromiseCapability(Promise); + Promise$prototype$then = Promise$prototype.then; + + return Promise; + }()); + + // Chrome's native Promise has extra methods that it shouldn't have. Let's remove them. + if (globals.Promise) { + delete globals.Promise.accept; + delete globals.Promise.defer; + delete globals.Promise.prototype.chain; + } + + if (typeof PromiseShim === 'function') { + // export the Promise constructor. + defineProperties(globals, { Promise: PromiseShim }); + // In Chrome 33 (and thereabouts) Promise is defined, but the + // implementation is buggy in a number of ways. Let's check subclassing + // support to see if we have a buggy implementation. + var promiseSupportsSubclassing = supportsSubclassing(globals.Promise, function (S) { + return S.resolve(42).then(function () {}) instanceof S; + }); + var promiseIgnoresNonFunctionThenCallbacks = !throwsError(function () { + return globals.Promise.reject(42).then(null, 5).then(null, noop); + }); + var promiseRequiresObjectContext = throwsError(function () { return globals.Promise.call(3, noop); }); + // Promise.resolve() was errata'ed late in the ES6 process. + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1170742 + // https://code.google.com/p/v8/issues/detail?id=4161 + // It serves as a proxy for a number of other bugs in early Promise + // implementations. + var promiseResolveBroken = (function (Promise) { + var p = Promise.resolve(5); + p.constructor = {}; + var p2 = Promise.resolve(p); + try { + p2.then(null, noop).then(null, noop); // avoid "uncaught rejection" warnings in console + } catch (e) { + return true; // v8 native Promises break here https://code.google.com/p/chromium/issues/detail?id=575314 + } + return p === p2; // This *should* be false! + }(globals.Promise)); + + // Chrome 46 (probably older too) does not retrieve a thenable's .then synchronously + var getsThenSynchronously = supportsDescriptors && (function () { + var count = 0; + // eslint-disable-next-line getter-return + var thenable = Object.defineProperty({}, 'then', { get: function () { count += 1; } }); + Promise.resolve(thenable); + return count === 1; + }()); + + var BadResolverPromise = function BadResolverPromise(executor) { + var p = new Promise(executor); + executor(3, function () {}); + this.then = p.then; + this.constructor = BadResolverPromise; + }; + BadResolverPromise.prototype = Promise.prototype; + BadResolverPromise.all = Promise.all; + // Chrome Canary 49 (probably older too) has some implementation bugs + var hasBadResolverPromise = valueOrFalseIfThrows(function () { + return !!BadResolverPromise.all([1, 2]); + }); + + if (!promiseSupportsSubclassing || !promiseIgnoresNonFunctionThenCallbacks || + !promiseRequiresObjectContext || promiseResolveBroken || + !getsThenSynchronously || hasBadResolverPromise) { + /* globals Promise: true */ + /* eslint-disable no-undef, no-global-assign */ + Promise = PromiseShim; + /* eslint-enable no-undef, no-global-assign */ + /* globals Promise: false */ + overrideNative(globals, 'Promise', PromiseShim); + } + if (Promise.all.length !== 1) { + var origAll = Promise.all; + overrideNative(Promise, 'all', function all(iterable) { + return ES.Call(origAll, this, arguments); + }); + } + if (Promise.race.length !== 1) { + var origRace = Promise.race; + overrideNative(Promise, 'race', function race(iterable) { + return ES.Call(origRace, this, arguments); + }); + } + if (Promise.resolve.length !== 1) { + var origResolve = Promise.resolve; + overrideNative(Promise, 'resolve', function resolve(x) { + return ES.Call(origResolve, this, arguments); + }); + } + if (Promise.reject.length !== 1) { + var origReject = Promise.reject; + overrideNative(Promise, 'reject', function reject(r) { + return ES.Call(origReject, this, arguments); + }); + } + ensureEnumerable(Promise, 'all'); + ensureEnumerable(Promise, 'race'); + ensureEnumerable(Promise, 'resolve'); + ensureEnumerable(Promise, 'reject'); + addDefaultSpecies(Promise); + } + + // Map and Set require a true ES5 environment + // Their fast path also requires that the environment preserve + // property insertion order, which is not guaranteed by the spec. + var testOrder = function (a) { + var b = keys(_reduce(a, function (o, k) { + o[k] = true; + return o; + }, {})); + return a.join(':') === b.join(':'); + }; + var preservesInsertionOrder = testOrder(['z', 'a', 'bb']); + // some engines (eg, Chrome) only preserve insertion order for string keys + var preservesNumericInsertionOrder = testOrder(['z', 1, 'a', '3', 2]); + + if (supportsDescriptors) { + + var fastkey = function fastkey(key, skipInsertionOrderCheck) { + if (!skipInsertionOrderCheck && !preservesInsertionOrder) { + return null; + } + if (isNullOrUndefined(key)) { + return '^' + ES.ToString(key); + } else if (typeof key === 'string') { + return '$' + key; + } else if (typeof key === 'number') { + // note that -0 will get coerced to "0" when used as a property key + if (!preservesNumericInsertionOrder) { + return 'n' + key; + } + return key; + } else if (typeof key === 'boolean') { + return 'b' + key; + } + return null; + }; + + var emptyObject = function emptyObject() { + // accomodate some older not-quite-ES5 browsers + return Object.create ? Object.create(null) : {}; + }; + + var addIterableToMap = function addIterableToMap(MapConstructor, map, iterable) { + if (isArray(iterable) || Type.string(iterable)) { + _forEach(iterable, function (entry) { + if (!ES.TypeIsObject(entry)) { + throw new TypeError('Iterator value ' + entry + ' is not an entry object'); + } + map.set(entry[0], entry[1]); + }); + } else if (iterable instanceof MapConstructor) { + _call(MapConstructor.prototype.forEach, iterable, function (value, key) { + map.set(key, value); + }); + } else { + var iter, adder; + if (!isNullOrUndefined(iterable)) { + adder = map.set; + if (!ES.IsCallable(adder)) { throw new TypeError('bad map'); } + iter = ES.GetIterator(iterable); + } + if (typeof iter !== 'undefined') { + while (true) { + var next = ES.IteratorStep(iter); + if (next === false) { break; } + var nextItem = next.value; + try { + if (!ES.TypeIsObject(nextItem)) { + throw new TypeError('Iterator value ' + nextItem + ' is not an entry object'); + } + _call(adder, map, nextItem[0], nextItem[1]); + } catch (e) { + ES.IteratorClose(iter, true); + throw e; + } + } + } + } + }; + var addIterableToSet = function addIterableToSet(SetConstructor, set, iterable) { + if (isArray(iterable) || Type.string(iterable)) { + _forEach(iterable, function (value) { + set.add(value); + }); + } else if (iterable instanceof SetConstructor) { + _call(SetConstructor.prototype.forEach, iterable, function (value) { + set.add(value); + }); + } else { + var iter, adder; + if (!isNullOrUndefined(iterable)) { + adder = set.add; + if (!ES.IsCallable(adder)) { throw new TypeError('bad set'); } + iter = ES.GetIterator(iterable); + } + if (typeof iter !== 'undefined') { + while (true) { + var next = ES.IteratorStep(iter); + if (next === false) { break; } + var nextValue = next.value; + try { + _call(adder, set, nextValue); + } catch (e) { + ES.IteratorClose(iter, true); + throw e; + } + } + } + } + }; + + var collectionShims = { + Map: (function () { + + var empty = {}; + + var MapEntry = function MapEntry(key, value) { + this.key = key; + this.value = value; + this.next = null; + this.prev = null; + }; + + MapEntry.prototype.isRemoved = function isRemoved() { + return this.key === empty; + }; + + var isMap = function isMap(map) { + return !!map._es6map; + }; + + var requireMapSlot = function requireMapSlot(map, method) { + if (!ES.TypeIsObject(map) || !isMap(map)) { + throw new TypeError('Method Map.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(map)); + } + }; + + var MapIterator = function MapIterator(map, kind) { + requireMapSlot(map, '[[MapIterator]]'); + this.head = map._head; + this.i = this.head; + this.kind = kind; + }; + + MapIterator.prototype = { + isMapIterator: true, + next: function next() { + if (!this.isMapIterator) { + throw new TypeError('Not a MapIterator'); + } + var i = this.i; + var kind = this.kind; + var head = this.head; + if (typeof this.i === 'undefined') { + return iteratorResult(); + } + while (i.isRemoved() && i !== head) { + // back up off of removed entries + i = i.prev; + } + // advance to next unreturned element. + var result; + while (i.next !== head) { + i = i.next; + if (!i.isRemoved()) { + if (kind === 'key') { + result = i.key; + } else if (kind === 'value') { + result = i.value; + } else { + result = [i.key, i.value]; + } + this.i = i; + return iteratorResult(result); + } + } + // once the iterator is done, it is done forever. + this.i = void 0; + return iteratorResult(); + } + }; + addIterator(MapIterator.prototype); + + var Map$prototype; + var MapShim = function Map() { + if (!(this instanceof Map)) { + throw new TypeError('Constructor Map requires "new"'); + } + if (this && this._es6map) { + throw new TypeError('Bad construction'); + } + var map = emulateES6construct(this, Map, Map$prototype, { + _es6map: true, + _head: null, + _map: OrigMap ? new OrigMap() : null, + _size: 0, + _storage: emptyObject() + }); + + var head = new MapEntry(null, null); + // circular doubly-linked list. + /* eslint no-multi-assign: 1 */ + head.next = head.prev = head; + map._head = head; + + // Optionally initialize map from iterable + if (arguments.length > 0) { + addIterableToMap(Map, map, arguments[0]); + } + return map; + }; + Map$prototype = MapShim.prototype; + + Value.getter(Map$prototype, 'size', function () { + if (typeof this._size === 'undefined') { + throw new TypeError('size method called on incompatible Map'); + } + return this._size; + }); + + defineProperties(Map$prototype, { + get: function get(key) { + requireMapSlot(this, 'get'); + var entry; + var fkey = fastkey(key, true); + if (fkey !== null) { + // fast O(1) path + entry = this._storage[fkey]; + if (entry) { + return entry.value; + } else { + return; + } + } + if (this._map) { + // fast object key path + entry = origMapGet.call(this._map, key); + if (entry) { + return entry.value; + } else { + return; + } + } + var head = this._head; + var i = head; + while ((i = i.next) !== head) { + if (ES.SameValueZero(i.key, key)) { + return i.value; + } + } + }, + + has: function has(key) { + requireMapSlot(this, 'has'); + var fkey = fastkey(key, true); + if (fkey !== null) { + // fast O(1) path + return typeof this._storage[fkey] !== 'undefined'; + } + if (this._map) { + // fast object key path + return origMapHas.call(this._map, key); + } + var head = this._head; + var i = head; + while ((i = i.next) !== head) { + if (ES.SameValueZero(i.key, key)) { + return true; + } + } + return false; + }, + + set: function set(key, value) { + requireMapSlot(this, 'set'); + var head = this._head; + var i = head; + var entry; + var fkey = fastkey(key, true); + if (fkey !== null) { + // fast O(1) path + if (typeof this._storage[fkey] !== 'undefined') { + this._storage[fkey].value = value; + return this; + } else { + entry = this._storage[fkey] = new MapEntry(key, value); /* eslint no-multi-assign: 1 */ + i = head.prev; + // fall through + } + } else if (this._map) { + // fast object key path + if (origMapHas.call(this._map, key)) { + origMapGet.call(this._map, key).value = value; + } else { + entry = new MapEntry(key, value); + origMapSet.call(this._map, key, entry); + i = head.prev; + // fall through + } + } + while ((i = i.next) !== head) { + if (ES.SameValueZero(i.key, key)) { + i.value = value; + return this; + } + } + entry = entry || new MapEntry(key, value); + if (ES.SameValue(-0, key)) { + entry.key = +0; // coerce -0 to +0 in entry + } + entry.next = this._head; + entry.prev = this._head.prev; + entry.prev.next = entry; + entry.next.prev = entry; + this._size += 1; + return this; + }, + + 'delete': function (key) { + requireMapSlot(this, 'delete'); + var head = this._head; + var i = head; + var fkey = fastkey(key, true); + if (fkey !== null) { + // fast O(1) path + if (typeof this._storage[fkey] === 'undefined') { + return false; + } + i = this._storage[fkey].prev; + delete this._storage[fkey]; + // fall through + } else if (this._map) { + // fast object key path + if (!origMapHas.call(this._map, key)) { + return false; + } + i = origMapGet.call(this._map, key).prev; + origMapDelete.call(this._map, key); + // fall through + } + while ((i = i.next) !== head) { + if (ES.SameValueZero(i.key, key)) { + i.key = empty; + i.value = empty; + i.prev.next = i.next; + i.next.prev = i.prev; + this._size -= 1; + return true; + } + } + return false; + }, + + clear: function clear() { + /* eslint no-multi-assign: 1 */ + requireMapSlot(this, 'clear'); + this._map = OrigMap ? new OrigMap() : null; + this._size = 0; + this._storage = emptyObject(); + var head = this._head; + var i = head; + var p = i.next; + while ((i = p) !== head) { + i.key = empty; + i.value = empty; + p = i.next; + i.next = i.prev = head; + } + head.next = head.prev = head; + }, + + keys: function keys() { + requireMapSlot(this, 'keys'); + return new MapIterator(this, 'key'); + }, + + values: function values() { + requireMapSlot(this, 'values'); + return new MapIterator(this, 'value'); + }, + + entries: function entries() { + requireMapSlot(this, 'entries'); + return new MapIterator(this, 'key+value'); + }, + + forEach: function forEach(callback) { + requireMapSlot(this, 'forEach'); + var context = arguments.length > 1 ? arguments[1] : null; + var it = this.entries(); + for (var entry = it.next(); !entry.done; entry = it.next()) { + if (context) { + _call(callback, context, entry.value[1], entry.value[0], this); + } else { + callback(entry.value[1], entry.value[0], this); + } + } + } + }); + addIterator(Map$prototype, Map$prototype.entries); + + return MapShim; + }()), + + Set: (function () { + var isSet = function isSet(set) { + return set._es6set && typeof set._storage !== 'undefined'; + }; + var requireSetSlot = function requireSetSlot(set, method) { + if (!ES.TypeIsObject(set) || !isSet(set)) { + // https://github.com/paulmillr/es6-shim/issues/176 + throw new TypeError('Set.prototype.' + method + ' called on incompatible receiver ' + ES.ToString(set)); + } + }; + + // Creating a Map is expensive. To speed up the common case of + // Sets containing only string or numeric keys, we use an object + // as backing storage and lazily create a full Map only when + // required. + var Set$prototype; + var SetShim = function Set() { + if (!(this instanceof Set)) { + throw new TypeError('Constructor Set requires "new"'); + } + if (this && this._es6set) { + throw new TypeError('Bad construction'); + } + var set = emulateES6construct(this, Set, Set$prototype, { + _es6set: true, + '[[SetData]]': null, + _storage: emptyObject() + }); + if (!set._es6set) { + throw new TypeError('bad set'); + } + + // Optionally initialize Set from iterable + if (arguments.length > 0) { + addIterableToSet(Set, set, arguments[0]); + } + return set; + }; + Set$prototype = SetShim.prototype; + + var decodeKey = function (key) { + var k = key; + if (k === '^null') { + return null; + } else if (k === '^undefined') { + return void 0; + } else { + var first = k.charAt(0); + if (first === '$') { + return _strSlice(k, 1); + } else if (first === 'n') { + return +_strSlice(k, 1); + } else if (first === 'b') { + return k === 'btrue'; + } + } + return +k; + }; + // Switch from the object backing storage to a full Map. + var ensureMap = function ensureMap(set) { + if (!set['[[SetData]]']) { + var m = new collectionShims.Map(); + set['[[SetData]]'] = m; + _forEach(keys(set._storage), function (key) { + var k = decodeKey(key); + m.set(k, k); + }); + set['[[SetData]]'] = m; + } + set._storage = null; // free old backing storage + }; + + Value.getter(SetShim.prototype, 'size', function () { + requireSetSlot(this, 'size'); + if (this._storage) { + return keys(this._storage).length; + } + ensureMap(this); + return this['[[SetData]]'].size; + }); + + defineProperties(SetShim.prototype, { + has: function has(key) { + requireSetSlot(this, 'has'); + var fkey; + if (this._storage && (fkey = fastkey(key)) !== null) { + return !!this._storage[fkey]; + } + ensureMap(this); + return this['[[SetData]]'].has(key); + }, + + add: function add(key) { + requireSetSlot(this, 'add'); + var fkey; + if (this._storage && (fkey = fastkey(key)) !== null) { + this._storage[fkey] = true; + return this; + } + ensureMap(this); + this['[[SetData]]'].set(key, key); + return this; + }, + + 'delete': function (key) { + requireSetSlot(this, 'delete'); + var fkey; + if (this._storage && (fkey = fastkey(key)) !== null) { + var hasFKey = _hasOwnProperty(this._storage, fkey); + return (delete this._storage[fkey]) && hasFKey; + } + ensureMap(this); + return this['[[SetData]]']['delete'](key); + }, + + clear: function clear() { + requireSetSlot(this, 'clear'); + if (this._storage) { + this._storage = emptyObject(); + } + if (this['[[SetData]]']) { + this['[[SetData]]'].clear(); + } + }, + + values: function values() { + requireSetSlot(this, 'values'); + ensureMap(this); + return new SetIterator(this['[[SetData]]'].values()); + }, + + entries: function entries() { + requireSetSlot(this, 'entries'); + ensureMap(this); + return new SetIterator(this['[[SetData]]'].entries()); + }, + + forEach: function forEach(callback) { + requireSetSlot(this, 'forEach'); + var context = arguments.length > 1 ? arguments[1] : null; + var entireSet = this; + ensureMap(entireSet); + this['[[SetData]]'].forEach(function (value, key) { + if (context) { + _call(callback, context, key, key, entireSet); + } else { + callback(key, key, entireSet); + } + }); + } + }); + defineProperty(SetShim.prototype, 'keys', SetShim.prototype.values, true); + addIterator(SetShim.prototype, SetShim.prototype.values); + + var SetIterator = function SetIterator(it) { + this.it = it; + }; + SetIterator.prototype = { + isSetIterator: true, + next: function next() { + if (!this.isSetIterator) { + throw new TypeError('Not a SetIterator'); + } + return this.it.next(); + } + }; + addIterator(SetIterator.prototype); + + return SetShim; + }()) + }; + + var isGoogleTranslate = globals.Set && !Set.prototype['delete'] && Set.prototype.remove && Set.prototype.items && Set.prototype.map && Array.isArray(new Set().keys); + if (isGoogleTranslate) { + // special-case force removal of wildly invalid Set implementation in Google Translate iframes + // see https://github.com/paulmillr/es6-shim/issues/438 / https://twitter.com/ljharb/status/849335573114363904 + globals.Set = collectionShims.Set; + } + if (globals.Map || globals.Set) { + // Safari 8, for example, doesn't accept an iterable. + var mapAcceptsArguments = valueOrFalseIfThrows(function () { return new Map([[1, 2]]).get(1) === 2; }); + if (!mapAcceptsArguments) { + globals.Map = function Map() { + if (!(this instanceof Map)) { + throw new TypeError('Constructor Map requires "new"'); + } + var m = new OrigMap(); + if (arguments.length > 0) { + addIterableToMap(Map, m, arguments[0]); + } + delete m.constructor; + Object.setPrototypeOf(m, globals.Map.prototype); + return m; + }; + globals.Map.prototype = create(OrigMap.prototype); + defineProperty(globals.Map.prototype, 'constructor', globals.Map, true); + Value.preserveToString(globals.Map, OrigMap); + } + var testMap = new Map(); + var mapUsesSameValueZero = (function () { + // Chrome 38-42, node 0.11/0.12, iojs 1/2 also have a bug when the Map has a size > 4 + var m = new Map([[1, 0], [2, 0], [3, 0], [4, 0]]); + m.set(-0, m); + return m.get(0) === m && m.get(-0) === m && m.has(0) && m.has(-0); + }()); + var mapSupportsChaining = testMap.set(1, 2) === testMap; + if (!mapUsesSameValueZero || !mapSupportsChaining) { + overrideNative(Map.prototype, 'set', function set(k, v) { + _call(origMapSet, this, k === 0 ? 0 : k, v); + return this; + }); + } + if (!mapUsesSameValueZero) { + defineProperties(Map.prototype, { + get: function get(k) { + return _call(origMapGet, this, k === 0 ? 0 : k); + }, + has: function has(k) { + return _call(origMapHas, this, k === 0 ? 0 : k); + } + }, true); + Value.preserveToString(Map.prototype.get, origMapGet); + Value.preserveToString(Map.prototype.has, origMapHas); + } + var testSet = new Set(); + var setUsesSameValueZero = Set.prototype['delete'] && Set.prototype.add && Set.prototype.has && (function (s) { + s['delete'](0); + s.add(-0); + return !s.has(0); + }(testSet)); + var setSupportsChaining = testSet.add(1) === testSet; + if (!setUsesSameValueZero || !setSupportsChaining) { + var origSetAdd = Set.prototype.add; + Set.prototype.add = function add(v) { + _call(origSetAdd, this, v === 0 ? 0 : v); + return this; + }; + Value.preserveToString(Set.prototype.add, origSetAdd); + } + if (!setUsesSameValueZero) { + var origSetHas = Set.prototype.has; + Set.prototype.has = function has(v) { + return _call(origSetHas, this, v === 0 ? 0 : v); + }; + Value.preserveToString(Set.prototype.has, origSetHas); + var origSetDel = Set.prototype['delete']; + Set.prototype['delete'] = function SetDelete(v) { + return _call(origSetDel, this, v === 0 ? 0 : v); + }; + Value.preserveToString(Set.prototype['delete'], origSetDel); + } + var mapSupportsSubclassing = supportsSubclassing(globals.Map, function (M) { + var m = new M([]); + // Firefox 32 is ok with the instantiating the subclass but will + // throw when the map is used. + m.set(42, 42); + return m instanceof M; + }); + // without Object.setPrototypeOf, subclassing is not possible + var mapFailsToSupportSubclassing = Object.setPrototypeOf && !mapSupportsSubclassing; + var mapRequiresNew = (function () { + try { + return !(globals.Map() instanceof globals.Map); + } catch (e) { + return e instanceof TypeError; + } + }()); + if (globals.Map.length !== 0 || mapFailsToSupportSubclassing || !mapRequiresNew) { + globals.Map = function Map() { + if (!(this instanceof Map)) { + throw new TypeError('Constructor Map requires "new"'); + } + var m = new OrigMap(); + if (arguments.length > 0) { + addIterableToMap(Map, m, arguments[0]); + } + delete m.constructor; + Object.setPrototypeOf(m, Map.prototype); + return m; + }; + globals.Map.prototype = OrigMap.prototype; + defineProperty(globals.Map.prototype, 'constructor', globals.Map, true); + Value.preserveToString(globals.Map, OrigMap); + } + var setSupportsSubclassing = supportsSubclassing(globals.Set, function (S) { + var s = new S([]); + s.add(42, 42); + return s instanceof S; + }); + // without Object.setPrototypeOf, subclassing is not possible + var setFailsToSupportSubclassing = Object.setPrototypeOf && !setSupportsSubclassing; + var setRequiresNew = (function () { + try { + return !(globals.Set() instanceof globals.Set); + } catch (e) { + return e instanceof TypeError; + } + }()); + if (globals.Set.length !== 0 || setFailsToSupportSubclassing || !setRequiresNew) { + var OrigSet = globals.Set; + globals.Set = function Set() { + if (!(this instanceof Set)) { + throw new TypeError('Constructor Set requires "new"'); + } + var s = new OrigSet(); + if (arguments.length > 0) { + addIterableToSet(Set, s, arguments[0]); + } + delete s.constructor; + Object.setPrototypeOf(s, Set.prototype); + return s; + }; + globals.Set.prototype = OrigSet.prototype; + defineProperty(globals.Set.prototype, 'constructor', globals.Set, true); + Value.preserveToString(globals.Set, OrigSet); + } + var newMap = new globals.Map(); + var mapIterationThrowsStopIterator = !valueOrFalseIfThrows(function () { + return newMap.keys().next().done; + }); + /* + - In Firefox < 23, Map#size is a function. + - In all current Firefox, Set#entries/keys/values & Map#clear do not exist + - https://bugzilla.mozilla.org/show_bug.cgi?id=869996 + - In Firefox 24, Map and Set do not implement forEach + - In Firefox 25 at least, Map and Set are callable without "new" + */ + if ( + typeof globals.Map.prototype.clear !== 'function' || + new globals.Set().size !== 0 || + newMap.size !== 0 || + typeof globals.Map.prototype.keys !== 'function' || + typeof globals.Set.prototype.keys !== 'function' || + typeof globals.Map.prototype.forEach !== 'function' || + typeof globals.Set.prototype.forEach !== 'function' || + isCallableWithoutNew(globals.Map) || + isCallableWithoutNew(globals.Set) || + typeof newMap.keys().next !== 'function' || // Safari 8 + mapIterationThrowsStopIterator || // Firefox 25 + !mapSupportsSubclassing + ) { + defineProperties(globals, { + Map: collectionShims.Map, + Set: collectionShims.Set + }, true); + } + + if (globals.Set.prototype.keys !== globals.Set.prototype.values) { + // Fixed in WebKit with https://bugs.webkit.org/show_bug.cgi?id=144190 + defineProperty(globals.Set.prototype, 'keys', globals.Set.prototype.values, true); + } + + // Shim incomplete iterator implementations. + addIterator(Object.getPrototypeOf((new globals.Map()).keys())); + addIterator(Object.getPrototypeOf((new globals.Set()).keys())); + + if (functionsHaveNames && globals.Set.prototype.has.name !== 'has') { + // Microsoft Edge v0.11.10074.0 is missing a name on Set#has + var anonymousSetHas = globals.Set.prototype.has; + overrideNative(globals.Set.prototype, 'has', function has(key) { + return _call(anonymousSetHas, this, key); + }); + } + } + defineProperties(globals, collectionShims); + addDefaultSpecies(globals.Map); + addDefaultSpecies(globals.Set); + } + + var throwUnlessTargetIsObject = function throwUnlessTargetIsObject(target) { + if (!ES.TypeIsObject(target)) { + throw new TypeError('target must be an object'); + } + }; + + // Some Reflect methods are basically the same as + // those on the Object global, except that a TypeError is thrown if + // target isn't an object. As well as returning a boolean indicating + // the success of the operation. + var ReflectShims = { + // Apply method in a functional form. + apply: function apply() { + return ES.Call(ES.Call, null, arguments); + }, + + // New operator in a functional form. + construct: function construct(constructor, args) { + if (!ES.IsConstructor(constructor)) { + throw new TypeError('First argument must be a constructor.'); + } + var newTarget = arguments.length > 2 ? arguments[2] : constructor; + if (!ES.IsConstructor(newTarget)) { + throw new TypeError('new.target must be a constructor.'); + } + return ES.Construct(constructor, args, newTarget, 'internal'); + }, + + // When deleting a non-existent or configurable property, + // true is returned. + // When attempting to delete a non-configurable property, + // it will return false. + deleteProperty: function deleteProperty(target, key) { + throwUnlessTargetIsObject(target); + if (supportsDescriptors) { + var desc = Object.getOwnPropertyDescriptor(target, key); + + if (desc && !desc.configurable) { + return false; + } + } + + // Will return true. + return delete target[key]; + }, + + has: function has(target, key) { + throwUnlessTargetIsObject(target); + return key in target; + } + }; + + if (Object.getOwnPropertyNames) { + Object.assign(ReflectShims, { + // Basically the result of calling the internal [[OwnPropertyKeys]]. + // Concatenating propertyNames and propertySymbols should do the trick. + // This should continue to work together with a Symbol shim + // which overrides Object.getOwnPropertyNames and implements + // Object.getOwnPropertySymbols. + ownKeys: function ownKeys(target) { + throwUnlessTargetIsObject(target); + var keys = Object.getOwnPropertyNames(target); + + if (ES.IsCallable(Object.getOwnPropertySymbols)) { + _pushApply(keys, Object.getOwnPropertySymbols(target)); + } + + return keys; + } + }); + } + + var callAndCatchException = function ConvertExceptionToBoolean(func) { + return !throwsError(func); + }; + + if (Object.preventExtensions) { + Object.assign(ReflectShims, { + isExtensible: function isExtensible(target) { + throwUnlessTargetIsObject(target); + return Object.isExtensible(target); + }, + preventExtensions: function preventExtensions(target) { + throwUnlessTargetIsObject(target); + return callAndCatchException(function () { + return Object.preventExtensions(target); + }); + } + }); + } + + if (supportsDescriptors) { + var internalGet = function get(target, key, receiver) { + var desc = Object.getOwnPropertyDescriptor(target, key); + + if (!desc) { + var parent = Object.getPrototypeOf(target); + + if (parent === null) { + return void 0; + } + + return internalGet(parent, key, receiver); + } + + if ('value' in desc) { + return desc.value; + } + + if (desc.get) { + return ES.Call(desc.get, receiver); + } + + return void 0; + }; + + var internalSet = function set(target, key, value, receiver) { + var desc = Object.getOwnPropertyDescriptor(target, key); + + if (!desc) { + var parent = Object.getPrototypeOf(target); + + if (parent !== null) { + return internalSet(parent, key, value, receiver); + } + + desc = { + value: void 0, + writable: true, + enumerable: true, + configurable: true + }; + } + + if ('value' in desc) { + if (!desc.writable) { + return false; + } + + if (!ES.TypeIsObject(receiver)) { + return false; + } + + var existingDesc = Object.getOwnPropertyDescriptor(receiver, key); + + if (existingDesc) { + return Reflect.defineProperty(receiver, key, { + value: value + }); + } else { + return Reflect.defineProperty(receiver, key, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + } + + if (desc.set) { + _call(desc.set, receiver, value); + return true; + } + + return false; + }; + + Object.assign(ReflectShims, { + defineProperty: function defineProperty(target, propertyKey, attributes) { + throwUnlessTargetIsObject(target); + return callAndCatchException(function () { + return Object.defineProperty(target, propertyKey, attributes); + }); + }, + + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + throwUnlessTargetIsObject(target); + return Object.getOwnPropertyDescriptor(target, propertyKey); + }, + + // Syntax in a functional form. + get: function get(target, key) { + throwUnlessTargetIsObject(target); + var receiver = arguments.length > 2 ? arguments[2] : target; + + return internalGet(target, key, receiver); + }, + + set: function set(target, key, value) { + throwUnlessTargetIsObject(target); + var receiver = arguments.length > 3 ? arguments[3] : target; + + return internalSet(target, key, value, receiver); + } + }); + } + + if (Object.getPrototypeOf) { + var objectDotGetPrototypeOf = Object.getPrototypeOf; + ReflectShims.getPrototypeOf = function getPrototypeOf(target) { + throwUnlessTargetIsObject(target); + return objectDotGetPrototypeOf(target); + }; + } + + if (Object.setPrototypeOf && ReflectShims.getPrototypeOf) { + var willCreateCircularPrototype = function (object, lastProto) { + var proto = lastProto; + while (proto) { + if (object === proto) { + return true; + } + proto = ReflectShims.getPrototypeOf(proto); + } + return false; + }; + + Object.assign(ReflectShims, { + // Sets the prototype of the given object. + // Returns true on success, otherwise false. + setPrototypeOf: function setPrototypeOf(object, proto) { + throwUnlessTargetIsObject(object); + if (proto !== null && !ES.TypeIsObject(proto)) { + throw new TypeError('proto must be an object or null'); + } + + // If they already are the same, we're done. + if (proto === Reflect.getPrototypeOf(object)) { + return true; + } + + // Cannot alter prototype if object not extensible. + if (Reflect.isExtensible && !Reflect.isExtensible(object)) { + return false; + } + + // Ensure that we do not create a circular prototype chain. + if (willCreateCircularPrototype(object, proto)) { + return false; + } + + Object.setPrototypeOf(object, proto); + + return true; + } + }); + } + var defineOrOverrideReflectProperty = function (key, shim) { + if (!ES.IsCallable(globals.Reflect[key])) { + defineProperty(globals.Reflect, key, shim); + } else { + var acceptsPrimitives = valueOrFalseIfThrows(function () { + globals.Reflect[key](1); + globals.Reflect[key](NaN); + globals.Reflect[key](true); + return true; + }); + if (acceptsPrimitives) { + overrideNative(globals.Reflect, key, shim); + } + } + }; + Object.keys(ReflectShims).forEach(function (key) { + defineOrOverrideReflectProperty(key, ReflectShims[key]); + }); + var originalReflectGetProto = globals.Reflect.getPrototypeOf; + if (functionsHaveNames && originalReflectGetProto && originalReflectGetProto.name !== 'getPrototypeOf') { + overrideNative(globals.Reflect, 'getPrototypeOf', function getPrototypeOf(target) { + return _call(originalReflectGetProto, globals.Reflect, target); + }); + } + if (globals.Reflect.setPrototypeOf) { + if (valueOrFalseIfThrows(function () { + globals.Reflect.setPrototypeOf(1, {}); + return true; + })) { + overrideNative(globals.Reflect, 'setPrototypeOf', ReflectShims.setPrototypeOf); + } + } + if (globals.Reflect.defineProperty) { + if (!valueOrFalseIfThrows(function () { + var basic = !globals.Reflect.defineProperty(1, 'test', { value: 1 }); + // "extensible" fails on Edge 0.12 + var extensible = typeof Object.preventExtensions !== 'function' || !globals.Reflect.defineProperty(Object.preventExtensions({}), 'test', {}); + return basic && extensible; + })) { + overrideNative(globals.Reflect, 'defineProperty', ReflectShims.defineProperty); + } + } + if (globals.Reflect.construct) { + if (!valueOrFalseIfThrows(function () { + var F = function F() {}; + return globals.Reflect.construct(function () {}, [], F) instanceof F; + })) { + overrideNative(globals.Reflect, 'construct', ReflectShims.construct); + } + } + + if (String(new Date(NaN)) !== 'Invalid Date') { + var dateToString = Date.prototype.toString; + var shimmedDateToString = function toString() { + var valueOf = +this; + if (valueOf !== valueOf) { + return 'Invalid Date'; + } + return ES.Call(dateToString, this); + }; + overrideNative(Date.prototype, 'toString', shimmedDateToString); + } + + // Annex B HTML methods + // http://www.ecma-international.org/ecma-262/6.0/#sec-additional-properties-of-the-string.prototype-object + var stringHTMLshims = { + anchor: function anchor(name) { return ES.CreateHTML(this, 'a', 'name', name); }, + big: function big() { return ES.CreateHTML(this, 'big', '', ''); }, + blink: function blink() { return ES.CreateHTML(this, 'blink', '', ''); }, + bold: function bold() { return ES.CreateHTML(this, 'b', '', ''); }, + fixed: function fixed() { return ES.CreateHTML(this, 'tt', '', ''); }, + fontcolor: function fontcolor(color) { return ES.CreateHTML(this, 'font', 'color', color); }, + fontsize: function fontsize(size) { return ES.CreateHTML(this, 'font', 'size', size); }, + italics: function italics() { return ES.CreateHTML(this, 'i', '', ''); }, + link: function link(url) { return ES.CreateHTML(this, 'a', 'href', url); }, + small: function small() { return ES.CreateHTML(this, 'small', '', ''); }, + strike: function strike() { return ES.CreateHTML(this, 'strike', '', ''); }, + sub: function sub() { return ES.CreateHTML(this, 'sub', '', ''); }, + sup: function sub() { return ES.CreateHTML(this, 'sup', '', ''); } + }; + _forEach(Object.keys(stringHTMLshims), function (key) { + var method = String.prototype[key]; + var shouldOverwrite = false; + if (ES.IsCallable(method)) { + var output = _call(method, '', ' " '); + var quotesCount = _concat([], output.match(/"/g)).length; + shouldOverwrite = output !== output.toLowerCase() || quotesCount > 2; + } else { + shouldOverwrite = true; + } + if (shouldOverwrite) { + overrideNative(String.prototype, key, stringHTMLshims[key]); + } + }); + + var JSONstringifiesSymbols = (function () { + // Microsoft Edge v0.12 stringifies Symbols incorrectly + if (!hasSymbols) { return false; } // Symbols are not supported + var stringify = typeof JSON === 'object' && typeof JSON.stringify === 'function' ? JSON.stringify : null; + if (!stringify) { return false; } // JSON.stringify is not supported + if (typeof stringify(Symbol()) !== 'undefined') { return true; } // Symbols should become `undefined` + if (stringify([Symbol()]) !== '[null]') { return true; } // Symbols in arrays should become `null` + var obj = { a: Symbol() }; + obj[Symbol()] = true; + if (stringify(obj) !== '{}') { return true; } // Symbol-valued keys *and* Symbol-valued properties should be omitted + return false; + }()); + var JSONstringifyAcceptsObjectSymbol = valueOrFalseIfThrows(function () { + // Chrome 45 throws on stringifying object symbols + if (!hasSymbols) { return true; } // Symbols are not supported + return JSON.stringify(Object(Symbol())) === '{}' && JSON.stringify([Object(Symbol())]) === '[{}]'; + }); + if (JSONstringifiesSymbols || !JSONstringifyAcceptsObjectSymbol) { + var origStringify = JSON.stringify; + overrideNative(JSON, 'stringify', function stringify(value) { + if (typeof value === 'symbol') { return; } + var replacer; + if (arguments.length > 1) { + replacer = arguments[1]; + } + var args = [value]; + if (!isArray(replacer)) { + var replaceFn = ES.IsCallable(replacer) ? replacer : null; + var wrappedReplacer = function (key, val) { + var parsedValue = replaceFn ? _call(replaceFn, this, key, val) : val; + if (typeof parsedValue !== 'symbol') { + if (Type.symbol(parsedValue)) { + return assignTo({})(parsedValue); + } else { + return parsedValue; + } + } + }; + args.push(wrappedReplacer); + } else { + // create wrapped replacer that handles an array replacer? + args.push(replacer); + } + if (arguments.length > 2) { + args.push(arguments[2]); + } + return origStringify.apply(this, args); + }); + } + + return globals; +})); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "../../node_modules/process/browser.js"))) + +/***/ }), + +/***/ "../../node_modules/eventemitter3/index.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/eventemitter3/index.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} + + +/***/ }), + +/***/ "../../node_modules/function-bind/implementation.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/function-bind/implementation.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var slice = Array.prototype.slice; +var toStr = Object.prototype.toString; +var funcType = '[object Function]'; + +module.exports = function bind(that) { + var target = this; + if (typeof target !== 'function' || toStr.call(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slice.call(arguments, 1); + + var bound; + var binder = function () { + if (this instanceof bound) { + var result = target.apply( + this, + args.concat(slice.call(arguments)) + ); + if (Object(result) === result) { + return result; + } + return this; + } else { + return target.apply( + that, + args.concat(slice.call(arguments)) + ); + } + }; + + var boundLength = Math.max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs.push('$' + i); + } + + bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder); + + if (target.prototype) { + var Empty = function Empty() {}; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + + return bound; +}; + + +/***/ }), + +/***/ "../../node_modules/function-bind/index.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/function-bind/index.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/function-bind/implementation.js"); + +module.exports = Function.prototype.bind || implementation; + + +/***/ }), + +/***/ "../../node_modules/function.prototype.name/implementation.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/function.prototype.name/implementation.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var functionsHaveNames = __webpack_require__(/*! functions-have-names */ "../../node_modules/functions-have-names/index.js")(); +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var functionToString = bind.call(Function.call, Function.prototype.toString); +var stringMatch = bind.call(Function.call, String.prototype.match); + +var classRegex = /^class /; + +var isClass = function isClassConstructor(fn) { + if (isCallable(fn)) { + return false; + } + if (typeof fn !== 'function') { + return false; + } + try { + var match = stringMatch(functionToString(fn), classRegex); + return !!match; + } catch (e) {} + return false; +}; + +var regex = /\s*function\s+([^(\s]*)\s*/; + +var functionProto = Function.prototype; + +module.exports = function getName() { + if (!isClass(this) && !isCallable(this)) { + throw new TypeError('Function.prototype.name sham getter called on non-function'); + } + if (functionsHaveNames) { + return this.name; + } + if (this === functionProto) { + return ''; + } + var str = functionToString(this); + var match = stringMatch(str, regex); + var name = match && match[1]; + return name; +}; + + +/***/ }), + +/***/ "../../node_modules/function.prototype.name/polyfill.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/function.prototype.name/polyfill.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/function.prototype.name/implementation.js"); + +module.exports = function getPolyfill() { + return implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/function.prototype.name/shim.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/function.prototype.name/shim.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var supportsDescriptors = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js").supportsDescriptors; +var functionsHaveNames = __webpack_require__(/*! functions-have-names */ "../../node_modules/functions-have-names/index.js")(); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/function.prototype.name/polyfill.js"); +var defineProperty = Object.defineProperty; +var TypeErr = TypeError; + +module.exports = function shimName() { + var polyfill = getPolyfill(); + if (functionsHaveNames) { + return polyfill; + } + if (!supportsDescriptors) { + throw new TypeErr('Shimming Function.prototype.name support requires ES5 property descriptor support.'); + } + var functionProto = Function.prototype; + defineProperty(functionProto, 'name', { + configurable: true, + enumerable: false, + get: function () { + var name = polyfill.call(this); + if (this !== functionProto) { + defineProperty(this, 'name', { + configurable: true, + enumerable: false, + value: name, + writable: false + }); + } + return name; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/functions-have-names/index.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/functions-have-names/index.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var functionsHaveNames = function functionsHaveNames() { + return typeof function f() {}.name === 'string'; +}; + +var gOPD = Object.getOwnPropertyDescriptor; + +functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() { + return functionsHaveNames() && gOPD && !!gOPD(function () {}, 'name').configurable; +}; + +var $bind = Function.prototype.bind; + +functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() { + return functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== ''; +}; + +module.exports = functionsHaveNames; + + +/***/ }), + +/***/ "../../node_modules/global/window.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/global/window.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var win; + +if (typeof window !== "undefined") { + win = window; +} else if (typeof global !== "undefined") { + win = global; +} else if (typeof self !== "undefined"){ + win = self; +} else { + win = {}; +} + +module.exports = win; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/globalthis/auto.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/globalthis/auto.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./shim */ "../../node_modules/globalthis/shim.js")(); + + +/***/ }), + +/***/ "../../node_modules/globalthis/implementation.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/globalthis/implementation.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/* globals self, window, global */ +/* eslint no-negated-condition: 0, no-new-func: 0 */ + + + +if (typeof self !== 'undefined') { + module.exports = self; +} else if (typeof window !== 'undefined') { + module.exports = window; +} else if (typeof global !== 'undefined') { + module.exports = global; +} else { + module.exports = Function('return this')(); +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/globalthis/polyfill.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/globalthis/polyfill.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/globalthis/implementation.js"); + +module.exports = function getPolyfill() { + if (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) { + return implementation; + } + return global; +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/globalthis/shim.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/globalthis/shim.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/globalthis/polyfill.js"); + +module.exports = function shimGlobal() { + var polyfill = getPolyfill(); + if (define.supportsDescriptors) { + var descriptor = Object.getOwnPropertyDescriptor(polyfill, 'globalThis'); + if (!descriptor || (descriptor.configurable && (descriptor.enumerable || descriptor.writable || globalThis !== polyfill))) { // eslint-disable-line max-len + Object.defineProperty(polyfill, 'globalThis', { + configurable: true, + enumerable: false, + value: polyfill, + writable: false + }); + } + } else if (typeof globalThis !== 'object' || globalThis !== polyfill) { + polyfill.globalThis = polyfill; + } + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/has-symbols/index.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/has-symbols/index.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var origSymbol = global.Symbol; +var hasSymbolSham = __webpack_require__(/*! ./shams */ "../../node_modules/has-symbols/shams.js"); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/has-symbols/shams.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/has-symbols/shams.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* eslint complexity: [2, 17], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/has/src/index.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/has/src/index.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); + +module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); + + +/***/ }), + +/***/ "../../node_modules/html-entities/index.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/html-entities/index.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = { + XmlEntities: __webpack_require__(/*! ./lib/xml-entities.js */ "../../node_modules/html-entities/lib/xml-entities.js"), + Html4Entities: __webpack_require__(/*! ./lib/html4-entities.js */ "../../node_modules/html-entities/lib/html4-entities.js"), + Html5Entities: __webpack_require__(/*! ./lib/html5-entities.js */ "../../node_modules/html-entities/lib/html5-entities.js"), + AllHtmlEntities: __webpack_require__(/*! ./lib/html5-entities.js */ "../../node_modules/html-entities/lib/html5-entities.js") +}; + + +/***/ }), + +/***/ "../../node_modules/html-entities/lib/html4-entities.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/html-entities/lib/html4-entities.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var HTML_ALPHA = ['apos', 'nbsp', 'iexcl', 'cent', 'pound', 'curren', 'yen', 'brvbar', 'sect', 'uml', 'copy', 'ordf', 'laquo', 'not', 'shy', 'reg', 'macr', 'deg', 'plusmn', 'sup2', 'sup3', 'acute', 'micro', 'para', 'middot', 'cedil', 'sup1', 'ordm', 'raquo', 'frac14', 'frac12', 'frac34', 'iquest', 'Agrave', 'Aacute', 'Acirc', 'Atilde', 'Auml', 'Aring', 'Aelig', 'Ccedil', 'Egrave', 'Eacute', 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml', 'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde', 'Ouml', 'times', 'Oslash', 'Ugrave', 'Uacute', 'Ucirc', 'Uuml', 'Yacute', 'THORN', 'szlig', 'agrave', 'aacute', 'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil', 'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute', 'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute', 'ocirc', 'otilde', 'ouml', 'divide', 'oslash', 'ugrave', 'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml', 'quot', 'amp', 'lt', 'gt', 'OElig', 'oelig', 'Scaron', 'scaron', 'Yuml', 'circ', 'tilde', 'ensp', 'emsp', 'thinsp', 'zwnj', 'zwj', 'lrm', 'rlm', 'ndash', 'mdash', 'lsquo', 'rsquo', 'sbquo', 'ldquo', 'rdquo', 'bdquo', 'dagger', 'Dagger', 'permil', 'lsaquo', 'rsaquo', 'euro', 'fnof', 'Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Xi', 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'Phi', 'Chi', 'Psi', 'Omega', 'alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho', 'sigmaf', 'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega', 'thetasym', 'upsih', 'piv', 'bull', 'hellip', 'prime', 'Prime', 'oline', 'frasl', 'weierp', 'image', 'real', 'trade', 'alefsym', 'larr', 'uarr', 'rarr', 'darr', 'harr', 'crarr', 'lArr', 'uArr', 'rArr', 'dArr', 'hArr', 'forall', 'part', 'exist', 'empty', 'nabla', 'isin', 'notin', 'ni', 'prod', 'sum', 'minus', 'lowast', 'radic', 'prop', 'infin', 'ang', 'and', 'or', 'cap', 'cup', 'int', 'there4', 'sim', 'cong', 'asymp', 'ne', 'equiv', 'le', 'ge', 'sub', 'sup', 'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp', 'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang', 'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams']; +var HTML_CODES = [39, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 34, 38, 60, 62, 338, 339, 352, 353, 376, 710, 732, 8194, 8195, 8201, 8204, 8205, 8206, 8207, 8211, 8212, 8216, 8217, 8218, 8220, 8221, 8222, 8224, 8225, 8240, 8249, 8250, 8364, 402, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 977, 978, 982, 8226, 8230, 8242, 8243, 8254, 8260, 8472, 8465, 8476, 8482, 8501, 8592, 8593, 8594, 8595, 8596, 8629, 8656, 8657, 8658, 8659, 8660, 8704, 8706, 8707, 8709, 8711, 8712, 8713, 8715, 8719, 8721, 8722, 8727, 8730, 8733, 8734, 8736, 8743, 8744, 8745, 8746, 8747, 8756, 8764, 8773, 8776, 8800, 8801, 8804, 8805, 8834, 8835, 8836, 8838, 8839, 8853, 8855, 8869, 8901, 8968, 8969, 8970, 8971, 9001, 9002, 9674, 9824, 9827, 9829, 9830]; + +var alphaIndex = {}; +var numIndex = {}; + +var i = 0; +var length = HTML_ALPHA.length; +while (i < length) { + var a = HTML_ALPHA[i]; + var c = HTML_CODES[i]; + alphaIndex[a] = String.fromCharCode(c); + numIndex[c] = a; + i++; +} + +/** + * @constructor + */ +function Html4Entities() {} + +/** + * @param {String} str + * @returns {String} + */ +Html4Entities.prototype.decode = function(str) { + if (!str || !str.length) { + return ''; + } + return str.replace(/&(#?[\w\d]+);?/g, function(s, entity) { + var chr; + if (entity.charAt(0) === "#") { + var code = entity.charAt(1).toLowerCase() === 'x' ? + parseInt(entity.substr(2), 16) : + parseInt(entity.substr(1)); + + if (!(isNaN(code) || code < -32768 || code > 65535)) { + chr = String.fromCharCode(code); + } + } else { + chr = alphaIndex[entity]; + } + return chr || s; + }); +}; + +/** + * @param {String} str + * @returns {String} + */ +Html4Entities.decode = function(str) { + return new Html4Entities().decode(str); +}; + +/** + * @param {String} str + * @returns {String} + */ +Html4Entities.prototype.encode = function(str) { + if (!str || !str.length) { + return ''; + } + var strLength = str.length; + var result = ''; + var i = 0; + while (i < strLength) { + var alpha = numIndex[str.charCodeAt(i)]; + result += alpha ? "&" + alpha + ";" : str.charAt(i); + i++; + } + return result; +}; + +/** + * @param {String} str + * @returns {String} + */ +Html4Entities.encode = function(str) { + return new Html4Entities().encode(str); +}; + +/** + * @param {String} str + * @returns {String} + */ +Html4Entities.prototype.encodeNonUTF = function(str) { + if (!str || !str.length) { + return ''; + } + var strLength = str.length; + var result = ''; + var i = 0; + while (i < strLength) { + var cc = str.charCodeAt(i); + var alpha = numIndex[cc]; + if (alpha) { + result += "&" + alpha + ";"; + } else if (cc < 32 || cc > 126) { + result += "&#" + cc + ";"; + } else { + result += str.charAt(i); + } + i++; + } + return result; +}; + +/** + * @param {String} str + * @returns {String} + */ +Html4Entities.encodeNonUTF = function(str) { + return new Html4Entities().encodeNonUTF(str); +}; + +/** + * @param {String} str + * @returns {String} + */ +Html4Entities.prototype.encodeNonASCII = function(str) { + if (!str || !str.length) { + return ''; + } + var strLength = str.length; + var result = ''; + var i = 0; + while (i < strLength) { + var c = str.charCodeAt(i); + if (c <= 255) { + result += str[i++]; + continue; + } + result += '&#' + c + ';'; + i++; + } + return result; +}; + +/** + * @param {String} str + * @returns {String} + */ +Html4Entities.encodeNonASCII = function(str) { + return new Html4Entities().encodeNonASCII(str); +}; + +module.exports = Html4Entities; + + +/***/ }), + +/***/ "../../node_modules/html-entities/lib/html5-entities.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/html-entities/lib/html5-entities.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var ENTITIES = [['Aacute', [193]], ['aacute', [225]], ['Abreve', [258]], ['abreve', [259]], ['ac', [8766]], ['acd', [8767]], ['acE', [8766, 819]], ['Acirc', [194]], ['acirc', [226]], ['acute', [180]], ['Acy', [1040]], ['acy', [1072]], ['AElig', [198]], ['aelig', [230]], ['af', [8289]], ['Afr', [120068]], ['afr', [120094]], ['Agrave', [192]], ['agrave', [224]], ['alefsym', [8501]], ['aleph', [8501]], ['Alpha', [913]], ['alpha', [945]], ['Amacr', [256]], ['amacr', [257]], ['amalg', [10815]], ['amp', [38]], ['AMP', [38]], ['andand', [10837]], ['And', [10835]], ['and', [8743]], ['andd', [10844]], ['andslope', [10840]], ['andv', [10842]], ['ang', [8736]], ['ange', [10660]], ['angle', [8736]], ['angmsdaa', [10664]], ['angmsdab', [10665]], ['angmsdac', [10666]], ['angmsdad', [10667]], ['angmsdae', [10668]], ['angmsdaf', [10669]], ['angmsdag', [10670]], ['angmsdah', [10671]], ['angmsd', [8737]], ['angrt', [8735]], ['angrtvb', [8894]], ['angrtvbd', [10653]], ['angsph', [8738]], ['angst', [197]], ['angzarr', [9084]], ['Aogon', [260]], ['aogon', [261]], ['Aopf', [120120]], ['aopf', [120146]], ['apacir', [10863]], ['ap', [8776]], ['apE', [10864]], ['ape', [8778]], ['apid', [8779]], ['apos', [39]], ['ApplyFunction', [8289]], ['approx', [8776]], ['approxeq', [8778]], ['Aring', [197]], ['aring', [229]], ['Ascr', [119964]], ['ascr', [119990]], ['Assign', [8788]], ['ast', [42]], ['asymp', [8776]], ['asympeq', [8781]], ['Atilde', [195]], ['atilde', [227]], ['Auml', [196]], ['auml', [228]], ['awconint', [8755]], ['awint', [10769]], ['backcong', [8780]], ['backepsilon', [1014]], ['backprime', [8245]], ['backsim', [8765]], ['backsimeq', [8909]], ['Backslash', [8726]], ['Barv', [10983]], ['barvee', [8893]], ['barwed', [8965]], ['Barwed', [8966]], ['barwedge', [8965]], ['bbrk', [9141]], ['bbrktbrk', [9142]], ['bcong', [8780]], ['Bcy', [1041]], ['bcy', [1073]], ['bdquo', [8222]], ['becaus', [8757]], ['because', [8757]], ['Because', [8757]], ['bemptyv', [10672]], ['bepsi', [1014]], ['bernou', [8492]], ['Bernoullis', [8492]], ['Beta', [914]], ['beta', [946]], ['beth', [8502]], ['between', [8812]], ['Bfr', [120069]], ['bfr', [120095]], ['bigcap', [8898]], ['bigcirc', [9711]], ['bigcup', [8899]], ['bigodot', [10752]], ['bigoplus', [10753]], ['bigotimes', [10754]], ['bigsqcup', [10758]], ['bigstar', [9733]], ['bigtriangledown', [9661]], ['bigtriangleup', [9651]], ['biguplus', [10756]], ['bigvee', [8897]], ['bigwedge', [8896]], ['bkarow', [10509]], ['blacklozenge', [10731]], ['blacksquare', [9642]], ['blacktriangle', [9652]], ['blacktriangledown', [9662]], ['blacktriangleleft', [9666]], ['blacktriangleright', [9656]], ['blank', [9251]], ['blk12', [9618]], ['blk14', [9617]], ['blk34', [9619]], ['block', [9608]], ['bne', [61, 8421]], ['bnequiv', [8801, 8421]], ['bNot', [10989]], ['bnot', [8976]], ['Bopf', [120121]], ['bopf', [120147]], ['bot', [8869]], ['bottom', [8869]], ['bowtie', [8904]], ['boxbox', [10697]], ['boxdl', [9488]], ['boxdL', [9557]], ['boxDl', [9558]], ['boxDL', [9559]], ['boxdr', [9484]], ['boxdR', [9554]], ['boxDr', [9555]], ['boxDR', [9556]], ['boxh', [9472]], ['boxH', [9552]], ['boxhd', [9516]], ['boxHd', [9572]], ['boxhD', [9573]], ['boxHD', [9574]], ['boxhu', [9524]], ['boxHu', [9575]], ['boxhU', [9576]], ['boxHU', [9577]], ['boxminus', [8863]], ['boxplus', [8862]], ['boxtimes', [8864]], ['boxul', [9496]], ['boxuL', [9563]], ['boxUl', [9564]], ['boxUL', [9565]], ['boxur', [9492]], ['boxuR', [9560]], ['boxUr', [9561]], ['boxUR', [9562]], ['boxv', [9474]], ['boxV', [9553]], ['boxvh', [9532]], ['boxvH', [9578]], ['boxVh', [9579]], ['boxVH', [9580]], ['boxvl', [9508]], ['boxvL', [9569]], ['boxVl', [9570]], ['boxVL', [9571]], ['boxvr', [9500]], ['boxvR', [9566]], ['boxVr', [9567]], ['boxVR', [9568]], ['bprime', [8245]], ['breve', [728]], ['Breve', [728]], ['brvbar', [166]], ['bscr', [119991]], ['Bscr', [8492]], ['bsemi', [8271]], ['bsim', [8765]], ['bsime', [8909]], ['bsolb', [10693]], ['bsol', [92]], ['bsolhsub', [10184]], ['bull', [8226]], ['bullet', [8226]], ['bump', [8782]], ['bumpE', [10926]], ['bumpe', [8783]], ['Bumpeq', [8782]], ['bumpeq', [8783]], ['Cacute', [262]], ['cacute', [263]], ['capand', [10820]], ['capbrcup', [10825]], ['capcap', [10827]], ['cap', [8745]], ['Cap', [8914]], ['capcup', [10823]], ['capdot', [10816]], ['CapitalDifferentialD', [8517]], ['caps', [8745, 65024]], ['caret', [8257]], ['caron', [711]], ['Cayleys', [8493]], ['ccaps', [10829]], ['Ccaron', [268]], ['ccaron', [269]], ['Ccedil', [199]], ['ccedil', [231]], ['Ccirc', [264]], ['ccirc', [265]], ['Cconint', [8752]], ['ccups', [10828]], ['ccupssm', [10832]], ['Cdot', [266]], ['cdot', [267]], ['cedil', [184]], ['Cedilla', [184]], ['cemptyv', [10674]], ['cent', [162]], ['centerdot', [183]], ['CenterDot', [183]], ['cfr', [120096]], ['Cfr', [8493]], ['CHcy', [1063]], ['chcy', [1095]], ['check', [10003]], ['checkmark', [10003]], ['Chi', [935]], ['chi', [967]], ['circ', [710]], ['circeq', [8791]], ['circlearrowleft', [8634]], ['circlearrowright', [8635]], ['circledast', [8859]], ['circledcirc', [8858]], ['circleddash', [8861]], ['CircleDot', [8857]], ['circledR', [174]], ['circledS', [9416]], ['CircleMinus', [8854]], ['CirclePlus', [8853]], ['CircleTimes', [8855]], ['cir', [9675]], ['cirE', [10691]], ['cire', [8791]], ['cirfnint', [10768]], ['cirmid', [10991]], ['cirscir', [10690]], ['ClockwiseContourIntegral', [8754]], ['clubs', [9827]], ['clubsuit', [9827]], ['colon', [58]], ['Colon', [8759]], ['Colone', [10868]], ['colone', [8788]], ['coloneq', [8788]], ['comma', [44]], ['commat', [64]], ['comp', [8705]], ['compfn', [8728]], ['complement', [8705]], ['complexes', [8450]], ['cong', [8773]], ['congdot', [10861]], ['Congruent', [8801]], ['conint', [8750]], ['Conint', [8751]], ['ContourIntegral', [8750]], ['copf', [120148]], ['Copf', [8450]], ['coprod', [8720]], ['Coproduct', [8720]], ['copy', [169]], ['COPY', [169]], ['copysr', [8471]], ['CounterClockwiseContourIntegral', [8755]], ['crarr', [8629]], ['cross', [10007]], ['Cross', [10799]], ['Cscr', [119966]], ['cscr', [119992]], ['csub', [10959]], ['csube', [10961]], ['csup', [10960]], ['csupe', [10962]], ['ctdot', [8943]], ['cudarrl', [10552]], ['cudarrr', [10549]], ['cuepr', [8926]], ['cuesc', [8927]], ['cularr', [8630]], ['cularrp', [10557]], ['cupbrcap', [10824]], ['cupcap', [10822]], ['CupCap', [8781]], ['cup', [8746]], ['Cup', [8915]], ['cupcup', [10826]], ['cupdot', [8845]], ['cupor', [10821]], ['cups', [8746, 65024]], ['curarr', [8631]], ['curarrm', [10556]], ['curlyeqprec', [8926]], ['curlyeqsucc', [8927]], ['curlyvee', [8910]], ['curlywedge', [8911]], ['curren', [164]], ['curvearrowleft', [8630]], ['curvearrowright', [8631]], ['cuvee', [8910]], ['cuwed', [8911]], ['cwconint', [8754]], ['cwint', [8753]], ['cylcty', [9005]], ['dagger', [8224]], ['Dagger', [8225]], ['daleth', [8504]], ['darr', [8595]], ['Darr', [8609]], ['dArr', [8659]], ['dash', [8208]], ['Dashv', [10980]], ['dashv', [8867]], ['dbkarow', [10511]], ['dblac', [733]], ['Dcaron', [270]], ['dcaron', [271]], ['Dcy', [1044]], ['dcy', [1076]], ['ddagger', [8225]], ['ddarr', [8650]], ['DD', [8517]], ['dd', [8518]], ['DDotrahd', [10513]], ['ddotseq', [10871]], ['deg', [176]], ['Del', [8711]], ['Delta', [916]], ['delta', [948]], ['demptyv', [10673]], ['dfisht', [10623]], ['Dfr', [120071]], ['dfr', [120097]], ['dHar', [10597]], ['dharl', [8643]], ['dharr', [8642]], ['DiacriticalAcute', [180]], ['DiacriticalDot', [729]], ['DiacriticalDoubleAcute', [733]], ['DiacriticalGrave', [96]], ['DiacriticalTilde', [732]], ['diam', [8900]], ['diamond', [8900]], ['Diamond', [8900]], ['diamondsuit', [9830]], ['diams', [9830]], ['die', [168]], ['DifferentialD', [8518]], ['digamma', [989]], ['disin', [8946]], ['div', [247]], ['divide', [247]], ['divideontimes', [8903]], ['divonx', [8903]], ['DJcy', [1026]], ['djcy', [1106]], ['dlcorn', [8990]], ['dlcrop', [8973]], ['dollar', [36]], ['Dopf', [120123]], ['dopf', [120149]], ['Dot', [168]], ['dot', [729]], ['DotDot', [8412]], ['doteq', [8784]], ['doteqdot', [8785]], ['DotEqual', [8784]], ['dotminus', [8760]], ['dotplus', [8724]], ['dotsquare', [8865]], ['doublebarwedge', [8966]], ['DoubleContourIntegral', [8751]], ['DoubleDot', [168]], ['DoubleDownArrow', [8659]], ['DoubleLeftArrow', [8656]], ['DoubleLeftRightArrow', [8660]], ['DoubleLeftTee', [10980]], ['DoubleLongLeftArrow', [10232]], ['DoubleLongLeftRightArrow', [10234]], ['DoubleLongRightArrow', [10233]], ['DoubleRightArrow', [8658]], ['DoubleRightTee', [8872]], ['DoubleUpArrow', [8657]], ['DoubleUpDownArrow', [8661]], ['DoubleVerticalBar', [8741]], ['DownArrowBar', [10515]], ['downarrow', [8595]], ['DownArrow', [8595]], ['Downarrow', [8659]], ['DownArrowUpArrow', [8693]], ['DownBreve', [785]], ['downdownarrows', [8650]], ['downharpoonleft', [8643]], ['downharpoonright', [8642]], ['DownLeftRightVector', [10576]], ['DownLeftTeeVector', [10590]], ['DownLeftVectorBar', [10582]], ['DownLeftVector', [8637]], ['DownRightTeeVector', [10591]], ['DownRightVectorBar', [10583]], ['DownRightVector', [8641]], ['DownTeeArrow', [8615]], ['DownTee', [8868]], ['drbkarow', [10512]], ['drcorn', [8991]], ['drcrop', [8972]], ['Dscr', [119967]], ['dscr', [119993]], ['DScy', [1029]], ['dscy', [1109]], ['dsol', [10742]], ['Dstrok', [272]], ['dstrok', [273]], ['dtdot', [8945]], ['dtri', [9663]], ['dtrif', [9662]], ['duarr', [8693]], ['duhar', [10607]], ['dwangle', [10662]], ['DZcy', [1039]], ['dzcy', [1119]], ['dzigrarr', [10239]], ['Eacute', [201]], ['eacute', [233]], ['easter', [10862]], ['Ecaron', [282]], ['ecaron', [283]], ['Ecirc', [202]], ['ecirc', [234]], ['ecir', [8790]], ['ecolon', [8789]], ['Ecy', [1069]], ['ecy', [1101]], ['eDDot', [10871]], ['Edot', [278]], ['edot', [279]], ['eDot', [8785]], ['ee', [8519]], ['efDot', [8786]], ['Efr', [120072]], ['efr', [120098]], ['eg', [10906]], ['Egrave', [200]], ['egrave', [232]], ['egs', [10902]], ['egsdot', [10904]], ['el', [10905]], ['Element', [8712]], ['elinters', [9191]], ['ell', [8467]], ['els', [10901]], ['elsdot', [10903]], ['Emacr', [274]], ['emacr', [275]], ['empty', [8709]], ['emptyset', [8709]], ['EmptySmallSquare', [9723]], ['emptyv', [8709]], ['EmptyVerySmallSquare', [9643]], ['emsp13', [8196]], ['emsp14', [8197]], ['emsp', [8195]], ['ENG', [330]], ['eng', [331]], ['ensp', [8194]], ['Eogon', [280]], ['eogon', [281]], ['Eopf', [120124]], ['eopf', [120150]], ['epar', [8917]], ['eparsl', [10723]], ['eplus', [10865]], ['epsi', [949]], ['Epsilon', [917]], ['epsilon', [949]], ['epsiv', [1013]], ['eqcirc', [8790]], ['eqcolon', [8789]], ['eqsim', [8770]], ['eqslantgtr', [10902]], ['eqslantless', [10901]], ['Equal', [10869]], ['equals', [61]], ['EqualTilde', [8770]], ['equest', [8799]], ['Equilibrium', [8652]], ['equiv', [8801]], ['equivDD', [10872]], ['eqvparsl', [10725]], ['erarr', [10609]], ['erDot', [8787]], ['escr', [8495]], ['Escr', [8496]], ['esdot', [8784]], ['Esim', [10867]], ['esim', [8770]], ['Eta', [919]], ['eta', [951]], ['ETH', [208]], ['eth', [240]], ['Euml', [203]], ['euml', [235]], ['euro', [8364]], ['excl', [33]], ['exist', [8707]], ['Exists', [8707]], ['expectation', [8496]], ['exponentiale', [8519]], ['ExponentialE', [8519]], ['fallingdotseq', [8786]], ['Fcy', [1060]], ['fcy', [1092]], ['female', [9792]], ['ffilig', [64259]], ['fflig', [64256]], ['ffllig', [64260]], ['Ffr', [120073]], ['ffr', [120099]], ['filig', [64257]], ['FilledSmallSquare', [9724]], ['FilledVerySmallSquare', [9642]], ['fjlig', [102, 106]], ['flat', [9837]], ['fllig', [64258]], ['fltns', [9649]], ['fnof', [402]], ['Fopf', [120125]], ['fopf', [120151]], ['forall', [8704]], ['ForAll', [8704]], ['fork', [8916]], ['forkv', [10969]], ['Fouriertrf', [8497]], ['fpartint', [10765]], ['frac12', [189]], ['frac13', [8531]], ['frac14', [188]], ['frac15', [8533]], ['frac16', [8537]], ['frac18', [8539]], ['frac23', [8532]], ['frac25', [8534]], ['frac34', [190]], ['frac35', [8535]], ['frac38', [8540]], ['frac45', [8536]], ['frac56', [8538]], ['frac58', [8541]], ['frac78', [8542]], ['frasl', [8260]], ['frown', [8994]], ['fscr', [119995]], ['Fscr', [8497]], ['gacute', [501]], ['Gamma', [915]], ['gamma', [947]], ['Gammad', [988]], ['gammad', [989]], ['gap', [10886]], ['Gbreve', [286]], ['gbreve', [287]], ['Gcedil', [290]], ['Gcirc', [284]], ['gcirc', [285]], ['Gcy', [1043]], ['gcy', [1075]], ['Gdot', [288]], ['gdot', [289]], ['ge', [8805]], ['gE', [8807]], ['gEl', [10892]], ['gel', [8923]], ['geq', [8805]], ['geqq', [8807]], ['geqslant', [10878]], ['gescc', [10921]], ['ges', [10878]], ['gesdot', [10880]], ['gesdoto', [10882]], ['gesdotol', [10884]], ['gesl', [8923, 65024]], ['gesles', [10900]], ['Gfr', [120074]], ['gfr', [120100]], ['gg', [8811]], ['Gg', [8921]], ['ggg', [8921]], ['gimel', [8503]], ['GJcy', [1027]], ['gjcy', [1107]], ['gla', [10917]], ['gl', [8823]], ['glE', [10898]], ['glj', [10916]], ['gnap', [10890]], ['gnapprox', [10890]], ['gne', [10888]], ['gnE', [8809]], ['gneq', [10888]], ['gneqq', [8809]], ['gnsim', [8935]], ['Gopf', [120126]], ['gopf', [120152]], ['grave', [96]], ['GreaterEqual', [8805]], ['GreaterEqualLess', [8923]], ['GreaterFullEqual', [8807]], ['GreaterGreater', [10914]], ['GreaterLess', [8823]], ['GreaterSlantEqual', [10878]], ['GreaterTilde', [8819]], ['Gscr', [119970]], ['gscr', [8458]], ['gsim', [8819]], ['gsime', [10894]], ['gsiml', [10896]], ['gtcc', [10919]], ['gtcir', [10874]], ['gt', [62]], ['GT', [62]], ['Gt', [8811]], ['gtdot', [8919]], ['gtlPar', [10645]], ['gtquest', [10876]], ['gtrapprox', [10886]], ['gtrarr', [10616]], ['gtrdot', [8919]], ['gtreqless', [8923]], ['gtreqqless', [10892]], ['gtrless', [8823]], ['gtrsim', [8819]], ['gvertneqq', [8809, 65024]], ['gvnE', [8809, 65024]], ['Hacek', [711]], ['hairsp', [8202]], ['half', [189]], ['hamilt', [8459]], ['HARDcy', [1066]], ['hardcy', [1098]], ['harrcir', [10568]], ['harr', [8596]], ['hArr', [8660]], ['harrw', [8621]], ['Hat', [94]], ['hbar', [8463]], ['Hcirc', [292]], ['hcirc', [293]], ['hearts', [9829]], ['heartsuit', [9829]], ['hellip', [8230]], ['hercon', [8889]], ['hfr', [120101]], ['Hfr', [8460]], ['HilbertSpace', [8459]], ['hksearow', [10533]], ['hkswarow', [10534]], ['hoarr', [8703]], ['homtht', [8763]], ['hookleftarrow', [8617]], ['hookrightarrow', [8618]], ['hopf', [120153]], ['Hopf', [8461]], ['horbar', [8213]], ['HorizontalLine', [9472]], ['hscr', [119997]], ['Hscr', [8459]], ['hslash', [8463]], ['Hstrok', [294]], ['hstrok', [295]], ['HumpDownHump', [8782]], ['HumpEqual', [8783]], ['hybull', [8259]], ['hyphen', [8208]], ['Iacute', [205]], ['iacute', [237]], ['ic', [8291]], ['Icirc', [206]], ['icirc', [238]], ['Icy', [1048]], ['icy', [1080]], ['Idot', [304]], ['IEcy', [1045]], ['iecy', [1077]], ['iexcl', [161]], ['iff', [8660]], ['ifr', [120102]], ['Ifr', [8465]], ['Igrave', [204]], ['igrave', [236]], ['ii', [8520]], ['iiiint', [10764]], ['iiint', [8749]], ['iinfin', [10716]], ['iiota', [8489]], ['IJlig', [306]], ['ijlig', [307]], ['Imacr', [298]], ['imacr', [299]], ['image', [8465]], ['ImaginaryI', [8520]], ['imagline', [8464]], ['imagpart', [8465]], ['imath', [305]], ['Im', [8465]], ['imof', [8887]], ['imped', [437]], ['Implies', [8658]], ['incare', [8453]], ['in', [8712]], ['infin', [8734]], ['infintie', [10717]], ['inodot', [305]], ['intcal', [8890]], ['int', [8747]], ['Int', [8748]], ['integers', [8484]], ['Integral', [8747]], ['intercal', [8890]], ['Intersection', [8898]], ['intlarhk', [10775]], ['intprod', [10812]], ['InvisibleComma', [8291]], ['InvisibleTimes', [8290]], ['IOcy', [1025]], ['iocy', [1105]], ['Iogon', [302]], ['iogon', [303]], ['Iopf', [120128]], ['iopf', [120154]], ['Iota', [921]], ['iota', [953]], ['iprod', [10812]], ['iquest', [191]], ['iscr', [119998]], ['Iscr', [8464]], ['isin', [8712]], ['isindot', [8949]], ['isinE', [8953]], ['isins', [8948]], ['isinsv', [8947]], ['isinv', [8712]], ['it', [8290]], ['Itilde', [296]], ['itilde', [297]], ['Iukcy', [1030]], ['iukcy', [1110]], ['Iuml', [207]], ['iuml', [239]], ['Jcirc', [308]], ['jcirc', [309]], ['Jcy', [1049]], ['jcy', [1081]], ['Jfr', [120077]], ['jfr', [120103]], ['jmath', [567]], ['Jopf', [120129]], ['jopf', [120155]], ['Jscr', [119973]], ['jscr', [119999]], ['Jsercy', [1032]], ['jsercy', [1112]], ['Jukcy', [1028]], ['jukcy', [1108]], ['Kappa', [922]], ['kappa', [954]], ['kappav', [1008]], ['Kcedil', [310]], ['kcedil', [311]], ['Kcy', [1050]], ['kcy', [1082]], ['Kfr', [120078]], ['kfr', [120104]], ['kgreen', [312]], ['KHcy', [1061]], ['khcy', [1093]], ['KJcy', [1036]], ['kjcy', [1116]], ['Kopf', [120130]], ['kopf', [120156]], ['Kscr', [119974]], ['kscr', [120000]], ['lAarr', [8666]], ['Lacute', [313]], ['lacute', [314]], ['laemptyv', [10676]], ['lagran', [8466]], ['Lambda', [923]], ['lambda', [955]], ['lang', [10216]], ['Lang', [10218]], ['langd', [10641]], ['langle', [10216]], ['lap', [10885]], ['Laplacetrf', [8466]], ['laquo', [171]], ['larrb', [8676]], ['larrbfs', [10527]], ['larr', [8592]], ['Larr', [8606]], ['lArr', [8656]], ['larrfs', [10525]], ['larrhk', [8617]], ['larrlp', [8619]], ['larrpl', [10553]], ['larrsim', [10611]], ['larrtl', [8610]], ['latail', [10521]], ['lAtail', [10523]], ['lat', [10923]], ['late', [10925]], ['lates', [10925, 65024]], ['lbarr', [10508]], ['lBarr', [10510]], ['lbbrk', [10098]], ['lbrace', [123]], ['lbrack', [91]], ['lbrke', [10635]], ['lbrksld', [10639]], ['lbrkslu', [10637]], ['Lcaron', [317]], ['lcaron', [318]], ['Lcedil', [315]], ['lcedil', [316]], ['lceil', [8968]], ['lcub', [123]], ['Lcy', [1051]], ['lcy', [1083]], ['ldca', [10550]], ['ldquo', [8220]], ['ldquor', [8222]], ['ldrdhar', [10599]], ['ldrushar', [10571]], ['ldsh', [8626]], ['le', [8804]], ['lE', [8806]], ['LeftAngleBracket', [10216]], ['LeftArrowBar', [8676]], ['leftarrow', [8592]], ['LeftArrow', [8592]], ['Leftarrow', [8656]], ['LeftArrowRightArrow', [8646]], ['leftarrowtail', [8610]], ['LeftCeiling', [8968]], ['LeftDoubleBracket', [10214]], ['LeftDownTeeVector', [10593]], ['LeftDownVectorBar', [10585]], ['LeftDownVector', [8643]], ['LeftFloor', [8970]], ['leftharpoondown', [8637]], ['leftharpoonup', [8636]], ['leftleftarrows', [8647]], ['leftrightarrow', [8596]], ['LeftRightArrow', [8596]], ['Leftrightarrow', [8660]], ['leftrightarrows', [8646]], ['leftrightharpoons', [8651]], ['leftrightsquigarrow', [8621]], ['LeftRightVector', [10574]], ['LeftTeeArrow', [8612]], ['LeftTee', [8867]], ['LeftTeeVector', [10586]], ['leftthreetimes', [8907]], ['LeftTriangleBar', [10703]], ['LeftTriangle', [8882]], ['LeftTriangleEqual', [8884]], ['LeftUpDownVector', [10577]], ['LeftUpTeeVector', [10592]], ['LeftUpVectorBar', [10584]], ['LeftUpVector', [8639]], ['LeftVectorBar', [10578]], ['LeftVector', [8636]], ['lEg', [10891]], ['leg', [8922]], ['leq', [8804]], ['leqq', [8806]], ['leqslant', [10877]], ['lescc', [10920]], ['les', [10877]], ['lesdot', [10879]], ['lesdoto', [10881]], ['lesdotor', [10883]], ['lesg', [8922, 65024]], ['lesges', [10899]], ['lessapprox', [10885]], ['lessdot', [8918]], ['lesseqgtr', [8922]], ['lesseqqgtr', [10891]], ['LessEqualGreater', [8922]], ['LessFullEqual', [8806]], ['LessGreater', [8822]], ['lessgtr', [8822]], ['LessLess', [10913]], ['lesssim', [8818]], ['LessSlantEqual', [10877]], ['LessTilde', [8818]], ['lfisht', [10620]], ['lfloor', [8970]], ['Lfr', [120079]], ['lfr', [120105]], ['lg', [8822]], ['lgE', [10897]], ['lHar', [10594]], ['lhard', [8637]], ['lharu', [8636]], ['lharul', [10602]], ['lhblk', [9604]], ['LJcy', [1033]], ['ljcy', [1113]], ['llarr', [8647]], ['ll', [8810]], ['Ll', [8920]], ['llcorner', [8990]], ['Lleftarrow', [8666]], ['llhard', [10603]], ['lltri', [9722]], ['Lmidot', [319]], ['lmidot', [320]], ['lmoustache', [9136]], ['lmoust', [9136]], ['lnap', [10889]], ['lnapprox', [10889]], ['lne', [10887]], ['lnE', [8808]], ['lneq', [10887]], ['lneqq', [8808]], ['lnsim', [8934]], ['loang', [10220]], ['loarr', [8701]], ['lobrk', [10214]], ['longleftarrow', [10229]], ['LongLeftArrow', [10229]], ['Longleftarrow', [10232]], ['longleftrightarrow', [10231]], ['LongLeftRightArrow', [10231]], ['Longleftrightarrow', [10234]], ['longmapsto', [10236]], ['longrightarrow', [10230]], ['LongRightArrow', [10230]], ['Longrightarrow', [10233]], ['looparrowleft', [8619]], ['looparrowright', [8620]], ['lopar', [10629]], ['Lopf', [120131]], ['lopf', [120157]], ['loplus', [10797]], ['lotimes', [10804]], ['lowast', [8727]], ['lowbar', [95]], ['LowerLeftArrow', [8601]], ['LowerRightArrow', [8600]], ['loz', [9674]], ['lozenge', [9674]], ['lozf', [10731]], ['lpar', [40]], ['lparlt', [10643]], ['lrarr', [8646]], ['lrcorner', [8991]], ['lrhar', [8651]], ['lrhard', [10605]], ['lrm', [8206]], ['lrtri', [8895]], ['lsaquo', [8249]], ['lscr', [120001]], ['Lscr', [8466]], ['lsh', [8624]], ['Lsh', [8624]], ['lsim', [8818]], ['lsime', [10893]], ['lsimg', [10895]], ['lsqb', [91]], ['lsquo', [8216]], ['lsquor', [8218]], ['Lstrok', [321]], ['lstrok', [322]], ['ltcc', [10918]], ['ltcir', [10873]], ['lt', [60]], ['LT', [60]], ['Lt', [8810]], ['ltdot', [8918]], ['lthree', [8907]], ['ltimes', [8905]], ['ltlarr', [10614]], ['ltquest', [10875]], ['ltri', [9667]], ['ltrie', [8884]], ['ltrif', [9666]], ['ltrPar', [10646]], ['lurdshar', [10570]], ['luruhar', [10598]], ['lvertneqq', [8808, 65024]], ['lvnE', [8808, 65024]], ['macr', [175]], ['male', [9794]], ['malt', [10016]], ['maltese', [10016]], ['Map', [10501]], ['map', [8614]], ['mapsto', [8614]], ['mapstodown', [8615]], ['mapstoleft', [8612]], ['mapstoup', [8613]], ['marker', [9646]], ['mcomma', [10793]], ['Mcy', [1052]], ['mcy', [1084]], ['mdash', [8212]], ['mDDot', [8762]], ['measuredangle', [8737]], ['MediumSpace', [8287]], ['Mellintrf', [8499]], ['Mfr', [120080]], ['mfr', [120106]], ['mho', [8487]], ['micro', [181]], ['midast', [42]], ['midcir', [10992]], ['mid', [8739]], ['middot', [183]], ['minusb', [8863]], ['minus', [8722]], ['minusd', [8760]], ['minusdu', [10794]], ['MinusPlus', [8723]], ['mlcp', [10971]], ['mldr', [8230]], ['mnplus', [8723]], ['models', [8871]], ['Mopf', [120132]], ['mopf', [120158]], ['mp', [8723]], ['mscr', [120002]], ['Mscr', [8499]], ['mstpos', [8766]], ['Mu', [924]], ['mu', [956]], ['multimap', [8888]], ['mumap', [8888]], ['nabla', [8711]], ['Nacute', [323]], ['nacute', [324]], ['nang', [8736, 8402]], ['nap', [8777]], ['napE', [10864, 824]], ['napid', [8779, 824]], ['napos', [329]], ['napprox', [8777]], ['natural', [9838]], ['naturals', [8469]], ['natur', [9838]], ['nbsp', [160]], ['nbump', [8782, 824]], ['nbumpe', [8783, 824]], ['ncap', [10819]], ['Ncaron', [327]], ['ncaron', [328]], ['Ncedil', [325]], ['ncedil', [326]], ['ncong', [8775]], ['ncongdot', [10861, 824]], ['ncup', [10818]], ['Ncy', [1053]], ['ncy', [1085]], ['ndash', [8211]], ['nearhk', [10532]], ['nearr', [8599]], ['neArr', [8663]], ['nearrow', [8599]], ['ne', [8800]], ['nedot', [8784, 824]], ['NegativeMediumSpace', [8203]], ['NegativeThickSpace', [8203]], ['NegativeThinSpace', [8203]], ['NegativeVeryThinSpace', [8203]], ['nequiv', [8802]], ['nesear', [10536]], ['nesim', [8770, 824]], ['NestedGreaterGreater', [8811]], ['NestedLessLess', [8810]], ['nexist', [8708]], ['nexists', [8708]], ['Nfr', [120081]], ['nfr', [120107]], ['ngE', [8807, 824]], ['nge', [8817]], ['ngeq', [8817]], ['ngeqq', [8807, 824]], ['ngeqslant', [10878, 824]], ['nges', [10878, 824]], ['nGg', [8921, 824]], ['ngsim', [8821]], ['nGt', [8811, 8402]], ['ngt', [8815]], ['ngtr', [8815]], ['nGtv', [8811, 824]], ['nharr', [8622]], ['nhArr', [8654]], ['nhpar', [10994]], ['ni', [8715]], ['nis', [8956]], ['nisd', [8954]], ['niv', [8715]], ['NJcy', [1034]], ['njcy', [1114]], ['nlarr', [8602]], ['nlArr', [8653]], ['nldr', [8229]], ['nlE', [8806, 824]], ['nle', [8816]], ['nleftarrow', [8602]], ['nLeftarrow', [8653]], ['nleftrightarrow', [8622]], ['nLeftrightarrow', [8654]], ['nleq', [8816]], ['nleqq', [8806, 824]], ['nleqslant', [10877, 824]], ['nles', [10877, 824]], ['nless', [8814]], ['nLl', [8920, 824]], ['nlsim', [8820]], ['nLt', [8810, 8402]], ['nlt', [8814]], ['nltri', [8938]], ['nltrie', [8940]], ['nLtv', [8810, 824]], ['nmid', [8740]], ['NoBreak', [8288]], ['NonBreakingSpace', [160]], ['nopf', [120159]], ['Nopf', [8469]], ['Not', [10988]], ['not', [172]], ['NotCongruent', [8802]], ['NotCupCap', [8813]], ['NotDoubleVerticalBar', [8742]], ['NotElement', [8713]], ['NotEqual', [8800]], ['NotEqualTilde', [8770, 824]], ['NotExists', [8708]], ['NotGreater', [8815]], ['NotGreaterEqual', [8817]], ['NotGreaterFullEqual', [8807, 824]], ['NotGreaterGreater', [8811, 824]], ['NotGreaterLess', [8825]], ['NotGreaterSlantEqual', [10878, 824]], ['NotGreaterTilde', [8821]], ['NotHumpDownHump', [8782, 824]], ['NotHumpEqual', [8783, 824]], ['notin', [8713]], ['notindot', [8949, 824]], ['notinE', [8953, 824]], ['notinva', [8713]], ['notinvb', [8951]], ['notinvc', [8950]], ['NotLeftTriangleBar', [10703, 824]], ['NotLeftTriangle', [8938]], ['NotLeftTriangleEqual', [8940]], ['NotLess', [8814]], ['NotLessEqual', [8816]], ['NotLessGreater', [8824]], ['NotLessLess', [8810, 824]], ['NotLessSlantEqual', [10877, 824]], ['NotLessTilde', [8820]], ['NotNestedGreaterGreater', [10914, 824]], ['NotNestedLessLess', [10913, 824]], ['notni', [8716]], ['notniva', [8716]], ['notnivb', [8958]], ['notnivc', [8957]], ['NotPrecedes', [8832]], ['NotPrecedesEqual', [10927, 824]], ['NotPrecedesSlantEqual', [8928]], ['NotReverseElement', [8716]], ['NotRightTriangleBar', [10704, 824]], ['NotRightTriangle', [8939]], ['NotRightTriangleEqual', [8941]], ['NotSquareSubset', [8847, 824]], ['NotSquareSubsetEqual', [8930]], ['NotSquareSuperset', [8848, 824]], ['NotSquareSupersetEqual', [8931]], ['NotSubset', [8834, 8402]], ['NotSubsetEqual', [8840]], ['NotSucceeds', [8833]], ['NotSucceedsEqual', [10928, 824]], ['NotSucceedsSlantEqual', [8929]], ['NotSucceedsTilde', [8831, 824]], ['NotSuperset', [8835, 8402]], ['NotSupersetEqual', [8841]], ['NotTilde', [8769]], ['NotTildeEqual', [8772]], ['NotTildeFullEqual', [8775]], ['NotTildeTilde', [8777]], ['NotVerticalBar', [8740]], ['nparallel', [8742]], ['npar', [8742]], ['nparsl', [11005, 8421]], ['npart', [8706, 824]], ['npolint', [10772]], ['npr', [8832]], ['nprcue', [8928]], ['nprec', [8832]], ['npreceq', [10927, 824]], ['npre', [10927, 824]], ['nrarrc', [10547, 824]], ['nrarr', [8603]], ['nrArr', [8655]], ['nrarrw', [8605, 824]], ['nrightarrow', [8603]], ['nRightarrow', [8655]], ['nrtri', [8939]], ['nrtrie', [8941]], ['nsc', [8833]], ['nsccue', [8929]], ['nsce', [10928, 824]], ['Nscr', [119977]], ['nscr', [120003]], ['nshortmid', [8740]], ['nshortparallel', [8742]], ['nsim', [8769]], ['nsime', [8772]], ['nsimeq', [8772]], ['nsmid', [8740]], ['nspar', [8742]], ['nsqsube', [8930]], ['nsqsupe', [8931]], ['nsub', [8836]], ['nsubE', [10949, 824]], ['nsube', [8840]], ['nsubset', [8834, 8402]], ['nsubseteq', [8840]], ['nsubseteqq', [10949, 824]], ['nsucc', [8833]], ['nsucceq', [10928, 824]], ['nsup', [8837]], ['nsupE', [10950, 824]], ['nsupe', [8841]], ['nsupset', [8835, 8402]], ['nsupseteq', [8841]], ['nsupseteqq', [10950, 824]], ['ntgl', [8825]], ['Ntilde', [209]], ['ntilde', [241]], ['ntlg', [8824]], ['ntriangleleft', [8938]], ['ntrianglelefteq', [8940]], ['ntriangleright', [8939]], ['ntrianglerighteq', [8941]], ['Nu', [925]], ['nu', [957]], ['num', [35]], ['numero', [8470]], ['numsp', [8199]], ['nvap', [8781, 8402]], ['nvdash', [8876]], ['nvDash', [8877]], ['nVdash', [8878]], ['nVDash', [8879]], ['nvge', [8805, 8402]], ['nvgt', [62, 8402]], ['nvHarr', [10500]], ['nvinfin', [10718]], ['nvlArr', [10498]], ['nvle', [8804, 8402]], ['nvlt', [60, 8402]], ['nvltrie', [8884, 8402]], ['nvrArr', [10499]], ['nvrtrie', [8885, 8402]], ['nvsim', [8764, 8402]], ['nwarhk', [10531]], ['nwarr', [8598]], ['nwArr', [8662]], ['nwarrow', [8598]], ['nwnear', [10535]], ['Oacute', [211]], ['oacute', [243]], ['oast', [8859]], ['Ocirc', [212]], ['ocirc', [244]], ['ocir', [8858]], ['Ocy', [1054]], ['ocy', [1086]], ['odash', [8861]], ['Odblac', [336]], ['odblac', [337]], ['odiv', [10808]], ['odot', [8857]], ['odsold', [10684]], ['OElig', [338]], ['oelig', [339]], ['ofcir', [10687]], ['Ofr', [120082]], ['ofr', [120108]], ['ogon', [731]], ['Ograve', [210]], ['ograve', [242]], ['ogt', [10689]], ['ohbar', [10677]], ['ohm', [937]], ['oint', [8750]], ['olarr', [8634]], ['olcir', [10686]], ['olcross', [10683]], ['oline', [8254]], ['olt', [10688]], ['Omacr', [332]], ['omacr', [333]], ['Omega', [937]], ['omega', [969]], ['Omicron', [927]], ['omicron', [959]], ['omid', [10678]], ['ominus', [8854]], ['Oopf', [120134]], ['oopf', [120160]], ['opar', [10679]], ['OpenCurlyDoubleQuote', [8220]], ['OpenCurlyQuote', [8216]], ['operp', [10681]], ['oplus', [8853]], ['orarr', [8635]], ['Or', [10836]], ['or', [8744]], ['ord', [10845]], ['order', [8500]], ['orderof', [8500]], ['ordf', [170]], ['ordm', [186]], ['origof', [8886]], ['oror', [10838]], ['orslope', [10839]], ['orv', [10843]], ['oS', [9416]], ['Oscr', [119978]], ['oscr', [8500]], ['Oslash', [216]], ['oslash', [248]], ['osol', [8856]], ['Otilde', [213]], ['otilde', [245]], ['otimesas', [10806]], ['Otimes', [10807]], ['otimes', [8855]], ['Ouml', [214]], ['ouml', [246]], ['ovbar', [9021]], ['OverBar', [8254]], ['OverBrace', [9182]], ['OverBracket', [9140]], ['OverParenthesis', [9180]], ['para', [182]], ['parallel', [8741]], ['par', [8741]], ['parsim', [10995]], ['parsl', [11005]], ['part', [8706]], ['PartialD', [8706]], ['Pcy', [1055]], ['pcy', [1087]], ['percnt', [37]], ['period', [46]], ['permil', [8240]], ['perp', [8869]], ['pertenk', [8241]], ['Pfr', [120083]], ['pfr', [120109]], ['Phi', [934]], ['phi', [966]], ['phiv', [981]], ['phmmat', [8499]], ['phone', [9742]], ['Pi', [928]], ['pi', [960]], ['pitchfork', [8916]], ['piv', [982]], ['planck', [8463]], ['planckh', [8462]], ['plankv', [8463]], ['plusacir', [10787]], ['plusb', [8862]], ['pluscir', [10786]], ['plus', [43]], ['plusdo', [8724]], ['plusdu', [10789]], ['pluse', [10866]], ['PlusMinus', [177]], ['plusmn', [177]], ['plussim', [10790]], ['plustwo', [10791]], ['pm', [177]], ['Poincareplane', [8460]], ['pointint', [10773]], ['popf', [120161]], ['Popf', [8473]], ['pound', [163]], ['prap', [10935]], ['Pr', [10939]], ['pr', [8826]], ['prcue', [8828]], ['precapprox', [10935]], ['prec', [8826]], ['preccurlyeq', [8828]], ['Precedes', [8826]], ['PrecedesEqual', [10927]], ['PrecedesSlantEqual', [8828]], ['PrecedesTilde', [8830]], ['preceq', [10927]], ['precnapprox', [10937]], ['precneqq', [10933]], ['precnsim', [8936]], ['pre', [10927]], ['prE', [10931]], ['precsim', [8830]], ['prime', [8242]], ['Prime', [8243]], ['primes', [8473]], ['prnap', [10937]], ['prnE', [10933]], ['prnsim', [8936]], ['prod', [8719]], ['Product', [8719]], ['profalar', [9006]], ['profline', [8978]], ['profsurf', [8979]], ['prop', [8733]], ['Proportional', [8733]], ['Proportion', [8759]], ['propto', [8733]], ['prsim', [8830]], ['prurel', [8880]], ['Pscr', [119979]], ['pscr', [120005]], ['Psi', [936]], ['psi', [968]], ['puncsp', [8200]], ['Qfr', [120084]], ['qfr', [120110]], ['qint', [10764]], ['qopf', [120162]], ['Qopf', [8474]], ['qprime', [8279]], ['Qscr', [119980]], ['qscr', [120006]], ['quaternions', [8461]], ['quatint', [10774]], ['quest', [63]], ['questeq', [8799]], ['quot', [34]], ['QUOT', [34]], ['rAarr', [8667]], ['race', [8765, 817]], ['Racute', [340]], ['racute', [341]], ['radic', [8730]], ['raemptyv', [10675]], ['rang', [10217]], ['Rang', [10219]], ['rangd', [10642]], ['range', [10661]], ['rangle', [10217]], ['raquo', [187]], ['rarrap', [10613]], ['rarrb', [8677]], ['rarrbfs', [10528]], ['rarrc', [10547]], ['rarr', [8594]], ['Rarr', [8608]], ['rArr', [8658]], ['rarrfs', [10526]], ['rarrhk', [8618]], ['rarrlp', [8620]], ['rarrpl', [10565]], ['rarrsim', [10612]], ['Rarrtl', [10518]], ['rarrtl', [8611]], ['rarrw', [8605]], ['ratail', [10522]], ['rAtail', [10524]], ['ratio', [8758]], ['rationals', [8474]], ['rbarr', [10509]], ['rBarr', [10511]], ['RBarr', [10512]], ['rbbrk', [10099]], ['rbrace', [125]], ['rbrack', [93]], ['rbrke', [10636]], ['rbrksld', [10638]], ['rbrkslu', [10640]], ['Rcaron', [344]], ['rcaron', [345]], ['Rcedil', [342]], ['rcedil', [343]], ['rceil', [8969]], ['rcub', [125]], ['Rcy', [1056]], ['rcy', [1088]], ['rdca', [10551]], ['rdldhar', [10601]], ['rdquo', [8221]], ['rdquor', [8221]], ['CloseCurlyDoubleQuote', [8221]], ['rdsh', [8627]], ['real', [8476]], ['realine', [8475]], ['realpart', [8476]], ['reals', [8477]], ['Re', [8476]], ['rect', [9645]], ['reg', [174]], ['REG', [174]], ['ReverseElement', [8715]], ['ReverseEquilibrium', [8651]], ['ReverseUpEquilibrium', [10607]], ['rfisht', [10621]], ['rfloor', [8971]], ['rfr', [120111]], ['Rfr', [8476]], ['rHar', [10596]], ['rhard', [8641]], ['rharu', [8640]], ['rharul', [10604]], ['Rho', [929]], ['rho', [961]], ['rhov', [1009]], ['RightAngleBracket', [10217]], ['RightArrowBar', [8677]], ['rightarrow', [8594]], ['RightArrow', [8594]], ['Rightarrow', [8658]], ['RightArrowLeftArrow', [8644]], ['rightarrowtail', [8611]], ['RightCeiling', [8969]], ['RightDoubleBracket', [10215]], ['RightDownTeeVector', [10589]], ['RightDownVectorBar', [10581]], ['RightDownVector', [8642]], ['RightFloor', [8971]], ['rightharpoondown', [8641]], ['rightharpoonup', [8640]], ['rightleftarrows', [8644]], ['rightleftharpoons', [8652]], ['rightrightarrows', [8649]], ['rightsquigarrow', [8605]], ['RightTeeArrow', [8614]], ['RightTee', [8866]], ['RightTeeVector', [10587]], ['rightthreetimes', [8908]], ['RightTriangleBar', [10704]], ['RightTriangle', [8883]], ['RightTriangleEqual', [8885]], ['RightUpDownVector', [10575]], ['RightUpTeeVector', [10588]], ['RightUpVectorBar', [10580]], ['RightUpVector', [8638]], ['RightVectorBar', [10579]], ['RightVector', [8640]], ['ring', [730]], ['risingdotseq', [8787]], ['rlarr', [8644]], ['rlhar', [8652]], ['rlm', [8207]], ['rmoustache', [9137]], ['rmoust', [9137]], ['rnmid', [10990]], ['roang', [10221]], ['roarr', [8702]], ['robrk', [10215]], ['ropar', [10630]], ['ropf', [120163]], ['Ropf', [8477]], ['roplus', [10798]], ['rotimes', [10805]], ['RoundImplies', [10608]], ['rpar', [41]], ['rpargt', [10644]], ['rppolint', [10770]], ['rrarr', [8649]], ['Rrightarrow', [8667]], ['rsaquo', [8250]], ['rscr', [120007]], ['Rscr', [8475]], ['rsh', [8625]], ['Rsh', [8625]], ['rsqb', [93]], ['rsquo', [8217]], ['rsquor', [8217]], ['CloseCurlyQuote', [8217]], ['rthree', [8908]], ['rtimes', [8906]], ['rtri', [9657]], ['rtrie', [8885]], ['rtrif', [9656]], ['rtriltri', [10702]], ['RuleDelayed', [10740]], ['ruluhar', [10600]], ['rx', [8478]], ['Sacute', [346]], ['sacute', [347]], ['sbquo', [8218]], ['scap', [10936]], ['Scaron', [352]], ['scaron', [353]], ['Sc', [10940]], ['sc', [8827]], ['sccue', [8829]], ['sce', [10928]], ['scE', [10932]], ['Scedil', [350]], ['scedil', [351]], ['Scirc', [348]], ['scirc', [349]], ['scnap', [10938]], ['scnE', [10934]], ['scnsim', [8937]], ['scpolint', [10771]], ['scsim', [8831]], ['Scy', [1057]], ['scy', [1089]], ['sdotb', [8865]], ['sdot', [8901]], ['sdote', [10854]], ['searhk', [10533]], ['searr', [8600]], ['seArr', [8664]], ['searrow', [8600]], ['sect', [167]], ['semi', [59]], ['seswar', [10537]], ['setminus', [8726]], ['setmn', [8726]], ['sext', [10038]], ['Sfr', [120086]], ['sfr', [120112]], ['sfrown', [8994]], ['sharp', [9839]], ['SHCHcy', [1065]], ['shchcy', [1097]], ['SHcy', [1064]], ['shcy', [1096]], ['ShortDownArrow', [8595]], ['ShortLeftArrow', [8592]], ['shortmid', [8739]], ['shortparallel', [8741]], ['ShortRightArrow', [8594]], ['ShortUpArrow', [8593]], ['shy', [173]], ['Sigma', [931]], ['sigma', [963]], ['sigmaf', [962]], ['sigmav', [962]], ['sim', [8764]], ['simdot', [10858]], ['sime', [8771]], ['simeq', [8771]], ['simg', [10910]], ['simgE', [10912]], ['siml', [10909]], ['simlE', [10911]], ['simne', [8774]], ['simplus', [10788]], ['simrarr', [10610]], ['slarr', [8592]], ['SmallCircle', [8728]], ['smallsetminus', [8726]], ['smashp', [10803]], ['smeparsl', [10724]], ['smid', [8739]], ['smile', [8995]], ['smt', [10922]], ['smte', [10924]], ['smtes', [10924, 65024]], ['SOFTcy', [1068]], ['softcy', [1100]], ['solbar', [9023]], ['solb', [10692]], ['sol', [47]], ['Sopf', [120138]], ['sopf', [120164]], ['spades', [9824]], ['spadesuit', [9824]], ['spar', [8741]], ['sqcap', [8851]], ['sqcaps', [8851, 65024]], ['sqcup', [8852]], ['sqcups', [8852, 65024]], ['Sqrt', [8730]], ['sqsub', [8847]], ['sqsube', [8849]], ['sqsubset', [8847]], ['sqsubseteq', [8849]], ['sqsup', [8848]], ['sqsupe', [8850]], ['sqsupset', [8848]], ['sqsupseteq', [8850]], ['square', [9633]], ['Square', [9633]], ['SquareIntersection', [8851]], ['SquareSubset', [8847]], ['SquareSubsetEqual', [8849]], ['SquareSuperset', [8848]], ['SquareSupersetEqual', [8850]], ['SquareUnion', [8852]], ['squarf', [9642]], ['squ', [9633]], ['squf', [9642]], ['srarr', [8594]], ['Sscr', [119982]], ['sscr', [120008]], ['ssetmn', [8726]], ['ssmile', [8995]], ['sstarf', [8902]], ['Star', [8902]], ['star', [9734]], ['starf', [9733]], ['straightepsilon', [1013]], ['straightphi', [981]], ['strns', [175]], ['sub', [8834]], ['Sub', [8912]], ['subdot', [10941]], ['subE', [10949]], ['sube', [8838]], ['subedot', [10947]], ['submult', [10945]], ['subnE', [10955]], ['subne', [8842]], ['subplus', [10943]], ['subrarr', [10617]], ['subset', [8834]], ['Subset', [8912]], ['subseteq', [8838]], ['subseteqq', [10949]], ['SubsetEqual', [8838]], ['subsetneq', [8842]], ['subsetneqq', [10955]], ['subsim', [10951]], ['subsub', [10965]], ['subsup', [10963]], ['succapprox', [10936]], ['succ', [8827]], ['succcurlyeq', [8829]], ['Succeeds', [8827]], ['SucceedsEqual', [10928]], ['SucceedsSlantEqual', [8829]], ['SucceedsTilde', [8831]], ['succeq', [10928]], ['succnapprox', [10938]], ['succneqq', [10934]], ['succnsim', [8937]], ['succsim', [8831]], ['SuchThat', [8715]], ['sum', [8721]], ['Sum', [8721]], ['sung', [9834]], ['sup1', [185]], ['sup2', [178]], ['sup3', [179]], ['sup', [8835]], ['Sup', [8913]], ['supdot', [10942]], ['supdsub', [10968]], ['supE', [10950]], ['supe', [8839]], ['supedot', [10948]], ['Superset', [8835]], ['SupersetEqual', [8839]], ['suphsol', [10185]], ['suphsub', [10967]], ['suplarr', [10619]], ['supmult', [10946]], ['supnE', [10956]], ['supne', [8843]], ['supplus', [10944]], ['supset', [8835]], ['Supset', [8913]], ['supseteq', [8839]], ['supseteqq', [10950]], ['supsetneq', [8843]], ['supsetneqq', [10956]], ['supsim', [10952]], ['supsub', [10964]], ['supsup', [10966]], ['swarhk', [10534]], ['swarr', [8601]], ['swArr', [8665]], ['swarrow', [8601]], ['swnwar', [10538]], ['szlig', [223]], ['Tab', [9]], ['target', [8982]], ['Tau', [932]], ['tau', [964]], ['tbrk', [9140]], ['Tcaron', [356]], ['tcaron', [357]], ['Tcedil', [354]], ['tcedil', [355]], ['Tcy', [1058]], ['tcy', [1090]], ['tdot', [8411]], ['telrec', [8981]], ['Tfr', [120087]], ['tfr', [120113]], ['there4', [8756]], ['therefore', [8756]], ['Therefore', [8756]], ['Theta', [920]], ['theta', [952]], ['thetasym', [977]], ['thetav', [977]], ['thickapprox', [8776]], ['thicksim', [8764]], ['ThickSpace', [8287, 8202]], ['ThinSpace', [8201]], ['thinsp', [8201]], ['thkap', [8776]], ['thksim', [8764]], ['THORN', [222]], ['thorn', [254]], ['tilde', [732]], ['Tilde', [8764]], ['TildeEqual', [8771]], ['TildeFullEqual', [8773]], ['TildeTilde', [8776]], ['timesbar', [10801]], ['timesb', [8864]], ['times', [215]], ['timesd', [10800]], ['tint', [8749]], ['toea', [10536]], ['topbot', [9014]], ['topcir', [10993]], ['top', [8868]], ['Topf', [120139]], ['topf', [120165]], ['topfork', [10970]], ['tosa', [10537]], ['tprime', [8244]], ['trade', [8482]], ['TRADE', [8482]], ['triangle', [9653]], ['triangledown', [9663]], ['triangleleft', [9667]], ['trianglelefteq', [8884]], ['triangleq', [8796]], ['triangleright', [9657]], ['trianglerighteq', [8885]], ['tridot', [9708]], ['trie', [8796]], ['triminus', [10810]], ['TripleDot', [8411]], ['triplus', [10809]], ['trisb', [10701]], ['tritime', [10811]], ['trpezium', [9186]], ['Tscr', [119983]], ['tscr', [120009]], ['TScy', [1062]], ['tscy', [1094]], ['TSHcy', [1035]], ['tshcy', [1115]], ['Tstrok', [358]], ['tstrok', [359]], ['twixt', [8812]], ['twoheadleftarrow', [8606]], ['twoheadrightarrow', [8608]], ['Uacute', [218]], ['uacute', [250]], ['uarr', [8593]], ['Uarr', [8607]], ['uArr', [8657]], ['Uarrocir', [10569]], ['Ubrcy', [1038]], ['ubrcy', [1118]], ['Ubreve', [364]], ['ubreve', [365]], ['Ucirc', [219]], ['ucirc', [251]], ['Ucy', [1059]], ['ucy', [1091]], ['udarr', [8645]], ['Udblac', [368]], ['udblac', [369]], ['udhar', [10606]], ['ufisht', [10622]], ['Ufr', [120088]], ['ufr', [120114]], ['Ugrave', [217]], ['ugrave', [249]], ['uHar', [10595]], ['uharl', [8639]], ['uharr', [8638]], ['uhblk', [9600]], ['ulcorn', [8988]], ['ulcorner', [8988]], ['ulcrop', [8975]], ['ultri', [9720]], ['Umacr', [362]], ['umacr', [363]], ['uml', [168]], ['UnderBar', [95]], ['UnderBrace', [9183]], ['UnderBracket', [9141]], ['UnderParenthesis', [9181]], ['Union', [8899]], ['UnionPlus', [8846]], ['Uogon', [370]], ['uogon', [371]], ['Uopf', [120140]], ['uopf', [120166]], ['UpArrowBar', [10514]], ['uparrow', [8593]], ['UpArrow', [8593]], ['Uparrow', [8657]], ['UpArrowDownArrow', [8645]], ['updownarrow', [8597]], ['UpDownArrow', [8597]], ['Updownarrow', [8661]], ['UpEquilibrium', [10606]], ['upharpoonleft', [8639]], ['upharpoonright', [8638]], ['uplus', [8846]], ['UpperLeftArrow', [8598]], ['UpperRightArrow', [8599]], ['upsi', [965]], ['Upsi', [978]], ['upsih', [978]], ['Upsilon', [933]], ['upsilon', [965]], ['UpTeeArrow', [8613]], ['UpTee', [8869]], ['upuparrows', [8648]], ['urcorn', [8989]], ['urcorner', [8989]], ['urcrop', [8974]], ['Uring', [366]], ['uring', [367]], ['urtri', [9721]], ['Uscr', [119984]], ['uscr', [120010]], ['utdot', [8944]], ['Utilde', [360]], ['utilde', [361]], ['utri', [9653]], ['utrif', [9652]], ['uuarr', [8648]], ['Uuml', [220]], ['uuml', [252]], ['uwangle', [10663]], ['vangrt', [10652]], ['varepsilon', [1013]], ['varkappa', [1008]], ['varnothing', [8709]], ['varphi', [981]], ['varpi', [982]], ['varpropto', [8733]], ['varr', [8597]], ['vArr', [8661]], ['varrho', [1009]], ['varsigma', [962]], ['varsubsetneq', [8842, 65024]], ['varsubsetneqq', [10955, 65024]], ['varsupsetneq', [8843, 65024]], ['varsupsetneqq', [10956, 65024]], ['vartheta', [977]], ['vartriangleleft', [8882]], ['vartriangleright', [8883]], ['vBar', [10984]], ['Vbar', [10987]], ['vBarv', [10985]], ['Vcy', [1042]], ['vcy', [1074]], ['vdash', [8866]], ['vDash', [8872]], ['Vdash', [8873]], ['VDash', [8875]], ['Vdashl', [10982]], ['veebar', [8891]], ['vee', [8744]], ['Vee', [8897]], ['veeeq', [8794]], ['vellip', [8942]], ['verbar', [124]], ['Verbar', [8214]], ['vert', [124]], ['Vert', [8214]], ['VerticalBar', [8739]], ['VerticalLine', [124]], ['VerticalSeparator', [10072]], ['VerticalTilde', [8768]], ['VeryThinSpace', [8202]], ['Vfr', [120089]], ['vfr', [120115]], ['vltri', [8882]], ['vnsub', [8834, 8402]], ['vnsup', [8835, 8402]], ['Vopf', [120141]], ['vopf', [120167]], ['vprop', [8733]], ['vrtri', [8883]], ['Vscr', [119985]], ['vscr', [120011]], ['vsubnE', [10955, 65024]], ['vsubne', [8842, 65024]], ['vsupnE', [10956, 65024]], ['vsupne', [8843, 65024]], ['Vvdash', [8874]], ['vzigzag', [10650]], ['Wcirc', [372]], ['wcirc', [373]], ['wedbar', [10847]], ['wedge', [8743]], ['Wedge', [8896]], ['wedgeq', [8793]], ['weierp', [8472]], ['Wfr', [120090]], ['wfr', [120116]], ['Wopf', [120142]], ['wopf', [120168]], ['wp', [8472]], ['wr', [8768]], ['wreath', [8768]], ['Wscr', [119986]], ['wscr', [120012]], ['xcap', [8898]], ['xcirc', [9711]], ['xcup', [8899]], ['xdtri', [9661]], ['Xfr', [120091]], ['xfr', [120117]], ['xharr', [10231]], ['xhArr', [10234]], ['Xi', [926]], ['xi', [958]], ['xlarr', [10229]], ['xlArr', [10232]], ['xmap', [10236]], ['xnis', [8955]], ['xodot', [10752]], ['Xopf', [120143]], ['xopf', [120169]], ['xoplus', [10753]], ['xotime', [10754]], ['xrarr', [10230]], ['xrArr', [10233]], ['Xscr', [119987]], ['xscr', [120013]], ['xsqcup', [10758]], ['xuplus', [10756]], ['xutri', [9651]], ['xvee', [8897]], ['xwedge', [8896]], ['Yacute', [221]], ['yacute', [253]], ['YAcy', [1071]], ['yacy', [1103]], ['Ycirc', [374]], ['ycirc', [375]], ['Ycy', [1067]], ['ycy', [1099]], ['yen', [165]], ['Yfr', [120092]], ['yfr', [120118]], ['YIcy', [1031]], ['yicy', [1111]], ['Yopf', [120144]], ['yopf', [120170]], ['Yscr', [119988]], ['yscr', [120014]], ['YUcy', [1070]], ['yucy', [1102]], ['yuml', [255]], ['Yuml', [376]], ['Zacute', [377]], ['zacute', [378]], ['Zcaron', [381]], ['zcaron', [382]], ['Zcy', [1047]], ['zcy', [1079]], ['Zdot', [379]], ['zdot', [380]], ['zeetrf', [8488]], ['ZeroWidthSpace', [8203]], ['Zeta', [918]], ['zeta', [950]], ['zfr', [120119]], ['Zfr', [8488]], ['ZHcy', [1046]], ['zhcy', [1078]], ['zigrarr', [8669]], ['zopf', [120171]], ['Zopf', [8484]], ['Zscr', [119989]], ['zscr', [120015]], ['zwj', [8205]], ['zwnj', [8204]]]; + +var alphaIndex = {}; +var charIndex = {}; + +createIndexes(alphaIndex, charIndex); + +/** + * @constructor + */ +function Html5Entities() {} + +/** + * @param {String} str + * @returns {String} + */ +Html5Entities.prototype.decode = function(str) { + if (!str || !str.length) { + return ''; + } + return str.replace(/&(#?[\w\d]+);?/g, function(s, entity) { + var chr; + if (entity.charAt(0) === "#") { + var code = entity.charAt(1) === 'x' ? + parseInt(entity.substr(2).toLowerCase(), 16) : + parseInt(entity.substr(1)); + + if (!(isNaN(code) || code < -32768 || code > 65535)) { + chr = String.fromCharCode(code); + } + } else { + chr = alphaIndex[entity]; + } + return chr || s; + }); +}; + +/** + * @param {String} str + * @returns {String} + */ + Html5Entities.decode = function(str) { + return new Html5Entities().decode(str); + }; + +/** + * @param {String} str + * @returns {String} + */ +Html5Entities.prototype.encode = function(str) { + if (!str || !str.length) { + return ''; + } + var strLength = str.length; + var result = ''; + var i = 0; + while (i < strLength) { + var charInfo = charIndex[str.charCodeAt(i)]; + if (charInfo) { + var alpha = charInfo[str.charCodeAt(i + 1)]; + if (alpha) { + i++; + } else { + alpha = charInfo['']; + } + if (alpha) { + result += "&" + alpha + ";"; + i++; + continue; + } + } + result += str.charAt(i); + i++; + } + return result; +}; + +/** + * @param {String} str + * @returns {String} + */ + Html5Entities.encode = function(str) { + return new Html5Entities().encode(str); + }; + +/** + * @param {String} str + * @returns {String} + */ +Html5Entities.prototype.encodeNonUTF = function(str) { + if (!str || !str.length) { + return ''; + } + var strLength = str.length; + var result = ''; + var i = 0; + while (i < strLength) { + var c = str.charCodeAt(i); + var charInfo = charIndex[c]; + if (charInfo) { + var alpha = charInfo[str.charCodeAt(i + 1)]; + if (alpha) { + i++; + } else { + alpha = charInfo['']; + } + if (alpha) { + result += "&" + alpha + ";"; + i++; + continue; + } + } + if (c < 32 || c > 126) { + result += '&#' + c + ';'; + } else { + result += str.charAt(i); + } + i++; + } + return result; +}; + +/** + * @param {String} str + * @returns {String} + */ + Html5Entities.encodeNonUTF = function(str) { + return new Html5Entities().encodeNonUTF(str); + }; + +/** + * @param {String} str + * @returns {String} + */ +Html5Entities.prototype.encodeNonASCII = function(str) { + if (!str || !str.length) { + return ''; + } + var strLength = str.length; + var result = ''; + var i = 0; + while (i < strLength) { + var c = str.charCodeAt(i); + if (c <= 255) { + result += str[i++]; + continue; + } + result += '&#' + c + ';'; + i++ + } + return result; +}; + +/** + * @param {String} str + * @returns {String} + */ + Html5Entities.encodeNonASCII = function(str) { + return new Html5Entities().encodeNonASCII(str); + }; + +/** + * @param {Object} alphaIndex Passed by reference. + * @param {Object} charIndex Passed by reference. + */ +function createIndexes(alphaIndex, charIndex) { + var i = ENTITIES.length; + var _results = []; + while (i--) { + var e = ENTITIES[i]; + var alpha = e[0]; + var chars = e[1]; + var chr = chars[0]; + var addChar = (chr < 32 || chr > 126) || chr === 62 || chr === 60 || chr === 38 || chr === 34 || chr === 39; + var charInfo; + if (addChar) { + charInfo = charIndex[chr] = charIndex[chr] || {}; + } + if (chars[1]) { + var chr2 = chars[1]; + alphaIndex[alpha] = String.fromCharCode(chr) + String.fromCharCode(chr2); + _results.push(addChar && (charInfo[chr2] = alpha)); + } else { + alphaIndex[alpha] = String.fromCharCode(chr); + _results.push(addChar && (charInfo[''] = alpha)); + } + } +} + +module.exports = Html5Entities; + + +/***/ }), + +/***/ "../../node_modules/html-entities/lib/xml-entities.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/html-entities/lib/xml-entities.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var ALPHA_INDEX = { + '<': '<', + '>': '>', + '"': '"', + '&apos': '\'', + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': '\'', + '&': '&' +}; + +var CHAR_INDEX = { + 60: 'lt', + 62: 'gt', + 34: 'quot', + 39: 'apos', + 38: 'amp' +}; + +var CHAR_S_INDEX = { + '<': '<', + '>': '>', + '"': '"', + '\'': ''', + '&': '&' +}; + +/** + * @constructor + */ +function XmlEntities() {} + +/** + * @param {String} str + * @returns {String} + */ +XmlEntities.prototype.encode = function(str) { + if (!str || !str.length) { + return ''; + } + return str.replace(/<|>|"|'|&/g, function(s) { + return CHAR_S_INDEX[s]; + }); +}; + +/** + * @param {String} str + * @returns {String} + */ + XmlEntities.encode = function(str) { + return new XmlEntities().encode(str); + }; + +/** + * @param {String} str + * @returns {String} + */ +XmlEntities.prototype.decode = function(str) { + if (!str || !str.length) { + return ''; + } + return str.replace(/&#?[0-9a-zA-Z]+;?/g, function(s) { + if (s.charAt(1) === '#') { + var code = s.charAt(2).toLowerCase() === 'x' ? + parseInt(s.substr(3), 16) : + parseInt(s.substr(2)); + + if (isNaN(code) || code < -32768 || code > 65535) { + return ''; + } + return String.fromCharCode(code); + } + return ALPHA_INDEX[s] || s; + }); +}; + +/** + * @param {String} str + * @returns {String} + */ + XmlEntities.decode = function(str) { + return new XmlEntities().decode(str); + }; + +/** + * @param {String} str + * @returns {String} + */ +XmlEntities.prototype.encodeNonUTF = function(str) { + if (!str || !str.length) { + return ''; + } + var strLength = str.length; + var result = ''; + var i = 0; + while (i < strLength) { + var c = str.charCodeAt(i); + var alpha = CHAR_INDEX[c]; + if (alpha) { + result += "&" + alpha + ";"; + i++; + continue; + } + if (c < 32 || c > 126) { + result += '&#' + c + ';'; + } else { + result += str.charAt(i); + } + i++; + } + return result; +}; + +/** + * @param {String} str + * @returns {String} + */ + XmlEntities.encodeNonUTF = function(str) { + return new XmlEntities().encodeNonUTF(str); + }; + +/** + * @param {String} str + * @returns {String} + */ +XmlEntities.prototype.encodeNonASCII = function(str) { + if (!str || !str.length) { + return ''; + } + var strLenght = str.length; + var result = ''; + var i = 0; + while (i < strLenght) { + var c = str.charCodeAt(i); + if (c <= 255) { + result += str[i++]; + continue; + } + result += '&#' + c + ';'; + i++; + } + return result; +}; + +/** + * @param {String} str + * @returns {String} + */ + XmlEntities.encodeNonASCII = function(str) { + return new XmlEntities().encodeNonASCII(str); + }; + +module.exports = XmlEntities; + + +/***/ }), + +/***/ "../../node_modules/is-callable/index.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/is-callable/index.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var fnToStr = Function.prototype.toString; + +var constructorRegex = /^\s*class\b/; +var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; // not a function + } +}; + +var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { return false; } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } +}; +var toStr = Object.prototype.toString; +var fnClass = '[object Function]'; +var genClass = '[object GeneratorFunction]'; +var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + +module.exports = function isCallable(value) { + if (!value) { return false; } + if (typeof value !== 'function' && typeof value !== 'object') { return false; } + if (typeof value === 'function' && !value.prototype) { return true; } + if (hasToStringTag) { return tryFunctionObject(value); } + if (isES6ClassFn(value)) { return false; } + var strClass = toStr.call(value); + return strClass === fnClass || strClass === genClass; +}; + + +/***/ }), + +/***/ "../../node_modules/is-date-object/index.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/is-date-object/index.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getDay = Date.prototype.getDay; +var tryDateObject = function tryDateObject(value) { + try { + getDay.call(value); + return true; + } catch (e) { + return false; + } +}; + +var toStr = Object.prototype.toString; +var dateClass = '[object Date]'; +var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + +module.exports = function isDateObject(value) { + if (typeof value !== 'object' || value === null) { return false; } + return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; +}; + + +/***/ }), + +/***/ "../../node_modules/is-function/index.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/is-function/index.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = isFunction + +var toString = Object.prototype.toString + +function isFunction (fn) { + var string = toString.call(fn) + return string === '[object Function]' || + (typeof fn === 'function' && string !== '[object RegExp]') || + (typeof window !== 'undefined' && + // IE8 and below + (fn === window.setTimeout || + fn === window.alert || + fn === window.confirm || + fn === window.prompt)) +}; + + +/***/ }), + +/***/ "../../node_modules/is-regex/index.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/is-regex/index.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var regexExec = RegExp.prototype.exec; +var gOPD = Object.getOwnPropertyDescriptor; + +var tryRegexExecCall = function tryRegexExec(value) { + try { + var lastIndex = value.lastIndex; + value.lastIndex = 0; + + regexExec.call(value); + return true; + } catch (e) { + return false; + } finally { + value.lastIndex = lastIndex; + } +}; +var toStr = Object.prototype.toString; +var regexClass = '[object RegExp]'; +var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; + +module.exports = function isRegex(value) { + if (!value || typeof value !== 'object') { + return false; + } + if (!hasToStringTag) { + return toStr.call(value) === regexClass; + } + + var descriptor = gOPD(value, 'lastIndex'); + var hasLastIndexDataProperty = descriptor && has(descriptor, 'value'); + if (!hasLastIndexDataProperty) { + return false; + } + + return tryRegexExecCall(value); +}; + + +/***/ }), + +/***/ "../../node_modules/is-symbol/index.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/is-symbol/index.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +if (hasSymbols) { + var symToStr = Symbol.prototype.toString; + var symStringRegex = /^Symbol\(.*\)$/; + var isSymbolObject = function isRealSymbolObject(value) { + if (typeof value.valueOf() !== 'symbol') { + return false; + } + return symStringRegex.test(symToStr.call(value)); + }; + + module.exports = function isSymbol(value) { + if (typeof value === 'symbol') { + return true; + } + if (toStr.call(value) !== '[object Symbol]') { + return false; + } + try { + return isSymbolObject(value); + } catch (e) { + return false; + } + }; +} else { + + module.exports = function isSymbol(value) { + // this environment does not support Symbols. + return false && false; + }; +} + + +/***/ }), + +/***/ "../../node_modules/lodash/_DataView.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_DataView.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; + + +/***/ }), + +/***/ "../../node_modules/lodash/_Hash.js": +/*!********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_Hash.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var hashClear = __webpack_require__(/*! ./_hashClear */ "../../node_modules/lodash/_hashClear.js"), + hashDelete = __webpack_require__(/*! ./_hashDelete */ "../../node_modules/lodash/_hashDelete.js"), + hashGet = __webpack_require__(/*! ./_hashGet */ "../../node_modules/lodash/_hashGet.js"), + hashHas = __webpack_require__(/*! ./_hashHas */ "../../node_modules/lodash/_hashHas.js"), + hashSet = __webpack_require__(/*! ./_hashSet */ "../../node_modules/lodash/_hashSet.js"); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; + + +/***/ }), + +/***/ "../../node_modules/lodash/_ListCache.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_ListCache.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ "../../node_modules/lodash/_listCacheClear.js"), + listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ "../../node_modules/lodash/_listCacheDelete.js"), + listCacheGet = __webpack_require__(/*! ./_listCacheGet */ "../../node_modules/lodash/_listCacheGet.js"), + listCacheHas = __webpack_require__(/*! ./_listCacheHas */ "../../node_modules/lodash/_listCacheHas.js"), + listCacheSet = __webpack_require__(/*! ./_listCacheSet */ "../../node_modules/lodash/_listCacheSet.js"); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; + + +/***/ }), + +/***/ "../../node_modules/lodash/_Map.js": +/*!*******************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_Map.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; + + +/***/ }), + +/***/ "../../node_modules/lodash/_MapCache.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_MapCache.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ "../../node_modules/lodash/_mapCacheClear.js"), + mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ "../../node_modules/lodash/_mapCacheDelete.js"), + mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ "../../node_modules/lodash/_mapCacheGet.js"), + mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ "../../node_modules/lodash/_mapCacheHas.js"), + mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ "../../node_modules/lodash/_mapCacheSet.js"); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; + + +/***/ }), + +/***/ "../../node_modules/lodash/_Promise.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_Promise.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; + + +/***/ }), + +/***/ "../../node_modules/lodash/_Set.js": +/*!*******************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_Set.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; + + +/***/ }), + +/***/ "../../node_modules/lodash/_SetCache.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_SetCache.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var MapCache = __webpack_require__(/*! ./_MapCache */ "../../node_modules/lodash/_MapCache.js"), + setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ "../../node_modules/lodash/_setCacheAdd.js"), + setCacheHas = __webpack_require__(/*! ./_setCacheHas */ "../../node_modules/lodash/_setCacheHas.js"); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; + + +/***/ }), + +/***/ "../../node_modules/lodash/_Stack.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_Stack.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "../../node_modules/lodash/_ListCache.js"), + stackClear = __webpack_require__(/*! ./_stackClear */ "../../node_modules/lodash/_stackClear.js"), + stackDelete = __webpack_require__(/*! ./_stackDelete */ "../../node_modules/lodash/_stackDelete.js"), + stackGet = __webpack_require__(/*! ./_stackGet */ "../../node_modules/lodash/_stackGet.js"), + stackHas = __webpack_require__(/*! ./_stackHas */ "../../node_modules/lodash/_stackHas.js"), + stackSet = __webpack_require__(/*! ./_stackSet */ "../../node_modules/lodash/_stackSet.js"); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; + + +/***/ }), + +/***/ "../../node_modules/lodash/_Symbol.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_Symbol.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; + + +/***/ }), + +/***/ "../../node_modules/lodash/_Uint8Array.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_Uint8Array.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; + + +/***/ }), + +/***/ "../../node_modules/lodash/_WeakMap.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_WeakMap.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"), + root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; + + +/***/ }), + +/***/ "../../node_modules/lodash/_apply.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_apply.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; + + +/***/ }), + +/***/ "../../node_modules/lodash/_arrayFilter.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_arrayFilter.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; + + +/***/ }), + +/***/ "../../node_modules/lodash/_arrayLikeKeys.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_arrayLikeKeys.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseTimes = __webpack_require__(/*! ./_baseTimes */ "../../node_modules/lodash/_baseTimes.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "../../node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "../../node_modules/lodash/_isIndex.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../node_modules/lodash/isTypedArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; + + +/***/ }), + +/***/ "../../node_modules/lodash/_arrayMap.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_arrayMap.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; + + +/***/ }), + +/***/ "../../node_modules/lodash/_arrayPush.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_arrayPush.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; + + +/***/ }), + +/***/ "../../node_modules/lodash/_arrayReduce.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_arrayReduce.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +module.exports = arrayReduce; + + +/***/ }), + +/***/ "../../node_modules/lodash/_arraySome.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_arraySome.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; + + +/***/ }), + +/***/ "../../node_modules/lodash/_asciiToArray.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_asciiToArray.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +module.exports = asciiToArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/_asciiWords.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_asciiWords.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used to match words composed of alphanumeric characters. */ +var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + +/** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function asciiWords(string) { + return string.match(reAsciiWord) || []; +} + +module.exports = asciiWords; + + +/***/ }), + +/***/ "../../node_modules/lodash/_assignMergeValue.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_assignMergeValue.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../../node_modules/lodash/_baseAssignValue.js"), + eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js"); + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignMergeValue; + + +/***/ }), + +/***/ "../../node_modules/lodash/_assignValue.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_assignValue.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../../node_modules/lodash/_baseAssignValue.js"), + eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; + + +/***/ }), + +/***/ "../../node_modules/lodash/_assocIndexOf.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_assocIndexOf.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js"); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseAssignValue.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseAssignValue.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var defineProperty = __webpack_require__(/*! ./_defineProperty */ "../../node_modules/lodash/_defineProperty.js"); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseCreate.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseCreate.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseFor.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseFor.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ "../../node_modules/lodash/_createBaseFor.js"); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseGet.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseGet.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var castPath = __webpack_require__(/*! ./_castPath */ "../../node_modules/lodash/_castPath.js"), + toKey = __webpack_require__(/*! ./_toKey */ "../../node_modules/lodash/_toKey.js"); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseGetAllKeys.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseGetAllKeys.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayPush = __webpack_require__(/*! ./_arrayPush */ "../../node_modules/lodash/_arrayPush.js"), + isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseGetTag.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseGetTag.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js"), + getRawTag = __webpack_require__(/*! ./_getRawTag */ "../../node_modules/lodash/_getRawTag.js"), + objectToString = __webpack_require__(/*! ./_objectToString */ "../../node_modules/lodash/_objectToString.js"); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseIsArguments.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseIsArguments.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseIsEqual.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseIsEqual.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ "../../node_modules/lodash/_baseIsEqualDeep.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js"); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseIsEqualDeep.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseIsEqualDeep.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "../../node_modules/lodash/_Stack.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "../../node_modules/lodash/_equalArrays.js"), + equalByTag = __webpack_require__(/*! ./_equalByTag */ "../../node_modules/lodash/_equalByTag.js"), + equalObjects = __webpack_require__(/*! ./_equalObjects */ "../../node_modules/lodash/_equalObjects.js"), + getTag = __webpack_require__(/*! ./_getTag */ "../../node_modules/lodash/_getTag.js"), + isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../node_modules/lodash/isTypedArray.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseIsNative.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseIsNative.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isFunction = __webpack_require__(/*! ./isFunction */ "../../node_modules/lodash/isFunction.js"), + isMasked = __webpack_require__(/*! ./_isMasked */ "../../node_modules/lodash/_isMasked.js"), + isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"), + toSource = __webpack_require__(/*! ./_toSource */ "../../node_modules/lodash/_toSource.js"); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseIsTypedArray.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseIsTypedArray.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"), + isLength = __webpack_require__(/*! ./isLength */ "../../node_modules/lodash/isLength.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseKeys.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseKeys.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isPrototype = __webpack_require__(/*! ./_isPrototype */ "../../node_modules/lodash/_isPrototype.js"), + nativeKeys = __webpack_require__(/*! ./_nativeKeys */ "../../node_modules/lodash/_nativeKeys.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseKeysIn.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseKeysIn.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "../../node_modules/lodash/_isPrototype.js"), + nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ "../../node_modules/lodash/_nativeKeysIn.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseMerge.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseMerge.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Stack = __webpack_require__(/*! ./_Stack */ "../../node_modules/lodash/_Stack.js"), + assignMergeValue = __webpack_require__(/*! ./_assignMergeValue */ "../../node_modules/lodash/_assignMergeValue.js"), + baseFor = __webpack_require__(/*! ./_baseFor */ "../../node_modules/lodash/_baseFor.js"), + baseMergeDeep = __webpack_require__(/*! ./_baseMergeDeep */ "../../node_modules/lodash/_baseMergeDeep.js"), + isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js"), + safeGet = __webpack_require__(/*! ./_safeGet */ "../../node_modules/lodash/_safeGet.js"); + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +module.exports = baseMerge; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseMergeDeep.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseMergeDeep.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var assignMergeValue = __webpack_require__(/*! ./_assignMergeValue */ "../../node_modules/lodash/_assignMergeValue.js"), + cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ "../../node_modules/lodash/_cloneBuffer.js"), + cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ "../../node_modules/lodash/_cloneTypedArray.js"), + copyArray = __webpack_require__(/*! ./_copyArray */ "../../node_modules/lodash/_copyArray.js"), + initCloneObject = __webpack_require__(/*! ./_initCloneObject */ "../../node_modules/lodash/_initCloneObject.js"), + isArguments = __webpack_require__(/*! ./isArguments */ "../../node_modules/lodash/isArguments.js"), + isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"), + isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ "../../node_modules/lodash/isArrayLikeObject.js"), + isBuffer = __webpack_require__(/*! ./isBuffer */ "../../node_modules/lodash/isBuffer.js"), + isFunction = __webpack_require__(/*! ./isFunction */ "../../node_modules/lodash/isFunction.js"), + isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"), + isPlainObject = __webpack_require__(/*! ./isPlainObject */ "../../node_modules/lodash/isPlainObject.js"), + isTypedArray = __webpack_require__(/*! ./isTypedArray */ "../../node_modules/lodash/isTypedArray.js"), + safeGet = __webpack_require__(/*! ./_safeGet */ "../../node_modules/lodash/_safeGet.js"), + toPlainObject = __webpack_require__(/*! ./toPlainObject */ "../../node_modules/lodash/toPlainObject.js"); + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +module.exports = baseMergeDeep; + + +/***/ }), + +/***/ "../../node_modules/lodash/_basePropertyOf.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_basePropertyOf.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = basePropertyOf; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseRest.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseRest.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js"), + overRest = __webpack_require__(/*! ./_overRest */ "../../node_modules/lodash/_overRest.js"), + setToString = __webpack_require__(/*! ./_setToString */ "../../node_modules/lodash/_setToString.js"); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseSetToString.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseSetToString.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var constant = __webpack_require__(/*! ./constant */ "../../node_modules/lodash/constant.js"), + defineProperty = __webpack_require__(/*! ./_defineProperty */ "../../node_modules/lodash/_defineProperty.js"), + identity = __webpack_require__(/*! ./identity */ "../../node_modules/lodash/identity.js"); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseSlice.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseSlice.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseTimes.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseTimes.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseToString.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseToString.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js"), + arrayMap = __webpack_require__(/*! ./_arrayMap */ "../../node_modules/lodash/_arrayMap.js"), + isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; + + +/***/ }), + +/***/ "../../node_modules/lodash/_baseUnary.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_baseUnary.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; + + +/***/ }), + +/***/ "../../node_modules/lodash/_cacheHas.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_cacheHas.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; + + +/***/ }), + +/***/ "../../node_modules/lodash/_castPath.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_castPath.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"), + isKey = __webpack_require__(/*! ./_isKey */ "../../node_modules/lodash/_isKey.js"), + stringToPath = __webpack_require__(/*! ./_stringToPath */ "../../node_modules/lodash/_stringToPath.js"), + toString = __webpack_require__(/*! ./toString */ "../../node_modules/lodash/toString.js"); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; + + +/***/ }), + +/***/ "../../node_modules/lodash/_castSlice.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_castSlice.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseSlice = __webpack_require__(/*! ./_baseSlice */ "../../node_modules/lodash/_baseSlice.js"); + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +module.exports = castSlice; + + +/***/ }), + +/***/ "../../node_modules/lodash/_cloneArrayBuffer.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_cloneArrayBuffer.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "../../node_modules/lodash/_Uint8Array.js"); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; + + +/***/ }), + +/***/ "../../node_modules/lodash/_cloneBuffer.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_cloneBuffer.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "../../node_modules/lodash/_cloneTypedArray.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_cloneTypedArray.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ "../../node_modules/lodash/_cloneArrayBuffer.js"); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/_copyArray.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_copyArray.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/_copyObject.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_copyObject.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var assignValue = __webpack_require__(/*! ./_assignValue */ "../../node_modules/lodash/_assignValue.js"), + baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ "../../node_modules/lodash/_baseAssignValue.js"); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; + + +/***/ }), + +/***/ "../../node_modules/lodash/_coreJsData.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_coreJsData.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; + + +/***/ }), + +/***/ "../../node_modules/lodash/_createAssigner.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_createAssigner.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseRest = __webpack_require__(/*! ./_baseRest */ "../../node_modules/lodash/_baseRest.js"), + isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ "../../node_modules/lodash/_isIterateeCall.js"); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; + + +/***/ }), + +/***/ "../../node_modules/lodash/_createBaseFor.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_createBaseFor.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; + + +/***/ }), + +/***/ "../../node_modules/lodash/_createCaseFirst.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_createCaseFirst.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var castSlice = __webpack_require__(/*! ./_castSlice */ "../../node_modules/lodash/_castSlice.js"), + hasUnicode = __webpack_require__(/*! ./_hasUnicode */ "../../node_modules/lodash/_hasUnicode.js"), + stringToArray = __webpack_require__(/*! ./_stringToArray */ "../../node_modules/lodash/_stringToArray.js"), + toString = __webpack_require__(/*! ./toString */ "../../node_modules/lodash/toString.js"); + +/** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ +function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; +} + +module.exports = createCaseFirst; + + +/***/ }), + +/***/ "../../node_modules/lodash/_createCompounder.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_createCompounder.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayReduce = __webpack_require__(/*! ./_arrayReduce */ "../../node_modules/lodash/_arrayReduce.js"), + deburr = __webpack_require__(/*! ./deburr */ "../../node_modules/lodash/deburr.js"), + words = __webpack_require__(/*! ./words */ "../../node_modules/lodash/words.js"); + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]"; + +/** Used to match apostrophes. */ +var reApos = RegExp(rsApos, 'g'); + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; +} + +module.exports = createCompounder; + + +/***/ }), + +/***/ "../../node_modules/lodash/_deburrLetter.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_deburrLetter.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var basePropertyOf = __webpack_require__(/*! ./_basePropertyOf */ "../../node_modules/lodash/_basePropertyOf.js"); + +/** Used to map Latin Unicode letters to basic Latin letters. */ +var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' +}; + +/** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ +var deburrLetter = basePropertyOf(deburredLetters); + +module.exports = deburrLetter; + + +/***/ }), + +/***/ "../../node_modules/lodash/_defineProperty.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_defineProperty.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + + +/***/ }), + +/***/ "../../node_modules/lodash/_equalArrays.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_equalArrays.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var SetCache = __webpack_require__(/*! ./_SetCache */ "../../node_modules/lodash/_SetCache.js"), + arraySome = __webpack_require__(/*! ./_arraySome */ "../../node_modules/lodash/_arraySome.js"), + cacheHas = __webpack_require__(/*! ./_cacheHas */ "../../node_modules/lodash/_cacheHas.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; + + +/***/ }), + +/***/ "../../node_modules/lodash/_equalByTag.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_equalByTag.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js"), + Uint8Array = __webpack_require__(/*! ./_Uint8Array */ "../../node_modules/lodash/_Uint8Array.js"), + eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js"), + equalArrays = __webpack_require__(/*! ./_equalArrays */ "../../node_modules/lodash/_equalArrays.js"), + mapToArray = __webpack_require__(/*! ./_mapToArray */ "../../node_modules/lodash/_mapToArray.js"), + setToArray = __webpack_require__(/*! ./_setToArray */ "../../node_modules/lodash/_setToArray.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; + + +/***/ }), + +/***/ "../../node_modules/lodash/_equalObjects.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_equalObjects.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ "../../node_modules/lodash/_getAllKeys.js"); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; + + +/***/ }), + +/***/ "../../node_modules/lodash/_freeGlobal.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_freeGlobal.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/lodash/_getAllKeys.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_getAllKeys.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ "../../node_modules/lodash/_baseGetAllKeys.js"), + getSymbols = __webpack_require__(/*! ./_getSymbols */ "../../node_modules/lodash/_getSymbols.js"), + keys = __webpack_require__(/*! ./keys */ "../../node_modules/lodash/keys.js"); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; + + +/***/ }), + +/***/ "../../node_modules/lodash/_getMapData.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_getMapData.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isKeyable = __webpack_require__(/*! ./_isKeyable */ "../../node_modules/lodash/_isKeyable.js"); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; + + +/***/ }), + +/***/ "../../node_modules/lodash/_getNative.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_getNative.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ "../../node_modules/lodash/_baseIsNative.js"), + getValue = __webpack_require__(/*! ./_getValue */ "../../node_modules/lodash/_getValue.js"); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; + + +/***/ }), + +/***/ "../../node_modules/lodash/_getPrototype.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_getPrototype.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var overArg = __webpack_require__(/*! ./_overArg */ "../../node_modules/lodash/_overArg.js"); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + + +/***/ }), + +/***/ "../../node_modules/lodash/_getRawTag.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_getRawTag.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Symbol = __webpack_require__(/*! ./_Symbol */ "../../node_modules/lodash/_Symbol.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; + + +/***/ }), + +/***/ "../../node_modules/lodash/_getSymbols.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_getSymbols.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ "../../node_modules/lodash/_arrayFilter.js"), + stubArray = __webpack_require__(/*! ./stubArray */ "../../node_modules/lodash/stubArray.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; + + +/***/ }), + +/***/ "../../node_modules/lodash/_getTag.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_getTag.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DataView = __webpack_require__(/*! ./_DataView */ "../../node_modules/lodash/_DataView.js"), + Map = __webpack_require__(/*! ./_Map */ "../../node_modules/lodash/_Map.js"), + Promise = __webpack_require__(/*! ./_Promise */ "../../node_modules/lodash/_Promise.js"), + Set = __webpack_require__(/*! ./_Set */ "../../node_modules/lodash/_Set.js"), + WeakMap = __webpack_require__(/*! ./_WeakMap */ "../../node_modules/lodash/_WeakMap.js"), + baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"), + toSource = __webpack_require__(/*! ./_toSource */ "../../node_modules/lodash/_toSource.js"); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; + + +/***/ }), + +/***/ "../../node_modules/lodash/_getValue.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_getValue.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; + + +/***/ }), + +/***/ "../../node_modules/lodash/_hasUnicode.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_hasUnicode.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +module.exports = hasUnicode; + + +/***/ }), + +/***/ "../../node_modules/lodash/_hasUnicodeWord.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_hasUnicodeWord.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used to detect strings that need a more robust regexp to match words. */ +var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + +/** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ +function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); +} + +module.exports = hasUnicodeWord; + + +/***/ }), + +/***/ "../../node_modules/lodash/_hashClear.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_hashClear.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../../node_modules/lodash/_nativeCreate.js"); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; + + +/***/ }), + +/***/ "../../node_modules/lodash/_hashDelete.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_hashDelete.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; + + +/***/ }), + +/***/ "../../node_modules/lodash/_hashGet.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_hashGet.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../../node_modules/lodash/_nativeCreate.js"); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_hashHas.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_hashHas.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../../node_modules/lodash/_nativeCreate.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; + + +/***/ }), + +/***/ "../../node_modules/lodash/_hashSet.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_hashSet.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ "../../node_modules/lodash/_nativeCreate.js"); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_initCloneObject.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_initCloneObject.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseCreate = __webpack_require__(/*! ./_baseCreate */ "../../node_modules/lodash/_baseCreate.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "../../node_modules/lodash/_getPrototype.js"), + isPrototype = __webpack_require__(/*! ./_isPrototype */ "../../node_modules/lodash/_isPrototype.js"); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; + + +/***/ }), + +/***/ "../../node_modules/lodash/_isIndex.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_isIndex.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; + + +/***/ }), + +/***/ "../../node_modules/lodash/_isIterateeCall.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_isIterateeCall.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var eq = __webpack_require__(/*! ./eq */ "../../node_modules/lodash/eq.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"), + isIndex = __webpack_require__(/*! ./_isIndex */ "../../node_modules/lodash/_isIndex.js"), + isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; + + +/***/ }), + +/***/ "../../node_modules/lodash/_isKey.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_isKey.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isArray = __webpack_require__(/*! ./isArray */ "../../node_modules/lodash/isArray.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js"); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; + + +/***/ }), + +/***/ "../../node_modules/lodash/_isKeyable.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_isKeyable.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; + + +/***/ }), + +/***/ "../../node_modules/lodash/_isMasked.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_isMasked.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var coreJsData = __webpack_require__(/*! ./_coreJsData */ "../../node_modules/lodash/_coreJsData.js"); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; + + +/***/ }), + +/***/ "../../node_modules/lodash/_isPrototype.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_isPrototype.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; + + +/***/ }), + +/***/ "../../node_modules/lodash/_listCacheClear.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_listCacheClear.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; + + +/***/ }), + +/***/ "../../node_modules/lodash/_listCacheDelete.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_listCacheDelete.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../../node_modules/lodash/_assocIndexOf.js"); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; + + +/***/ }), + +/***/ "../../node_modules/lodash/_listCacheGet.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_listCacheGet.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../../node_modules/lodash/_assocIndexOf.js"); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_listCacheHas.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_listCacheHas.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../../node_modules/lodash/_assocIndexOf.js"); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; + + +/***/ }), + +/***/ "../../node_modules/lodash/_listCacheSet.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_listCacheSet.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ "../../node_modules/lodash/_assocIndexOf.js"); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_mapCacheClear.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_mapCacheClear.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Hash = __webpack_require__(/*! ./_Hash */ "../../node_modules/lodash/_Hash.js"), + ListCache = __webpack_require__(/*! ./_ListCache */ "../../node_modules/lodash/_ListCache.js"), + Map = __webpack_require__(/*! ./_Map */ "../../node_modules/lodash/_Map.js"); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; + + +/***/ }), + +/***/ "../../node_modules/lodash/_mapCacheDelete.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_mapCacheDelete.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "../../node_modules/lodash/_getMapData.js"); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; + + +/***/ }), + +/***/ "../../node_modules/lodash/_mapCacheGet.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_mapCacheGet.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "../../node_modules/lodash/_getMapData.js"); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_mapCacheHas.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_mapCacheHas.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "../../node_modules/lodash/_getMapData.js"); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; + + +/***/ }), + +/***/ "../../node_modules/lodash/_mapCacheSet.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_mapCacheSet.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getMapData = __webpack_require__(/*! ./_getMapData */ "../../node_modules/lodash/_getMapData.js"); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_mapToArray.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_mapToArray.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/_memoizeCapped.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_memoizeCapped.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var memoize = __webpack_require__(/*! ./memoize */ "../../node_modules/lodash/memoize.js"); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; + + +/***/ }), + +/***/ "../../node_modules/lodash/_nativeCreate.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_nativeCreate.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getNative = __webpack_require__(/*! ./_getNative */ "../../node_modules/lodash/_getNative.js"); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; + + +/***/ }), + +/***/ "../../node_modules/lodash/_nativeKeys.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_nativeKeys.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var overArg = __webpack_require__(/*! ./_overArg */ "../../node_modules/lodash/_overArg.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; + + +/***/ }), + +/***/ "../../node_modules/lodash/_nativeKeysIn.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_nativeKeysIn.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; + + +/***/ }), + +/***/ "../../node_modules/lodash/_nodeUtil.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_nodeUtil.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "../../node_modules/lodash/_freeGlobal.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "../../node_modules/lodash/_objectToString.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_objectToString.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; + + +/***/ }), + +/***/ "../../node_modules/lodash/_overArg.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_overArg.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; + + +/***/ }), + +/***/ "../../node_modules/lodash/_overRest.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_overRest.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var apply = __webpack_require__(/*! ./_apply */ "../../node_modules/lodash/_apply.js"); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; + + +/***/ }), + +/***/ "../../node_modules/lodash/_root.js": +/*!********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_root.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ "../../node_modules/lodash/_freeGlobal.js"); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; + + +/***/ }), + +/***/ "../../node_modules/lodash/_safeGet.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_safeGet.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +module.exports = safeGet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_setCacheAdd.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_setCacheAdd.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; + + +/***/ }), + +/***/ "../../node_modules/lodash/_setCacheHas.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_setCacheHas.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; + + +/***/ }), + +/***/ "../../node_modules/lodash/_setToArray.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_setToArray.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/_setToString.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_setToString.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ "../../node_modules/lodash/_baseSetToString.js"), + shortOut = __webpack_require__(/*! ./_shortOut */ "../../node_modules/lodash/_shortOut.js"); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; + + +/***/ }), + +/***/ "../../node_modules/lodash/_shortOut.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_shortOut.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; + + +/***/ }), + +/***/ "../../node_modules/lodash/_stackClear.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_stackClear.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "../../node_modules/lodash/_ListCache.js"); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; + + +/***/ }), + +/***/ "../../node_modules/lodash/_stackDelete.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_stackDelete.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; + + +/***/ }), + +/***/ "../../node_modules/lodash/_stackGet.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_stackGet.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_stackHas.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_stackHas.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; + + +/***/ }), + +/***/ "../../node_modules/lodash/_stackSet.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_stackSet.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ListCache = __webpack_require__(/*! ./_ListCache */ "../../node_modules/lodash/_ListCache.js"), + Map = __webpack_require__(/*! ./_Map */ "../../node_modules/lodash/_Map.js"), + MapCache = __webpack_require__(/*! ./_MapCache */ "../../node_modules/lodash/_MapCache.js"); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; + + +/***/ }), + +/***/ "../../node_modules/lodash/_stringToArray.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_stringToArray.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var asciiToArray = __webpack_require__(/*! ./_asciiToArray */ "../../node_modules/lodash/_asciiToArray.js"), + hasUnicode = __webpack_require__(/*! ./_hasUnicode */ "../../node_modules/lodash/_hasUnicode.js"), + unicodeToArray = __webpack_require__(/*! ./_unicodeToArray */ "../../node_modules/lodash/_unicodeToArray.js"); + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +module.exports = stringToArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/_stringToPath.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_stringToPath.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ "../../node_modules/lodash/_memoizeCapped.js"); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; + + +/***/ }), + +/***/ "../../node_modules/lodash/_toKey.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_toKey.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; + + +/***/ }), + +/***/ "../../node_modules/lodash/_toSource.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_toSource.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; + + +/***/ }), + +/***/ "../../node_modules/lodash/_unicodeToArray.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_unicodeToArray.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +module.exports = unicodeToArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/_unicodeWords.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/_unicodeWords.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]", + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; + +/** Used to match complex or compound words. */ +var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji +].join('|'), 'g'); + +/** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function unicodeWords(string) { + return string.match(reUnicodeWord) || []; +} + +module.exports = unicodeWords; + + +/***/ }), + +/***/ "../../node_modules/lodash/constant.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/constant.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; + + +/***/ }), + +/***/ "../../node_modules/lodash/debounce.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/debounce.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"), + now = __webpack_require__(/*! ./now */ "../../node_modules/lodash/now.js"), + toNumber = __webpack_require__(/*! ./toNumber */ "../../node_modules/lodash/toNumber.js"); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +module.exports = debounce; + + +/***/ }), + +/***/ "../../node_modules/lodash/deburr.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/deburr.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var deburrLetter = __webpack_require__(/*! ./_deburrLetter */ "../../node_modules/lodash/_deburrLetter.js"), + toString = __webpack_require__(/*! ./toString */ "../../node_modules/lodash/toString.js"); + +/** Used to match Latin Unicode letters (excluding mathematical operators). */ +var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + +/** Used to compose unicode character classes. */ +var rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; + +/** Used to compose unicode capture groups. */ +var rsCombo = '[' + rsComboRange + ']'; + +/** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ +var reComboMark = RegExp(rsCombo, 'g'); + +/** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ +function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); +} + +module.exports = deburr; + + +/***/ }), + +/***/ "../../node_modules/lodash/eq.js": +/*!*****************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/eq.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; + + +/***/ }), + +/***/ "../../node_modules/lodash/get.js": +/*!******************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/get.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGet = __webpack_require__(/*! ./_baseGet */ "../../node_modules/lodash/_baseGet.js"); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; + + +/***/ }), + +/***/ "../../node_modules/lodash/identity.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/identity.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; + + +/***/ }), + +/***/ "../../node_modules/lodash/isArguments.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isArguments.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ "../../node_modules/lodash/_baseIsArguments.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js"); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; + + +/***/ }), + +/***/ "../../node_modules/lodash/isArray.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isArray.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/isArrayLike.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isArrayLike.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isFunction = __webpack_require__(/*! ./isFunction */ "../../node_modules/lodash/isFunction.js"), + isLength = __webpack_require__(/*! ./isLength */ "../../node_modules/lodash/isLength.js"); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; + + +/***/ }), + +/***/ "../../node_modules/lodash/isArrayLikeObject.js": +/*!********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isArrayLikeObject.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js"); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; + + +/***/ }), + +/***/ "../../node_modules/lodash/isBuffer.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isBuffer.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"), + stubFalse = __webpack_require__(/*! ./stubFalse */ "../../node_modules/lodash/stubFalse.js"); + +/** Detect free variable `exports`. */ +var freeExports = true && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "../../node_modules/lodash/isEqual.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isEqual.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ "../../node_modules/lodash/_baseIsEqual.js"); + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +module.exports = isEqual; + + +/***/ }), + +/***/ "../../node_modules/lodash/isFunction.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isFunction.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"), + isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; + + +/***/ }), + +/***/ "../../node_modules/lodash/isLength.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isLength.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; + + +/***/ }), + +/***/ "../../node_modules/lodash/isObject.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isObject.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; + + +/***/ }), + +/***/ "../../node_modules/lodash/isObjectLike.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isObjectLike.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; + + +/***/ }), + +/***/ "../../node_modules/lodash/isPlainObject.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isPlainObject.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"), + getPrototype = __webpack_require__(/*! ./_getPrototype */ "../../node_modules/lodash/_getPrototype.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; + + +/***/ }), + +/***/ "../../node_modules/lodash/isSymbol.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isSymbol.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ "../../node_modules/lodash/_baseGetTag.js"), + isObjectLike = __webpack_require__(/*! ./isObjectLike */ "../../node_modules/lodash/isObjectLike.js"); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; + + +/***/ }), + +/***/ "../../node_modules/lodash/isTypedArray.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/isTypedArray.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ "../../node_modules/lodash/_baseIsTypedArray.js"), + baseUnary = __webpack_require__(/*! ./_baseUnary */ "../../node_modules/lodash/_baseUnary.js"), + nodeUtil = __webpack_require__(/*! ./_nodeUtil */ "../../node_modules/lodash/_nodeUtil.js"); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/keys.js": +/*!*******************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/keys.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "../../node_modules/lodash/_arrayLikeKeys.js"), + baseKeys = __webpack_require__(/*! ./_baseKeys */ "../../node_modules/lodash/_baseKeys.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; + + +/***/ }), + +/***/ "../../node_modules/lodash/keysIn.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/keysIn.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ "../../node_modules/lodash/_arrayLikeKeys.js"), + baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ "../../node_modules/lodash/_baseKeysIn.js"), + isArrayLike = __webpack_require__(/*! ./isArrayLike */ "../../node_modules/lodash/isArrayLike.js"); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; + + +/***/ }), + +/***/ "../../node_modules/lodash/memoize.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/memoize.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var MapCache = __webpack_require__(/*! ./_MapCache */ "../../node_modules/lodash/_MapCache.js"); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ +function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; +} + +// Expose `MapCache`. +memoize.Cache = MapCache; + +module.exports = memoize; + + +/***/ }), + +/***/ "../../node_modules/lodash/mergeWith.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/mergeWith.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseMerge = __webpack_require__(/*! ./_baseMerge */ "../../node_modules/lodash/_baseMerge.js"), + createAssigner = __webpack_require__(/*! ./_createAssigner */ "../../node_modules/lodash/_createAssigner.js"); + +/** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ +var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); +}); + +module.exports = mergeWith; + + +/***/ }), + +/***/ "../../node_modules/lodash/now.js": +/*!******************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/now.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var root = __webpack_require__(/*! ./_root */ "../../node_modules/lodash/_root.js"); + +/** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ +var now = function() { + return root.Date.now(); +}; + +module.exports = now; + + +/***/ }), + +/***/ "../../node_modules/lodash/startCase.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/startCase.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var createCompounder = __webpack_require__(/*! ./_createCompounder */ "../../node_modules/lodash/_createCompounder.js"), + upperFirst = __webpack_require__(/*! ./upperFirst */ "../../node_modules/lodash/upperFirst.js"); + +/** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ +var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); +}); + +module.exports = startCase; + + +/***/ }), + +/***/ "../../node_modules/lodash/stubArray.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/stubArray.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +module.exports = stubArray; + + +/***/ }), + +/***/ "../../node_modules/lodash/stubFalse.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/stubFalse.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + +module.exports = stubFalse; + + +/***/ }), + +/***/ "../../node_modules/lodash/toNumber.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/toNumber.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./isObject */ "../../node_modules/lodash/isObject.js"), + isSymbol = __webpack_require__(/*! ./isSymbol */ "../../node_modules/lodash/isSymbol.js"); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ +function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = toNumber; + + +/***/ }), + +/***/ "../../node_modules/lodash/toPlainObject.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/toPlainObject.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var copyObject = __webpack_require__(/*! ./_copyObject */ "../../node_modules/lodash/_copyObject.js"), + keysIn = __webpack_require__(/*! ./keysIn */ "../../node_modules/lodash/keysIn.js"); + +/** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ +function toPlainObject(value) { + return copyObject(value, keysIn(value)); +} + +module.exports = toPlainObject; + + +/***/ }), + +/***/ "../../node_modules/lodash/toString.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/toString.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var baseToString = __webpack_require__(/*! ./_baseToString */ "../../node_modules/lodash/_baseToString.js"); + +/** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + return value == null ? '' : baseToString(value); +} + +module.exports = toString; + + +/***/ }), + +/***/ "../../node_modules/lodash/upperFirst.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/upperFirst.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var createCaseFirst = __webpack_require__(/*! ./_createCaseFirst */ "../../node_modules/lodash/_createCaseFirst.js"); + +/** + * Converts the first character of `string` to upper case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.upperFirst('fred'); + * // => 'Fred' + * + * _.upperFirst('FRED'); + * // => 'FRED' + */ +var upperFirst = createCaseFirst('toUpperCase'); + +module.exports = upperFirst; + + +/***/ }), + +/***/ "../../node_modules/lodash/words.js": +/*!********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/lodash/words.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var asciiWords = __webpack_require__(/*! ./_asciiWords */ "../../node_modules/lodash/_asciiWords.js"), + hasUnicodeWord = __webpack_require__(/*! ./_hasUnicodeWord */ "../../node_modules/lodash/_hasUnicodeWord.js"), + toString = __webpack_require__(/*! ./toString */ "../../node_modules/lodash/toString.js"), + unicodeWords = __webpack_require__(/*! ./_unicodeWords */ "../../node_modules/lodash/_unicodeWords.js"); + +/** + * Splits `string` into an array of its words. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {RegExp|string} [pattern] The pattern to match words. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the words of `string`. + * @example + * + * _.words('fred, barney, & pebbles'); + * // => ['fred', 'barney', 'pebbles'] + * + * _.words('fred, barney, & pebbles', /[^, ]+/g); + * // => ['fred', 'barney', '&', 'pebbles'] + */ +function words(string, pattern, guard) { + string = toString(string); + pattern = guard ? undefined : pattern; + + if (pattern === undefined) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); + } + return string.match(pattern) || []; +} + +module.exports = words; + + +/***/ }), + +/***/ "../../node_modules/memoizerific/memoizerific.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/memoizerific/memoizerific.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var require;var require;(function(f){if(true){module.exports=f()}else { var g; }})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ +module.exports = function(forceSimilar) { + if (typeof Map !== 'function' || forceSimilar) { + var Similar = _dereq_('./similar'); + return new Similar(); + } + else { + return new Map(); + } +} + +},{"./similar":2}],2:[function(_dereq_,module,exports){ +function Similar() { + this.list = []; + this.lastItem = undefined; + this.size = 0; + + return this; +} + +Similar.prototype.get = function(key) { + var index; + + if (this.lastItem && this.isEqual(this.lastItem.key, key)) { + return this.lastItem.val; + } + + index = this.indexOf(key); + if (index >= 0) { + this.lastItem = this.list[index]; + return this.list[index].val; + } + + return undefined; +}; + +Similar.prototype.set = function(key, val) { + var index; + + if (this.lastItem && this.isEqual(this.lastItem.key, key)) { + this.lastItem.val = val; + return this; + } + + index = this.indexOf(key); + if (index >= 0) { + this.lastItem = this.list[index]; + this.list[index].val = val; + return this; + } + + this.lastItem = { key: key, val: val }; + this.list.push(this.lastItem); + this.size++; + + return this; +}; + +Similar.prototype.delete = function(key) { + var index; + + if (this.lastItem && this.isEqual(this.lastItem.key, key)) { + this.lastItem = undefined; + } + + index = this.indexOf(key); + if (index >= 0) { + this.size--; + return this.list.splice(index, 1)[0]; + } + + return undefined; +}; + + +// important that has() doesn't use get() in case an existing key has a falsy value, in which case has() would return false +Similar.prototype.has = function(key) { + var index; + + if (this.lastItem && this.isEqual(this.lastItem.key, key)) { + return true; + } + + index = this.indexOf(key); + if (index >= 0) { + this.lastItem = this.list[index]; + return true; + } + + return false; +}; + +Similar.prototype.forEach = function(callback, thisArg) { + var i; + for (i = 0; i < this.size; i++) { + callback.call(thisArg || this, this.list[i].val, this.list[i].key, this); + } +}; + +Similar.prototype.indexOf = function(key) { + var i; + for (i = 0; i < this.size; i++) { + if (this.isEqual(this.list[i].key, key)) { + return i; + } + } + return -1; +}; + +// check if the numbers are equal, or whether they are both precisely NaN (isNaN returns true for all non-numbers) +Similar.prototype.isEqual = function(val1, val2) { + return val1 === val2 || (val1 !== val1 && val2 !== val2); +}; + +module.exports = Similar; +},{}],3:[function(_dereq_,module,exports){ +var MapOrSimilar = _dereq_('map-or-similar'); + +module.exports = function (limit) { + var cache = new MapOrSimilar(undefined === 'true'), + lru = []; + + return function (fn) { + var memoizerific = function () { + var currentCache = cache, + newMap, + fnResult, + argsLengthMinusOne = arguments.length - 1, + lruPath = Array(argsLengthMinusOne + 1), + isMemoized = true, + i; + + if ((memoizerific.numArgs || memoizerific.numArgs === 0) && memoizerific.numArgs !== argsLengthMinusOne + 1) { + throw new Error('Memoizerific functions should always be called with the same number of arguments'); + } + + // loop through each argument to traverse the map tree + for (i = 0; i < argsLengthMinusOne; i++) { + lruPath[i] = { + cacheItem: currentCache, + arg: arguments[i] + }; + + // climb through the hierarchical map tree until the second-last argument has been found, or an argument is missing. + // if all arguments up to the second-last have been found, this will potentially be a cache hit (determined later) + if (currentCache.has(arguments[i])) { + currentCache = currentCache.get(arguments[i]); + continue; + } + + isMemoized = false; + + // make maps until last value + newMap = new MapOrSimilar(undefined === 'true'); + currentCache.set(arguments[i], newMap); + currentCache = newMap; + } + + // we are at the last arg, check if it is really memoized + if (isMemoized) { + if (currentCache.has(arguments[argsLengthMinusOne])) { + fnResult = currentCache.get(arguments[argsLengthMinusOne]); + } + else { + isMemoized = false; + } + } + + if (!isMemoized) { + fnResult = fn.apply(null, arguments); + currentCache.set(arguments[argsLengthMinusOne], fnResult); + } + + if (limit > 0) { + lruPath[argsLengthMinusOne] = { + cacheItem: currentCache, + arg: arguments[argsLengthMinusOne] + }; + + if (isMemoized) { + moveToMostRecentLru(lru, lruPath); + } + else { + lru.push(lruPath); + } + + if (lru.length > limit) { + removeCachedResult(lru.shift()); + } + } + + memoizerific.wasMemoized = isMemoized; + memoizerific.numArgs = argsLengthMinusOne + 1; + + return fnResult; + }; + + memoizerific.limit = limit; + memoizerific.wasMemoized = false; + memoizerific.cache = cache; + memoizerific.lru = lru; + + return memoizerific; + }; +}; + +// move current args to most recent position +function moveToMostRecentLru(lru, lruPath) { + var lruLen = lru.length, + lruPathLen = lruPath.length, + isMatch, + i, ii; + + for (i = 0; i < lruLen; i++) { + isMatch = true; + for (ii = 0; ii < lruPathLen; ii++) { + if (!isEqual(lru[i][ii].arg, lruPath[ii].arg)) { + isMatch = false; + break; + } + } + if (isMatch) { + break; + } + } + + lru.push(lru.splice(i, 1)[0]); +} + +// remove least recently used cache item and all dead branches +function removeCachedResult(removedLru) { + var removedLruLen = removedLru.length, + currentLru = removedLru[removedLruLen - 1], + tmp, + i; + + currentLru.cacheItem.delete(currentLru.arg); + + // walk down the tree removing dead branches (size 0) along the way + for (i = removedLruLen - 2; i >= 0; i--) { + currentLru = removedLru[i]; + tmp = currentLru.cacheItem.get(currentLru.arg); + + if (!tmp || !tmp.size) { + currentLru.cacheItem.delete(currentLru.arg); + } else { + break; + } + } +} + +// check if the numbers are equal, or whether they are both precisely NaN (isNaN returns true for all non-numbers) +function isEqual(val1, val2) { + return val1 === val2 || (val1 !== val1 && val2 !== val2); +} +},{"map-or-similar":1}]},{},[3])(3) +}); + +/***/ }), + +/***/ "../../node_modules/object-assign/index.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object-assign/index.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* +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; + } +} + +module.exports = 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; +}; + + +/***/ }), + +/***/ "../../node_modules/object-inspect/index.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object-inspect/index.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype; +var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; +var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype; +var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var match = String.prototype.match; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; + +var inspectCustom = __webpack_require__(/*! ./util.inspect */ 4).custom; +var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null; + +module.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + return String(obj); + } + if (typeof obj === 'bigint') { // eslint-disable-line valid-typeof + return String(obj) + 'n'; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') { depth = 0; } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return '[Object]'; + } + + if (typeof seen === 'undefined') { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect(value, from) { + if (from) { + seen = seen.slice(); + seen.push(from); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function') { + var name = nameOf(obj); + return '[Function' + (name ? ': ' + name : '') + ']'; + } + if (isSymbol(obj)) { + var symString = Symbol.prototype.toString.call(obj); + return typeof obj === 'object' ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + String(obj.nodeName).toLowerCase(); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) { s += '...'; } + s += '</' + String(obj.nodeName).toLowerCase() + '>'; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) { return '[]'; } + return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (parts.length === 0) { return '[' + String(obj) + ']'; } + return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; + } + if (typeof obj === 'object') { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { + return obj[inspectSymbol](); + } else if (typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + mapForEach.call(obj, function (value, key) { + mapParts.push(inspect(key, obj) + ' => ' + inspect(value, obj)); + }); + return collectionOf('Map', mapSize.call(obj), mapParts); + } + if (isSet(obj)) { + var setParts = []; + setForEach.call(obj, function (value) { + setParts.push(inspect(value, obj)); + }); + return collectionOf('Set', setSize.call(obj), setParts); + } + if (isWeakMap(obj)) { + return weakCollectionOf('WeakMap'); + } + if (isWeakSet(obj)) { + return weakCollectionOf('WeakSet'); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + if (!isDate(obj) && !isRegExp(obj)) { + var xs = arrObjKeys(obj, inspect); + if (xs.length === 0) { return '{}'; } + return '{ ' + xs.join(', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes(s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; +} + +function quote(s) { + return String(s).replace(/"/g, '"'); +} + +function isArray(obj) { return toStr(obj) === '[object Array]'; } +function isDate(obj) { return toStr(obj) === '[object Date]'; } +function isRegExp(obj) { return toStr(obj) === '[object RegExp]'; } +function isError(obj) { return toStr(obj) === '[object Error]'; } +function isSymbol(obj) { return toStr(obj) === '[object Symbol]'; } +function isString(obj) { return toStr(obj) === '[object String]'; } +function isNumber(obj) { return toStr(obj) === '[object Number]'; } +function isBigInt(obj) { return toStr(obj) === '[object BigInt]'; } +function isBoolean(obj) { return toStr(obj) === '[object Boolean]'; } + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has(obj, key) { + return hasOwn.call(obj, key); +} + +function toStr(obj) { + return objectToString.call(obj); +} + +function nameOf(f) { + if (f.name) { return f.name; } + var m = match.call(f, /^function\s*([\w$]+)/); + if (m) { return m[1]; } + return null; +} + +function indexOf(xs, x) { + if (xs.indexOf) { return xs.indexOf(x); } + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) { return i; } + } + return -1; +} + +function isMap(x) { + if (!mapSize || !x || typeof x !== 'object') { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakMap(x) { + if (!weakMapHas || !x || typeof x !== 'object') { + return false; + } + try { + weakMapHas.call(x, weakMapHas); + try { + weakSetHas.call(x, weakSetHas); + } catch (s) { + return true; + } + return x instanceof WeakMap; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isSet(x) { + if (!setSize || !x || typeof x !== 'object') { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isWeakSet(x) { + if (!weakSetHas || !x || typeof x !== 'object') { + return false; + } + try { + weakSetHas.call(x, weakSetHas); + try { + weakMapHas.call(x, weakMapHas); + } catch (s) { + return true; + } + return x instanceof WeakSet; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement(x) { + if (!x || typeof x !== 'object') { return false; } + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function'; +} + +function inspectString(str, opts) { + // eslint-disable-next-line no-control-regex + var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte(c) { + var n = c.charCodeAt(0); + var x = { + 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' + }[n]; + if (x) { return '\\' + x; } + return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); +} + +function markBoxed(str) { + return 'Object(' + str + ')'; +} + +function weakCollectionOf(type) { + return type + ' { ? }'; +} + +function collectionOf(type, size, entries) { + return type + ' (' + size + ') {' + entries.join(', ') + '}'; +} + +function arrObjKeys(obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + for (var key in obj) { // eslint-disable-line no-restricted-syntax + if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue + if ((/[^\w$]/).test(key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + return xs; +} + + +/***/ }), + +/***/ "../../node_modules/object-keys/implementation.js": +/*!**********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object-keys/implementation.js ***! + \**********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var keysShim; +if (!Object.keys) { + // modified from https://github.com/es-shims/es5-shim + var has = Object.prototype.hasOwnProperty; + var toStr = Object.prototype.toString; + var isArgs = __webpack_require__(/*! ./isArguments */ "../../node_modules/object-keys/isArguments.js"); // eslint-disable-line global-require + var isEnumerable = Object.prototype.propertyIsEnumerable; + var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); + var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); + var dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + var equalsConstructorPrototype = function (o) { + var ctor = o.constructor; + return ctor && ctor.prototype === o; + }; + var excludedKeys = { + $applicationCache: true, + $console: true, + $external: true, + $frame: true, + $frameElement: true, + $frames: true, + $innerHeight: true, + $innerWidth: true, + $onmozfullscreenchange: true, + $onmozfullscreenerror: true, + $outerHeight: true, + $outerWidth: true, + $pageXOffset: true, + $pageYOffset: true, + $parent: true, + $scrollLeft: true, + $scrollTop: true, + $scrollX: true, + $scrollY: true, + $self: true, + $webkitIndexedDB: true, + $webkitStorageInfo: true, + $window: true + }; + var hasAutomationEqualityBug = (function () { + /* global window */ + if (typeof window === 'undefined') { return false; } + for (var k in window) { + try { + if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { + try { + equalsConstructorPrototype(window[k]); + } catch (e) { + return true; + } + } + } catch (e) { + return true; + } + } + return false; + }()); + var equalsConstructorPrototypeIfNotBuggy = function (o) { + /* global window */ + if (typeof window === 'undefined' || !hasAutomationEqualityBug) { + return equalsConstructorPrototype(o); + } + try { + return equalsConstructorPrototype(o); + } catch (e) { + return false; + } + }; + + keysShim = function keys(object) { + var isObject = object !== null && typeof object === 'object'; + var isFunction = toStr.call(object) === '[object Function]'; + var isArguments = isArgs(object); + var isString = isObject && toStr.call(object) === '[object String]'; + var theKeys = []; + + if (!isObject && !isFunction && !isArguments) { + throw new TypeError('Object.keys called on a non-object'); + } + + var skipProto = hasProtoEnumBug && isFunction; + if (isString && object.length > 0 && !has.call(object, 0)) { + for (var i = 0; i < object.length; ++i) { + theKeys.push(String(i)); + } + } + + if (isArguments && object.length > 0) { + for (var j = 0; j < object.length; ++j) { + theKeys.push(String(j)); + } + } else { + for (var name in object) { + if (!(skipProto && name === 'prototype') && has.call(object, name)) { + theKeys.push(String(name)); + } + } + } + + if (hasDontEnumBug) { + var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); + + for (var k = 0; k < dontEnums.length; ++k) { + if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { + theKeys.push(dontEnums[k]); + } + } + } + return theKeys; + }; +} +module.exports = keysShim; + + +/***/ }), + +/***/ "../../node_modules/object-keys/index.js": +/*!*************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object-keys/index.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var slice = Array.prototype.slice; +var isArgs = __webpack_require__(/*! ./isArguments */ "../../node_modules/object-keys/isArguments.js"); + +var origKeys = Object.keys; +var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(/*! ./implementation */ "../../node_modules/object-keys/implementation.js"); + +var originalKeys = Object.keys; + +keysShim.shim = function shimObjectKeys() { + if (Object.keys) { + var keysWorksWithArguments = (function () { + // Safari 5.0 bug + var args = Object.keys(arguments); + return args && args.length === arguments.length; + }(1, 2)); + if (!keysWorksWithArguments) { + Object.keys = function keys(object) { // eslint-disable-line func-name-matching + if (isArgs(object)) { + return originalKeys(slice.call(object)); + } + return originalKeys(object); + }; + } + } else { + Object.keys = keysShim; + } + return Object.keys || keysShim; +}; + +module.exports = keysShim; + + +/***/ }), + +/***/ "../../node_modules/object-keys/isArguments.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object-keys/isArguments.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; + +module.exports = function isArguments(value) { + var str = toStr.call(value); + var isArgs = str === '[object Arguments]'; + if (!isArgs) { + isArgs = str !== '[object Array]' && + value !== null && + typeof value === 'object' && + typeof value.length === 'number' && + value.length >= 0 && + toStr.call(value.callee) === '[object Function]'; + } + return isArgs; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/implementation.js": +/*!*************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/implementation.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES = __webpack_require__(/*! es-abstract/es7 */ "../../node_modules/object.entries/node_modules/es-abstract/es7.js"); +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); + +module.exports = function entries(O) { + var obj = ES.RequireObjectCoercible(O); + var entrys = []; + for (var key in obj) { + if (has(obj, key) && isEnumerable(obj, key)) { + entrys.push([key, obj[key]]); + } + } + return entrys; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; // eslint-disable-line no-shadow-restricted-names + +var ThrowTypeError = Object.getOwnPropertyDescriptor + ? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }()) + : function () { throw new TypeError(); }; + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '$ %Array%': Array, + '$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '$ %ArrayPrototype%': Array.prototype, + '$ %ArrayProto_entries%': Array.prototype.entries, + '$ %ArrayProto_forEach%': Array.prototype.forEach, + '$ %ArrayProto_keys%': Array.prototype.keys, + '$ %ArrayProto_values%': Array.prototype.values, + '$ %AsyncFromSyncIteratorPrototype%': undefined, + '$ %AsyncFunction%': asyncFunction, + '$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '$ %AsyncGeneratorFunction%': asyncGenFunction, + '$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '$ %Boolean%': Boolean, + '$ %BooleanPrototype%': Boolean.prototype, + '$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '$ %Date%': Date, + '$ %DatePrototype%': Date.prototype, + '$ %decodeURI%': decodeURI, + '$ %decodeURIComponent%': decodeURIComponent, + '$ %encodeURI%': encodeURI, + '$ %encodeURIComponent%': encodeURIComponent, + '$ %Error%': Error, + '$ %ErrorPrototype%': Error.prototype, + '$ %eval%': eval, // eslint-disable-line no-eval + '$ %EvalError%': EvalError, + '$ %EvalErrorPrototype%': EvalError.prototype, + '$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '$ %Function%': Function, + '$ %FunctionPrototype%': Function.prototype, + '$ %Generator%': generator ? getProto(generator()) : undefined, + '$ %GeneratorFunction%': generatorFunction, + '$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '$ %isFinite%': isFinite, + '$ %isNaN%': isNaN, + '$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '$ %JSON%': JSON, + '$ %JSONParse%': JSON.parse, + '$ %Map%': typeof Map === 'undefined' ? undefined : Map, + '$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '$ %Math%': Math, + '$ %Number%': Number, + '$ %NumberPrototype%': Number.prototype, + '$ %Object%': Object, + '$ %ObjectPrototype%': Object.prototype, + '$ %ObjProto_toString%': Object.prototype.toString, + '$ %ObjProto_valueOf%': Object.prototype.valueOf, + '$ %parseFloat%': parseFloat, + '$ %parseInt%': parseInt, + '$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '$ %RangeError%': RangeError, + '$ %RangeErrorPrototype%': RangeError.prototype, + '$ %ReferenceError%': ReferenceError, + '$ %ReferenceErrorPrototype%': ReferenceError.prototype, + '$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '$ %RegExp%': RegExp, + '$ %RegExpPrototype%': RegExp.prototype, + '$ %Set%': typeof Set === 'undefined' ? undefined : Set, + '$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '$ %String%': String, + '$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '$ %StringPrototype%': String.prototype, + '$ %Symbol%': hasSymbols ? Symbol : undefined, + '$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '$ %SyntaxError%': SyntaxError, + '$ %SyntaxErrorPrototype%': SyntaxError.prototype, + '$ %ThrowTypeError%': ThrowTypeError, + '$ %TypedArray%': TypedArray, + '$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '$ %TypeError%': TypeError, + '$ %TypeErrorPrototype%': TypeError.prototype, + '$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '$ %URIError%': URIError, + '$ %URIErrorPrototype%': URIError.prototype, + '$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var key = '$ ' + name; + if (!(key in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) { + throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + return INTRINSICS[key]; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/es2015.js": +/*!******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/es2015.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es6 */ "../../node_modules/object.entries/node_modules/es-to-primitive/es6.js"); +var keys = __webpack_require__(/*! object-keys */ "../../node_modules/object-keys/index.js"); +var inspect = __webpack_require__(/*! object-inspect */ "../../node_modules/object.entries/node_modules/object-inspect/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $Array = GetIntrinsic('%Array%'); +var $ArrayPrototype = $Array.prototype; +var $String = GetIntrinsic('%String%'); +var $Object = GetIntrinsic('%Object%'); +var $Number = GetIntrinsic('%Number%'); +var $Symbol = GetIntrinsic('%Symbol%', true); +var $RegExp = GetIntrinsic('%RegExp%'); +var $Promise = GetIntrinsic('%Promise%', true); +var $preventExtensions = $Object.preventExtensions; + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/assertRecord.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isFinite.js"); +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; +var MAX_SAFE_INTEGER = $Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/assign.js"); +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/mod.js"); +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isPrimitive.js"); +var forEach = __webpack_require__(/*! ./helpers/forEach */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/forEach.js"); +var every = __webpack_require__(/*! ./helpers/every */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/every.js"); +var isSamePropertyDescriptor = __webpack_require__(/*! ./helpers/isSamePropertyDescriptor */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var parseInteger = parseInt; +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js"); +var $PromiseThen = $Promise ? callBind(GetIntrinsic('%PromiseProto_then%')) : null; +var arraySlice = callBind($Array.prototype.slice); +var strSlice = callBind($String.prototype.slice); +var isBinary = callBind($RegExp.prototype.test, /^0b[01]+$/i); +var isOctal = callBind($RegExp.prototype.test, /^0o[0-7]+$/i); +var isDigit = callBind($RegExp.prototype.test, /^[0-9]$/); +var regexExec = callBind($RegExp.prototype.exec); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = callBind($RegExp.prototype.test, nonWSregex); +var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i; +var isInvalidHexLiteral = callBind($RegExp.prototype.test, invalidHexLiteral); +var $charCodeAt = callBind($String.prototype.charCodeAt); +var $isEnumerable = callBind($Object.prototype.propertyIsEnumerable); + +var toStr = callBind($Object.prototype.toString); + +var $NumberValueOf = callBind(GetIntrinsic('%NumberPrototype%').valueOf); +var $BooleanValueOf = callBind(GetIntrinsic('%BooleanPrototype%').valueOf); +var $StringValueOf = callBind(GetIntrinsic('%StringPrototype%').valueOf); +var $DateValueOf = callBind(GetIntrinsic('%DatePrototype%').valueOf); +var $SymbolToString = hasSymbols && callBind(GetIntrinsic('%SymbolPrototype%').toString); + +var $floor = Math.floor; +var $abs = Math.abs; + +var $ObjectCreate = $Object.create; +var $gOPD = $Object.getOwnPropertyDescriptor; +var $gOPN = $Object.getOwnPropertyNames; +var $gOPS = $Object.getOwnPropertySymbols; +var $isExtensible = $Object.isExtensible; +var $defineProperty = $Object.defineProperty; +var $setProto = Object.setPrototypeOf || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== Array.prototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto + return O; + } +); + +var DefineOwnProperty = function DefineOwnProperty(ES, O, P, desc) { + if (!$defineProperty) { + if (!ES.IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + O[P] = V; // will use [[Define]] + return ES.SameValue(O[P], V); + } + $defineProperty(O, P, ES.FromPropertyDescriptor(desc)); + return true; +}; + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBind($String.prototype.replace); +var trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ES5 = __webpack_require__(/*! ./es5 */ "../../node_modules/object.entries/node_modules/es-abstract/es5.js"); + +var hasRegExpMatcher = __webpack_require__(/*! is-regex */ "../../node_modules/is-regex/index.js"); + +// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations +var ES6 = assign(assign({}, ES5), { + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args + Call: function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + if (!this.IsCallable(F)) { + throw new $TypeError(inspect(F) + ' is not a function'); + } + return F.apply(V, args); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive + ToPrimitive: toPrimitive, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean + // ToBoolean: ES5.ToBoolean, + + // https://ecma-international.org/ecma-262/6.0/#sec-tonumber + ToNumber: function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : toPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = trim(value); + if (trimmed !== value) { + return this.ToNumber(trimmed); + } + } + } + return $Number(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger + // ToInteger: ES5.ToNumber, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32 + // ToInt32: ES5.ToInt32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32 + // ToUint32: ES5.ToUint32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16 + ToInt16: function ToInt16(argument) { + var int16bit = this.ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16 + // ToUint16: ES5.ToUint16, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8 + ToInt8: function ToInt8(argument) { + var int8bit = this.ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8 + ToUint8: function ToUint8(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * $floor($abs(number)); + return mod(posInt, 0x100); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp + ToUint8Clamp: function ToUint8Clamp(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring + ToString: function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject + ToObject: function ToObject(value) { + this.RequireObjectCoercible(value); + return $Object(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + ToPropertyKey: function ToPropertyKey(argument) { + var key = this.ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : this.ToString(key); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + ToLength: function ToLength(argument) { + var len = this.ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) { + if (toStr(argument) !== '[object String]') { + throw new $TypeError('must be a string'); + } + if (argument === '-0') { return -0; } + var n = this.ToNumber(argument); + if (this.SameValue(this.ToString(n), argument)) { return n; } + return void 0; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible + RequireObjectCoercible: ES5.CheckObjectCoercible, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + IsArray: $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable + // IsCallable: ES5.IsCallable, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + IsConstructor: function IsConstructor(argument) { + return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument` + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o + IsExtensible: $preventExtensions + ? function IsExtensible(obj) { + if (isPrimitive(obj)) { + return false; + } + return $isExtensible(obj); + } + : function isExtensible(obj) { return true; }, // eslint-disable-line no-unused-vars + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger + IsInteger: function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey + IsPropertyKey: function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isregexp + IsRegExp: function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if (hasSymbols) { + var isRegExp = argument[$Symbol.match]; + if (typeof isRegExp !== 'undefined') { + return ES5.ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue + // SameValue: ES5.SameValue, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero + SameValueZero: function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); + }, + + /** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + GetV: function GetV(V, P) { + // 7.3.2.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = this.ToObject(V); + + // 7.3.2.4 + return O[P]; + }, + + /** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + GetMethod: function GetMethod(O, P) { + // 7.3.9.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = this.GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!this.IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; + }, + + /** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + Get: function Get(O, P) { + // 7.3.1.1 + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; + }, + + Type: function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5.Type(x); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (this.Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (this.IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) { + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + Set: function Set(O, P, V, Throw) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + if (this.Type(Throw) !== 'Boolean') { + throw new $TypeError('Throw must be a Boolean'); + } + if (Throw) { + O[P] = V; + return true; + } else { + try { + O[P] = V; + } catch (e) { + return false; + } + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + HasOwnProperty: function HasOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return has(O, P); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + HasProperty: function HasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return P in O; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + IsConcatSpreadable: function IsConcatSpreadable(O) { + if (this.Type(O) !== 'Object') { + return false; + } + if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') { + var spreadable = this.Get(O, Symbol.isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return this.ToBoolean(spreadable); + } + } + return this.IsArray(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-invoke + Invoke: function Invoke(O, P) { + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = arraySlice(arguments, 2); + var func = this.GetV(O, P); + return this.Call(func, O, argumentsList); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-getiterator + GetIterator: function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + if (!hasSymbols) { + throw new SyntaxError('GetIterator depends on native Symbol support when `method` is not passed'); + } + actualMethod = this.GetMethod(obj, $Symbol.iterator); + } + var iterator = this.Call(actualMethod, obj); + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + IteratorNext: function IteratorNext(iterator, value) { + var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (this.Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + IteratorComplete: function IteratorComplete(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.ToBoolean(this.Get(iterResult, 'done')); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + IteratorValue: function IteratorValue(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.Get(iterResult, 'value'); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + IteratorStep: function IteratorStep(iterator) { + var result = this.IteratorNext(iterator); + var done = this.IteratorComplete(result); + return done === true ? false : result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + IteratorClose: function IteratorClose(iterator, completion) { + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!this.IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = this.GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = this.Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionRecord = completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (this.Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + CreateIterResultObject: function CreateIterResultObject(value, done) { + if (this.Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + RegExpExec: function RegExpExec(R, S) { + if (this.Type(R) !== 'Object') { + throw new $TypeError('R must be an Object'); + } + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + var exec = this.Get(R, 'exec'); + if (this.IsCallable(exec)) { + var result = this.Call(exec, R, [S]); + if (result === null || this.Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = this.IsArray(originalArray); + if (isArray) { + C = this.Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (this.IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) { + C = this.Get(C, $Symbol.species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!this.IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // this.Construct(C, len); + }, + + CreateDataProperty: function CreateDataProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = $gOPD(O, P); + var extensible = oldDesc || this.IsExtensible(O); + var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty(this, O, P, { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + }); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = this.CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + ObjectCreate: function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && this.Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: proto must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if (proto === null && !$ObjectCreate) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + + return $ObjectCreate(proto); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) { + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53'); + } + if (this.Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: unicode must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + CreateMethodProperty: function CreateMethodProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty(this, O, P, newDesc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + DefinePropertyOrThrow: function DefinePropertyOrThrow(O, P, desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor(this, desc) ? desc : this.ToPropertyDescriptor(desc); + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty(this, O, P, Desc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + DeletePropertyOrThrow: function DeletePropertyOrThrow(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var success = delete O[P]; + if (!success) { + throw new TypeError('Attempt to delete property failed.'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + EnumerableOwnNames: function EnumerableOwnNames(O) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + thisNumberValue: function thisNumberValue(value) { + if (this.Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + thisBooleanValue: function thisBooleanValue(value) { + if (this.Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + thisStringValue: function thisStringValue(value) { + if (this.Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + thisTimeValue: function thisTimeValue(value) { + return $DateValueOf(value); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + SetIntegrityLevel: function SetIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + var ES = this; + if (level === 'sealed') { + forEach(theKeys, function (k) { + ES.DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (ES.IsAccessorDescriptor(ES.ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + ES.DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + TestIntegrityLevel: function TestIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = this.IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + var ES = this; + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && ES.IsDataDescriptor(ES.ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + OrdinaryHasInstance: function OrdinaryHasInstance(C, O) { + if (this.IsCallable(C) === false) { + return false; + } + if (this.Type(O) !== 'Object') { + return false; + } + var P = this.Get(C, 'prototype'); + if (this.Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + OrdinaryHasProperty: function OrdinaryHasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + InstanceofOperator: function InstanceofOperator(O, C) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = hasSymbols && $Symbol.hasInstance ? this.GetMethod(C, $Symbol.hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return this.ToBoolean(this.Call(instOfHandler, C, [O])); + } + if (!this.IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return this.OrdinaryHasInstance(C, O); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + IsPromise: function IsPromise(x) { + if (this.Type(x) !== 'Object') { + return false; + } + if (!$Promise) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // eslint-disable-next-line max-lines-per-function, max-statements, id-length, max-params + ValidateAndApplyPropertyDescriptor: function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = this.Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (this.Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (this.Type(current) !== 'Undefined' && !isPropertyDescriptor(this, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (this.Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + }); + } + } else { + if (!this.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + } + return true; + } + if (this.IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor(this, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (this.IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (this.IsDataDescriptor(current) !== this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (this.IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + }); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + }); + } + } else if (this.IsDataDescriptor(current) && this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !this.SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (this.IsAccessorDescriptor(current) && this.IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !this.SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !this.SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + OrdinaryDefineOwnProperty: function OrdinaryDefineOwnProperty(O, P, Desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + var desc = $gOPD(O, P); + var current = desc && this.ToPropertyDescriptor(desc); + var extensible = this.IsExtensible(O); + return this.ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + OrdinaryGetOwnProperty: function OrdinaryGetOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 fallback + var arrayLength = this.IsArray(O) && P === 'length'; + var regexLastIndex = this.IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return this.ToPropertyDescriptor($gOPD(O, P)); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + ArrayCreate: function ArrayCreate(length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + this.OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; + }, + + // eslint-disable-next-line max-statements, max-lines-per-function + ArraySetLength: function ArraySetLength(A, Desc) { + if (!this.IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return this.OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = this.ToUint32(Desc['[[Value]]']); + var numberLen = this.ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = this.OrdinaryGetOwnProperty(A, 'length'); + if (!this.IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + var deleteSucceeded = delete A[this.ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return this.OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + CreateHTML: function CreateHTML(string, tag, attribute, value) { + if (this.Type(tag) !== 'String' || this.Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = this.RequireObjectCoercible(string); + var S = this.ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = this.ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + '</' + tag + '>'; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + GetOwnPropertyKeys: function GetOwnPropertyKeys(O, Type) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return hasSymbols && $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + SymbolDescriptiveString: function SymbolDescriptiveString(sym) { + if (this.Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + // eslint-disable-next-line max-statements, max-params, max-lines-per-function + GetSubstitution: function GetSubstitution(matched, str, position, captures, replacement) { + if (this.Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (this.Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!this.IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + var ES = this; + var isStringOrHole = function (capture, index, arr) { return ES.Type(capture) === 'String' || !(index in arr); }; + if (!this.IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (this.Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = replacement[i]; + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = replacement[i + 1]; + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : replacement[i + 2]; + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = parseInteger(next, 10); + // if (n > m, impl-defined) + result += (n <= m && this.Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = parseInteger(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && this.Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += replacement[i]; + } + } + return result; + } +}); + +delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible + +module.exports = ES6; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/es2016.js": +/*!******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/es2016.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js"); + +var $Array = GetIntrinsic('%Array%'); + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var ES2015 = __webpack_require__(/*! ./es2015 */ "../../node_modules/object.entries/node_modules/es-abstract/es2015.js"); +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/assign.js"); +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js"); + +var $arrayPush = callBind($Array.prototype.push); +var $arraySlice = callBind($Array.prototype.slice); +var $arrayJoin = callBind($Array.prototype.join); + +var ES2016 = assign(assign({}, ES2015), { + // https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + SameValueNonNumber: function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return this.SameValue(x, y); + }, + + // https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike + IterableToArrayLike: function IterableToArrayLike(items) { + var usingIterator; + if (hasSymbols) { + usingIterator = this.GetMethod(items, Symbol.iterator); + } else if (this.IsArray(items)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (this.Type(items) === 'String') { + var ES = this; + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(items, i, true); + var value = $arrayJoin($arraySlice(items, i, nextIndex), ''); + i = nextIndex; + return { + done: nextIndex > items.length, + value: value + }; + } + }; + }; + } + if (typeof usingIterator !== 'undefined') { + var iterator = this.GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = this.IteratorStep(iterator); + if (next) { + var nextValue = this.IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return this.ToObject(items); + } +}); + +module.exports = ES2016; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/es5.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/es5.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js"); + +var $Object = GetIntrinsic('%Object%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $String = GetIntrinsic('%String%'); +var $Number = GetIntrinsic('%Number%'); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/assertRecord.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isFinite.js"); + +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/mod.js"); + +var IsCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es5 */ "../../node_modules/object.entries/node_modules/es-to-primitive/es5.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js"); +var strSlice = callBind($String.prototype.slice); + +var isPrefixOf = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return strSlice(string, 0, prefix.length) === prefix; +}; + +// https://es5.github.io/#x9 +var ES5 = { + ToPrimitive: toPrimitive, + + ToBoolean: function ToBoolean(value) { + return !!value; + }, + ToNumber: function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion + }, + ToInteger: function ToInteger(value) { + var number = this.ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return sign(number) * Math.floor(Math.abs(number)); + }, + ToInt32: function ToInt32(x) { + return this.ToNumber(x) >> 0; + }, + ToUint32: function ToUint32(x) { + return this.ToNumber(x) >>> 0; + }, + ToUint16: function ToUint16(value) { + var number = this.ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * Math.floor(Math.abs(number)); + return mod(posInt, 0x10000); + }, + ToString: function ToString(value) { + return $String(value); + }, + ToObject: function ToObject(value) { + this.CheckObjectCoercible(value); + return $Object(value); + }, + CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { + /* jshint eqnull:true */ + if (value == null) { + throw new $TypeError(optMessage || 'Cannot call method on ' + value); + } + return value; + }, + IsCallable: IsCallable, + SameValue: function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-8 + Type: function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + IsPropertyDescriptor: function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor(this, Desc); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + IsAccessorDescriptor: function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + IsDataDescriptor: function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + IsGenericDescriptor: function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) { + return true; + } + + return false; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (this.IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + ToPropertyDescriptor: function ToPropertyDescriptor(Obj) { + if (this.Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = this.ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !this.IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !this.IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + 'Strict Equality Comparison': function StrictEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + // eslint-disable-next-line max-statements + 'Abstract Relational Comparison': function AbstractRelationalComparison(x, y, LeftFirst) { + if (this.Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = this.ToPrimitive(x, $Number); + py = this.ToPrimitive(y, $Number); + } else { + py = this.ToPrimitive(y, $Number); + px = this.ToPrimitive(x, $Number); + } + var bothStrings = this.Type(px) === 'String' && this.Type(py) === 'String'; + if (!bothStrings) { + var nx = this.ToNumber(px); + var ny = this.ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f + } +}; + +module.exports = ES5; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/es7.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/es7.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2016 */ "../../node_modules/object.entries/node_modules/es-abstract/es2016.js"); + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/assertRecord.js": +/*!********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/assertRecord.js ***! + \********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(ES, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(ES, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/assign.js": +/*!**************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/assign.js ***! + \**************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + target[key] = source[key]; + } + } + return target; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js": +/*!****************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/callBind.js ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js"); + +var $Function = GetIntrinsic('%Function%'); +var $apply = $Function.apply; +var $call = $Function.call; + +module.exports = function callBind() { + return bind.apply($call, arguments); +}; + +module.exports.apply = function applyBind() { + return bind.apply($apply, arguments); +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/every.js": +/*!*************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/every.js ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/forEach.js": +/*!***************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/forEach.js ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isFinite.js": +/*!****************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/isFinite.js ***! + \****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isNaN.js": +/*!*************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/isNaN.js ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isPrimitive.js": +/*!*******************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/isPrimitive.js ***! + \*******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isPropertyDescriptor.js": +/*!****************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/isPropertyDescriptor.js ***! + \****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.entries/node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js": +/*!********************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js ***! + \********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var every = __webpack_require__(/*! ./every */ "../../node_modules/object.entries/node_modules/es-abstract/helpers/every.js"); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/mod.js": +/*!***********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/mod.js ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return Math.floor(remain >= 0 ? remain : remain + modulo); +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-abstract/helpers/sign.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-abstract/helpers/sign.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-to-primitive/es2015.js": +/*!**********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-to-primitive/es2015.js ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.entries/node_modules/es-to-primitive/helpers/isPrimitive.js"); +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var isDate = __webpack_require__(/*! is-date-object */ "../../node_modules/is-date-object/index.js"); +var isSymbol = __webpack_require__(/*! is-symbol */ "../../node_modules/is-symbol/index.js"); + +var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { + if (typeof O === 'undefined' || O === null) { + throw new TypeError('Cannot call method on ' + O); + } + if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { + throw new TypeError('hint must be "string" or "number"'); + } + var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var method, result, i; + for (i = 0; i < methodNames.length; ++i) { + method = O[methodNames[i]]; + if (isCallable(method)) { + result = method.call(O); + if (isPrimitive(result)) { + return result; + } + } + } + throw new TypeError('No default value'); +}; + +var GetMethod = function GetMethod(O, P) { + var func = O[P]; + if (func !== null && typeof func !== 'undefined') { + if (!isCallable(func)) { + throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); + } + return func; + } + return void 0; +}; + +// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + var hint = 'default'; + if (arguments.length > 1) { + if (arguments[1] === String) { + hint = 'string'; + } else if (arguments[1] === Number) { + hint = 'number'; + } + } + + var exoticToPrim; + if (hasSymbols) { + if (Symbol.toPrimitive) { + exoticToPrim = GetMethod(input, Symbol.toPrimitive); + } else if (isSymbol(input)) { + exoticToPrim = Symbol.prototype.valueOf; + } + } + if (typeof exoticToPrim !== 'undefined') { + var result = exoticToPrim.call(input, hint); + if (isPrimitive(result)) { + return result; + } + throw new TypeError('unable to convert exotic object to primitive'); + } + if (hint === 'default' && (isDate(input) || isSymbol(input))) { + hint = 'string'; + } + return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-to-primitive/es5.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-to-primitive/es5.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.entries/node_modules/es-to-primitive/helpers/isPrimitive.js"); + +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); + +// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 +var ES5internalSlots = { + '[[DefaultValue]]': function (O) { + var actualHint; + if (arguments.length > 1) { + actualHint = arguments[1]; + } else { + actualHint = toStr.call(O) === '[object Date]' ? String : Number; + } + + if (actualHint === String || actualHint === Number) { + var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var value, i; + for (i = 0; i < methods.length; ++i) { + if (isCallable(O[methods[i]])) { + value = O[methods[i]](); + if (isPrimitive(value)) { + return value; + } + } + } + throw new TypeError('No default value'); + } + throw new TypeError('invalid [[DefaultValue]] hint supplied'); + } +}; + +// http://ecma-international.org/ecma-262/5.1/#sec-9.1 +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + if (arguments.length > 1) { + return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]); + } + return ES5internalSlots['[[DefaultValue]]'](input); +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-to-primitive/es6.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-to-primitive/es6.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2015 */ "../../node_modules/object.entries/node_modules/es-to-primitive/es2015.js"); + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/es-to-primitive/helpers/isPrimitive.js": +/*!***********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/es-to-primitive/helpers/isPrimitive.js ***! + \***********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/node_modules/object-inspect/index.js": +/*!********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/node_modules/object-inspect/index.js ***! + \********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; + +var inspectCustom = __webpack_require__(/*! ./util.inspect */ 3).custom; +var inspectSymbol = (inspectCustom && isSymbol(inspectCustom)) ? inspectCustom : null; + +module.exports = function inspect_ (obj, opts, depth, seen) { + if (!opts) opts = {}; + + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + return String(obj); + } + if (typeof obj === 'bigint') { + return String(obj) + 'n'; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') depth = 0; + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return '[Object]'; + } + + if (typeof seen === 'undefined') seen = []; + else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect (value, from) { + if (from) { + seen = seen.slice(); + seen.push(from); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function') { + var name = nameOf(obj); + return '[Function' + (name ? ': ' + name : '') + ']'; + } + if (isSymbol(obj)) { + var symString = Symbol.prototype.toString.call(obj); + return typeof obj === 'object' ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + String(obj.nodeName).toLowerCase(); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) s += '...'; + s += '</' + String(obj.nodeName).toLowerCase() + '>'; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) return '[]'; + return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (parts.length === 0) return '[' + String(obj) + ']'; + return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; + } + if (typeof obj === 'object') { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { + return obj[inspectSymbol](); + } else if (typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var parts = []; + mapForEach.call(obj, function (value, key) { + parts.push(inspect(key, obj) + ' => ' + inspect(value, obj)); + }); + return collectionOf('Map', mapSize.call(obj), parts); + } + if (isSet(obj)) { + var parts = []; + setForEach.call(obj, function (value ) { + parts.push(inspect(value, obj)); + }); + return collectionOf('Set', setSize.call(obj), parts); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + if (!isDate(obj) && !isRegExp(obj)) { + var xs = arrObjKeys(obj, inspect); + if (xs.length === 0) return '{}'; + return '{ ' + xs.join(', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes (s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; +} + +function quote (s) { + return String(s).replace(/"/g, '"'); +} + +function isArray (obj) { return toStr(obj) === '[object Array]'; } +function isDate (obj) { return toStr(obj) === '[object Date]'; } +function isRegExp (obj) { return toStr(obj) === '[object RegExp]'; } +function isError (obj) { return toStr(obj) === '[object Error]'; } +function isSymbol (obj) { return toStr(obj) === '[object Symbol]'; } +function isString (obj) { return toStr(obj) === '[object String]'; } +function isNumber (obj) { return toStr(obj) === '[object Number]'; } +function isBigInt (obj) { return toStr(obj) === '[object BigInt]'; } +function isBoolean (obj) { return toStr(obj) === '[object Boolean]'; } + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has (obj, key) { + return hasOwn.call(obj, key); +} + +function toStr (obj) { + return objectToString.call(obj); +} + +function nameOf (f) { + if (f.name) return f.name; + var m = String(f).match(/^function\s*([\w$]+)/); + if (m) return m[1]; +} + +function indexOf (xs, x) { + if (xs.indexOf) return xs.indexOf(x); + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} + +function isMap (x) { + if (!mapSize) { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isSet (x) { + if (!setSize) { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement (x) { + if (!x || typeof x !== 'object') return false; + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' + && typeof x.getAttribute === 'function' + ; +} + +function inspectString (str, opts) { + var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte (c) { + var n = c.charCodeAt(0); + var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n]; + if (x) return '\\' + x; + return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); +} + +function markBoxed (str) { + return 'Object(' + str + ')'; +} + +function collectionOf (type, size, entries) { + return type + ' (' + size + ') {' + entries.join(', ') + '}'; +} + +function arrObjKeys (obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + for (var key in obj) { + if (!has(obj, key)) continue; + if (isArr && String(Number(key)) === key && key < obj.length) continue; + if (/[^\w$]/.test(key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + return xs; +} + + +/***/ }), + +/***/ "../../node_modules/object.entries/polyfill.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/polyfill.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/object.entries/implementation.js"); + +module.exports = function getPolyfill() { + return typeof Object.entries === 'function' ? Object.entries : implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/object.entries/shim.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.entries/shim.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/object.entries/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function shimEntries() { + var polyfill = getPolyfill(); + define(Object, { entries: polyfill }, { + entries: function testEntries() { + return Object.entries !== polyfill; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/implementation.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/implementation.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES = __webpack_require__(/*! es-abstract/es7 */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es7.js"); + +var defineProperty = Object.defineProperty; +var getDescriptor = Object.getOwnPropertyDescriptor; +var getOwnNames = Object.getOwnPropertyNames; +var getSymbols = Object.getOwnPropertySymbols; +var concat = Function.call.bind(Array.prototype.concat); +var reduce = Function.call.bind(Array.prototype.reduce); +var getAll = getSymbols ? function (obj) { + return concat(getOwnNames(obj), getSymbols(obj)); +} : getOwnNames; + +var isES5 = ES.IsCallable(getDescriptor) && ES.IsCallable(getOwnNames); + +var safePut = function put(obj, prop, val) { // eslint-disable-line max-params + if (defineProperty && prop in obj) { + defineProperty(obj, prop, { + configurable: true, + enumerable: true, + value: val, + writable: true + }); + } else { + obj[prop] = val; + } +}; + +module.exports = function getOwnPropertyDescriptors(value) { + ES.RequireObjectCoercible(value); + if (!isES5) { + throw new TypeError('getOwnPropertyDescriptors requires Object.getOwnPropertyDescriptor'); + } + + var O = ES.ToObject(value); + return reduce(getAll(O), function (acc, key) { + var descriptor = getDescriptor(O, key); + if (typeof descriptor !== 'undefined') { + safePut(acc, key, descriptor); + } + return acc; + }, {}); +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js": +/*!******************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js ***! + \******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; // eslint-disable-line no-shadow-restricted-names + +var ThrowTypeError = Object.getOwnPropertyDescriptor + ? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }()) + : function () { throw new TypeError(); }; + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '$ %Array%': Array, + '$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '$ %ArrayPrototype%': Array.prototype, + '$ %ArrayProto_entries%': Array.prototype.entries, + '$ %ArrayProto_forEach%': Array.prototype.forEach, + '$ %ArrayProto_keys%': Array.prototype.keys, + '$ %ArrayProto_values%': Array.prototype.values, + '$ %AsyncFromSyncIteratorPrototype%': undefined, + '$ %AsyncFunction%': asyncFunction, + '$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '$ %AsyncGeneratorFunction%': asyncGenFunction, + '$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '$ %Boolean%': Boolean, + '$ %BooleanPrototype%': Boolean.prototype, + '$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '$ %Date%': Date, + '$ %DatePrototype%': Date.prototype, + '$ %decodeURI%': decodeURI, + '$ %decodeURIComponent%': decodeURIComponent, + '$ %encodeURI%': encodeURI, + '$ %encodeURIComponent%': encodeURIComponent, + '$ %Error%': Error, + '$ %ErrorPrototype%': Error.prototype, + '$ %eval%': eval, // eslint-disable-line no-eval + '$ %EvalError%': EvalError, + '$ %EvalErrorPrototype%': EvalError.prototype, + '$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '$ %Function%': Function, + '$ %FunctionPrototype%': Function.prototype, + '$ %Generator%': generator ? getProto(generator()) : undefined, + '$ %GeneratorFunction%': generatorFunction, + '$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '$ %isFinite%': isFinite, + '$ %isNaN%': isNaN, + '$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '$ %JSON%': JSON, + '$ %JSONParse%': JSON.parse, + '$ %Map%': typeof Map === 'undefined' ? undefined : Map, + '$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '$ %Math%': Math, + '$ %Number%': Number, + '$ %NumberPrototype%': Number.prototype, + '$ %Object%': Object, + '$ %ObjectPrototype%': Object.prototype, + '$ %ObjProto_toString%': Object.prototype.toString, + '$ %ObjProto_valueOf%': Object.prototype.valueOf, + '$ %parseFloat%': parseFloat, + '$ %parseInt%': parseInt, + '$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '$ %RangeError%': RangeError, + '$ %RangeErrorPrototype%': RangeError.prototype, + '$ %ReferenceError%': ReferenceError, + '$ %ReferenceErrorPrototype%': ReferenceError.prototype, + '$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '$ %RegExp%': RegExp, + '$ %RegExpPrototype%': RegExp.prototype, + '$ %Set%': typeof Set === 'undefined' ? undefined : Set, + '$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '$ %String%': String, + '$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '$ %StringPrototype%': String.prototype, + '$ %Symbol%': hasSymbols ? Symbol : undefined, + '$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '$ %SyntaxError%': SyntaxError, + '$ %SyntaxErrorPrototype%': SyntaxError.prototype, + '$ %ThrowTypeError%': ThrowTypeError, + '$ %TypedArray%': TypedArray, + '$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '$ %TypeError%': TypeError, + '$ %TypeErrorPrototype%': TypeError.prototype, + '$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '$ %URIError%': URIError, + '$ %URIErrorPrototype%': URIError.prototype, + '$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var key = '$ ' + name; + if (!(key in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) { + throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + return INTRINSICS[key]; +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es2015.js": +/*!************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es2015.js ***! + \************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es6 */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es6.js"); +var keys = __webpack_require__(/*! object-keys */ "../../node_modules/object-keys/index.js"); +var inspect = __webpack_require__(/*! object-inspect */ "../../node_modules/object.getownpropertydescriptors/node_modules/object-inspect/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $Array = GetIntrinsic('%Array%'); +var $ArrayPrototype = $Array.prototype; +var $String = GetIntrinsic('%String%'); +var $Object = GetIntrinsic('%Object%'); +var $Number = GetIntrinsic('%Number%'); +var $Symbol = GetIntrinsic('%Symbol%', true); +var $RegExp = GetIntrinsic('%RegExp%'); +var $Promise = GetIntrinsic('%Promise%', true); +var $preventExtensions = $Object.preventExtensions; + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/assertRecord.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isFinite.js"); +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; +var MAX_SAFE_INTEGER = $Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/assign.js"); +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/mod.js"); +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isPrimitive.js"); +var forEach = __webpack_require__(/*! ./helpers/forEach */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/forEach.js"); +var every = __webpack_require__(/*! ./helpers/every */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/every.js"); +var isSamePropertyDescriptor = __webpack_require__(/*! ./helpers/isSamePropertyDescriptor */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var parseInteger = parseInt; +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/callBind.js"); +var $PromiseThen = $Promise ? callBind(GetIntrinsic('%PromiseProto_then%')) : null; +var arraySlice = callBind($Array.prototype.slice); +var strSlice = callBind($String.prototype.slice); +var isBinary = callBind($RegExp.prototype.test, /^0b[01]+$/i); +var isOctal = callBind($RegExp.prototype.test, /^0o[0-7]+$/i); +var isDigit = callBind($RegExp.prototype.test, /^[0-9]$/); +var regexExec = callBind($RegExp.prototype.exec); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = callBind($RegExp.prototype.test, nonWSregex); +var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i; +var isInvalidHexLiteral = callBind($RegExp.prototype.test, invalidHexLiteral); +var $charCodeAt = callBind($String.prototype.charCodeAt); +var $isEnumerable = callBind($Object.prototype.propertyIsEnumerable); + +var toStr = callBind($Object.prototype.toString); + +var $NumberValueOf = callBind(GetIntrinsic('%NumberPrototype%').valueOf); +var $BooleanValueOf = callBind(GetIntrinsic('%BooleanPrototype%').valueOf); +var $StringValueOf = callBind(GetIntrinsic('%StringPrototype%').valueOf); +var $DateValueOf = callBind(GetIntrinsic('%DatePrototype%').valueOf); +var $SymbolToString = hasSymbols && callBind(GetIntrinsic('%SymbolPrototype%').toString); + +var $floor = Math.floor; +var $abs = Math.abs; + +var $ObjectCreate = $Object.create; +var $gOPD = $Object.getOwnPropertyDescriptor; +var $gOPN = $Object.getOwnPropertyNames; +var $gOPS = $Object.getOwnPropertySymbols; +var $isExtensible = $Object.isExtensible; +var $defineProperty = $Object.defineProperty; +var $setProto = Object.setPrototypeOf || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== Array.prototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto + return O; + } +); + +var DefineOwnProperty = function DefineOwnProperty(ES, O, P, desc) { + if (!$defineProperty) { + if (!ES.IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + O[P] = V; // will use [[Define]] + return ES.SameValue(O[P], V); + } + $defineProperty(O, P, ES.FromPropertyDescriptor(desc)); + return true; +}; + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBind($String.prototype.replace); +var trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ES5 = __webpack_require__(/*! ./es5 */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es5.js"); + +var hasRegExpMatcher = __webpack_require__(/*! is-regex */ "../../node_modules/is-regex/index.js"); + +// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations +var ES6 = assign(assign({}, ES5), { + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args + Call: function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + if (!this.IsCallable(F)) { + throw new $TypeError(inspect(F) + ' is not a function'); + } + return F.apply(V, args); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive + ToPrimitive: toPrimitive, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean + // ToBoolean: ES5.ToBoolean, + + // https://ecma-international.org/ecma-262/6.0/#sec-tonumber + ToNumber: function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : toPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = trim(value); + if (trimmed !== value) { + return this.ToNumber(trimmed); + } + } + } + return $Number(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger + // ToInteger: ES5.ToNumber, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32 + // ToInt32: ES5.ToInt32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32 + // ToUint32: ES5.ToUint32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16 + ToInt16: function ToInt16(argument) { + var int16bit = this.ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16 + // ToUint16: ES5.ToUint16, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8 + ToInt8: function ToInt8(argument) { + var int8bit = this.ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8 + ToUint8: function ToUint8(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * $floor($abs(number)); + return mod(posInt, 0x100); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp + ToUint8Clamp: function ToUint8Clamp(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring + ToString: function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject + ToObject: function ToObject(value) { + this.RequireObjectCoercible(value); + return $Object(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + ToPropertyKey: function ToPropertyKey(argument) { + var key = this.ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : this.ToString(key); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + ToLength: function ToLength(argument) { + var len = this.ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) { + if (toStr(argument) !== '[object String]') { + throw new $TypeError('must be a string'); + } + if (argument === '-0') { return -0; } + var n = this.ToNumber(argument); + if (this.SameValue(this.ToString(n), argument)) { return n; } + return void 0; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible + RequireObjectCoercible: ES5.CheckObjectCoercible, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + IsArray: $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable + // IsCallable: ES5.IsCallable, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + IsConstructor: function IsConstructor(argument) { + return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument` + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o + IsExtensible: $preventExtensions + ? function IsExtensible(obj) { + if (isPrimitive(obj)) { + return false; + } + return $isExtensible(obj); + } + : function isExtensible(obj) { return true; }, // eslint-disable-line no-unused-vars + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger + IsInteger: function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey + IsPropertyKey: function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isregexp + IsRegExp: function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if (hasSymbols) { + var isRegExp = argument[$Symbol.match]; + if (typeof isRegExp !== 'undefined') { + return ES5.ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue + // SameValue: ES5.SameValue, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero + SameValueZero: function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); + }, + + /** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + GetV: function GetV(V, P) { + // 7.3.2.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = this.ToObject(V); + + // 7.3.2.4 + return O[P]; + }, + + /** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + GetMethod: function GetMethod(O, P) { + // 7.3.9.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = this.GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!this.IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; + }, + + /** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + Get: function Get(O, P) { + // 7.3.1.1 + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; + }, + + Type: function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5.Type(x); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (this.Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (this.IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) { + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + Set: function Set(O, P, V, Throw) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + if (this.Type(Throw) !== 'Boolean') { + throw new $TypeError('Throw must be a Boolean'); + } + if (Throw) { + O[P] = V; + return true; + } else { + try { + O[P] = V; + } catch (e) { + return false; + } + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + HasOwnProperty: function HasOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return has(O, P); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + HasProperty: function HasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return P in O; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + IsConcatSpreadable: function IsConcatSpreadable(O) { + if (this.Type(O) !== 'Object') { + return false; + } + if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') { + var spreadable = this.Get(O, Symbol.isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return this.ToBoolean(spreadable); + } + } + return this.IsArray(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-invoke + Invoke: function Invoke(O, P) { + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = arraySlice(arguments, 2); + var func = this.GetV(O, P); + return this.Call(func, O, argumentsList); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-getiterator + GetIterator: function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + if (!hasSymbols) { + throw new SyntaxError('GetIterator depends on native Symbol support when `method` is not passed'); + } + actualMethod = this.GetMethod(obj, $Symbol.iterator); + } + var iterator = this.Call(actualMethod, obj); + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + IteratorNext: function IteratorNext(iterator, value) { + var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (this.Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + IteratorComplete: function IteratorComplete(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.ToBoolean(this.Get(iterResult, 'done')); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + IteratorValue: function IteratorValue(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.Get(iterResult, 'value'); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + IteratorStep: function IteratorStep(iterator) { + var result = this.IteratorNext(iterator); + var done = this.IteratorComplete(result); + return done === true ? false : result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + IteratorClose: function IteratorClose(iterator, completion) { + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!this.IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = this.GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = this.Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionRecord = completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (this.Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + CreateIterResultObject: function CreateIterResultObject(value, done) { + if (this.Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + RegExpExec: function RegExpExec(R, S) { + if (this.Type(R) !== 'Object') { + throw new $TypeError('R must be an Object'); + } + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + var exec = this.Get(R, 'exec'); + if (this.IsCallable(exec)) { + var result = this.Call(exec, R, [S]); + if (result === null || this.Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = this.IsArray(originalArray); + if (isArray) { + C = this.Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (this.IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) { + C = this.Get(C, $Symbol.species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!this.IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // this.Construct(C, len); + }, + + CreateDataProperty: function CreateDataProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = $gOPD(O, P); + var extensible = oldDesc || this.IsExtensible(O); + var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty(this, O, P, { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + }); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = this.CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + ObjectCreate: function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && this.Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: proto must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if (proto === null && !$ObjectCreate) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + + return $ObjectCreate(proto); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) { + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53'); + } + if (this.Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: unicode must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + CreateMethodProperty: function CreateMethodProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty(this, O, P, newDesc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + DefinePropertyOrThrow: function DefinePropertyOrThrow(O, P, desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor(this, desc) ? desc : this.ToPropertyDescriptor(desc); + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty(this, O, P, Desc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + DeletePropertyOrThrow: function DeletePropertyOrThrow(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var success = delete O[P]; + if (!success) { + throw new TypeError('Attempt to delete property failed.'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + EnumerableOwnNames: function EnumerableOwnNames(O) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + thisNumberValue: function thisNumberValue(value) { + if (this.Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + thisBooleanValue: function thisBooleanValue(value) { + if (this.Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + thisStringValue: function thisStringValue(value) { + if (this.Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + thisTimeValue: function thisTimeValue(value) { + return $DateValueOf(value); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + SetIntegrityLevel: function SetIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + var ES = this; + if (level === 'sealed') { + forEach(theKeys, function (k) { + ES.DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (ES.IsAccessorDescriptor(ES.ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + ES.DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + TestIntegrityLevel: function TestIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = this.IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + var ES = this; + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && ES.IsDataDescriptor(ES.ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + OrdinaryHasInstance: function OrdinaryHasInstance(C, O) { + if (this.IsCallable(C) === false) { + return false; + } + if (this.Type(O) !== 'Object') { + return false; + } + var P = this.Get(C, 'prototype'); + if (this.Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + OrdinaryHasProperty: function OrdinaryHasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + InstanceofOperator: function InstanceofOperator(O, C) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = hasSymbols && $Symbol.hasInstance ? this.GetMethod(C, $Symbol.hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return this.ToBoolean(this.Call(instOfHandler, C, [O])); + } + if (!this.IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return this.OrdinaryHasInstance(C, O); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + IsPromise: function IsPromise(x) { + if (this.Type(x) !== 'Object') { + return false; + } + if (!$Promise) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // eslint-disable-next-line max-lines-per-function, max-statements, id-length, max-params + ValidateAndApplyPropertyDescriptor: function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = this.Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (this.Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (this.Type(current) !== 'Undefined' && !isPropertyDescriptor(this, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (this.Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + }); + } + } else { + if (!this.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + } + return true; + } + if (this.IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor(this, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (this.IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (this.IsDataDescriptor(current) !== this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (this.IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + }); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + }); + } + } else if (this.IsDataDescriptor(current) && this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !this.SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (this.IsAccessorDescriptor(current) && this.IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !this.SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !this.SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + OrdinaryDefineOwnProperty: function OrdinaryDefineOwnProperty(O, P, Desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + var desc = $gOPD(O, P); + var current = desc && this.ToPropertyDescriptor(desc); + var extensible = this.IsExtensible(O); + return this.ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + OrdinaryGetOwnProperty: function OrdinaryGetOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 fallback + var arrayLength = this.IsArray(O) && P === 'length'; + var regexLastIndex = this.IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return this.ToPropertyDescriptor($gOPD(O, P)); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + ArrayCreate: function ArrayCreate(length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + this.OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; + }, + + // eslint-disable-next-line max-statements, max-lines-per-function + ArraySetLength: function ArraySetLength(A, Desc) { + if (!this.IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return this.OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = this.ToUint32(Desc['[[Value]]']); + var numberLen = this.ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = this.OrdinaryGetOwnProperty(A, 'length'); + if (!this.IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + var deleteSucceeded = delete A[this.ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return this.OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + CreateHTML: function CreateHTML(string, tag, attribute, value) { + if (this.Type(tag) !== 'String' || this.Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = this.RequireObjectCoercible(string); + var S = this.ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = this.ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + '</' + tag + '>'; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + GetOwnPropertyKeys: function GetOwnPropertyKeys(O, Type) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return hasSymbols && $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + SymbolDescriptiveString: function SymbolDescriptiveString(sym) { + if (this.Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + // eslint-disable-next-line max-statements, max-params, max-lines-per-function + GetSubstitution: function GetSubstitution(matched, str, position, captures, replacement) { + if (this.Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (this.Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!this.IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + var ES = this; + var isStringOrHole = function (capture, index, arr) { return ES.Type(capture) === 'String' || !(index in arr); }; + if (!this.IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (this.Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = replacement[i]; + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = replacement[i + 1]; + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : replacement[i + 2]; + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = parseInteger(next, 10); + // if (n > m, impl-defined) + result += (n <= m && this.Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = parseInteger(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && this.Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += replacement[i]; + } + } + return result; + } +}); + +delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible + +module.exports = ES6; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es2016.js": +/*!************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es2016.js ***! + \************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js"); + +var $Array = GetIntrinsic('%Array%'); + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var ES2015 = __webpack_require__(/*! ./es2015 */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es2015.js"); +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/assign.js"); +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/callBind.js"); + +var $arrayPush = callBind($Array.prototype.push); +var $arraySlice = callBind($Array.prototype.slice); +var $arrayJoin = callBind($Array.prototype.join); + +var ES2016 = assign(assign({}, ES2015), { + // https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + SameValueNonNumber: function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return this.SameValue(x, y); + }, + + // https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike + IterableToArrayLike: function IterableToArrayLike(items) { + var usingIterator; + if (hasSymbols) { + usingIterator = this.GetMethod(items, Symbol.iterator); + } else if (this.IsArray(items)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (this.Type(items) === 'String') { + var ES = this; + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(items, i, true); + var value = $arrayJoin($arraySlice(items, i, nextIndex), ''); + i = nextIndex; + return { + done: nextIndex > items.length, + value: value + }; + } + }; + }; + } + if (typeof usingIterator !== 'undefined') { + var iterator = this.GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = this.IteratorStep(iterator); + if (next) { + var nextValue = this.IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return this.ToObject(items); + } +}); + +module.exports = ES2016; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es5.js": +/*!*********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es5.js ***! + \*********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js"); + +var $Object = GetIntrinsic('%Object%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $String = GetIntrinsic('%String%'); +var $Number = GetIntrinsic('%Number%'); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/assertRecord.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isFinite.js"); + +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/mod.js"); + +var IsCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es5 */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es5.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/callBind.js"); +var strSlice = callBind($String.prototype.slice); + +var isPrefixOf = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return strSlice(string, 0, prefix.length) === prefix; +}; + +// https://es5.github.io/#x9 +var ES5 = { + ToPrimitive: toPrimitive, + + ToBoolean: function ToBoolean(value) { + return !!value; + }, + ToNumber: function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion + }, + ToInteger: function ToInteger(value) { + var number = this.ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return sign(number) * Math.floor(Math.abs(number)); + }, + ToInt32: function ToInt32(x) { + return this.ToNumber(x) >> 0; + }, + ToUint32: function ToUint32(x) { + return this.ToNumber(x) >>> 0; + }, + ToUint16: function ToUint16(value) { + var number = this.ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * Math.floor(Math.abs(number)); + return mod(posInt, 0x10000); + }, + ToString: function ToString(value) { + return $String(value); + }, + ToObject: function ToObject(value) { + this.CheckObjectCoercible(value); + return $Object(value); + }, + CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { + /* jshint eqnull:true */ + if (value == null) { + throw new $TypeError(optMessage || 'Cannot call method on ' + value); + } + return value; + }, + IsCallable: IsCallable, + SameValue: function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-8 + Type: function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + IsPropertyDescriptor: function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor(this, Desc); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + IsAccessorDescriptor: function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + IsDataDescriptor: function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + IsGenericDescriptor: function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) { + return true; + } + + return false; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (this.IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + ToPropertyDescriptor: function ToPropertyDescriptor(Obj) { + if (this.Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = this.ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !this.IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !this.IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + 'Strict Equality Comparison': function StrictEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + // eslint-disable-next-line max-statements + 'Abstract Relational Comparison': function AbstractRelationalComparison(x, y, LeftFirst) { + if (this.Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = this.ToPrimitive(x, $Number); + py = this.ToPrimitive(y, $Number); + } else { + py = this.ToPrimitive(y, $Number); + px = this.ToPrimitive(x, $Number); + } + var bothStrings = this.Type(px) === 'String' && this.Type(py) === 'String'; + if (!bothStrings) { + var nx = this.ToNumber(px); + var ny = this.ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f + } +}; + +module.exports = ES5; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es7.js": +/*!*********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es7.js ***! + \*********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2016 */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/es2016.js"); + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/assertRecord.js": +/*!**************************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/assertRecord.js ***! + \**************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(ES, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(ES, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/assign.js": +/*!********************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/assign.js ***! + \********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + target[key] = source[key]; + } + } + return target; +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/callBind.js": +/*!**********************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/callBind.js ***! + \**********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js"); + +var $Function = GetIntrinsic('%Function%'); +var $apply = $Function.apply; +var $call = $Function.call; + +module.exports = function callBind() { + return bind.apply($call, arguments); +}; + +module.exports.apply = function applyBind() { + return bind.apply($apply, arguments); +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/every.js": +/*!*******************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/every.js ***! + \*******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/forEach.js": +/*!*********************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/forEach.js ***! + \*********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isFinite.js": +/*!**********************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isFinite.js ***! + \**********************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isNaN.js": +/*!*******************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isNaN.js ***! + \*******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isPrimitive.js": +/*!*************************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isPrimitive.js ***! + \*************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isPropertyDescriptor.js": +/*!**********************************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isPropertyDescriptor.js ***! + \**********************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js": +/*!**************************************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js ***! + \**************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var every = __webpack_require__(/*! ./every */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/every.js"); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/mod.js": +/*!*****************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/mod.js ***! + \*****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return Math.floor(remain >= 0 ? remain : remain + modulo); +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/sign.js": +/*!******************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-abstract/helpers/sign.js ***! + \******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es2015.js": +/*!****************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es2015.js ***! + \****************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/helpers/isPrimitive.js"); +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var isDate = __webpack_require__(/*! is-date-object */ "../../node_modules/is-date-object/index.js"); +var isSymbol = __webpack_require__(/*! is-symbol */ "../../node_modules/is-symbol/index.js"); + +var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { + if (typeof O === 'undefined' || O === null) { + throw new TypeError('Cannot call method on ' + O); + } + if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { + throw new TypeError('hint must be "string" or "number"'); + } + var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var method, result, i; + for (i = 0; i < methodNames.length; ++i) { + method = O[methodNames[i]]; + if (isCallable(method)) { + result = method.call(O); + if (isPrimitive(result)) { + return result; + } + } + } + throw new TypeError('No default value'); +}; + +var GetMethod = function GetMethod(O, P) { + var func = O[P]; + if (func !== null && typeof func !== 'undefined') { + if (!isCallable(func)) { + throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); + } + return func; + } + return void 0; +}; + +// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + var hint = 'default'; + if (arguments.length > 1) { + if (arguments[1] === String) { + hint = 'string'; + } else if (arguments[1] === Number) { + hint = 'number'; + } + } + + var exoticToPrim; + if (hasSymbols) { + if (Symbol.toPrimitive) { + exoticToPrim = GetMethod(input, Symbol.toPrimitive); + } else if (isSymbol(input)) { + exoticToPrim = Symbol.prototype.valueOf; + } + } + if (typeof exoticToPrim !== 'undefined') { + var result = exoticToPrim.call(input, hint); + if (isPrimitive(result)) { + return result; + } + throw new TypeError('unable to convert exotic object to primitive'); + } + if (hint === 'default' && (isDate(input) || isSymbol(input))) { + hint = 'string'; + } + return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es5.js": +/*!*************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es5.js ***! + \*************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/helpers/isPrimitive.js"); + +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); + +// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 +var ES5internalSlots = { + '[[DefaultValue]]': function (O) { + var actualHint; + if (arguments.length > 1) { + actualHint = arguments[1]; + } else { + actualHint = toStr.call(O) === '[object Date]' ? String : Number; + } + + if (actualHint === String || actualHint === Number) { + var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var value, i; + for (i = 0; i < methods.length; ++i) { + if (isCallable(O[methods[i]])) { + value = O[methods[i]](); + if (isPrimitive(value)) { + return value; + } + } + } + throw new TypeError('No default value'); + } + throw new TypeError('invalid [[DefaultValue]] hint supplied'); + } +}; + +// http://ecma-international.org/ecma-262/5.1/#sec-9.1 +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + if (arguments.length > 1) { + return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]); + } + return ES5internalSlots['[[DefaultValue]]'](input); +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es6.js": +/*!*************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es6.js ***! + \*************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2015 */ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/es2015.js"); + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/helpers/isPrimitive.js": +/*!*****************************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/es-to-primitive/helpers/isPrimitive.js ***! + \*****************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/node_modules/object-inspect/index.js": +/*!**************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/node_modules/object-inspect/index.js ***! + \**************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; + +var inspectCustom = __webpack_require__(/*! ./util.inspect */ 5).custom; +var inspectSymbol = (inspectCustom && isSymbol(inspectCustom)) ? inspectCustom : null; + +module.exports = function inspect_ (obj, opts, depth, seen) { + if (!opts) opts = {}; + + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + return String(obj); + } + if (typeof obj === 'bigint') { + return String(obj) + 'n'; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') depth = 0; + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return '[Object]'; + } + + if (typeof seen === 'undefined') seen = []; + else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect (value, from) { + if (from) { + seen = seen.slice(); + seen.push(from); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function') { + var name = nameOf(obj); + return '[Function' + (name ? ': ' + name : '') + ']'; + } + if (isSymbol(obj)) { + var symString = Symbol.prototype.toString.call(obj); + return typeof obj === 'object' ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + String(obj.nodeName).toLowerCase(); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) s += '...'; + s += '</' + String(obj.nodeName).toLowerCase() + '>'; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) return '[]'; + return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (parts.length === 0) return '[' + String(obj) + ']'; + return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; + } + if (typeof obj === 'object') { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { + return obj[inspectSymbol](); + } else if (typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var parts = []; + mapForEach.call(obj, function (value, key) { + parts.push(inspect(key, obj) + ' => ' + inspect(value, obj)); + }); + return collectionOf('Map', mapSize.call(obj), parts); + } + if (isSet(obj)) { + var parts = []; + setForEach.call(obj, function (value ) { + parts.push(inspect(value, obj)); + }); + return collectionOf('Set', setSize.call(obj), parts); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + if (!isDate(obj) && !isRegExp(obj)) { + var xs = arrObjKeys(obj, inspect); + if (xs.length === 0) return '{}'; + return '{ ' + xs.join(', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes (s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; +} + +function quote (s) { + return String(s).replace(/"/g, '"'); +} + +function isArray (obj) { return toStr(obj) === '[object Array]'; } +function isDate (obj) { return toStr(obj) === '[object Date]'; } +function isRegExp (obj) { return toStr(obj) === '[object RegExp]'; } +function isError (obj) { return toStr(obj) === '[object Error]'; } +function isSymbol (obj) { return toStr(obj) === '[object Symbol]'; } +function isString (obj) { return toStr(obj) === '[object String]'; } +function isNumber (obj) { return toStr(obj) === '[object Number]'; } +function isBigInt (obj) { return toStr(obj) === '[object BigInt]'; } +function isBoolean (obj) { return toStr(obj) === '[object Boolean]'; } + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has (obj, key) { + return hasOwn.call(obj, key); +} + +function toStr (obj) { + return objectToString.call(obj); +} + +function nameOf (f) { + if (f.name) return f.name; + var m = String(f).match(/^function\s*([\w$]+)/); + if (m) return m[1]; +} + +function indexOf (xs, x) { + if (xs.indexOf) return xs.indexOf(x); + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} + +function isMap (x) { + if (!mapSize) { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isSet (x) { + if (!setSize) { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement (x) { + if (!x || typeof x !== 'object') return false; + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' + && typeof x.getAttribute === 'function' + ; +} + +function inspectString (str, opts) { + var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte (c) { + var n = c.charCodeAt(0); + var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n]; + if (x) return '\\' + x; + return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); +} + +function markBoxed (str) { + return 'Object(' + str + ')'; +} + +function collectionOf (type, size, entries) { + return type + ' (' + size + ') {' + entries.join(', ') + '}'; +} + +function arrObjKeys (obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + for (var key in obj) { + if (!has(obj, key)) continue; + if (isArr && String(Number(key)) === key && key < obj.length) continue; + if (/[^\w$]/.test(key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + return xs; +} + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/polyfill.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/polyfill.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/object.getownpropertydescriptors/implementation.js"); + +module.exports = function getPolyfill() { + return typeof Object.getOwnPropertyDescriptors === 'function' ? Object.getOwnPropertyDescriptors : implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/object.getownpropertydescriptors/shim.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.getownpropertydescriptors/shim.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/object.getownpropertydescriptors/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function shimGetOwnPropertyDescriptors() { + var polyfill = getPolyfill(); + define( + Object, + { getOwnPropertyDescriptors: polyfill }, + { getOwnPropertyDescriptors: function () { return Object.getOwnPropertyDescriptors !== polyfill; } } + ); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/implementation.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/implementation.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var ES = __webpack_require__(/*! es-abstract/es7 */ "../../node_modules/object.values/node_modules/es-abstract/es7.js"); +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); + +module.exports = function values(O) { + var obj = ES.RequireObjectCoercible(O); + var vals = []; + for (var key in obj) { + if (has(obj, key) && isEnumerable(obj, key)) { + vals.push(obj[key]); + } + } + return vals; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js": +/*!***********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* globals + Atomics, + SharedArrayBuffer, +*/ + +var undefined; // eslint-disable-line no-shadow-restricted-names + +var ThrowTypeError = Object.getOwnPropertyDescriptor + ? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }()) + : function () { throw new TypeError(); }; + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto + +var generator; // = function * () {}; +var generatorFunction = generator ? getProto(generator) : undefined; +var asyncFn; // async function() {}; +var asyncFunction = asyncFn ? asyncFn.constructor : undefined; +var asyncGen; // async function * () {}; +var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; +var asyncGenIterator = asyncGen ? asyncGen() : undefined; + +var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); + +var INTRINSICS = { + '$ %Array%': Array, + '$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, + '$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, + '$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, + '$ %ArrayPrototype%': Array.prototype, + '$ %ArrayProto_entries%': Array.prototype.entries, + '$ %ArrayProto_forEach%': Array.prototype.forEach, + '$ %ArrayProto_keys%': Array.prototype.keys, + '$ %ArrayProto_values%': Array.prototype.values, + '$ %AsyncFromSyncIteratorPrototype%': undefined, + '$ %AsyncFunction%': asyncFunction, + '$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, + '$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, + '$ %AsyncGeneratorFunction%': asyncGenFunction, + '$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, + '$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, + '$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, + '$ %Boolean%': Boolean, + '$ %BooleanPrototype%': Boolean.prototype, + '$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView, + '$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, + '$ %Date%': Date, + '$ %DatePrototype%': Date.prototype, + '$ %decodeURI%': decodeURI, + '$ %decodeURIComponent%': decodeURIComponent, + '$ %encodeURI%': encodeURI, + '$ %encodeURIComponent%': encodeURIComponent, + '$ %Error%': Error, + '$ %ErrorPrototype%': Error.prototype, + '$ %eval%': eval, // eslint-disable-line no-eval + '$ %EvalError%': EvalError, + '$ %EvalErrorPrototype%': EvalError.prototype, + '$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, + '$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, + '$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, + '$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, + '$ %Function%': Function, + '$ %FunctionPrototype%': Function.prototype, + '$ %Generator%': generator ? getProto(generator()) : undefined, + '$ %GeneratorFunction%': generatorFunction, + '$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, + '$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, + '$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, + '$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, + '$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, + '$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, + '$ %isFinite%': isFinite, + '$ %isNaN%': isNaN, + '$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, + '$ %JSON%': JSON, + '$ %JSONParse%': JSON.parse, + '$ %Map%': typeof Map === 'undefined' ? undefined : Map, + '$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), + '$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, + '$ %Math%': Math, + '$ %Number%': Number, + '$ %NumberPrototype%': Number.prototype, + '$ %Object%': Object, + '$ %ObjectPrototype%': Object.prototype, + '$ %ObjProto_toString%': Object.prototype.toString, + '$ %ObjProto_valueOf%': Object.prototype.valueOf, + '$ %parseFloat%': parseFloat, + '$ %parseInt%': parseInt, + '$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise, + '$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, + '$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, + '$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, + '$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, + '$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, + '$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, + '$ %RangeError%': RangeError, + '$ %RangeErrorPrototype%': RangeError.prototype, + '$ %ReferenceError%': ReferenceError, + '$ %ReferenceErrorPrototype%': ReferenceError.prototype, + '$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, + '$ %RegExp%': RegExp, + '$ %RegExpPrototype%': RegExp.prototype, + '$ %Set%': typeof Set === 'undefined' ? undefined : Set, + '$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), + '$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, + '$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, + '$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, + '$ %String%': String, + '$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, + '$ %StringPrototype%': String.prototype, + '$ %Symbol%': hasSymbols ? Symbol : undefined, + '$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, + '$ %SyntaxError%': SyntaxError, + '$ %SyntaxErrorPrototype%': SyntaxError.prototype, + '$ %ThrowTypeError%': ThrowTypeError, + '$ %TypedArray%': TypedArray, + '$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, + '$ %TypeError%': TypeError, + '$ %TypeErrorPrototype%': TypeError.prototype, + '$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, + '$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, + '$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, + '$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, + '$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, + '$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, + '$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, + '$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, + '$ %URIError%': URIError, + '$ %URIErrorPrototype%': URIError.prototype, + '$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, + '$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, + '$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, + '$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype +}; + +module.exports = function GetIntrinsic(name, allowMissing) { + if (arguments.length > 1 && typeof allowMissing !== 'boolean') { + throw new TypeError('"allowMissing" argument must be a boolean'); + } + + var key = '$ ' + name; + if (!(key in INTRINSICS)) { + throw new SyntaxError('intrinsic ' + name + ' does not exist!'); + } + + // istanbul ignore if // hopefully this is impossible to test :-) + if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) { + throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); + } + return INTRINSICS[key]; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/es2015.js": +/*!*****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/es2015.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es6 */ "../../node_modules/object.values/node_modules/es-to-primitive/es6.js"); +var keys = __webpack_require__(/*! object-keys */ "../../node_modules/object-keys/index.js"); +var inspect = __webpack_require__(/*! object-inspect */ "../../node_modules/object.values/node_modules/object-inspect/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $RangeError = GetIntrinsic('%RangeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); +var $Array = GetIntrinsic('%Array%'); +var $ArrayPrototype = $Array.prototype; +var $String = GetIntrinsic('%String%'); +var $Object = GetIntrinsic('%Object%'); +var $Number = GetIntrinsic('%Number%'); +var $Symbol = GetIntrinsic('%Symbol%', true); +var $RegExp = GetIntrinsic('%RegExp%'); +var $Promise = GetIntrinsic('%Promise%', true); +var $preventExtensions = $Object.preventExtensions; + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/object.values/node_modules/es-abstract/helpers/assertRecord.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/object.values/node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/object.values/node_modules/es-abstract/helpers/isFinite.js"); +var MAX_ARRAY_LENGTH = Math.pow(2, 32) - 1; +var MAX_SAFE_INTEGER = $Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1; + +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/object.values/node_modules/es-abstract/helpers/assign.js"); +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/object.values/node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/object.values/node_modules/es-abstract/helpers/mod.js"); +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.values/node_modules/es-abstract/helpers/isPrimitive.js"); +var forEach = __webpack_require__(/*! ./helpers/forEach */ "../../node_modules/object.values/node_modules/es-abstract/helpers/forEach.js"); +var every = __webpack_require__(/*! ./helpers/every */ "../../node_modules/object.values/node_modules/es-abstract/helpers/every.js"); +var isSamePropertyDescriptor = __webpack_require__(/*! ./helpers/isSamePropertyDescriptor */ "../../node_modules/object.values/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/object.values/node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var parseInteger = parseInt; +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.values/node_modules/es-abstract/helpers/callBind.js"); +var $PromiseThen = $Promise ? callBind(GetIntrinsic('%PromiseProto_then%')) : null; +var arraySlice = callBind($Array.prototype.slice); +var strSlice = callBind($String.prototype.slice); +var isBinary = callBind($RegExp.prototype.test, /^0b[01]+$/i); +var isOctal = callBind($RegExp.prototype.test, /^0o[0-7]+$/i); +var isDigit = callBind($RegExp.prototype.test, /^[0-9]$/); +var regexExec = callBind($RegExp.prototype.exec); +var nonWS = ['\u0085', '\u200b', '\ufffe'].join(''); +var nonWSregex = new $RegExp('[' + nonWS + ']', 'g'); +var hasNonWS = callBind($RegExp.prototype.test, nonWSregex); +var invalidHexLiteral = /^[-+]0x[0-9a-f]+$/i; +var isInvalidHexLiteral = callBind($RegExp.prototype.test, invalidHexLiteral); +var $charCodeAt = callBind($String.prototype.charCodeAt); +var $isEnumerable = callBind($Object.prototype.propertyIsEnumerable); + +var toStr = callBind($Object.prototype.toString); + +var $NumberValueOf = callBind(GetIntrinsic('%NumberPrototype%').valueOf); +var $BooleanValueOf = callBind(GetIntrinsic('%BooleanPrototype%').valueOf); +var $StringValueOf = callBind(GetIntrinsic('%StringPrototype%').valueOf); +var $DateValueOf = callBind(GetIntrinsic('%DatePrototype%').valueOf); +var $SymbolToString = hasSymbols && callBind(GetIntrinsic('%SymbolPrototype%').toString); + +var $floor = Math.floor; +var $abs = Math.abs; + +var $ObjectCreate = $Object.create; +var $gOPD = $Object.getOwnPropertyDescriptor; +var $gOPN = $Object.getOwnPropertyNames; +var $gOPS = $Object.getOwnPropertySymbols; +var $isExtensible = $Object.isExtensible; +var $defineProperty = $Object.defineProperty; +var $setProto = Object.setPrototypeOf || ( + // eslint-disable-next-line no-proto, no-negated-condition + [].__proto__ !== Array.prototype + ? null + : function (O, proto) { + O.__proto__ = proto; // eslint-disable-line no-proto + return O; + } +); + +var DefineOwnProperty = function DefineOwnProperty(ES, O, P, desc) { + if (!$defineProperty) { + if (!ES.IsDataDescriptor(desc)) { + // ES3 does not support getters/setters + return false; + } + if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { + return false; + } + + // fallback for ES3 + if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { + // a non-enumerable existing property + return false; + } + + // property does not exist at all, or exists but is enumerable + var V = desc['[[Value]]']; + O[P] = V; // will use [[Define]] + return ES.SameValue(O[P], V); + } + $defineProperty(O, P, ES.FromPropertyDescriptor(desc)); + return true; +}; + +// whitespace from: https://es5.github.io/#x15.5.4.20 +// implementation from https://github.com/es-shims/es5-shim/blob/v3.4.0/es5-shim.js#L1304-L1324 +var ws = [ + '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003', + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028', + '\u2029\uFEFF' +].join(''); +var trimRegex = new RegExp('(^[' + ws + ']+)|([' + ws + ']+$)', 'g'); +var $replace = callBind($String.prototype.replace); +var trim = function (value) { + return $replace(value, trimRegex, ''); +}; + +var ES5 = __webpack_require__(/*! ./es5 */ "../../node_modules/object.values/node_modules/es-abstract/es5.js"); + +var hasRegExpMatcher = __webpack_require__(/*! is-regex */ "../../node_modules/is-regex/index.js"); + +// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-abstract-operations +var ES6 = assign(assign({}, ES5), { + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-call-f-v-args + Call: function Call(F, V) { + var args = arguments.length > 2 ? arguments[2] : []; + if (!this.IsCallable(F)) { + throw new $TypeError(inspect(F) + ' is not a function'); + } + return F.apply(V, args); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toprimitive + ToPrimitive: toPrimitive, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toboolean + // ToBoolean: ES5.ToBoolean, + + // https://ecma-international.org/ecma-262/6.0/#sec-tonumber + ToNumber: function ToNumber(argument) { + var value = isPrimitive(argument) ? argument : toPrimitive(argument, $Number); + if (typeof value === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a number'); + } + if (typeof value === 'string') { + if (isBinary(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 2)); + } else if (isOctal(value)) { + return this.ToNumber(parseInteger(strSlice(value, 2), 8)); + } else if (hasNonWS(value) || isInvalidHexLiteral(value)) { + return NaN; + } else { + var trimmed = trim(value); + if (trimmed !== value) { + return this.ToNumber(trimmed); + } + } + } + return $Number(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tointeger + // ToInteger: ES5.ToNumber, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint32 + // ToInt32: ES5.ToInt32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint32 + // ToUint32: ES5.ToUint32, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint16 + ToInt16: function ToInt16(argument) { + var int16bit = this.ToUint16(argument); + return int16bit >= 0x8000 ? int16bit - 0x10000 : int16bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint16 + // ToUint16: ES5.ToUint16, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toint8 + ToInt8: function ToInt8(argument) { + var int8bit = this.ToUint8(argument); + return int8bit >= 0x80 ? int8bit - 0x100 : int8bit; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8 + ToUint8: function ToUint8(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * $floor($abs(number)); + return mod(posInt, 0x100); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-touint8clamp + ToUint8Clamp: function ToUint8Clamp(argument) { + var number = this.ToNumber(argument); + if ($isNaN(number) || number <= 0) { return 0; } + if (number >= 0xFF) { return 0xFF; } + var f = $floor(argument); + if (f + 0.5 < number) { return f + 1; } + if (number < f + 0.5) { return f; } + if (f % 2 !== 0) { return f + 1; } + return f; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring + ToString: function ToString(argument) { + if (typeof argument === 'symbol') { + throw new $TypeError('Cannot convert a Symbol value to a string'); + } + return $String(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-toobject + ToObject: function ToObject(value) { + this.RequireObjectCoercible(value); + return $Object(value); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-topropertykey + ToPropertyKey: function ToPropertyKey(argument) { + var key = this.ToPrimitive(argument, $String); + return typeof key === 'symbol' ? key : this.ToString(key); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + ToLength: function ToLength(argument) { + var len = this.ToInteger(argument); + if (len <= 0) { return 0; } // includes converting -0 to +0 + if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } + return len; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-canonicalnumericindexstring + CanonicalNumericIndexString: function CanonicalNumericIndexString(argument) { + if (toStr(argument) !== '[object String]') { + throw new $TypeError('must be a string'); + } + if (argument === '-0') { return -0; } + var n = this.ToNumber(argument); + if (this.SameValue(this.ToString(n), argument)) { return n; } + return void 0; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-requireobjectcoercible + RequireObjectCoercible: ES5.CheckObjectCoercible, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isarray + IsArray: $Array.isArray || function IsArray(argument) { + return toStr(argument) === '[object Array]'; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iscallable + // IsCallable: ES5.IsCallable, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isconstructor + IsConstructor: function IsConstructor(argument) { + return typeof argument === 'function' && !!argument.prototype; // unfortunately there's no way to truly check this without try/catch `new argument` + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isextensible-o + IsExtensible: $preventExtensions + ? function IsExtensible(obj) { + if (isPrimitive(obj)) { + return false; + } + return $isExtensible(obj); + } + : function isExtensible(obj) { return true; }, // eslint-disable-line no-unused-vars + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-isinteger + IsInteger: function IsInteger(argument) { + if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) { + return false; + } + var abs = $abs(argument); + return $floor(abs) === abs; + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ispropertykey + IsPropertyKey: function IsPropertyKey(argument) { + return typeof argument === 'string' || typeof argument === 'symbol'; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isregexp + IsRegExp: function IsRegExp(argument) { + if (!argument || typeof argument !== 'object') { + return false; + } + if (hasSymbols) { + var isRegExp = argument[$Symbol.match]; + if (typeof isRegExp !== 'undefined') { + return ES5.ToBoolean(isRegExp); + } + } + return hasRegExpMatcher(argument); + }, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevalue + // SameValue: ES5.SameValue, + + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero + SameValueZero: function SameValueZero(x, y) { + return (x === y) || ($isNaN(x) && $isNaN(y)); + }, + + /** + * 7.3.2 GetV (V, P) + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let O be ToObject(V). + * 3. ReturnIfAbrupt(O). + * 4. Return O.[[Get]](P, V). + */ + GetV: function GetV(V, P) { + // 7.3.2.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.2.2-3 + var O = this.ToObject(V); + + // 7.3.2.4 + return O[P]; + }, + + /** + * 7.3.9 - https://ecma-international.org/ecma-262/6.0/#sec-getmethod + * 1. Assert: IsPropertyKey(P) is true. + * 2. Let func be GetV(O, P). + * 3. ReturnIfAbrupt(func). + * 4. If func is either undefined or null, return undefined. + * 5. If IsCallable(func) is false, throw a TypeError exception. + * 6. Return func. + */ + GetMethod: function GetMethod(O, P) { + // 7.3.9.1 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + // 7.3.9.2 + var func = this.GetV(O, P); + + // 7.3.9.4 + if (func == null) { + return void 0; + } + + // 7.3.9.5 + if (!this.IsCallable(func)) { + throw new $TypeError(P + 'is not a function'); + } + + // 7.3.9.6 + return func; + }, + + /** + * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p + * 1. Assert: Type(O) is Object. + * 2. Assert: IsPropertyKey(P) is true. + * 3. Return O.[[Get]](P, O). + */ + Get: function Get(O, P) { + // 7.3.1.1 + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + // 7.3.1.2 + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); + } + // 7.3.1.3 + return O[P]; + }, + + Type: function Type(x) { + if (typeof x === 'symbol') { + return 'Symbol'; + } + return ES5.Type(x); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-speciesconstructor + SpeciesConstructor: function SpeciesConstructor(O, defaultConstructor) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var C = O.constructor; + if (typeof C === 'undefined') { + return defaultConstructor; + } + if (this.Type(C) !== 'Object') { + throw new $TypeError('O.constructor is not an Object'); + } + var S = hasSymbols && $Symbol.species ? C[$Symbol.species] : void 0; + if (S == null) { + return defaultConstructor; + } + if (this.IsConstructor(S)) { + return S; + } + throw new $TypeError('no constructor found'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + var obj = {}; + if ('[[Value]]' in Desc) { + obj.value = Desc['[[Value]]']; + } + if ('[[Writable]]' in Desc) { + obj.writable = Desc['[[Writable]]']; + } + if ('[[Get]]' in Desc) { + obj.get = Desc['[[Get]]']; + } + if ('[[Set]]' in Desc) { + obj.set = Desc['[[Set]]']; + } + if ('[[Enumerable]]' in Desc) { + obj.enumerable = Desc['[[Enumerable]]']; + } + if ('[[Configurable]]' in Desc) { + obj.configurable = Desc['[[Configurable]]']; + } + return obj; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-completepropertydescriptor + CompletePropertyDescriptor: function CompletePropertyDescriptor(Desc) { + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (!has(Desc, '[[Value]]')) { + Desc['[[Value]]'] = void 0; + } + if (!has(Desc, '[[Writable]]')) { + Desc['[[Writable]]'] = false; + } + } else { + if (!has(Desc, '[[Get]]')) { + Desc['[[Get]]'] = void 0; + } + if (!has(Desc, '[[Set]]')) { + Desc['[[Set]]'] = void 0; + } + } + if (!has(Desc, '[[Enumerable]]')) { + Desc['[[Enumerable]]'] = false; + } + if (!has(Desc, '[[Configurable]]')) { + Desc['[[Configurable]]'] = false; + } + return Desc; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-set-o-p-v-throw + Set: function Set(O, P, V, Throw) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + if (this.Type(Throw) !== 'Boolean') { + throw new $TypeError('Throw must be a Boolean'); + } + if (Throw) { + O[P] = V; + return true; + } else { + try { + O[P] = V; + } catch (e) { + return false; + } + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty + HasOwnProperty: function HasOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return has(O, P); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-hasproperty + HasProperty: function HasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + return P in O; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-isconcatspreadable + IsConcatSpreadable: function IsConcatSpreadable(O) { + if (this.Type(O) !== 'Object') { + return false; + } + if (hasSymbols && typeof $Symbol.isConcatSpreadable === 'symbol') { + var spreadable = this.Get(O, Symbol.isConcatSpreadable); + if (typeof spreadable !== 'undefined') { + return this.ToBoolean(spreadable); + } + } + return this.IsArray(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-invoke + Invoke: function Invoke(O, P) { + if (!this.IsPropertyKey(P)) { + throw new $TypeError('P must be a Property Key'); + } + var argumentsList = arraySlice(arguments, 2); + var func = this.GetV(O, P); + return this.Call(func, O, argumentsList); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-getiterator + GetIterator: function GetIterator(obj, method) { + var actualMethod = method; + if (arguments.length < 2) { + if (!hasSymbols) { + throw new SyntaxError('GetIterator depends on native Symbol support when `method` is not passed'); + } + actualMethod = this.GetMethod(obj, $Symbol.iterator); + } + var iterator = this.Call(actualMethod, obj); + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('iterator must return an object'); + } + + return iterator; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratornext + IteratorNext: function IteratorNext(iterator, value) { + var result = this.Invoke(iterator, 'next', arguments.length < 2 ? [] : [value]); + if (this.Type(result) !== 'Object') { + throw new $TypeError('iterator next must return an object'); + } + return result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorcomplete + IteratorComplete: function IteratorComplete(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.ToBoolean(this.Get(iterResult, 'done')); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorvalue + IteratorValue: function IteratorValue(iterResult) { + if (this.Type(iterResult) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterResult) is not Object'); + } + return this.Get(iterResult, 'value'); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorstep + IteratorStep: function IteratorStep(iterator) { + var result = this.IteratorNext(iterator); + var done = this.IteratorComplete(result); + return done === true ? false : result; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-iteratorclose + IteratorClose: function IteratorClose(iterator, completion) { + if (this.Type(iterator) !== 'Object') { + throw new $TypeError('Assertion failed: Type(iterator) is not Object'); + } + if (!this.IsCallable(completion)) { + throw new $TypeError('Assertion failed: completion is not a thunk for a Completion Record'); + } + var completionThunk = completion; + + var iteratorReturn = this.GetMethod(iterator, 'return'); + + if (typeof iteratorReturn === 'undefined') { + return completionThunk(); + } + + var completionRecord; + try { + var innerResult = this.Call(iteratorReturn, iterator, []); + } catch (e) { + // if we hit here, then "e" is the innerResult completion that needs re-throwing + + // if the completion is of type "throw", this will throw. + completionRecord = completionThunk(); + completionThunk = null; // ensure it's not called twice. + + // if not, then return the innerResult completion + throw e; + } + completionRecord = completionThunk(); // if innerResult worked, then throw if the completion does + completionThunk = null; // ensure it's not called twice. + + if (this.Type(innerResult) !== 'Object') { + throw new $TypeError('iterator .return must return an object'); + } + + return completionRecord; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createiterresultobject + CreateIterResultObject: function CreateIterResultObject(value, done) { + if (this.Type(done) !== 'Boolean') { + throw new $TypeError('Assertion failed: Type(done) is not Boolean'); + } + return { + value: value, + done: done + }; + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-regexpexec + RegExpExec: function RegExpExec(R, S) { + if (this.Type(R) !== 'Object') { + throw new $TypeError('R must be an Object'); + } + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + var exec = this.Get(R, 'exec'); + if (this.IsCallable(exec)) { + var result = this.Call(exec, R, [S]); + if (result === null || this.Type(result) === 'Object') { + return result; + } + throw new $TypeError('"exec" method must return `null` or an Object'); + } + return regexExec(R, S); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-arrayspeciescreate + ArraySpeciesCreate: function ArraySpeciesCreate(originalArray, length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: length must be an integer >= 0'); + } + var len = length === 0 ? 0 : length; + var C; + var isArray = this.IsArray(originalArray); + if (isArray) { + C = this.Get(originalArray, 'constructor'); + // TODO: figure out how to make a cross-realm normal Array, a same-realm Array + // if (this.IsConstructor(C)) { + // if C is another realm's Array, C = undefined + // Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(Array))) === null ? + // } + if (this.Type(C) === 'Object' && hasSymbols && $Symbol.species) { + C = this.Get(C, $Symbol.species); + if (C === null) { + C = void 0; + } + } + } + if (typeof C === 'undefined') { + return $Array(len); + } + if (!this.IsConstructor(C)) { + throw new $TypeError('C must be a constructor'); + } + return new C(len); // this.Construct(C, len); + }, + + CreateDataProperty: function CreateDataProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var oldDesc = $gOPD(O, P); + var extensible = oldDesc || this.IsExtensible(O); + var immutable = oldDesc && (!oldDesc.writable || !oldDesc.configurable); + if (immutable || !extensible) { + return false; + } + return DefineOwnProperty(this, O, P, { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Value]]': V, + '[[Writable]]': true + }); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-createdatapropertyorthrow + CreateDataPropertyOrThrow: function CreateDataPropertyOrThrow(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + var success = this.CreateDataProperty(O, P, V); + if (!success) { + throw new $TypeError('unable to create data property'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-objectcreate + ObjectCreate: function ObjectCreate(proto, internalSlotsList) { + if (proto !== null && this.Type(proto) !== 'Object') { + throw new $TypeError('Assertion failed: proto must be null or an object'); + } + var slots = arguments.length < 2 ? [] : internalSlotsList; + if (slots.length > 0) { + throw new $SyntaxError('es-abstract does not yet support internal slots'); + } + + if (proto === null && !$ObjectCreate) { + throw new $SyntaxError('native Object.create support is required to create null objects'); + } + + return $ObjectCreate(proto); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-advancestringindex + AdvanceStringIndex: function AdvanceStringIndex(S, index, unicode) { + if (this.Type(S) !== 'String') { + throw new $TypeError('S must be a String'); + } + if (!this.IsInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) { + throw new $TypeError('Assertion failed: length must be an integer >= 0 and <= 2**53'); + } + if (this.Type(unicode) !== 'Boolean') { + throw new $TypeError('Assertion failed: unicode must be a Boolean'); + } + if (!unicode) { + return index + 1; + } + var length = S.length; + if ((index + 1) >= length) { + return index + 1; + } + + var first = $charCodeAt(S, index); + if (first < 0xD800 || first > 0xDBFF) { + return index + 1; + } + + var second = $charCodeAt(S, index + 1); + if (second < 0xDC00 || second > 0xDFFF) { + return index + 1; + } + + return index + 2; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createmethodproperty + CreateMethodProperty: function CreateMethodProperty(O, P, V) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var newDesc = { + '[[Configurable]]': true, + '[[Enumerable]]': false, + '[[Value]]': V, + '[[Writable]]': true + }; + return DefineOwnProperty(this, O, P, newDesc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-definepropertyorthrow + DefinePropertyOrThrow: function DefinePropertyOrThrow(O, P, desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var Desc = isPropertyDescriptor(this, desc) ? desc : this.ToPropertyDescriptor(desc); + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc is not a valid Property Descriptor'); + } + + return DefineOwnProperty(this, O, P, Desc); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-deletepropertyorthrow + DeletePropertyOrThrow: function DeletePropertyOrThrow(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true'); + } + + var success = delete O[P]; + if (!success) { + throw new TypeError('Attempt to delete property failed.'); + } + return success; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-enumerableownnames + EnumerableOwnNames: function EnumerableOwnNames(O) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + + return keys(O); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-number-prototype-object + thisNumberValue: function thisNumberValue(value) { + if (this.Type(value) === 'Number') { + return value; + } + + return $NumberValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-boolean-prototype-object + thisBooleanValue: function thisBooleanValue(value) { + if (this.Type(value) === 'Boolean') { + return value; + } + + return $BooleanValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-string-prototype-object + thisStringValue: function thisStringValue(value) { + if (this.Type(value) === 'String') { + return value; + } + + return $StringValueOf(value); + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-date-prototype-object + thisTimeValue: function thisTimeValue(value) { + return $DateValueOf(value); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-setintegritylevel + SetIntegrityLevel: function SetIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + if (!$preventExtensions) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.preventExtensions` support'); + } + var status = $preventExtensions(O); + if (!status) { + return false; + } + if (!$gOPN) { + throw new $SyntaxError('SetIntegrityLevel requires native `Object.getOwnPropertyNames` support'); + } + var theKeys = $gOPN(O); + var ES = this; + if (level === 'sealed') { + forEach(theKeys, function (k) { + ES.DefinePropertyOrThrow(O, k, { configurable: false }); + }); + } else if (level === 'frozen') { + forEach(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + var desc; + if (ES.IsAccessorDescriptor(ES.ToPropertyDescriptor(currentDesc))) { + desc = { configurable: false }; + } else { + desc = { configurable: false, writable: false }; + } + ES.DefinePropertyOrThrow(O, k, desc); + } + }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-testintegritylevel + TestIntegrityLevel: function TestIntegrityLevel(O, level) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (level !== 'sealed' && level !== 'frozen') { + throw new $TypeError('Assertion failed: `level` must be `"sealed"` or `"frozen"`'); + } + var status = this.IsExtensible(O); + if (status) { + return false; + } + var theKeys = $gOPN(O); + var ES = this; + return theKeys.length === 0 || every(theKeys, function (k) { + var currentDesc = $gOPD(O, k); + if (typeof currentDesc !== 'undefined') { + if (currentDesc.configurable) { + return false; + } + if (level === 'frozen' && ES.IsDataDescriptor(ES.ToPropertyDescriptor(currentDesc)) && currentDesc.writable) { + return false; + } + } + return true; + }); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasinstance + OrdinaryHasInstance: function OrdinaryHasInstance(C, O) { + if (this.IsCallable(C) === false) { + return false; + } + if (this.Type(O) !== 'Object') { + return false; + } + var P = this.Get(C, 'prototype'); + if (this.Type(P) !== 'Object') { + throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.'); + } + return O instanceof C; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty + OrdinaryHasProperty: function OrdinaryHasProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + return P in O; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator + InstanceofOperator: function InstanceofOperator(O, C) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + var instOfHandler = hasSymbols && $Symbol.hasInstance ? this.GetMethod(C, $Symbol.hasInstance) : void 0; + if (typeof instOfHandler !== 'undefined') { + return this.ToBoolean(this.Call(instOfHandler, C, [O])); + } + if (!this.IsCallable(C)) { + throw new $TypeError('`C` is not Callable'); + } + return this.OrdinaryHasInstance(C, O); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ispromise + IsPromise: function IsPromise(x) { + if (this.Type(x) !== 'Object') { + return false; + } + if (!$Promise) { // Promises are not supported + return false; + } + try { + $PromiseThen(x); // throws if not a promise + } catch (e) { + return false; + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-abstract-equality-comparison + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number' || xType === 'Symbol') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number' || yType === 'Symbol')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // eslint-disable-next-line max-lines-per-function, max-statements, id-length, max-params + ValidateAndApplyPropertyDescriptor: function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { + // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. + var oType = this.Type(O); + if (oType !== 'Undefined' && oType !== 'Object') { + throw new $TypeError('Assertion failed: O must be undefined or an Object'); + } + if (this.Type(extensible) !== 'Boolean') { + throw new $TypeError('Assertion failed: extensible must be a Boolean'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (this.Type(current) !== 'Undefined' && !isPropertyDescriptor(this, current)) { + throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); + } + if (oType !== 'Undefined' && !this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); + } + if (this.Type(current) === 'Undefined') { + if (!extensible) { + return false; + } + if (this.IsGenericDescriptor(Desc) || this.IsDataDescriptor(Desc)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': Desc['[[Configurable]]'], + '[[Enumerable]]': Desc['[[Enumerable]]'], + '[[Value]]': Desc['[[Value]]'], + '[[Writable]]': Desc['[[Writable]]'] + }); + } + } else { + if (!this.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + } + return true; + } + if (this.IsGenericDescriptor(Desc) && !('[[Configurable]]' in Desc) && !('[[Enumerable]]' in Desc)) { + return true; + } + if (isSamePropertyDescriptor(this, Desc, current)) { + return true; // removed by ES2017, but should still be correct + } + // "if every field in Desc is absent, return true" can't really match the assertion that it's a Property Descriptor + if (!current['[[Configurable]]']) { + if (Desc['[[Configurable]]']) { + return false; + } + if ('[[Enumerable]]' in Desc && !Desc['[[Enumerable]]'] === !!current['[[Enumerable]]']) { + return false; + } + } + if (this.IsGenericDescriptor(Desc)) { + // no further validation is required. + } else if (this.IsDataDescriptor(current) !== this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + return false; + } + if (this.IsDataDescriptor(current)) { + if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Get]]': undefined + }); + } + } else if (oType !== 'Undefined') { + DefineOwnProperty(this, O, P, { + '[[Configurable]]': current['[[Configurable]]'], + '[[Enumerable]]': current['[[Enumerable]]'], + '[[Value]]': undefined + }); + } + } else if (this.IsDataDescriptor(current) && this.IsDataDescriptor(Desc)) { + if (!current['[[Configurable]]'] && !current['[[Writable]]']) { + if ('[[Writable]]' in Desc && Desc['[[Writable]]']) { + return false; + } + if ('[[Value]]' in Desc && !this.SameValue(Desc['[[Value]]'], current['[[Value]]'])) { + return false; + } + return true; + } + } else if (this.IsAccessorDescriptor(current) && this.IsAccessorDescriptor(Desc)) { + if (!current['[[Configurable]]']) { + if ('[[Set]]' in Desc && !this.SameValue(Desc['[[Set]]'], current['[[Set]]'])) { + return false; + } + if ('[[Get]]' in Desc && !this.SameValue(Desc['[[Get]]'], current['[[Get]]'])) { + return false; + } + return true; + } + } else { + throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); + } + if (oType !== 'Undefined') { + return DefineOwnProperty(this, O, P, Desc); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarydefineownproperty + OrdinaryDefineOwnProperty: function OrdinaryDefineOwnProperty(O, P, Desc) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + var desc = $gOPD(O, P); + var current = desc && this.ToPropertyDescriptor(desc); + var extensible = this.IsExtensible(O); + return this.ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-ordinarygetownproperty + OrdinaryGetOwnProperty: function OrdinaryGetOwnProperty(O, P) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: O must be an Object'); + } + if (!this.IsPropertyKey(P)) { + throw new $TypeError('Assertion failed: P must be a Property Key'); + } + if (!has(O, P)) { + return void 0; + } + if (!$gOPD) { + // ES3 fallback + var arrayLength = this.IsArray(O) && P === 'length'; + var regexLastIndex = this.IsRegExp(O) && P === 'lastIndex'; + return { + '[[Configurable]]': !(arrayLength || regexLastIndex), + '[[Enumerable]]': $isEnumerable(O, P), + '[[Value]]': O[P], + '[[Writable]]': true + }; + } + return this.ToPropertyDescriptor($gOPD(O, P)); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-arraycreate + ArrayCreate: function ArrayCreate(length) { + if (!this.IsInteger(length) || length < 0) { + throw new $TypeError('Assertion failed: `length` must be an integer Number >= 0'); + } + if (length > MAX_ARRAY_LENGTH) { + throw new $RangeError('length is greater than (2**32 - 1)'); + } + var proto = arguments.length > 1 ? arguments[1] : $ArrayPrototype; + var A = []; // steps 5 - 7, and 9 + if (proto !== $ArrayPrototype) { // step 8 + if (!$setProto) { + throw new $SyntaxError('ArrayCreate: a `proto` argument that is not `Array.prototype` is not supported in an environment that does not support setting the [[Prototype]]'); + } + $setProto(A, proto); + } + if (length !== 0) { // bypasses the need for step 2 + A.length = length; + } + /* step 10, the above as a shortcut for the below + this.OrdinaryDefineOwnProperty(A, 'length', { + '[[Configurable]]': false, + '[[Enumerable]]': false, + '[[Value]]': length, + '[[Writable]]': true + }); + */ + return A; + }, + + // eslint-disable-next-line max-statements, max-lines-per-function + ArraySetLength: function ArraySetLength(A, Desc) { + if (!this.IsArray(A)) { + throw new $TypeError('Assertion failed: A must be an Array'); + } + if (!isPropertyDescriptor(this, Desc)) { + throw new $TypeError('Assertion failed: Desc must be a Property Descriptor'); + } + if (!('[[Value]]' in Desc)) { + return this.OrdinaryDefineOwnProperty(A, 'length', Desc); + } + var newLenDesc = assign({}, Desc); + var newLen = this.ToUint32(Desc['[[Value]]']); + var numberLen = this.ToNumber(Desc['[[Value]]']); + if (newLen !== numberLen) { + throw new $RangeError('Invalid array length'); + } + newLenDesc['[[Value]]'] = newLen; + var oldLenDesc = this.OrdinaryGetOwnProperty(A, 'length'); + if (!this.IsDataDescriptor(oldLenDesc)) { + throw new $TypeError('Assertion failed: an array had a non-data descriptor on `length`'); + } + var oldLen = oldLenDesc['[[Value]]']; + if (newLen >= oldLen) { + return this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + } + if (!oldLenDesc['[[Writable]]']) { + return false; + } + var newWritable; + if (!('[[Writable]]' in newLenDesc) || newLenDesc['[[Writable]]']) { + newWritable = true; + } else { + newWritable = false; + newLenDesc['[[Writable]]'] = true; + } + var succeeded = this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + if (!succeeded) { + return false; + } + while (newLen < oldLen) { + oldLen -= 1; + var deleteSucceeded = delete A[this.ToString(oldLen)]; + if (!deleteSucceeded) { + newLenDesc['[[Value]]'] = oldLen + 1; + if (!newWritable) { + newLenDesc['[[Writable]]'] = false; + this.OrdinaryDefineOwnProperty(A, 'length', newLenDesc); + return false; + } + } + } + if (!newWritable) { + return this.OrdinaryDefineOwnProperty(A, 'length', { '[[Writable]]': false }); + } + return true; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-createhtml + CreateHTML: function CreateHTML(string, tag, attribute, value) { + if (this.Type(tag) !== 'String' || this.Type(attribute) !== 'String') { + throw new $TypeError('Assertion failed: `tag` and `attribute` must be strings'); + } + var str = this.RequireObjectCoercible(string); + var S = this.ToString(str); + var p1 = '<' + tag; + if (attribute !== '') { + var V = this.ToString(value); + var escapedV = $replace(V, /\x22/g, '"'); + p1 += '\x20' + attribute + '\x3D\x22' + escapedV + '\x22'; + } + return p1 + '>' + S + '</' + tag + '>'; + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getownpropertykeys + GetOwnPropertyKeys: function GetOwnPropertyKeys(O, Type) { + if (this.Type(O) !== 'Object') { + throw new $TypeError('Assertion failed: Type(O) is not Object'); + } + if (Type === 'Symbol') { + return hasSymbols && $gOPS ? $gOPS(O) : []; + } + if (Type === 'String') { + if (!$gOPN) { + return keys(O); + } + return $gOPN(O); + } + throw new $TypeError('Assertion failed: `Type` must be `"String"` or `"Symbol"`'); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-symboldescriptivestring + SymbolDescriptiveString: function SymbolDescriptiveString(sym) { + if (this.Type(sym) !== 'Symbol') { + throw new $TypeError('Assertion failed: `sym` must be a Symbol'); + } + return $SymbolToString(sym); + }, + + // https://www.ecma-international.org/ecma-262/6.0/#sec-getsubstitution + // eslint-disable-next-line max-statements, max-params, max-lines-per-function + GetSubstitution: function GetSubstitution(matched, str, position, captures, replacement) { + if (this.Type(matched) !== 'String') { + throw new $TypeError('Assertion failed: `matched` must be a String'); + } + var matchLength = matched.length; + + if (this.Type(str) !== 'String') { + throw new $TypeError('Assertion failed: `str` must be a String'); + } + var stringLength = str.length; + + if (!this.IsInteger(position) || position < 0 || position > stringLength) { + throw new $TypeError('Assertion failed: `position` must be a nonnegative integer, and less than or equal to the length of `string`, got ' + inspect(position)); + } + + var ES = this; + var isStringOrHole = function (capture, index, arr) { return ES.Type(capture) === 'String' || !(index in arr); }; + if (!this.IsArray(captures) || !every(captures, isStringOrHole)) { + throw new $TypeError('Assertion failed: `captures` must be a List of Strings, got ' + inspect(captures)); + } + + if (this.Type(replacement) !== 'String') { + throw new $TypeError('Assertion failed: `replacement` must be a String'); + } + + var tailPos = position + matchLength; + var m = captures.length; + + var result = ''; + for (var i = 0; i < replacement.length; i += 1) { + // if this is a $, and it's not the end of the replacement + var current = replacement[i]; + var isLast = (i + 1) >= replacement.length; + var nextIsLast = (i + 2) >= replacement.length; + if (current === '$' && !isLast) { + var next = replacement[i + 1]; + if (next === '$') { + result += '$'; + i += 1; + } else if (next === '&') { + result += matched; + i += 1; + } else if (next === '`') { + result += position === 0 ? '' : strSlice(str, 0, position - 1); + i += 1; + } else if (next === "'") { + result += tailPos >= stringLength ? '' : strSlice(str, tailPos); + i += 1; + } else { + var nextNext = nextIsLast ? null : replacement[i + 2]; + if (isDigit(next) && next !== '0' && (nextIsLast || !isDigit(nextNext))) { + // $1 through $9, and not followed by a digit + var n = parseInteger(next, 10); + // if (n > m, impl-defined) + result += (n <= m && this.Type(captures[n - 1]) === 'Undefined') ? '' : captures[n - 1]; + i += 1; + } else if (isDigit(next) && (nextIsLast || isDigit(nextNext))) { + // $00 through $99 + var nn = next + nextNext; + var nnI = parseInteger(nn, 10) - 1; + // if nn === '00' or nn > m, impl-defined + result += (nn <= m && this.Type(captures[nnI]) === 'Undefined') ? '' : captures[nnI]; + i += 2; + } else { + result += '$'; + } + } + } else { + // the final $, or else not a $ + result += replacement[i]; + } + } + return result; + } +}); + +delete ES6.CheckObjectCoercible; // renamed in ES6 to RequireObjectCoercible + +module.exports = ES6; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/es2016.js": +/*!*****************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/es2016.js ***! + \*****************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js"); + +var $Array = GetIntrinsic('%Array%'); + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var ES2015 = __webpack_require__(/*! ./es2015 */ "../../node_modules/object.values/node_modules/es-abstract/es2015.js"); +var assign = __webpack_require__(/*! ./helpers/assign */ "../../node_modules/object.values/node_modules/es-abstract/helpers/assign.js"); +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.values/node_modules/es-abstract/helpers/callBind.js"); + +var $arrayPush = callBind($Array.prototype.push); +var $arraySlice = callBind($Array.prototype.slice); +var $arrayJoin = callBind($Array.prototype.join); + +var ES2016 = assign(assign({}, ES2015), { + // https://www.ecma-international.org/ecma-262/7.0/#sec-samevaluenonnumber + SameValueNonNumber: function SameValueNonNumber(x, y) { + if (typeof x === 'number' || typeof x !== typeof y) { + throw new TypeError('SameValueNonNumber requires two non-number values of the same type.'); + } + return this.SameValue(x, y); + }, + + // https://www.ecma-international.org/ecma-262/7.0/#sec-iterabletoarraylike + IterableToArrayLike: function IterableToArrayLike(items) { + var usingIterator; + if (hasSymbols) { + usingIterator = this.GetMethod(items, Symbol.iterator); + } else if (this.IsArray(items)) { + usingIterator = function () { + var i = -1; + var arr = this; // eslint-disable-line no-invalid-this + return { + next: function () { + i += 1; + return { + done: i >= arr.length, + value: arr[i] + }; + } + }; + }; + } else if (this.Type(items) === 'String') { + var ES = this; + usingIterator = function () { + var i = 0; + return { + next: function () { + var nextIndex = ES.AdvanceStringIndex(items, i, true); + var value = $arrayJoin($arraySlice(items, i, nextIndex), ''); + i = nextIndex; + return { + done: nextIndex > items.length, + value: value + }; + } + }; + }; + } + if (typeof usingIterator !== 'undefined') { + var iterator = this.GetIterator(items, usingIterator); + var values = []; + var next = true; + while (next) { + next = this.IteratorStep(iterator); + if (next) { + var nextValue = this.IteratorValue(next); + $arrayPush(values, nextValue); + } + } + return values; + } + + return this.ToObject(items); + } +}); + +module.exports = ES2016; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/es5.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/es5.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ./GetIntrinsic */ "../../node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js"); + +var $Object = GetIntrinsic('%Object%'); +var $TypeError = GetIntrinsic('%TypeError%'); +var $String = GetIntrinsic('%String%'); +var $Number = GetIntrinsic('%Number%'); + +var assertRecord = __webpack_require__(/*! ./helpers/assertRecord */ "../../node_modules/object.values/node_modules/es-abstract/helpers/assertRecord.js"); +var isPropertyDescriptor = __webpack_require__(/*! ./helpers/isPropertyDescriptor */ "../../node_modules/object.values/node_modules/es-abstract/helpers/isPropertyDescriptor.js"); +var $isNaN = __webpack_require__(/*! ./helpers/isNaN */ "../../node_modules/object.values/node_modules/es-abstract/helpers/isNaN.js"); +var $isFinite = __webpack_require__(/*! ./helpers/isFinite */ "../../node_modules/object.values/node_modules/es-abstract/helpers/isFinite.js"); + +var sign = __webpack_require__(/*! ./helpers/sign */ "../../node_modules/object.values/node_modules/es-abstract/helpers/sign.js"); +var mod = __webpack_require__(/*! ./helpers/mod */ "../../node_modules/object.values/node_modules/es-abstract/helpers/mod.js"); + +var IsCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var toPrimitive = __webpack_require__(/*! es-to-primitive/es5 */ "../../node_modules/object.values/node_modules/es-to-primitive/es5.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var callBind = __webpack_require__(/*! ./helpers/callBind */ "../../node_modules/object.values/node_modules/es-abstract/helpers/callBind.js"); +var strSlice = callBind($String.prototype.slice); + +var isPrefixOf = function isPrefixOf(prefix, string) { + if (prefix === string) { + return true; + } + if (prefix.length > string.length) { + return false; + } + return strSlice(string, 0, prefix.length) === prefix; +}; + +// https://es5.github.io/#x9 +var ES5 = { + ToPrimitive: toPrimitive, + + ToBoolean: function ToBoolean(value) { + return !!value; + }, + ToNumber: function ToNumber(value) { + return +value; // eslint-disable-line no-implicit-coercion + }, + ToInteger: function ToInteger(value) { + var number = this.ToNumber(value); + if ($isNaN(number)) { return 0; } + if (number === 0 || !$isFinite(number)) { return number; } + return sign(number) * Math.floor(Math.abs(number)); + }, + ToInt32: function ToInt32(x) { + return this.ToNumber(x) >> 0; + }, + ToUint32: function ToUint32(x) { + return this.ToNumber(x) >>> 0; + }, + ToUint16: function ToUint16(value) { + var number = this.ToNumber(value); + if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; } + var posInt = sign(number) * Math.floor(Math.abs(number)); + return mod(posInt, 0x10000); + }, + ToString: function ToString(value) { + return $String(value); + }, + ToObject: function ToObject(value) { + this.CheckObjectCoercible(value); + return $Object(value); + }, + CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) { + /* jshint eqnull:true */ + if (value == null) { + throw new $TypeError(optMessage || 'Cannot call method on ' + value); + } + return value; + }, + IsCallable: IsCallable, + SameValue: function SameValue(x, y) { + if (x === y) { // 0 === -0, but they are not identical. + if (x === 0) { return 1 / x === 1 / y; } + return true; + } + return $isNaN(x) && $isNaN(y); + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-8 + Type: function Type(x) { + if (x === null) { + return 'Null'; + } + if (typeof x === 'undefined') { + return 'Undefined'; + } + if (typeof x === 'function' || typeof x === 'object') { + return 'Object'; + } + if (typeof x === 'number') { + return 'Number'; + } + if (typeof x === 'boolean') { + return 'Boolean'; + } + if (typeof x === 'string') { + return 'String'; + } + }, + + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + IsPropertyDescriptor: function IsPropertyDescriptor(Desc) { + return isPropertyDescriptor(this, Desc); + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.1 + IsAccessorDescriptor: function IsAccessorDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.2 + IsDataDescriptor: function IsDataDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { + return false; + } + + return true; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.3 + IsGenericDescriptor: function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) { + return true; + } + + return false; + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.4 + FromPropertyDescriptor: function FromPropertyDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return Desc; + } + + assertRecord(this, 'Property Descriptor', 'Desc', Desc); + + if (this.IsDataDescriptor(Desc)) { + return { + value: Desc['[[Value]]'], + writable: !!Desc['[[Writable]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else if (this.IsAccessorDescriptor(Desc)) { + return { + get: Desc['[[Get]]'], + set: Desc['[[Set]]'], + enumerable: !!Desc['[[Enumerable]]'], + configurable: !!Desc['[[Configurable]]'] + }; + } else { + throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor'); + } + }, + + // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 + ToPropertyDescriptor: function ToPropertyDescriptor(Obj) { + if (this.Type(Obj) !== 'Object') { + throw new $TypeError('ToPropertyDescriptor requires an object'); + } + + var desc = {}; + if (has(Obj, 'enumerable')) { + desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable); + } + if (has(Obj, 'configurable')) { + desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable); + } + if (has(Obj, 'value')) { + desc['[[Value]]'] = Obj.value; + } + if (has(Obj, 'writable')) { + desc['[[Writable]]'] = this.ToBoolean(Obj.writable); + } + if (has(Obj, 'get')) { + var getter = Obj.get; + if (typeof getter !== 'undefined' && !this.IsCallable(getter)) { + throw new TypeError('getter must be a function'); + } + desc['[[Get]]'] = getter; + } + if (has(Obj, 'set')) { + var setter = Obj.set; + if (typeof setter !== 'undefined' && !this.IsCallable(setter)) { + throw new $TypeError('setter must be a function'); + } + desc['[[Set]]'] = setter; + } + + if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { + throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); + } + return desc; + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3 + 'Abstract Equality Comparison': function AbstractEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType === yType) { + return x === y; // ES6+ specified this shortcut anyways. + } + if (x == null && y == null) { + return true; + } + if (xType === 'Number' && yType === 'String') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if (xType === 'String' && yType === 'Number') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (xType === 'Boolean') { + return this['Abstract Equality Comparison'](this.ToNumber(x), y); + } + if (yType === 'Boolean') { + return this['Abstract Equality Comparison'](x, this.ToNumber(y)); + } + if ((xType === 'String' || xType === 'Number') && yType === 'Object') { + return this['Abstract Equality Comparison'](x, this.ToPrimitive(y)); + } + if (xType === 'Object' && (yType === 'String' || yType === 'Number')) { + return this['Abstract Equality Comparison'](this.ToPrimitive(x), y); + } + return false; + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.9.6 + 'Strict Equality Comparison': function StrictEqualityComparison(x, y) { + var xType = this.Type(x); + var yType = this.Type(y); + if (xType !== yType) { + return false; + } + if (xType === 'Undefined' || xType === 'Null') { + return true; + } + return x === y; // shortcut for steps 4-7 + }, + + // https://www.ecma-international.org/ecma-262/5.1/#sec-11.8.5 + // eslint-disable-next-line max-statements + 'Abstract Relational Comparison': function AbstractRelationalComparison(x, y, LeftFirst) { + if (this.Type(LeftFirst) !== 'Boolean') { + throw new $TypeError('Assertion failed: LeftFirst argument must be a Boolean'); + } + var px; + var py; + if (LeftFirst) { + px = this.ToPrimitive(x, $Number); + py = this.ToPrimitive(y, $Number); + } else { + py = this.ToPrimitive(y, $Number); + px = this.ToPrimitive(x, $Number); + } + var bothStrings = this.Type(px) === 'String' && this.Type(py) === 'String'; + if (!bothStrings) { + var nx = this.ToNumber(px); + var ny = this.ToNumber(py); + if ($isNaN(nx) || $isNaN(ny)) { + return undefined; + } + if ($isFinite(nx) && $isFinite(ny) && nx === ny) { + return false; + } + if (nx === 0 && ny === 0) { + return false; + } + if (nx === Infinity) { + return false; + } + if (ny === Infinity) { + return true; + } + if (ny === -Infinity) { + return false; + } + if (nx === -Infinity) { + return true; + } + return nx < ny; // by now, these are both nonzero, finite, and not equal + } + if (isPrefixOf(py, px)) { + return false; + } + if (isPrefixOf(px, py)) { + return true; + } + return px < py; // both strings, neither a prefix of the other. shortcut for steps c-f + } +}; + +module.exports = ES5; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/es7.js": +/*!**************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/es7.js ***! + \**************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2016 */ "../../node_modules/object.values/node_modules/es-abstract/es2016.js"); + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/assertRecord.js": +/*!*******************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/assertRecord.js ***! + \*******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js"); + +var $TypeError = GetIntrinsic('%TypeError%'); +var $SyntaxError = GetIntrinsic('%SyntaxError%'); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var predicates = { + // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type + 'Property Descriptor': function isPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + var isData = has(Desc, '[[Value]]'); + var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); + if (isData && IsAccessor) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; + } +}; + +module.exports = function assertRecord(ES, recordType, argumentName, value) { + var predicate = predicates[recordType]; + if (typeof predicate !== 'function') { + throw new $SyntaxError('unknown record type: ' + recordType); + } + if (!predicate(ES, value)) { + throw new $TypeError(argumentName + ' must be a ' + recordType); + } +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/assign.js": +/*!*************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/assign.js ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); + +var $assign = GetIntrinsic('%Object%').assign; + +module.exports = function assign(target, source) { + if ($assign) { + return $assign(target, source); + } + + // eslint-disable-next-line no-restricted-syntax + for (var key in source) { + if (has(source, key)) { + target[key] = source[key]; + } + } + return target; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/callBind.js": +/*!***************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/callBind.js ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js"); + +var $Function = GetIntrinsic('%Function%'); +var $apply = $Function.apply; +var $call = $Function.call; + +module.exports = function callBind() { + return bind.apply($call, arguments); +}; + +module.exports.apply = function applyBind() { + return bind.apply($apply, arguments); +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/every.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/every.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function every(array, predicate) { + for (var i = 0; i < array.length; i += 1) { + if (!predicate(array[i], i, array)) { + return false; + } + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/forEach.js": +/*!**************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/forEach.js ***! + \**************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function forEach(array, callback) { + for (var i = 0; i < array.length; i += 1) { + callback(array[i], i, array); // eslint-disable-line callback-return + } +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/isFinite.js": +/*!***************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/isFinite.js ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var $isNaN = Number.isNaN || function (a) { return a !== a; }; + +module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/isNaN.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/isNaN.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/isPrimitive.js": +/*!******************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/isPrimitive.js ***! + \******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/isPropertyDescriptor.js": +/*!***************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/isPropertyDescriptor.js ***! + \***************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var GetIntrinsic = __webpack_require__(/*! ../GetIntrinsic */ "../../node_modules/object.values/node_modules/es-abstract/GetIntrinsic.js"); + +var has = __webpack_require__(/*! has */ "../../node_modules/has/src/index.js"); +var $TypeError = GetIntrinsic('%TypeError%'); + +module.exports = function IsPropertyDescriptor(ES, Desc) { + if (ES.Type(Desc) !== 'Object') { + return false; + } + var allowed = { + '[[Configurable]]': true, + '[[Enumerable]]': true, + '[[Get]]': true, + '[[Set]]': true, + '[[Value]]': true, + '[[Writable]]': true + }; + + for (var key in Desc) { // eslint-disable-line + if (has(Desc, key) && !allowed[key]) { + return false; + } + } + + if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { + throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); + } + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js": +/*!*******************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/isSamePropertyDescriptor.js ***! + \*******************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var every = __webpack_require__(/*! ./every */ "../../node_modules/object.values/node_modules/es-abstract/helpers/every.js"); + +module.exports = function isSamePropertyDescriptor(ES, D1, D2) { + var fields = [ + '[[Configurable]]', + '[[Enumerable]]', + '[[Get]]', + '[[Set]]', + '[[Value]]', + '[[Writable]]' + ]; + return every(fields, function (field) { + if ((field in D1) !== (field in D2)) { + return false; + } + return ES.SameValue(D1[field], D2[field]); + }); +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/mod.js": +/*!**********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/mod.js ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function mod(number, modulo) { + var remain = number % modulo; + return Math.floor(remain >= 0 ? remain : remain + modulo); +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-abstract/helpers/sign.js": +/*!***********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-abstract/helpers/sign.js ***! + \***********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function sign(number) { + return number >= 0 ? 1 : -1; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-to-primitive/es2015.js": +/*!*********************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-to-primitive/es2015.js ***! + \*********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.values/node_modules/es-to-primitive/helpers/isPrimitive.js"); +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); +var isDate = __webpack_require__(/*! is-date-object */ "../../node_modules/is-date-object/index.js"); +var isSymbol = __webpack_require__(/*! is-symbol */ "../../node_modules/is-symbol/index.js"); + +var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) { + if (typeof O === 'undefined' || O === null) { + throw new TypeError('Cannot call method on ' + O); + } + if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) { + throw new TypeError('hint must be "string" or "number"'); + } + var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var method, result, i; + for (i = 0; i < methodNames.length; ++i) { + method = O[methodNames[i]]; + if (isCallable(method)) { + result = method.call(O); + if (isPrimitive(result)) { + return result; + } + } + } + throw new TypeError('No default value'); +}; + +var GetMethod = function GetMethod(O, P) { + var func = O[P]; + if (func !== null && typeof func !== 'undefined') { + if (!isCallable(func)) { + throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function'); + } + return func; + } + return void 0; +}; + +// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + var hint = 'default'; + if (arguments.length > 1) { + if (arguments[1] === String) { + hint = 'string'; + } else if (arguments[1] === Number) { + hint = 'number'; + } + } + + var exoticToPrim; + if (hasSymbols) { + if (Symbol.toPrimitive) { + exoticToPrim = GetMethod(input, Symbol.toPrimitive); + } else if (isSymbol(input)) { + exoticToPrim = Symbol.prototype.valueOf; + } + } + if (typeof exoticToPrim !== 'undefined') { + var result = exoticToPrim.call(input, hint); + if (isPrimitive(result)) { + return result; + } + throw new TypeError('unable to convert exotic object to primitive'); + } + if (hint === 'default' && (isDate(input) || isSymbol(input))) { + hint = 'string'; + } + return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint); +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-to-primitive/es5.js": +/*!******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-to-primitive/es5.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; + +var isPrimitive = __webpack_require__(/*! ./helpers/isPrimitive */ "../../node_modules/object.values/node_modules/es-to-primitive/helpers/isPrimitive.js"); + +var isCallable = __webpack_require__(/*! is-callable */ "../../node_modules/is-callable/index.js"); + +// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8 +var ES5internalSlots = { + '[[DefaultValue]]': function (O) { + var actualHint; + if (arguments.length > 1) { + actualHint = arguments[1]; + } else { + actualHint = toStr.call(O) === '[object Date]' ? String : Number; + } + + if (actualHint === String || actualHint === Number) { + var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString']; + var value, i; + for (i = 0; i < methods.length; ++i) { + if (isCallable(O[methods[i]])) { + value = O[methods[i]](); + if (isPrimitive(value)) { + return value; + } + } + } + throw new TypeError('No default value'); + } + throw new TypeError('invalid [[DefaultValue]] hint supplied'); + } +}; + +// http://ecma-international.org/ecma-262/5.1/#sec-9.1 +module.exports = function ToPrimitive(input) { + if (isPrimitive(input)) { + return input; + } + if (arguments.length > 1) { + return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]); + } + return ES5internalSlots['[[DefaultValue]]'](input); +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-to-primitive/es6.js": +/*!******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-to-primitive/es6.js ***! + \******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = __webpack_require__(/*! ./es2015 */ "../../node_modules/object.values/node_modules/es-to-primitive/es2015.js"); + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/es-to-primitive/helpers/isPrimitive.js": +/*!**********************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/es-to-primitive/helpers/isPrimitive.js ***! + \**********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function isPrimitive(value) { + return value === null || (typeof value !== 'function' && typeof value !== 'object'); +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/node_modules/object-inspect/index.js": +/*!*******************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/node_modules/object-inspect/index.js ***! + \*******************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var hasMap = typeof Map === 'function' && Map.prototype; +var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null; +var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null; +var mapForEach = hasMap && Map.prototype.forEach; +var hasSet = typeof Set === 'function' && Set.prototype; +var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null; +var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null; +var setForEach = hasSet && Set.prototype.forEach; +var booleanValueOf = Boolean.prototype.valueOf; +var objectToString = Object.prototype.toString; +var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null; + +var inspectCustom = __webpack_require__(/*! ./util.inspect */ 2).custom; +var inspectSymbol = (inspectCustom && isSymbol(inspectCustom)) ? inspectCustom : null; + +module.exports = function inspect_ (obj, opts, depth, seen) { + if (!opts) opts = {}; + + if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + + if (typeof obj === 'undefined') { + return 'undefined'; + } + if (obj === null) { + return 'null'; + } + if (typeof obj === 'boolean') { + return obj ? 'true' : 'false'; + } + + if (typeof obj === 'string') { + return inspectString(obj, opts); + } + if (typeof obj === 'number') { + if (obj === 0) { + return Infinity / obj > 0 ? '0' : '-0'; + } + return String(obj); + } + if (typeof obj === 'bigint') { + return String(obj) + 'n'; + } + + var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth; + if (typeof depth === 'undefined') depth = 0; + if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') { + return '[Object]'; + } + + if (typeof seen === 'undefined') seen = []; + else if (indexOf(seen, obj) >= 0) { + return '[Circular]'; + } + + function inspect (value, from) { + if (from) { + seen = seen.slice(); + seen.push(from); + } + return inspect_(value, opts, depth + 1, seen); + } + + if (typeof obj === 'function') { + var name = nameOf(obj); + return '[Function' + (name ? ': ' + name : '') + ']'; + } + if (isSymbol(obj)) { + var symString = Symbol.prototype.toString.call(obj); + return typeof obj === 'object' ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s = '<' + String(obj.nodeName).toLowerCase(); + var attrs = obj.attributes || []; + for (var i = 0; i < attrs.length; i++) { + s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts); + } + s += '>'; + if (obj.childNodes && obj.childNodes.length) s += '...'; + s += '</' + String(obj.nodeName).toLowerCase() + '>'; + return s; + } + if (isArray(obj)) { + if (obj.length === 0) return '[]'; + return '[ ' + arrObjKeys(obj, inspect).join(', ') + ' ]'; + } + if (isError(obj)) { + var parts = arrObjKeys(obj, inspect); + if (parts.length === 0) return '[' + String(obj) + ']'; + return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }'; + } + if (typeof obj === 'object') { + if (inspectSymbol && typeof obj[inspectSymbol] === 'function') { + return obj[inspectSymbol](); + } else if (typeof obj.inspect === 'function') { + return obj.inspect(); + } + } + if (isMap(obj)) { + var parts = []; + mapForEach.call(obj, function (value, key) { + parts.push(inspect(key, obj) + ' => ' + inspect(value, obj)); + }); + return collectionOf('Map', mapSize.call(obj), parts); + } + if (isSet(obj)) { + var parts = []; + setForEach.call(obj, function (value ) { + parts.push(inspect(value, obj)); + }); + return collectionOf('Set', setSize.call(obj), parts); + } + if (isNumber(obj)) { + return markBoxed(inspect(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect(bigIntValueOf.call(obj))); + } + if (isBoolean(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString(obj)) { + return markBoxed(inspect(String(obj))); + } + if (!isDate(obj) && !isRegExp(obj)) { + var xs = arrObjKeys(obj, inspect); + if (xs.length === 0) return '{}'; + return '{ ' + xs.join(', ') + ' }'; + } + return String(obj); +}; + +function wrapQuotes (s, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'"; + return quoteChar + s + quoteChar; +} + +function quote (s) { + return String(s).replace(/"/g, '"'); +} + +function isArray (obj) { return toStr(obj) === '[object Array]'; } +function isDate (obj) { return toStr(obj) === '[object Date]'; } +function isRegExp (obj) { return toStr(obj) === '[object RegExp]'; } +function isError (obj) { return toStr(obj) === '[object Error]'; } +function isSymbol (obj) { return toStr(obj) === '[object Symbol]'; } +function isString (obj) { return toStr(obj) === '[object String]'; } +function isNumber (obj) { return toStr(obj) === '[object Number]'; } +function isBigInt (obj) { return toStr(obj) === '[object BigInt]'; } +function isBoolean (obj) { return toStr(obj) === '[object Boolean]'; } + +var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; }; +function has (obj, key) { + return hasOwn.call(obj, key); +} + +function toStr (obj) { + return objectToString.call(obj); +} + +function nameOf (f) { + if (f.name) return f.name; + var m = String(f).match(/^function\s*([\w$]+)/); + if (m) return m[1]; +} + +function indexOf (xs, x) { + if (xs.indexOf) return xs.indexOf(x); + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} + +function isMap (x) { + if (!mapSize) { + return false; + } + try { + mapSize.call(x); + try { + setSize.call(x); + } catch (s) { + return true; + } + return x instanceof Map; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isSet (x) { + if (!setSize) { + return false; + } + try { + setSize.call(x); + try { + mapSize.call(x); + } catch (m) { + return true; + } + return x instanceof Set; // core-js workaround, pre-v2.5.0 + } catch (e) {} + return false; +} + +function isElement (x) { + if (!x || typeof x !== 'object') return false; + if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) { + return true; + } + return typeof x.nodeName === 'string' + && typeof x.getAttribute === 'function' + ; +} + +function inspectString (str, opts) { + var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s, 'single', opts); +} + +function lowbyte (c) { + var n = c.charCodeAt(0); + var x = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[n]; + if (x) return '\\' + x; + return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16); +} + +function markBoxed (str) { + return 'Object(' + str + ')'; +} + +function collectionOf (type, size, entries) { + return type + ' (' + size + ') {' + entries.join(', ') + '}'; +} + +function arrObjKeys (obj, inspect) { + var isArr = isArray(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i = 0; i < obj.length; i++) { + xs[i] = has(obj, i) ? inspect(obj[i], obj) : ''; + } + } + for (var key in obj) { + if (!has(obj, key)) continue; + if (isArr && String(Number(key)) === key && key < obj.length) continue; + if (/[^\w$]/.test(key)) { + xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj)); + } else { + xs.push(key + ': ' + inspect(obj[key], obj)); + } + } + return xs; +} + + +/***/ }), + +/***/ "../../node_modules/object.values/polyfill.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/polyfill.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/object.values/implementation.js"); + +module.exports = function getPolyfill() { + return typeof Object.values === 'function' ? Object.values : implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/object.values/shim.js": +/*!**************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/object.values/shim.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/object.values/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function shimValues() { + var polyfill = getPolyfill(); + define(Object, { values: polyfill }, { + values: function testValues() { + return Object.values !== polyfill; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/process/browser.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/process/browser.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), + +/***/ "../../node_modules/promise.allsettled/auto.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.allsettled/auto.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./shim */ "../../node_modules/promise.allsettled/shim.js")(); + + +/***/ }), + +/***/ "../../node_modules/promise.allsettled/implementation.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.allsettled/implementation.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var requirePromise = __webpack_require__(/*! ./requirePromise */ "../../node_modules/promise.allsettled/requirePromise.js"); + +requirePromise(); + +var ES = __webpack_require__(/*! es-abstract/es2018 */ "../../node_modules/es-abstract/es2018.js"); +var getIntrinsic = __webpack_require__(/*! es-abstract/GetIntrinsic */ "../../node_modules/es-abstract/GetIntrinsic.js"); +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); + +var all = bind.call(Function.call, getIntrinsic('%Promise_all%')); +var reject = bind.call(Function.call, getIntrinsic('%Promise_reject%')); + +module.exports = function allSettled(iterable) { + var C = this; + if (ES.Type(C) !== 'Object') { + throw new TypeError('`this` value must be an object'); + } + return all(C, Array.from(iterable, function (item) { + var onFulfill = function (value) { + return { status: 'fulfilled', value: value }; + }; + var onReject = function (reason) { + return { status: 'rejected', reason: reason }; + }; + var itemPromise = ES.PromiseResolve(C, item); + try { + return itemPromise.then(onFulfill, onReject); + } catch (e) { + return reject(C, e); + } + })); +}; + + +/***/ }), + +/***/ "../../node_modules/promise.allsettled/polyfill.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.allsettled/polyfill.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var requirePromise = __webpack_require__(/*! ./requirePromise */ "../../node_modules/promise.allsettled/requirePromise.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/promise.allsettled/implementation.js"); + +module.exports = function getPolyfill() { + requirePromise(); + return typeof Promise.allSettled === 'function' ? Promise.allSettled : implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/promise.allsettled/requirePromise.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.allsettled/requirePromise.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function requirePromise() { + if (typeof Promise !== 'function') { + throw new TypeError('`Promise.allSettled` requires a global `Promise` be available.'); + } + if (typeof Array.from !== 'function') { + throw new TypeError('`Promise.allSettled` requires `Array.from` be available.'); + } +}; + + +/***/ }), + +/***/ "../../node_modules/promise.allsettled/shim.js": +/*!*******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.allsettled/shim.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var requirePromise = __webpack_require__(/*! ./requirePromise */ "../../node_modules/promise.allsettled/requirePromise.js"); + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/promise.allsettled/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function shimAllSettled() { + requirePromise(); + + var polyfill = getPolyfill(); + define(Promise, { allSettled: polyfill }, { + allSettled: function testAllSettled() { + return Promise.allSettled !== polyfill; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/promise.prototype.finally/auto.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.prototype.finally/auto.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./shim */ "../../node_modules/promise.prototype.finally/shim.js")(); + + +/***/ }), + +/***/ "../../node_modules/promise.prototype.finally/implementation.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.prototype.finally/implementation.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var requirePromise = __webpack_require__(/*! ./requirePromise */ "../../node_modules/promise.prototype.finally/requirePromise.js"); + +requirePromise(); + +var ES = __webpack_require__(/*! es-abstract/es2018 */ "../../node_modules/es-abstract/es2018.js"); + +var promiseResolve = function PromiseResolve(C, value) { + return new C(function (resolve) { + resolve(value); + }); +}; + +var OriginalPromise = Promise; + +var createThenFinally = function CreateThenFinally(C, onFinally) { + return function (value) { + var result = onFinally(); + var promise = promiseResolve(C, result); + var valueThunk = function () { + return value; + }; + return promise.then(valueThunk); + }; +}; + +var createCatchFinally = function CreateCatchFinally(C, onFinally) { + return function (reason) { + var result = onFinally(); + var promise = promiseResolve(C, result); + var thrower = function () { + throw reason; + }; + return promise.then(thrower); + }; +}; + +var promiseFinally = function finally_(onFinally) { + /* eslint no-invalid-this: 0 */ + + var promise = this; + + if (ES.Type(promise) !== 'Object') { + throw new TypeError('receiver is not an Object'); + } + + var C = ES.SpeciesConstructor(promise, OriginalPromise); // may throw + + var thenFinally = onFinally; + var catchFinally = onFinally; + if (ES.IsCallable(onFinally)) { + thenFinally = createThenFinally(C, onFinally); + catchFinally = createCatchFinally(C, onFinally); + } + + return promise.then(thenFinally, catchFinally); +}; + +if (Object.getOwnPropertyDescriptor) { + var descriptor = Object.getOwnPropertyDescriptor(promiseFinally, 'name'); + if (descriptor && descriptor.configurable) { + Object.defineProperty(promiseFinally, 'name', { configurable: true, value: 'finally' }); + } +} + +module.exports = promiseFinally; + + +/***/ }), + +/***/ "../../node_modules/promise.prototype.finally/polyfill.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.prototype.finally/polyfill.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var requirePromise = __webpack_require__(/*! ./requirePromise */ "../../node_modules/promise.prototype.finally/requirePromise.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/promise.prototype.finally/implementation.js"); + +module.exports = function getPolyfill() { + requirePromise(); + return typeof Promise.prototype['finally'] === 'function' ? Promise.prototype['finally'] : implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/promise.prototype.finally/requirePromise.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.prototype.finally/requirePromise.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function requirePromise() { + if (typeof Promise !== 'function') { + throw new TypeError('`Promise.prototype.finally` requires a global `Promise` be available.'); + } +}; + + +/***/ }), + +/***/ "../../node_modules/promise.prototype.finally/shim.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/promise.prototype.finally/shim.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var requirePromise = __webpack_require__(/*! ./requirePromise */ "../../node_modules/promise.prototype.finally/requirePromise.js"); + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/promise.prototype.finally/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function shimPromiseFinally() { + requirePromise(); + + var polyfill = getPolyfill(); + define(Promise.prototype, { 'finally': polyfill }, { + 'finally': function testFinally() { + return Promise.prototype['finally'] !== polyfill; + } + }); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/prop-types/checkPropTypes.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/prop-types/checkPropTypes.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var printWarning = function() {}; + +if (true) { + var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../../node_modules/prop-types/lib/ReactPropTypesSecret.js"); + var loggedTypeFailures = {}; + var has = Function.call.bind(Object.prototype.hasOwnProperty); + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(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) {} + }; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (has(typeSpecs, typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ); + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } +} + +/** + * Resets warning cache when testing. + * + * @private + */ +checkPropTypes.resetWarningCache = function() { + if (true) { + loggedTypeFailures = {}; + } +} + +module.exports = checkPropTypes; + + +/***/ }), + +/***/ "../../node_modules/prop-types/factoryWithTypeCheckers.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/prop-types/factoryWithTypeCheckers.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactIs = __webpack_require__(/*! react-is */ "../../node_modules/react-is/index.js"); +var assign = __webpack_require__(/*! object-assign */ "../../node_modules/object-assign/index.js"); + +var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../../node_modules/prop-types/lib/ReactPropTypesSecret.js"); +var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../../node_modules/prop-types/checkPropTypes.js"); + +var has = Function.call.bind(Object.prototype.hasOwnProperty); +var printWarning = function() {}; + +if (true) { + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(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) {} + }; +} + +function emptyFunctionThatReturnsNull() { + return null; +} + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<<anonymous>>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + elementType: createElementTypeTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * 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 + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = new Error( + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + err.name = 'Invariant Violation'; + throw err; + } else if ( true && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!ReactIs.isValidElementType(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + if (true) { + if (arguments.length > 1) { + printWarning( + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' + ); + } else { + printWarning('Invalid argument supplied to oneOf, expected an array.'); + } + } + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { + var type = getPreciseType(value); + if (type === 'symbol') { + return String(value); + } + return value; + }); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (has(propValue, key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // falsy value can't be a Symbol + if (!propValue) { + return false; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + + +/***/ }), + +/***/ "../../node_modules/prop-types/index.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/prop-types/index.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if (true) { + var ReactIs = __webpack_require__(/*! react-is */ "../../node_modules/react-is/index.js"); + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); +} else {} + + +/***/ }), + +/***/ "../../node_modules/prop-types/lib/ReactPropTypesSecret.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/prop-types/lib/ReactPropTypesSecret.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + + +/***/ }), + +/***/ "../../node_modules/qs/lib/formats.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/qs/lib/formats.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var replace = String.prototype.replace; +var percentTwenties = /%20/g; + +var util = __webpack_require__(/*! ./utils */ "../../node_modules/qs/lib/utils.js"); + +var Format = { + RFC1738: 'RFC1738', + RFC3986: 'RFC3986' +}; + +module.exports = util.assign( + { + 'default': Format.RFC3986, + formatters: { + RFC1738: function (value) { + return replace.call(value, percentTwenties, '+'); + }, + RFC3986: function (value) { + return String(value); + } + } + }, + Format +); + + +/***/ }), + +/***/ "../../node_modules/qs/lib/index.js": +/*!********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/qs/lib/index.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var stringify = __webpack_require__(/*! ./stringify */ "../../node_modules/qs/lib/stringify.js"); +var parse = __webpack_require__(/*! ./parse */ "../../node_modules/qs/lib/parse.js"); +var formats = __webpack_require__(/*! ./formats */ "../../node_modules/qs/lib/formats.js"); + +module.exports = { + formats: formats, + parse: parse, + stringify: stringify +}; + + +/***/ }), + +/***/ "../../node_modules/qs/lib/parse.js": +/*!********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/qs/lib/parse.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "../../node_modules/qs/lib/utils.js"); + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var defaults = { + allowDots: false, + allowPrototypes: false, + arrayLimit: 20, + charset: 'utf-8', + charsetSentinel: false, + comma: false, + decoder: utils.decode, + delimiter: '&', + depth: 5, + ignoreQueryPrefix: false, + interpretNumericEntities: false, + parameterLimit: 1000, + parseArrays: true, + plainObjects: false, + strictNullHandling: false +}; + +var interpretNumericEntities = function (str) { + return str.replace(/&#(\d+);/g, function ($0, numberStr) { + return String.fromCharCode(parseInt(numberStr, 10)); + }); +}; + +// This is what browsers will submit when the ✓ character occurs in an +// application/x-www-form-urlencoded body and the encoding of the page containing +// the form is iso-8859-1, or when the submitted form has an accept-charset +// attribute of iso-8859-1. Presumably also with other charsets that do not contain +// the ✓ character, such as us-ascii. +var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') + +// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. +var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓') + +var parseValues = function parseQueryStringValues(str, options) { + var obj = {}; + var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; + var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); + var skipIndex = -1; // Keep track of where the utf8 sentinel was found + var i; + + var charset = options.charset; + if (options.charsetSentinel) { + for (i = 0; i < parts.length; ++i) { + if (parts[i].indexOf('utf8=') === 0) { + if (parts[i] === charsetSentinel) { + charset = 'utf-8'; + } else if (parts[i] === isoSentinel) { + charset = 'iso-8859-1'; + } + skipIndex = i; + i = parts.length; // The eslint settings do not allow break; + } + } + } + + for (i = 0; i < parts.length; ++i) { + if (i === skipIndex) { + continue; + } + var part = parts[i]; + + var bracketEqualsPos = part.indexOf(']='); + var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; + + var key, val; + if (pos === -1) { + key = options.decoder(part, defaults.decoder, charset, 'key'); + val = options.strictNullHandling ? null : ''; + } else { + key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key'); + val = options.decoder(part.slice(pos + 1), defaults.decoder, charset, 'value'); + } + + if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { + val = interpretNumericEntities(val); + } + + if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) { + val = val.split(','); + } + + if (part.indexOf('[]=') > -1) { + val = isArray(val) ? [val] : val; + } + + if (has.call(obj, key)) { + obj[key] = utils.combine(obj[key], val); + } else { + obj[key] = val; + } + } + + return obj; +}; + +var parseObject = function (chain, val, options) { + var leaf = val; + + for (var i = chain.length - 1; i >= 0; --i) { + var obj; + var root = chain[i]; + + if (root === '[]' && options.parseArrays) { + obj = [].concat(leaf); + } else { + obj = options.plainObjects ? Object.create(null) : {}; + var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; + var index = parseInt(cleanRoot, 10); + if (!options.parseArrays && cleanRoot === '') { + obj = { 0: leaf }; + } else if ( + !isNaN(index) + && root !== cleanRoot + && String(index) === cleanRoot + && index >= 0 + && (options.parseArrays && index <= options.arrayLimit) + ) { + obj = []; + obj[index] = leaf; + } else { + obj[cleanRoot] = leaf; + } + } + + leaf = obj; + } + + return leaf; +}; + +var parseKeys = function parseQueryStringKeys(givenKey, val, options) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + + // Get the parent + + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + + // Stash the parent if it exists + + var keys = []; + if (parent) { + // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + + keys.push(parent); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return parseObject(keys, val, options); +}; + +var normalizeParseOptions = function normalizeParseOptions(opts) { + if (!opts) { + return defaults; + } + + if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; + + return { + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, + arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, + decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, + delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, + // eslint-disable-next-line no-implicit-coercion, no-extra-parens + depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (str, opts) { + var options = normalizeParseOptions(opts); + + if (str === '' || str === null || typeof str === 'undefined') { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var newObj = parseKeys(key, tempObj[key], options); + obj = utils.merge(obj, newObj, options); + } + + return utils.compact(obj); +}; + + +/***/ }), + +/***/ "../../node_modules/qs/lib/stringify.js": +/*!************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/qs/lib/stringify.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "../../node_modules/qs/lib/utils.js"); +var formats = __webpack_require__(/*! ./formats */ "../../node_modules/qs/lib/formats.js"); +var has = Object.prototype.hasOwnProperty; + +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + comma: 'comma', + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var isArray = Array.isArray; +var push = Array.prototype.push; +var pushToArray = function (arr, valueOrArray) { + push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); +}; + +var toISO = Date.prototype.toISOString; + +var defaultFormat = formats['default']; +var defaults = { + addQueryPrefix: false, + allowDots: false, + charset: 'utf-8', + charsetSentinel: false, + delimiter: '&', + encode: true, + encoder: utils.encode, + encodeValuesOnly: false, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + // deprecated + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false +}; + +var isNonNullishPrimitive = function isNonNullishPrimitive(v) { + return typeof v === 'string' + || typeof v === 'number' + || typeof v === 'boolean' + || typeof v === 'symbol' + || typeof v === 'bigint'; +}; + +var stringify = function stringify( + object, + prefix, + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly, + charset +) { + var obj = object; + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === 'comma' && isArray(obj)) { + obj = obj.join(','); + } + + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix; + } + + obj = ''; + } + + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key'); + return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))]; + } + return [formatter(prefix) + '=' + formatter(String(obj))]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (skipNulls && obj[key] === null) { + continue; + } + + if (isArray(obj)) { + pushToArray(values, stringify( + obj[key], + typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix, + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly, + charset + )); + } else { + pushToArray(values, stringify( + obj[key], + prefix + (allowDots ? '.' + key : '[' + key + ']'), + generateArrayPrefix, + strictNullHandling, + skipNulls, + encoder, + filter, + sort, + allowDots, + serializeDate, + formatter, + encodeValuesOnly, + charset + )); + } + } + + return values; +}; + +var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { + if (!opts) { + return defaults; + } + + if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + var charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + var format = formats['default']; + if (typeof opts.format !== 'undefined') { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + + var filter = defaults.filter; + if (typeof opts.filter === 'function' || isArray(opts.filter)) { + filter = opts.filter; + } + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, + charset: charset, + charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling + }; +}; + +module.exports = function (object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + + var objKeys; + var filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (isArray(options.filter)) { + filter = options.filter; + objKeys = filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var arrayFormat; + if (opts && opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if (opts && 'indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (options.sort) { + objKeys.sort(options.sort); + } + + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + + if (options.skipNulls && obj[key] === null) { + continue; + } + pushToArray(keys, stringify( + obj[key], + key, + generateArrayPrefix, + options.strictNullHandling, + options.skipNulls, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.formatter, + options.encodeValuesOnly, + options.charset + )); + } + + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B&'; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93&'; + } + } + + return joined.length > 0 ? prefix + joined : ''; +}; + + +/***/ }), + +/***/ "../../node_modules/qs/lib/utils.js": +/*!********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/qs/lib/utils.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty; +var isArray = Array.isArray; + +var hexTable = (function () { + var array = []; + for (var i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +}()); + +var compactQueue = function compactQueue(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + + if (isArray(obj)) { + var compacted = []; + + for (var j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); + } + } + + item.obj[item.prop] = compacted; + } + } +}; + +var arrayToObject = function arrayToObject(source, options) { + var obj = options && options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +var merge = function merge(target, source, options) { + /* eslint no-param-reassign: 0 */ + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (isArray(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (!target || typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (isArray(target) && !isArray(source)) { + mergeTarget = arrayToObject(target, options); + } + + if (isArray(target) && isArray(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + var targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +}; + +var decode = function (str, decoder, charset) { + var strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +}; + +var encode = function encode(str, defaultEncoder, charset) { + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + var string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + + var out = ''; + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); + + if ( + c === 0x2D // - + || c === 0x2E // . + || c === 0x5F // _ + || c === 0x7E // ~ + || (c >= 0x30 && c <= 0x39) // 0-9 + || (c >= 0x41 && c <= 0x5A) // a-z + || (c >= 0x61 && c <= 0x7A) // A-Z + ) { + out += string.charAt(i); + continue; + } + + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } + + if (c < 0x800) { + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + out += hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + } + + return out; +}; + +var compact = function compact(value) { + var queue = [{ obj: { o: value }, prop: 'o' }]; + var refs = []; + + for (var i = 0; i < queue.length; ++i) { + var item = queue[i]; + var obj = item.obj[item.prop]; + + var keys = Object.keys(obj); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + var val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj: obj, prop: key }); + refs.push(val); + } + } + } + + compactQueue(queue); + + return value; +}; + +var isRegExp = function isRegExp(obj) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + +var isBuffer = function isBuffer(obj) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +var combine = function combine(a, b) { + return [].concat(a, b); +}; + +module.exports = { + arrayToObject: arrayToObject, + assign: assign, + combine: combine, + compact: compact, + decode: decode, + encode: encode, + isBuffer: isBuffer, + isRegExp: isRegExp, + merge: merge +}; + + +/***/ }), + +/***/ "../../node_modules/querystring-es3/decode.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/querystring-es3/decode.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + + +/***/ }), + +/***/ "../../node_modules/querystring-es3/encode.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/querystring-es3/encode.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; +}; + + +/***/ }), + +/***/ "../../node_modules/querystring-es3/index.js": +/*!*****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/querystring-es3/index.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.decode = exports.parse = __webpack_require__(/*! ./decode */ "../../node_modules/querystring-es3/decode.js"); +exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ "../../node_modules/querystring-es3/encode.js"); + + +/***/ }), + +/***/ "../../node_modules/react-dom/cjs/react-dom.development.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/react-dom/cjs/react-dom.development.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** @license React v16.13.1 + * react-dom.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + + + +if (true) { + (function() { +'use strict'; + +var React = __webpack_require__(/*! react */ "./node_modules/react/index.js"); +var _assign = __webpack_require__(/*! object-assign */ "../../node_modules/object-assign/index.js"); +var Scheduler = __webpack_require__(/*! scheduler */ "../../node_modules/react-dom/node_modules/scheduler/index.js"); +var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "../../node_modules/prop-types/checkPropTypes.js"); +var tracing = __webpack_require__(/*! scheduler/tracing */ "../../node_modules/react-dom/node_modules/scheduler/tracing.js"); + +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 + }; +} + +if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) { + ReactSharedInternals.ReactCurrentBatchConfig = { + suspense: null + }; +} + +// by calls to these methods by a Babel plugin. +// +// In PROD (or in packages without access to React internals), +// they are left as they are instead. + +function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + printWarning('warn', format, args); + } +} +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; + + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], 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) {} + } +} + +if (!React) { + { + throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." ); + } +} + +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. + if (!(typeof document !== 'undefined')) { + { + throw Error( "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." ); + } + } + + 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; // 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; + +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 { + { + { + throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." ); + } + } + } +} + +var getFiberCurrentPropsFromNode = null; +var getInstanceFromNode = null; +var getNodeFromInstance = null; +function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) { + getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl; + getInstanceFromNode = getInstanceFromNodeImpl; + getNodeFromInstance = getNodeFromInstanceImpl; + + { + if (!getNodeFromInstance || !getInstanceFromNode) { + error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.'); + } + } +} +var validateEventDispatches; + +{ + 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; + + if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) { + error('EventPluginUtils: Invalid `event`.'); + } + }; +} +/** + * 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; +} + +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 DehydratedFragment = 18; +var SuspenseListComponent = 19; +var FundamentalComponent = 20; +var ScopeComponent = 21; +var Block = 22; + +/** + * 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); + + if (!(pluginIndex > -1)) { + { + throw Error( "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`." ); + } + } + + if (plugins[pluginIndex]) { + continue; + } + + if (!pluginModule.extractEvents) { + { + throw Error( "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not." ); + } + } + + plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + + for (var eventName in publishedEvents) { + if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) { + { + throw Error( "EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`." ); + } + } + } + } +} +/** + * 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) { + if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) { + { + throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName + "`." ); + } + } + + 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) { + if (!!registrationNameModules[registrationName]) { + { + throw Error( "EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`." ); + } + } + + 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. + */ + +/** + * 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 + */ + +function injectEventPluginOrder(injectedEventPluginOrder) { + if (!!eventPluginOrder) { + { + throw Error( "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React." ); + } + } // Clone the ordering so it cannot be dynamically mutated. + + + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder); + recomputePluginOrdering(); +} +/** + * Injects plugins to be used by plugin event system. 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 + */ + +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) { + if (!!namesToPlugins[pluginName]) { + { + throw Error( "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`." ); + } + } + + namesToPlugins[pluginName] = pluginModule; + isOrderingDirty = true; + } + } + + if (isOrderingDirty) { + recomputePluginOrdering(); + } +} + +var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); + +var PLUGIN_EVENT_SYSTEM = 1; +var IS_REPLAYED = 1 << 5; +var IS_FIRST_ANCESTOR = 1 << 6; + +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; + } + + if (!(typeof restoreImpl === 'function')) { + { + throw Error( "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." ); + } + } + + var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted. + + if (stateNode) { + var _props = getFiberCurrentPropsFromNode(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]); + } + } +} + +var enableProfilerTimer = true; // Trace which interactions trigger each commit. + +var enableDeprecatedFlareAPI = false; // Experimental Host Component support. + +var enableFundamentalAPI = false; // Experimental Scope support. +var warnAboutStringRefs = false; + +// 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 discreteUpdatesImpl = function (fn, a, b, c, d) { + return fn(a, b, c, d); +}; + +var flushDiscreteUpdatesImpl = function () {}; + +var batchedEventUpdatesImpl = batchedUpdatesImpl; +var isInsideEventHandler = false; +var isBatchingEventUpdates = false; + +function finishEventHandler() { + // 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. + 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. + flushDiscreteUpdatesImpl(); + restoreStateIfNeeded(); + } +} + +function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(bookkeeping); + } + + isInsideEventHandler = true; + + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + finishEventHandler(); + } +} +function batchedEventUpdates(fn, a, b) { + if (isBatchingEventUpdates) { + // If we are currently inside another batch, we need to wait until it + // fully completes before restoring state. + return fn(a, b); + } + + isBatchingEventUpdates = true; + + try { + return batchedEventUpdatesImpl(fn, a, b); + } finally { + isBatchingEventUpdates = false; + finishEventHandler(); + } +} // This is for the React Flare event system +function discreteUpdates(fn, a, b, c, d) { + var prevIsInsideEventHandler = isInsideEventHandler; + isInsideEventHandler = true; + + try { + return discreteUpdatesImpl(fn, a, b, c, d); + } finally { + isInsideEventHandler = prevIsInsideEventHandler; + + if (!isInsideEventHandler) { + finishEventHandler(); + } + } +} +function flushDiscreteUpdatesIfNeeded(timeStamp) { + // event.timeStamp isn't overly reliable due to inconsistencies in + // how different browsers have historically provided the time stamp. + // Some browsers provide high-resolution time stamps for all events, + // some provide low-resolution time stamps for all events. FF < 52 + // even mixes both time stamps together. Some browsers even report + // negative time stamps or time stamps that are 0 (iOS9) in some cases. + // Given we are only comparing two time stamps with equality (!==), + // we are safe from the resolution differences. If the time stamp is 0 + // we bail-out of preventing the flush, which can affect semantics, + // such as if an earlier flush removes or adds event listeners that + // are fired in the subsequent flush. However, this is the same + // behaviour as we had before this change, so the risks are low. + if (!isInsideEventHandler && (!enableDeprecatedFlareAPI )) { + flushDiscreteUpdatesImpl(); + } +} +function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) { + batchedUpdatesImpl = _batchedUpdatesImpl; + discreteUpdatesImpl = _discreteUpdatesImpl; + flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl; + batchedEventUpdatesImpl = _batchedEventUpdatesImpl; +} + +var DiscreteEvent = 0; +var UserBlockingEvent = 1; +var ContinuousEvent = 2; + +// 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; + + { + error('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, sanitizeURL) { + 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; + this.sanitizeURL = sanitizeURL; +} // 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. + +var reservedProps = ['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']; + +reservedProps.forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // 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 + false); +}); // 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 + false); +}); // 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 + false); +}); // 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', 'disablePictureInPicture', '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 + false); +}); // 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' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // These are HTML attributes that are "overloaded booleans": they behave like +// booleans, but can also accept a string value. + +['capture', 'download' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // These are HTML attributes that must be positive numbers. + +['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (name) { + properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty + name, // attributeName + null, // attributeNamespace + false); +}); // 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 + false); +}); +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 +// scraping 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' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, null, // attributeNamespace + false); +}); // String SVG attributes with the xlink namespace. + +['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].forEach(function (attributeName) { + var name = attributeName.replace(CAMELIZE, capitalize); + properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty + attributeName, 'http://www.w3.org/1999/xlink', false); +}); // String SVG attributes with the xml namespace. + +['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, +// you'll need to set attributeName to name.toLowerCase() +// instead in the assignment below. +].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', false); +}); // 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 + false); +}); // These attributes accept URLs. These must not allow javascript: URLS. +// These will also need to accept Trusted Types object in the future. + +var xlinkHref = 'xlinkHref'; +properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty +'xlink:href', 'http://www.w3.org/1999/xlink', true); +['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { + properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty + attributeName.toLowerCase(), // attributeName + null, // attributeNamespace + true); +}); + +var ReactDebugCurrentFrame = null; + +{ + ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; +} // A javascript: URL can contain leading C0 control or \u0020 SPACE, +// and any newline or tab are filtered out as if they're not part of the URL. +// https://url.spec.whatwg.org/#url-parsing +// Tab or newline are defined as \r\n\t: +// https://infra.spec.whatwg.org/#ascii-tab-or-newline +// A C0 control is a code point in the range \u0000 NULL to \u001F +// INFORMATION SEPARATOR ONE, inclusive: +// https://infra.spec.whatwg.org/#c0-control-or-space + +/* eslint-disable max-len */ + + +var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; +var didWarn = false; + +function sanitizeURL(url) { + { + if (!didWarn && isJavaScriptProtocol.test(url)) { + didWarn = true; + + error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); + } + } +} + +/** + * 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 { + if ( propertyInfo.sanitizeURL) { + // If we haven't fully disabled javascript: URLs, and if + // the hydration is successful of a javascript: URL, we + // still want to warn on the client. + sanitizeURL('' + expected); + } + + 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; + + if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { + // If attribute type is boolean, we know for sure it won't be an execution sink + // and we won't require Trusted Type here. + attributeValue = ''; + } else { + // `setAttribute` with objects becomes only `[object]` in IE8/9, + // ('' + value) makes it output the correct toString()-value. + { + attributeValue = '' + value; + } + + if (propertyInfo.sanitizeURL) { + sanitizeURL(attributeValue.toString()); + } + } + + if (attributeNamespace) { + node.setAttributeNS(attributeNamespace, attributeName, attributeValue); + } else { + node.setAttribute(attributeName, attributeValue); + } + } +} + +var BEFORE_SLASH_RE = /^(.*)[\\\/]/; +function describeComponentFrame (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; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary +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_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; +var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; +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 Uninitialized = -1; +var Pending = 0; +var Resolved = 1; +var Rejected = 2; +function refineResolvedLazyComponent(lazyComponent) { + return lazyComponent._status === Resolved ? lazyComponent._result : null; +} +function initializeLazyComponentType(lazyComponent) { + if (lazyComponent._status === Uninitialized) { + lazyComponent._status = Pending; + var ctor = lazyComponent._ctor; + var thenable = ctor(); + lazyComponent._result = thenable; + thenable.then(function (moduleObject) { + if (lazyComponent._status === Pending) { + var defaultExport = moduleObject.default; + + { + if (defaultExport === undefined) { + error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject); + } + } + + lazyComponent._status = Resolved; + lazyComponent._result = defaultExport; + } + }, function (error) { + if (lazyComponent._status === Pending) { + lazyComponent._status = Rejected; + lazyComponent._result = error; + } + }); + } +} + +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') { + error('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_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'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + 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_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + return null; +} + +var ReactDebugCurrentFrame$1 = 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 isRendering = false; +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); + } +} +function resetCurrentFiber() { + { + ReactDebugCurrentFrame$1.getCurrentStack = null; + current = null; + isRendering = false; + } +} +function setCurrentFiber(fiber) { + { + ReactDebugCurrentFrame$1.getCurrentStack = getCurrentFiberStackInDev; + current = fiber; + isRendering = false; + } +} +function setIsRendering(rendering) { + { + isRendering = rendering; + } +} + +// 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$2 = null; +var ReactControlledValuePropTypes = { + checkPropTypes: null +}; + +{ + ReactDebugCurrentFrame$2 = 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 || enableDeprecatedFlareAPI ) { + 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 || enableDeprecatedFlareAPI ) { + 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$2.getStackAddendum); + }; +} + +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 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 <input> 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) { + error('%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) { + error('%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) { + error('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) { + error('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); + + if (!otherProps) { + { + throw Error( "ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported." ); + } + } // 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 <x> 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 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 <fbt>). + + 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 <option> host component that warns when `selected` is set. + */ + + +function validateProps(element, props) { + { + // This mirrors the codepath above, but runs for hydration too. + // Warn about invalid children here so that client and hydration are consistent. + // TODO: this seems like it could cause a DEV-only throw for hydration + // if children contains a non-element object. We should try to avoid that. + if (typeof props.children === 'object' && props.children !== null) { + React.Children.forEach(props.children, function (child) { + if (child == null) { + return; + } + + if (typeof child === 'string' || typeof child === 'number') { + return; + } + + if (typeof child.type !== 'string') { + return; + } + + if (!didWarnInvalidChild) { + didWarnInvalidChild = true; + + error('Only strings and numbers are supported as <option> children.'); + } + }); + } // TODO: Remove support for `selected` in <option>. + + + if (props.selected != null && !didWarnSelectedSetOnOption) { + error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.'); + + didWarnSelectedSetOnOption = true; + } + } +} +function postMountWrapper$1(element, props) { + // value="" should make a value attribute (#6219) + if (props.value != null) { + element.setAttribute('value', toString(getToStringValue(props.value))); + } +} +function getHostProps$1(element, props) { + var hostProps = _assign({ + children: undefined + }, props); + + var content = flattenChildren(props.children); + + if (content) { + hostProps.children = content; + } + + return hostProps; +} + +var didWarnValueDefaultValue$1; + +{ + didWarnValueDefaultValue$1 = false; +} + +function getDeclarationErrorAddendum() { + var ownerName = getCurrentFiberOwnerNameInDevOrNull(); + + if (ownerName) { + return '\n\nCheck the render method of `' + ownerName + '`.'; + } + + return ''; +} + +var valuePropNames = ['value', 'defaultValue']; +/** + * Validation function for `value` and `defaultValue`. + */ + +function checkSelectPropTypes(props) { + { + ReactControlledValuePropTypes.checkPropTypes('select', props); + + for (var i = 0; i < valuePropNames.length; i++) { + var propName = valuePropNames[i]; + + if (props[propName] == null) { + continue; + } + + var isArray = Array.isArray(props[propName]); + + if (props.multiple && !isArray) { + error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum()); + } else if (!props.multiple && isArray) { + error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum()); + } + } + } +} + +function updateOptions(node, multiple, propValue, setDefaultSelected) { + var options = node.options; + + if (multiple) { + var selectedValues = propValue; + var selectedValue = {}; + + for (var i = 0; i < selectedValues.length; i++) { + // Prefix to avoid chaos with special keys. + selectedValue['$' + selectedValues[i]] = true; + } + + for (var _i = 0; _i < options.length; _i++) { + var selected = selectedValue.hasOwnProperty('$' + options[_i].value); + + if (options[_i].selected !== selected) { + options[_i].selected = selected; + } + + if (selected && setDefaultSelected) { + options[_i].defaultSelected = true; + } + } + } else { + // Do not set `select.value` as exact behavior isn't consistent across all + // browsers for all cases. + var _selectedValue = toString(getToStringValue(propValue)); + + var defaultSelected = null; + + for (var _i2 = 0; _i2 < options.length; _i2++) { + if (options[_i2].value === _selectedValue) { + options[_i2].selected = true; + + if (setDefaultSelected) { + options[_i2].defaultSelected = true; + } + + return; + } + + if (defaultSelected === null && !options[_i2].disabled) { + defaultSelected = options[_i2]; + } + } + + if (defaultSelected !== null) { + defaultSelected.selected = true; + } + } +} +/** + * Implements a <select> host component that allows optionally setting the + * props `value` and `defaultValue`. If `multiple` is false, the prop must be a + * stringable. If `multiple` is true, the prop must be an array of stringables. + * + * If `value` is not supplied (or null/undefined), user actions that change the + * selected option will trigger updates to the rendered options. + * + * If it is supplied (and not null/undefined), the rendered options will not + * update in response to user actions. Instead, the `value` prop must change in + * order for the rendered options to update. + * + * If `defaultValue` is provided, any options with the supplied values will be + * selected. + */ + + +function getHostProps$2(element, props) { + return _assign({}, props, { + value: undefined + }); +} +function initWrapperState$1(element, props) { + var node = element; + + { + checkSelectPropTypes(props); + } + + node._wrapperState = { + wasMultiple: !!props.multiple + }; + + { + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) { + error('Select 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 select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components'); + + didWarnValueDefaultValue$1 = true; + } + } +} +function postMountWrapper$2(element, props) { + var node = element; + node.multiple = !!props.multiple; + var value = props.value; + + if (value != null) { + updateOptions(node, !!props.multiple, value, false); + } else if (props.defaultValue != null) { + updateOptions(node, !!props.multiple, props.defaultValue, true); + } +} +function postUpdateWrapper(element, props) { + var node = element; + var wasMultiple = node._wrapperState.wasMultiple; + node._wrapperState.wasMultiple = !!props.multiple; + var value = props.value; + + if (value != null) { + updateOptions(node, !!props.multiple, value, false); + } else if (wasMultiple !== !!props.multiple) { + // For simplicity, reapply `defaultValue` if `multiple` is toggled. + if (props.defaultValue != null) { + updateOptions(node, !!props.multiple, props.defaultValue, true); + } else { + // Revert the select back to its default unselected state. + updateOptions(node, !!props.multiple, props.multiple ? [] : '', false); + } + } +} +function restoreControlledState$1(element, props) { + var node = element; + var value = props.value; + + if (value != null) { + updateOptions(node, !!props.multiple, value, false); + } +} + +var didWarnValDefaultVal = false; + +/** + * Implements a <textarea> host component that allows setting `value`, and + * `defaultValue`. This differs from the traditional DOM API because value is + * usually set as PCDATA children. + * + * If `value` is not supplied (or null/undefined), user actions that affect the + * value will trigger updates to the element. + * + * If `value` is supplied (and not null/undefined), the rendered element will + * not trigger updates to the element. Instead, the `value` prop must change in + * order for the rendered element to be updated. + * + * The rendered element will be initialized with an empty value, the prop + * `defaultValue` if specified, or the children content (deprecated). + */ +function getHostProps$3(element, props) { + var node = element; + + if (!(props.dangerouslySetInnerHTML == null)) { + { + throw Error( "`dangerouslySetInnerHTML` does not make sense on <textarea>." ); + } + } // Always set children to the same thing. In IE9, the selection range will + // get reset if `textContent` is mutated. We could add a check in setTextContent + // to only set the value if/when the value differs from the node value (which would + // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this + // solution. The value can be a boolean or object so that's why it's forced + // to be a string. + + + var hostProps = _assign({}, props, { + value: undefined, + defaultValue: undefined, + children: toString(node._wrapperState.initialValue) + }); + + return hostProps; +} +function initWrapperState$2(element, props) { + var node = element; + + { + ReactControlledValuePropTypes.checkPropTypes('textarea', props); + + if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) { + error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea 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 textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component'); + + didWarnValDefaultVal = true; + } + } + + var initialValue = props.value; // Only bother fetching default value if we're going to use it + + if (initialValue == null) { + var children = props.children, + defaultValue = props.defaultValue; + + if (children != null) { + { + error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.'); + } + + { + if (!(defaultValue == null)) { + { + throw Error( "If you supply `defaultValue` on a <textarea>, do not pass children." ); + } + } + + if (Array.isArray(children)) { + if (!(children.length <= 1)) { + { + throw Error( "<textarea> can only have at most one child." ); + } + } + + children = children[0]; + } + + defaultValue = children; + } + } + + if (defaultValue == null) { + defaultValue = ''; + } + + initialValue = defaultValue; + } + + node._wrapperState = { + initialValue: getToStringValue(initialValue) + }; +} +function updateWrapper$1(element, props) { + var node = element; + var value = getToStringValue(props.value); + var defaultValue = getToStringValue(props.defaultValue); + + if (value != null) { + // Cast `value` to a string to ensure the value is set correctly. While + // browsers typically do this as necessary, jsdom doesn't. + var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed + + if (newValue !== node.value) { + node.value = newValue; + } + + if (props.defaultValue == null && node.defaultValue !== newValue) { + node.defaultValue = newValue; + } + } + + if (defaultValue != null) { + node.defaultValue = toString(defaultValue); + } +} +function postMountWrapper$3(element, props) { + var node = element; // This is in postMount because we need access to the DOM node, which is not + // available until after the component has mounted. + + var textContent = node.textContent; // Only set node.value if textContent is equal to the expected + // initial value. In IE10/IE11 there is a bug where the placeholder attribute + // will populate textContent as well. + // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/ + + if (textContent === node._wrapperState.initialValue) { + if (textContent !== '' && textContent !== null) { + node.value = textContent; + } + } +} +function restoreControlledState$2(element, props) { + // DOM component is still mounted; update + updateWrapper$1(element, props); +} + +var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; +var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; +var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; +var Namespaces = { + html: HTML_NAMESPACE, + mathml: MATH_NAMESPACE, + svg: SVG_NAMESPACE +}; // Assumes there is no parent namespace. + +function getIntrinsicNamespace(type) { + switch (type) { + case 'svg': + return SVG_NAMESPACE; + + case 'math': + return MATH_NAMESPACE; + + default: + return HTML_NAMESPACE; + } +} +function getChildNamespace(parentNamespace, type) { + if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) { + // No (or default) parent namespace: potential entry point. + return getIntrinsicNamespace(type); + } + + if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') { + // We're leaving SVG. + return HTML_NAMESPACE; + } // By default, pass namespace below. + + + return parentNamespace; +} + +/* globals MSApp */ + +/** + * Create a function which has 'unsafe' privileges (required by windows8 apps) + */ +var createMicrosoftUnsafeLocalFunction = function (func) { + if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { + return function (arg0, arg1, arg2, arg3) { + MSApp.execUnsafeLocalFunction(function () { + return func(arg0, arg1, arg2, arg3); + }); + }; + } else { + return func; + } +}; + +var reusableSVGContainer; +/** + * Set the innerHTML property of a node + * + * @param {DOMElement} node + * @param {string} html + * @internal + */ + +var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) { + if (node.namespaceURI === Namespaces.svg) { + + if (!('innerHTML' in node)) { + // IE does not have innerHTML for SVG nodes, so instead we inject the + // new markup in a temp node and then move the child nodes across into + // the target node + reusableSVGContainer = reusableSVGContainer || document.createElement('div'); + reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>'; + var svgNode = reusableSVGContainer.firstChild; + + while (node.firstChild) { + node.removeChild(node.firstChild); + } + + while (svgNode.firstChild) { + node.appendChild(svgNode.firstChild); + } + + return; + } + } + + node.innerHTML = html; +}); + +/** + * 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; + +/** + * Set the textContent property of a node. For text updates, it's faster + * to set the `nodeValue` of the Text node directly instead of using + * `.textContent` which will remove the existing node and create a new one. + * + * @param {DOMElement} node + * @param {string} text + * @internal + */ + +var setTextContent = function (node, text) { + if (text) { + var firstChild = node.firstChild; + + if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) { + firstChild.nodeValue = text; + return; + } + } + + node.textContent = text; +}; + +// Do not use 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); +} + +var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // prettier-ignore + +var elementListenerMap = new PossiblyWeakMap(); +function getListenerMapForElement(element) { + var listenerMap = elementListenerMap.get(element); + + if (listenerMap === undefined) { + listenerMap = new Map(); + elementListenerMap.set(element, listenerMap); + } + + return listenerMap; +} + +/** + * `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. + */ +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; +var Hydrating = +/* */ +1024; +var HydratingAndUpdate = +/* */ +1028; // Passive & Update & Callback & Ref & Snapshot + +var LifecycleEffectMask = +/* */ +932; // Union of all host effects + +var HostEffectMask = +/* */ +2047; +var Incomplete = +/* */ +2048; +var ShouldCapture = +/* */ +4096; + +var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; +function getNearestMountedFiber(fiber) { + var node = fiber; + var nearestMounted = 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. + var nextNode = node; + + do { + node = nextNode; + + if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) { + // This is an insertion or in-progress hydration. The nearest possible + // mounted fiber is the parent but we need to continue to figure out + // if that one is still mounted. + nearestMounted = node.return; + } + + nextNode = node.return; + } while (nextNode); + } else { + while (node.return) { + node = node.return; + } + } + + if (node.tag === HostRoot) { + // TODO: Check if this was a nested HostRoot when used with + // renderContainerIntoSubtree. + return nearestMounted; + } // If we didn't hit the root, that means that we're in an disconnected tree + // that has been unmounted. + + + return null; +} +function getSuspenseInstanceFromFiber(fiber) { + if (fiber.tag === SuspenseComponent) { + var suspenseState = fiber.memoizedState; + + if (suspenseState === null) { + var current = fiber.alternate; + + if (current !== null) { + suspenseState = current.memoizedState; + } + } + + if (suspenseState !== null) { + return suspenseState.dehydrated; + } + } + + return null; +} +function getContainerFromFiber(fiber) { + return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null; +} +function isFiberMounted(fiber) { + return getNearestMountedFiber(fiber) === fiber; +} +function isMounted(component) { + { + var owner = ReactCurrentOwner.current; + + if (owner !== null && owner.tag === ClassComponent) { + var ownerFiber = owner; + var instance = ownerFiber.stateNode; + + if (!instance._warnedAboutRefsInRender) { + error('%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'); + } + + instance._warnedAboutRefsInRender = true; + } + } + + var fiber = get(component); + + if (!fiber) { + return false; + } + + return getNearestMountedFiber(fiber) === fiber; +} + +function assertIsMounted(fiber) { + if (!(getNearestMountedFiber(fiber) === fiber)) { + { + throw Error( "Unable to find node on an unmounted component." ); + } + } +} + +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 nearestMounted = getNearestMountedFiber(fiber); + + if (!(nearestMounted !== null)) { + { + throw Error( "Unable to find node on an unmounted component." ); + } + } + + if (nearestMounted !== fiber) { + 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; + + if (parentA === null) { + // We're at the root. + break; + } + + var parentB = parentA.alternate; + + if (parentB === null) { + // There is no alternate. This is an unusual case. Currently, it only + // happens when a Suspense component is hidden. An extra fragment fiber + // is inserted in between the Suspense fiber and its children. Skip + // over this extra fragment fiber and proceed to the next parent. + var nextParent = parentA.return; + + if (nextParent !== null) { + a = b = nextParent; + continue; + } // If there's no parent, 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. + + + { + { + throw Error( "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; + } + + if (!didFindChild) { + { + throw Error( "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue." ); + } + } + } + } + + if (!(a.alternate === b)) { + { + throw Error( "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue." ); + } + } + } // If the root is not a host container, we're in a disconnected tree. I.e. + // unmounted. + + + if (!(a.tag === HostRoot)) { + { + throw Error( "Unable to find node on an unmounted component." ); + } + } + + 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 || enableFundamentalAPI ) { + 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; +} + +/** + * 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) { + if (!(next != null)) { + { + throw Error( "accumulateInto(...): Accumulated items must not be null or undefined." ); + } + } + + 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 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); + + if (!!eventQueue) { + { + throw Error( "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented." ); + } + } // This would be a good time to rethrow if any of the event handlers threw. + + + rethrowCaughtError(); +} + +/** + * 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 <use> 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; +} + +/** + * Summary of `DOMEventPluginSystem` 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 `EventPluginRegistry`, which in turn will ask plugins if they want + * to extract any synthetic events. + * + * - The `EventPluginRegistry` will then process each event by annotating them with + * "dispatches", a sequence of listeners and IDs that care about that event. + * + * - The `EventPluginRegistry` then dispatches the events. + * + * Overview of React and the event system: + * + * +------------+ . + * | DOM | . + * +------------+ . + * | . + * v . + * +------------+ . + * | ReactEvent | . + * | Listener | . + * +------------+ . +-----------+ + * | . +--------+|SimpleEvent| + * | . | |Plugin | + * +-----|------+ . v +-----------+ + * | | | . +--------------+ +------------+ + * | +-----------.--->|PluginRegistry| | Event | + * | | . | | +-----------+ | Propagators| + * | ReactEvent | . | | |TapEvent | |------------| + * | Emitter | . | |<---+|Plugin | |other plugin| + * | | . | | +-----------+ | utilities | + * | +-----------.--->| | +------------+ + * | | | . +--------------+ + * +-----|------+ . ^ +-----------+ + * | . | |Enter/Leave| + * + . +-------+|Plugin | + * +-------------+ . +-----------+ + * | application | . + * |-------------| . + * | | . + * | | . + * +-------------+ . + * . + * React Core . General Purpose Event Plugin System + */ + +var CALLBACK_BOOKKEEPING_POOL_SIZE = 10; +var callbackBookkeepingPool = []; + +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); + } +} // Used to store ancestor hierarchy in top level callback + + +function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) { + if (callbackBookkeepingPool.length) { + var instance = callbackBookkeepingPool.pop(); + instance.topLevelType = topLevelType; + instance.eventSystemFlags = eventSystemFlags; + instance.nativeEvent = nativeEvent; + instance.targetInst = targetInst; + return instance; + } + + return { + topLevelType: topLevelType, + eventSystemFlags: eventSystemFlags, + nativeEvent: nativeEvent, + targetInst: targetInst, + ancestors: [] + }; +} +/** + * 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) { + if (inst.tag === HostRoot) { + return inst.stateNode.containerInfo; + } // 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; +} +/** + * Allows registered plugins an opportunity to extract events from top-level + * native browser events. + * + * @return {*} An accumulation of synthetic events. + * @internal + */ + + +function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { + 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, eventSystemFlags); + + if (extractedEvents) { + events = accumulateInto(events, extractedEvents); + } + } + } + + return events; +} + +function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { + var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); + runEventsInBatch(events); +} + +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) { + var ancestors = bookKeeping.ancestors; + ancestors.push(ancestor); + break; + } + + var root = findRootContainerNode(ancestor); + + if (!root) { + break; + } + + var tag = ancestor.tag; + + if (tag === HostComponent || tag === HostText) { + bookKeeping.ancestors.push(ancestor); + } + + ancestor = getClosestInstanceFromNode(root); + } while (ancestor); + + for (var i = 0; i < bookKeeping.ancestors.length; i++) { + targetInst = bookKeeping.ancestors[i]; + var eventTarget = getEventTarget(bookKeeping.nativeEvent); + var topLevelType = bookKeeping.topLevelType; + var nativeEvent = bookKeeping.nativeEvent; + var eventSystemFlags = bookKeeping.eventSystemFlags; // If this is the first ancestor, we mark it on the system flags + + if (i === 0) { + eventSystemFlags |= IS_FIRST_ANCESTOR; + } + + runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, eventSystemFlags); + } +} + +function dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) { + var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags); + + try { + // Event queue being processed in the same cycle allows + // `preventDefault`. + batchedEventUpdates(handleTopLevel, bookKeeping); + } finally { + releaseTopLevelCallbackBookKeeping(bookKeeping); + } +} +/** + * 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 legacyListenToEvent(registrationName, mountAt) { + var listenerMap = getListenerMapForElement(mountAt); + var dependencies = registrationNameDependencies[registrationName]; + + for (var i = 0; i < dependencies.length; i++) { + var dependency = dependencies[i]; + legacyListenToTopLevelEvent(dependency, mountAt, listenerMap); + } +} +function legacyListenToTopLevelEvent(topLevelType, mountAt, listenerMap) { + if (!listenerMap.has(topLevelType)) { + switch (topLevelType) { + 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. + + listenerMap.set(TOP_BLUR, null); + listenerMap.set(TOP_FOCUS, null); + break; + + case TOP_CANCEL: + case TOP_CLOSE: + if (isEventSupported(getRawEventName(topLevelType))) { + trapCapturedEvent(topLevelType, 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(topLevelType) !== -1; + + if (!isMediaEvent) { + trapBubbledEvent(topLevelType, mountAt); + } + + break; + } + + listenerMap.set(topLevelType, null); + } +} +function isListeningToAllDependencies(registrationName, mountAt) { + var listenerMap = getListenerMapForElement(mountAt); + var dependencies = registrationNameDependencies[registrationName]; + + for (var i = 0; i < dependencies.length; i++) { + var dependency = dependencies[i]; + + if (!listenerMap.has(dependency)) { + return false; + } + } + + return true; +} + +var attemptUserBlockingHydration; +function setAttemptUserBlockingHydration(fn) { + attemptUserBlockingHydration = fn; +} +var attemptContinuousHydration; +function setAttemptContinuousHydration(fn) { + attemptContinuousHydration = fn; +} +var attemptHydrationAtCurrentPriority; +function setAttemptHydrationAtCurrentPriority(fn) { + attemptHydrationAtCurrentPriority = fn; +} // TODO: Upgrade this definition once we're on a newer version of Flow that +var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed. + +var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout. +// if the last target was dehydrated. + +var queuedFocus = null; +var queuedDrag = null; +var queuedMouse = null; // For pointer events there can be one latest event per pointerId. + +var queuedPointers = new Map(); +var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too. + +var queuedExplicitHydrationTargets = []; +function hasQueuedDiscreteEvents() { + return queuedDiscreteEvents.length > 0; +} +var discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT]; +var continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE]; +function isReplayableDiscreteEvent(eventType) { + return discreteReplayableEvents.indexOf(eventType) > -1; +} + +function trapReplayableEventForDocument(topLevelType, document, listenerMap) { + legacyListenToTopLevelEvent(topLevelType, document, listenerMap); +} + +function eagerlyTrapReplayableEvents(container, document) { + var listenerMapForDoc = getListenerMapForElement(document); // Discrete + + discreteReplayableEvents.forEach(function (topLevelType) { + trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc); + }); // Continuous + + continuousReplayableEvents.forEach(function (topLevelType) { + trapReplayableEventForDocument(topLevelType, document, listenerMapForDoc); + }); +} + +function createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) { + return { + blockedOn: blockedOn, + topLevelType: topLevelType, + eventSystemFlags: eventSystemFlags | IS_REPLAYED, + nativeEvent: nativeEvent, + container: container + }; +} + +function queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) { + var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent); + queuedDiscreteEvents.push(queuedEvent); +} // Resets the replaying for this type of continuous event to no event. + +function clearIfContinuousEvent(topLevelType, nativeEvent) { + switch (topLevelType) { + case TOP_FOCUS: + case TOP_BLUR: + queuedFocus = null; + break; + + case TOP_DRAG_ENTER: + case TOP_DRAG_LEAVE: + queuedDrag = null; + break; + + case TOP_MOUSE_OVER: + case TOP_MOUSE_OUT: + queuedMouse = null; + break; + + case TOP_POINTER_OVER: + case TOP_POINTER_OUT: + { + var pointerId = nativeEvent.pointerId; + queuedPointers.delete(pointerId); + break; + } + + case TOP_GOT_POINTER_CAPTURE: + case TOP_LOST_POINTER_CAPTURE: + { + var _pointerId = nativeEvent.pointerId; + queuedPointerCaptures.delete(_pointerId); + break; + } + } +} + +function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) { + if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) { + var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent); + + if (blockedOn !== null) { + var _fiber2 = getInstanceFromNode$1(blockedOn); + + if (_fiber2 !== null) { + // Attempt to increase the priority of this target. + attemptContinuousHydration(_fiber2); + } + } + + return queuedEvent; + } // If we have already queued this exact event, then it's because + // the different event systems have different DOM event listeners. + // We can accumulate the flags and store a single event to be + // replayed. + + + existingQueuedEvent.eventSystemFlags |= eventSystemFlags; + return existingQueuedEvent; +} + +function queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent) { + // These set relatedTarget to null because the replayed event will be treated as if we + // moved from outside the window (no target) onto the target once it hydrates. + // Instead of mutating we could clone the event. + switch (topLevelType) { + case TOP_FOCUS: + { + var focusEvent = nativeEvent; + queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, container, focusEvent); + return true; + } + + case TOP_DRAG_ENTER: + { + var dragEvent = nativeEvent; + queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, container, dragEvent); + return true; + } + + case TOP_MOUSE_OVER: + { + var mouseEvent = nativeEvent; + queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, container, mouseEvent); + return true; + } + + case TOP_POINTER_OVER: + { + var pointerEvent = nativeEvent; + var pointerId = pointerEvent.pointerId; + queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, container, pointerEvent)); + return true; + } + + case TOP_GOT_POINTER_CAPTURE: + { + var _pointerEvent = nativeEvent; + var _pointerId2 = _pointerEvent.pointerId; + queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, container, _pointerEvent)); + return true; + } + } + + return false; +} // Check if this target is unblocked. Returns true if it's unblocked. + +function attemptExplicitHydrationTarget(queuedTarget) { + // TODO: This function shares a lot of logic with attemptToDispatchEvent. + // Try to unify them. It's a bit tricky since it would require two return + // values. + var targetInst = getClosestInstanceFromNode(queuedTarget.target); + + if (targetInst !== null) { + var nearestMounted = getNearestMountedFiber(targetInst); + + if (nearestMounted !== null) { + var tag = nearestMounted.tag; + + if (tag === SuspenseComponent) { + var instance = getSuspenseInstanceFromFiber(nearestMounted); + + if (instance !== null) { + // We're blocked on hydrating this boundary. + // Increase its priority. + queuedTarget.blockedOn = instance; + Scheduler.unstable_runWithPriority(queuedTarget.priority, function () { + attemptHydrationAtCurrentPriority(nearestMounted); + }); + return; + } + } else if (tag === HostRoot) { + var root = nearestMounted.stateNode; + + if (root.hydrate) { + queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of + // a root other than sync. + + return; + } + } + } + } + + queuedTarget.blockedOn = null; +} + +function attemptReplayContinuousQueuedEvent(queuedEvent) { + if (queuedEvent.blockedOn !== null) { + return false; + } + + var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.container, queuedEvent.nativeEvent); + + if (nextBlockedOn !== null) { + // We're still blocked. Try again later. + var _fiber3 = getInstanceFromNode$1(nextBlockedOn); + + if (_fiber3 !== null) { + attemptContinuousHydration(_fiber3); + } + + queuedEvent.blockedOn = nextBlockedOn; + return false; + } + + return true; +} + +function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) { + if (attemptReplayContinuousQueuedEvent(queuedEvent)) { + map.delete(key); + } +} + +function replayUnblockedEvents() { + hasScheduledReplayAttempt = false; // First replay discrete events. + + while (queuedDiscreteEvents.length > 0) { + var nextDiscreteEvent = queuedDiscreteEvents[0]; + + if (nextDiscreteEvent.blockedOn !== null) { + // We're still blocked. + // Increase the priority of this boundary to unblock + // the next discrete event. + var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn); + + if (_fiber4 !== null) { + attemptUserBlockingHydration(_fiber4); + } + + break; + } + + var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.container, nextDiscreteEvent.nativeEvent); + + if (nextBlockedOn !== null) { + // We're still blocked. Try again later. + nextDiscreteEvent.blockedOn = nextBlockedOn; + } else { + // We've successfully replayed the first event. Let's try the next one. + queuedDiscreteEvents.shift(); + } + } // Next replay any continuous events. + + + if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) { + queuedFocus = null; + } + + if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) { + queuedDrag = null; + } + + if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) { + queuedMouse = null; + } + + queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap); + queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap); +} + +function scheduleCallbackIfUnblocked(queuedEvent, unblocked) { + if (queuedEvent.blockedOn === unblocked) { + queuedEvent.blockedOn = null; + + if (!hasScheduledReplayAttempt) { + hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are + // now unblocked. This first might not actually be unblocked yet. + // We could check it early to avoid scheduling an unnecessary callback. + + Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents); + } + } +} + +function retryIfBlockedOn(unblocked) { + // Mark anything that was blocked on this as no longer blocked + // and eligible for a replay. + if (queuedDiscreteEvents.length > 0) { + scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's + // worth it because we expect very few discrete events to queue up and once + // we are actually fully unblocked it will be fast to replay them. + + for (var i = 1; i < queuedDiscreteEvents.length; i++) { + var queuedEvent = queuedDiscreteEvents[i]; + + if (queuedEvent.blockedOn === unblocked) { + queuedEvent.blockedOn = null; + } + } + } + + if (queuedFocus !== null) { + scheduleCallbackIfUnblocked(queuedFocus, unblocked); + } + + if (queuedDrag !== null) { + scheduleCallbackIfUnblocked(queuedDrag, unblocked); + } + + if (queuedMouse !== null) { + scheduleCallbackIfUnblocked(queuedMouse, unblocked); + } + + var unblock = function (queuedEvent) { + return scheduleCallbackIfUnblocked(queuedEvent, unblocked); + }; + + queuedPointers.forEach(unblock); + queuedPointerCaptures.forEach(unblock); + + for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) { + var queuedTarget = queuedExplicitHydrationTargets[_i]; + + if (queuedTarget.blockedOn === unblocked) { + queuedTarget.blockedOn = null; + } + } + + while (queuedExplicitHydrationTargets.length > 0) { + var nextExplicitTarget = queuedExplicitHydrationTargets[0]; + + if (nextExplicitTarget.blockedOn !== null) { + // We're still blocked. + break; + } else { + attemptExplicitHydrationTarget(nextExplicitTarget); + + if (nextExplicitTarget.blockedOn === null) { + // We're unblocked. + queuedExplicitHydrationTargets.shift(); + } + } + } +} + +function addEventBubbleListener(element, eventType, listener) { + element.addEventListener(eventType, listener, false); +} +function addEventCaptureListener(element, eventType, listener) { + element.addEventListener(eventType, listener, true); +} + +// do it in two places, which duplicates logic +// and increases the bundle size, we do it all +// here once. If we remove or refactor the +// SimpleEventPlugin, we should also remove or +// update the below line. + +var simpleEventPluginEventTypes = {}; +var topLevelEventsToDispatchConfig = new Map(); +var eventPriorities = new Map(); // We store most of the events in this module in pairs of two strings so we can re-use +// the code required to apply the same logic for event prioritization and that of the +// SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code +// duplication (for which there would be quite a bit). For the events that are not needed +// for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an +// array of top level events. +// Lastly, we ignore prettier so we can keep the formatting sane. +// prettier-ignore + +var discreteEventPairsForSimpleEventPlugin = [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 otherDiscreteEvents = [TOP_CHANGE, TOP_SELECTION_CHANGE, TOP_TEXT_INPUT, TOP_COMPOSITION_START, TOP_COMPOSITION_END, TOP_COMPOSITION_UPDATE]; // prettier-ignore + +var userBlockingPairsForSimpleEventPlugin = [TOP_DRAG, 'drag', TOP_DRAG_ENTER, 'dragEnter', TOP_DRAG_EXIT, 'dragExit', TOP_DRAG_LEAVE, 'dragLeave', TOP_DRAG_OVER, 'dragOver', TOP_MOUSE_MOVE, 'mouseMove', TOP_MOUSE_OUT, 'mouseOut', TOP_MOUSE_OVER, 'mouseOver', TOP_POINTER_MOVE, 'pointerMove', TOP_POINTER_OUT, 'pointerOut', TOP_POINTER_OVER, 'pointerOver', TOP_SCROLL, 'scroll', TOP_TOGGLE, 'toggle', TOP_TOUCH_MOVE, 'touchMove', TOP_WHEEL, 'wheel']; // prettier-ignore + +var continuousPairsForSimpleEventPlugin = [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_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_PLAYING, 'playing', TOP_PROGRESS, 'progress', TOP_SEEKING, 'seeking', TOP_STALLED, 'stalled', TOP_SUSPEND, 'suspend', TOP_TIME_UPDATE, 'timeUpdate', TOP_TRANSITION_END, 'transitionEnd', TOP_WAITING, 'waiting']; +/** + * Turns + * ['abort', ...] + * into + * eventTypes = { + * 'abort': { + * phasedRegistrationNames: { + * bubbled: 'onAbort', + * captured: 'onAbortCapture', + * }, + * dependencies: [TOP_ABORT], + * }, + * ... + * }; + * topLevelEventsToDispatchConfig = new Map([ + * [TOP_ABORT, { sameConfig }], + * ]); + */ + +function processSimpleEventPluginPairsByPriority(eventTypes, priority) { + // As the event types are in pairs of two, we need to iterate + // through in twos. The events are in pairs of two to save code + // and improve init perf of processing this array, as it will + // result in far fewer object allocations and property accesses + // if we only use three arrays to process all the categories of + // instead of tuples. + for (var i = 0; i < eventTypes.length; i += 2) { + var topEvent = eventTypes[i]; + var event = eventTypes[i + 1]; + var capitalizedEvent = event[0].toUpperCase() + event.slice(1); + var onEvent = 'on' + capitalizedEvent; + var config = { + phasedRegistrationNames: { + bubbled: onEvent, + captured: onEvent + 'Capture' + }, + dependencies: [topEvent], + eventPriority: priority + }; + eventPriorities.set(topEvent, priority); + topLevelEventsToDispatchConfig.set(topEvent, config); + simpleEventPluginEventTypes[event] = config; + } +} + +function processTopEventPairsByPriority(eventTypes, priority) { + for (var i = 0; i < eventTypes.length; i++) { + eventPriorities.set(eventTypes[i], priority); + } +} // SimpleEventPlugin + + +processSimpleEventPluginPairsByPriority(discreteEventPairsForSimpleEventPlugin, DiscreteEvent); +processSimpleEventPluginPairsByPriority(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent); +processSimpleEventPluginPairsByPriority(continuousPairsForSimpleEventPlugin, ContinuousEvent); // Not used by SimpleEventPlugin + +processTopEventPairsByPriority(otherDiscreteEvents, DiscreteEvent); +function getEventPriorityForPluginSystem(topLevelType) { + var priority = eventPriorities.get(topLevelType); // Default to a ContinuousEvent. Note: we might + // want to warn if we can't detect the priority + // for the event. + + return priority === undefined ? ContinuousEvent : priority; +} + +// Intentionally not named imports because Rollup would use dynamic dispatch for +var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + runWithPriority = Scheduler.unstable_runWithPriority; // TODO: can we stop exporting these? + +var _enabled = true; +function setEnabled(enabled) { + _enabled = !!enabled; +} +function isEnabled() { + return _enabled; +} +function trapBubbledEvent(topLevelType, element) { + trapEventForPluginEventSystem(element, topLevelType, false); +} +function trapCapturedEvent(topLevelType, element) { + trapEventForPluginEventSystem(element, topLevelType, true); +} + +function trapEventForPluginEventSystem(container, topLevelType, capture) { + var listener; + + switch (getEventPriorityForPluginSystem(topLevelType)) { + case DiscreteEvent: + listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container); + break; + + case UserBlockingEvent: + listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container); + break; + + case ContinuousEvent: + default: + listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM, container); + break; + } + + var rawEventName = getRawEventName(topLevelType); + + if (capture) { + addEventCaptureListener(container, rawEventName, listener); + } else { + addEventBubbleListener(container, rawEventName, listener); + } +} + +function dispatchDiscreteEvent(topLevelType, eventSystemFlags, container, nativeEvent) { + flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp); + discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, container, nativeEvent); +} + +function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, container, nativeEvent) { + runWithPriority(UserBlockingPriority, dispatchEvent.bind(null, topLevelType, eventSystemFlags, container, nativeEvent)); +} + +function dispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) { + if (!_enabled) { + return; + } + + if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) { + // If we already have a queue of discrete events, and this is another discrete + // event, then we can't dispatch it regardless of its target, since they + // need to dispatch in order. + queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know. + topLevelType, eventSystemFlags, container, nativeEvent); + return; + } + + var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent); + + if (blockedOn === null) { + // We successfully dispatched this event. + clearIfContinuousEvent(topLevelType, nativeEvent); + return; + } + + if (isReplayableDiscreteEvent(topLevelType)) { + // This this to be replayed later once the target is available. + queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent); + return; + } + + if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, container, nativeEvent)) { + return; + } // We need to clear only if we didn't queue because + // queueing is accummulative. + + + clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target, + // in case the event system needs to trace it. + + { + dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null); + } +} // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked. + +function attemptToDispatchEvent(topLevelType, eventSystemFlags, container, nativeEvent) { + // TODO: Warn if _enabled is false. + var nativeEventTarget = getEventTarget(nativeEvent); + var targetInst = getClosestInstanceFromNode(nativeEventTarget); + + if (targetInst !== null) { + var nearestMounted = getNearestMountedFiber(targetInst); + + if (nearestMounted === null) { + // This tree has been unmounted already. Dispatch without a target. + targetInst = null; + } else { + var tag = nearestMounted.tag; + + if (tag === SuspenseComponent) { + var instance = getSuspenseInstanceFromFiber(nearestMounted); + + if (instance !== null) { + // Queue the event to be replayed later. Abort dispatching since we + // don't want this event dispatched twice through the event system. + // TODO: If this is the first discrete event in the queue. Schedule an increased + // priority for this boundary. + return instance; + } // This shouldn't happen, something went wrong but to avoid blocking + // the whole system, dispatch the event without a target. + // TODO: Warn. + + + targetInst = null; + } else if (tag === HostRoot) { + var root = nearestMounted.stateNode; + + if (root.hydrate) { + // If this happens during a replay something went wrong and it might block + // the whole system. + return getContainerFromFiber(nearestMounted); + } + + targetInst = null; + } else if (nearestMounted !== 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; + } + } + } + + { + dispatchEventForLegacyPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst); + } // We're not blocked on anything. + + + return null; +} + +// List derived from Gecko source code: +// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js +var shorthandToLonghand = { + animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'], + background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'], + backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'], + border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'], + borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'], + borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'], + borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'], + borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'], + borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'], + borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'], + borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'], + borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'], + borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'], + borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'], + borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'], + borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'], + borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'], + columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'], + columns: ['columnCount', 'columnWidth'], + flex: ['flexBasis', 'flexGrow', 'flexShrink'], + flexFlow: ['flexDirection', 'flexWrap'], + font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'], + fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'], + gap: ['columnGap', 'rowGap'], + grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], + gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'], + gridColumn: ['gridColumnEnd', 'gridColumnStart'], + gridColumnGap: ['columnGap'], + gridGap: ['columnGap', 'rowGap'], + gridRow: ['gridRowEnd', 'gridRowStart'], + gridRowGap: ['rowGap'], + gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], + listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'], + margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'], + marker: ['markerEnd', 'markerMid', 'markerStart'], + mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'], + maskPosition: ['maskPositionX', 'maskPositionY'], + outline: ['outlineColor', 'outlineStyle', 'outlineWidth'], + overflow: ['overflowX', 'overflowY'], + padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'], + placeContent: ['alignContent', 'justifyContent'], + placeItems: ['alignItems', 'justifyItems'], + placeSelf: ['alignSelf', 'justifySelf'], + textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'], + textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'], + transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'], + wordWrap: ['overflowWrap'] +}; + +/** + * CSS properties which accept numbers but are not in units of "px". + */ +var isUnitlessNumber = { + animationIterationCount: true, + borderImageOutset: true, + borderImageSlice: true, + borderImageWidth: true, + boxFlex: true, + boxFlexGroup: true, + boxOrdinalGroup: true, + columnCount: true, + columns: true, + flex: true, + flexGrow: true, + flexPositive: true, + flexShrink: true, + flexNegative: true, + flexOrder: true, + gridArea: true, + gridRow: true, + gridRowEnd: true, + gridRowSpan: true, + gridRowStart: true, + gridColumn: true, + gridColumnEnd: true, + gridColumnSpan: true, + gridColumnStart: true, + fontWeight: true, + lineClamp: true, + lineHeight: true, + opacity: true, + order: true, + orphans: true, + tabSize: true, + widows: true, + zIndex: true, + zoom: true, + // SVG-related properties + fillOpacity: true, + floodOpacity: true, + stopOpacity: true, + strokeDasharray: true, + strokeDashoffset: true, + strokeMiterlimit: true, + strokeOpacity: true, + strokeWidth: true +}; +/** + * @param {string} prefix vendor-specific prefix, eg: Webkit + * @param {string} key style name, eg: transitionDuration + * @return {string} style name prefixed with `prefix`, properly camelCased, eg: + * WebkitTransitionDuration + */ + +function prefixKey(prefix, key) { + return prefix + key.charAt(0).toUpperCase() + key.substring(1); +} +/** + * Support style names that may come passed in prefixed by adding permutations + * of vendor prefixes. + */ + + +var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an +// infinite loop, because it iterates over the newly added props too. + +Object.keys(isUnitlessNumber).forEach(function (prop) { + prefixes.forEach(function (prefix) { + isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; + }); +}); + +/** + * Convert a value into the proper css writable value. The style name `name` + * should be logical (no hyphens), as specified + * in `CSSProperty.isUnitlessNumber`. + * + * @param {string} name CSS property name such as `topMargin`. + * @param {*} value CSS property value such as `10px`. + * @return {string} Normalized style value with dimensions applied. + */ + +function dangerousStyleValue(name, value, isCustomProperty) { + // Note that we've removed escapeTextForBrowser() calls here since the + // whole string will be escaped when the attribute is injected into + // the markup. If you provide unsafe user data here they can inject + // arbitrary CSS which may be problematic (I couldn't repro this): + // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet + // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ + // This is not an XSS hole but instead a potential CSS injection issue + // which has lead to a greater discussion about how we're going to + // trust URLs moving forward. See #2115901 + var isEmpty = value == null || typeof value === 'boolean' || value === ''; + + if (isEmpty) { + return ''; + } + + if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) { + return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers + } + + return ('' + value).trim(); +} + +var uppercasePattern = /([A-Z])/g; +var msPattern = /^ms-/; +/** + * Hyphenates a camelcased CSS property name, for example: + * + * > hyphenateStyleName('backgroundColor') + * < "background-color" + * > hyphenateStyleName('MozTransition') + * < "-moz-transition" + * > hyphenateStyleName('msTransition') + * < "-ms-transition" + * + * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix + * is converted to `-ms-`. + */ + +function hyphenateStyleName(name) { + return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); +} + +var warnValidStyle = function () {}; + +{ + // 'msTransform' is correct, but the other prefixes should be capitalized + var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; + var msPattern$1 = /^-ms-/; + var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon + + var badStyleValueWithSemicolonPattern = /;\s*$/; + var warnedStyleNames = {}; + var warnedStyleValues = {}; + var warnedForNaNValue = false; + var warnedForInfinityValue = false; + + var camelize = function (string) { + return string.replace(hyphenPattern, function (_, character) { + return character.toUpperCase(); + }); + }; + + var warnHyphenatedStyleName = function (name) { + if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { + return; + } + + warnedStyleNames[name] = true; + + error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests + // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix + // is converted to lowercase `ms`. + camelize(name.replace(msPattern$1, 'ms-'))); + }; + + var warnBadVendoredStyleName = function (name) { + if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { + return; + } + + warnedStyleNames[name] = true; + + error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); + }; + + var warnStyleValueWithSemicolon = function (name, value) { + if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { + return; + } + + warnedStyleValues[value] = true; + + error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); + }; + + var warnStyleValueIsNaN = function (name, value) { + if (warnedForNaNValue) { + return; + } + + warnedForNaNValue = true; + + error('`NaN` is an invalid value for the `%s` css style property.', name); + }; + + var warnStyleValueIsInfinity = function (name, value) { + if (warnedForInfinityValue) { + return; + } + + warnedForInfinityValue = true; + + error('`Infinity` is an invalid value for the `%s` css style property.', name); + }; + + warnValidStyle = function (name, value) { + if (name.indexOf('-') > -1) { + warnHyphenatedStyleName(name); + } else if (badVendoredStyleNamePattern.test(name)) { + warnBadVendoredStyleName(name); + } else if (badStyleValueWithSemicolonPattern.test(value)) { + warnStyleValueWithSemicolon(name, value); + } + + if (typeof value === 'number') { + if (isNaN(value)) { + warnStyleValueIsNaN(name, value); + } else if (!isFinite(value)) { + warnStyleValueIsInfinity(name, value); + } + } + }; +} + +var warnValidStyle$1 = warnValidStyle; + +/** + * Operations for dealing with CSS properties. + */ + +/** + * This creates a string that is expected to be equivalent to the style + * attribute generated by server-side rendering. It by-passes warnings and + * security checks so it's not safe to use this value for anything other than + * comparison. It is only used in DEV for SSR validation. + */ + +function createDangerousStringForStyles(styles) { + { + var serialized = ''; + var delimiter = ''; + + for (var styleName in styles) { + if (!styles.hasOwnProperty(styleName)) { + continue; + } + + var styleValue = styles[styleName]; + + if (styleValue != null) { + var isCustomProperty = styleName.indexOf('--') === 0; + serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':'; + serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty); + delimiter = ';'; + } + } + + return serialized || null; + } +} +/** + * Sets the value for multiple styles on a node. If a value is specified as + * '' (empty string), the corresponding style property will be unset. + * + * @param {DOMElement} node + * @param {object} styles + */ + +function setValueForStyles(node, styles) { + var style = node.style; + + for (var styleName in styles) { + if (!styles.hasOwnProperty(styleName)) { + continue; + } + + var isCustomProperty = styleName.indexOf('--') === 0; + + { + if (!isCustomProperty) { + warnValidStyle$1(styleName, styles[styleName]); + } + } + + var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); + + if (styleName === 'float') { + styleName = 'cssFloat'; + } + + if (isCustomProperty) { + style.setProperty(styleName, styleValue); + } else { + style[styleName] = styleValue; + } + } +} + +function isValueEmpty(value) { + return value == null || typeof value === 'boolean' || value === ''; +} +/** + * Given {color: 'red', overflow: 'hidden'} returns { + * color: 'color', + * overflowX: 'overflow', + * overflowY: 'overflow', + * }. This can be read as "the overflowY property was set by the overflow + * shorthand". That is, the values are the property that each was derived from. + */ + + +function expandShorthandMap(styles) { + var expanded = {}; + + for (var key in styles) { + var longhands = shorthandToLonghand[key] || [key]; + + for (var i = 0; i < longhands.length; i++) { + expanded[longhands[i]] = key; + } + } + + return expanded; +} +/** + * When mixing shorthand and longhand property names, we warn during updates if + * we expect an incorrect result to occur. In particular, we warn for: + * + * Updating a shorthand property (longhand gets overwritten): + * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} + * becomes .style.font = 'baz' + * Removing a shorthand property (longhand gets lost too): + * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'} + * becomes .style.font = '' + * Removing a longhand property (should revert to shorthand; doesn't): + * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'} + * becomes .style.fontVariant = '' + */ + + +function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) { + { + + if (!nextStyles) { + return; + } + + var expandedUpdates = expandShorthandMap(styleUpdates); + var expandedStyles = expandShorthandMap(nextStyles); + var warnedAbout = {}; + + for (var key in expandedUpdates) { + var originalKey = expandedUpdates[key]; + var correctOriginalKey = expandedStyles[key]; + + if (correctOriginalKey && originalKey !== correctOriginalKey) { + var warningKey = originalKey + ',' + correctOriginalKey; + + if (warnedAbout[warningKey]) { + continue; + } + + warnedAbout[warningKey] = true; + + error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey); + } + } + } +} + +// For HTML, certain tags should omit their close tag. We keep a whitelist for +// those special-case tags. +var omittedCloseTags = { + area: true, + base: true, + br: true, + col: true, + embed: true, + hr: true, + img: true, + input: true, + keygen: true, + link: true, + meta: true, + param: true, + source: true, + track: true, + wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems. + +}; + +// `omittedCloseTags` except that `menuitem` should still have its closing tag. + +var voidElementTags = _assign({ + menuitem: true +}, omittedCloseTags); + +var HTML = '__html'; +var ReactDebugCurrentFrame$3 = null; + +{ + ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame; +} + +function assertValidProps(tag, props) { + if (!props) { + return; + } // Note the use of `==` which checks for null or undefined. + + + if (voidElementTags[tag]) { + if (!(props.children == null && props.dangerouslySetInnerHTML == null)) { + { + throw Error( tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) ); + } + } + } + + if (props.dangerouslySetInnerHTML != null) { + if (!(props.children == null)) { + { + throw Error( "Can only set one of `children` or `props.dangerouslySetInnerHTML`." ); + } + } + + if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) { + { + throw Error( "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information." ); + } + } + } + + { + if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) { + error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.'); + } + } + + if (!(props.style == null || typeof props.style === 'object')) { + { + throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) ); + } + } +} + +function isCustomComponent(tagName, props) { + if (tagName.indexOf('-') === -1) { + return typeof props.is === 'string'; + } + + switch (tagName) { + // These are reserved SVG and MathML elements. + // We don't mind this whitelist too much because we expect it to never grow. + // The alternative is to track the namespace in a few places which is convoluted. + // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts + 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 false; + + default: + return true; + } +} + +// When adding attributes to the HTML or SVG whitelist, be sure to +// also add them to this module to ensure casing and incorrect name +// warnings. +var possibleStandardNames = { + // HTML + accept: 'accept', + acceptcharset: 'acceptCharset', + 'accept-charset': 'acceptCharset', + accesskey: 'accessKey', + action: 'action', + allowfullscreen: 'allowFullScreen', + alt: 'alt', + as: 'as', + async: 'async', + autocapitalize: 'autoCapitalize', + autocomplete: 'autoComplete', + autocorrect: 'autoCorrect', + autofocus: 'autoFocus', + autoplay: 'autoPlay', + autosave: 'autoSave', + capture: 'capture', + cellpadding: 'cellPadding', + cellspacing: 'cellSpacing', + challenge: 'challenge', + charset: 'charSet', + checked: 'checked', + children: 'children', + cite: 'cite', + class: 'className', + classid: 'classID', + classname: 'className', + cols: 'cols', + colspan: 'colSpan', + content: 'content', + contenteditable: 'contentEditable', + contextmenu: 'contextMenu', + controls: 'controls', + controlslist: 'controlsList', + coords: 'coords', + crossorigin: 'crossOrigin', + dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', + data: 'data', + datetime: 'dateTime', + default: 'default', + defaultchecked: 'defaultChecked', + defaultvalue: 'defaultValue', + defer: 'defer', + dir: 'dir', + disabled: 'disabled', + disablepictureinpicture: 'disablePictureInPicture', + download: 'download', + draggable: 'draggable', + enctype: 'encType', + for: 'htmlFor', + form: 'form', + formmethod: 'formMethod', + formaction: 'formAction', + formenctype: 'formEncType', + formnovalidate: 'formNoValidate', + formtarget: 'formTarget', + frameborder: 'frameBorder', + headers: 'headers', + height: 'height', + hidden: 'hidden', + high: 'high', + href: 'href', + hreflang: 'hrefLang', + htmlfor: 'htmlFor', + httpequiv: 'httpEquiv', + 'http-equiv': 'httpEquiv', + icon: 'icon', + id: 'id', + innerhtml: 'innerHTML', + inputmode: 'inputMode', + integrity: 'integrity', + is: 'is', + itemid: 'itemID', + itemprop: 'itemProp', + itemref: 'itemRef', + itemscope: 'itemScope', + itemtype: 'itemType', + keyparams: 'keyParams', + keytype: 'keyType', + kind: 'kind', + label: 'label', + lang: 'lang', + list: 'list', + loop: 'loop', + low: 'low', + manifest: 'manifest', + marginwidth: 'marginWidth', + marginheight: 'marginHeight', + max: 'max', + maxlength: 'maxLength', + media: 'media', + mediagroup: 'mediaGroup', + method: 'method', + min: 'min', + minlength: 'minLength', + multiple: 'multiple', + muted: 'muted', + name: 'name', + nomodule: 'noModule', + nonce: 'nonce', + novalidate: 'noValidate', + open: 'open', + optimum: 'optimum', + pattern: 'pattern', + placeholder: 'placeholder', + playsinline: 'playsInline', + poster: 'poster', + preload: 'preload', + profile: 'profile', + radiogroup: 'radioGroup', + readonly: 'readOnly', + referrerpolicy: 'referrerPolicy', + rel: 'rel', + required: 'required', + reversed: 'reversed', + role: 'role', + rows: 'rows', + rowspan: 'rowSpan', + sandbox: 'sandbox', + scope: 'scope', + scoped: 'scoped', + scrolling: 'scrolling', + seamless: 'seamless', + selected: 'selected', + shape: 'shape', + size: 'size', + sizes: 'sizes', + span: 'span', + spellcheck: 'spellCheck', + src: 'src', + srcdoc: 'srcDoc', + srclang: 'srcLang', + srcset: 'srcSet', + start: 'start', + step: 'step', + style: 'style', + summary: 'summary', + tabindex: 'tabIndex', + target: 'target', + title: 'title', + type: 'type', + usemap: 'useMap', + value: 'value', + width: 'width', + wmode: 'wmode', + wrap: 'wrap', + // SVG + about: 'about', + accentheight: 'accentHeight', + 'accent-height': 'accentHeight', + accumulate: 'accumulate', + additive: 'additive', + alignmentbaseline: 'alignmentBaseline', + 'alignment-baseline': 'alignmentBaseline', + allowreorder: 'allowReorder', + alphabetic: 'alphabetic', + amplitude: 'amplitude', + arabicform: 'arabicForm', + 'arabic-form': 'arabicForm', + ascent: 'ascent', + attributename: 'attributeName', + attributetype: 'attributeType', + autoreverse: 'autoReverse', + azimuth: 'azimuth', + basefrequency: 'baseFrequency', + baselineshift: 'baselineShift', + 'baseline-shift': 'baselineShift', + baseprofile: 'baseProfile', + bbox: 'bbox', + begin: 'begin', + bias: 'bias', + by: 'by', + calcmode: 'calcMode', + capheight: 'capHeight', + 'cap-height': 'capHeight', + clip: 'clip', + clippath: 'clipPath', + 'clip-path': 'clipPath', + clippathunits: 'clipPathUnits', + cliprule: 'clipRule', + 'clip-rule': 'clipRule', + color: 'color', + colorinterpolation: 'colorInterpolation', + 'color-interpolation': 'colorInterpolation', + colorinterpolationfilters: 'colorInterpolationFilters', + 'color-interpolation-filters': 'colorInterpolationFilters', + colorprofile: 'colorProfile', + 'color-profile': 'colorProfile', + colorrendering: 'colorRendering', + 'color-rendering': 'colorRendering', + contentscripttype: 'contentScriptType', + contentstyletype: 'contentStyleType', + cursor: 'cursor', + cx: 'cx', + cy: 'cy', + d: 'd', + datatype: 'datatype', + decelerate: 'decelerate', + descent: 'descent', + diffuseconstant: 'diffuseConstant', + direction: 'direction', + display: 'display', + divisor: 'divisor', + dominantbaseline: 'dominantBaseline', + 'dominant-baseline': 'dominantBaseline', + dur: 'dur', + dx: 'dx', + dy: 'dy', + edgemode: 'edgeMode', + elevation: 'elevation', + enablebackground: 'enableBackground', + 'enable-background': 'enableBackground', + end: 'end', + exponent: 'exponent', + externalresourcesrequired: 'externalResourcesRequired', + fill: 'fill', + fillopacity: 'fillOpacity', + 'fill-opacity': 'fillOpacity', + fillrule: 'fillRule', + 'fill-rule': 'fillRule', + filter: 'filter', + filterres: 'filterRes', + filterunits: 'filterUnits', + floodopacity: 'floodOpacity', + 'flood-opacity': 'floodOpacity', + floodcolor: 'floodColor', + 'flood-color': 'floodColor', + focusable: 'focusable', + fontfamily: 'fontFamily', + 'font-family': 'fontFamily', + fontsize: 'fontSize', + 'font-size': 'fontSize', + fontsizeadjust: 'fontSizeAdjust', + 'font-size-adjust': 'fontSizeAdjust', + fontstretch: 'fontStretch', + 'font-stretch': 'fontStretch', + fontstyle: 'fontStyle', + 'font-style': 'fontStyle', + fontvariant: 'fontVariant', + 'font-variant': 'fontVariant', + fontweight: 'fontWeight', + 'font-weight': 'fontWeight', + format: 'format', + from: 'from', + fx: 'fx', + fy: 'fy', + g1: 'g1', + g2: 'g2', + glyphname: 'glyphName', + 'glyph-name': 'glyphName', + glyphorientationhorizontal: 'glyphOrientationHorizontal', + 'glyph-orientation-horizontal': 'glyphOrientationHorizontal', + glyphorientationvertical: 'glyphOrientationVertical', + 'glyph-orientation-vertical': 'glyphOrientationVertical', + glyphref: 'glyphRef', + gradienttransform: 'gradientTransform', + gradientunits: 'gradientUnits', + hanging: 'hanging', + horizadvx: 'horizAdvX', + 'horiz-adv-x': 'horizAdvX', + horizoriginx: 'horizOriginX', + 'horiz-origin-x': 'horizOriginX', + ideographic: 'ideographic', + imagerendering: 'imageRendering', + 'image-rendering': 'imageRendering', + in2: 'in2', + in: 'in', + inlist: 'inlist', + intercept: 'intercept', + k1: 'k1', + k2: 'k2', + k3: 'k3', + k4: 'k4', + k: 'k', + kernelmatrix: 'kernelMatrix', + kernelunitlength: 'kernelUnitLength', + kerning: 'kerning', + keypoints: 'keyPoints', + keysplines: 'keySplines', + keytimes: 'keyTimes', + lengthadjust: 'lengthAdjust', + letterspacing: 'letterSpacing', + 'letter-spacing': 'letterSpacing', + lightingcolor: 'lightingColor', + 'lighting-color': 'lightingColor', + limitingconeangle: 'limitingConeAngle', + local: 'local', + markerend: 'markerEnd', + 'marker-end': 'markerEnd', + markerheight: 'markerHeight', + markermid: 'markerMid', + 'marker-mid': 'markerMid', + markerstart: 'markerStart', + 'marker-start': 'markerStart', + markerunits: 'markerUnits', + markerwidth: 'markerWidth', + mask: 'mask', + maskcontentunits: 'maskContentUnits', + maskunits: 'maskUnits', + mathematical: 'mathematical', + mode: 'mode', + numoctaves: 'numOctaves', + offset: 'offset', + opacity: 'opacity', + operator: 'operator', + order: 'order', + orient: 'orient', + orientation: 'orientation', + origin: 'origin', + overflow: 'overflow', + overlineposition: 'overlinePosition', + 'overline-position': 'overlinePosition', + overlinethickness: 'overlineThickness', + 'overline-thickness': 'overlineThickness', + paintorder: 'paintOrder', + 'paint-order': 'paintOrder', + panose1: 'panose1', + 'panose-1': 'panose1', + pathlength: 'pathLength', + patterncontentunits: 'patternContentUnits', + patterntransform: 'patternTransform', + patternunits: 'patternUnits', + pointerevents: 'pointerEvents', + 'pointer-events': 'pointerEvents', + points: 'points', + pointsatx: 'pointsAtX', + pointsaty: 'pointsAtY', + pointsatz: 'pointsAtZ', + prefix: 'prefix', + preservealpha: 'preserveAlpha', + preserveaspectratio: 'preserveAspectRatio', + primitiveunits: 'primitiveUnits', + property: 'property', + r: 'r', + radius: 'radius', + refx: 'refX', + refy: 'refY', + renderingintent: 'renderingIntent', + 'rendering-intent': 'renderingIntent', + repeatcount: 'repeatCount', + repeatdur: 'repeatDur', + requiredextensions: 'requiredExtensions', + requiredfeatures: 'requiredFeatures', + resource: 'resource', + restart: 'restart', + result: 'result', + results: 'results', + rotate: 'rotate', + rx: 'rx', + ry: 'ry', + scale: 'scale', + security: 'security', + seed: 'seed', + shaperendering: 'shapeRendering', + 'shape-rendering': 'shapeRendering', + slope: 'slope', + spacing: 'spacing', + specularconstant: 'specularConstant', + specularexponent: 'specularExponent', + speed: 'speed', + spreadmethod: 'spreadMethod', + startoffset: 'startOffset', + stddeviation: 'stdDeviation', + stemh: 'stemh', + stemv: 'stemv', + stitchtiles: 'stitchTiles', + stopcolor: 'stopColor', + 'stop-color': 'stopColor', + stopopacity: 'stopOpacity', + 'stop-opacity': 'stopOpacity', + strikethroughposition: 'strikethroughPosition', + 'strikethrough-position': 'strikethroughPosition', + strikethroughthickness: 'strikethroughThickness', + 'strikethrough-thickness': 'strikethroughThickness', + string: 'string', + stroke: 'stroke', + strokedasharray: 'strokeDasharray', + 'stroke-dasharray': 'strokeDasharray', + strokedashoffset: 'strokeDashoffset', + 'stroke-dashoffset': 'strokeDashoffset', + strokelinecap: 'strokeLinecap', + 'stroke-linecap': 'strokeLinecap', + strokelinejoin: 'strokeLinejoin', + 'stroke-linejoin': 'strokeLinejoin', + strokemiterlimit: 'strokeMiterlimit', + 'stroke-miterlimit': 'strokeMiterlimit', + strokewidth: 'strokeWidth', + 'stroke-width': 'strokeWidth', + strokeopacity: 'strokeOpacity', + 'stroke-opacity': 'strokeOpacity', + suppresscontenteditablewarning: 'suppressContentEditableWarning', + suppresshydrationwarning: 'suppressHydrationWarning', + surfacescale: 'surfaceScale', + systemlanguage: 'systemLanguage', + tablevalues: 'tableValues', + targetx: 'targetX', + targety: 'targetY', + textanchor: 'textAnchor', + 'text-anchor': 'textAnchor', + textdecoration: 'textDecoration', + 'text-decoration': 'textDecoration', + textlength: 'textLength', + textrendering: 'textRendering', + 'text-rendering': 'textRendering', + to: 'to', + transform: 'transform', + typeof: 'typeof', + u1: 'u1', + u2: 'u2', + underlineposition: 'underlinePosition', + 'underline-position': 'underlinePosition', + underlinethickness: 'underlineThickness', + 'underline-thickness': 'underlineThickness', + unicode: 'unicode', + unicodebidi: 'unicodeBidi', + 'unicode-bidi': 'unicodeBidi', + unicoderange: 'unicodeRange', + 'unicode-range': 'unicodeRange', + unitsperem: 'unitsPerEm', + 'units-per-em': 'unitsPerEm', + unselectable: 'unselectable', + valphabetic: 'vAlphabetic', + 'v-alphabetic': 'vAlphabetic', + values: 'values', + vectoreffect: 'vectorEffect', + 'vector-effect': 'vectorEffect', + version: 'version', + vertadvy: 'vertAdvY', + 'vert-adv-y': 'vertAdvY', + vertoriginx: 'vertOriginX', + 'vert-origin-x': 'vertOriginX', + vertoriginy: 'vertOriginY', + 'vert-origin-y': 'vertOriginY', + vhanging: 'vHanging', + 'v-hanging': 'vHanging', + videographic: 'vIdeographic', + 'v-ideographic': 'vIdeographic', + viewbox: 'viewBox', + viewtarget: 'viewTarget', + visibility: 'visibility', + vmathematical: 'vMathematical', + 'v-mathematical': 'vMathematical', + vocab: 'vocab', + widths: 'widths', + wordspacing: 'wordSpacing', + 'word-spacing': 'wordSpacing', + writingmode: 'writingMode', + 'writing-mode': 'writingMode', + x1: 'x1', + x2: 'x2', + x: 'x', + xchannelselector: 'xChannelSelector', + xheight: 'xHeight', + 'x-height': 'xHeight', + xlinkactuate: 'xlinkActuate', + 'xlink:actuate': 'xlinkActuate', + xlinkarcrole: 'xlinkArcrole', + 'xlink:arcrole': 'xlinkArcrole', + xlinkhref: 'xlinkHref', + 'xlink:href': 'xlinkHref', + xlinkrole: 'xlinkRole', + 'xlink:role': 'xlinkRole', + xlinkshow: 'xlinkShow', + 'xlink:show': 'xlinkShow', + xlinktitle: 'xlinkTitle', + 'xlink:title': 'xlinkTitle', + xlinktype: 'xlinkType', + 'xlink:type': 'xlinkType', + xmlbase: 'xmlBase', + 'xml:base': 'xmlBase', + xmllang: 'xmlLang', + 'xml:lang': 'xmlLang', + xmlns: 'xmlns', + 'xml:space': 'xmlSpace', + xmlnsxlink: 'xmlnsXlink', + 'xmlns:xlink': 'xmlnsXlink', + xmlspace: 'xmlSpace', + y1: 'y1', + y2: 'y2', + y: 'y', + ychannelselector: 'yChannelSelector', + z: 'z', + zoomandpan: 'zoomAndPan' +}; + +var ariaProperties = { + 'aria-current': 0, + // state + 'aria-details': 0, + 'aria-disabled': 0, + // state + 'aria-hidden': 0, + // state + 'aria-invalid': 0, + // state + 'aria-keyshortcuts': 0, + 'aria-label': 0, + 'aria-roledescription': 0, + // Widget Attributes + 'aria-autocomplete': 0, + 'aria-checked': 0, + 'aria-expanded': 0, + 'aria-haspopup': 0, + 'aria-level': 0, + 'aria-modal': 0, + 'aria-multiline': 0, + 'aria-multiselectable': 0, + 'aria-orientation': 0, + 'aria-placeholder': 0, + 'aria-pressed': 0, + 'aria-readonly': 0, + 'aria-required': 0, + 'aria-selected': 0, + 'aria-sort': 0, + 'aria-valuemax': 0, + 'aria-valuemin': 0, + 'aria-valuenow': 0, + 'aria-valuetext': 0, + // Live Region Attributes + 'aria-atomic': 0, + 'aria-busy': 0, + 'aria-live': 0, + 'aria-relevant': 0, + // Drag-and-Drop Attributes + 'aria-dropeffect': 0, + 'aria-grabbed': 0, + // Relationship Attributes + 'aria-activedescendant': 0, + 'aria-colcount': 0, + 'aria-colindex': 0, + 'aria-colspan': 0, + 'aria-controls': 0, + 'aria-describedby': 0, + 'aria-errormessage': 0, + 'aria-flowto': 0, + 'aria-labelledby': 0, + 'aria-owns': 0, + 'aria-posinset': 0, + 'aria-rowcount': 0, + 'aria-rowindex': 0, + 'aria-rowspan': 0, + 'aria-setsize': 0 +}; + +var warnedProperties = {}; +var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); +var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); +var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + +function validateProperty(tagName, name) { + { + if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) { + return true; + } + + if (rARIACamel.test(name)) { + var ariaName = 'aria-' + name.slice(4).toLowerCase(); + var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM + // DOM properties, then it is an invalid aria-* attribute. + + if (correctName == null) { + error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); + + warnedProperties[name] = true; + return true; + } // aria-* attributes should be lowercase; suggest the lowercase version. + + + if (name !== correctName) { + error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); + + warnedProperties[name] = true; + return true; + } + } + + if (rARIA.test(name)) { + var lowerCasedName = name.toLowerCase(); + var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM + // DOM properties, then it is an invalid aria-* attribute. + + if (standardName == null) { + warnedProperties[name] = true; + return false; + } // aria-* attributes should be lowercase; suggest the lowercase version. + + + if (name !== standardName) { + error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); + + warnedProperties[name] = true; + return true; + } + } + } + + return true; +} + +function warnInvalidARIAProps(type, props) { + { + var invalidProps = []; + + for (var key in props) { + var isValid = validateProperty(type, key); + + if (!isValid) { + invalidProps.push(key); + } + } + + var unknownPropString = invalidProps.map(function (prop) { + return '`' + prop + '`'; + }).join(', '); + + if (invalidProps.length === 1) { + error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); + } else if (invalidProps.length > 1) { + error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type); + } + } +} + +function validateProperties(type, props) { + if (isCustomComponent(type, props)) { + return; + } + + warnInvalidARIAProps(type, props); +} + +var didWarnValueNull = false; +function validateProperties$1(type, props) { + { + if (type !== 'input' && type !== 'textarea' && type !== 'select') { + return; + } + + if (props != null && props.value === null && !didWarnValueNull) { + didWarnValueNull = true; + + if (type === 'select' && props.multiple) { + error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type); + } else { + error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); + } + } + } +} + +var validateProperty$1 = function () {}; + +{ + var warnedProperties$1 = {}; + var _hasOwnProperty = Object.prototype.hasOwnProperty; + var EVENT_NAME_REGEX = /^on./; + var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; + var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); + var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); + + validateProperty$1 = function (tagName, name, value, canUseEventSystem) { + if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) { + return true; + } + + var lowerCasedName = name.toLowerCase(); + + if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { + error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.'); + + warnedProperties$1[name] = true; + return true; + } // We can't rely on the event system being injected on the server. + + + if (canUseEventSystem) { + if (registrationNameModules.hasOwnProperty(name)) { + return true; + } + + var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; + + if (registrationName != null) { + error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); + + warnedProperties$1[name] = true; + return true; + } + + if (EVENT_NAME_REGEX.test(name)) { + error('Unknown event handler property `%s`. It will be ignored.', name); + + warnedProperties$1[name] = true; + return true; + } + } else if (EVENT_NAME_REGEX.test(name)) { + // If no event plugins have been injected, we are in a server environment. + // So we can't tell if the event name is correct for sure, but we can filter + // out known bad ones like `onclick`. We can't suggest a specific replacement though. + if (INVALID_EVENT_NAME_REGEX.test(name)) { + error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); + } + + warnedProperties$1[name] = true; + return true; + } // Let the ARIA attribute hook validate ARIA attributes + + + if (rARIA$1.test(name) || rARIACamel$1.test(name)) { + return true; + } + + if (lowerCasedName === 'innerhtml') { + error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); + + warnedProperties$1[name] = true; + return true; + } + + if (lowerCasedName === 'aria') { + error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); + + warnedProperties$1[name] = true; + return true; + } + + if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') { + error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); + + warnedProperties$1[name] = true; + return true; + } + + if (typeof value === 'number' && isNaN(value)) { + error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); + + warnedProperties$1[name] = true; + return true; + } + + var propertyInfo = getPropertyInfo(name); + var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config. + + if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { + var standardName = possibleStandardNames[lowerCasedName]; + + if (standardName !== name) { + error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); + + warnedProperties$1[name] = true; + return true; + } + } else if (!isReserved && name !== lowerCasedName) { + // Unknown attributes should have lowercase casing since that's how they + // will be cased anyway with server rendering. + error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName); + + warnedProperties$1[name] = true; + return true; + } + + if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { + if (value) { + error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name); + } else { + error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name); + } + + warnedProperties$1[name] = true; + return true; + } // Now that we've validated casing, do not validate + // data types for reserved props + + + if (isReserved) { + return true; + } // Warn when a known attribute is a bad type + + + if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { + warnedProperties$1[name] = true; + return false; + } // Warn when passing the strings 'false' or 'true' into a boolean prop + + + if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) { + error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value); + + warnedProperties$1[name] = true; + return true; + } + + return true; + }; +} + +var warnUnknownProperties = function (type, props, canUseEventSystem) { + { + var unknownProps = []; + + for (var key in props) { + var isValid = validateProperty$1(type, key, props[key], canUseEventSystem); + + if (!isValid) { + unknownProps.push(key); + } + } + + var unknownPropString = unknownProps.map(function (prop) { + return '`' + prop + '`'; + }).join(', '); + + if (unknownProps.length === 1) { + error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type); + } else if (unknownProps.length > 1) { + error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type); + } + } +}; + +function validateProperties$2(type, props, canUseEventSystem) { + if (isCustomComponent(type, props)) { + return; + } + + warnUnknownProperties(type, props, canUseEventSystem); +} + +var didWarnInvalidHydration = false; +var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML'; +var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning'; +var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning'; +var AUTOFOCUS = 'autoFocus'; +var CHILDREN = 'children'; +var STYLE = 'style'; +var HTML$1 = '__html'; +var HTML_NAMESPACE$1 = Namespaces.html; +var warnedUnknownTags; +var suppressHydrationWarning; +var validatePropertiesInDevelopment; +var warnForTextDifference; +var warnForPropDifference; +var warnForExtraAttributes; +var warnForInvalidEventListener; +var canDiffStyleForHydrationWarning; +var normalizeMarkupForTextOrAttribute; +var normalizeHTML; + +{ + warnedUnknownTags = { + // Chrome is the only major browser not shipping <time>. But as of July + // 2017 it intends to ship it due to widespread usage. We intentionally + // *don't* warn for <time> even if it's unrecognized by Chrome because + // it soon will be, and many apps have been using it anyway. + time: true, + // There are working polyfills for <dialog>. Let people use it. + dialog: true, + // Electron ships a custom <webview> tag to display external web content in + // an isolated frame and process. + // This tag is not present in non Electron environments such as JSDom which + // is often used for testing purposes. + // @see https://electronjs.org/docs/api/webview-tag + webview: true + }; + + validatePropertiesInDevelopment = function (type, props) { + validateProperties(type, props); + validateProperties$1(type, props); + validateProperties$2(type, props, + /* canUseEventSystem */ + true); + }; // IE 11 parses & normalizes the style attribute as opposed to other + // browsers. It adds spaces and sorts the properties in some + // non-alphabetical order. Handling that would require sorting CSS + // properties in the client & server versions or applying + // `expectedStyle` to a temporary DOM node to read its `style` attribute + // normalized. Since it only affects IE, we're skipping style warnings + // in that browser completely in favor of doing all that work. + // See https://github.com/facebook/react/issues/11807 + + + canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF. + // It also can turn \u0000 into \uFFFD inside attributes. + // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream + // If we have a mismatch, it might be caused by that. + // We will still patch up in this case but not fire the warning. + + var NORMALIZE_NEWLINES_REGEX = /\r\n?/g; + var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g; + + normalizeMarkupForTextOrAttribute = function (markup) { + var markupString = typeof markup === 'string' ? markup : '' + markup; + return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, ''); + }; + + warnForTextDifference = function (serverText, clientText) { + if (didWarnInvalidHydration) { + return; + } + + var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText); + var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText); + + if (normalizedServerText === normalizedClientText) { + return; + } + + didWarnInvalidHydration = true; + + error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText); + }; + + warnForPropDifference = function (propName, serverValue, clientValue) { + if (didWarnInvalidHydration) { + return; + } + + var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue); + var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue); + + if (normalizedServerValue === normalizedClientValue) { + return; + } + + didWarnInvalidHydration = true; + + error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue)); + }; + + warnForExtraAttributes = function (attributeNames) { + if (didWarnInvalidHydration) { + return; + } + + didWarnInvalidHydration = true; + var names = []; + attributeNames.forEach(function (name) { + names.push(name); + }); + + error('Extra attributes from the server: %s', names); + }; + + warnForInvalidEventListener = function (registrationName, listener) { + if (listener === false) { + error('Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName); + } else { + error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener); + } + }; // Parse the HTML and read it back to normalize the HTML string so that it + // can be used for comparison. + + + normalizeHTML = function (parent, html) { + // We could have created a separate document here to avoid + // re-initializing custom elements if they exist. But this breaks + // how <noscript> is being handled. So we use the same document. + // See the discussion in https://github.com/facebook/react/pull/11157. + var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName); + testElement.innerHTML = html; + return testElement.innerHTML; + }; +} + +function ensureListeningTo(rootContainerElement, registrationName) { + var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE; + var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument; + legacyListenToEvent(registrationName, doc); +} + +function getOwnerDocumentFromRootContainer(rootContainerElement) { + return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument; +} + +function noop() {} + +function trapClickOnNonInteractiveElement(node) { + // Mobile Safari does not fire properly bubble click events on + // non-interactive elements, which means delegated click listeners do not + // fire. The workaround for this bug involves attaching an empty click + // listener on the target node. + // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html + // Just set it using the onclick property so that we don't have to manage any + // bookkeeping for it. Not sure if we need to clear it when the listener is + // removed. + // TODO: Only do this for the relevant Safaris maybe? + node.onclick = noop; +} + +function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) { + for (var propKey in nextProps) { + if (!nextProps.hasOwnProperty(propKey)) { + continue; + } + + var nextProp = nextProps[propKey]; + + if (propKey === STYLE) { + { + if (nextProp) { + // Freeze the next style object so that we can assume it won't be + // mutated. We have already warned for this in the past. + Object.freeze(nextProp); + } + } // Relies on `updateStylesByID` not mutating `styleUpdates`. + + + setValueForStyles(domElement, nextProp); + } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { + var nextHtml = nextProp ? nextProp[HTML$1] : undefined; + + if (nextHtml != null) { + setInnerHTML(domElement, nextHtml); + } + } else if (propKey === CHILDREN) { + if (typeof nextProp === 'string') { + // Avoid setting initial textContent when the text is empty. In IE11 setting + // textContent on a <textarea> will cause the placeholder to not + // show within the <textarea> until it has been focused and blurred again. + // https://github.com/facebook/react/issues/6731#issuecomment-254874553 + var canSetTextContent = tag !== 'textarea' || nextProp !== ''; + + if (canSetTextContent) { + setTextContent(domElement, nextProp); + } + } else if (typeof nextProp === 'number') { + setTextContent(domElement, '' + nextProp); + } + } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) { + if (nextProp != null) { + if ( typeof nextProp !== 'function') { + warnForInvalidEventListener(propKey, nextProp); + } + + ensureListeningTo(rootContainerElement, propKey); + } + } else if (nextProp != null) { + setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag); + } + } +} + +function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) { + // TODO: Handle wasCustomComponentTag + for (var i = 0; i < updatePayload.length; i += 2) { + var propKey = updatePayload[i]; + var propValue = updatePayload[i + 1]; + + if (propKey === STYLE) { + setValueForStyles(domElement, propValue); + } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { + setInnerHTML(domElement, propValue); + } else if (propKey === CHILDREN) { + setTextContent(domElement, propValue); + } else { + setValueForProperty(domElement, propKey, propValue, isCustomComponentTag); + } + } +} + +function createElement(type, props, rootContainerElement, parentNamespace) { + var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML + // tags get no namespace. + + var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement); + var domElement; + var namespaceURI = parentNamespace; + + if (namespaceURI === HTML_NAMESPACE$1) { + namespaceURI = getIntrinsicNamespace(type); + } + + if (namespaceURI === HTML_NAMESPACE$1) { + { + isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to + // allow <SVG> or <mATH>. + + if (!isCustomComponentTag && type !== type.toLowerCase()) { + error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type); + } + } + + if (type === 'script') { + // Create the script via .innerHTML so its "parser-inserted" flag is + // set to true and it does not execute + var div = ownerDocument.createElement('div'); + + div.innerHTML = '<script><' + '/script>'; // eslint-disable-line + // This is guaranteed to yield a script element. + + var firstChild = div.firstChild; + domElement = div.removeChild(firstChild); + } else if (typeof props.is === 'string') { + // $FlowIssue `createElement` should be updated for Web Components + domElement = ownerDocument.createElement(type, { + is: props.is + }); + } else { + // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug. + // See discussion in https://github.com/facebook/react/pull/6896 + // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240 + domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size` + // attributes on `select`s needs to be added before `option`s are inserted. + // This prevents: + // - a bug where the `select` does not scroll to the correct option because singular + // `select` elements automatically pick the first item #13222 + // - a bug where the `select` set the first item as selected despite the `size` attribute #14239 + // See https://github.com/facebook/react/issues/13222 + // and https://github.com/facebook/react/issues/14239 + + if (type === 'select') { + var node = domElement; + + if (props.multiple) { + node.multiple = true; + } else if (props.size) { + // Setting a size greater than 1 causes a select to behave like `multiple=true`, where + // it is possible that no option is selected. + // + // This is only necessary when a select in "single selection mode". + node.size = props.size; + } + } + } + } else { + domElement = ownerDocument.createElementNS(namespaceURI, type); + } + + { + if (namespaceURI === HTML_NAMESPACE$1) { + if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) { + warnedUnknownTags[type] = true; + + error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type); + } + } + } + + return domElement; +} +function createTextNode(text, rootContainerElement) { + return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text); +} +function setInitialProperties(domElement, tag, rawProps, rootContainerElement) { + var isCustomComponentTag = isCustomComponent(tag, rawProps); + + { + validatePropertiesInDevelopment(tag, rawProps); + } // TODO: Make sure that we check isMounted before firing any of these events. + + + var props; + + switch (tag) { + case 'iframe': + case 'object': + case 'embed': + trapBubbledEvent(TOP_LOAD, domElement); + props = rawProps; + break; + + case 'video': + case 'audio': + // Create listener for each media event + for (var i = 0; i < mediaEventTypes.length; i++) { + trapBubbledEvent(mediaEventTypes[i], domElement); + } + + props = rawProps; + break; + + case 'source': + trapBubbledEvent(TOP_ERROR, domElement); + props = rawProps; + break; + + case 'img': + case 'image': + case 'link': + trapBubbledEvent(TOP_ERROR, domElement); + trapBubbledEvent(TOP_LOAD, domElement); + props = rawProps; + break; + + case 'form': + trapBubbledEvent(TOP_RESET, domElement); + trapBubbledEvent(TOP_SUBMIT, domElement); + props = rawProps; + break; + + case 'details': + trapBubbledEvent(TOP_TOGGLE, domElement); + props = rawProps; + break; + + case 'input': + initWrapperState(domElement, rawProps); + props = getHostProps(domElement, rawProps); + trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening + // to onChange. Even if there is no listener. + + ensureListeningTo(rootContainerElement, 'onChange'); + break; + + case 'option': + validateProps(domElement, rawProps); + props = getHostProps$1(domElement, rawProps); + break; + + case 'select': + initWrapperState$1(domElement, rawProps); + props = getHostProps$2(domElement, rawProps); + trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening + // to onChange. Even if there is no listener. + + ensureListeningTo(rootContainerElement, 'onChange'); + break; + + case 'textarea': + initWrapperState$2(domElement, rawProps); + props = getHostProps$3(domElement, rawProps); + trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening + // to onChange. Even if there is no listener. + + ensureListeningTo(rootContainerElement, 'onChange'); + break; + + default: + props = rawProps; + } + + assertValidProps(tag, props); + setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag); + + switch (tag) { + case 'input': + // TODO: Make sure we check if this is still unmounted or do any clean + // up necessary since we never stop tracking anymore. + track(domElement); + postMountWrapper(domElement, rawProps, false); + break; + + case 'textarea': + // TODO: Make sure we check if this is still unmounted or do any clean + // up necessary since we never stop tracking anymore. + track(domElement); + postMountWrapper$3(domElement); + break; + + case 'option': + postMountWrapper$1(domElement, rawProps); + break; + + case 'select': + postMountWrapper$2(domElement, rawProps); + break; + + default: + if (typeof props.onClick === 'function') { + // TODO: This cast may not be sound for SVG, MathML or custom elements. + trapClickOnNonInteractiveElement(domElement); + } + + break; + } +} // Calculate the diff between the two objects. + +function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) { + { + validatePropertiesInDevelopment(tag, nextRawProps); + } + + var updatePayload = null; + var lastProps; + var nextProps; + + switch (tag) { + case 'input': + lastProps = getHostProps(domElement, lastRawProps); + nextProps = getHostProps(domElement, nextRawProps); + updatePayload = []; + break; + + case 'option': + lastProps = getHostProps$1(domElement, lastRawProps); + nextProps = getHostProps$1(domElement, nextRawProps); + updatePayload = []; + break; + + case 'select': + lastProps = getHostProps$2(domElement, lastRawProps); + nextProps = getHostProps$2(domElement, nextRawProps); + updatePayload = []; + break; + + case 'textarea': + lastProps = getHostProps$3(domElement, lastRawProps); + nextProps = getHostProps$3(domElement, nextRawProps); + updatePayload = []; + break; + + default: + lastProps = lastRawProps; + nextProps = nextRawProps; + + if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') { + // TODO: This cast may not be sound for SVG, MathML or custom elements. + trapClickOnNonInteractiveElement(domElement); + } + + break; + } + + assertValidProps(tag, nextProps); + var propKey; + var styleName; + var styleUpdates = null; + + for (propKey in lastProps) { + if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) { + continue; + } + + if (propKey === STYLE) { + var lastStyle = lastProps[propKey]; + + for (styleName in lastStyle) { + if (lastStyle.hasOwnProperty(styleName)) { + if (!styleUpdates) { + styleUpdates = {}; + } + + styleUpdates[styleName] = ''; + } + } + } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameModules.hasOwnProperty(propKey)) { + // This is a special case. If any listener updates we need to ensure + // that the "current" fiber pointer gets updated so we need a commit + // to update this element. + if (!updatePayload) { + updatePayload = []; + } + } else { + // For all other deleted properties we add it to the queue. We use + // the whitelist in the commit phase instead. + (updatePayload = updatePayload || []).push(propKey, null); + } + } + + for (propKey in nextProps) { + var nextProp = nextProps[propKey]; + var lastProp = lastProps != null ? lastProps[propKey] : undefined; + + if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) { + continue; + } + + if (propKey === STYLE) { + { + if (nextProp) { + // Freeze the next style object so that we can assume it won't be + // mutated. We have already warned for this in the past. + Object.freeze(nextProp); + } + } + + if (lastProp) { + // Unset styles on `lastProp` but not on `nextProp`. + for (styleName in lastProp) { + if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) { + if (!styleUpdates) { + styleUpdates = {}; + } + + styleUpdates[styleName] = ''; + } + } // Update styles that changed since `lastProp`. + + + for (styleName in nextProp) { + if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) { + if (!styleUpdates) { + styleUpdates = {}; + } + + styleUpdates[styleName] = nextProp[styleName]; + } + } + } else { + // Relies on `updateStylesByID` not mutating `styleUpdates`. + if (!styleUpdates) { + if (!updatePayload) { + updatePayload = []; + } + + updatePayload.push(propKey, styleUpdates); + } + + styleUpdates = nextProp; + } + } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { + var nextHtml = nextProp ? nextProp[HTML$1] : undefined; + var lastHtml = lastProp ? lastProp[HTML$1] : undefined; + + if (nextHtml != null) { + if (lastHtml !== nextHtml) { + (updatePayload = updatePayload || []).push(propKey, nextHtml); + } + } + } else if (propKey === CHILDREN) { + if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) { + (updatePayload = updatePayload || []).push(propKey, '' + nextProp); + } + } else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameModules.hasOwnProperty(propKey)) { + if (nextProp != null) { + // We eagerly listen to this even though we haven't committed yet. + if ( typeof nextProp !== 'function') { + warnForInvalidEventListener(propKey, nextProp); + } + + ensureListeningTo(rootContainerElement, propKey); + } + + if (!updatePayload && lastProp !== nextProp) { + // This is a special case. If any listener updates we need to ensure + // that the "current" props pointer gets updated so we need a commit + // to update this element. + updatePayload = []; + } + } else { + // For any other property we always add it to the queue and then we + // filter it out using the whitelist during the commit. + (updatePayload = updatePayload || []).push(propKey, nextProp); + } + } + + if (styleUpdates) { + { + validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]); + } + + (updatePayload = updatePayload || []).push(STYLE, styleUpdates); + } + + return updatePayload; +} // Apply the diff. + +function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) { + // Update checked *before* name. + // In the middle of an update, it is possible to have multiple checked. + // When a checked radio tries to change name, browser makes another radio's checked false. + if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) { + updateChecked(domElement, nextRawProps); + } + + var wasCustomComponentTag = isCustomComponent(tag, lastRawProps); + var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff. + + updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props + // changed. + + switch (tag) { + case 'input': + // Update the wrapper around inputs *after* updating props. This has to + // happen after `updateDOMProperties`. Otherwise HTML5 input validations + // raise warnings and prevent the new value from being assigned. + updateWrapper(domElement, nextRawProps); + break; + + case 'textarea': + updateWrapper$1(domElement, nextRawProps); + break; + + case 'select': + // <select> value update needs to occur after <option> children + // reconciliation + postUpdateWrapper(domElement, nextRawProps); + break; + } +} + +function getPossibleStandardName(propName) { + { + var lowerCasedName = propName.toLowerCase(); + + if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) { + return null; + } + + return possibleStandardNames[lowerCasedName] || null; + } +} + +function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) { + var isCustomComponentTag; + var extraAttributeNames; + + { + suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true; + isCustomComponentTag = isCustomComponent(tag, rawProps); + validatePropertiesInDevelopment(tag, rawProps); + } // TODO: Make sure that we check isMounted before firing any of these events. + + + switch (tag) { + case 'iframe': + case 'object': + case 'embed': + trapBubbledEvent(TOP_LOAD, domElement); + break; + + case 'video': + case 'audio': + // Create listener for each media event + for (var i = 0; i < mediaEventTypes.length; i++) { + trapBubbledEvent(mediaEventTypes[i], domElement); + } + + break; + + case 'source': + trapBubbledEvent(TOP_ERROR, domElement); + break; + + case 'img': + case 'image': + case 'link': + trapBubbledEvent(TOP_ERROR, domElement); + trapBubbledEvent(TOP_LOAD, domElement); + break; + + case 'form': + trapBubbledEvent(TOP_RESET, domElement); + trapBubbledEvent(TOP_SUBMIT, domElement); + break; + + case 'details': + trapBubbledEvent(TOP_TOGGLE, domElement); + break; + + case 'input': + initWrapperState(domElement, rawProps); + trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening + // to onChange. Even if there is no listener. + + ensureListeningTo(rootContainerElement, 'onChange'); + break; + + case 'option': + validateProps(domElement, rawProps); + break; + + case 'select': + initWrapperState$1(domElement, rawProps); + trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening + // to onChange. Even if there is no listener. + + ensureListeningTo(rootContainerElement, 'onChange'); + break; + + case 'textarea': + initWrapperState$2(domElement, rawProps); + trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening + // to onChange. Even if there is no listener. + + ensureListeningTo(rootContainerElement, 'onChange'); + break; + } + + assertValidProps(tag, rawProps); + + { + extraAttributeNames = new Set(); + var attributes = domElement.attributes; + + for (var _i = 0; _i < attributes.length; _i++) { + var name = attributes[_i].name.toLowerCase(); + + switch (name) { + // Built-in SSR attribute is whitelisted + case 'data-reactroot': + break; + // Controlled attributes are not validated + // TODO: Only ignore them on controlled tags. + + case 'value': + break; + + case 'checked': + break; + + case 'selected': + break; + + default: + // Intentionally use the original name. + // See discussion in https://github.com/facebook/react/pull/10676. + extraAttributeNames.add(attributes[_i].name); + } + } + } + + var updatePayload = null; + + for (var propKey in rawProps) { + if (!rawProps.hasOwnProperty(propKey)) { + continue; + } + + var nextProp = rawProps[propKey]; + + if (propKey === CHILDREN) { + // For text content children we compare against textContent. This + // might match additional HTML that is hidden when we read it using + // textContent. E.g. "foo" will match "f<span>oo</span>" but that still + // satisfies our requirement. Our requirement is not to produce perfect + // HTML and attributes. Ideally we should preserve structure but it's + // ok not to if the visible content is still enough to indicate what + // even listeners these nodes might be wired up to. + // TODO: Warn if there is more than a single textNode as a child. + // TODO: Should we use domElement.firstChild.nodeValue to compare? + if (typeof nextProp === 'string') { + if (domElement.textContent !== nextProp) { + if ( !suppressHydrationWarning) { + warnForTextDifference(domElement.textContent, nextProp); + } + + updatePayload = [CHILDREN, nextProp]; + } + } else if (typeof nextProp === 'number') { + if (domElement.textContent !== '' + nextProp) { + if ( !suppressHydrationWarning) { + warnForTextDifference(domElement.textContent, nextProp); + } + + updatePayload = [CHILDREN, '' + nextProp]; + } + } + } else if (registrationNameModules.hasOwnProperty(propKey)) { + if (nextProp != null) { + if ( typeof nextProp !== 'function') { + warnForInvalidEventListener(propKey, nextProp); + } + + ensureListeningTo(rootContainerElement, propKey); + } + } else if ( // Convince Flow we've calculated it (it's DEV-only in this method.) + typeof isCustomComponentTag === 'boolean') { + // Validate that the properties correspond to their expected values. + var serverValue = void 0; + var propertyInfo = getPropertyInfo(propKey); + + if (suppressHydrationWarning) ; else if ( propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated + // TODO: Only ignore them on controlled tags. + propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) { + var serverHTML = domElement.innerHTML; + var nextHtml = nextProp ? nextProp[HTML$1] : undefined; + var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : ''); + + if (expectedHTML !== serverHTML) { + warnForPropDifference(propKey, serverHTML, expectedHTML); + } + } else if (propKey === STYLE) { + // $FlowFixMe - Should be inferred as not undefined. + extraAttributeNames.delete(propKey); + + if (canDiffStyleForHydrationWarning) { + var expectedStyle = createDangerousStringForStyles(nextProp); + serverValue = domElement.getAttribute('style'); + + if (expectedStyle !== serverValue) { + warnForPropDifference(propKey, serverValue, expectedStyle); + } + } + } else if (isCustomComponentTag) { + // $FlowFixMe - Should be inferred as not undefined. + extraAttributeNames.delete(propKey.toLowerCase()); + serverValue = getValueForAttribute(domElement, propKey, nextProp); + + if (nextProp !== serverValue) { + warnForPropDifference(propKey, serverValue, nextProp); + } + } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) { + var isMismatchDueToBadCasing = false; + + if (propertyInfo !== null) { + // $FlowFixMe - Should be inferred as not undefined. + extraAttributeNames.delete(propertyInfo.attributeName); + serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo); + } else { + var ownNamespace = parentNamespace; + + if (ownNamespace === HTML_NAMESPACE$1) { + ownNamespace = getIntrinsicNamespace(tag); + } + + if (ownNamespace === HTML_NAMESPACE$1) { + // $FlowFixMe - Should be inferred as not undefined. + extraAttributeNames.delete(propKey.toLowerCase()); + } else { + var standardName = getPossibleStandardName(propKey); + + if (standardName !== null && standardName !== propKey) { + // If an SVG prop is supplied with bad casing, it will + // be successfully parsed from HTML, but will produce a mismatch + // (and would be incorrectly rendered on the client). + // However, we already warn about bad casing elsewhere. + // So we'll skip the misleading extra mismatch warning in this case. + isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined. + + extraAttributeNames.delete(standardName); + } // $FlowFixMe - Should be inferred as not undefined. + + + extraAttributeNames.delete(propKey); + } + + serverValue = getValueForAttribute(domElement, propKey, nextProp); + } + + if (nextProp !== serverValue && !isMismatchDueToBadCasing) { + warnForPropDifference(propKey, serverValue, nextProp); + } + } + } + } + + { + // $FlowFixMe - Should be inferred as not undefined. + if (extraAttributeNames.size > 0 && !suppressHydrationWarning) { + // $FlowFixMe - Should be inferred as not undefined. + warnForExtraAttributes(extraAttributeNames); + } + } + + switch (tag) { + case 'input': + // TODO: Make sure we check if this is still unmounted or do any clean + // up necessary since we never stop tracking anymore. + track(domElement); + postMountWrapper(domElement, rawProps, true); + break; + + case 'textarea': + // TODO: Make sure we check if this is still unmounted or do any clean + // up necessary since we never stop tracking anymore. + track(domElement); + postMountWrapper$3(domElement); + break; + + case 'select': + case 'option': + // For input and textarea we current always set the value property at + // post mount to force it to diverge from attributes. However, for + // option and select we don't quite do the same thing and select + // is not resilient to the DOM state changing so we don't do that here. + // TODO: Consider not doing this for input and textarea. + break; + + default: + if (typeof rawProps.onClick === 'function') { + // TODO: This cast may not be sound for SVG, MathML or custom elements. + trapClickOnNonInteractiveElement(domElement); + } + + break; + } + + return updatePayload; +} +function diffHydratedText(textNode, text) { + var isDifferent = textNode.nodeValue !== text; + return isDifferent; +} +function warnForUnmatchedText(textNode, text) { + { + warnForTextDifference(textNode.nodeValue, text); + } +} +function warnForDeletedHydratableElement(parentNode, child) { + { + if (didWarnInvalidHydration) { + return; + } + + didWarnInvalidHydration = true; + + error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase()); + } +} +function warnForDeletedHydratableText(parentNode, child) { + { + if (didWarnInvalidHydration) { + return; + } + + didWarnInvalidHydration = true; + + error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase()); + } +} +function warnForInsertedHydratedElement(parentNode, tag, props) { + { + if (didWarnInvalidHydration) { + return; + } + + didWarnInvalidHydration = true; + + error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase()); + } +} +function warnForInsertedHydratedText(parentNode, text) { + { + if (text === '') { + // We expect to insert empty text nodes since they're not represented in + // the HTML. + // TODO: Remove this special case if we can just avoid inserting empty + // text nodes. + return; + } + + if (didWarnInvalidHydration) { + return; + } + + didWarnInvalidHydration = true; + + error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase()); + } +} +function restoreControlledState$3(domElement, tag, props) { + switch (tag) { + case 'input': + restoreControlledState(domElement, props); + return; + + case 'textarea': + restoreControlledState$2(domElement, props); + return; + + case 'select': + restoreControlledState$1(domElement, props); + return; + } +} + +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 <input type="number">. 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 { + // Used by Flare + activeElementDetached: null, + focusedElem: focusedElem, + selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null + }; +} +/** + * @restoreSelection: If any selection information was potentially lost, + * restore it. This is useful when performing operations that could remove dom + * nodes and place them back in, resulting in focus being lost. + */ + +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(input) { + var selection; + + 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 validateDOMNesting = function () {}; + +var updatedAncestorInfo = function () {}; + +{ + // This validation code was written based on the HTML5 parsing spec: + // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope + // + // Note: this does not catch all invalid nesting, nor does it try to (as it's + // not clear what practical benefit doing so provides); instead, we warn only + // for cases where the parser will give a parse tree differing from what React + // intended. For example, <b><div></div></b> is invalid but we don't warn + // because it still parses correctly; we do warn for other cases like nested + // <p> tags where the beginning of the second element implicitly closes the + // first, causing a confusing mess. + // https://html.spec.whatwg.org/multipage/syntax.html#special + var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope + + var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point + // TODO: Distinguish by namespace here -- for <title>, including it here + // errs on the side of fewer warnings + 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope + + var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags + + var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt']; + var emptyAncestorInfo = { + current: null, + formTag: null, + aTagInScope: null, + buttonTagInScope: null, + nobrTagInScope: null, + pTagInButtonScope: null, + listItemTagAutoclosing: null, + dlItemTagAutoclosing: null + }; + + updatedAncestorInfo = function (oldInfo, tag) { + var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo); + + var info = { + tag: tag + }; + + if (inScopeTags.indexOf(tag) !== -1) { + ancestorInfo.aTagInScope = null; + ancestorInfo.buttonTagInScope = null; + ancestorInfo.nobrTagInScope = null; + } + + if (buttonScopeTags.indexOf(tag) !== -1) { + ancestorInfo.pTagInButtonScope = null; + } // See rules for 'li', 'dd', 'dt' start tags in + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody + + + if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') { + ancestorInfo.listItemTagAutoclosing = null; + ancestorInfo.dlItemTagAutoclosing = null; + } + + ancestorInfo.current = info; + + if (tag === 'form') { + ancestorInfo.formTag = info; + } + + if (tag === 'a') { + ancestorInfo.aTagInScope = info; + } + + if (tag === 'button') { + ancestorInfo.buttonTagInScope = info; + } + + if (tag === 'nobr') { + ancestorInfo.nobrTagInScope = info; + } + + if (tag === 'p') { + ancestorInfo.pTagInButtonScope = info; + } + + if (tag === 'li') { + ancestorInfo.listItemTagAutoclosing = info; + } + + if (tag === 'dd' || tag === 'dt') { + ancestorInfo.dlItemTagAutoclosing = info; + } + + return ancestorInfo; + }; + /** + * Returns whether + */ + + + var isTagValidWithParent = function (tag, parentTag) { + // First, let's check if we're in an unusual parsing mode... + switch (parentTag) { + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect + case 'select': + return tag === 'option' || tag === 'optgroup' || tag === '#text'; + + case 'optgroup': + return tag === 'option' || tag === '#text'; + // Strictly speaking, seeing an <option> doesn't mean we're in a <select> + // but + + case 'option': + return tag === '#text'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption + // No special behavior since these rules fall back to "in body" mode for + // all except special table nodes which cause bad parsing behavior anyway. + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr + + case 'tr': + return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody + + case 'tbody': + case 'thead': + case 'tfoot': + return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup + + case 'colgroup': + return tag === 'col' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable + + case 'table': + return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead + + case 'head': + return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; + // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element + + case 'html': + return tag === 'head' || tag === 'body' || tag === 'frameset'; + + case 'frameset': + return tag === 'frame'; + + case '#document': + return tag === 'html'; + } // Probably in the "in body" parsing mode, so we outlaw only tag combos + // where the parsing rules cause implicit opens or closes to be added. + // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody + + + switch (tag) { + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6'; + + case 'rp': + case 'rt': + return impliedEndTags.indexOf(parentTag) === -1; + + case 'body': + case 'caption': + case 'col': + case 'colgroup': + case 'frameset': + case 'frame': + case 'head': + case 'html': + case 'tbody': + case 'td': + case 'tfoot': + case 'th': + case 'thead': + case 'tr': + // These tags are only valid with a few parents that have special child + // parsing rules -- if we're down here, then none of those matched and + // so we allow it only if we don't know what the parent is, as all other + // cases are invalid. + return parentTag == null; + } + + return true; + }; + /** + * Returns whether + */ + + + var findInvalidAncestorForTag = function (tag, ancestorInfo) { + switch (tag) { + case 'address': + case 'article': + case 'aside': + case 'blockquote': + case 'center': + case 'details': + case 'dialog': + case 'dir': + case 'div': + case 'dl': + case 'fieldset': + case 'figcaption': + case 'figure': + case 'footer': + case 'header': + case 'hgroup': + case 'main': + case 'menu': + case 'nav': + case 'ol': + case 'p': + case 'section': + case 'summary': + case 'ul': + case 'pre': + case 'listing': + case 'table': + case 'hr': + case 'xmp': + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': + return ancestorInfo.pTagInButtonScope; + + case 'form': + return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; + + case 'li': + return ancestorInfo.listItemTagAutoclosing; + + case 'dd': + case 'dt': + return ancestorInfo.dlItemTagAutoclosing; + + case 'button': + return ancestorInfo.buttonTagInScope; + + case 'a': + // Spec says something about storing a list of markers, but it sounds + // equivalent to this check. + return ancestorInfo.aTagInScope; + + case 'nobr': + return ancestorInfo.nobrTagInScope; + } + + return null; + }; + + var didWarn$1 = {}; + + validateDOMNesting = function (childTag, childText, ancestorInfo) { + ancestorInfo = ancestorInfo || emptyAncestorInfo; + var parentInfo = ancestorInfo.current; + var parentTag = parentInfo && parentInfo.tag; + + if (childText != null) { + if (childTag != null) { + error('validateDOMNesting: when childText is passed, childTag should be null'); + } + + childTag = '#text'; + } + + var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; + var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); + var invalidParentOrAncestor = invalidParent || invalidAncestor; + + if (!invalidParentOrAncestor) { + return; + } + + var ancestorTag = invalidParentOrAncestor.tag; + var addendum = getCurrentFiberStackInDev(); + var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum; + + if (didWarn$1[warnKey]) { + return; + } + + didWarn$1[warnKey] = true; + var tagDisplayName = childTag; + var whitespaceInfo = ''; + + if (childTag === '#text') { + if (/\S/.test(childText)) { + tagDisplayName = 'Text nodes'; + } else { + tagDisplayName = 'Whitespace text nodes'; + whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.'; + } + } else { + tagDisplayName = '<' + childTag + '>'; + } + + if (invalidParent) { + var info = ''; + + if (ancestorTag === 'table' && childTag === 'tr') { + info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.'; + } + + error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info); + } else { + error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag); + } + }; +} + +var SUPPRESS_HYDRATION_WARNING$1; + +{ + SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning'; +} + +var SUSPENSE_START_DATA = '$'; +var SUSPENSE_END_DATA = '/$'; +var SUSPENSE_PENDING_START_DATA = '$?'; +var SUSPENSE_FALLBACK_START_DATA = '$!'; +var STYLE$1 = 'style'; +var eventsEnabled = null; +var selectionInformation = null; + +function shouldAutoFocusHostComponent(type, props) { + switch (type) { + case 'button': + case 'input': + case 'select': + case 'textarea': + return !!props.autoFocus; + } + + return false; +} +function getRootHostContext(rootContainerInstance) { + var type; + var namespace; + var nodeType = rootContainerInstance.nodeType; + + switch (nodeType) { + case DOCUMENT_NODE: + case DOCUMENT_FRAGMENT_NODE: + { + type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment'; + var root = rootContainerInstance.documentElement; + namespace = root ? root.namespaceURI : getChildNamespace(null, ''); + break; + } + + default: + { + var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance; + var ownNamespace = container.namespaceURI || null; + type = container.tagName; + namespace = getChildNamespace(ownNamespace, type); + break; + } + } + + { + var validatedTag = type.toLowerCase(); + var ancestorInfo = updatedAncestorInfo(null, validatedTag); + return { + namespace: namespace, + ancestorInfo: ancestorInfo + }; + } +} +function getChildHostContext(parentHostContext, type, rootContainerInstance) { + { + var parentHostContextDev = parentHostContext; + var namespace = getChildNamespace(parentHostContextDev.namespace, type); + var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type); + return { + namespace: namespace, + ancestorInfo: ancestorInfo + }; + } +} +function getPublicInstance(instance) { + return instance; +} +function prepareForCommit(containerInfo) { + eventsEnabled = isEnabled(); + selectionInformation = getSelectionInformation(); + setEnabled(false); +} +function resetAfterCommit(containerInfo) { + restoreSelection(selectionInformation); + setEnabled(eventsEnabled); + eventsEnabled = null; + + selectionInformation = null; +} +function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { + var parentNamespace; + + { + // TODO: take namespace into account when validating. + var hostContextDev = hostContext; + validateDOMNesting(type, null, hostContextDev.ancestorInfo); + + if (typeof props.children === 'string' || typeof props.children === 'number') { + var string = '' + props.children; + var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); + validateDOMNesting(null, string, ownAncestorInfo); + } + + parentNamespace = hostContextDev.namespace; + } + + var domElement = createElement(type, props, rootContainerInstance, parentNamespace); + precacheFiberNode(internalInstanceHandle, domElement); + updateFiberProps(domElement, props); + return domElement; +} +function appendInitialChild(parentInstance, child) { + parentInstance.appendChild(child); +} +function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) { + setInitialProperties(domElement, type, props, rootContainerInstance); + return shouldAutoFocusHostComponent(type, props); +} +function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) { + { + var hostContextDev = hostContext; + + if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) { + var string = '' + newProps.children; + var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); + validateDOMNesting(null, string, ownAncestorInfo); + } + } + + return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance); +} +function shouldSetTextContent(type, props) { + return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null; +} +function shouldDeprioritizeSubtree(type, props) { + return !!props.hidden; +} +function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { + { + var hostContextDev = hostContext; + validateDOMNesting(null, text, hostContextDev.ancestorInfo); + } + + var textNode = createTextNode(text, rootContainerInstance); + precacheFiberNode(internalInstanceHandle, textNode); + return textNode; +} +// if a component just imports ReactDOM (e.g. for findDOMNode). +// Some environments might not have setTimeout or clearTimeout. + +var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined; +var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined; +var noTimeout = -1; // ------------------- +function commitMount(domElement, type, newProps, internalInstanceHandle) { + // Despite the naming that might imply otherwise, this method only + // fires if there is an `Update` effect scheduled during mounting. + // This happens if `finalizeInitialChildren` returns `true` (which it + // does to implement the `autoFocus` attribute on the client). But + // there are also other cases when this might happen (such as patching + // up text content during hydration mismatch). So we'll check this again. + if (shouldAutoFocusHostComponent(type, newProps)) { + domElement.focus(); + } +} +function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) { + // Update the props handle so that we know which props are the ones with + // with current event handlers. + updateFiberProps(domElement, newProps); // Apply the diff to the DOM node. + + updateProperties(domElement, updatePayload, type, oldProps, newProps); +} +function resetTextContent(domElement) { + setTextContent(domElement, ''); +} +function commitTextUpdate(textInstance, oldText, newText) { + textInstance.nodeValue = newText; +} +function appendChild(parentInstance, child) { + parentInstance.appendChild(child); +} +function appendChildToContainer(container, child) { + var parentNode; + + if (container.nodeType === COMMENT_NODE) { + parentNode = container.parentNode; + parentNode.insertBefore(child, container); + } else { + parentNode = container; + parentNode.appendChild(child); + } // This container might be used for a portal. + // If something inside a portal is clicked, that click should bubble + // through the React tree. However, on Mobile Safari the click would + // never bubble through the *DOM* tree unless an ancestor with onclick + // event exists. So we wouldn't see it and dispatch it. + // This is why we ensure that non React root containers have inline onclick + // defined. + // https://github.com/facebook/react/issues/11918 + + + var reactRootContainer = container._reactRootContainer; + + if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) { + // TODO: This cast may not be sound for SVG, MathML or custom elements. + trapClickOnNonInteractiveElement(parentNode); + } +} +function insertBefore(parentInstance, child, beforeChild) { + parentInstance.insertBefore(child, beforeChild); +} +function insertInContainerBefore(container, child, beforeChild) { + if (container.nodeType === COMMENT_NODE) { + container.parentNode.insertBefore(child, beforeChild); + } else { + container.insertBefore(child, beforeChild); + } +} +function removeChild(parentInstance, child) { + parentInstance.removeChild(child); +} +function removeChildFromContainer(container, child) { + if (container.nodeType === COMMENT_NODE) { + container.parentNode.removeChild(child); + } else { + container.removeChild(child); + } +} + +function hideInstance(instance) { + // pass host context to this method? + + + instance = instance; + var style = instance.style; + + if (typeof style.setProperty === 'function') { + style.setProperty('display', 'none', 'important'); + } else { + style.display = 'none'; + } +} +function hideTextInstance(textInstance) { + textInstance.nodeValue = ''; +} +function unhideInstance(instance, props) { + instance = instance; + var styleProp = props[STYLE$1]; + var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null; + instance.style.display = dangerousStyleValue('display', display); +} +function unhideTextInstance(textInstance, text) { + textInstance.nodeValue = text; +} // ------------------- +function canHydrateInstance(instance, type, props) { + if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) { + return null; + } // This has now been refined to an element node. + + + return instance; +} +function canHydrateTextInstance(instance, text) { + if (text === '' || instance.nodeType !== TEXT_NODE) { + // Empty strings are not parsed by HTML so there won't be a correct match here. + return null; + } // This has now been refined to a text node. + + + return instance; +} +function isSuspenseInstancePending(instance) { + return instance.data === SUSPENSE_PENDING_START_DATA; +} +function isSuspenseInstanceFallback(instance) { + return instance.data === SUSPENSE_FALLBACK_START_DATA; +} + +function getNextHydratable(node) { + // Skip non-hydratable nodes. + for (; node != null; node = node.nextSibling) { + var nodeType = node.nodeType; + + if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) { + break; + } + } + + return node; +} + +function getNextHydratableSibling(instance) { + return getNextHydratable(instance.nextSibling); +} +function getFirstHydratableChild(parentInstance) { + return getNextHydratable(parentInstance.firstChild); +} +function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) { + precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events + // get attached. + + updateFiberProps(instance, props); + var parentNamespace; + + { + var hostContextDev = hostContext; + parentNamespace = hostContextDev.namespace; + } + + return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance); +} +function hydrateTextInstance(textInstance, text, internalInstanceHandle) { + precacheFiberNode(internalInstanceHandle, textInstance); + return diffHydratedText(textInstance, text); +} +function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) { + var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary. + // There might be nested nodes so we need to keep track of how + // deep we are and only break out when we're back on top. + + var depth = 0; + + while (node) { + if (node.nodeType === COMMENT_NODE) { + var data = node.data; + + if (data === SUSPENSE_END_DATA) { + if (depth === 0) { + return getNextHydratableSibling(node); + } else { + depth--; + } + } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) { + depth++; + } + } + + node = node.nextSibling; + } // TODO: Warn, we didn't find the end comment boundary. + + + return null; +} // Returns the SuspenseInstance if this node is a direct child of a +// SuspenseInstance. I.e. if its previous sibling is a Comment with +// SUSPENSE_x_START_DATA. Otherwise, null. + +function getParentSuspenseInstance(targetInstance) { + var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary. + // There might be nested nodes so we need to keep track of how + // deep we are and only break out when we're back on top. + + var depth = 0; + + while (node) { + if (node.nodeType === COMMENT_NODE) { + var data = node.data; + + if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) { + if (depth === 0) { + return node; + } else { + depth--; + } + } else if (data === SUSPENSE_END_DATA) { + depth++; + } + } + + node = node.previousSibling; + } + + return null; +} +function commitHydratedContainer(container) { + // Retry if any event replaying was blocked on this. + retryIfBlockedOn(container); +} +function commitHydratedSuspenseInstance(suspenseInstance) { + // Retry if any event replaying was blocked on this. + retryIfBlockedOn(suspenseInstance); +} +function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) { + { + warnForUnmatchedText(textInstance, text); + } +} +function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) { + if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { + warnForUnmatchedText(textInstance, text); + } +} +function didNotHydrateContainerInstance(parentContainer, instance) { + { + if (instance.nodeType === ELEMENT_NODE) { + warnForDeletedHydratableElement(parentContainer, instance); + } else if (instance.nodeType === COMMENT_NODE) ; else { + warnForDeletedHydratableText(parentContainer, instance); + } + } +} +function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) { + if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { + if (instance.nodeType === ELEMENT_NODE) { + warnForDeletedHydratableElement(parentInstance, instance); + } else if (instance.nodeType === COMMENT_NODE) ; else { + warnForDeletedHydratableText(parentInstance, instance); + } + } +} +function didNotFindHydratableContainerInstance(parentContainer, type, props) { + { + warnForInsertedHydratedElement(parentContainer, type); + } +} +function didNotFindHydratableContainerTextInstance(parentContainer, text) { + { + warnForInsertedHydratedText(parentContainer, text); + } +} +function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) { + if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { + warnForInsertedHydratedElement(parentInstance, type); + } +} +function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) { + if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { + warnForInsertedHydratedText(parentInstance, text); + } +} +function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) { + if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ; +} + +var randomKey = Math.random().toString(36).slice(2); +var internalInstanceKey = '__reactInternalInstance$' + randomKey; +var internalEventHandlersKey = '__reactEventHandlers$' + randomKey; +var internalContainerInstanceKey = '__reactContainere$' + randomKey; +function precacheFiberNode(hostInst, node) { + node[internalInstanceKey] = hostInst; +} +function markContainerAsRoot(hostRoot, node) { + node[internalContainerInstanceKey] = hostRoot; +} +function unmarkContainerAsRoot(node) { + node[internalContainerInstanceKey] = null; +} +function isContainerMarkedAsRoot(node) { + return !!node[internalContainerInstanceKey]; +} // Given a DOM node, return the closest HostComponent or HostText fiber ancestor. +// If the target node is part of a hydrated or not yet rendered subtree, then +// this may also return a SuspenseComponent or HostRoot to indicate that. +// Conceptually the HostRoot fiber is a child of the Container node. So if you +// pass the Container node as the targetNode, you will not actually get the +// HostRoot back. To get to the HostRoot, you need to pass a child of it. +// The same thing applies to Suspense boundaries. + +function getClosestInstanceFromNode(targetNode) { + var targetInst = targetNode[internalInstanceKey]; + + if (targetInst) { + // Don't return HostRoot or SuspenseComponent here. + return targetInst; + } // If the direct event target isn't a React owned DOM node, we need to look + // to see if one of its parents is a React owned DOM node. + + + var parentNode = targetNode.parentNode; + + while (parentNode) { + // We'll check if this is a container root that could include + // React nodes in the future. We need to check this first because + // if we're a child of a dehydrated container, we need to first + // find that inner container before moving on to finding the parent + // instance. Note that we don't check this field on the targetNode + // itself because the fibers are conceptually between the container + // node and the first child. It isn't surrounding the container node. + // If it's not a container, we check if it's an instance. + targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]; + + if (targetInst) { + // Since this wasn't the direct target of the event, we might have + // stepped past dehydrated DOM nodes to get here. However they could + // also have been non-React nodes. We need to answer which one. + // If we the instance doesn't have any children, then there can't be + // a nested suspense boundary within it. So we can use this as a fast + // bailout. Most of the time, when people add non-React children to + // the tree, it is using a ref to a child-less DOM node. + // Normally we'd only need to check one of the fibers because if it + // has ever gone from having children to deleting them or vice versa + // it would have deleted the dehydrated boundary nested inside already. + // However, since the HostRoot starts out with an alternate it might + // have one on the alternate so we need to check in case this was a + // root. + var alternate = targetInst.alternate; + + if (targetInst.child !== null || alternate !== null && alternate.child !== null) { + // Next we need to figure out if the node that skipped past is + // nested within a dehydrated boundary and if so, which one. + var suspenseInstance = getParentSuspenseInstance(targetNode); + + while (suspenseInstance !== null) { + // We found a suspense instance. That means that we haven't + // hydrated it yet. Even though we leave the comments in the + // DOM after hydrating, and there are boundaries in the DOM + // that could already be hydrated, we wouldn't have found them + // through this pass since if the target is hydrated it would + // have had an internalInstanceKey on it. + // Let's get the fiber associated with the SuspenseComponent + // as the deepest instance. + var targetSuspenseInst = suspenseInstance[internalInstanceKey]; + + if (targetSuspenseInst) { + return targetSuspenseInst; + } // If we don't find a Fiber on the comment, it might be because + // we haven't gotten to hydrate it yet. There might still be a + // parent boundary that hasn't above this one so we need to find + // the outer most that is known. + + + suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent + // host component also hasn't hydrated yet. We can return it + // below since it will bail out on the isMounted check later. + } + } + + return targetInst; + } + + targetNode = parentNode; + parentNode = targetNode.parentNode; + } + + 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] || node[internalContainerInstanceKey]; + + if (inst) { + if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) { + 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. + + + { + { + throw Error( "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; +} +/** + * 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; + + 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); + } +} + +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': + case 'onMouseEnter': + return !!(props.disabled && isInteractive(type)); + + default: + return false; + } +} +/** + * @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; // 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; + } + + if (!(!listener || typeof listener === 'function')) { + { + throw Error( "Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type." ); + } + } + + return listener; +} + +/** + * 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) { + { + if (!inst) { + error('Dispatching inst must not be null'); + } + } + + 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); +} + +/** + * 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; + var startValue = startText; + var startLength = startValue.length; + var end; + 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; +} + +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) { + { + error("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; + + if (!(event instanceof EventConstructor)) { + { + throw Error( "Trying to release an event instance into a pool of a different type." ); + } + } + + 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; + var fallbackData; + + 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; + + 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, eventSystemFlags) { + 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]; + } +}; + +/** + * @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; +} + +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, eventSystemFlags) { + var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window; + var getTargetInstFunc, handleEventFunc; + + 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); + } + } +}; + +var SyntheticUIEvent = SyntheticEvent.extend({ + view: null, + detail: null +}); + +/** + * Translation from modifier key to the associated property in the event. + * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers + */ +var modifierKeyToProp = { + Alt: 'altKey', + Control: 'ctrlKey', + Meta: 'metaKey', + Shift: 'shiftKey' +}; // 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. + +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, eventSystemFlags) { + var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER; + var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT; + + if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) { + // If this is an over event with a target, then we've already dispatched + // the event in the out event of the other target. If this is replayed, + // then it's because we couldn't dispatch against this target previously + // so we have to do it now instead. + return null; + } + + if (!isOutEvent && !isOverEvent) { + // Must not be a mouse or pointer in or out - ignoring. + return null; + } + + var win; + + 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; + var to; + + if (isOutEvent) { + from = targetInst; + var related = nativeEvent.relatedTarget || nativeEvent.toElement; + to = related ? getClosestInstanceFromNode(related) : null; + + if (to !== null) { + var nearestMounted = getNearestMountedFiber(to); + + if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) { + to = 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, leaveEventType, enterEventType, eventTypePrefix; + + 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); // If we are not processing the first ancestor, then we + // should not process the same nativeEvent again, as we + // will have already processed it in the first ancestor. + + if ((eventSystemFlags & IS_FIRST_ANCESTOR) === 0) { + return [leave]; + } + + 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 objectIs = typeof Object.is === 'function' ? Object.is : is; + +var hasOwnProperty$2 = 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 (objectIs(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$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) { + return false; + } + } + + return true; +} + +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$1(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$1(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, eventSystemFlags, container) { + var containerOrDoc = container || getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do + // not extract events. See #3639. + + if (!containerOrDoc || !isListeningToAllDependencies('onSelect', containerOrDoc)) { + 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; + } +}; + +/** + * @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; + 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 +}); + +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 = { + // simpleEventPluginEventTypes gets populated from + // the DOMEventProperties module. + eventTypes: simpleEventPluginEventTypes, + extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) { + var dispatchConfig = topLevelEventsToDispatchConfig.get(topLevelType); + + if (!dispatchConfig) { + return null; + } + + var EventConstructor; + + 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) { + error('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; + } +}; + +/** + * 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']; +/** + * Inject modules for resolving DOM hierarchy and plugin ordering. + */ + +injectEventPluginOrder(DOMEventPluginOrder); +setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1); +/** + * Some important event plugins included by default (without having to require + * them). + */ + +injectEventPluginsByName({ + SimpleEventPlugin: SimpleEventPlugin, + EnterLeaveEventPlugin: EnterLeaveEventPlugin, + ChangeEventPlugin: ChangeEventPlugin, + SelectEventPlugin: SelectEventPlugin, + BeforeInputEventPlugin: BeforeInputEventPlugin +}); + +// Prefix measurements so that it's possible to filter them. +// Longer prefixes are hard to read in DevTools. +var reactEmoji = "\u269B"; +var warningEmoji = "\u26D4"; +var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; // Keep track of current fiber so that we know the path to unwind on pause. +// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them? + +var currentFiber = null; // If we're in the middle of user code, which fiber and method is it? +// Reusing `currentFiber` would be confusing for this because user code fiber +// can change during commit phase too, but we don't need to unwind it (since +// lifecycles in the commit phase don't resemble a tree). + +var currentPhase = null; +var currentPhaseFiber = null; // Did lifecycle hook schedule an update? This is often a performance problem, +// so we will keep track of it, and include it in the report. +// Track commits caused by cascading updates. + +var isCommitting = false; +var hasScheduledUpdateInCurrentCommit = false; +var hasScheduledUpdateInCurrentPhase = false; +var commitCountInCurrentWorkLoop = 0; +var effectCountInCurrentCommit = 0; +// to avoid stretch the commit phase with measurement overhead. + +var labelsInCurrentCommit = new Set(); + +var formatMarkName = function (markName) { + return reactEmoji + " " + markName; +}; + +var formatLabel = function (label, warning) { + var prefix = warning ? warningEmoji + " " : reactEmoji + " "; + var suffix = warning ? " Warning: " + warning : ''; + return "" + prefix + label + suffix; +}; + +var beginMark = function (markName) { + performance.mark(formatMarkName(markName)); +}; + +var clearMark = function (markName) { + performance.clearMarks(formatMarkName(markName)); +}; + +var endMark = function (label, markName, warning) { + var formattedMarkName = formatMarkName(markName); + var formattedLabel = formatLabel(label, warning); + + try { + performance.measure(formattedLabel, formattedMarkName); + } catch (err) {} // If previous mark was missing for some reason, this will throw. + // This could only happen if React crashed in an unexpected place earlier. + // Don't pile on with more errors. + // Clear marks immediately to avoid growing buffer. + + + performance.clearMarks(formattedMarkName); + performance.clearMeasures(formattedLabel); +}; + +var getFiberMarkName = function (label, debugID) { + return label + " (#" + debugID + ")"; +}; + +var getFiberLabel = function (componentName, isMounted, phase) { + if (phase === null) { + // These are composite component total time measurements. + return componentName + " [" + (isMounted ? 'update' : 'mount') + "]"; + } else { + // Composite component methods. + return componentName + "." + phase; + } +}; + +var beginFiberMark = function (fiber, phase) { + var componentName = getComponentName(fiber.type) || 'Unknown'; + var debugID = fiber._debugID; + var isMounted = fiber.alternate !== null; + var label = getFiberLabel(componentName, isMounted, phase); + + if (isCommitting && labelsInCurrentCommit.has(label)) { + // During the commit phase, we don't show duplicate labels because + // there is a fixed overhead for every measurement, and we don't + // want to stretch the commit phase beyond necessary. + return false; + } + + labelsInCurrentCommit.add(label); + var markName = getFiberMarkName(label, debugID); + beginMark(markName); + return true; +}; + +var clearFiberMark = function (fiber, phase) { + var componentName = getComponentName(fiber.type) || 'Unknown'; + var debugID = fiber._debugID; + var isMounted = fiber.alternate !== null; + var label = getFiberLabel(componentName, isMounted, phase); + var markName = getFiberMarkName(label, debugID); + clearMark(markName); +}; + +var endFiberMark = function (fiber, phase, warning) { + var componentName = getComponentName(fiber.type) || 'Unknown'; + var debugID = fiber._debugID; + var isMounted = fiber.alternate !== null; + var label = getFiberLabel(componentName, isMounted, phase); + var markName = getFiberMarkName(label, debugID); + endMark(label, markName, warning); +}; + +var shouldIgnoreFiber = function (fiber) { + // Host components should be skipped in the timeline. + // We could check typeof fiber.type, but does this work with RN? + switch (fiber.tag) { + case HostRoot: + case HostComponent: + case HostText: + case HostPortal: + case Fragment: + case ContextProvider: + case ContextConsumer: + case Mode: + return true; + + default: + return false; + } +}; + +var clearPendingPhaseMeasurement = function () { + if (currentPhase !== null && currentPhaseFiber !== null) { + clearFiberMark(currentPhaseFiber, currentPhase); + } + + currentPhaseFiber = null; + currentPhase = null; + hasScheduledUpdateInCurrentPhase = false; +}; + +var pauseTimers = function () { + // Stops all currently active measurements so that they can be resumed + // if we continue in a later deferred loop from the same unit of work. + var fiber = currentFiber; + + while (fiber) { + if (fiber._debugIsCurrentlyTiming) { + endFiberMark(fiber, null, null); + } + + fiber = fiber.return; + } +}; + +var resumeTimersRecursively = function (fiber) { + if (fiber.return !== null) { + resumeTimersRecursively(fiber.return); + } + + if (fiber._debugIsCurrentlyTiming) { + beginFiberMark(fiber, null); + } +}; + +var resumeTimers = function () { + // Resumes all measurements that were active during the last deferred loop. + if (currentFiber !== null) { + resumeTimersRecursively(currentFiber); + } +}; + +function recordEffect() { + { + effectCountInCurrentCommit++; + } +} +function recordScheduleUpdate() { + { + if (isCommitting) { + hasScheduledUpdateInCurrentCommit = true; + } + + if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') { + hasScheduledUpdateInCurrentPhase = true; + } + } +} +function startWorkTimer(fiber) { + { + if (!supportsUserTiming || shouldIgnoreFiber(fiber)) { + return; + } // If we pause, this is the fiber to unwind from. + + + currentFiber = fiber; + + if (!beginFiberMark(fiber, null)) { + return; + } + + fiber._debugIsCurrentlyTiming = true; + } +} +function cancelWorkTimer(fiber) { + { + if (!supportsUserTiming || shouldIgnoreFiber(fiber)) { + return; + } // Remember we shouldn't complete measurement for this fiber. + // Otherwise flamechart will be deep even for small updates. + + + fiber._debugIsCurrentlyTiming = false; + clearFiberMark(fiber, null); + } +} +function stopWorkTimer(fiber) { + { + if (!supportsUserTiming || shouldIgnoreFiber(fiber)) { + return; + } // If we pause, its parent is the fiber to unwind from. + + + currentFiber = fiber.return; + + if (!fiber._debugIsCurrentlyTiming) { + return; + } + + fiber._debugIsCurrentlyTiming = false; + endFiberMark(fiber, null, null); + } +} +function stopFailedWorkTimer(fiber) { + { + if (!supportsUserTiming || shouldIgnoreFiber(fiber)) { + return; + } // If we pause, its parent is the fiber to unwind from. + + + currentFiber = fiber.return; + + if (!fiber._debugIsCurrentlyTiming) { + return; + } + + fiber._debugIsCurrentlyTiming = false; + var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary'; + endFiberMark(fiber, null, warning); + } +} +function startPhaseTimer(fiber, phase) { + { + if (!supportsUserTiming) { + return; + } + + clearPendingPhaseMeasurement(); + + if (!beginFiberMark(fiber, phase)) { + return; + } + + currentPhaseFiber = fiber; + currentPhase = phase; + } +} +function stopPhaseTimer() { + { + if (!supportsUserTiming) { + return; + } + + if (currentPhase !== null && currentPhaseFiber !== null) { + var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null; + endFiberMark(currentPhaseFiber, currentPhase, warning); + } + + currentPhase = null; + currentPhaseFiber = null; + } +} +function startWorkLoopTimer(nextUnitOfWork) { + { + currentFiber = nextUnitOfWork; + + if (!supportsUserTiming) { + return; + } + + commitCountInCurrentWorkLoop = 0; // This is top level call. + // Any other measurements are performed within. + + beginMark('(React Tree Reconciliation)'); // Resume any measurements that were in progress during the last loop. + + resumeTimers(); + } +} +function stopWorkLoopTimer(interruptedBy, didCompleteRoot) { + { + if (!supportsUserTiming) { + return; + } + + var warning = null; + + if (interruptedBy !== null) { + if (interruptedBy.tag === HostRoot) { + warning = 'A top-level update interrupted the previous render'; + } else { + var componentName = getComponentName(interruptedBy.type) || 'Unknown'; + warning = "An update to " + componentName + " interrupted the previous render"; + } + } else if (commitCountInCurrentWorkLoop > 1) { + warning = 'There were cascading updates'; + } + + commitCountInCurrentWorkLoop = 0; + var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop. + + pauseTimers(); + endMark(label, '(React Tree Reconciliation)', warning); + } +} +function startCommitTimer() { + { + if (!supportsUserTiming) { + return; + } + + isCommitting = true; + hasScheduledUpdateInCurrentCommit = false; + labelsInCurrentCommit.clear(); + beginMark('(Committing Changes)'); + } +} +function stopCommitTimer() { + { + if (!supportsUserTiming) { + return; + } + + var warning = null; + + if (hasScheduledUpdateInCurrentCommit) { + warning = 'Lifecycle hook scheduled a cascading update'; + } else if (commitCountInCurrentWorkLoop > 0) { + warning = 'Caused by a cascading update in earlier commit'; + } + + hasScheduledUpdateInCurrentCommit = false; + commitCountInCurrentWorkLoop++; + isCommitting = false; + labelsInCurrentCommit.clear(); + endMark('(Committing Changes)', '(Committing Changes)', warning); + } +} +function startCommitSnapshotEffectsTimer() { + { + if (!supportsUserTiming) { + return; + } + + effectCountInCurrentCommit = 0; + beginMark('(Committing Snapshot Effects)'); + } +} +function stopCommitSnapshotEffectsTimer() { + { + if (!supportsUserTiming) { + return; + } + + var count = effectCountInCurrentCommit; + effectCountInCurrentCommit = 0; + endMark("(Committing Snapshot Effects: " + count + " Total)", '(Committing Snapshot Effects)', null); + } +} +function startCommitHostEffectsTimer() { + { + if (!supportsUserTiming) { + return; + } + + effectCountInCurrentCommit = 0; + beginMark('(Committing Host Effects)'); + } +} +function stopCommitHostEffectsTimer() { + { + if (!supportsUserTiming) { + return; + } + + var count = effectCountInCurrentCommit; + effectCountInCurrentCommit = 0; + endMark("(Committing Host Effects: " + count + " Total)", '(Committing Host Effects)', null); + } +} +function startCommitLifeCyclesTimer() { + { + if (!supportsUserTiming) { + return; + } + + effectCountInCurrentCommit = 0; + beginMark('(Calling Lifecycle Methods)'); + } +} +function stopCommitLifeCyclesTimer() { + { + if (!supportsUserTiming) { + return; + } + + var count = effectCountInCurrentCommit; + effectCountInCurrentCommit = 0; + endMark("(Calling Lifecycle Methods: " + count + " Total)", '(Calling Lifecycle Methods)', null); + } +} + +var valueStack = []; +var fiberStack; + +{ + fiberStack = []; +} + +var index = -1; + +function createCursor(defaultValue) { + return { + current: defaultValue + }; +} + +function pop(cursor, fiber) { + if (index < 0) { + { + error('Unexpected pop.'); + } + + return; + } + + { + if (fiber !== fiberStack[index]) { + error('Unexpected Fiber popped.'); + } + } + + cursor.current = valueStack[index]; + valueStack[index] = null; + + { + fiberStack[index] = null; + } + + index--; +} + +function push(cursor, value, fiber) { + index++; + valueStack[index] = cursor.current; + + { + fiberStack[index] = fiber; + } + + cursor.current = value; +} + +var warnedAboutMissingGetChildContext; + +{ + warnedAboutMissingGetChildContext = {}; +} + +var emptyContextObject = {}; + +{ + Object.freeze(emptyContextObject); +} // A cursor to the current merged context object on the stack. + + +var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed. + +var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack. +// We use this to get access to the parent context after we have already +// pushed the next context provider, and now need to merge their contexts. + +var previousContext = emptyContextObject; + +function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) { + { + if (didPushOwnContextIfProvider && isContextProvider(Component)) { + // If the fiber is a context provider itself, when we read its context + // we may have already pushed its own child context on the stack. A context + // provider should not "see" its own child context. Therefore we read the + // previous (parent) context instead for a context provider. + return previousContext; + } + + return contextStackCursor.current; + } +} + +function cacheContext(workInProgress, unmaskedContext, maskedContext) { + { + var instance = workInProgress.stateNode; + instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext; + instance.__reactInternalMemoizedMaskedChildContext = maskedContext; + } +} + +function getMaskedContext(workInProgress, unmaskedContext) { + { + var type = workInProgress.type; + var contextTypes = type.contextTypes; + + if (!contextTypes) { + return emptyContextObject; + } // Avoid recreating masked context unless unmasked context has changed. + // Failing to do this will result in unnecessary calls to componentWillReceiveProps. + // This may trigger infinite loops if componentWillReceiveProps calls setState. + + + var instance = workInProgress.stateNode; + + if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) { + return instance.__reactInternalMemoizedMaskedChildContext; + } + + var context = {}; + + for (var key in contextTypes) { + context[key] = unmaskedContext[key]; + } + + { + var name = getComponentName(type) || 'Unknown'; + checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev); + } // Cache unmasked context so we can avoid recreating masked context unless necessary. + // Context is created before the class component is instantiated so check for instance. + + + if (instance) { + cacheContext(workInProgress, unmaskedContext, context); + } + + return context; + } +} + +function hasContextChanged() { + { + return didPerformWorkStackCursor.current; + } +} + +function isContextProvider(type) { + { + var childContextTypes = type.childContextTypes; + return childContextTypes !== null && childContextTypes !== undefined; + } +} + +function popContext(fiber) { + { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } +} + +function popTopLevelContextObject(fiber) { + { + pop(didPerformWorkStackCursor, fiber); + pop(contextStackCursor, fiber); + } +} + +function pushTopLevelContextObject(fiber, context, didChange) { + { + if (!(contextStackCursor.current === emptyContextObject)) { + { + throw Error( "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + push(contextStackCursor, context, fiber); + push(didPerformWorkStackCursor, didChange, fiber); + } +} + +function processChildContext(fiber, type, parentContext) { + { + var instance = fiber.stateNode; + var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future. + // It has only been added in Fiber to match the (unintentional) behavior in Stack. + + if (typeof instance.getChildContext !== 'function') { + { + var componentName = getComponentName(type) || 'Unknown'; + + if (!warnedAboutMissingGetChildContext[componentName]) { + warnedAboutMissingGetChildContext[componentName] = true; + + error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName); + } + } + + return parentContext; + } + + var childContext; + startPhaseTimer(fiber, 'getChildContext'); + childContext = instance.getChildContext(); + stopPhaseTimer(); + + for (var contextKey in childContext) { + if (!(contextKey in childContextTypes)) { + { + throw Error( (getComponentName(type) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes." ); + } + } + } + + { + var name = getComponentName(type) || 'Unknown'; + checkPropTypes(childContextTypes, childContext, 'child context', name, // In practice, there is one case in which we won't get a stack. It's when + // somebody calls unstable_renderSubtreeIntoContainer() and we process + // context from the parent component instance. The stack will be missing + // because it's outside of the reconciliation, and so the pointer has not + // been set. This is rare and doesn't matter. We'll also remove that API. + getCurrentFiberStackInDev); + } + + return _assign({}, parentContext, {}, childContext); + } +} + +function pushContextProvider(workInProgress) { + { + var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity. + // If the instance does not exist yet, we will push null at first, + // and replace it on the stack later when invalidating the context. + + var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later. + // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates. + + previousContext = contextStackCursor.current; + push(contextStackCursor, memoizedMergedChildContext, workInProgress); + push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); + return true; + } +} + +function invalidateContextProvider(workInProgress, type, didChange) { + { + var instance = workInProgress.stateNode; + + if (!instance) { + { + throw Error( "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + if (didChange) { + // Merge parent and own context. + // Skip this if we're not updating due to sCU. + // This avoids unnecessarily recomputing memoized values. + var mergedContext = processChildContext(workInProgress, type, previousContext); + instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one. + // It is important to unwind the context in the reverse order. + + pop(didPerformWorkStackCursor, workInProgress); + pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed. + + push(contextStackCursor, mergedContext, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } else { + pop(didPerformWorkStackCursor, workInProgress); + push(didPerformWorkStackCursor, didChange, workInProgress); + } + } +} + +function findCurrentUnmaskedContext(fiber) { + { + // Currently this is only used with renderSubtreeIntoContainer; not sure if it + // makes sense elsewhere + if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) { + { + throw Error( "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + var node = fiber; + + do { + switch (node.tag) { + case HostRoot: + return node.stateNode.context; + + case ClassComponent: + { + var Component = node.type; + + if (isContextProvider(Component)) { + return node.stateNode.__reactInternalMemoizedMergedChildContext; + } + + break; + } + } + + node = node.return; + } while (node !== null); + + { + { + throw Error( "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue." ); + } + } + } +} + +var LegacyRoot = 0; +var BlockingRoot = 1; +var ConcurrentRoot = 2; + +var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority, + Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback, + Scheduler_cancelCallback = Scheduler.unstable_cancelCallback, + Scheduler_shouldYield = Scheduler.unstable_shouldYield, + Scheduler_requestPaint = Scheduler.unstable_requestPaint, + Scheduler_now = Scheduler.unstable_now, + Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel, + Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority, + Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority, + Scheduler_NormalPriority = Scheduler.unstable_NormalPriority, + Scheduler_LowPriority = Scheduler.unstable_LowPriority, + Scheduler_IdlePriority = Scheduler.unstable_IdlePriority; + +{ + // Provide explicit error message when production+profiling bundle of e.g. + // react-dom is used with production (non-profiling) bundle of + // scheduler/tracing + if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) { + { + throw Error( "It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling" ); + } + } +} + +var fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use +// ascending numbers so we can compare them like numbers. They start at 90 to +// avoid clashing with Scheduler's priorities. + +var ImmediatePriority = 99; +var UserBlockingPriority$1 = 98; +var NormalPriority = 97; +var LowPriority = 96; +var IdlePriority = 95; // NoPriority is the absence of priority. Also React-only. + +var NoPriority = 90; +var shouldYield = Scheduler_shouldYield; +var requestPaint = // Fall back gracefully if we're running an older version of Scheduler. +Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {}; +var syncQueue = null; +var immediateQueueCallbackNode = null; +var isFlushingSyncQueue = false; +var initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly. +// This will be the case for modern browsers that support `performance.now`. In +// older browsers, Scheduler falls back to `Date.now`, which returns a Unix +// timestamp. In that case, subtract the module initialization time to simulate +// the behavior of performance.now and keep our times small enough to fit +// within 32 bits. +// TODO: Consider lifting this into Scheduler. + +var now = initialTimeMs < 10000 ? Scheduler_now : function () { + return Scheduler_now() - initialTimeMs; +}; +function getCurrentPriorityLevel() { + switch (Scheduler_getCurrentPriorityLevel()) { + case Scheduler_ImmediatePriority: + return ImmediatePriority; + + case Scheduler_UserBlockingPriority: + return UserBlockingPriority$1; + + case Scheduler_NormalPriority: + return NormalPriority; + + case Scheduler_LowPriority: + return LowPriority; + + case Scheduler_IdlePriority: + return IdlePriority; + + default: + { + { + throw Error( "Unknown priority level." ); + } + } + + } +} + +function reactPriorityToSchedulerPriority(reactPriorityLevel) { + switch (reactPriorityLevel) { + case ImmediatePriority: + return Scheduler_ImmediatePriority; + + case UserBlockingPriority$1: + return Scheduler_UserBlockingPriority; + + case NormalPriority: + return Scheduler_NormalPriority; + + case LowPriority: + return Scheduler_LowPriority; + + case IdlePriority: + return Scheduler_IdlePriority; + + default: + { + { + throw Error( "Unknown priority level." ); + } + } + + } +} + +function runWithPriority$1(reactPriorityLevel, fn) { + var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel); + return Scheduler_runWithPriority(priorityLevel, fn); +} +function scheduleCallback(reactPriorityLevel, callback, options) { + var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel); + return Scheduler_scheduleCallback(priorityLevel, callback, options); +} +function scheduleSyncCallback(callback) { + // Push this callback into an internal queue. We'll flush these either in + // the next tick, or earlier if something calls `flushSyncCallbackQueue`. + if (syncQueue === null) { + syncQueue = [callback]; // Flush the queue in the next tick, at the earliest. + + immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl); + } else { + // Push onto existing queue. Don't need to schedule a callback because + // we already scheduled one when we created the queue. + syncQueue.push(callback); + } + + return fakeCallbackNode; +} +function cancelCallback(callbackNode) { + if (callbackNode !== fakeCallbackNode) { + Scheduler_cancelCallback(callbackNode); + } +} +function flushSyncCallbackQueue() { + if (immediateQueueCallbackNode !== null) { + var node = immediateQueueCallbackNode; + immediateQueueCallbackNode = null; + Scheduler_cancelCallback(node); + } + + flushSyncCallbackQueueImpl(); +} + +function flushSyncCallbackQueueImpl() { + if (!isFlushingSyncQueue && syncQueue !== null) { + // Prevent re-entrancy. + isFlushingSyncQueue = true; + var i = 0; + + try { + var _isSync = true; + var queue = syncQueue; + runWithPriority$1(ImmediatePriority, function () { + for (; i < queue.length; i++) { + var callback = queue[i]; + + do { + callback = callback(_isSync); + } while (callback !== null); + } + }); + syncQueue = null; + } catch (error) { + // If something throws, leave the remaining callbacks on the queue. + if (syncQueue !== null) { + syncQueue = syncQueue.slice(i + 1); + } // Resume flushing in the next tick + + + Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue); + throw error; + } finally { + isFlushingSyncQueue = false; + } + } +} + +var NoMode = 0; +var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root +// tag instead + +var BlockingMode = 2; +var ConcurrentMode = 4; +var ProfileMode = 8; + +// Max 31 bit integer. The max integer size in V8 for 32-bit systems. +// Math.pow(2, 30) - 1 +// 0b111111111111111111111111111111 +var MAX_SIGNED_31_BIT_INT = 1073741823; + +var NoWork = 0; // TODO: Think of a better name for Never. The key difference with Idle is that +// Never work can be committed in an inconsistent state without tearing the UI. +// The main example is offscreen content, like a hidden subtree. So one possible +// name is Offscreen. However, it also includes dehydrated Suspense boundaries, +// which are inconsistent in the sense that they haven't finished yet, but +// aren't visibly inconsistent because the server rendered HTML matches what the +// hydrated tree would look like. + +var Never = 1; // Idle is slightly higher priority than Never. It must completely finish in +// order to be consistent. + +var Idle = 2; // Continuous Hydration is slightly higher than Idle and is used to increase +// priority of hover targets. + +var ContinuousHydration = 3; +var Sync = MAX_SIGNED_31_BIT_INT; +var Batched = Sync - 1; +var UNIT_SIZE = 10; +var MAGIC_NUMBER_OFFSET = Batched - 1; // 1 unit of expiration time represents 10ms. + +function msToExpirationTime(ms) { + // Always subtract from the offset so that we don't clash with the magic number for NoWork. + return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0); +} +function expirationTimeToMs(expirationTime) { + return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE; +} + +function ceiling(num, precision) { + return ((num / precision | 0) + 1) * precision; +} + +function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) { + return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE); +} // TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update +// the names to reflect. + + +var LOW_PRIORITY_EXPIRATION = 5000; +var LOW_PRIORITY_BATCH_SIZE = 250; +function computeAsyncExpiration(currentTime) { + return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE); +} +function computeSuspenseExpiration(currentTime, timeoutMs) { + // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time? + return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE); +} // We intentionally set a higher expiration time for interactive updates in +// dev than in production. +// +// If the main thread is being blocked so long that you hit the expiration, +// it's a problem that could be solved with better scheduling. +// +// People will be more likely to notice this and fix it with the long +// expiration time in development. +// +// In production we opt for better UX at the risk of masking scheduling +// problems, by expiring fast. + +var HIGH_PRIORITY_EXPIRATION = 500 ; +var HIGH_PRIORITY_BATCH_SIZE = 100; +function computeInteractiveExpiration(currentTime) { + return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE); +} +function inferPriorityFromExpirationTime(currentTime, expirationTime) { + if (expirationTime === Sync) { + return ImmediatePriority; + } + + if (expirationTime === Never || expirationTime === Idle) { + return IdlePriority; + } + + var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime); + + if (msUntil <= 0) { + return ImmediatePriority; + } + + if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) { + return UserBlockingPriority$1; + } + + if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) { + return NormalPriority; + } // TODO: Handle LowPriority + // Assume anything lower has idle priority + + + return IdlePriority; +} + +var ReactStrictModeWarnings = { + recordUnsafeLifecycleWarnings: function (fiber, instance) {}, + flushPendingUnsafeLifecycleWarnings: function () {}, + recordLegacyContextWarning: function (fiber, instance) {}, + flushLegacyContextWarning: function () {}, + discardPendingWarnings: function () {} +}; + +{ + var findStrictRoot = function (fiber) { + var maybeStrictRoot = null; + var node = fiber; + + while (node !== null) { + if (node.mode & StrictMode) { + maybeStrictRoot = node; + } + + node = node.return; + } + + return maybeStrictRoot; + }; + + var setToSortedString = function (set) { + var array = []; + set.forEach(function (value) { + array.push(value); + }); + return array.sort().join(', '); + }; + + var pendingComponentWillMountWarnings = []; + var pendingUNSAFE_ComponentWillMountWarnings = []; + var pendingComponentWillReceivePropsWarnings = []; + var pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + var pendingComponentWillUpdateWarnings = []; + var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about. + + var didWarnAboutUnsafeLifecycles = new Set(); + + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) { + // Dedup strategy: Warn once per component. + if (didWarnAboutUnsafeLifecycles.has(fiber.type)) { + return; + } + + if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components. + instance.componentWillMount.__suppressDeprecationWarning !== true) { + pendingComponentWillMountWarnings.push(fiber); + } + + if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') { + pendingUNSAFE_ComponentWillMountWarnings.push(fiber); + } + + if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + pendingComponentWillReceivePropsWarnings.push(fiber); + } + + if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber); + } + + if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + pendingComponentWillUpdateWarnings.push(fiber); + } + + if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') { + pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber); + } + }; + + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () { + // We do an initial pass to gather component names + var componentWillMountUniqueNames = new Set(); + + if (pendingComponentWillMountWarnings.length > 0) { + pendingComponentWillMountWarnings.forEach(function (fiber) { + componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component'); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillMountWarnings = []; + } + + var UNSAFE_componentWillMountUniqueNames = new Set(); + + if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) { + pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) { + UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component'); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillMountWarnings = []; + } + + var componentWillReceivePropsUniqueNames = new Set(); + + if (pendingComponentWillReceivePropsWarnings.length > 0) { + pendingComponentWillReceivePropsWarnings.forEach(function (fiber) { + componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component'); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillReceivePropsWarnings = []; + } + + var UNSAFE_componentWillReceivePropsUniqueNames = new Set(); + + if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) { + pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) { + UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component'); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + } + + var componentWillUpdateUniqueNames = new Set(); + + if (pendingComponentWillUpdateWarnings.length > 0) { + pendingComponentWillUpdateWarnings.forEach(function (fiber) { + componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component'); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingComponentWillUpdateWarnings = []; + } + + var UNSAFE_componentWillUpdateUniqueNames = new Set(); + + if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) { + pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) { + UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component'); + didWarnAboutUnsafeLifecycles.add(fiber.type); + }); + pendingUNSAFE_ComponentWillUpdateWarnings = []; + } // Finally, we flush all the warnings + // UNSAFE_ ones before the deprecated ones, since they'll be 'louder' + + + if (UNSAFE_componentWillMountUniqueNames.size > 0) { + var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames); + + error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames); + } + + if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) { + var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames); + + error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '\nPlease update the following components: %s', _sortedNames); + } + + if (UNSAFE_componentWillUpdateUniqueNames.size > 0) { + var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames); + + error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2); + } + + if (componentWillMountUniqueNames.size > 0) { + var _sortedNames3 = setToSortedString(componentWillMountUniqueNames); + + warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3); + } + + if (componentWillReceivePropsUniqueNames.size > 0) { + var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames); + + warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4); + } + + if (componentWillUpdateUniqueNames.size > 0) { + var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames); + + warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5); + } + }; + + var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about. + + var didWarnAboutLegacyContext = new Set(); + + ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) { + var strictRoot = findStrictRoot(fiber); + + if (strictRoot === null) { + error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.'); + + return; + } // Dedup strategy: Warn once per component. + + + if (didWarnAboutLegacyContext.has(fiber.type)) { + return; + } + + var warningsForRoot = pendingLegacyContextWarning.get(strictRoot); + + if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') { + if (warningsForRoot === undefined) { + warningsForRoot = []; + pendingLegacyContextWarning.set(strictRoot, warningsForRoot); + } + + warningsForRoot.push(fiber); + } + }; + + ReactStrictModeWarnings.flushLegacyContextWarning = function () { + pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) { + if (fiberArray.length === 0) { + return; + } + + var firstFiber = fiberArray[0]; + var uniqueNames = new Set(); + fiberArray.forEach(function (fiber) { + uniqueNames.add(getComponentName(fiber.type) || 'Component'); + didWarnAboutLegacyContext.add(fiber.type); + }); + var sortedNames = setToSortedString(uniqueNames); + var firstComponentStack = getStackByFiberInDevAndProd(firstFiber); + + error('Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, firstComponentStack); + }); + }; + + ReactStrictModeWarnings.discardPendingWarnings = function () { + pendingComponentWillMountWarnings = []; + pendingUNSAFE_ComponentWillMountWarnings = []; + pendingComponentWillReceivePropsWarnings = []; + pendingUNSAFE_ComponentWillReceivePropsWarnings = []; + pendingComponentWillUpdateWarnings = []; + pendingUNSAFE_ComponentWillUpdateWarnings = []; + pendingLegacyContextWarning = new Map(); + }; +} + +var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below. + +var failedBoundaries = null; +var setRefreshHandler = function (handler) { + { + resolveFamily = handler; + } +}; +function resolveFunctionForHotReloading(type) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return type; + } + + var family = resolveFamily(type); + + if (family === undefined) { + return type; + } // Use the latest known implementation. + + + return family.current; + } +} +function resolveClassForHotReloading(type) { + // No implementation differences. + return resolveFunctionForHotReloading(type); +} +function resolveForwardRefForHotReloading(type) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return type; + } + + var family = resolveFamily(type); + + if (family === undefined) { + // Check if we're dealing with a real forwardRef. Don't want to crash early. + if (type !== null && type !== undefined && typeof type.render === 'function') { + // ForwardRef is special because its resolved .type is an object, + // but it's possible that we only have its inner render function in the map. + // If that inner render function is different, we'll build a new forwardRef type. + var currentRender = resolveFunctionForHotReloading(type.render); + + if (type.render !== currentRender) { + var syntheticType = { + $$typeof: REACT_FORWARD_REF_TYPE, + render: currentRender + }; + + if (type.displayName !== undefined) { + syntheticType.displayName = type.displayName; + } + + return syntheticType; + } + } + + return type; + } // Use the latest known implementation. + + + return family.current; + } +} +function isCompatibleFamilyForHotReloading(fiber, element) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return false; + } + + var prevType = fiber.elementType; + var nextType = element.type; // If we got here, we know types aren't === equal. + + var needsCompareFamilies = false; + var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null; + + switch (fiber.tag) { + case ClassComponent: + { + if (typeof nextType === 'function') { + needsCompareFamilies = true; + } + + break; + } + + case FunctionComponent: + { + if (typeof nextType === 'function') { + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + // We don't know the inner type yet. + // We're going to assume that the lazy inner type is stable, + // and so it is sufficient to avoid reconciling it away. + // We're not going to unwrap or actually use the new lazy type. + needsCompareFamilies = true; + } + + break; + } + + case ForwardRef: + { + if ($$typeofNextType === REACT_FORWARD_REF_TYPE) { + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + needsCompareFamilies = true; + } + + break; + } + + case MemoComponent: + case SimpleMemoComponent: + { + if ($$typeofNextType === REACT_MEMO_TYPE) { + // TODO: if it was but can no longer be simple, + // we shouldn't set this. + needsCompareFamilies = true; + } else if ($$typeofNextType === REACT_LAZY_TYPE) { + needsCompareFamilies = true; + } + + break; + } + + default: + return false; + } // Check if both types have a family and it's the same one. + + + if (needsCompareFamilies) { + // Note: memo() and forwardRef() we'll compare outer rather than inner type. + // This means both of them need to be registered to preserve state. + // If we unwrapped and compared the inner types for wrappers instead, + // then we would risk falsely saying two separate memo(Foo) + // calls are equivalent because they wrap the same Foo function. + var prevFamily = resolveFamily(prevType); + + if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) { + return true; + } + } + + return false; + } +} +function markFailedErrorBoundaryForHotReloading(fiber) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return; + } + + if (typeof WeakSet !== 'function') { + return; + } + + if (failedBoundaries === null) { + failedBoundaries = new WeakSet(); + } + + failedBoundaries.add(fiber); + } +} +var scheduleRefresh = function (root, update) { + { + if (resolveFamily === null) { + // Hot reloading is disabled. + return; + } + + var staleFamilies = update.staleFamilies, + updatedFamilies = update.updatedFamilies; + flushPassiveEffects(); + flushSync(function () { + scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies); + }); + } +}; +var scheduleRoot = function (root, element) { + { + if (root.context !== emptyContextObject) { + // Super edge case: root has a legacy _renderSubtree context + // but we don't know the parentComponent so we can't pass it. + // Just ignore. We'll delete this with _renderSubtree code path later. + return; + } + + flushPassiveEffects(); + syncUpdates(function () { + updateContainer(element, root, null, null); + }); + } +}; + +function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) { + { + var alternate = fiber.alternate, + child = fiber.child, + sibling = fiber.sibling, + tag = fiber.tag, + type = fiber.type; + var candidateType = null; + + switch (tag) { + case FunctionComponent: + case SimpleMemoComponent: + case ClassComponent: + candidateType = type; + break; + + case ForwardRef: + candidateType = type.render; + break; + } + + if (resolveFamily === null) { + throw new Error('Expected resolveFamily to be set during hot reload.'); + } + + var needsRender = false; + var needsRemount = false; + + if (candidateType !== null) { + var family = resolveFamily(candidateType); + + if (family !== undefined) { + if (staleFamilies.has(family)) { + needsRemount = true; + } else if (updatedFamilies.has(family)) { + if (tag === ClassComponent) { + needsRemount = true; + } else { + needsRender = true; + } + } + } + } + + if (failedBoundaries !== null) { + if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) { + needsRemount = true; + } + } + + if (needsRemount) { + fiber._debugNeedsRemount = true; + } + + if (needsRemount || needsRender) { + scheduleWork(fiber, Sync); + } + + if (child !== null && !needsRemount) { + scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies); + } + + if (sibling !== null) { + scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies); + } + } +} + +var findHostInstancesForRefresh = function (root, families) { + { + var hostInstances = new Set(); + var types = new Set(families.map(function (family) { + return family.current; + })); + findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances); + return hostInstances; + } +}; + +function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) { + { + var child = fiber.child, + sibling = fiber.sibling, + tag = fiber.tag, + type = fiber.type; + var candidateType = null; + + switch (tag) { + case FunctionComponent: + case SimpleMemoComponent: + case ClassComponent: + candidateType = type; + break; + + case ForwardRef: + candidateType = type.render; + break; + } + + var didMatch = false; + + if (candidateType !== null) { + if (types.has(candidateType)) { + didMatch = true; + } + } + + if (didMatch) { + // We have a match. This only drills down to the closest host components. + // There's no need to search deeper because for the purpose of giving + // visual feedback, "flashing" outermost parent rectangles is sufficient. + findHostInstancesForFiberShallowly(fiber, hostInstances); + } else { + // If there's no match, maybe there will be one further down in the child tree. + if (child !== null) { + findHostInstancesForMatchingFibersRecursively(child, types, hostInstances); + } + } + + if (sibling !== null) { + findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances); + } + } +} + +function findHostInstancesForFiberShallowly(fiber, hostInstances) { + { + var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances); + + if (foundHostInstances) { + return; + } // If we didn't find any host children, fallback to closest host parent. + + + var node = fiber; + + while (true) { + switch (node.tag) { + case HostComponent: + hostInstances.add(node.stateNode); + return; + + case HostPortal: + hostInstances.add(node.stateNode.containerInfo); + return; + + case HostRoot: + hostInstances.add(node.stateNode.containerInfo); + return; + } + + if (node.return === null) { + throw new Error('Expected to reach root first.'); + } + + node = node.return; + } + } +} + +function findChildHostInstancesForFiberShallowly(fiber, hostInstances) { + { + var node = fiber; + var foundHostInstances = false; + + while (true) { + if (node.tag === HostComponent) { + // We got a match. + foundHostInstances = true; + hostInstances.add(node.stateNode); // There may still be more, so keep searching. + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === fiber) { + return foundHostInstances; + } + + while (node.sibling === null) { + if (node.return === null || node.return === fiber) { + return foundHostInstances; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + } + + return false; +} + +function resolveDefaultProps(Component, baseProps) { + if (Component && Component.defaultProps) { + // Resolve default props. Taken from ReactElement + var props = _assign({}, baseProps); + + var defaultProps = Component.defaultProps; + + for (var propName in defaultProps) { + if (props[propName] === undefined) { + props[propName] = defaultProps[propName]; + } + } + + return props; + } + + return baseProps; +} +function readLazyComponentType(lazyComponent) { + initializeLazyComponentType(lazyComponent); + + if (lazyComponent._status !== Resolved) { + throw lazyComponent._result; + } + + return lazyComponent._result; +} + +var valueCursor = createCursor(null); +var rendererSigil; + +{ + // Use this to detect multiple renderers using the same context + rendererSigil = {}; +} + +var currentlyRenderingFiber = null; +var lastContextDependency = null; +var lastContextWithAllBitsObserved = null; +var isDisallowedContextReadInDEV = false; +function resetContextDependencies() { + // This is called right before React yields execution, to ensure `readContext` + // cannot be called outside the render phase. + currentlyRenderingFiber = null; + lastContextDependency = null; + lastContextWithAllBitsObserved = null; + + { + isDisallowedContextReadInDEV = false; + } +} +function enterDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = true; + } +} +function exitDisallowedContextReadInDEV() { + { + isDisallowedContextReadInDEV = false; + } +} +function pushProvider(providerFiber, nextValue) { + var context = providerFiber.type._context; + + { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + + { + if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) { + error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.'); + } + + context._currentRenderer = rendererSigil; + } + } +} +function popProvider(providerFiber) { + var currentValue = valueCursor.current; + pop(valueCursor, providerFiber); + var context = providerFiber.type._context; + + { + context._currentValue = currentValue; + } +} +function calculateChangedBits(context, newValue, oldValue) { + if (objectIs(oldValue, newValue)) { + // No change + return 0; + } else { + var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; + + { + if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) { + error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits); + } + } + + return changedBits | 0; + } +} +function scheduleWorkOnParentPath(parent, renderExpirationTime) { + // Update the child expiration time of all the ancestors, including + // the alternates. + var node = parent; + + while (node !== null) { + var alternate = node.alternate; + + if (node.childExpirationTime < renderExpirationTime) { + node.childExpirationTime = renderExpirationTime; + + if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { + alternate.childExpirationTime = renderExpirationTime; + } + } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) { + alternate.childExpirationTime = renderExpirationTime; + } else { + // Neither alternate was updated, which means the rest of the + // ancestor path already has sufficient priority. + break; + } + + node = node.return; + } +} +function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) { + var fiber = workInProgress.child; + + if (fiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + fiber.return = workInProgress; + } + + while (fiber !== null) { + var nextFiber = void 0; // Visit this fiber. + + var list = fiber.dependencies; + + if (list !== null) { + nextFiber = fiber.child; + var dependency = list.firstContext; + + while (dependency !== null) { + // Check if the context matches. + if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) { + // Match! Schedule an update on this fiber. + if (fiber.tag === ClassComponent) { + // Schedule a force update on the work-in-progress. + var update = createUpdate(renderExpirationTime, null); + update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the + // update to the current fiber, too, which means it will persist even if + // this render is thrown away. Since it's a race condition, not sure it's + // worth fixing. + + enqueueUpdate(fiber, update); + } + + if (fiber.expirationTime < renderExpirationTime) { + fiber.expirationTime = renderExpirationTime; + } + + var alternate = fiber.alternate; + + if (alternate !== null && alternate.expirationTime < renderExpirationTime) { + alternate.expirationTime = renderExpirationTime; + } + + scheduleWorkOnParentPath(fiber.return, renderExpirationTime); // Mark the expiration time on the list, too. + + if (list.expirationTime < renderExpirationTime) { + list.expirationTime = renderExpirationTime; + } // Since we already found a match, we can stop traversing the + // dependency list. + + + break; + } + + dependency = dependency.next; + } + } else if (fiber.tag === ContextProvider) { + // Don't scan deeper if this is a matching provider + nextFiber = fiber.type === workInProgress.type ? null : fiber.child; + } else { + // Traverse down. + nextFiber = fiber.child; + } + + if (nextFiber !== null) { + // Set the return pointer of the child to the work-in-progress fiber. + nextFiber.return = fiber; + } else { + // No child. Traverse to next sibling. + nextFiber = fiber; + + while (nextFiber !== null) { + if (nextFiber === workInProgress) { + // We're back to the root of this subtree. Exit. + nextFiber = null; + break; + } + + var sibling = nextFiber.sibling; + + if (sibling !== null) { + // Set the return pointer of the sibling to the work-in-progress fiber. + sibling.return = nextFiber.return; + nextFiber = sibling; + break; + } // No more siblings. Traverse up. + + + nextFiber = nextFiber.return; + } + } + + fiber = nextFiber; + } +} +function prepareToReadContext(workInProgress, renderExpirationTime) { + currentlyRenderingFiber = workInProgress; + lastContextDependency = null; + lastContextWithAllBitsObserved = null; + var dependencies = workInProgress.dependencies; + + if (dependencies !== null) { + var firstContext = dependencies.firstContext; + + if (firstContext !== null) { + if (dependencies.expirationTime >= renderExpirationTime) { + // Context list has a pending update. Mark that this fiber performed work. + markWorkInProgressReceivedUpdate(); + } // Reset the work-in-progress list + + + dependencies.firstContext = null; + } + } +} +function readContext(context, observedBits) { + { + // This warning would fire if you read context inside a Hook like useMemo. + // Unlike the class check below, it's not enforced in production for perf. + if (isDisallowedContextReadInDEV) { + error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); + } + } + + if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else { + var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types. + + if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) { + // Observe all updates. + lastContextWithAllBitsObserved = context; + resolvedObservedBits = MAX_SIGNED_31_BIT_INT; + } else { + resolvedObservedBits = observedBits; + } + + var contextItem = { + context: context, + observedBits: resolvedObservedBits, + next: null + }; + + if (lastContextDependency === null) { + if (!(currentlyRenderingFiber !== null)) { + { + throw Error( "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()." ); + } + } // This is the first dependency for this component. Create a new list. + + + lastContextDependency = contextItem; + currentlyRenderingFiber.dependencies = { + expirationTime: NoWork, + firstContext: contextItem, + responders: null + }; + } else { + // Append a new context item. + lastContextDependency = lastContextDependency.next = contextItem; + } + } + + return context._currentValue ; +} + +var UpdateState = 0; +var ReplaceState = 1; +var ForceUpdate = 2; +var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`. +// It should only be read right after calling `processUpdateQueue`, via +// `checkHasForceUpdateAfterProcessing`. + +var hasForceUpdate = false; +var didWarnUpdateInsideUpdate; +var currentlyProcessingQueue; + +{ + didWarnUpdateInsideUpdate = false; + currentlyProcessingQueue = null; +} + +function initializeUpdateQueue(fiber) { + var queue = { + baseState: fiber.memoizedState, + baseQueue: null, + shared: { + pending: null + }, + effects: null + }; + fiber.updateQueue = queue; +} +function cloneUpdateQueue(current, workInProgress) { + // Clone the update queue from current. Unless it's already a clone. + var queue = workInProgress.updateQueue; + var currentQueue = current.updateQueue; + + if (queue === currentQueue) { + var clone = { + baseState: currentQueue.baseState, + baseQueue: currentQueue.baseQueue, + shared: currentQueue.shared, + effects: currentQueue.effects + }; + workInProgress.updateQueue = clone; + } +} +function createUpdate(expirationTime, suspenseConfig) { + var update = { + expirationTime: expirationTime, + suspenseConfig: suspenseConfig, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; + update.next = update; + + { + update.priority = getCurrentPriorityLevel(); + } + + return update; +} +function enqueueUpdate(fiber, update) { + var updateQueue = fiber.updateQueue; + + if (updateQueue === null) { + // Only occurs if the fiber has been unmounted. + return; + } + + var sharedQueue = updateQueue.shared; + var pending = sharedQueue.pending; + + if (pending === null) { + // This is the first update. Create a circular list. + update.next = update; + } else { + update.next = pending.next; + pending.next = update; + } + + sharedQueue.pending = update; + + { + if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) { + error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); + + didWarnUpdateInsideUpdate = true; + } + } +} +function enqueueCapturedUpdate(workInProgress, update) { + var current = workInProgress.alternate; + + if (current !== null) { + // Ensure the work-in-progress queue is a clone + cloneUpdateQueue(current, workInProgress); + } // Captured updates go only on the work-in-progress queue. + + + var queue = workInProgress.updateQueue; // Append the update to the end of the list. + + var last = queue.baseQueue; + + if (last === null) { + queue.baseQueue = update.next = update; + update.next = update; + } else { + update.next = last.next; + last.next = update; + } +} + +function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { + switch (update.tag) { + case ReplaceState: + { + var payload = update.payload; + + if (typeof payload === 'function') { + // Updater function + { + enterDisallowedContextReadInDEV(); + + if ( workInProgress.mode & StrictMode) { + payload.call(instance, prevState, nextProps); + } + } + + var nextState = payload.call(instance, prevState, nextProps); + + { + exitDisallowedContextReadInDEV(); + } + + return nextState; + } // State object + + + return payload; + } + + case CaptureUpdate: + { + workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture; + } + // Intentional fallthrough + + case UpdateState: + { + var _payload = update.payload; + var partialState; + + if (typeof _payload === 'function') { + // Updater function + { + enterDisallowedContextReadInDEV(); + + if ( workInProgress.mode & StrictMode) { + _payload.call(instance, prevState, nextProps); + } + } + + partialState = _payload.call(instance, prevState, nextProps); + + { + exitDisallowedContextReadInDEV(); + } + } else { + // Partial state object + partialState = _payload; + } + + if (partialState === null || partialState === undefined) { + // Null and undefined are treated as no-ops. + return prevState; + } // Merge the partial state and the previous state. + + + return _assign({}, prevState, partialState); + } + + case ForceUpdate: + { + hasForceUpdate = true; + return prevState; + } + } + + return prevState; +} + +function processUpdateQueue(workInProgress, props, instance, renderExpirationTime) { + // This is always non-null on a ClassComponent or HostRoot + var queue = workInProgress.updateQueue; + hasForceUpdate = false; + + { + currentlyProcessingQueue = queue.shared; + } // The last rebase update that is NOT part of the base state. + + + var baseQueue = queue.baseQueue; // The last pending update that hasn't been processed yet. + + var pendingQueue = queue.shared.pending; + + if (pendingQueue !== null) { + // We have new updates that haven't been processed yet. + // We'll add them to the base queue. + if (baseQueue !== null) { + // Merge the pending queue and the base queue. + var baseFirst = baseQueue.next; + var pendingFirst = pendingQueue.next; + baseQueue.next = pendingFirst; + pendingQueue.next = baseFirst; + } + + baseQueue = pendingQueue; + queue.shared.pending = null; // TODO: Pass `current` as argument + + var current = workInProgress.alternate; + + if (current !== null) { + var currentQueue = current.updateQueue; + + if (currentQueue !== null) { + currentQueue.baseQueue = pendingQueue; + } + } + } // These values may change as we process the queue. + + + if (baseQueue !== null) { + var first = baseQueue.next; // Iterate through the list of updates to compute the result. + + var newState = queue.baseState; + var newExpirationTime = NoWork; + var newBaseState = null; + var newBaseQueueFirst = null; + var newBaseQueueLast = null; + + if (first !== null) { + var update = first; + + do { + var updateExpirationTime = update.expirationTime; + + if (updateExpirationTime < renderExpirationTime) { + // Priority is insufficient. Skip this update. If this is the first + // skipped update, the previous update/state is the new base + // update/state. + var clone = { + expirationTime: update.expirationTime, + suspenseConfig: update.suspenseConfig, + tag: update.tag, + payload: update.payload, + callback: update.callback, + next: null + }; + + if (newBaseQueueLast === null) { + newBaseQueueFirst = newBaseQueueLast = clone; + newBaseState = newState; + } else { + newBaseQueueLast = newBaseQueueLast.next = clone; + } // Update the remaining priority in the queue. + + + if (updateExpirationTime > newExpirationTime) { + newExpirationTime = updateExpirationTime; + } + } else { + // This update does have sufficient priority. + if (newBaseQueueLast !== null) { + var _clone = { + expirationTime: Sync, + // This update is going to be committed so we never want uncommit it. + suspenseConfig: update.suspenseConfig, + tag: update.tag, + payload: update.payload, + callback: update.callback, + next: null + }; + newBaseQueueLast = newBaseQueueLast.next = _clone; + } // Mark the event time of this update as relevant to this render pass. + // TODO: This should ideally use the true event time of this update rather than + // its priority which is a derived and not reverseable value. + // TODO: We should skip this update if it was already committed but currently + // we have no way of detecting the difference between a committed and suspended + // update here. + + + markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update. + + newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance); + var callback = update.callback; + + if (callback !== null) { + workInProgress.effectTag |= Callback; + var effects = queue.effects; + + if (effects === null) { + queue.effects = [update]; + } else { + effects.push(update); + } + } + } + + update = update.next; + + if (update === null || update === first) { + pendingQueue = queue.shared.pending; + + if (pendingQueue === null) { + break; + } else { + // An update was scheduled from inside a reducer. Add the new + // pending updates to the end of the list and keep processing. + update = baseQueue.next = pendingQueue.next; + pendingQueue.next = first; + queue.baseQueue = baseQueue = pendingQueue; + queue.shared.pending = null; + } + } + } while (true); + } + + if (newBaseQueueLast === null) { + newBaseState = newState; + } else { + newBaseQueueLast.next = newBaseQueueFirst; + } + + queue.baseState = newBaseState; + queue.baseQueue = newBaseQueueLast; // Set the remaining expiration time to be whatever is remaining in the queue. + // This should be fine because the only two other things that contribute to + // expiration time are props and context. We're already in the middle of the + // begin phase by the time we start processing the queue, so we've already + // dealt with the props. Context in components that specify + // shouldComponentUpdate is tricky; but we'll have to account for + // that regardless. + + markUnprocessedUpdateTime(newExpirationTime); + workInProgress.expirationTime = newExpirationTime; + workInProgress.memoizedState = newState; + } + + { + currentlyProcessingQueue = null; + } +} + +function callCallback(callback, context) { + if (!(typeof callback === 'function')) { + { + throw Error( "Invalid argument passed as callback. Expected a function. Instead received: " + callback ); + } + } + + callback.call(context); +} + +function resetHasForceUpdateBeforeProcessing() { + hasForceUpdate = false; +} +function checkHasForceUpdateAfterProcessing() { + return hasForceUpdate; +} +function commitUpdateQueue(finishedWork, finishedQueue, instance) { + // Commit the effects + var effects = finishedQueue.effects; + finishedQueue.effects = null; + + if (effects !== null) { + for (var i = 0; i < effects.length; i++) { + var effect = effects[i]; + var callback = effect.callback; + + if (callback !== null) { + effect.callback = null; + callCallback(callback, instance); + } + } + } +} + +var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; +function requestCurrentSuspenseConfig() { + return ReactCurrentBatchConfig.suspense; +} + +var fakeInternalInstance = {}; +var isArray = Array.isArray; // React.Component uses a shared frozen object by default. +// We'll use it to determine whether we need to initialize legacy refs. + +var emptyRefsObject = new React.Component().refs; +var didWarnAboutStateAssignmentForComponent; +var didWarnAboutUninitializedState; +var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate; +var didWarnAboutLegacyLifecyclesAndDerivedState; +var didWarnAboutUndefinedDerivedState; +var warnOnUndefinedDerivedState; +var warnOnInvalidCallback; +var didWarnAboutDirectlyAssigningPropsToState; +var didWarnAboutContextTypeAndContextTypes; +var didWarnAboutInvalidateContextType; + +{ + didWarnAboutStateAssignmentForComponent = new Set(); + didWarnAboutUninitializedState = new Set(); + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + didWarnAboutDirectlyAssigningPropsToState = new Set(); + didWarnAboutUndefinedDerivedState = new Set(); + didWarnAboutContextTypeAndContextTypes = new Set(); + didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + + warnOnInvalidCallback = function (callback, callerName) { + if (callback === null || typeof callback === 'function') { + return; + } + + var key = callerName + "_" + callback; + + if (!didWarnOnInvalidCallback.has(key)) { + didWarnOnInvalidCallback.add(key); + + error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); + } + }; + + warnOnUndefinedDerivedState = function (type, partialState) { + if (partialState === undefined) { + var componentName = getComponentName(type) || 'Component'; + + if (!didWarnAboutUndefinedDerivedState.has(componentName)) { + didWarnAboutUndefinedDerivedState.add(componentName); + + error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName); + } + } + }; // This is so gross but it's at least non-critical and can be removed if + // it causes problems. This is meant to give a nicer error message for + // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, + // ...)) which otherwise throws a "_processChildContext is not a function" + // exception. + + + Object.defineProperty(fakeInternalInstance, '_processChildContext', { + enumerable: false, + value: function () { + { + { + throw Error( "_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal)." ); + } + } + } + }); + Object.freeze(fakeInternalInstance); +} + +function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { + var prevState = workInProgress.memoizedState; + + { + if ( workInProgress.mode & StrictMode) { + // Invoke the function an extra time to help detect side-effects. + getDerivedStateFromProps(nextProps, prevState); + } + } + + var partialState = getDerivedStateFromProps(nextProps, prevState); + + { + warnOnUndefinedDerivedState(ctor, partialState); + } // Merge the partial state and the previous state. + + + var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState); + workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the + // base state. + + if (workInProgress.expirationTime === NoWork) { + // Queue is always non-null for classes + var updateQueue = workInProgress.updateQueue; + updateQueue.baseState = memoizedState; + } +} +var classComponentUpdater = { + isMounted: isMounted, + enqueueSetState: function (inst, payload, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTimeForUpdate(); + var suspenseConfig = requestCurrentSuspenseConfig(); + var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig); + var update = createUpdate(expirationTime, suspenseConfig); + update.payload = payload; + + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, 'setState'); + } + + update.callback = callback; + } + + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); + }, + enqueueReplaceState: function (inst, payload, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTimeForUpdate(); + var suspenseConfig = requestCurrentSuspenseConfig(); + var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig); + var update = createUpdate(expirationTime, suspenseConfig); + update.tag = ReplaceState; + update.payload = payload; + + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, 'replaceState'); + } + + update.callback = callback; + } + + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); + }, + enqueueForceUpdate: function (inst, callback) { + var fiber = get(inst); + var currentTime = requestCurrentTimeForUpdate(); + var suspenseConfig = requestCurrentSuspenseConfig(); + var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig); + var update = createUpdate(expirationTime, suspenseConfig); + update.tag = ForceUpdate; + + if (callback !== undefined && callback !== null) { + { + warnOnInvalidCallback(callback, 'forceUpdate'); + } + + update.callback = callback; + } + + enqueueUpdate(fiber, update); + scheduleWork(fiber, expirationTime); + } +}; + +function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { + var instance = workInProgress.stateNode; + + if (typeof instance.shouldComponentUpdate === 'function') { + { + if ( workInProgress.mode & StrictMode) { + // Invoke the function an extra time to help detect side-effects. + instance.shouldComponentUpdate(newProps, newState, nextContext); + } + } + + startPhaseTimer(workInProgress, 'shouldComponentUpdate'); + var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); + stopPhaseTimer(); + + { + if (shouldUpdate === undefined) { + error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component'); + } + } + + return shouldUpdate; + } + + if (ctor.prototype && ctor.prototype.isPureReactComponent) { + return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); + } + + return true; +} + +function checkClassInstance(workInProgress, ctor, newProps) { + var instance = workInProgress.stateNode; + + { + var name = getComponentName(ctor) || 'Component'; + var renderPresent = instance.render; + + if (!renderPresent) { + if (ctor.prototype && typeof ctor.prototype.render === 'function') { + error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name); + } else { + error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name); + } + } + + if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) { + error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name); + } + + if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) { + error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name); + } + + if (instance.propTypes) { + error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name); + } + + if (instance.contextType) { + error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name); + } + + { + if (instance.contextTypes) { + error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name); + } + + if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { + didWarnAboutContextTypeAndContextTypes.add(ctor); + + error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name); + } + } + + if (typeof instance.componentShouldUpdate === 'function') { + error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name); + } + + if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') { + error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component'); + } + + if (typeof instance.componentDidUnmount === 'function') { + error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name); + } + + if (typeof instance.componentDidReceiveProps === 'function') { + error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name); + } + + if (typeof instance.componentWillRecieveProps === 'function') { + error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name); + } + + if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') { + error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name); + } + + var hasMutatedProps = instance.props !== newProps; + + if (instance.props !== undefined && hasMutatedProps) { + error('%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name); + } + + if (instance.defaultProps) { + error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name); + } + + if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); + + error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor)); + } + + if (typeof instance.getDerivedStateFromProps === 'function') { + error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name); + } + + if (typeof instance.getDerivedStateFromError === 'function') { + error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name); + } + + if (typeof ctor.getSnapshotBeforeUpdate === 'function') { + error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name); + } + + var _state = instance.state; + + if (_state && (typeof _state !== 'object' || isArray(_state))) { + error('%s.state: must be set to an object or null', name); + } + + if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') { + error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name); + } + } +} + +function adoptClassInstance(workInProgress, instance) { + instance.updater = classComponentUpdater; + workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates + + set(instance, workInProgress); + + { + instance._reactInternalInstance = fakeInternalInstance; + } +} + +function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = false; + var unmaskedContext = emptyContextObject; + var context = emptyContextObject; + var contextType = ctor.contextType; + + { + if ('contextType' in ctor) { + var isValid = // Allow null for conditional declaration + contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer> + + if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { + didWarnAboutInvalidateContextType.add(ctor); + var addendum = ''; + + if (contextType === undefined) { + addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.'; + } else if (typeof contextType !== 'object') { + addendum = ' However, it is set to a ' + typeof contextType + '.'; + } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { + addendum = ' Did you accidentally pass the Context.Provider instead?'; + } else if (contextType._context !== undefined) { + // <Context.Consumer> + addendum = ' Did you accidentally pass the Context.Consumer instead?'; + } else { + addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.'; + } + + error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum); + } + } + } + + if (typeof contextType === 'object' && contextType !== null) { + context = readContext(contextType); + } else { + unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + var contextTypes = ctor.contextTypes; + isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; + context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; + } // Instantiate twice to help detect side-effects. + + + { + if ( workInProgress.mode & StrictMode) { + new ctor(props, context); // eslint-disable-line no-new + } + } + + var instance = new ctor(props, context); + var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; + adoptClassInstance(workInProgress, instance); + + { + if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { + var componentName = getComponentName(ctor) || 'Component'; + + if (!didWarnAboutUninitializedState.has(componentName)) { + didWarnAboutUninitializedState.add(componentName); + + error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName); + } + } // If new component APIs are defined, "unsafe" lifecycles won't be called. + // Warn about these lifecycles if they are present. + // Don't warn about react-lifecycles-compat polyfilled methods though. + + + if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') { + var foundWillMountName = null; + var foundWillReceivePropsName = null; + var foundWillUpdateName = null; + + if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) { + foundWillMountName = 'componentWillMount'; + } else if (typeof instance.UNSAFE_componentWillMount === 'function') { + foundWillMountName = 'UNSAFE_componentWillMount'; + } + + if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { + foundWillReceivePropsName = 'componentWillReceiveProps'; + } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; + } + + if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { + foundWillUpdateName = 'componentWillUpdate'; + } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') { + foundWillUpdateName = 'UNSAFE_componentWillUpdate'; + } + + if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { + var _componentName = getComponentName(ctor) || 'Component'; + + var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; + + if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { + didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); + + error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n " + foundWillUpdateName : ''); + } + } + } + } // Cache unmasked context so we can avoid recreating masked context unless necessary. + // ReactFiberContext usually updates this cache but can't for newly-created instances. + + + if (isLegacyContextConsumer) { + cacheContext(workInProgress, unmaskedContext, context); + } + + return instance; +} + +function callComponentWillMount(workInProgress, instance) { + startPhaseTimer(workInProgress, 'componentWillMount'); + var oldState = instance.state; + + if (typeof instance.componentWillMount === 'function') { + instance.componentWillMount(); + } + + if (typeof instance.UNSAFE_componentWillMount === 'function') { + instance.UNSAFE_componentWillMount(); + } + + stopPhaseTimer(); + + if (oldState !== instance.state) { + { + error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component'); + } + + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + } +} + +function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { + var oldState = instance.state; + startPhaseTimer(workInProgress, 'componentWillReceiveProps'); + + if (typeof instance.componentWillReceiveProps === 'function') { + instance.componentWillReceiveProps(newProps, nextContext); + } + + if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + } + + stopPhaseTimer(); + + if (instance.state !== oldState) { + { + var componentName = getComponentName(workInProgress.type) || 'Component'; + + if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { + didWarnAboutStateAssignmentForComponent.add(componentName); + + error('%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); + } + } + + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + } +} // Invokes the mount life-cycles on a previously never rendered instance. + + +function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { + { + checkClassInstance(workInProgress, ctor, newProps); + } + + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = emptyRefsObject; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + + if (typeof contextType === 'object' && contextType !== null) { + instance.context = readContext(contextType); + } else { + var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + instance.context = getMaskedContext(workInProgress, unmaskedContext); + } + + { + if (instance.state === newProps) { + var componentName = getComponentName(ctor) || 'Component'; + + if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { + didWarnAboutDirectlyAssigningPropsToState.add(componentName); + + error('%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName); + } + } + + if (workInProgress.mode & StrictMode) { + ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); + } + + { + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); + } + } + + processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime); + instance.state = workInProgress.memoizedState; + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + instance.state = workInProgress.memoizedState; + } // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + + if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { + callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's + // process them now. + + processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime); + instance.state = workInProgress.memoizedState; + } + + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } +} + +function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) { + var instance = workInProgress.stateNode; + var oldProps = workInProgress.memoizedProps; + instance.props = oldProps; + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = emptyContextObject; + + if (typeof contextType === 'object' && contextType !== null) { + nextContext = readContext(contextType); + } else { + var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); + } + + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { + if (oldProps !== newProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } + + resetHasForceUpdateBeforeProcessing(); + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime); + newState = workInProgress.memoizedState; + + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } + + return false; + } + + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } + + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); + + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { + startPhaseTimer(workInProgress, 'componentWillMount'); + + if (typeof instance.componentWillMount === 'function') { + instance.componentWillMount(); + } + + if (typeof instance.UNSAFE_componentWillMount === 'function') { + instance.UNSAFE_componentWillMount(); + } + + stopPhaseTimer(); + } + + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } + } else { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidMount === 'function') { + workInProgress.effectTag |= Update; + } // If shouldComponentUpdate returned false, we should still update the + // memoized state to indicate that this work can be reused. + + + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; + } // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + + + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; + return shouldUpdate; +} // Invokes the update life-cycles and returns false if it shouldn't rerender. + + +function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) { + var instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + var oldProps = workInProgress.memoizedProps; + instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps); + var oldContext = instance.context; + var contextType = ctor.contextType; + var nextContext = emptyContextObject; + + if (typeof contextType === 'object' && contextType !== null) { + nextContext = readContext(contextType); + } else { + var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); + nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); + } + + var getDerivedStateFromProps = ctor.getDerivedStateFromProps; + var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what + // ever the previously attempted to render - not the "current". However, + // during componentDidUpdate we pass the "current" props. + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { + if (oldProps !== newProps || oldContext !== nextContext) { + callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); + } + } + + resetHasForceUpdateBeforeProcessing(); + var oldState = workInProgress.memoizedState; + var newState = instance.state = oldState; + processUpdateQueue(workInProgress, newProps, instance, renderExpirationTime); + newState = workInProgress.memoizedState; + + if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Update; + } + } + + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Snapshot; + } + } + + return false; + } + + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); + newState = workInProgress.memoizedState; + } + + var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); + + if (shouldUpdate) { + // In order to support react-lifecycles-compat polyfilled components, + // Unsafe lifecycles should not be invoked for components using the new APIs. + if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) { + startPhaseTimer(workInProgress, 'componentWillUpdate'); + + if (typeof instance.componentWillUpdate === 'function') { + instance.componentWillUpdate(newProps, newState, nextContext); + } + + if (typeof instance.UNSAFE_componentWillUpdate === 'function') { + instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); + } + + stopPhaseTimer(); + } + + if (typeof instance.componentDidUpdate === 'function') { + workInProgress.effectTag |= Update; + } + + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + workInProgress.effectTag |= Snapshot; + } + } else { + // If an update was already in progress, we should schedule an Update + // effect even though we're bailing out, so that cWU/cDU are called. + if (typeof instance.componentDidUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Update; + } + } + + if (typeof instance.getSnapshotBeforeUpdate === 'function') { + if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) { + workInProgress.effectTag |= Snapshot; + } + } // If shouldComponentUpdate returned false, we should still update the + // memoized props/state to indicate that this work can be reused. + + + workInProgress.memoizedProps = newProps; + workInProgress.memoizedState = newState; + } // Update the existing instance's state, props, and context pointers even + // if shouldComponentUpdate returns false. + + + instance.props = newProps; + instance.state = newState; + instance.context = nextContext; + return shouldUpdate; +} + +var didWarnAboutMaps; +var didWarnAboutGenerators; +var didWarnAboutStringRefs; +var ownerHasKeyUseWarning; +var ownerHasFunctionTypeWarning; + +var warnForMissingKey = function (child) {}; + +{ + didWarnAboutMaps = false; + didWarnAboutGenerators = false; + didWarnAboutStringRefs = {}; + /** + * 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. + */ + + ownerHasKeyUseWarning = {}; + ownerHasFunctionTypeWarning = {}; + + warnForMissingKey = function (child) { + if (child === null || typeof child !== 'object') { + return; + } + + if (!child._store || child._store.validated || child.key != null) { + return; + } + + if (!(typeof child._store === 'object')) { + { + throw Error( "React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + child._store.validated = true; + var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev(); + + if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasKeyUseWarning[currentComponentErrorInfo] = true; + + error('Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.'); + }; +} + +var isArray$1 = Array.isArray; + +function coerceRef(returnFiber, current, element) { + var mixedRef = element.ref; + + if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') { + { + // TODO: Clean this up once we turn on the string ref warning for + // everyone, because the strict mode case will no longer be relevant + if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs + // because these cannot be automatically converted to an arrow function + // using a codemod. Therefore, we don't have to warn about string refs again. + !(element._owner && element._self && element._owner.stateNode !== element._self)) { + var componentName = getComponentName(returnFiber.type) || 'Component'; + + if (!didWarnAboutStringRefs[componentName]) { + { + error('A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber)); + } + + didWarnAboutStringRefs[componentName] = true; + } + } + } + + if (element._owner) { + var owner = element._owner; + var inst; + + if (owner) { + var ownerFiber = owner; + + if (!(ownerFiber.tag === ClassComponent)) { + { + throw Error( "Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref" ); + } + } + + inst = ownerFiber.stateNode; + } + + if (!inst) { + { + throw Error( "Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue." ); + } + } + + var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref + + if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) { + return current.ref; + } + + var ref = function (value) { + var refs = inst.refs; + + if (refs === emptyRefsObject) { + // This is a lazy pooled frozen object, so we need to initialize. + refs = inst.refs = {}; + } + + if (value === null) { + delete refs[stringRef]; + } else { + refs[stringRef] = value; + } + }; + + ref._stringRef = stringRef; + return ref; + } else { + if (!(typeof mixedRef === 'string')) { + { + throw Error( "Expected ref to be a function, a string, an object returned by React.createRef(), or null." ); + } + } + + if (!element._owner) { + { + throw Error( "Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information." ); + } + } + } + } + + return mixedRef; +} + +function throwOnInvalidObjectType(returnFiber, newChild) { + if (returnFiber.type !== 'textarea') { + var addendum = ''; + + { + addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev(); + } + + { + { + throw Error( "Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + ")." + addendum ); + } + } + } +} + +function warnOnFunctionType() { + { + var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev(); + + if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) { + return; + } + + ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true; + + error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.'); + } +} // This wrapper function exists because I expect to clone the code in each path +// to be able to optimize each path individually by branching early. This needs +// a compiler or we can do it manually. Helpers that don't need this branching +// live outside of this function. + + +function ChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (!shouldTrackSideEffects) { + // Noop. + return; + } // Deletions are added in reversed order so we add it to the front. + // At this point, the return fiber's effect list is empty except for + // deletions, so we can just append the deletion to the list. The remaining + // effects aren't added until the complete phase. Once we implement + // resuming, this may not be true. + + + var last = returnFiber.lastEffect; + + if (last !== null) { + last.nextEffect = childToDelete; + returnFiber.lastEffect = childToDelete; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + } + + childToDelete.nextEffect = null; + childToDelete.effectTag = Deletion; + } + + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) { + // Noop. + return null; + } // TODO: For the shouldClone case, this could be micro-optimized a bit by + // assuming that after the first child we've already added everything. + + + var childToDelete = currentFirstChild; + + while (childToDelete !== null) { + deleteChild(returnFiber, childToDelete); + childToDelete = childToDelete.sibling; + } + + return null; + } + + function mapRemainingChildren(returnFiber, currentFirstChild) { + // Add the remaining children to a temporary map so that we can find them by + // keys quickly. Implicit (null) keys get added to this set with their index + // instead. + var existingChildren = new Map(); + var existingChild = currentFirstChild; + + while (existingChild !== null) { + if (existingChild.key !== null) { + existingChildren.set(existingChild.key, existingChild); + } else { + existingChildren.set(existingChild.index, existingChild); + } + + existingChild = existingChild.sibling; + } + + return existingChildren; + } + + function useFiber(fiber, pendingProps) { + // We currently set sibling to null and index to 0 here because it is easy + // to forget to do before returning it. E.g. for the single child case. + var clone = createWorkInProgress(fiber, pendingProps); + clone.index = 0; + clone.sibling = null; + return clone; + } + + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + + if (!shouldTrackSideEffects) { + // Noop. + return lastPlacedIndex; + } + + var current = newFiber.alternate; + + if (current !== null) { + var oldIndex = current.index; + + if (oldIndex < lastPlacedIndex) { + // This is a move. + newFiber.effectTag = Placement; + return lastPlacedIndex; + } else { + // This item can stay in place. + return oldIndex; + } + } else { + // This is an insertion. + newFiber.effectTag = Placement; + return lastPlacedIndex; + } + } + + function placeSingleChild(newFiber) { + // This is simpler for the single child case. We only need to do a + // placement for inserting new children. + if (shouldTrackSideEffects && newFiber.alternate === null) { + newFiber.effectTag = Placement; + } + + return newFiber; + } + + function updateTextNode(returnFiber, current, textContent, expirationTime) { + if (current === null || current.tag !== HostText) { + // Insert + var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, textContent); + existing.return = returnFiber; + return existing; + } + } + + function updateElement(returnFiber, current, element, expirationTime) { + if (current !== null) { + if (current.elementType === element.type || ( // Keep this check inline so it only runs on the false path: + isCompatibleFamilyForHotReloading(current, element) )) { + // Move based on index + var existing = useFiber(current, element.props); + existing.ref = coerceRef(returnFiber, current, element); + existing.return = returnFiber; + + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + + return existing; + } + } // Insert + + + var created = createFiberFromElement(element, returnFiber.mode, expirationTime); + created.ref = coerceRef(returnFiber, current, element); + created.return = returnFiber; + return created; + } + + function updatePortal(returnFiber, current, portal, expirationTime) { + if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { + // Insert + var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, portal.children || []); + existing.return = returnFiber; + return existing; + } + } + + function updateFragment(returnFiber, current, fragment, expirationTime, key) { + if (current === null || current.tag !== Fragment) { + // Insert + var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key); + created.return = returnFiber; + return created; + } else { + // Update + var existing = useFiber(current, fragment); + existing.return = returnFiber; + return existing; + } + } + + function createChild(returnFiber, newChild, expirationTime) { + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } + + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime); + + _created.ref = coerceRef(returnFiber, null, newChild); + _created.return = returnFiber; + return _created; + } + + case REACT_PORTAL_TYPE: + { + var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime); + + _created2.return = returnFiber; + return _created2; + } + } + + if (isArray$1(newChild) || getIteratorFn(newChild)) { + var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null); + + _created3.return = returnFiber; + return _created3; + } + + throwOnInvalidObjectType(returnFiber, newChild); + } + + { + if (typeof newChild === 'function') { + warnOnFunctionType(); + } + } + + return null; + } + + function updateSlot(returnFiber, oldFiber, newChild, expirationTime) { + // Update the fiber if the keys match, otherwise return null. + var key = oldFiber !== null ? oldFiber.key : null; + + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys. If the previous node is implicitly keyed + // we can continue to replace it without aborting even if it is not a text + // node. + if (key !== null) { + return null; + } + + return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime); + } + + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + if (newChild.key === key) { + if (newChild.type === REACT_FRAGMENT_TYPE) { + return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key); + } + + return updateElement(returnFiber, oldFiber, newChild, expirationTime); + } else { + return null; + } + } + + case REACT_PORTAL_TYPE: + { + if (newChild.key === key) { + return updatePortal(returnFiber, oldFiber, newChild, expirationTime); + } else { + return null; + } + } + } + + if (isArray$1(newChild) || getIteratorFn(newChild)) { + if (key !== null) { + return null; + } + + return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null); + } + + throwOnInvalidObjectType(returnFiber, newChild); + } + + { + if (typeof newChild === 'function') { + warnOnFunctionType(); + } + } + + return null; + } + + function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) { + if (typeof newChild === 'string' || typeof newChild === 'number') { + // Text nodes don't have keys, so we neither have to check the old nor + // new node for the key. If both are text nodes, they match. + var matchedFiber = existingChildren.get(newIdx) || null; + return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime); + } + + if (typeof newChild === 'object' && newChild !== null) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + { + var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + + if (newChild.type === REACT_FRAGMENT_TYPE) { + return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key); + } + + return updateElement(returnFiber, _matchedFiber, newChild, expirationTime); + } + + case REACT_PORTAL_TYPE: + { + var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; + + return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime); + } + } + + if (isArray$1(newChild) || getIteratorFn(newChild)) { + var _matchedFiber3 = existingChildren.get(newIdx) || null; + + return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null); + } + + throwOnInvalidObjectType(returnFiber, newChild); + } + + { + if (typeof newChild === 'function') { + warnOnFunctionType(); + } + } + + return null; + } + /** + * Warns if there is a duplicate or missing key + */ + + + function warnOnInvalidKey(child, knownKeys) { + { + if (typeof child !== 'object' || child === null) { + return knownKeys; + } + + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(child); + var key = child.key; + + if (typeof key !== 'string') { + break; + } + + if (knownKeys === null) { + knownKeys = new Set(); + knownKeys.add(key); + break; + } + + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + + error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key); + + break; + } + } + + return knownKeys; + } + + function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) { + // This algorithm can't optimize by searching from both ends since we + // don't have backpointers on fibers. I'm trying to see how far we can get + // with that model. If it ends up not being worth the tradeoffs, we can + // add it later. + // Even with a two ended optimization, we'd want to optimize for the case + // where there are few changes and brute force the comparison instead of + // going for the Map. It'd like to explore hitting that path first in + // forward-only mode and only go for the Map once we notice that we need + // lots of look ahead. This doesn't handle reversal as well as two ended + // search but that's unusual. Besides, for the two ended optimization to + // work on Iterables, we'd need to copy the whole set. + // In this first iteration, we'll just live with hitting the bad case + // (adding everything to a Map) in for every insert/move. + // If you change this code, also update reconcileChildrenIterator() which + // uses the same algorithm. + { + // First, validate keys. + var knownKeys = null; + + for (var i = 0; i < newChildren.length; i++) { + var child = newChildren[i]; + knownKeys = warnOnInvalidKey(child, knownKeys); + } + } + + var resultingFirstChild = null; + var previousNewFiber = null; + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + + for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; + } + + var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime); + + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (oldFiber === null) { + oldFiber = nextOldFiber; + } + + break; + } + + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + + if (newIdx === newChildren.length) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; + } + + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime); + + if (_newFiber === null) { + continue; + } + + lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); + + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber; + } else { + previousNewFiber.sibling = _newFiber; + } + + previousNewFiber = _newFiber; + } + + return resultingFirstChild; + } // Add all children to a key map for quick lookups. + + + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. + + for (; newIdx < newChildren.length; newIdx++) { + var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime); + + if (_newFiber2 !== null) { + if (shouldTrackSideEffects) { + if (_newFiber2.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); + } + } + + lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); + + if (previousNewFiber === null) { + resultingFirstChild = _newFiber2; + } else { + previousNewFiber.sibling = _newFiber2; + } + + previousNewFiber = _newFiber2; + } + } + + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + } + + return resultingFirstChild; + } + + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) { + // This is the same implementation as reconcileChildrenArray(), + // but using the iterator instead. + var iteratorFn = getIteratorFn(newChildrenIterable); + + if (!(typeof iteratorFn === 'function')) { + { + throw Error( "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + { + // We don't support rendering Generators because it's a mutation. + // See https://github.com/facebook/react/issues/12995 + if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag + newChildrenIterable[Symbol.toStringTag] === 'Generator') { + if (!didWarnAboutGenerators) { + error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.'); + } + + didWarnAboutGenerators = true; + } // Warn about using Maps as children + + + if (newChildrenIterable.entries === iteratorFn) { + if (!didWarnAboutMaps) { + error('Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.'); + } + + didWarnAboutMaps = true; + } // First, validate keys. + // We'll get a different iterator later for the main pass. + + + var _newChildren = iteratorFn.call(newChildrenIterable); + + if (_newChildren) { + var knownKeys = null; + + var _step = _newChildren.next(); + + for (; !_step.done; _step = _newChildren.next()) { + var child = _step.value; + knownKeys = warnOnInvalidKey(child, knownKeys); + } + } + } + + var newChildren = iteratorFn.call(newChildrenIterable); + + if (!(newChildren != null)) { + { + throw Error( "An iterable object provided no iterator." ); + } + } + + var resultingFirstChild = null; + var previousNewFiber = null; + var oldFiber = currentFirstChild; + var lastPlacedIndex = 0; + var newIdx = 0; + var nextOldFiber = null; + var step = newChildren.next(); + + for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { + if (oldFiber.index > newIdx) { + nextOldFiber = oldFiber; + oldFiber = null; + } else { + nextOldFiber = oldFiber.sibling; + } + + var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime); + + if (newFiber === null) { + // TODO: This breaks on empty slots like null children. That's + // unfortunate because it triggers the slow path all the time. We need + // a better way to communicate whether this was a miss or null, + // boolean, undefined, etc. + if (oldFiber === null) { + oldFiber = nextOldFiber; + } + + break; + } + + if (shouldTrackSideEffects) { + if (oldFiber && newFiber.alternate === null) { + // We matched the slot, but we didn't reuse the existing fiber, so we + // need to delete the existing child. + deleteChild(returnFiber, oldFiber); + } + } + + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); + + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = newFiber; + } else { + // TODO: Defer siblings if we're not at the right index for this slot. + // I.e. if we had null values before, then we want to defer this + // for each null value. However, we also don't want to call updateSlot + // with the previous one. + previousNewFiber.sibling = newFiber; + } + + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + + if (step.done) { + // We've reached the end of the new children. We can delete the rest. + deleteRemainingChildren(returnFiber, oldFiber); + return resultingFirstChild; + } + + if (oldFiber === null) { + // If we don't have any more existing children we can choose a fast path + // since the rest will all be insertions. + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber3 = createChild(returnFiber, step.value, expirationTime); + + if (_newFiber3 === null) { + continue; + } + + lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); + + if (previousNewFiber === null) { + // TODO: Move out of the loop. This only happens for the first run. + resultingFirstChild = _newFiber3; + } else { + previousNewFiber.sibling = _newFiber3; + } + + previousNewFiber = _newFiber3; + } + + return resultingFirstChild; + } // Add all children to a key map for quick lookups. + + + var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. + + for (; !step.done; newIdx++, step = newChildren.next()) { + var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime); + + if (_newFiber4 !== null) { + if (shouldTrackSideEffects) { + if (_newFiber4.alternate !== null) { + // The new fiber is a work in progress, but if there exists a + // current, that means that we reused the fiber. We need to delete + // it from the child list so that we don't add it to the deletion + // list. + existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); + } + } + + lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); + + if (previousNewFiber === null) { + resultingFirstChild = _newFiber4; + } else { + previousNewFiber.sibling = _newFiber4; + } + + previousNewFiber = _newFiber4; + } + } + + if (shouldTrackSideEffects) { + // Any existing children that weren't consumed above were deleted. We need + // to add them to the deletion list. + existingChildren.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + } + + return resultingFirstChild; + } + + function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) { + // There's no need to check for keys on text nodes since we don't have a + // way to define them. + if (currentFirstChild !== null && currentFirstChild.tag === HostText) { + // We already have an existing node so let's just update it and delete + // the rest. + deleteRemainingChildren(returnFiber, currentFirstChild.sibling); + var existing = useFiber(currentFirstChild, textContent); + existing.return = returnFiber; + return existing; + } // The existing first child is not a text node so we need to create one + // and delete the existing ones. + + + deleteRemainingChildren(returnFiber, currentFirstChild); + var created = createFiberFromText(textContent, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } + + function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) { + var key = element.key; + var child = currentFirstChild; + + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + switch (child.tag) { + case Fragment: + { + if (element.type === REACT_FRAGMENT_TYPE) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, element.props.children); + existing.return = returnFiber; + + { + existing._debugSource = element._source; + existing._debugOwner = element._owner; + } + + return existing; + } + + break; + } + + case Block: + + // We intentionally fallthrough here if enableBlocksAPI is not on. + // eslint-disable-next-lined no-fallthrough + + default: + { + if (child.elementType === element.type || ( // Keep this check inline so it only runs on the false path: + isCompatibleFamilyForHotReloading(child, element) )) { + deleteRemainingChildren(returnFiber, child.sibling); + + var _existing3 = useFiber(child, element.props); + + _existing3.ref = coerceRef(returnFiber, child, element); + _existing3.return = returnFiber; + + { + _existing3._debugSource = element._source; + _existing3._debugOwner = element._owner; + } + + return _existing3; + } + + break; + } + } // Didn't match. + + + deleteRemainingChildren(returnFiber, child); + break; + } else { + deleteChild(returnFiber, child); + } + + child = child.sibling; + } + + if (element.type === REACT_FRAGMENT_TYPE) { + var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key); + created.return = returnFiber; + return created; + } else { + var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime); + + _created4.ref = coerceRef(returnFiber, currentFirstChild, element); + _created4.return = returnFiber; + return _created4; + } + } + + function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) { + var key = portal.key; + var child = currentFirstChild; + + while (child !== null) { + // TODO: If key === null and child.key === null, then this only applies to + // the first item in the list. + if (child.key === key) { + if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, portal.children || []); + existing.return = returnFiber; + return existing; + } else { + deleteRemainingChildren(returnFiber, child); + break; + } + } else { + deleteChild(returnFiber, child); + } + + child = child.sibling; + } + + var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime); + created.return = returnFiber; + return created; + } // This API will tag the children with the side-effect of the reconciliation + // itself. They will be added to the side-effect list as we pass through the + // children and the parent. + + + function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) { + // This function is not recursive. + // If the top level item is an array, we treat it as a set of children, + // not as a fragment. Nested arrays on the other hand will be treated as + // fragment nodes. Recursion happens at the normal flow. + // Handle top level unkeyed fragments as if they were arrays. + // This leads to an ambiguity between <>{[...]}</> and <>...</>. + // We treat the ambiguous cases above the same. + var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; + + if (isUnkeyedTopLevelFragment) { + newChild = newChild.props.children; + } // Handle object types + + + var isObject = typeof newChild === 'object' && newChild !== null; + + if (isObject) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime)); + + case REACT_PORTAL_TYPE: + return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime)); + } + } + + if (typeof newChild === 'string' || typeof newChild === 'number') { + return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime)); + } + + if (isArray$1(newChild)) { + return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime); + } + + if (getIteratorFn(newChild)) { + return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime); + } + + if (isObject) { + throwOnInvalidObjectType(returnFiber, newChild); + } + + { + if (typeof newChild === 'function') { + warnOnFunctionType(); + } + } + + if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) { + // If the new child is undefined, and the return fiber is a composite + // component, throw an error. If Fiber return types are disabled, + // we already threw above. + switch (returnFiber.tag) { + case ClassComponent: + { + { + var instance = returnFiber.stateNode; + + if (instance.render._isMockFunction) { + // We allow auto-mocks to proceed as if they're returning null. + break; + } + } + } + // Intentionally fall through to the next case, which handles both + // functions and classes + // eslint-disable-next-lined no-fallthrough + + case FunctionComponent: + { + var Component = returnFiber.type; + + { + { + throw Error( (Component.displayName || Component.name || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null." ); + } + } + } + } + } // Remaining cases are all treated as empty. + + + return deleteRemainingChildren(returnFiber, currentFirstChild); + } + + return reconcileChildFibers; +} + +var reconcileChildFibers = ChildReconciler(true); +var mountChildFibers = ChildReconciler(false); +function cloneChildFibers(current, workInProgress) { + if (!(current === null || workInProgress.child === current.child)) { + { + throw Error( "Resuming work not yet implemented." ); + } + } + + if (workInProgress.child === null) { + return; + } + + var currentChild = workInProgress.child; + var newChild = createWorkInProgress(currentChild, currentChild.pendingProps); + workInProgress.child = newChild; + newChild.return = workInProgress; + + while (currentChild.sibling !== null) { + currentChild = currentChild.sibling; + newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps); + newChild.return = workInProgress; + } + + newChild.sibling = null; +} // Reset a workInProgress child set to prepare it for a second pass. + +function resetChildFibers(workInProgress, renderExpirationTime) { + var child = workInProgress.child; + + while (child !== null) { + resetWorkInProgress(child, renderExpirationTime); + child = child.sibling; + } +} + +var NO_CONTEXT = {}; +var contextStackCursor$1 = createCursor(NO_CONTEXT); +var contextFiberStackCursor = createCursor(NO_CONTEXT); +var rootInstanceStackCursor = createCursor(NO_CONTEXT); + +function requiredContext(c) { + if (!(c !== NO_CONTEXT)) { + { + throw Error( "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + return c; +} + +function getRootHostContainer() { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + return rootInstance; +} + +function pushHostContainer(fiber, nextRootInstance) { + // Push current root instance onto the stack; + // This allows us to reset root when portals are popped. + push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + + push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. + // However, we can't just call getRootHostContext() and push it because + // we'd have a different number of entries on the stack depending on + // whether getRootHostContext() throws somewhere in renderer code or not. + // So we push an empty value first. This lets us safely unwind on errors. + + push(contextStackCursor$1, NO_CONTEXT, fiber); + var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it. + + pop(contextStackCursor$1, fiber); + push(contextStackCursor$1, nextRootContext, fiber); +} + +function popHostContainer(fiber) { + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); + pop(rootInstanceStackCursor, fiber); +} + +function getHostContext() { + var context = requiredContext(contextStackCursor$1.current); + return context; +} + +function pushHostContext(fiber) { + var rootInstance = requiredContext(rootInstanceStackCursor.current); + var context = requiredContext(contextStackCursor$1.current); + var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. + + if (context === nextContext) { + return; + } // Track the context and the Fiber that provided it. + // This enables us to pop only Fibers that provide unique contexts. + + + push(contextFiberStackCursor, fiber, fiber); + push(contextStackCursor$1, nextContext, fiber); +} + +function popHostContext(fiber) { + // Do not pop unless this Fiber provided the current context. + // pushHostContext() only pushes Fibers that provide unique contexts. + if (contextFiberStackCursor.current !== fiber) { + return; + } + + pop(contextStackCursor$1, fiber); + pop(contextFiberStackCursor, fiber); +} + +var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is +// inherited deeply down the subtree. The upper bits only affect +// this immediate suspense boundary and gets reset each new +// boundary or suspense list. + +var SubtreeSuspenseContextMask = 1; // Subtree Flags: +// InvisibleParentSuspenseContext indicates that one of our parent Suspense +// boundaries is not currently showing visible main content. +// Either because it is already showing a fallback or is not mounted at all. +// We can use this to determine if it is desirable to trigger a fallback at +// the parent. If not, then we might need to trigger undesirable boundaries +// and/or suspend the commit to avoid hiding the parent content. + +var InvisibleParentSuspenseContext = 1; // Shallow Flags: +// ForceSuspenseFallback can be used by SuspenseList to force newly added +// items into their fallback state during one of the render passes. + +var ForceSuspenseFallback = 2; +var suspenseStackCursor = createCursor(DefaultSuspenseContext); +function hasSuspenseContext(parentContext, flag) { + return (parentContext & flag) !== 0; +} +function setDefaultShallowSuspenseContext(parentContext) { + return parentContext & SubtreeSuspenseContextMask; +} +function setShallowSuspenseContext(parentContext, shallowContext) { + return parentContext & SubtreeSuspenseContextMask | shallowContext; +} +function addSubtreeSuspenseContext(parentContext, subtreeContext) { + return parentContext | subtreeContext; +} +function pushSuspenseContext(fiber, newContext) { + push(suspenseStackCursor, newContext, fiber); +} +function popSuspenseContext(fiber) { + pop(suspenseStackCursor, fiber); +} + +function shouldCaptureSuspense(workInProgress, hasInvisibleParent) { + // If it was the primary children that just suspended, capture and render the + // fallback. Otherwise, don't capture and bubble to the next boundary. + var nextState = workInProgress.memoizedState; + + if (nextState !== null) { + if (nextState.dehydrated !== null) { + // A dehydrated boundary always captures. + return true; + } + + return false; + } + + var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop. + + if (props.fallback === undefined) { + return false; + } // Regular boundaries always capture. + + + if (props.unstable_avoidThisFallback !== true) { + return true; + } // If it's a boundary we should avoid, then we prefer to bubble up to the + // parent boundary if it is currently invisible. + + + if (hasInvisibleParent) { + return false; + } // If the parent is not able to handle it, we must handle it. + + + return true; +} +function findFirstSuspended(row) { + var node = row; + + while (node !== null) { + if (node.tag === SuspenseComponent) { + var state = node.memoizedState; + + if (state !== null) { + var dehydrated = state.dehydrated; + + if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) { + return node; + } + } + } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't + // keep track of whether it suspended or not. + node.memoizedProps.revealOrder !== undefined) { + var didSuspend = (node.effectTag & DidCapture) !== NoEffect; + + if (didSuspend) { + return node; + } + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === row) { + return null; + } + + while (node.sibling === null) { + if (node.return === null || node.return === row) { + return null; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + + return null; +} + +function createDeprecatedResponderListener(responder, props) { + var eventResponderListener = { + responder: responder, + props: props + }; + + { + Object.freeze(eventResponderListener); + } + + return eventResponderListener; +} + +var HasEffect = +/* */ +1; // Represents the phase in which the effect (not the clean-up) fires. + +var Layout = +/* */ +2; +var Passive$1 = +/* */ +4; + +var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; +var didWarnAboutMismatchedHooksForComponent; + +{ + didWarnAboutMismatchedHooksForComponent = new Set(); +} + +// These are set right before calling the component. +var renderExpirationTime = NoWork; // The work-in-progress fiber. I've named it differently to distinguish it from +// the work-in-progress hook. + +var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The +// current hook list is the list that belongs to the current fiber. The +// work-in-progress hook list is a new list that will be added to the +// work-in-progress fiber. + +var currentHook = null; +var workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This +// does not get reset if we do another render pass; only when we're completely +// finished evaluating this component. This is an optimization so we know +// whether we need to clear render phase updates after a throw. + +var didScheduleRenderPhaseUpdate = false; +var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook + +var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders. +// The list stores the order of hooks used during the initial render (mount). +// Subsequent renders (updates) reference this list. + +var hookTypesDev = null; +var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore +// the dependencies for Hooks that need them (e.g. useEffect or useMemo). +// When true, such Hooks will always be "remounted". Only used during hot reload. + +var ignorePreviousDependencies = false; + +function mountHookTypesDev() { + { + var hookName = currentHookNameInDev; + + if (hookTypesDev === null) { + hookTypesDev = [hookName]; + } else { + hookTypesDev.push(hookName); + } + } +} + +function updateHookTypesDev() { + { + var hookName = currentHookNameInDev; + + if (hookTypesDev !== null) { + hookTypesUpdateIndexDev++; + + if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) { + warnOnHookMismatchInDev(hookName); + } + } + } +} + +function checkDepsAreArrayDev(deps) { + { + if (deps !== undefined && deps !== null && !Array.isArray(deps)) { + // Verify deps, but only on mount to avoid extra checks. + // It's unlikely their type would change as usually you define them inline. + error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps); + } + } +} + +function warnOnHookMismatchInDev(currentHookName) { + { + var componentName = getComponentName(currentlyRenderingFiber$1.type); + + if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) { + didWarnAboutMismatchedHooksForComponent.add(componentName); + + if (hookTypesDev !== null) { + var table = ''; + var secondColumnStart = 30; + + for (var i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i]; + var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName; + var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up + // lol @ IE not supporting String#repeat + + while (row.length < secondColumnStart) { + row += ' '; + } + + row += newHookName + '\n'; + table += row; + } + + error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table); + } + } + } +} + +function throwInvalidHookError() { + { + { + throw Error( "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." ); + } + } +} + +function areHookInputsEqual(nextDeps, prevDeps) { + { + if (ignorePreviousDependencies) { + // Only true when this component is being hot reloaded. + return false; + } + } + + if (prevDeps === null) { + { + error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev); + } + + return false; + } + + { + // Don't bother comparing lengths in prod because these arrays should be + // passed inline. + if (nextDeps.length !== prevDeps.length) { + error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]"); + } + } + + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { + if (objectIs(nextDeps[i], prevDeps[i])) { + continue; + } + + return false; + } + + return true; +} + +function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderExpirationTime) { + renderExpirationTime = nextRenderExpirationTime; + currentlyRenderingFiber$1 = workInProgress; + + { + hookTypesDev = current !== null ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; // Used for hot reloading: + + ignorePreviousDependencies = current !== null && current.type !== workInProgress.type; + } + + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.expirationTime = NoWork; // The following should have already been reset + // currentHook = null; + // workInProgressHook = null; + // didScheduleRenderPhaseUpdate = false; + // TODO Warn if no hooks are used at all during mount, then some are used during update. + // Currently we will identify the update render as a mount because memoizedState === null. + // This is tricky because it's valid for certain types of components (e.g. React.lazy) + // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used. + // Non-stateful hooks (e.g. context) don't get added to memoizedState, + // so memoizedState would be null during updates and mounts. + + { + if (current !== null && current.memoizedState !== null) { + ReactCurrentDispatcher.current = HooksDispatcherOnUpdateInDEV; + } else if (hookTypesDev !== null) { + // This dispatcher handles an edge case where a component is updating, + // but no stateful hooks have been used. + // We want to match the production code behavior (which will use HooksDispatcherOnMount), + // but with the extra DEV validation to ensure hooks ordering hasn't changed. + // This dispatcher does that. + ReactCurrentDispatcher.current = HooksDispatcherOnMountWithHookTypesInDEV; + } else { + ReactCurrentDispatcher.current = HooksDispatcherOnMountInDEV; + } + } + + var children = Component(props, secondArg); // Check if there was a render phase update + + if (workInProgress.expirationTime === renderExpirationTime) { + // Keep rendering in a loop for as long as render phase updates continue to + // be scheduled. Use a counter to prevent infinite loops. + var numberOfReRenders = 0; + + do { + workInProgress.expirationTime = NoWork; + + if (!(numberOfReRenders < RE_RENDER_LIMIT)) { + { + throw Error( "Too many re-renders. React limits the number of renders to prevent an infinite loop." ); + } + } + + numberOfReRenders += 1; + + { + // Even when hot reloading, allow dependencies to stabilize + // after first render to prevent infinite render phase updates. + ignorePreviousDependencies = false; + } // Start over from the beginning of the list + + + currentHook = null; + workInProgressHook = null; + workInProgress.updateQueue = null; + + { + // Also validate hook order for cascading updates. + hookTypesUpdateIndexDev = -1; + } + + ReactCurrentDispatcher.current = HooksDispatcherOnRerenderInDEV ; + children = Component(props, secondArg); + } while (workInProgress.expirationTime === renderExpirationTime); + } // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrancy. + + + ReactCurrentDispatcher.current = ContextOnlyDispatcher; + + { + workInProgress._debugHookTypes = hookTypesDev; + } // This check uses currentHook so that it works the same in DEV and prod bundles. + // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles. + + + var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; + renderExpirationTime = NoWork; + currentlyRenderingFiber$1 = null; + currentHook = null; + workInProgressHook = null; + + { + currentHookNameInDev = null; + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; + } + + didScheduleRenderPhaseUpdate = false; + + if (!!didRenderTooFewHooks) { + { + throw Error( "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." ); + } + } + + return children; +} +function bailoutHooks(current, workInProgress, expirationTime) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.effectTag &= ~(Passive | Update); + + if (current.expirationTime <= expirationTime) { + current.expirationTime = NoWork; + } +} +function resetHooksAfterThrow() { + // We can assume the previous dispatcher is always this one, since we set it + // at the beginning of the render phase and there's no re-entrancy. + ReactCurrentDispatcher.current = ContextOnlyDispatcher; + + if (didScheduleRenderPhaseUpdate) { + // There were render phase updates. These are only valid for this render + // phase, which we are now aborting. Remove the updates from the queues so + // they do not persist to the next render. Do not remove updates from hooks + // that weren't processed. + // + // Only reset the updates from the queue if it has a clone. If it does + // not have a clone, that means it wasn't processed, and the updates were + // scheduled before we entered the render phase. + var hook = currentlyRenderingFiber$1.memoizedState; + + while (hook !== null) { + var queue = hook.queue; + + if (queue !== null) { + queue.pending = null; + } + + hook = hook.next; + } + } + + renderExpirationTime = NoWork; + currentlyRenderingFiber$1 = null; + currentHook = null; + workInProgressHook = null; + + { + hookTypesDev = null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + } + + didScheduleRenderPhaseUpdate = false; +} + +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + + if (workInProgressHook === null) { + // This is the first hook in the list + currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook; + } else { + // Append to the end of the list + workInProgressHook = workInProgressHook.next = hook; + } + + return workInProgressHook; +} + +function updateWorkInProgressHook() { + // This function is used both for updates and for re-renders triggered by a + // render phase update. It assumes there is either a current hook we can + // clone, or a work-in-progress hook from a previous render pass that we can + // use as a base. When we reach the end of the base list, we must switch to + // the dispatcher used for mounts. + var nextCurrentHook; + + if (currentHook === null) { + var current = currentlyRenderingFiber$1.alternate; + + if (current !== null) { + nextCurrentHook = current.memoizedState; + } else { + nextCurrentHook = null; + } + } else { + nextCurrentHook = currentHook.next; + } + + var nextWorkInProgressHook; + + if (workInProgressHook === null) { + nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState; + } else { + nextWorkInProgressHook = workInProgressHook.next; + } + + if (nextWorkInProgressHook !== null) { + // There's already a work-in-progress. Reuse it. + workInProgressHook = nextWorkInProgressHook; + nextWorkInProgressHook = workInProgressHook.next; + currentHook = nextCurrentHook; + } else { + // Clone from the current hook. + if (!(nextCurrentHook !== null)) { + { + throw Error( "Rendered more hooks than during the previous render." ); + } + } + + currentHook = nextCurrentHook; + var newHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + + if (workInProgressHook === null) { + // This is the first hook in the list. + currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook; + } else { + // Append to the end of the list. + workInProgressHook = workInProgressHook.next = newHook; + } + } + + return workInProgressHook; +} + +function createFunctionComponentUpdateQueue() { + return { + lastEffect: null + }; +} + +function basicStateReducer(state, action) { + // $FlowFixMe: Flow doesn't like mixed types + return typeof action === 'function' ? action(state) : action; +} + +function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + var initialState; + + if (init !== undefined) { + initialState = init(initialArg); + } else { + initialState = initialArg; + } + + hook.memoizedState = hook.baseState = initialState; + var queue = hook.queue = { + pending: null, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; +} + +function updateReducer(reducer, initialArg, init) { + var hook = updateWorkInProgressHook(); + var queue = hook.queue; + + if (!(queue !== null)) { + { + throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." ); + } + } + + queue.lastRenderedReducer = reducer; + var current = currentHook; // The last rebase update that is NOT part of the base state. + + var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet. + + var pendingQueue = queue.pending; + + if (pendingQueue !== null) { + // We have new updates that haven't been processed yet. + // We'll add them to the base queue. + if (baseQueue !== null) { + // Merge the pending queue and the base queue. + var baseFirst = baseQueue.next; + var pendingFirst = pendingQueue.next; + baseQueue.next = pendingFirst; + pendingQueue.next = baseFirst; + } + + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; + } + + if (baseQueue !== null) { + // We have a queue to process. + var first = baseQueue.next; + var newState = current.baseState; + var newBaseState = null; + var newBaseQueueFirst = null; + var newBaseQueueLast = null; + var update = first; + + do { + var updateExpirationTime = update.expirationTime; + + if (updateExpirationTime < renderExpirationTime) { + // Priority is insufficient. Skip this update. If this is the first + // skipped update, the previous update/state is the new base + // update/state. + var clone = { + expirationTime: update.expirationTime, + suspenseConfig: update.suspenseConfig, + action: update.action, + eagerReducer: update.eagerReducer, + eagerState: update.eagerState, + next: null + }; + + if (newBaseQueueLast === null) { + newBaseQueueFirst = newBaseQueueLast = clone; + newBaseState = newState; + } else { + newBaseQueueLast = newBaseQueueLast.next = clone; + } // Update the remaining priority in the queue. + + + if (updateExpirationTime > currentlyRenderingFiber$1.expirationTime) { + currentlyRenderingFiber$1.expirationTime = updateExpirationTime; + markUnprocessedUpdateTime(updateExpirationTime); + } + } else { + // This update does have sufficient priority. + if (newBaseQueueLast !== null) { + var _clone = { + expirationTime: Sync, + // This update is going to be committed so we never want uncommit it. + suspenseConfig: update.suspenseConfig, + action: update.action, + eagerReducer: update.eagerReducer, + eagerState: update.eagerState, + next: null + }; + newBaseQueueLast = newBaseQueueLast.next = _clone; + } // Mark the event time of this update as relevant to this render pass. + // TODO: This should ideally use the true event time of this update rather than + // its priority which is a derived and not reverseable value. + // TODO: We should skip this update if it was already committed but currently + // we have no way of detecting the difference between a committed and suspended + // update here. + + + markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process this update. + + if (update.eagerReducer === reducer) { + // If this update was processed eagerly, and its reducer matches the + // current reducer, we can use the eagerly computed state. + newState = update.eagerState; + } else { + var action = update.action; + newState = reducer(newState, action); + } + } + + update = update.next; + } while (update !== null && update !== first); + + if (newBaseQueueLast === null) { + newBaseState = newState; + } else { + newBaseQueueLast.next = newBaseQueueFirst; + } // Mark that the fiber performed work, but only if the new state is + // different from the current state. + + + if (!objectIs(newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); + } + + hook.memoizedState = newState; + hook.baseState = newBaseState; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = newState; + } + + var dispatch = queue.dispatch; + return [hook.memoizedState, dispatch]; +} + +function rerenderReducer(reducer, initialArg, init) { + var hook = updateWorkInProgressHook(); + var queue = hook.queue; + + if (!(queue !== null)) { + { + throw Error( "Should have a queue. This is likely a bug in React. Please file an issue." ); + } + } + + queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous + // work-in-progress hook. + + var dispatch = queue.dispatch; + var lastRenderPhaseUpdate = queue.pending; + var newState = hook.memoizedState; + + if (lastRenderPhaseUpdate !== null) { + // The queue doesn't persist past this render pass. + queue.pending = null; + var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next; + var update = firstRenderPhaseUpdate; + + do { + // Process this render phase update. We don't have to check the + // priority because it will always be the same as the current + // render's. + var action = update.action; + newState = reducer(newState, action); + update = update.next; + } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is + // different from the current state. + + + if (!objectIs(newState, hook.memoizedState)) { + markWorkInProgressReceivedUpdate(); + } + + hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to + // the base state unless the queue is empty. + // TODO: Not sure if this is the desired semantics, but it's what we + // do for gDSFP. I can't remember why. + + if (hook.baseQueue === null) { + hook.baseState = newState; + } + + queue.lastRenderedState = newState; + } + + return [newState, dispatch]; +} + +function mountState(initialState) { + var hook = mountWorkInProgressHook(); + + if (typeof initialState === 'function') { + // $FlowFixMe: Flow doesn't like mixed types + initialState = initialState(); + } + + hook.memoizedState = hook.baseState = initialState; + var queue = hook.queue = { + pending: null, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue); + return [hook.memoizedState, dispatch]; +} + +function updateState(initialState) { + return updateReducer(basicStateReducer); +} + +function rerenderState(initialState) { + return rerenderReducer(basicStateReducer); +} + +function pushEffect(tag, create, destroy, deps) { + var effect = { + tag: tag, + create: create, + destroy: destroy, + deps: deps, + // Circular + next: null + }; + var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; + + if (componentUpdateQueue === null) { + componentUpdateQueue = createFunctionComponentUpdateQueue(); + currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; + componentUpdateQueue.lastEffect = effect.next = effect; + } else { + var lastEffect = componentUpdateQueue.lastEffect; + + if (lastEffect === null) { + componentUpdateQueue.lastEffect = effect.next = effect; + } else { + var firstEffect = lastEffect.next; + lastEffect.next = effect; + effect.next = firstEffect; + componentUpdateQueue.lastEffect = effect; + } + } + + return effect; +} + +function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + var ref = { + current: initialValue + }; + + { + Object.seal(ref); + } + + hook.memoizedState = ref; + return ref; +} + +function updateRef(initialValue) { + var hook = updateWorkInProgressHook(); + return hook.memoizedState; +} + +function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + currentlyRenderingFiber$1.effectTag |= fiberEffectTag; + hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, undefined, nextDeps); +} + +function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var destroy = undefined; + + if (currentHook !== null) { + var prevEffect = currentHook.memoizedState; + destroy = prevEffect.destroy; + + if (nextDeps !== null) { + var prevDeps = prevEffect.deps; + + if (areHookInputsEqual(nextDeps, prevDeps)) { + pushEffect(hookEffectTag, create, destroy, nextDeps); + return; + } + } + } + + currentlyRenderingFiber$1.effectTag |= fiberEffectTag; + hook.memoizedState = pushEffect(HasEffect | hookEffectTag, create, destroy, nextDeps); +} + +function mountEffect(create, deps) { + { + // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests + if ('undefined' !== typeof jest) { + warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1); + } + } + + return mountEffectImpl(Update | Passive, Passive$1, create, deps); +} + +function updateEffect(create, deps) { + { + // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests + if ('undefined' !== typeof jest) { + warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1); + } + } + + return updateEffectImpl(Update | Passive, Passive$1, create, deps); +} + +function mountLayoutEffect(create, deps) { + return mountEffectImpl(Update, Layout, create, deps); +} + +function updateLayoutEffect(create, deps) { + return updateEffectImpl(Update, Layout, create, deps); +} + +function imperativeHandleEffect(create, ref) { + if (typeof ref === 'function') { + var refCallback = ref; + + var _inst = create(); + + refCallback(_inst); + return function () { + refCallback(null); + }; + } else if (ref !== null && ref !== undefined) { + var refObject = ref; + + { + if (!refObject.hasOwnProperty('current')) { + error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}'); + } + } + + var _inst2 = create(); + + refObject.current = _inst2; + return function () { + refObject.current = null; + }; + } +} + +function mountImperativeHandle(ref, create, deps) { + { + if (typeof create !== 'function') { + error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null'); + } + } // TODO: If deps are provided, should we skip comparing the ref itself? + + + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); +} + +function updateImperativeHandle(ref, create, deps) { + { + if (typeof create !== 'function') { + error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null'); + } + } // TODO: If deps are provided, should we skip comparing the ref itself? + + + var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; + return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); +} + +function mountDebugValue(value, formatterFn) {// This hook is normally a no-op. + // The react-debug-hooks package injects its own implementation + // so that e.g. DevTools can display custom hook values. +} + +var updateDebugValue = mountDebugValue; + +function mountCallback(callback, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + hook.memoizedState = [callback, nextDeps]; + return callback; +} + +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + + if (prevState !== null) { + if (nextDeps !== null) { + var prevDeps = prevState[1]; + + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } + } + + hook.memoizedState = [callback, nextDeps]; + return callback; +} + +function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; +} + +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + var nextDeps = deps === undefined ? null : deps; + var prevState = hook.memoizedState; + + if (prevState !== null) { + // Assume these are defined. If they're not, areHookInputsEqual will warn. + if (nextDeps !== null) { + var prevDeps = prevState[1]; + + if (areHookInputsEqual(nextDeps, prevDeps)) { + return prevState[0]; + } + } + } + + var nextValue = nextCreate(); + hook.memoizedState = [nextValue, nextDeps]; + return nextValue; +} + +function mountDeferredValue(value, config) { + var _mountState = mountState(value), + prevValue = _mountState[0], + setValue = _mountState[1]; + + mountEffect(function () { + var previousConfig = ReactCurrentBatchConfig$1.suspense; + ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.suspense = previousConfig; + } + }, [value, config]); + return prevValue; +} + +function updateDeferredValue(value, config) { + var _updateState = updateState(), + prevValue = _updateState[0], + setValue = _updateState[1]; + + updateEffect(function () { + var previousConfig = ReactCurrentBatchConfig$1.suspense; + ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.suspense = previousConfig; + } + }, [value, config]); + return prevValue; +} + +function rerenderDeferredValue(value, config) { + var _rerenderState = rerenderState(), + prevValue = _rerenderState[0], + setValue = _rerenderState[1]; + + updateEffect(function () { + var previousConfig = ReactCurrentBatchConfig$1.suspense; + ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.suspense = previousConfig; + } + }, [value, config]); + return prevValue; +} + +function startTransition(setPending, config, callback) { + var priorityLevel = getCurrentPriorityLevel(); + runWithPriority$1(priorityLevel < UserBlockingPriority$1 ? UserBlockingPriority$1 : priorityLevel, function () { + setPending(true); + }); + runWithPriority$1(priorityLevel > NormalPriority ? NormalPriority : priorityLevel, function () { + var previousConfig = ReactCurrentBatchConfig$1.suspense; + ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config; + + try { + setPending(false); + callback(); + } finally { + ReactCurrentBatchConfig$1.suspense = previousConfig; + } + }); +} + +function mountTransition(config) { + var _mountState2 = mountState(false), + isPending = _mountState2[0], + setPending = _mountState2[1]; + + var start = mountCallback(startTransition.bind(null, setPending, config), [setPending, config]); + return [start, isPending]; +} + +function updateTransition(config) { + var _updateState2 = updateState(), + isPending = _updateState2[0], + setPending = _updateState2[1]; + + var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]); + return [start, isPending]; +} + +function rerenderTransition(config) { + var _rerenderState2 = rerenderState(), + isPending = _rerenderState2[0], + setPending = _rerenderState2[1]; + + var start = updateCallback(startTransition.bind(null, setPending, config), [setPending, config]); + return [start, isPending]; +} + +function dispatchAction(fiber, queue, action) { + { + if (typeof arguments[3] === 'function') { + error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().'); + } + } + + var currentTime = requestCurrentTimeForUpdate(); + var suspenseConfig = requestCurrentSuspenseConfig(); + var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig); + var update = { + expirationTime: expirationTime, + suspenseConfig: suspenseConfig, + action: action, + eagerReducer: null, + eagerState: null, + next: null + }; + + { + update.priority = getCurrentPriorityLevel(); + } // Append the update to the end of the list. + + + var pending = queue.pending; + + if (pending === null) { + // This is the first update. Create a circular list. + update.next = update; + } else { + update.next = pending.next; + pending.next = update; + } + + queue.pending = update; + var alternate = fiber.alternate; + + if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) { + // This is a render phase update. Stash it in a lazily-created map of + // queue -> linked list of updates. After this render pass, we'll restart + // and apply the stashed updates on top of the work-in-progress hook. + didScheduleRenderPhaseUpdate = true; + update.expirationTime = renderExpirationTime; + currentlyRenderingFiber$1.expirationTime = renderExpirationTime; + } else { + if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) { + // The queue is currently empty, which means we can eagerly compute the + // next state before entering the render phase. If the new state is the + // same as the current state, we may be able to bail out entirely. + var lastRenderedReducer = queue.lastRenderedReducer; + + if (lastRenderedReducer !== null) { + var prevDispatcher; + + { + prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + } + + try { + var currentState = queue.lastRenderedState; + var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute + // it, on the update object. If the reducer hasn't changed by the + // time we enter the render phase, then the eager state can be used + // without calling the reducer again. + + update.eagerReducer = lastRenderedReducer; + update.eagerState = eagerState; + + if (objectIs(eagerState, currentState)) { + // Fast path. We can bail out without scheduling React to re-render. + // It's still possible that we'll need to rebase this update later, + // if the component re-renders for a different reason and by that + // time the reducer has changed. + return; + } + } catch (error) {// Suppress the error. It will throw again in the render phase. + } finally { + { + ReactCurrentDispatcher.current = prevDispatcher; + } + } + } + } + + { + // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests + if ('undefined' !== typeof jest) { + warnIfNotScopedWithMatchingAct(fiber); + warnIfNotCurrentlyActingUpdatesInDev(fiber); + } + } + + scheduleWork(fiber, expirationTime); + } +} + +var ContextOnlyDispatcher = { + readContext: readContext, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useResponder: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError +}; +var HooksDispatcherOnMountInDEV = null; +var HooksDispatcherOnMountWithHookTypesInDEV = null; +var HooksDispatcherOnUpdateInDEV = null; +var HooksDispatcherOnRerenderInDEV = null; +var InvalidNestedHooksDispatcherOnMountInDEV = null; +var InvalidNestedHooksDispatcherOnUpdateInDEV = null; +var InvalidNestedHooksDispatcherOnRerenderInDEV = null; + +{ + var warnInvalidContextAccess = function () { + error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); + }; + + var warnInvalidHookAccess = function () { + error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks'); + }; + + HooksDispatcherOnMountInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + mountHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + mountHookTypesDev(); + checkDepsAreArrayDev(deps); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + mountHookTypesDev(); + return mountDebugValue(); + }, + useResponder: function (responder, props) { + currentHookNameInDev = 'useResponder'; + mountHookTypesDev(); + return createDeprecatedResponderListener(responder, props); + }, + useDeferredValue: function (value, config) { + currentHookNameInDev = 'useDeferredValue'; + mountHookTypesDev(); + return mountDeferredValue(value, config); + }, + useTransition: function (config) { + currentHookNameInDev = 'useTransition'; + mountHookTypesDev(); + return mountTransition(config); + } + }; + HooksDispatcherOnMountWithHookTypesInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + updateHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + updateHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + updateHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + updateHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + updateHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + updateHookTypesDev(); + return mountDebugValue(); + }, + useResponder: function (responder, props) { + currentHookNameInDev = 'useResponder'; + updateHookTypesDev(); + return createDeprecatedResponderListener(responder, props); + }, + useDeferredValue: function (value, config) { + currentHookNameInDev = 'useDeferredValue'; + updateHookTypesDev(); + return mountDeferredValue(value, config); + }, + useTransition: function (config) { + currentHookNameInDev = 'useTransition'; + updateHookTypesDev(); + return mountTransition(config); + } + }; + HooksDispatcherOnUpdateInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + updateHookTypesDev(); + return updateRef(); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + updateHookTypesDev(); + return updateDebugValue(); + }, + useResponder: function (responder, props) { + currentHookNameInDev = 'useResponder'; + updateHookTypesDev(); + return createDeprecatedResponderListener(responder, props); + }, + useDeferredValue: function (value, config) { + currentHookNameInDev = 'useDeferredValue'; + updateHookTypesDev(); + return updateDeferredValue(value, config); + }, + useTransition: function (config) { + currentHookNameInDev = 'useTransition'; + updateHookTypesDev(); + return updateTransition(config); + } + }; + HooksDispatcherOnRerenderInDEV = { + readContext: function (context, observedBits) { + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + + try { + return rerenderReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + updateHookTypesDev(); + return updateRef(); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV; + + try { + return rerenderState(initialState); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + updateHookTypesDev(); + return updateDebugValue(); + }, + useResponder: function (responder, props) { + currentHookNameInDev = 'useResponder'; + updateHookTypesDev(); + return createDeprecatedResponderListener(responder, props); + }, + useDeferredValue: function (value, config) { + currentHookNameInDev = 'useDeferredValue'; + updateHookTypesDev(); + return rerenderDeferredValue(value, config); + }, + useTransition: function (config) { + currentHookNameInDev = 'useTransition'; + updateHookTypesDev(); + return rerenderTransition(config); + } + }; + InvalidNestedHooksDispatcherOnMountInDEV = { + readContext: function (context, observedBits) { + warnInvalidContextAccess(); + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountMemo(create, deps); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountRef(initialValue); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + warnInvalidHookAccess(); + mountHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnMountInDEV; + + try { + return mountState(initialState); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountDebugValue(); + }, + useResponder: function (responder, props) { + currentHookNameInDev = 'useResponder'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return createDeprecatedResponderListener(responder, props); + }, + useDeferredValue: function (value, config) { + currentHookNameInDev = 'useDeferredValue'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountDeferredValue(value, config); + }, + useTransition: function (config) { + currentHookNameInDev = 'useTransition'; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountTransition(config); + } + }; + InvalidNestedHooksDispatcherOnUpdateInDEV = { + readContext: function (context, observedBits) { + warnInvalidContextAccess(); + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return updateReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateRef(); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return updateState(initialState); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDebugValue(); + }, + useResponder: function (responder, props) { + currentHookNameInDev = 'useResponder'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return createDeprecatedResponderListener(responder, props); + }, + useDeferredValue: function (value, config) { + currentHookNameInDev = 'useDeferredValue'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDeferredValue(value, config); + }, + useTransition: function (config) { + currentHookNameInDev = 'useTransition'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateTransition(config); + } + }; + InvalidNestedHooksDispatcherOnRerenderInDEV = { + readContext: function (context, observedBits) { + warnInvalidContextAccess(); + return readContext(context, observedBits); + }, + useCallback: function (callback, deps) { + currentHookNameInDev = 'useCallback'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateCallback(callback, deps); + }, + useContext: function (context, observedBits) { + currentHookNameInDev = 'useContext'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return readContext(context, observedBits); + }, + useEffect: function (create, deps) { + currentHookNameInDev = 'useEffect'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateEffect(create, deps); + }, + useImperativeHandle: function (ref, create, deps) { + currentHookNameInDev = 'useImperativeHandle'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateImperativeHandle(ref, create, deps); + }, + useLayoutEffect: function (create, deps) { + currentHookNameInDev = 'useLayoutEffect'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateLayoutEffect(create, deps); + }, + useMemo: function (create, deps) { + currentHookNameInDev = 'useMemo'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return updateMemo(create, deps); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useReducer: function (reducer, initialArg, init) { + currentHookNameInDev = 'useReducer'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return rerenderReducer(reducer, initialArg, init); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useRef: function (initialValue) { + currentHookNameInDev = 'useRef'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateRef(); + }, + useState: function (initialState) { + currentHookNameInDev = 'useState'; + warnInvalidHookAccess(); + updateHookTypesDev(); + var prevDispatcher = ReactCurrentDispatcher.current; + ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV; + + try { + return rerenderState(initialState); + } finally { + ReactCurrentDispatcher.current = prevDispatcher; + } + }, + useDebugValue: function (value, formatterFn) { + currentHookNameInDev = 'useDebugValue'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateDebugValue(); + }, + useResponder: function (responder, props) { + currentHookNameInDev = 'useResponder'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return createDeprecatedResponderListener(responder, props); + }, + useDeferredValue: function (value, config) { + currentHookNameInDev = 'useDeferredValue'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderDeferredValue(value, config); + }, + useTransition: function (config) { + currentHookNameInDev = 'useTransition'; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderTransition(config); + } + }; +} + +var now$1 = Scheduler.unstable_now; +var commitTime = 0; +var profilerStartTime = -1; + +function getCommitTime() { + return commitTime; +} + +function recordCommitTime() { + + commitTime = now$1(); +} + +function startProfilerTimer(fiber) { + + profilerStartTime = now$1(); + + if (fiber.actualStartTime < 0) { + fiber.actualStartTime = now$1(); + } +} + +function stopProfilerTimerIfRunning(fiber) { + + profilerStartTime = -1; +} + +function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { + + if (profilerStartTime >= 0) { + var elapsedTime = now$1() - profilerStartTime; + fiber.actualDuration += elapsedTime; + + if (overrideBaseTime) { + fiber.selfBaseDuration = elapsedTime; + } + + profilerStartTime = -1; + } +} + +// This may have been an insertion or a hydration. + +var hydrationParentFiber = null; +var nextHydratableInstance = null; +var isHydrating = false; + +function enterHydrationState(fiber) { + + var parentInstance = fiber.stateNode.containerInfo; + nextHydratableInstance = getFirstHydratableChild(parentInstance); + hydrationParentFiber = fiber; + isHydrating = true; + return true; +} + +function deleteHydratableInstance(returnFiber, instance) { + { + switch (returnFiber.tag) { + case HostRoot: + didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance); + break; + + case HostComponent: + didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance); + break; + } + } + + var childToDelete = createFiberFromHostInstanceForDeletion(); + childToDelete.stateNode = instance; + childToDelete.return = returnFiber; + childToDelete.effectTag = Deletion; // This might seem like it belongs on progressedFirstDeletion. However, + // these children are not part of the reconciliation list of children. + // Even if we abort and rereconcile the children, that will try to hydrate + // again and the nodes are still in the host tree so these will be + // recreated. + + if (returnFiber.lastEffect !== null) { + returnFiber.lastEffect.nextEffect = childToDelete; + returnFiber.lastEffect = childToDelete; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + } +} + +function insertNonHydratedInstance(returnFiber, fiber) { + fiber.effectTag = fiber.effectTag & ~Hydrating | Placement; + + { + switch (returnFiber.tag) { + case HostRoot: + { + var parentContainer = returnFiber.stateNode.containerInfo; + + switch (fiber.tag) { + case HostComponent: + var type = fiber.type; + var props = fiber.pendingProps; + didNotFindHydratableContainerInstance(parentContainer, type); + break; + + case HostText: + var text = fiber.pendingProps; + didNotFindHydratableContainerTextInstance(parentContainer, text); + break; + } + + break; + } + + case HostComponent: + { + var parentType = returnFiber.type; + var parentProps = returnFiber.memoizedProps; + var parentInstance = returnFiber.stateNode; + + switch (fiber.tag) { + case HostComponent: + var _type = fiber.type; + var _props = fiber.pendingProps; + didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type); + break; + + case HostText: + var _text = fiber.pendingProps; + didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text); + break; + + case SuspenseComponent: + didNotFindHydratableSuspenseInstance(parentType, parentProps); + break; + } + + break; + } + + default: + return; + } + } +} + +function tryHydrate(fiber, nextInstance) { + switch (fiber.tag) { + case HostComponent: + { + var type = fiber.type; + var props = fiber.pendingProps; + var instance = canHydrateInstance(nextInstance, type); + + if (instance !== null) { + fiber.stateNode = instance; + return true; + } + + return false; + } + + case HostText: + { + var text = fiber.pendingProps; + var textInstance = canHydrateTextInstance(nextInstance, text); + + if (textInstance !== null) { + fiber.stateNode = textInstance; + return true; + } + + return false; + } + + case SuspenseComponent: + { + + return false; + } + + default: + return false; + } +} + +function tryToClaimNextHydratableInstance(fiber) { + if (!isHydrating) { + return; + } + + var nextInstance = nextHydratableInstance; + + if (!nextInstance) { + // Nothing to hydrate. Make it an insertion. + insertNonHydratedInstance(hydrationParentFiber, fiber); + isHydrating = false; + hydrationParentFiber = fiber; + return; + } + + var firstAttemptedInstance = nextInstance; + + if (!tryHydrate(fiber, nextInstance)) { + // If we can't hydrate this instance let's try the next one. + // We use this as a heuristic. It's based on intuition and not data so it + // might be flawed or unnecessary. + nextInstance = getNextHydratableSibling(firstAttemptedInstance); + + if (!nextInstance || !tryHydrate(fiber, nextInstance)) { + // Nothing to hydrate. Make it an insertion. + insertNonHydratedInstance(hydrationParentFiber, fiber); + isHydrating = false; + hydrationParentFiber = fiber; + return; + } // We matched the next one, we'll now assume that the first one was + // superfluous and we'll delete it. Since we can't eagerly delete it + // we'll have to schedule a deletion. To do that, this node needs a dummy + // fiber associated with it. + + + deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance); + } + + hydrationParentFiber = fiber; + nextHydratableInstance = getFirstHydratableChild(nextInstance); +} + +function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { + + var instance = fiber.stateNode; + var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component. + + fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there + // is a new ref we mark this as an update. + + if (updatePayload !== null) { + return true; + } + + return false; +} + +function prepareToHydrateHostTextInstance(fiber) { + + var textInstance = fiber.stateNode; + var textContent = fiber.memoizedProps; + var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); + + { + if (shouldUpdate) { + // We assume that prepareToHydrateHostTextInstance is called in a context where the + // hydration parent is the parent host component of this host text. + var returnFiber = hydrationParentFiber; + + if (returnFiber !== null) { + switch (returnFiber.tag) { + case HostRoot: + { + var parentContainer = returnFiber.stateNode.containerInfo; + didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent); + break; + } + + case HostComponent: + { + var parentType = returnFiber.type; + var parentProps = returnFiber.memoizedProps; + var parentInstance = returnFiber.stateNode; + didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent); + break; + } + } + } + } + } + + return shouldUpdate; +} + +function skipPastDehydratedSuspenseInstance(fiber) { + + var suspenseState = fiber.memoizedState; + var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null; + + if (!suspenseInstance) { + { + throw Error( "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance); +} + +function popToNextHostParent(fiber) { + var parent = fiber.return; + + while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) { + parent = parent.return; + } + + hydrationParentFiber = parent; +} + +function popHydrationState(fiber) { + + if (fiber !== hydrationParentFiber) { + // We're deeper than the current hydration context, inside an inserted + // tree. + return false; + } + + if (!isHydrating) { + // If we're not currently hydrating but we're in a hydration context, then + // we were an insertion and now need to pop up reenter hydration of our + // siblings. + popToNextHostParent(fiber); + isHydrating = true; + return false; + } + + var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now. + // We only do this deeper than head and body since they tend to have random + // other nodes in them. We also ignore components with pure text content in + // side of them. + // TODO: Better heuristic. + + if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) { + var nextInstance = nextHydratableInstance; + + while (nextInstance) { + deleteHydratableInstance(fiber, nextInstance); + nextInstance = getNextHydratableSibling(nextInstance); + } + } + + popToNextHostParent(fiber); + + if (fiber.tag === SuspenseComponent) { + nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber); + } else { + nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; + } + + return true; +} + +function resetHydrationState() { + + hydrationParentFiber = null; + nextHydratableInstance = null; + isHydrating = false; +} + +var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; +var didReceiveUpdate = false; +var didWarnAboutBadClass; +var didWarnAboutModulePatternComponent; +var didWarnAboutContextTypeOnFunctionComponent; +var didWarnAboutGetDerivedStateOnFunctionComponent; +var didWarnAboutFunctionRefs; +var didWarnAboutReassigningProps; +var didWarnAboutRevealOrder; +var didWarnAboutTailOptions; + +{ + didWarnAboutBadClass = {}; + didWarnAboutModulePatternComponent = {}; + didWarnAboutContextTypeOnFunctionComponent = {}; + didWarnAboutGetDerivedStateOnFunctionComponent = {}; + didWarnAboutFunctionRefs = {}; + didWarnAboutReassigningProps = false; + didWarnAboutRevealOrder = {}; + didWarnAboutTailOptions = {}; +} + +function reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime) { + if (current === null) { + // If this is a fresh new component that hasn't been rendered yet, we + // won't update its child set by applying minimal side-effects. Instead, + // we will add them all to the child before it gets rendered. That means + // we can optimize this reconciliation pass by not tracking side-effects. + workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + } else { + // If the current child is the same as the work in progress, it means that + // we haven't yet started any work on these children. Therefore, we use + // the clone algorithm to create a copy of all the current children. + // If we had any progressed work already, that is invalid at this point so + // let's throw it out. + workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderExpirationTime); + } +} + +function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime) { + // This function is fork of reconcileChildren. It's used in cases where we + // want to reconcile without matching against the existing set. This has the + // effect of all current children being unmounted; even if the type and key + // are the same, the old child is unmounted and a new child is created. + // + // To do this, we're going to go through the reconcile algorithm twice. In + // the first pass, we schedule a deletion for all the current children by + // passing null. + workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderExpirationTime); // In the second pass, we mount the new children. The trick here is that we + // pass null in place of where we usually pass the current child set. This has + // the effect of remounting all children regardless of whether their + // identities match. + + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); +} + +function updateForwardRef(current, workInProgress, Component, nextProps, renderExpirationTime) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens after the first render suspends. + // We'll need to figure out if this is fine or can cause issues. + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } + } + + var render = Component.render; + var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent + + var nextChildren; + prepareToReadContext(workInProgress, renderExpirationTime); + + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime); + + if ( workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderExpirationTime); + } + } + + setIsRendering(false); + } + + if (current !== null && !didReceiveUpdate) { + bailoutHooks(current, workInProgress, renderExpirationTime); + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + } // React DevTools reads this flag. + + + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { + if (current === null) { + var type = Component.type; + + if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either. + Component.defaultProps === undefined) { + var resolvedType = type; + + { + resolvedType = resolveFunctionForHotReloading(type); + } // If this is a plain function component without default props, + // and with only the default shallow comparison, we upgrade it + // to a SimpleMemoComponent to allow fast path updates. + + + workInProgress.tag = SimpleMemoComponent; + workInProgress.type = resolvedType; + + { + validateFunctionComponentInDev(workInProgress, type); + } + + return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime); + } + + { + var innerPropTypes = type.propTypes; + + if (innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(type), getCurrentFiberStackInDev); + } + } + + var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime); + child.ref = workInProgress.ref; + child.return = workInProgress; + workInProgress.child = child; + return child; + } + + { + var _type = Component.type; + var _innerPropTypes = _type.propTypes; + + if (_innerPropTypes) { + // Inner memo component props aren't currently validated in createElement. + // We could move it there, but we'd still need this for lazy code path. + checkPropTypes(_innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(_type), getCurrentFiberStackInDev); + } + } + + var currentChild = current.child; // This is always exactly one child + + if (updateExpirationTime < renderExpirationTime) { + // This will be the props with resolved defaultProps, + // unlike current.memoizedProps which will be the unresolved ones. + var prevProps = currentChild.memoizedProps; // Default to shallow comparison + + var compare = Component.compare; + compare = compare !== null ? compare : shallowEqual; + + if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) { + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + } + } // React DevTools reads this flag. + + + workInProgress.effectTag |= PerformedWork; + var newChild = createWorkInProgress(currentChild, nextProps); + newChild.ref = workInProgress.ref; + newChild.return = workInProgress; + workInProgress.child = newChild; + return newChild; +} + +function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) { + // TODO: current can be non-null here even if the component + // hasn't yet mounted. This happens when the inner render suspends. + // We'll need to figure out if this is fine or can cause issues. + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var outerMemoType = workInProgress.elementType; + + if (outerMemoType.$$typeof === REACT_LAZY_TYPE) { + // We warn when you define propTypes on lazy() + // so let's just skip over it to find memo() outer wrapper. + // Inner props for memo are validated later. + outerMemoType = refineResolvedLazyComponent(outerMemoType); + } + + var outerPropTypes = outerMemoType && outerMemoType.propTypes; + + if (outerPropTypes) { + checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps) + 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev); + } // Inner propTypes will be validated in the function component path. + + } + } + + if (current !== null) { + var prevProps = current.memoizedProps; + + if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload. + workInProgress.type === current.type )) { + didReceiveUpdate = false; + + if (updateExpirationTime < renderExpirationTime) { + // The pending update priority was cleared at the beginning of + // beginWork. We're about to bail out, but there might be additional + // updates at a lower priority. Usually, the priority level of the + // remaining updates is accumlated during the evaluation of the + // component (i.e. when processing the update queue). But since since + // we're bailing out early *without* evaluating the component, we need + // to account for it here, too. Reset to the value of the current fiber. + // NOTE: This only applies to SimpleMemoComponent, not MemoComponent, + // because a MemoComponent fiber does not have hooks or an update queue; + // rather, it wraps around an inner component, which may or may not + // contains hooks. + // TODO: Move the reset at in beginWork out of the common path so that + // this is no longer necessary. + workInProgress.expirationTime = current.expirationTime; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + } + } + } + + return updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime); +} + +function updateFragment(current, workInProgress, renderExpirationTime) { + var nextChildren = workInProgress.pendingProps; + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateMode(current, workInProgress, renderExpirationTime) { + var nextChildren = workInProgress.pendingProps.children; + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateProfiler(current, workInProgress, renderExpirationTime) { + { + workInProgress.effectTag |= Update; + } + + var nextProps = workInProgress.pendingProps; + var nextChildren = nextProps.children; + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + + if (current === null && ref !== null || current !== null && current.ref !== ref) { + // Schedule a Ref effect + workInProgress.effectTag |= Ref; + } +} + +function updateFunctionComponent(current, workInProgress, Component, nextProps, renderExpirationTime) { + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } + } + + var context; + + { + var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); + context = getMaskedContext(workInProgress, unmaskedContext); + } + + var nextChildren; + prepareToReadContext(workInProgress, renderExpirationTime); + + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime); + + if ( workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderExpirationTime); + } + } + + setIsRendering(false); + } + + if (current !== null && !didReceiveUpdate) { + bailoutHooks(current, workInProgress, renderExpirationTime); + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + } // React DevTools reads this flag. + + + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateClassComponent(current, workInProgress, Component, nextProps, renderExpirationTime) { + { + if (workInProgress.type !== workInProgress.elementType) { + // Lazy component props can't be validated in createElement + // because they're only guaranteed to be resolved here. + var innerPropTypes = Component.propTypes; + + if (innerPropTypes) { + checkPropTypes(innerPropTypes, nextProps, // Resolved props + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } + } // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + + var hasContext; + + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + + prepareToReadContext(workInProgress, renderExpirationTime); + var instance = workInProgress.stateNode; + var shouldUpdate; + + if (instance === null) { + if (current !== null) { + // A class component without an instance only mounts if it suspended + // inside a non-concurrent tree, in an inconsistent state. We want to + // treat it like a new mount, even though an empty version of it already + // committed. Disconnect the alternate pointers. + current.alternate = null; + workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect + + workInProgress.effectTag |= Placement; + } // In the initial pass we might need to construct the instance. + + + constructClassInstance(workInProgress, Component, nextProps); + mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime); + shouldUpdate = true; + } else if (current === null) { + // In a resume, we'll already have an instance we can reuse. + shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime); + } else { + shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderExpirationTime); + } + + var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime); + + { + var inst = workInProgress.stateNode; + + if (inst.props !== nextProps) { + if (!didWarnAboutReassigningProps) { + error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component'); + } + + didWarnAboutReassigningProps = true; + } + } + + return nextUnitOfWork; +} + +function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) { + // Refs should update even if shouldComponentUpdate returns false + markRef(current, workInProgress); + var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect; + + if (!shouldUpdate && !didCaptureError) { + // Context providers should defer to sCU for rendering + if (hasContext) { + invalidateContextProvider(workInProgress, Component, false); + } + + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + } + + var instance = workInProgress.stateNode; // Rerender + + ReactCurrentOwner$1.current = workInProgress; + var nextChildren; + + if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') { + // If we captured an error, but getDerivedStateFromError is not defined, + // unmount all the children. componentDidCatch will schedule an update to + // re-render a fallback. This is temporary until we migrate everyone to + // the new API. + // TODO: Warn in a future release. + nextChildren = null; + + { + stopProfilerTimerIfRunning(); + } + } else { + { + setIsRendering(true); + nextChildren = instance.render(); + + if ( workInProgress.mode & StrictMode) { + instance.render(); + } + + setIsRendering(false); + } + } // React DevTools reads this flag. + + + workInProgress.effectTag |= PerformedWork; + + if (current !== null && didCaptureError) { + // If we're recovering from an error, reconcile without reusing any of + // the existing children. Conceptually, the normal children and the children + // that are shown on error are two different sets, so we shouldn't reuse + // normal children even if their identities match. + forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderExpirationTime); + } else { + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + } // Memoize state using the values we just used to render. + // TODO: Restructure so we never read values from the instance. + + + workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it. + + if (hasContext) { + invalidateContextProvider(workInProgress, Component, true); + } + + return workInProgress.child; +} + +function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + + if (root.pendingContext) { + pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context); + } else if (root.context) { + // Should always be set + pushTopLevelContextObject(workInProgress, root.context, false); + } + + pushHostContainer(workInProgress, root.containerInfo); +} + +function updateHostRoot(current, workInProgress, renderExpirationTime) { + pushHostRootContext(workInProgress); + var updateQueue = workInProgress.updateQueue; + + if (!(current !== null && updateQueue !== null)) { + { + throw Error( "If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + var nextProps = workInProgress.pendingProps; + var prevState = workInProgress.memoizedState; + var prevChildren = prevState !== null ? prevState.element : null; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderExpirationTime); + var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property + // being called "element". + + var nextChildren = nextState.element; + + if (nextChildren === prevChildren) { + // If the state is the same as before, that's a bailout because we had + // no work that expires at this time. + resetHydrationState(); + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + } + + var root = workInProgress.stateNode; + + if (root.hydrate && enterHydrationState(workInProgress)) { + // If we don't have any current children this might be the first pass. + // We always try to hydrate. If this isn't a hydration pass there won't + // be any children to hydrate which is effectively the same thing as + // not hydrating. + var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + workInProgress.child = child; + var node = child; + + while (node) { + // Mark each child as hydrating. This is a fast path to know whether this + // tree is part of a hydrating tree. This is used to determine if a child + // node has fully mounted yet, and for scheduling event replaying. + // Conceptually this is similar to Placement in that a new subtree is + // inserted into the React tree here. It just happens to not need DOM + // mutations because it already exists. + node.effectTag = node.effectTag & ~Placement | Hydrating; + node = node.sibling; + } + } else { + // Otherwise reset hydration state in case we aborted and resumed another + // root. + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + resetHydrationState(); + } + + return workInProgress.child; +} + +function updateHostComponent(current, workInProgress, renderExpirationTime) { + pushHostContext(workInProgress); + + if (current === null) { + tryToClaimNextHydratableInstance(workInProgress); + } + + var type = workInProgress.type; + var nextProps = workInProgress.pendingProps; + var prevProps = current !== null ? current.memoizedProps : null; + var nextChildren = nextProps.children; + var isDirectTextChild = shouldSetTextContent(type, nextProps); + + if (isDirectTextChild) { + // We special case a direct text child of a host node. This is a common + // case. We won't handle it as a reified child. We will instead handle + // this in the host environment that also has access to this prop. That + // avoids allocating another HostText fiber and traversing it. + nextChildren = null; + } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) { + // If we're switching from a direct text child to a normal child, or to + // empty, we need to schedule the text content to be reset. + workInProgress.effectTag |= ContentReset; + } + + markRef(current, workInProgress); // Check the host config to see if the children are offscreen/hidden. + + if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) { + { + markSpawnedWork(Never); + } // Schedule this fiber to re-render at offscreen priority. Then bailout. + + + workInProgress.expirationTime = workInProgress.childExpirationTime = Never; + return null; + } + + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + return workInProgress.child; +} + +function updateHostText(current, workInProgress) { + if (current === null) { + tryToClaimNextHydratableInstance(workInProgress); + } // Nothing to do here. This is terminal. We'll do the completion step + // immediately after. + + + return null; +} + +function mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) { + if (_current !== null) { + // A lazy component only mounts if it suspended inside a non- + // concurrent tree, in an inconsistent state. We want to treat it like + // a new mount, even though an empty version of it already committed. + // Disconnect the alternate pointers. + _current.alternate = null; + workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect + + workInProgress.effectTag |= Placement; + } + + var props = workInProgress.pendingProps; // We can't start a User Timing measurement with correct label yet. + // Cancel and resume right after we know the tag. + + cancelWorkTimer(workInProgress); + var Component = readLazyComponentType(elementType); // Store the unwrapped component in the type. + + workInProgress.type = Component; + var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component); + startWorkTimer(workInProgress); + var resolvedProps = resolveDefaultProps(Component, props); + var child; + + switch (resolvedTag) { + case FunctionComponent: + { + { + validateFunctionComponentInDev(workInProgress, Component); + workInProgress.type = Component = resolveFunctionForHotReloading(Component); + } + + child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime); + return child; + } + + case ClassComponent: + { + { + workInProgress.type = Component = resolveClassForHotReloading(Component); + } + + child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime); + return child; + } + + case ForwardRef: + { + { + workInProgress.type = Component = resolveForwardRefForHotReloading(Component); + } + + child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime); + return child; + } + + case MemoComponent: + { + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = Component.propTypes; + + if (outerPropTypes) { + checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only + 'prop', getComponentName(Component), getCurrentFiberStackInDev); + } + } + } + + child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too + updateExpirationTime, renderExpirationTime); + return child; + } + } + + var hint = ''; + + { + if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) { + hint = ' Did you wrap a component in React.lazy() more than once?'; + } + } // This message intentionally doesn't mention ForwardRef or MemoComponent + // because the fact that it's a separate type of work is an + // implementation detail. + + + { + { + throw Error( "Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint ); + } + } +} + +function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) { + if (_current !== null) { + // An incomplete component only mounts if it suspended inside a non- + // concurrent tree, in an inconsistent state. We want to treat it like + // a new mount, even though an empty version of it already committed. + // Disconnect the alternate pointers. + _current.alternate = null; + workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect + + workInProgress.effectTag |= Placement; + } // Promote the fiber to a class and try rendering again. + + + workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent` + // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + var hasContext; + + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + + prepareToReadContext(workInProgress, renderExpirationTime); + constructClassInstance(workInProgress, Component, nextProps); + mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime); + return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime); +} + +function mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) { + if (_current !== null) { + // An indeterminate component only mounts if it suspended inside a non- + // concurrent tree, in an inconsistent state. We want to treat it like + // a new mount, even though an empty version of it already committed. + // Disconnect the alternate pointers. + _current.alternate = null; + workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect + + workInProgress.effectTag |= Placement; + } + + var props = workInProgress.pendingProps; + var context; + + { + var unmaskedContext = getUnmaskedContext(workInProgress, Component, false); + context = getMaskedContext(workInProgress, unmaskedContext); + } + + prepareToReadContext(workInProgress, renderExpirationTime); + var value; + + { + if (Component.prototype && typeof Component.prototype.render === 'function') { + var componentName = getComponentName(Component) || 'Unknown'; + + if (!didWarnAboutBadClass[componentName]) { + error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName); + + didWarnAboutBadClass[componentName] = true; + } + } + + if (workInProgress.mode & StrictMode) { + ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null); + } + + setIsRendering(true); + ReactCurrentOwner$1.current = workInProgress; + value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime); + setIsRendering(false); + } // React DevTools reads this flag. + + + workInProgress.effectTag |= PerformedWork; + + if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) { + { + var _componentName = getComponentName(Component) || 'Unknown'; + + if (!didWarnAboutModulePatternComponent[_componentName]) { + error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName); + + didWarnAboutModulePatternComponent[_componentName] = true; + } + } // Proceed under the assumption that this is a class instance + + + workInProgress.tag = ClassComponent; // Throw out any hooks that were used. + + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches. + // During mounting we don't know the child context yet as the instance doesn't exist. + // We will invalidate the child context in finishClassComponent() right after rendering. + + var hasContext = false; + + if (isContextProvider(Component)) { + hasContext = true; + pushContextProvider(workInProgress); + } else { + hasContext = false; + } + + workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; + initializeUpdateQueue(workInProgress); + var getDerivedStateFromProps = Component.getDerivedStateFromProps; + + if (typeof getDerivedStateFromProps === 'function') { + applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props); + } + + adoptClassInstance(workInProgress, value); + mountClassInstance(workInProgress, Component, props, renderExpirationTime); + return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime); + } else { + // Proceed under the assumption that this is a function component + workInProgress.tag = FunctionComponent; + + { + + if ( workInProgress.mode & StrictMode) { + // Only double-render components with Hooks + if (workInProgress.memoizedState !== null) { + value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime); + } + } + } + + reconcileChildren(null, workInProgress, value, renderExpirationTime); + + { + validateFunctionComponentInDev(workInProgress, Component); + } + + return workInProgress.child; + } +} + +function validateFunctionComponentInDev(workInProgress, Component) { + { + if (Component) { + if (Component.childContextTypes) { + error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component'); + } + } + + if (workInProgress.ref !== null) { + var info = ''; + var ownerName = getCurrentFiberOwnerNameInDevOrNull(); + + if (ownerName) { + info += '\n\nCheck the render method of `' + ownerName + '`.'; + } + + var warningKey = ownerName || workInProgress._debugID || ''; + var debugSource = workInProgress._debugSource; + + if (debugSource) { + warningKey = debugSource.fileName + ':' + debugSource.lineNumber; + } + + if (!didWarnAboutFunctionRefs[warningKey]) { + didWarnAboutFunctionRefs[warningKey] = true; + + error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info); + } + } + + if (typeof Component.getDerivedStateFromProps === 'function') { + var _componentName2 = getComponentName(Component) || 'Unknown'; + + if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) { + error('%s: Function components do not support getDerivedStateFromProps.', _componentName2); + + didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true; + } + } + + if (typeof Component.contextType === 'object' && Component.contextType !== null) { + var _componentName3 = getComponentName(Component) || 'Unknown'; + + if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) { + error('%s: Function components do not support contextType.', _componentName3); + + didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true; + } + } + } +} + +var SUSPENDED_MARKER = { + dehydrated: null, + retryTime: NoWork +}; + +function shouldRemainOnFallback(suspenseContext, current, workInProgress) { + // If the context is telling us that we should show a fallback, and we're not + // already showing content, then we should show the fallback instead. + return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current === null || current.memoizedState !== null); +} + +function updateSuspenseComponent(current, workInProgress, renderExpirationTime) { + var mode = workInProgress.mode; + var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend. + + { + if (shouldSuspend(workInProgress)) { + workInProgress.effectTag |= DidCapture; + } + } + + var suspenseContext = suspenseStackCursor.current; + var nextDidTimeout = false; + var didSuspend = (workInProgress.effectTag & DidCapture) !== NoEffect; + + if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) { + // Something in this boundary's subtree already suspended. Switch to + // rendering the fallback children. + nextDidTimeout = true; + workInProgress.effectTag &= ~DidCapture; + } else { + // Attempting the main content + if (current === null || current.memoizedState !== null) { + // This is a new mount or this boundary is already showing a fallback state. + // Mark this subtree context as having at least one invisible parent that could + // handle the fallback state. + // Boundaries without fallbacks or should be avoided are not considered since + // they cannot handle preferred fallback states. + if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) { + suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext); + } + } + } + + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + pushSuspenseContext(workInProgress, suspenseContext); // This next part is a bit confusing. If the children timeout, we switch to + // showing the fallback children in place of the "primary" children. + // However, we don't want to delete the primary children because then their + // state will be lost (both the React state and the host state, e.g. + // uncontrolled form inputs). Instead we keep them mounted and hide them. + // Both the fallback children AND the primary children are rendered at the + // same time. Once the primary children are un-suspended, we can delete + // the fallback children — don't need to preserve their state. + // + // The two sets of children are siblings in the host environment, but + // semantically, for purposes of reconciliation, they are two separate sets. + // So we store them using two fragment fibers. + // + // However, we want to avoid allocating extra fibers for every placeholder. + // They're only necessary when the children time out, because that's the + // only time when both sets are mounted. + // + // So, the extra fragment fibers are only used if the children time out. + // Otherwise, we render the primary children directly. This requires some + // custom reconciliation logic to preserve the state of the primary + // children. It's essentially a very basic form of re-parenting. + + if (current === null) { + // If we're currently hydrating, try to hydrate this boundary. + // But only if this has a fallback. + if (nextProps.fallback !== undefined) { + tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component. + } // This is the initial mount. This branch is pretty simple because there's + // no previous state that needs to be preserved. + + + if (nextDidTimeout) { + // Mount separate fragments for primary and fallback children. + var nextFallbackChildren = nextProps.fallback; + var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null); + primaryChildFragment.return = workInProgress; + + if ((workInProgress.mode & BlockingMode) === NoMode) { + // Outside of blocking mode, we commit the effects from the + // partially completed, timed-out tree, too. + var progressedState = workInProgress.memoizedState; + var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child; + primaryChildFragment.child = progressedPrimaryChild; + var progressedChild = progressedPrimaryChild; + + while (progressedChild !== null) { + progressedChild.return = primaryChildFragment; + progressedChild = progressedChild.sibling; + } + } + + var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null); + fallbackChildFragment.return = workInProgress; + primaryChildFragment.sibling = fallbackChildFragment; // Skip the primary children, and continue working on the + // fallback children. + + workInProgress.memoizedState = SUSPENDED_MARKER; + workInProgress.child = primaryChildFragment; + return fallbackChildFragment; + } else { + // Mount the primary children without an intermediate fragment fiber. + var nextPrimaryChildren = nextProps.children; + workInProgress.memoizedState = null; + return workInProgress.child = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime); + } + } else { + // This is an update. This branch is more complicated because we need to + // ensure the state of the primary children is preserved. + var prevState = current.memoizedState; + + if (prevState !== null) { + // wrapped in a fragment fiber. + + + var currentPrimaryChildFragment = current.child; + var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; + + if (nextDidTimeout) { + // Still timed out. Reuse the current primary children by cloning + // its fragment. We're going to skip over these entirely. + var _nextFallbackChildren2 = nextProps.fallback; + + var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps); + + _primaryChildFragment2.return = workInProgress; + + if ((workInProgress.mode & BlockingMode) === NoMode) { + // Outside of blocking mode, we commit the effects from the + // partially completed, timed-out tree, too. + var _progressedState = workInProgress.memoizedState; + + var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child; + + if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) { + _primaryChildFragment2.child = _progressedPrimaryChild; + var _progressedChild2 = _progressedPrimaryChild; + + while (_progressedChild2 !== null) { + _progressedChild2.return = _primaryChildFragment2; + _progressedChild2 = _progressedChild2.sibling; + } + } + } // Because primaryChildFragment is a new fiber that we're inserting as the + // parent of a new tree, we need to set its treeBaseDuration. + + + if ( workInProgress.mode & ProfileMode) { + // treeBaseDuration is the sum of all the child tree base durations. + var _treeBaseDuration = 0; + var _hiddenChild = _primaryChildFragment2.child; + + while (_hiddenChild !== null) { + _treeBaseDuration += _hiddenChild.treeBaseDuration; + _hiddenChild = _hiddenChild.sibling; + } + + _primaryChildFragment2.treeBaseDuration = _treeBaseDuration; + } // Clone the fallback child fragment, too. These we'll continue + // working on. + + + var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2); + + _fallbackChildFragment2.return = workInProgress; + _primaryChildFragment2.sibling = _fallbackChildFragment2; + _primaryChildFragment2.childExpirationTime = NoWork; // Skip the primary children, and continue working on the + // fallback children. + + workInProgress.memoizedState = SUSPENDED_MARKER; + workInProgress.child = _primaryChildFragment2; + return _fallbackChildFragment2; + } else { + // No longer suspended. Switch back to showing the primary children, + // and remove the intermediate fragment fiber. + var _nextPrimaryChildren = nextProps.children; + var currentPrimaryChild = currentPrimaryChildFragment.child; + var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime); // If this render doesn't suspend, we need to delete the fallback + // children. Wait until the complete phase, after we've confirmed the + // fallback is no longer needed. + // TODO: Would it be better to store the fallback fragment on + // the stateNode? + // Continue rendering the children, like we normally do. + + workInProgress.memoizedState = null; + return workInProgress.child = primaryChild; + } + } else { + // The current tree has not already timed out. That means the primary + // children are not wrapped in a fragment fiber. + var _currentPrimaryChild = current.child; + + if (nextDidTimeout) { + // Timed out. Wrap the children in a fragment fiber to keep them + // separate from the fallback children. + var _nextFallbackChildren3 = nextProps.fallback; + + var _primaryChildFragment3 = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't + // going to render this fragment. + null, mode, NoWork, null); + + _primaryChildFragment3.return = workInProgress; + _primaryChildFragment3.child = _currentPrimaryChild; + + if (_currentPrimaryChild !== null) { + _currentPrimaryChild.return = _primaryChildFragment3; + } // Even though we're creating a new fiber, there are no new children, + // because we're reusing an already mounted tree. So we don't need to + // schedule a placement. + // primaryChildFragment.effectTag |= Placement; + + + if ((workInProgress.mode & BlockingMode) === NoMode) { + // Outside of blocking mode, we commit the effects from the + // partially completed, timed-out tree, too. + var _progressedState2 = workInProgress.memoizedState; + + var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child; + + _primaryChildFragment3.child = _progressedPrimaryChild2; + var _progressedChild3 = _progressedPrimaryChild2; + + while (_progressedChild3 !== null) { + _progressedChild3.return = _primaryChildFragment3; + _progressedChild3 = _progressedChild3.sibling; + } + } // Because primaryChildFragment is a new fiber that we're inserting as the + // parent of a new tree, we need to set its treeBaseDuration. + + + if ( workInProgress.mode & ProfileMode) { + // treeBaseDuration is the sum of all the child tree base durations. + var _treeBaseDuration2 = 0; + var _hiddenChild2 = _primaryChildFragment3.child; + + while (_hiddenChild2 !== null) { + _treeBaseDuration2 += _hiddenChild2.treeBaseDuration; + _hiddenChild2 = _hiddenChild2.sibling; + } + + _primaryChildFragment3.treeBaseDuration = _treeBaseDuration2; + } // Create a fragment from the fallback children, too. + + + var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime, null); + + _fallbackChildFragment3.return = workInProgress; + _primaryChildFragment3.sibling = _fallbackChildFragment3; + _fallbackChildFragment3.effectTag |= Placement; + _primaryChildFragment3.childExpirationTime = NoWork; // Skip the primary children, and continue working on the + // fallback children. + + workInProgress.memoizedState = SUSPENDED_MARKER; + workInProgress.child = _primaryChildFragment3; + return _fallbackChildFragment3; + } else { + // Still haven't timed out. Continue rendering the children, like we + // normally do. + workInProgress.memoizedState = null; + var _nextPrimaryChildren2 = nextProps.children; + return workInProgress.child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime); + } + } + } +} + +function scheduleWorkOnFiber(fiber, renderExpirationTime) { + if (fiber.expirationTime < renderExpirationTime) { + fiber.expirationTime = renderExpirationTime; + } + + var alternate = fiber.alternate; + + if (alternate !== null && alternate.expirationTime < renderExpirationTime) { + alternate.expirationTime = renderExpirationTime; + } + + scheduleWorkOnParentPath(fiber.return, renderExpirationTime); +} + +function propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) { + // Mark any Suspense boundaries with fallbacks as having work to do. + // If they were previously forced into fallbacks, they may now be able + // to unblock. + var node = firstChild; + + while (node !== null) { + if (node.tag === SuspenseComponent) { + var state = node.memoizedState; + + if (state !== null) { + scheduleWorkOnFiber(node, renderExpirationTime); + } + } else if (node.tag === SuspenseListComponent) { + // If the tail is hidden there might not be an Suspense boundaries + // to schedule work on. In this case we have to schedule it on the + // list itself. + // We don't have to traverse to the children of the list since + // the list will propagate the change when it rerenders. + scheduleWorkOnFiber(node, renderExpirationTime); + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === workInProgress) { + return; + } + + while (node.sibling === null) { + if (node.return === null || node.return === workInProgress) { + return; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } +} + +function findLastContentRow(firstChild) { + // This is going to find the last row among these children that is already + // showing content on the screen, as opposed to being in fallback state or + // new. If a row has multiple Suspense boundaries, any of them being in the + // fallback state, counts as the whole row being in a fallback state. + // Note that the "rows" will be workInProgress, but any nested children + // will still be current since we haven't rendered them yet. The mounted + // order may not be the same as the new order. We use the new order. + var row = firstChild; + var lastContentRow = null; + + while (row !== null) { + var currentRow = row.alternate; // New rows can't be content rows. + + if (currentRow !== null && findFirstSuspended(currentRow) === null) { + lastContentRow = row; + } + + row = row.sibling; + } + + return lastContentRow; +} + +function validateRevealOrder(revealOrder) { + { + if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) { + didWarnAboutRevealOrder[revealOrder] = true; + + if (typeof revealOrder === 'string') { + switch (revealOrder.toLowerCase()) { + case 'together': + case 'forwards': + case 'backwards': + { + error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase()); + + break; + } + + case 'forward': + case 'backward': + { + error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase()); + + break; + } + + default: + error('"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); + + break; + } + } else { + error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); + } + } + } +} + +function validateTailOptions(tailMode, revealOrder) { + { + if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) { + if (tailMode !== 'collapsed' && tailMode !== 'hidden') { + didWarnAboutTailOptions[tailMode] = true; + + error('"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode); + } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') { + didWarnAboutTailOptions[tailMode] = true; + + error('<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode); + } + } + } +} + +function validateSuspenseListNestedChild(childSlot, index) { + { + var isArray = Array.isArray(childSlot); + var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function'; + + if (isArray || isIterable) { + var type = isArray ? 'array' : 'iterable'; + + error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type); + + return false; + } + } + + return true; +} + +function validateSuspenseListChildren(children, revealOrder) { + { + if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) { + if (Array.isArray(children)) { + for (var i = 0; i < children.length; i++) { + if (!validateSuspenseListNestedChild(children[i], i)) { + return; + } + } + } else { + var iteratorFn = getIteratorFn(children); + + if (typeof iteratorFn === 'function') { + var childrenIterator = iteratorFn.call(children); + + if (childrenIterator) { + var step = childrenIterator.next(); + var _i = 0; + + for (; !step.done; step = childrenIterator.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) { + return; + } + + _i++; + } + } + } else { + error('A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder); + } + } + } + } +} + +function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) { + var renderState = workInProgress.memoizedState; + + if (renderState === null) { + workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailExpiration: 0, + tailMode: tailMode, + lastEffect: lastEffectBeforeRendering + }; + } else { + // We can reuse the existing object from previous renders. + renderState.isBackwards = isBackwards; + renderState.rendering = null; + renderState.renderingStartTime = 0; + renderState.last = lastContentRow; + renderState.tail = tail; + renderState.tailExpiration = 0; + renderState.tailMode = tailMode; + renderState.lastEffect = lastEffectBeforeRendering; + } +} // This can end up rendering this component multiple passes. +// The first pass splits the children fibers into two sets. A head and tail. +// We first render the head. If anything is in fallback state, we do another +// pass through beginWork to rerender all children (including the tail) with +// the force suspend context. If the first render didn't have anything in +// in fallback state. Then we render each row in the tail one-by-one. +// That happens in the completeWork phase without going back to beginWork. + + +function updateSuspenseListComponent(current, workInProgress, renderExpirationTime) { + var nextProps = workInProgress.pendingProps; + var revealOrder = nextProps.revealOrder; + var tailMode = nextProps.tail; + var newChildren = nextProps.children; + validateRevealOrder(revealOrder); + validateTailOptions(tailMode, revealOrder); + validateSuspenseListChildren(newChildren, revealOrder); + reconcileChildren(current, workInProgress, newChildren, renderExpirationTime); + var suspenseContext = suspenseStackCursor.current; + var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback); + + if (shouldForceFallback) { + suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); + workInProgress.effectTag |= DidCapture; + } else { + var didSuspendBefore = current !== null && (current.effectTag & DidCapture) !== NoEffect; + + if (didSuspendBefore) { + // If we previously forced a fallback, we need to schedule work + // on any nested boundaries to let them know to try to render + // again. This is the same as context updating. + propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime); + } + + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + } + + pushSuspenseContext(workInProgress, suspenseContext); + + if ((workInProgress.mode & BlockingMode) === NoMode) { + // Outside of blocking mode, SuspenseList doesn't work so we just + // use make it a noop by treating it as the default revealOrder. + workInProgress.memoizedState = null; + } else { + switch (revealOrder) { + case 'forwards': + { + var lastContentRow = findLastContentRow(workInProgress.child); + var tail; + + if (lastContentRow === null) { + // The whole list is part of the tail. + // TODO: We could fast path by just rendering the tail now. + tail = workInProgress.child; + workInProgress.child = null; + } else { + // Disconnect the tail rows after the content row. + // We're going to render them separately later. + tail = lastContentRow.sibling; + lastContentRow.sibling = null; + } + + initSuspenseListRenderState(workInProgress, false, // isBackwards + tail, lastContentRow, tailMode, workInProgress.lastEffect); + break; + } + + case 'backwards': + { + // We're going to find the first row that has existing content. + // At the same time we're going to reverse the list of everything + // we pass in the meantime. That's going to be our tail in reverse + // order. + var _tail = null; + var row = workInProgress.child; + workInProgress.child = null; + + while (row !== null) { + var currentRow = row.alternate; // New rows can't be content rows. + + if (currentRow !== null && findFirstSuspended(currentRow) === null) { + // This is the beginning of the main content. + workInProgress.child = row; + break; + } + + var nextRow = row.sibling; + row.sibling = _tail; + _tail = row; + row = nextRow; + } // TODO: If workInProgress.child is null, we can continue on the tail immediately. + + + initSuspenseListRenderState(workInProgress, true, // isBackwards + _tail, null, // last + tailMode, workInProgress.lastEffect); + break; + } + + case 'together': + { + initSuspenseListRenderState(workInProgress, false, // isBackwards + null, // tail + null, // last + undefined, workInProgress.lastEffect); + break; + } + + default: + { + // The default reveal order is the same as not having + // a boundary. + workInProgress.memoizedState = null; + } + } + } + + return workInProgress.child; +} + +function updatePortalComponent(current, workInProgress, renderExpirationTime) { + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + var nextChildren = workInProgress.pendingProps; + + if (current === null) { + // Portals are special because we don't append the children during mount + // but at commit. Therefore we need to track insertions which the normal + // flow doesn't do during mount. This doesn't happen at the root because + // the root always starts with a "current" with a null child. + // TODO: Consider unifying this with how the root works. + workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime); + } else { + reconcileChildren(current, workInProgress, nextChildren, renderExpirationTime); + } + + return workInProgress.child; +} + +function updateContextProvider(current, workInProgress, renderExpirationTime) { + var providerType = workInProgress.type; + var context = providerType._context; + var newProps = workInProgress.pendingProps; + var oldProps = workInProgress.memoizedProps; + var newValue = newProps.value; + + { + var providerPropTypes = workInProgress.type.propTypes; + + if (providerPropTypes) { + checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev); + } + } + + pushProvider(workInProgress, newValue); + + if (oldProps !== null) { + var oldValue = oldProps.value; + var changedBits = calculateChangedBits(context, newValue, oldValue); + + if (changedBits === 0) { + // No change. Bailout early if children are the same. + if (oldProps.children === newProps.children && !hasContextChanged()) { + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + } + } else { + // The context value changed. Search for matching consumers and schedule + // them to update. + propagateContextChange(workInProgress, context, changedBits, renderExpirationTime); + } + } + + var newChildren = newProps.children; + reconcileChildren(current, workInProgress, newChildren, renderExpirationTime); + return workInProgress.child; +} + +var hasWarnedAboutUsingContextAsConsumer = false; + +function updateContextConsumer(current, workInProgress, renderExpirationTime) { + var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In + // DEV mode, we create a separate object for Context.Consumer that acts + // like a proxy to Context. This proxy object adds unnecessary code in PROD + // so we use the old behaviour (Context.Consumer references Context) to + // reduce size and overhead. The separate object references context via + // a property called "_context", which also gives us the ability to check + // in DEV mode if this property exists or not and warn if it does not. + + { + if (context._context === undefined) { + // This may be because it's a Context (rather than a Consumer). + // Or it may be because it's older React where they're the same thing. + // We only want to warn if we're sure it's a new React. + if (context !== context.Consumer) { + if (!hasWarnedAboutUsingContextAsConsumer) { + hasWarnedAboutUsingContextAsConsumer = true; + + error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?'); + } + } + } else { + context = context._context; + } + } + + var newProps = workInProgress.pendingProps; + var render = newProps.children; + + { + if (typeof render !== 'function') { + error('A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.'); + } + } + + prepareToReadContext(workInProgress, renderExpirationTime); + var newValue = readContext(context, newProps.unstable_observedBits); + var newChildren; + + { + ReactCurrentOwner$1.current = workInProgress; + setIsRendering(true); + newChildren = render(newValue); + setIsRendering(false); + } // React DevTools reads this flag. + + + workInProgress.effectTag |= PerformedWork; + reconcileChildren(current, workInProgress, newChildren, renderExpirationTime); + return workInProgress.child; +} + +function markWorkInProgressReceivedUpdate() { + didReceiveUpdate = true; +} + +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime) { + cancelWorkTimer(workInProgress); + + if (current !== null) { + // Reuse previous dependencies + workInProgress.dependencies = current.dependencies; + } + + { + // Don't update "base" render times for bailouts. + stopProfilerTimerIfRunning(); + } + + var updateExpirationTime = workInProgress.expirationTime; + + if (updateExpirationTime !== NoWork) { + markUnprocessedUpdateTime(updateExpirationTime); + } // Check if the children have any pending work. + + + var childExpirationTime = workInProgress.childExpirationTime; + + if (childExpirationTime < renderExpirationTime) { + // The children don't have any work either. We can skip them. + // TODO: Once we add back resuming, we should check if the children are + // a work-in-progress set. If so, we need to transfer their effects. + return null; + } else { + // This fiber doesn't have work, but its subtree does. Clone the child + // fibers and continue. + cloneChildFibers(current, workInProgress); + return workInProgress.child; + } +} + +function remountFiber(current, oldWorkInProgress, newWorkInProgress) { + { + var returnFiber = oldWorkInProgress.return; + + if (returnFiber === null) { + throw new Error('Cannot swap the root fiber.'); + } // Disconnect from the old current. + // It will get deleted. + + + current.alternate = null; + oldWorkInProgress.alternate = null; // Connect to the new tree. + + newWorkInProgress.index = oldWorkInProgress.index; + newWorkInProgress.sibling = oldWorkInProgress.sibling; + newWorkInProgress.return = oldWorkInProgress.return; + newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it. + + if (oldWorkInProgress === returnFiber.child) { + returnFiber.child = newWorkInProgress; + } else { + var prevSibling = returnFiber.child; + + if (prevSibling === null) { + throw new Error('Expected parent to have a child.'); + } + + while (prevSibling.sibling !== oldWorkInProgress) { + prevSibling = prevSibling.sibling; + + if (prevSibling === null) { + throw new Error('Expected to find the previous sibling.'); + } + } + + prevSibling.sibling = newWorkInProgress; + } // Delete the old fiber and place the new one. + // Since the old fiber is disconnected, we have to schedule it manually. + + + var last = returnFiber.lastEffect; + + if (last !== null) { + last.nextEffect = current; + returnFiber.lastEffect = current; + } else { + returnFiber.firstEffect = returnFiber.lastEffect = current; + } + + current.nextEffect = null; + current.effectTag = Deletion; + newWorkInProgress.effectTag |= Placement; // Restart work from the new fiber. + + return newWorkInProgress; + } +} + +function beginWork(current, workInProgress, renderExpirationTime) { + var updateExpirationTime = workInProgress.expirationTime; + + { + if (workInProgress._debugNeedsRemount && current !== null) { + // This will restart the begin phase with a new fiber. + return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime)); + } + } + + if (current !== null) { + var oldProps = current.memoizedProps; + var newProps = workInProgress.pendingProps; + + if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload: + workInProgress.type !== current.type )) { + // If props or context changed, mark the fiber as having performed work. + // This may be unset if the props are determined to be equal later (memo). + didReceiveUpdate = true; + } else if (updateExpirationTime < renderExpirationTime) { + didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering + // the begin phase. There's still some bookkeeping we that needs to be done + // in this optimized path, mostly pushing stuff onto the stack. + + switch (workInProgress.tag) { + case HostRoot: + pushHostRootContext(workInProgress); + resetHydrationState(); + break; + + case HostComponent: + pushHostContext(workInProgress); + + if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) { + { + markSpawnedWork(Never); + } // Schedule this fiber to re-render at offscreen priority. Then bailout. + + + workInProgress.expirationTime = workInProgress.childExpirationTime = Never; + return null; + } + + break; + + case ClassComponent: + { + var Component = workInProgress.type; + + if (isContextProvider(Component)) { + pushContextProvider(workInProgress); + } + + break; + } + + case HostPortal: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + + case ContextProvider: + { + var newValue = workInProgress.memoizedProps.value; + pushProvider(workInProgress, newValue); + break; + } + + case Profiler: + { + // Profiler should only call onRender when one of its descendants actually rendered. + var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime; + + if (hasChildWork) { + workInProgress.effectTag |= Update; + } + } + + break; + + case SuspenseComponent: + { + var state = workInProgress.memoizedState; + + if (state !== null) { + // whether to retry the primary children, or to skip over it and + // go straight to the fallback. Check the priority of the primary + // child fragment. + + + var primaryChildFragment = workInProgress.child; + var primaryChildExpirationTime = primaryChildFragment.childExpirationTime; + + if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) { + // The primary children have pending work. Use the normal path + // to attempt to render the primary children again. + return updateSuspenseComponent(current, workInProgress, renderExpirationTime); + } else { + pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient + // priority. Bailout. + + var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + + if (child !== null) { + // The fallback children have pending work. Skip over the + // primary children and work on the fallback. + return child.sibling; + } else { + return null; + } + } + } else { + pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); + } + + break; + } + + case SuspenseListComponent: + { + var didSuspendBefore = (current.effectTag & DidCapture) !== NoEffect; + + var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime; + + if (didSuspendBefore) { + if (_hasChildWork) { + // If something was in fallback state last time, and we have all the + // same children then we're still in progressive loading state. + // Something might get unblocked by state updates or retries in the + // tree which will affect the tail. So we need to use the normal + // path to compute the correct tail. + return updateSuspenseListComponent(current, workInProgress, renderExpirationTime); + } // If none of the children had any work, that means that none of + // them got retried so they'll still be blocked in the same way + // as before. We can fast bail out. + + + workInProgress.effectTag |= DidCapture; + } // If nothing suspended before and we're rendering the same children, + // then the tail doesn't matter. Anything new that suspends will work + // in the "together" mode, so we can continue from the state we had. + + + var renderState = workInProgress.memoizedState; + + if (renderState !== null) { + // Reset to the "together" mode in case we've started a different + // update in the past but didn't complete it. + renderState.rendering = null; + renderState.tail = null; + } + + pushSuspenseContext(workInProgress, suspenseStackCursor.current); + + if (_hasChildWork) { + break; + } else { + // If none of the children had any work, that means that none of + // them got retried so they'll still be blocked in the same way + // as before. We can fast bail out. + return null; + } + } + } + + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderExpirationTime); + } else { + // An update was scheduled on this fiber, but there are no new props + // nor legacy context. Set this to false. If an update queue or context + // consumer produces a changed value, it will set this to true. Otherwise, + // the component will assume the children have not changed and bail out. + didReceiveUpdate = false; + } + } else { + didReceiveUpdate = false; + } // Before entering the begin phase, clear pending update priority. + // TODO: This assumes that we're about to evaluate the component and process + // the update queue. However, there's an exception: SimpleMemoComponent + // sometimes bails out later in the begin phase. This indicates that we should + // move this assignment out of the common path and into each branch. + + + workInProgress.expirationTime = NoWork; + + switch (workInProgress.tag) { + case IndeterminateComponent: + { + return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderExpirationTime); + } + + case LazyComponent: + { + var elementType = workInProgress.elementType; + return mountLazyComponent(current, workInProgress, elementType, updateExpirationTime, renderExpirationTime); + } + + case FunctionComponent: + { + var _Component = workInProgress.type; + var unresolvedProps = workInProgress.pendingProps; + var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps); + return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderExpirationTime); + } + + case ClassComponent: + { + var _Component2 = workInProgress.type; + var _unresolvedProps = workInProgress.pendingProps; + + var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps); + + return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderExpirationTime); + } + + case HostRoot: + return updateHostRoot(current, workInProgress, renderExpirationTime); + + case HostComponent: + return updateHostComponent(current, workInProgress, renderExpirationTime); + + case HostText: + return updateHostText(current, workInProgress); + + case SuspenseComponent: + return updateSuspenseComponent(current, workInProgress, renderExpirationTime); + + case HostPortal: + return updatePortalComponent(current, workInProgress, renderExpirationTime); + + case ForwardRef: + { + var type = workInProgress.type; + var _unresolvedProps2 = workInProgress.pendingProps; + + var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); + + return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderExpirationTime); + } + + case Fragment: + return updateFragment(current, workInProgress, renderExpirationTime); + + case Mode: + return updateMode(current, workInProgress, renderExpirationTime); + + case Profiler: + return updateProfiler(current, workInProgress, renderExpirationTime); + + case ContextProvider: + return updateContextProvider(current, workInProgress, renderExpirationTime); + + case ContextConsumer: + return updateContextConsumer(current, workInProgress, renderExpirationTime); + + case MemoComponent: + { + var _type2 = workInProgress.type; + var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props. + + var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3); + + { + if (workInProgress.type !== workInProgress.elementType) { + var outerPropTypes = _type2.propTypes; + + if (outerPropTypes) { + checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only + 'prop', getComponentName(_type2), getCurrentFiberStackInDev); + } + } + } + + _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3); + return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime); + } + + case SimpleMemoComponent: + { + return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime); + } + + case IncompleteClassComponent: + { + var _Component3 = workInProgress.type; + var _unresolvedProps4 = workInProgress.pendingProps; + + var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4); + + return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderExpirationTime); + } + + case SuspenseListComponent: + { + return updateSuspenseListComponent(current, workInProgress, renderExpirationTime); + } + } + + { + { + throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." ); + } + } +} + +function markUpdate(workInProgress) { + // Tag the fiber with an update effect. This turns a Placement into + // a PlacementAndUpdate. + workInProgress.effectTag |= Update; +} + +function markRef$1(workInProgress) { + workInProgress.effectTag |= Ref; +} + +var appendAllChildren; +var updateHostContainer; +var updateHostComponent$1; +var updateHostText$1; + +{ + // Mutation mode + appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) { + // We only have the top Fiber that was created but we need recurse down its + // children to find all the terminal nodes. + var node = workInProgress.child; + + while (node !== null) { + if (node.tag === HostComponent || node.tag === HostText) { + appendInitialChild(parent, node.stateNode); + } else if (node.tag === HostPortal) ; else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === workInProgress) { + return; + } + + while (node.sibling === null) { + if (node.return === null || node.return === workInProgress) { + return; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + }; + + updateHostContainer = function (workInProgress) {// Noop + }; + + updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) { + // If we have an alternate, that means this is an update and we need to + // schedule a side-effect to do the updates. + var oldProps = current.memoizedProps; + + if (oldProps === newProps) { + // In mutation mode, this is sufficient for a bailout because + // we won't touch this node even if children changed. + return; + } // If we get updated because one of our children updated, we don't + // have newProps so we'll have to reuse them. + // TODO: Split the update API as separate for the props vs. children. + // Even better would be if children weren't special cased at all tho. + + + var instance = workInProgress.stateNode; + var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host + // component is hitting the resume path. Figure out why. Possibly + // related to `hidden`. + + var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component. + + workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there + // is a new ref we mark this as an update. All the work is done in commitWork. + + if (updatePayload) { + markUpdate(workInProgress); + } + }; + + updateHostText$1 = function (current, workInProgress, oldText, newText) { + // If the text differs, mark it as an update. All the work in done in commitWork. + if (oldText !== newText) { + markUpdate(workInProgress); + } + }; +} + +function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case 'hidden': + { + // Any insertions at the end of the tail list after this point + // should be invisible. If there are already mounted boundaries + // anything before them are not considered for collapsing. + // Therefore we need to go through the whole tail to find if + // there are any. + var tailNode = renderState.tail; + var lastTailNode = null; + + while (tailNode !== null) { + if (tailNode.alternate !== null) { + lastTailNode = tailNode; + } + + tailNode = tailNode.sibling; + } // Next we're simply going to delete all insertions after the + // last rendered item. + + + if (lastTailNode === null) { + // All remaining items in the tail are insertions. + renderState.tail = null; + } else { + // Detach the insertion after the last node that was already + // inserted. + lastTailNode.sibling = null; + } + + break; + } + + case 'collapsed': + { + // Any insertions at the end of the tail list after this point + // should be invisible. If there are already mounted boundaries + // anything before them are not considered for collapsing. + // Therefore we need to go through the whole tail to find if + // there are any. + var _tailNode = renderState.tail; + var _lastTailNode = null; + + while (_tailNode !== null) { + if (_tailNode.alternate !== null) { + _lastTailNode = _tailNode; + } + + _tailNode = _tailNode.sibling; + } // Next we're simply going to delete all insertions after the + // last rendered item. + + + if (_lastTailNode === null) { + // All remaining items in the tail are insertions. + if (!hasRenderedATailFallback && renderState.tail !== null) { + // We suspended during the head. We want to show at least one + // row at the tail. So we'll keep on and cut off the rest. + renderState.tail.sibling = null; + } else { + renderState.tail = null; + } + } else { + // Detach the insertion after the last node that was already + // inserted. + _lastTailNode.sibling = null; + } + + break; + } + } +} + +function completeWork(current, workInProgress, renderExpirationTime) { + var newProps = workInProgress.pendingProps; + + switch (workInProgress.tag) { + case IndeterminateComponent: + case LazyComponent: + case SimpleMemoComponent: + case FunctionComponent: + case ForwardRef: + case Fragment: + case Mode: + case Profiler: + case ContextConsumer: + case MemoComponent: + return null; + + case ClassComponent: + { + var Component = workInProgress.type; + + if (isContextProvider(Component)) { + popContext(workInProgress); + } + + return null; + } + + case HostRoot: + { + popHostContainer(workInProgress); + popTopLevelContextObject(workInProgress); + var fiberRoot = workInProgress.stateNode; + + if (fiberRoot.pendingContext) { + fiberRoot.context = fiberRoot.pendingContext; + fiberRoot.pendingContext = null; + } + + if (current === null || current.child === null) { + // If we hydrated, pop so that we can delete any remaining children + // that weren't hydrated. + var wasHydrated = popHydrationState(workInProgress); + + if (wasHydrated) { + // If we hydrated, then we'll need to schedule an update for + // the commit side-effects on the root. + markUpdate(workInProgress); + } + } + + updateHostContainer(workInProgress); + return null; + } + + case HostComponent: + { + popHostContext(workInProgress); + var rootContainerInstance = getRootHostContainer(); + var type = workInProgress.type; + + if (current !== null && workInProgress.stateNode != null) { + updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance); + + if (current.ref !== workInProgress.ref) { + markRef$1(workInProgress); + } + } else { + if (!newProps) { + if (!(workInProgress.stateNode !== null)) { + { + throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." ); + } + } // This can happen when we abort work. + + + return null; + } + + var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context + // "stack" as the parent. Then append children as we go in beginWork + // or completeWork depending on whether we want to add them top->down or + // bottom->up. Top->down is faster in IE11. + + var _wasHydrated = popHydrationState(workInProgress); + + if (_wasHydrated) { + // TODO: Move this and createInstance step into the beginPhase + // to consolidate. + if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) { + // If changes to the hydrated node need to be applied at the + // commit-phase we mark this as such. + markUpdate(workInProgress); + } + } else { + var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress); + appendAllChildren(instance, workInProgress, false, false); // This needs to be set before we mount Flare event listeners + + workInProgress.stateNode = instance; + // (eg DOM renderer supports auto-focus for certain elements). + // Make sure such renderers get scheduled for later work. + + + if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) { + markUpdate(workInProgress); + } + } + + if (workInProgress.ref !== null) { + // If there is a ref on a host node we need to schedule a callback + markRef$1(workInProgress); + } + } + + return null; + } + + case HostText: + { + var newText = newProps; + + if (current && workInProgress.stateNode != null) { + var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need + // to schedule a side-effect to do the updates. + + updateHostText$1(current, workInProgress, oldText, newText); + } else { + if (typeof newText !== 'string') { + if (!(workInProgress.stateNode !== null)) { + { + throw Error( "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue." ); + } + } // This can happen when we abort work. + + } + + var _rootContainerInstance = getRootHostContainer(); + + var _currentHostContext = getHostContext(); + + var _wasHydrated2 = popHydrationState(workInProgress); + + if (_wasHydrated2) { + if (prepareToHydrateHostTextInstance(workInProgress)) { + markUpdate(workInProgress); + } + } else { + workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress); + } + } + + return null; + } + + case SuspenseComponent: + { + popSuspenseContext(workInProgress); + var nextState = workInProgress.memoizedState; + + if ((workInProgress.effectTag & DidCapture) !== NoEffect) { + // Something suspended. Re-render with the fallback children. + workInProgress.expirationTime = renderExpirationTime; // Do not reset the effect list. + + return workInProgress; + } + + var nextDidTimeout = nextState !== null; + var prevDidTimeout = false; + + if (current === null) { + if (workInProgress.memoizedProps.fallback !== undefined) { + popHydrationState(workInProgress); + } + } else { + var prevState = current.memoizedState; + prevDidTimeout = prevState !== null; + + if (!nextDidTimeout && prevState !== null) { + // We just switched from the fallback to the normal children. + // Delete the fallback. + // TODO: Would it be better to store the fallback fragment on + // the stateNode during the begin phase? + var currentFallbackChild = current.child.sibling; + + if (currentFallbackChild !== null) { + // Deletions go at the beginning of the return fiber's effect list + var first = workInProgress.firstEffect; + + if (first !== null) { + workInProgress.firstEffect = currentFallbackChild; + currentFallbackChild.nextEffect = first; + } else { + workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild; + currentFallbackChild.nextEffect = null; + } + + currentFallbackChild.effectTag = Deletion; + } + } + } + + if (nextDidTimeout && !prevDidTimeout) { + // If this subtreee is running in blocking mode we can suspend, + // otherwise we won't suspend. + // TODO: This will still suspend a synchronous tree if anything + // in the concurrent tree already suspended during this render. + // This is a known bug. + if ((workInProgress.mode & BlockingMode) !== NoMode) { + // TODO: Move this back to throwException because this is too late + // if this is a large tree which is common for initial loads. We + // don't know if we should restart a render or not until we get + // this marker, and this is too late. + // If this render already had a ping or lower pri updates, + // and this is the first time we know we're going to suspend we + // should be able to immediately restart from within throwException. + var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true; + + if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) { + // If this was in an invisible tree or a new render, then showing + // this boundary is ok. + renderDidSuspend(); + } else { + // Otherwise, we're going to have to hide content so we should + // suspend for longer if possible. + renderDidSuspendDelayIfPossible(); + } + } + } + + { + // TODO: Only schedule updates if these values are non equal, i.e. it changed. + if (nextDidTimeout || prevDidTimeout) { + // If this boundary just timed out, schedule an effect to attach a + // retry listener to the promise. This flag is also used to hide the + // primary children. In mutation mode, we also need the flag to + // *unhide* children that were previously hidden, so check if this + // is currently timed out, too. + workInProgress.effectTag |= Update; + } + } + + return null; + } + + case HostPortal: + popHostContainer(workInProgress); + updateHostContainer(workInProgress); + return null; + + case ContextProvider: + // Pop provider fiber + popProvider(workInProgress); + return null; + + case IncompleteClassComponent: + { + // Same as class component case. I put it down here so that the tags are + // sequential to ensure this switch is compiled to a jump table. + var _Component = workInProgress.type; + + if (isContextProvider(_Component)) { + popContext(workInProgress); + } + + return null; + } + + case SuspenseListComponent: + { + popSuspenseContext(workInProgress); + var renderState = workInProgress.memoizedState; + + if (renderState === null) { + // We're running in the default, "independent" mode. + // We don't do anything in this mode. + return null; + } + + var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect; + var renderedTail = renderState.rendering; + + if (renderedTail === null) { + // We just rendered the head. + if (!didSuspendAlready) { + // This is the first pass. We need to figure out if anything is still + // suspended in the rendered set. + // If new content unsuspended, but there's still some content that + // didn't. Then we need to do a second pass that forces everything + // to keep showing their fallbacks. + // We might be suspended if something in this render pass suspended, or + // something in the previous committed pass suspended. Otherwise, + // there's no chance so we can skip the expensive call to + // findFirstSuspended. + var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect); + + if (!cannotBeSuspended) { + var row = workInProgress.child; + + while (row !== null) { + var suspended = findFirstSuspended(row); + + if (suspended !== null) { + didSuspendAlready = true; + workInProgress.effectTag |= DidCapture; + cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as + // part of the second pass. In that case nothing will subscribe to + // its thennables. Instead, we'll transfer its thennables to the + // SuspenseList so that it can retry if they resolve. + // There might be multiple of these in the list but since we're + // going to wait for all of them anyway, it doesn't really matter + // which ones gets to ping. In theory we could get clever and keep + // track of how many dependencies remain but it gets tricky because + // in the meantime, we can add/remove/change items and dependencies. + // We might bail out of the loop before finding any but that + // doesn't matter since that means that the other boundaries that + // we did find already has their listeners attached. + + var newThennables = suspended.updateQueue; + + if (newThennables !== null) { + workInProgress.updateQueue = newThennables; + workInProgress.effectTag |= Update; + } // Rerender the whole list, but this time, we'll force fallbacks + // to stay in place. + // Reset the effect list before doing the second pass since that's now invalid. + + + if (renderState.lastEffect === null) { + workInProgress.firstEffect = null; + } + + workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state. + + resetChildFibers(workInProgress, renderExpirationTime); // Set up the Suspense Context to force suspense and immediately + // rerender the children. + + pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback)); + return workInProgress.child; + } + + row = row.sibling; + } + } + } else { + cutOffTailIfNeeded(renderState, false); + } // Next we're going to render the tail. + + } else { + // Append the rendered row to the child list. + if (!didSuspendAlready) { + var _suspended = findFirstSuspended(renderedTail); + + if (_suspended !== null) { + workInProgress.effectTag |= DidCapture; + didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't + // get lost if this row ends up dropped during a second pass. + + var _newThennables = _suspended.updateQueue; + + if (_newThennables !== null) { + workInProgress.updateQueue = _newThennables; + workInProgress.effectTag |= Update; + } + + cutOffTailIfNeeded(renderState, true); // This might have been modified. + + if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) { + // We need to delete the row we just rendered. + // Reset the effect list to what it was before we rendered this + // child. The nested children have already appended themselves. + var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point. + + if (lastEffect !== null) { + lastEffect.nextEffect = null; + } // We're done. + + + return null; + } + } else if ( // The time it took to render last row is greater than time until + // the expiration. + now() * 2 - renderState.renderingStartTime > renderState.tailExpiration && renderExpirationTime > Never) { + // We have now passed our CPU deadline and we'll just give up further + // attempts to render the main content and only render fallbacks. + // The assumption is that this is usually faster. + workInProgress.effectTag |= DidCapture; + didSuspendAlready = true; + cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this + // to get it started back up to attempt the next item. If we can show + // them, then they really have the same priority as this render. + // So we'll pick it back up the very next render pass once we've had + // an opportunity to yield for paint. + + var nextPriority = renderExpirationTime - 1; + workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority; + + { + markSpawnedWork(nextPriority); + } + } + } + + if (renderState.isBackwards) { + // The effect list of the backwards tail will have been added + // to the end. This breaks the guarantee that life-cycles fire in + // sibling order but that isn't a strong guarantee promised by React. + // Especially since these might also just pop in during future commits. + // Append to the beginning of the list. + renderedTail.sibling = workInProgress.child; + workInProgress.child = renderedTail; + } else { + var previousSibling = renderState.last; + + if (previousSibling !== null) { + previousSibling.sibling = renderedTail; + } else { + workInProgress.child = renderedTail; + } + + renderState.last = renderedTail; + } + } + + if (renderState.tail !== null) { + // We still have tail rows to render. + if (renderState.tailExpiration === 0) { + // Heuristic for how long we're willing to spend rendering rows + // until we just give up and show what we have so far. + var TAIL_EXPIRATION_TIMEOUT_MS = 500; + renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS; // TODO: This is meant to mimic the train model or JND but this + // is a per component value. It should really be since the start + // of the total render or last commit. Consider using something like + // globalMostRecentFallbackTime. That doesn't account for being + // suspended for part of the time or when it's a new render. + // It should probably use a global start time value instead. + } // Pop a row. + + + var next = renderState.tail; + renderState.rendering = next; + renderState.tail = next.sibling; + renderState.lastEffect = workInProgress.lastEffect; + renderState.renderingStartTime = now(); + next.sibling = null; // Restore the context. + // TODO: We can probably just avoid popping it instead and only + // setting it the first time we go from not suspended to suspended. + + var suspenseContext = suspenseStackCursor.current; + + if (didSuspendAlready) { + suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); + } else { + suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); + } + + pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row. + + return next; + } + + return null; + } + } + + { + { + throw Error( "Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue." ); + } + } +} + +function unwindWork(workInProgress, renderExpirationTime) { + switch (workInProgress.tag) { + case ClassComponent: + { + var Component = workInProgress.type; + + if (isContextProvider(Component)) { + popContext(workInProgress); + } + + var effectTag = workInProgress.effectTag; + + if (effectTag & ShouldCapture) { + workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture; + return workInProgress; + } + + return null; + } + + case HostRoot: + { + popHostContainer(workInProgress); + popTopLevelContextObject(workInProgress); + var _effectTag = workInProgress.effectTag; + + if (!((_effectTag & DidCapture) === NoEffect)) { + { + throw Error( "The root failed to unmount after an error. This is likely a bug in React. Please file an issue." ); + } + } + + workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture; + return workInProgress; + } + + case HostComponent: + { + // TODO: popHydrationState + popHostContext(workInProgress); + return null; + } + + case SuspenseComponent: + { + popSuspenseContext(workInProgress); + + var _effectTag2 = workInProgress.effectTag; + + if (_effectTag2 & ShouldCapture) { + workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary. + + return workInProgress; + } + + return null; + } + + case SuspenseListComponent: + { + popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been + // caught by a nested boundary. If not, it should bubble through. + + return null; + } + + case HostPortal: + popHostContainer(workInProgress); + return null; + + case ContextProvider: + popProvider(workInProgress); + return null; + + default: + return null; + } +} + +function unwindInterruptedWork(interruptedWork) { + switch (interruptedWork.tag) { + case ClassComponent: + { + var childContextTypes = interruptedWork.type.childContextTypes; + + if (childContextTypes !== null && childContextTypes !== undefined) { + popContext(interruptedWork); + } + + break; + } + + case HostRoot: + { + popHostContainer(interruptedWork); + popTopLevelContextObject(interruptedWork); + break; + } + + case HostComponent: + { + popHostContext(interruptedWork); + break; + } + + case HostPortal: + popHostContainer(interruptedWork); + break; + + case SuspenseComponent: + popSuspenseContext(interruptedWork); + break; + + case SuspenseListComponent: + popSuspenseContext(interruptedWork); + break; + + case ContextProvider: + popProvider(interruptedWork); + break; + } +} + +function createCapturedValue(value, source) { + // If the value is an error, call this function immediately after it is thrown + // so the stack is accurate. + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; +} + +function logCapturedError(capturedError) { + + var error = capturedError.error; + + { + var componentName = capturedError.componentName, + componentStack = capturedError.componentStack, + errorBoundaryName = capturedError.errorBoundaryName, + errorBoundaryFound = capturedError.errorBoundaryFound, + willRetry = capturedError.willRetry; // Browsers support silencing uncaught errors by calling + // `preventDefault()` in window `error` handler. + // We record this information as an expando on the error. + + if (error != null && error._suppressLogging) { + if (errorBoundaryFound && willRetry) { + // The error is recoverable and was silenced. + // Ignore it and don't print the stack addendum. + // This is handy for testing error boundaries without noise. + return; + } // The error is fatal. Since the silencing might have + // been accidental, we'll surface it anyway. + // However, the browser would have silenced the original error + // so we'll print it first, and then print the stack addendum. + + + console['error'](error); // Don't transform to our wrapper + // For a more detailed description of this block, see: + // https://github.com/facebook/react/pull/13384 + } + + var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:'; + var errorBoundaryMessage; // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow. + + if (errorBoundaryFound && errorBoundaryName) { + if (willRetry) { + errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + "."); + } else { + errorBoundaryMessage = "This error was initially handled by the error boundary " + errorBoundaryName + ".\n" + "Recreating the tree from scratch failed so React will unmount the tree."; + } + } else { + errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.'; + } + + var combinedMessage = "" + componentNameMessage + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. + // We don't include the original error message and JS stack because the browser + // has already printed it. Even if the application swallows the error, it is still + // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. + + console['error'](combinedMessage); // Don't transform to our wrapper + } +} + +var didWarnAboutUndefinedSnapshotBeforeUpdate = null; + +{ + didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); +} + +var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set; +function logError(boundary, errorInfo) { + var source = errorInfo.source; + var stack = errorInfo.stack; + + if (stack === null && source !== null) { + stack = getStackByFiberInDevAndProd(source); + } + + var capturedError = { + componentName: source !== null ? getComponentName(source.type) : null, + componentStack: stack !== null ? stack : '', + error: errorInfo.value, + errorBoundary: null, + errorBoundaryName: null, + errorBoundaryFound: false, + willRetry: false + }; + + if (boundary !== null && boundary.tag === ClassComponent) { + capturedError.errorBoundary = boundary.stateNode; + capturedError.errorBoundaryName = getComponentName(boundary.type); + capturedError.errorBoundaryFound = true; + capturedError.willRetry = true; + } + + try { + logCapturedError(capturedError); + } catch (e) { + // This method must not throw, or React internal state will get messed up. + // If console.error is overridden, or logCapturedError() shows a dialog that throws, + // we want to report this error outside of the normal stack as a last resort. + // https://github.com/facebook/react/issues/13188 + setTimeout(function () { + throw e; + }); + } +} + +var callComponentWillUnmountWithTimer = function (current, instance) { + startPhaseTimer(current, 'componentWillUnmount'); + instance.props = current.memoizedProps; + instance.state = current.memoizedState; + instance.componentWillUnmount(); + stopPhaseTimer(); +}; // Capture errors so they don't interrupt unmounting. + + +function safelyCallComponentWillUnmount(current, instance) { + { + invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance); + + if (hasCaughtError()) { + var unmountError = clearCaughtError(); + captureCommitPhaseError(current, unmountError); + } + } +} + +function safelyDetachRef(current) { + var ref = current.ref; + + if (ref !== null) { + if (typeof ref === 'function') { + { + invokeGuardedCallback(null, ref, null, null); + + if (hasCaughtError()) { + var refError = clearCaughtError(); + captureCommitPhaseError(current, refError); + } + } + } else { + ref.current = null; + } + } +} + +function safelyCallDestroy(current, destroy) { + { + invokeGuardedCallback(null, destroy, null); + + if (hasCaughtError()) { + var error = clearCaughtError(); + captureCommitPhaseError(current, error); + } + } +} + +function commitBeforeMutationLifeCycles(current, finishedWork) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + case Block: + { + return; + } + + case ClassComponent: + { + if (finishedWork.effectTag & Snapshot) { + if (current !== null) { + var prevProps = current.memoizedProps; + var prevState = current.memoizedState; + startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate'); + var instance = finishedWork.stateNode; // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance'); + } + + if (instance.state !== finishedWork.memoizedState) { + error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance'); + } + } + } + + var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState); + + { + var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate; + + if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) { + didWarnSet.add(finishedWork.type); + + error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type)); + } + } + + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + stopPhaseTimer(); + } + } + + return; + } + + case HostRoot: + case HostComponent: + case HostText: + case HostPortal: + case IncompleteClassComponent: + // Nothing to do for these component types + return; + } + + { + { + throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." ); + } + } +} + +function commitHookEffectListUnmount(tag, finishedWork) { + var updateQueue = finishedWork.updateQueue; + var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; + + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + var effect = firstEffect; + + do { + if ((effect.tag & tag) === tag) { + // Unmount + var destroy = effect.destroy; + effect.destroy = undefined; + + if (destroy !== undefined) { + destroy(); + } + } + + effect = effect.next; + } while (effect !== firstEffect); + } +} + +function commitHookEffectListMount(tag, finishedWork) { + var updateQueue = finishedWork.updateQueue; + var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; + + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + var effect = firstEffect; + + do { + if ((effect.tag & tag) === tag) { + // Mount + var create = effect.create; + effect.destroy = create(); + + { + var destroy = effect.destroy; + + if (destroy !== undefined && typeof destroy !== 'function') { + var addendum = void 0; + + if (destroy === null) { + addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).'; + } else if (typeof destroy.then === 'function') { + addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching'; + } else { + addendum = ' You returned: ' + destroy; + } + + error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork)); + } + } + } + + effect = effect.next; + } while (effect !== firstEffect); + } +} + +function commitPassiveHookEffects(finishedWork) { + if ((finishedWork.effectTag & Passive) !== NoEffect) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + case Block: + { + // TODO (#17945) We should call all passive destroy functions (for all fibers) + // before calling any create functions. The current approach only serializes + // these for a single fiber. + commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork); + commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); + break; + } + } + } +} + +function commitLifeCycles(finishedRoot, current, finishedWork, committedExpirationTime) { + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + case Block: + { + // At this point layout effects have already been destroyed (during mutation phase). + // This is done to prevent sibling component effects from interfering with each other, + // e.g. a destroy function in one component should never override a ref set + // by a create function in another component during the same commit. + commitHookEffectListMount(Layout | HasEffect, finishedWork); + + return; + } + + case ClassComponent: + { + var instance = finishedWork.stateNode; + + if (finishedWork.effectTag & Update) { + if (current === null) { + startPhaseTimer(finishedWork, 'componentDidMount'); // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance'); + } + + if (instance.state !== finishedWork.memoizedState) { + error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance'); + } + } + } + + instance.componentDidMount(); + stopPhaseTimer(); + } else { + var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps); + var prevState = current.memoizedState; + startPhaseTimer(finishedWork, 'componentDidUpdate'); // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance'); + } + + if (instance.state !== finishedWork.memoizedState) { + error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance'); + } + } + } + + instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); + stopPhaseTimer(); + } + } + + var updateQueue = finishedWork.updateQueue; + + if (updateQueue !== null) { + { + if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { + if (instance.props !== finishedWork.memoizedProps) { + error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance'); + } + + if (instance.state !== finishedWork.memoizedState) { + error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance'); + } + } + } // We could update instance props and state here, + // but instead we rely on them being set during last render. + // TODO: revisit this when we implement resuming. + + + commitUpdateQueue(finishedWork, updateQueue, instance); + } + + return; + } + + case HostRoot: + { + var _updateQueue = finishedWork.updateQueue; + + if (_updateQueue !== null) { + var _instance = null; + + if (finishedWork.child !== null) { + switch (finishedWork.child.tag) { + case HostComponent: + _instance = getPublicInstance(finishedWork.child.stateNode); + break; + + case ClassComponent: + _instance = finishedWork.child.stateNode; + break; + } + } + + commitUpdateQueue(finishedWork, _updateQueue, _instance); + } + + return; + } + + case HostComponent: + { + var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted + // (eg DOM renderer may schedule auto-focus for inputs and form controls). + // These effects should only be committed when components are first mounted, + // aka when there is no current/alternate. + + if (current === null && finishedWork.effectTag & Update) { + var type = finishedWork.type; + var props = finishedWork.memoizedProps; + commitMount(_instance2, type, props); + } + + return; + } + + case HostText: + { + // We have no life-cycles associated with text. + return; + } + + case HostPortal: + { + // We have no life-cycles associated with portals. + return; + } + + case Profiler: + { + { + var onRender = finishedWork.memoizedProps.onRender; + + if (typeof onRender === 'function') { + { + onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions); + } + } + } + + return; + } + + case SuspenseComponent: + { + commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); + return; + } + + case SuspenseListComponent: + case IncompleteClassComponent: + case FundamentalComponent: + case ScopeComponent: + return; + } + + { + { + throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." ); + } + } +} + +function hideOrUnhideAllChildren(finishedWork, isHidden) { + { + // We only have the top Fiber that was inserted but we need to recurse down its + // children to find all the terminal nodes. + var node = finishedWork; + + while (true) { + if (node.tag === HostComponent) { + var instance = node.stateNode; + + if (isHidden) { + hideInstance(instance); + } else { + unhideInstance(node.stateNode, node.memoizedProps); + } + } else if (node.tag === HostText) { + var _instance3 = node.stateNode; + + if (isHidden) { + hideTextInstance(_instance3); + } else { + unhideTextInstance(_instance3, node.memoizedProps); + } + } else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) { + // Found a nested Suspense component that timed out. Skip over the + // primary child fragment, which should remain hidden. + var fallbackChildFragment = node.child.sibling; + fallbackChildFragment.return = node; + node = fallbackChildFragment; + continue; + } else if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === finishedWork) { + return; + } + + while (node.sibling === null) { + if (node.return === null || node.return === finishedWork) { + return; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + } +} + +function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + + if (ref !== null) { + var instance = finishedWork.stateNode; + var instanceToUse; + + switch (finishedWork.tag) { + case HostComponent: + instanceToUse = getPublicInstance(instance); + break; + + default: + instanceToUse = instance; + } // Moved outside to ensure DCE works with this flag + + if (typeof ref === 'function') { + ref(instanceToUse); + } else { + { + if (!ref.hasOwnProperty('current')) { + error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork)); + } + } + + ref.current = instanceToUse; + } + } +} + +function commitDetachRef(current) { + var currentRef = current.ref; + + if (currentRef !== null) { + if (typeof currentRef === 'function') { + currentRef(null); + } else { + currentRef.current = null; + } + } +} // User-originating errors (lifecycles and refs) should not interrupt +// deletion, so don't let them throw. Host-originating errors should +// interrupt deletion, so it's okay + + +function commitUnmount(finishedRoot, current, renderPriorityLevel) { + onCommitUnmount(current); + + switch (current.tag) { + case FunctionComponent: + case ForwardRef: + case MemoComponent: + case SimpleMemoComponent: + case Block: + { + var updateQueue = current.updateQueue; + + if (updateQueue !== null) { + var lastEffect = updateQueue.lastEffect; + + if (lastEffect !== null) { + var firstEffect = lastEffect.next; + + { + // When the owner fiber is deleted, the destroy function of a passive + // effect hook is called during the synchronous commit phase. This is + // a concession to implementation complexity. Calling it in the + // passive effect phase (like they usually are, when dependencies + // change during an update) would require either traversing the + // children of the deleted fiber again, or including unmount effects + // as part of the fiber effect list. + // + // Because this is during the sync commit phase, we need to change + // the priority. + // + // TODO: Reconsider this implementation trade off. + var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel; + runWithPriority$1(priorityLevel, function () { + var effect = firstEffect; + + do { + var _destroy = effect.destroy; + + if (_destroy !== undefined) { + safelyCallDestroy(current, _destroy); + } + + effect = effect.next; + } while (effect !== firstEffect); + }); + } + } + } + + return; + } + + case ClassComponent: + { + safelyDetachRef(current); + var instance = current.stateNode; + + if (typeof instance.componentWillUnmount === 'function') { + safelyCallComponentWillUnmount(current, instance); + } + + return; + } + + case HostComponent: + { + + safelyDetachRef(current); + return; + } + + case HostPortal: + { + // TODO: this is recursive. + // We are also not using this parent because + // the portal will get pushed immediately. + { + unmountHostComponents(finishedRoot, current, renderPriorityLevel); + } + + return; + } + + case FundamentalComponent: + { + + return; + } + + case DehydratedFragment: + { + + return; + } + + case ScopeComponent: + { + + return; + } + } +} + +function commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) { + // While we're inside a removed host node we don't want to call + // removeChild on the inner nodes because they're removed by the top + // call anyway. We also want to call componentWillUnmount on all + // composites before this host node is removed from the tree. Therefore + // we do an inner loop while we're still inside the host node. + var node = root; + + while (true) { + commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because they may contain more composite or host nodes. + // Skip portals because commitUnmount() currently visits them recursively. + + if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above. + // If we don't use mutation we drill down into portals here instead. + node.tag !== HostPortal)) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === root) { + return; + } + + while (node.sibling === null) { + if (node.return === null || node.return === root) { + return; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } +} + +function detachFiber(current) { + var alternate = current.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we + // should clear the child pointer of the parent alternate to let this + // get GC:ed but we don't know which for sure which parent is the current + // one so we'll settle for GC:ing the subtree of this child. This child + // itself will be GC:ed when the parent updates the next time. + + current.return = null; + current.child = null; + current.memoizedState = null; + current.updateQueue = null; + current.dependencies = null; + current.alternate = null; + current.firstEffect = null; + current.lastEffect = null; + current.pendingProps = null; + current.memoizedProps = null; + current.stateNode = null; + + if (alternate !== null) { + detachFiber(alternate); + } +} + +function getHostParentFiber(fiber) { + var parent = fiber.return; + + while (parent !== null) { + if (isHostParent(parent)) { + return parent; + } + + parent = parent.return; + } + + { + { + throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." ); + } + } +} + +function isHostParent(fiber) { + return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal; +} + +function getHostSibling(fiber) { + // We're going to search forward into the tree until we find a sibling host + // node. Unfortunately, if multiple insertions are done in a row we have to + // search past them. This leads to exponential search for the next sibling. + // TODO: Find a more efficient way to do this. + var node = fiber; + + siblings: while (true) { + // If we didn't find anything, let's try the next sibling. + while (node.sibling === null) { + if (node.return === null || isHostParent(node.return)) { + // If we pop out of the root or hit the parent the fiber we are the + // last sibling. + return null; + } + + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + + while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) { + // If it is not host node and, we might have a host node inside it. + // Try to search down until we find one. + if (node.effectTag & Placement) { + // If we don't have a child, try the siblings instead. + continue siblings; + } // If we don't have a child, try the siblings instead. + // We also skip portals because they are not part of this host tree. + + + if (node.child === null || node.tag === HostPortal) { + continue siblings; + } else { + node.child.return = node; + node = node.child; + } + } // Check if this host node is stable or about to be placed. + + + if (!(node.effectTag & Placement)) { + // Found it! + return node.stateNode; + } + } +} + +function commitPlacement(finishedWork) { + + + var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together. + + var parent; + var isContainer; + var parentStateNode = parentFiber.stateNode; + + switch (parentFiber.tag) { + case HostComponent: + parent = parentStateNode; + isContainer = false; + break; + + case HostRoot: + parent = parentStateNode.containerInfo; + isContainer = true; + break; + + case HostPortal: + parent = parentStateNode.containerInfo; + isContainer = true; + break; + + case FundamentalComponent: + + // eslint-disable-next-line-no-fallthrough + + default: + { + { + throw Error( "Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + } + + if (parentFiber.effectTag & ContentReset) { + // Reset the text content of the parent before doing any insertions + resetTextContent(parent); // Clear ContentReset from the effect tag + + parentFiber.effectTag &= ~ContentReset; + } + + var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its + // children to find all the terminal nodes. + + if (isContainer) { + insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent); + } else { + insertOrAppendPlacementNode(finishedWork, before, parent); + } +} + +function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + var isHost = tag === HostComponent || tag === HostText; + + if (isHost || enableFundamentalAPI ) { + var stateNode = isHost ? node.stateNode : node.stateNode.instance; + + if (before) { + insertInContainerBefore(parent, stateNode, before); + } else { + appendChildToContainer(parent, stateNode); + } + } else if (tag === HostPortal) ; else { + var child = node.child; + + if (child !== null) { + insertOrAppendPlacementNodeIntoContainer(child, before, parent); + var sibling = child.sibling; + + while (sibling !== null) { + insertOrAppendPlacementNodeIntoContainer(sibling, before, parent); + sibling = sibling.sibling; + } + } + } +} + +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + var isHost = tag === HostComponent || tag === HostText; + + if (isHost || enableFundamentalAPI ) { + var stateNode = isHost ? node.stateNode : node.stateNode.instance; + + if (before) { + insertBefore(parent, stateNode, before); + } else { + appendChild(parent, stateNode); + } + } else if (tag === HostPortal) ; else { + var child = node.child; + + if (child !== null) { + insertOrAppendPlacementNode(child, before, parent); + var sibling = child.sibling; + + while (sibling !== null) { + insertOrAppendPlacementNode(sibling, before, parent); + sibling = sibling.sibling; + } + } + } +} + +function unmountHostComponents(finishedRoot, current, renderPriorityLevel) { + // We only have the top Fiber that was deleted but we need to recurse down its + // children to find all the terminal nodes. + var node = current; // Each iteration, currentParent is populated with node's host parent if not + // currentParentIsValid. + + var currentParentIsValid = false; // Note: these two variables *must* always be updated together. + + var currentParent; + var currentParentIsContainer; + + while (true) { + if (!currentParentIsValid) { + var parent = node.return; + + findParent: while (true) { + if (!(parent !== null)) { + { + throw Error( "Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + var parentStateNode = parent.stateNode; + + switch (parent.tag) { + case HostComponent: + currentParent = parentStateNode; + currentParentIsContainer = false; + break findParent; + + case HostRoot: + currentParent = parentStateNode.containerInfo; + currentParentIsContainer = true; + break findParent; + + case HostPortal: + currentParent = parentStateNode.containerInfo; + currentParentIsContainer = true; + break findParent; + + } + + parent = parent.return; + } + + currentParentIsValid = true; + } + + if (node.tag === HostComponent || node.tag === HostText) { + commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the + // node from the tree. + + if (currentParentIsContainer) { + removeChildFromContainer(currentParent, node.stateNode); + } else { + removeChild(currentParent, node.stateNode); + } // Don't visit children because we already visited them. + + } else if (node.tag === HostPortal) { + if (node.child !== null) { + // When we go into a portal, it becomes the parent to remove from. + // We will reassign it back when we pop the portal on the way up. + currentParent = node.stateNode.containerInfo; + currentParentIsContainer = true; // Visit children because portals might contain host components. + + node.child.return = node; + node = node.child; + continue; + } + } else { + commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because we may find more host components below. + + if (node.child !== null) { + node.child.return = node; + node = node.child; + continue; + } + } + + if (node === current) { + return; + } + + while (node.sibling === null) { + if (node.return === null || node.return === current) { + return; + } + + node = node.return; + + if (node.tag === HostPortal) { + // When we go out of the portal, we need to restore the parent. + // Since we don't keep a stack of them, we will search for it. + currentParentIsValid = false; + } + } + + node.sibling.return = node.return; + node = node.sibling; + } +} + +function commitDeletion(finishedRoot, current, renderPriorityLevel) { + { + // Recursively delete all host nodes from the parent. + // Detach refs and call componentWillUnmount() on the whole subtree. + unmountHostComponents(finishedRoot, current, renderPriorityLevel); + } + + detachFiber(current); +} + +function commitWork(current, finishedWork) { + + switch (finishedWork.tag) { + case FunctionComponent: + case ForwardRef: + case MemoComponent: + case SimpleMemoComponent: + case Block: + { + // Layout effects are destroyed during the mutation phase so that all + // destroy functions for all fibers are called before any create functions. + // This prevents sibling component effects from interfering with each other, + // e.g. a destroy function in one component should never override a ref set + // by a create function in another component during the same commit. + commitHookEffectListUnmount(Layout | HasEffect, finishedWork); + return; + } + + case ClassComponent: + { + return; + } + + case HostComponent: + { + var instance = finishedWork.stateNode; + + if (instance != null) { + // Commit the work prepared earlier. + var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps + // as the newProps. The updatePayload will contain the real change in + // this case. + + var oldProps = current !== null ? current.memoizedProps : newProps; + var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components. + + var updatePayload = finishedWork.updateQueue; + finishedWork.updateQueue = null; + + if (updatePayload !== null) { + commitUpdate(instance, updatePayload, type, oldProps, newProps); + } + } + + return; + } + + case HostText: + { + if (!(finishedWork.stateNode !== null)) { + { + throw Error( "This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue." ); + } + } + + var textInstance = finishedWork.stateNode; + var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps + // as the newProps. The updatePayload will contain the real change in + // this case. + + var oldText = current !== null ? current.memoizedProps : newText; + commitTextUpdate(textInstance, oldText, newText); + return; + } + + case HostRoot: + { + { + var _root = finishedWork.stateNode; + + if (_root.hydrate) { + // We've just hydrated. No need to hydrate again. + _root.hydrate = false; + commitHydratedContainer(_root.containerInfo); + } + } + + return; + } + + case Profiler: + { + return; + } + + case SuspenseComponent: + { + commitSuspenseComponent(finishedWork); + attachSuspenseRetryListeners(finishedWork); + return; + } + + case SuspenseListComponent: + { + attachSuspenseRetryListeners(finishedWork); + return; + } + + case IncompleteClassComponent: + { + return; + } + } + + { + { + throw Error( "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue." ); + } + } +} + +function commitSuspenseComponent(finishedWork) { + var newState = finishedWork.memoizedState; + var newDidTimeout; + var primaryChildParent = finishedWork; + + if (newState === null) { + newDidTimeout = false; + } else { + newDidTimeout = true; + primaryChildParent = finishedWork.child; + markCommitTimeOfFallback(); + } + + if ( primaryChildParent !== null) { + hideOrUnhideAllChildren(primaryChildParent, newDidTimeout); + } +} + +function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { + + var newState = finishedWork.memoizedState; + + if (newState === null) { + var current = finishedWork.alternate; + + if (current !== null) { + var prevState = current.memoizedState; + + if (prevState !== null) { + var suspenseInstance = prevState.dehydrated; + + if (suspenseInstance !== null) { + commitHydratedSuspenseInstance(suspenseInstance); + } + } + } + } +} + +function attachSuspenseRetryListeners(finishedWork) { + // If this boundary just timed out, then it will have a set of thenables. + // For each thenable, attach a listener so that when it resolves, React + // attempts to re-render the boundary in the primary (pre-timeout) state. + var thenables = finishedWork.updateQueue; + + if (thenables !== null) { + finishedWork.updateQueue = null; + var retryCache = finishedWork.stateNode; + + if (retryCache === null) { + retryCache = finishedWork.stateNode = new PossiblyWeakSet(); + } + + thenables.forEach(function (thenable) { + // Memoize using the boundary fiber to prevent redundant listeners. + var retry = resolveRetryThenable.bind(null, finishedWork, thenable); + + if (!retryCache.has(thenable)) { + { + if (thenable.__reactDoNotTraceInteractions !== true) { + retry = tracing.unstable_wrap(retry); + } + } + + retryCache.add(thenable); + thenable.then(retry, retry); + } + }); + } +} + +function commitResetTextContent(current) { + + resetTextContent(current.stateNode); +} + +var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map; + +function createRootErrorUpdate(fiber, errorInfo, expirationTime) { + var update = createUpdate(expirationTime, null); // Unmount the root by rendering null. + + update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property + // being called "element". + + update.payload = { + element: null + }; + var error = errorInfo.value; + + update.callback = function () { + onUncaughtError(error); + logError(fiber, errorInfo); + }; + + return update; +} + +function createClassErrorUpdate(fiber, errorInfo, expirationTime) { + var update = createUpdate(expirationTime, null); + update.tag = CaptureUpdate; + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + + if (typeof getDerivedStateFromError === 'function') { + var error$1 = errorInfo.value; + + update.payload = function () { + logError(fiber, errorInfo); + return getDerivedStateFromError(error$1); + }; + } + + var inst = fiber.stateNode; + + if (inst !== null && typeof inst.componentDidCatch === 'function') { + update.callback = function callback() { + { + markFailedErrorBoundaryForHotReloading(fiber); + } + + if (typeof getDerivedStateFromError !== 'function') { + // To preserve the preexisting retry behavior of error boundaries, + // we keep track of which ones already failed during this batch. + // This gets reset before we yield back to the browser. + // TODO: Warn in strict mode if getDerivedStateFromError is + // not defined. + markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined + + logError(fiber, errorInfo); + } + + var error$1 = errorInfo.value; + var stack = errorInfo.stack; + this.componentDidCatch(error$1, { + componentStack: stack !== null ? stack : '' + }); + + { + if (typeof getDerivedStateFromError !== 'function') { + // If componentDidCatch is the only error boundary method defined, + // then it needs to call setState to recover from errors. + // If no state update is scheduled then the boundary will swallow the error. + if (fiber.expirationTime !== Sync) { + error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown'); + } + } + } + }; + } else { + update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + }; + } + + return update; +} + +function attachPingListener(root, renderExpirationTime, thenable) { + // Attach a listener to the promise to "ping" the root and retry. But + // only if one does not already exist for the current render expiration + // time (which acts like a "thread ID" here). + var pingCache = root.pingCache; + var threadIDs; + + if (pingCache === null) { + pingCache = root.pingCache = new PossiblyWeakMap$1(); + threadIDs = new Set(); + pingCache.set(thenable, threadIDs); + } else { + threadIDs = pingCache.get(thenable); + + if (threadIDs === undefined) { + threadIDs = new Set(); + pingCache.set(thenable, threadIDs); + } + } + + if (!threadIDs.has(renderExpirationTime)) { + // Memoize using the thread ID to prevent redundant listeners. + threadIDs.add(renderExpirationTime); + var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime); + thenable.then(ping, ping); + } +} + +function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) { + // The source fiber did not complete. + sourceFiber.effectTag |= Incomplete; // Its effect list is no longer valid. + + sourceFiber.firstEffect = sourceFiber.lastEffect = null; + + if (value !== null && typeof value === 'object' && typeof value.then === 'function') { + // This is a thenable. + var thenable = value; + + if ((sourceFiber.mode & BlockingMode) === NoMode) { + // Reset the memoizedState to what it was before we attempted + // to render it. + var currentSource = sourceFiber.alternate; + + if (currentSource) { + sourceFiber.updateQueue = currentSource.updateQueue; + sourceFiber.memoizedState = currentSource.memoizedState; + sourceFiber.expirationTime = currentSource.expirationTime; + } else { + sourceFiber.updateQueue = null; + sourceFiber.memoizedState = null; + } + } + + var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view. + + var _workInProgress = returnFiber; + + do { + if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) { + // Found the nearest boundary. + // Stash the promise on the boundary fiber. If the boundary times out, we'll + // attach another listener to flip the boundary back to its normal state. + var thenables = _workInProgress.updateQueue; + + if (thenables === null) { + var updateQueue = new Set(); + updateQueue.add(thenable); + _workInProgress.updateQueue = updateQueue; + } else { + thenables.add(thenable); + } // If the boundary is outside of blocking mode, we should *not* + // suspend the commit. Pretend as if the suspended component rendered + // null and keep rendering. In the commit phase, we'll schedule a + // subsequent synchronous update to re-render the Suspense. + // + // Note: It doesn't matter whether the component that suspended was + // inside a blocking mode tree. If the Suspense is outside of it, we + // should *not* suspend the commit. + + + if ((_workInProgress.mode & BlockingMode) === NoMode) { + _workInProgress.effectTag |= DidCapture; // We're going to commit this fiber even though it didn't complete. + // But we shouldn't call any lifecycle methods or callbacks. Remove + // all lifecycle effect tags. + + sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete); + + if (sourceFiber.tag === ClassComponent) { + var currentSourceFiber = sourceFiber.alternate; + + if (currentSourceFiber === null) { + // This is a new mount. Change the tag so it's not mistaken for a + // completed class component. For example, we should not call + // componentWillUnmount if it is deleted. + sourceFiber.tag = IncompleteClassComponent; + } else { + // When we try rendering again, we should not reuse the current fiber, + // since it's known to be in an inconsistent state. Use a force update to + // prevent a bail out. + var update = createUpdate(Sync, null); + update.tag = ForceUpdate; + enqueueUpdate(sourceFiber, update); + } + } // The source fiber did not complete. Mark it with Sync priority to + // indicate that it still has pending work. + + + sourceFiber.expirationTime = Sync; // Exit without suspending. + + return; + } // Confirmed that the boundary is in a concurrent mode tree. Continue + // with the normal suspend path. + // + // After this we'll use a set of heuristics to determine whether this + // render pass will run to completion or restart or "suspend" the commit. + // The actual logic for this is spread out in different places. + // + // This first principle is that if we're going to suspend when we complete + // a root, then we should also restart if we get an update or ping that + // might unsuspend it, and vice versa. The only reason to suspend is + // because you think you might want to restart before committing. However, + // it doesn't make sense to restart only while in the period we're suspended. + // + // Restarting too aggressively is also not good because it starves out any + // intermediate loading state. So we use heuristics to determine when. + // Suspense Heuristics + // + // If nothing threw a Promise or all the same fallbacks are already showing, + // then don't suspend/restart. + // + // If this is an initial render of a new tree of Suspense boundaries and + // those trigger a fallback, then don't suspend/restart. We want to ensure + // that we can show the initial loading state as quickly as possible. + // + // If we hit a "Delayed" case, such as when we'd switch from content back into + // a fallback, then we should always suspend/restart. SuspenseConfig applies to + // this case. If none is defined, JND is used instead. + // + // If we're already showing a fallback and it gets "retried", allowing us to show + // another level, but there's still an inner boundary that would show a fallback, + // then we suspend/restart for 500ms since the last time we showed a fallback + // anywhere in the tree. This effectively throttles progressive loading into a + // consistent train of commits. This also gives us an opportunity to restart to + // get to the completed state slightly earlier. + // + // If there's ambiguity due to batching it's resolved in preference of: + // 1) "delayed", 2) "initial render", 3) "retry". + // + // We want to ensure that a "busy" state doesn't get force committed. We want to + // ensure that new initial loading states can commit as soon as possible. + + + attachPingListener(root, renderExpirationTime, thenable); + _workInProgress.effectTag |= ShouldCapture; + _workInProgress.expirationTime = renderExpirationTime; + return; + } // This boundary already captured during this render. Continue to the next + // boundary. + + + _workInProgress = _workInProgress.return; + } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode. + // TODO: Use invariant so the message is stripped in prod? + + + value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber)); + } // We didn't find a boundary that could handle this type of exception. Start + // over and traverse parent path again, this time treating the exception + // as an error. + + + renderDidError(); + value = createCapturedValue(value, sourceFiber); + var workInProgress = returnFiber; + + do { + switch (workInProgress.tag) { + case HostRoot: + { + var _errorInfo = value; + workInProgress.effectTag |= ShouldCapture; + workInProgress.expirationTime = renderExpirationTime; + + var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime); + + enqueueCapturedUpdate(workInProgress, _update); + return; + } + + case ClassComponent: + // Capture and retry + var errorInfo = value; + var ctor = workInProgress.type; + var instance = workInProgress.stateNode; + + if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) { + workInProgress.effectTag |= ShouldCapture; + workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state + + var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime); + + enqueueCapturedUpdate(workInProgress, _update2); + return; + } + + break; + } + + workInProgress = workInProgress.return; + } while (workInProgress !== null); +} + +var ceil = Math.ceil; +var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing; +var NoContext = +/* */ +0; +var BatchedContext = +/* */ +1; +var EventContext = +/* */ +2; +var DiscreteEventContext = +/* */ +4; +var LegacyUnbatchedContext = +/* */ +8; +var RenderContext = +/* */ +16; +var CommitContext = +/* */ +32; +var RootIncomplete = 0; +var RootFatalErrored = 1; +var RootErrored = 2; +var RootSuspended = 3; +var RootSuspendedWithDelay = 4; +var RootCompleted = 5; +// Describes where we are in the React execution stack +var executionContext = NoContext; // The root we're working on + +var workInProgressRoot = null; // The fiber we're working on + +var workInProgress = null; // The expiration time we're rendering + +var renderExpirationTime$1 = NoWork; // Whether to root completed, errored, suspended, etc. + +var workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown + +var workInProgressRootFatalError = null; // Most recent event time among processed updates during this render. +// This is conceptually a time stamp but expressed in terms of an ExpirationTime +// because we deal mostly with expiration times in the hot path, so this avoids +// the conversion happening in the hot path. + +var workInProgressRootLatestProcessedExpirationTime = Sync; +var workInProgressRootLatestSuspenseTimeout = Sync; +var workInProgressRootCanSuspendUsingConfig = null; // The work left over by components that were visited during this render. Only +// includes unprocessed updates, not work in bailed out children. + +var workInProgressRootNextUnprocessedUpdateTime = NoWork; // If we're pinged while rendering we don't always restart immediately. +// This flag determines if it might be worthwhile to restart if an opportunity +// happens latere. + +var workInProgressRootHasPendingPing = false; // The most recent time we committed a fallback. This lets us ensure a train +// model where we don't commit new loading states in too quick succession. + +var globalMostRecentFallbackTime = 0; +var FALLBACK_THROTTLE_MS = 500; +var nextEffect = null; +var hasUncaughtError = false; +var firstUncaughtError = null; +var legacyErrorBoundariesThatAlreadyFailed = null; +var rootDoesHavePassiveEffects = false; +var rootWithPendingPassiveEffects = null; +var pendingPassiveEffectsRenderPriority = NoPriority; +var pendingPassiveEffectsExpirationTime = NoWork; +var rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates + +var NESTED_UPDATE_LIMIT = 50; +var nestedUpdateCount = 0; +var rootWithNestedUpdates = null; +var NESTED_PASSIVE_UPDATE_LIMIT = 50; +var nestedPassiveUpdateCount = 0; +var interruptedBy = null; // Marks the need to reschedule pending interactions at these expiration times +// during the commit phase. This enables them to be traced across components +// that spawn new work during render. E.g. hidden boundaries, suspended SSR +// hydration or SuspenseList. + +var spawnedWorkDuringRender = null; // Expiration times are computed by adding to the current time (the start +// time). However, if two updates are scheduled within the same event, we +// should treat their start times as simultaneous, even if the actual clock +// time has advanced between the first and second call. +// In other words, because expiration times determine how updates are batched, +// we want all updates of like priority that occur within the same event to +// receive the same expiration time. Otherwise we get tearing. + +var currentEventTime = NoWork; +function requestCurrentTimeForUpdate() { + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + // We're inside React, so it's fine to read the actual time. + return msToExpirationTime(now()); + } // We're not inside React, so we may be in the middle of a browser event. + + + if (currentEventTime !== NoWork) { + // Use the same start time for all updates until we enter React again. + return currentEventTime; + } // This is the first update since React yielded. Compute a new start time. + + + currentEventTime = msToExpirationTime(now()); + return currentEventTime; +} +function getCurrentTime() { + return msToExpirationTime(now()); +} +function computeExpirationForFiber(currentTime, fiber, suspenseConfig) { + var mode = fiber.mode; + + if ((mode & BlockingMode) === NoMode) { + return Sync; + } + + var priorityLevel = getCurrentPriorityLevel(); + + if ((mode & ConcurrentMode) === NoMode) { + return priorityLevel === ImmediatePriority ? Sync : Batched; + } + + if ((executionContext & RenderContext) !== NoContext) { + // Use whatever time we're already rendering + // TODO: Should there be a way to opt out, like with `runWithPriority`? + return renderExpirationTime$1; + } + + var expirationTime; + + if (suspenseConfig !== null) { + // Compute an expiration time based on the Suspense timeout. + expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION); + } else { + // Compute an expiration time based on the Scheduler priority. + switch (priorityLevel) { + case ImmediatePriority: + expirationTime = Sync; + break; + + case UserBlockingPriority$1: + // TODO: Rename this to computeUserBlockingExpiration + expirationTime = computeInteractiveExpiration(currentTime); + break; + + case NormalPriority: + case LowPriority: + // TODO: Handle LowPriority + // TODO: Rename this to... something better. + expirationTime = computeAsyncExpiration(currentTime); + break; + + case IdlePriority: + expirationTime = Idle; + break; + + default: + { + { + throw Error( "Expected a valid priority level" ); + } + } + + } + } // If we're in the middle of rendering a tree, do not update at the same + // expiration time that is already rendering. + // TODO: We shouldn't have to do this if the update is on a different root. + // Refactor computeExpirationForFiber + scheduleUpdate so we have access to + // the root when we check for this condition. + + + if (workInProgressRoot !== null && expirationTime === renderExpirationTime$1) { + // This is a trick to move this update into a separate batch + expirationTime -= 1; + } + + return expirationTime; +} +function scheduleUpdateOnFiber(fiber, expirationTime) { + checkForNestedUpdates(); + warnAboutRenderPhaseUpdatesInDEV(fiber); + var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime); + + if (root === null) { + warnAboutUpdateOnUnmountedFiberInDEV(fiber); + return; + } + + checkForInterruption(fiber, expirationTime); + recordScheduleUpdate(); // TODO: computeExpirationForFiber also reads the priority. Pass the + // priority as an argument to that function and this one. + + var priorityLevel = getCurrentPriorityLevel(); + + if (expirationTime === Sync) { + if ( // Check if we're inside unbatchedUpdates + (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering + (executionContext & (RenderContext | CommitContext)) === NoContext) { + // Register pending interactions on the root to avoid losing traced interaction data. + schedulePendingInteractions(root, expirationTime); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed + // root inside of batchedUpdates should be synchronous, but layout updates + // should be deferred until the end of the batch. + + performSyncWorkOnRoot(root); + } else { + ensureRootIsScheduled(root); + schedulePendingInteractions(root, expirationTime); + + if (executionContext === NoContext) { + // Flush the synchronous work now, unless we're already working or inside + // a batch. This is intentionally inside scheduleUpdateOnFiber instead of + // scheduleCallbackForFiber to preserve the ability to schedule a callback + // without immediately flushing it. We only do this for user-initiated + // updates, to preserve historical behavior of legacy mode. + flushSyncCallbackQueue(); + } + } + } else { + ensureRootIsScheduled(root); + schedulePendingInteractions(root, expirationTime); + } + + if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered + // discrete, even inside a discrete event. + priorityLevel === UserBlockingPriority$1 || priorityLevel === ImmediatePriority)) { + // This is the result of a discrete event. Track the lowest priority + // discrete update per root so we can flush them early, if needed. + if (rootsWithPendingDiscreteUpdates === null) { + rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]); + } else { + var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root); + + if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) { + rootsWithPendingDiscreteUpdates.set(root, expirationTime); + } + } + } +} +var scheduleWork = scheduleUpdateOnFiber; // This is split into a separate function so we can mark a fiber with pending +// work without treating it as a typical update that originates from an event; +// e.g. retrying a Suspense boundary isn't an update, but it does schedule work +// on a fiber. + +function markUpdateTimeFromFiberToRoot(fiber, expirationTime) { + // Update the source fiber's expiration time + if (fiber.expirationTime < expirationTime) { + fiber.expirationTime = expirationTime; + } + + var alternate = fiber.alternate; + + if (alternate !== null && alternate.expirationTime < expirationTime) { + alternate.expirationTime = expirationTime; + } // Walk the parent path to the root and update the child expiration time. + + + var node = fiber.return; + var root = null; + + if (node === null && fiber.tag === HostRoot) { + root = fiber.stateNode; + } else { + while (node !== null) { + alternate = node.alternate; + + if (node.childExpirationTime < expirationTime) { + node.childExpirationTime = expirationTime; + + if (alternate !== null && alternate.childExpirationTime < expirationTime) { + alternate.childExpirationTime = expirationTime; + } + } else if (alternate !== null && alternate.childExpirationTime < expirationTime) { + alternate.childExpirationTime = expirationTime; + } + + if (node.return === null && node.tag === HostRoot) { + root = node.stateNode; + break; + } + + node = node.return; + } + } + + if (root !== null) { + if (workInProgressRoot === root) { + // Received an update to a tree that's in the middle of rendering. Mark + // that's unprocessed work on this root. + markUnprocessedUpdateTime(expirationTime); + + if (workInProgressRootExitStatus === RootSuspendedWithDelay) { + // The root already suspended with a delay, which means this render + // definitely won't finish. Since we have a new update, let's mark it as + // suspended now, right before marking the incoming update. This has the + // effect of interrupting the current render and switching to the update. + // TODO: This happens to work when receiving an update during the render + // phase, because of the trick inside computeExpirationForFiber to + // subtract 1 from `renderExpirationTime` to move it into a + // separate bucket. But we should probably model it with an exception, + // using the same mechanism we use to force hydration of a subtree. + // TODO: This does not account for low pri updates that were already + // scheduled before the root started rendering. Need to track the next + // pending expiration time (perhaps by backtracking the return path) and + // then trigger a restart in the `renderDidSuspendDelayIfPossible` path. + markRootSuspendedAtTime(root, renderExpirationTime$1); + } + } // Mark that the root has a pending update. + + + markRootUpdatedAtTime(root, expirationTime); + } + + return root; +} + +function getNextRootExpirationTimeToWorkOn(root) { + // Determines the next expiration time that the root should render, taking + // into account levels that may be suspended, or levels that may have + // received a ping. + var lastExpiredTime = root.lastExpiredTime; + + if (lastExpiredTime !== NoWork) { + return lastExpiredTime; + } // "Pending" refers to any update that hasn't committed yet, including if it + // suspended. The "suspended" range is therefore a subset. + + + var firstPendingTime = root.firstPendingTime; + + if (!isRootSuspendedAtTime(root, firstPendingTime)) { + // The highest priority pending time is not suspended. Let's work on that. + return firstPendingTime; + } // If the first pending time is suspended, check if there's a lower priority + // pending level that we know about. Or check if we received a ping. Work + // on whichever is higher priority. + + + var lastPingedTime = root.lastPingedTime; + var nextKnownPendingLevel = root.nextKnownPendingLevel; + var nextLevel = lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel; + + if ( nextLevel <= Idle && firstPendingTime !== nextLevel) { + // Don't work on Idle/Never priority unless everything else is committed. + return NoWork; + } + + return nextLevel; +} // Use this function to schedule a task for a root. There's only one task per +// root; if a task was already scheduled, we'll check to make sure the +// expiration time of the existing task is the same as the expiration time of +// the next level that the root has work on. This function is called on every +// update, and right before exiting a task. + + +function ensureRootIsScheduled(root) { + var lastExpiredTime = root.lastExpiredTime; + + if (lastExpiredTime !== NoWork) { + // Special case: Expired work should flush synchronously. + root.callbackExpirationTime = Sync; + root.callbackPriority = ImmediatePriority; + root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); + return; + } + + var expirationTime = getNextRootExpirationTimeToWorkOn(root); + var existingCallbackNode = root.callbackNode; + + if (expirationTime === NoWork) { + // There's nothing to work on. + if (existingCallbackNode !== null) { + root.callbackNode = null; + root.callbackExpirationTime = NoWork; + root.callbackPriority = NoPriority; + } + + return; + } // TODO: If this is an update, we already read the current time. Pass the + // time as an argument. + + + var currentTime = requestCurrentTimeForUpdate(); + var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and + // expiration time. Otherwise, we'll cancel it and schedule a new one. + + if (existingCallbackNode !== null) { + var existingCallbackPriority = root.callbackPriority; + var existingCallbackExpirationTime = root.callbackExpirationTime; + + if ( // Callback must have the exact same expiration time. + existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority. + existingCallbackPriority >= priorityLevel) { + // Existing callback is sufficient. + return; + } // Need to schedule a new task. + // TODO: Instead of scheduling a new task, we should be able to change the + // priority of the existing one. + + + cancelCallback(existingCallbackNode); + } + + root.callbackExpirationTime = expirationTime; + root.callbackPriority = priorityLevel; + var callbackNode; + + if (expirationTime === Sync) { + // Sync React callbacks are scheduled on a special internal queue + callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); + } else { + callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects + // ordering because tasks are processed in timeout order. + { + timeout: expirationTimeToMs(expirationTime) - now() + }); + } + + root.callbackNode = callbackNode; +} // This is the entry point for every concurrent task, i.e. anything that +// goes through Scheduler. + + +function performConcurrentWorkOnRoot(root, didTimeout) { + // Since we know we're in a React event, we can clear the current + // event time. The next update will compute a new event time. + currentEventTime = NoWork; + + if (didTimeout) { + // The render task took too long to complete. Mark the current time as + // expired to synchronously render all expired work in a single batch. + var currentTime = requestCurrentTimeForUpdate(); + markRootExpiredAtTime(root, currentTime); // This will schedule a synchronous callback. + + ensureRootIsScheduled(root); + return null; + } // Determine the next expiration time to work on, using the fields stored + // on the root. + + + var expirationTime = getNextRootExpirationTimeToWorkOn(root); + + if (expirationTime !== NoWork) { + var originalCallbackNode = root.callbackNode; + + if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) { + { + throw Error( "Should not already be working." ); + } + } + + flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack + // and prepare a fresh one. Otherwise we'll continue where we left off. + + if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) { + prepareFreshStack(root, expirationTime); + startWorkOnPendingInteractions(root, expirationTime); + } // If we have a work-in-progress fiber, it means there's still work to do + // in this root. + + + if (workInProgress !== null) { + var prevExecutionContext = executionContext; + executionContext |= RenderContext; + var prevDispatcher = pushDispatcher(); + var prevInteractions = pushInteractions(root); + startWorkLoopTimer(workInProgress); + + do { + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (true); + + resetContextDependencies(); + executionContext = prevExecutionContext; + popDispatcher(prevDispatcher); + + { + popInteractions(prevInteractions); + } + + if (workInProgressRootExitStatus === RootFatalErrored) { + var fatalError = workInProgressRootFatalError; + stopInterruptedWorkLoopTimer(); + prepareFreshStack(root, expirationTime); + markRootSuspendedAtTime(root, expirationTime); + ensureRootIsScheduled(root); + throw fatalError; + } + + if (workInProgress !== null) { + // There's still work left over. Exit without committing. + stopInterruptedWorkLoopTimer(); + } else { + // We now have a consistent tree. The next step is either to commit it, + // or, if something suspended, wait to commit it after a timeout. + stopFinishedWorkLoopTimer(); + var finishedWork = root.finishedWork = root.current.alternate; + root.finishedExpirationTime = expirationTime; + finishConcurrentRender(root, finishedWork, workInProgressRootExitStatus, expirationTime); + } + + ensureRootIsScheduled(root); + + if (root.callbackNode === originalCallbackNode) { + // The task node scheduled for this root is the same one that's + // currently executed. Need to return a continuation. + return performConcurrentWorkOnRoot.bind(null, root); + } + } + } + + return null; +} + +function finishConcurrentRender(root, finishedWork, exitStatus, expirationTime) { + // Set this to null to indicate there's no in-progress render. + workInProgressRoot = null; + + switch (exitStatus) { + case RootIncomplete: + case RootFatalErrored: + { + { + { + throw Error( "Root did not complete. This is a bug in React." ); + } + } + } + // Flow knows about invariant, so it complains if I add a break + // statement, but eslint doesn't know about invariant, so it complains + // if I do. eslint-disable-next-line no-fallthrough + + case RootErrored: + { + // If this was an async render, the error may have happened due to + // a mutation in a concurrent event. Try rendering one more time, + // synchronously, to see if the error goes away. If there are + // lower priority updates, let's include those, too, in case they + // fix the inconsistency. Render at Idle to include all updates. + // If it was Idle or Never or some not-yet-invented time, render + // at that time. + markRootExpiredAtTime(root, expirationTime > Idle ? Idle : expirationTime); // We assume that this second render pass will be synchronous + // and therefore not hit this path again. + + break; + } + + case RootSuspended: + { + markRootSuspendedAtTime(root, expirationTime); + var lastSuspendedTime = root.lastSuspendedTime; + + if (expirationTime === lastSuspendedTime) { + root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork); + } // We have an acceptable loading state. We need to figure out if we + // should immediately commit it or wait a bit. + // If we have processed new updates during this render, we may now + // have a new loading state ready. We want to ensure that we commit + // that as soon as possible. + + + var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync; + + if (hasNotProcessedNewUpdates && // do not delay if we're inside an act() scope + !( IsThisRendererActing.current)) { + // If we have not processed any new updates during this pass, then + // this is either a retry of an existing fallback state or a + // hidden tree. Hidden trees shouldn't be batched with other work + // and after that's fixed it can only be a retry. We're going to + // throttle committing retries so that we don't show too many + // loading states too quickly. + var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time. + + if (msUntilTimeout > 10) { + if (workInProgressRootHasPendingPing) { + var lastPingedTime = root.lastPingedTime; + + if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) { + // This render was pinged but we didn't get to restart + // earlier so try restarting now instead. + root.lastPingedTime = expirationTime; + prepareFreshStack(root, expirationTime); + break; + } + } + + var nextTime = getNextRootExpirationTimeToWorkOn(root); + + if (nextTime !== NoWork && nextTime !== expirationTime) { + // There's additional work on this root. + break; + } + + if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) { + // We should prefer to render the fallback of at the last + // suspended level. Ping the last suspended level to try + // rendering it again. + root.lastPingedTime = lastSuspendedTime; + break; + } // The render is suspended, it hasn't timed out, and there's no + // lower priority work to do. Instead of committing the fallback + // immediately, wait for more data to arrive. + + + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout); + break; + } + } // The work expired. Commit immediately. + + + commitRoot(root); + break; + } + + case RootSuspendedWithDelay: + { + markRootSuspendedAtTime(root, expirationTime); + var _lastSuspendedTime = root.lastSuspendedTime; + + if (expirationTime === _lastSuspendedTime) { + root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork); + } + + if ( // do not delay if we're inside an act() scope + !( IsThisRendererActing.current)) { + // We're suspended in a state that should be avoided. We'll try to + // avoid committing it for as long as the timeouts let us. + if (workInProgressRootHasPendingPing) { + var _lastPingedTime = root.lastPingedTime; + + if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) { + // This render was pinged but we didn't get to restart earlier + // so try restarting now instead. + root.lastPingedTime = expirationTime; + prepareFreshStack(root, expirationTime); + break; + } + } + + var _nextTime = getNextRootExpirationTimeToWorkOn(root); + + if (_nextTime !== NoWork && _nextTime !== expirationTime) { + // There's additional work on this root. + break; + } + + if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) { + // We should prefer to render the fallback of at the last + // suspended level. Ping the last suspended level to try + // rendering it again. + root.lastPingedTime = _lastSuspendedTime; + break; + } + + var _msUntilTimeout; + + if (workInProgressRootLatestSuspenseTimeout !== Sync) { + // We have processed a suspense config whose expiration time we + // can use as the timeout. + _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now(); + } else if (workInProgressRootLatestProcessedExpirationTime === Sync) { + // This should never normally happen because only new updates + // cause delayed states, so we should have processed something. + // However, this could also happen in an offscreen tree. + _msUntilTimeout = 0; + } else { + // If we don't have a suspense config, we're going to use a + // heuristic to determine how long we can suspend. + var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime); + var currentTimeMs = now(); + var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs; + var timeElapsed = currentTimeMs - eventTimeMs; + + if (timeElapsed < 0) { + // We get this wrong some time since we estimate the time. + timeElapsed = 0; + } + + _msUntilTimeout = jnd(timeElapsed) - timeElapsed; // Clamp the timeout to the expiration time. TODO: Once the + // event time is exact instead of inferred from expiration time + // we don't need this. + + if (timeUntilExpirationMs < _msUntilTimeout) { + _msUntilTimeout = timeUntilExpirationMs; + } + } // Don't bother with a very short suspense time. + + + if (_msUntilTimeout > 10) { + // The render is suspended, it hasn't timed out, and there's no + // lower priority work to do. Instead of committing the fallback + // immediately, wait for more data to arrive. + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout); + break; + } + } // The work expired. Commit immediately. + + + commitRoot(root); + break; + } + + case RootCompleted: + { + // The work completed. Ready to commit. + if ( // do not delay if we're inside an act() scope + !( IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) { + // If we have exceeded the minimum loading delay, which probably + // means we have shown a spinner already, we might have to suspend + // a bit longer to ensure that the spinner is shown for + // enough time. + var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig); + + if (_msUntilTimeout2 > 10) { + markRootSuspendedAtTime(root, expirationTime); + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2); + break; + } + } + + commitRoot(root); + break; + } + + default: + { + { + { + throw Error( "Unknown root exit status." ); + } + } + } + } +} // This is the entry point for synchronous tasks that don't go +// through Scheduler + + +function performSyncWorkOnRoot(root) { + // Check if there's expired work on this root. Otherwise, render at Sync. + var lastExpiredTime = root.lastExpiredTime; + var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync; + + if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) { + { + throw Error( "Should not already be working." ); + } + } + + flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack + // and prepare a fresh one. Otherwise we'll continue where we left off. + + if (root !== workInProgressRoot || expirationTime !== renderExpirationTime$1) { + prepareFreshStack(root, expirationTime); + startWorkOnPendingInteractions(root, expirationTime); + } // If we have a work-in-progress fiber, it means there's still work to do + // in this root. + + + if (workInProgress !== null) { + var prevExecutionContext = executionContext; + executionContext |= RenderContext; + var prevDispatcher = pushDispatcher(); + var prevInteractions = pushInteractions(root); + startWorkLoopTimer(workInProgress); + + do { + try { + workLoopSync(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (true); + + resetContextDependencies(); + executionContext = prevExecutionContext; + popDispatcher(prevDispatcher); + + { + popInteractions(prevInteractions); + } + + if (workInProgressRootExitStatus === RootFatalErrored) { + var fatalError = workInProgressRootFatalError; + stopInterruptedWorkLoopTimer(); + prepareFreshStack(root, expirationTime); + markRootSuspendedAtTime(root, expirationTime); + ensureRootIsScheduled(root); + throw fatalError; + } + + if (workInProgress !== null) { + // This is a sync render, so we should have finished the whole tree. + { + { + throw Error( "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." ); + } + } + } else { + // We now have a consistent tree. Because this is a sync render, we + // will commit it even if something suspended. + stopFinishedWorkLoopTimer(); + root.finishedWork = root.current.alternate; + root.finishedExpirationTime = expirationTime; + finishSyncRender(root); + } // Before exiting, make sure there's a callback scheduled for the next + // pending level. + + + ensureRootIsScheduled(root); + } + + return null; +} + +function finishSyncRender(root) { + // Set this to null to indicate there's no in-progress render. + workInProgressRoot = null; + commitRoot(root); +} +function flushDiscreteUpdates() { + // TODO: Should be able to flush inside batchedUpdates, but not inside `act`. + // However, `act` uses `batchedUpdates`, so there's no way to distinguish + // those two cases. Need to fix this before exposing flushDiscreteUpdates + // as a public API. + if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) { + { + if ((executionContext & RenderContext) !== NoContext) { + error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.'); + } + } // We're already rendering, so we can't synchronously flush pending work. + // This is probably a nested event dispatch triggered by a lifecycle/effect, + // like `el.focus()`. Exit. + + + return; + } + + flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that + // they fire before the next serial event. + + flushPassiveEffects(); +} +function syncUpdates(fn, a, b, c) { + return runWithPriority$1(ImmediatePriority, fn.bind(null, a, b, c)); +} + +function flushPendingDiscreteUpdates() { + if (rootsWithPendingDiscreteUpdates !== null) { + // For each root with pending discrete updates, schedule a callback to + // immediately flush them. + var roots = rootsWithPendingDiscreteUpdates; + rootsWithPendingDiscreteUpdates = null; + roots.forEach(function (expirationTime, root) { + markRootExpiredAtTime(root, expirationTime); + ensureRootIsScheduled(root); + }); // Now flush the immediate queue. + + flushSyncCallbackQueue(); + } +} + +function batchedUpdates$1(fn, a) { + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + + try { + return fn(a); + } finally { + executionContext = prevExecutionContext; + + if (executionContext === NoContext) { + // Flush the immediate callbacks that were scheduled during this batch + flushSyncCallbackQueue(); + } + } +} +function batchedEventUpdates$1(fn, a) { + var prevExecutionContext = executionContext; + executionContext |= EventContext; + + try { + return fn(a); + } finally { + executionContext = prevExecutionContext; + + if (executionContext === NoContext) { + // Flush the immediate callbacks that were scheduled during this batch + flushSyncCallbackQueue(); + } + } +} +function discreteUpdates$1(fn, a, b, c, d) { + var prevExecutionContext = executionContext; + executionContext |= DiscreteEventContext; + + try { + // Should this + return runWithPriority$1(UserBlockingPriority$1, fn.bind(null, a, b, c, d)); + } finally { + executionContext = prevExecutionContext; + + if (executionContext === NoContext) { + // Flush the immediate callbacks that were scheduled during this batch + flushSyncCallbackQueue(); + } + } +} +function unbatchedUpdates(fn, a) { + var prevExecutionContext = executionContext; + executionContext &= ~BatchedContext; + executionContext |= LegacyUnbatchedContext; + + try { + return fn(a); + } finally { + executionContext = prevExecutionContext; + + if (executionContext === NoContext) { + // Flush the immediate callbacks that were scheduled during this batch + flushSyncCallbackQueue(); + } + } +} +function flushSync(fn, a) { + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { + { + { + throw Error( "flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering." ); + } + } + } + + var prevExecutionContext = executionContext; + executionContext |= BatchedContext; + + try { + return runWithPriority$1(ImmediatePriority, fn.bind(null, a)); + } finally { + executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. + // Note that this will happen even if batchedUpdates is higher up + // the stack. + + flushSyncCallbackQueue(); + } +} + +function prepareFreshStack(root, expirationTime) { + root.finishedWork = null; + root.finishedExpirationTime = NoWork; + var timeoutHandle = root.timeoutHandle; + + if (timeoutHandle !== noTimeout) { + // The root previous suspended and scheduled a timeout to commit a fallback + // state. Now that we have additional work, cancel the timeout. + root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above + + cancelTimeout(timeoutHandle); + } + + if (workInProgress !== null) { + var interruptedWork = workInProgress.return; + + while (interruptedWork !== null) { + unwindInterruptedWork(interruptedWork); + interruptedWork = interruptedWork.return; + } + } + + workInProgressRoot = root; + workInProgress = createWorkInProgress(root.current, null); + renderExpirationTime$1 = expirationTime; + workInProgressRootExitStatus = RootIncomplete; + workInProgressRootFatalError = null; + workInProgressRootLatestProcessedExpirationTime = Sync; + workInProgressRootLatestSuspenseTimeout = Sync; + workInProgressRootCanSuspendUsingConfig = null; + workInProgressRootNextUnprocessedUpdateTime = NoWork; + workInProgressRootHasPendingPing = false; + + { + spawnedWorkDuringRender = null; + } + + { + ReactStrictModeWarnings.discardPendingWarnings(); + } +} + +function handleError(root, thrownValue) { + do { + try { + // Reset module-level state that was set during the render phase. + resetContextDependencies(); + resetHooksAfterThrow(); + resetCurrentFiber(); + + if (workInProgress === null || workInProgress.return === null) { + // Expected to be working on a non-root fiber. This is a fatal error + // because there's no ancestor that can handle it; the root is + // supposed to capture all errors that weren't caught by an error + // boundary. + workInProgressRootExitStatus = RootFatalErrored; + workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next + // sibling, or the parent if there are no siblings. But since the root + // has no siblings nor a parent, we set it to null. Usually this is + // handled by `completeUnitOfWork` or `unwindWork`, but since we're + // interntionally not calling those, we need set it here. + // TODO: Consider calling `unwindWork` to pop the contexts. + + workInProgress = null; + return null; + } + + if (enableProfilerTimer && workInProgress.mode & ProfileMode) { + // Record the time spent rendering before an error was thrown. This + // avoids inaccurate Profiler durations in the case of a + // suspended render. + stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true); + } + + throwException(root, workInProgress.return, workInProgress, thrownValue, renderExpirationTime$1); + workInProgress = completeUnitOfWork(workInProgress); + } catch (yetAnotherThrownValue) { + // Something in the return path also threw. + thrownValue = yetAnotherThrownValue; + continue; + } // Return to the normal work loop. + + + return; + } while (true); +} + +function pushDispatcher(root) { + var prevDispatcher = ReactCurrentDispatcher$1.current; + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + + if (prevDispatcher === null) { + // The React isomorphic package does not include a default dispatcher. + // Instead the first renderer will lazily attach one, in order to give + // nicer error messages. + return ContextOnlyDispatcher; + } else { + return prevDispatcher; + } +} + +function popDispatcher(prevDispatcher) { + ReactCurrentDispatcher$1.current = prevDispatcher; +} + +function pushInteractions(root) { + { + var prevInteractions = tracing.__interactionsRef.current; + tracing.__interactionsRef.current = root.memoizedInteractions; + return prevInteractions; + } +} + +function popInteractions(prevInteractions) { + { + tracing.__interactionsRef.current = prevInteractions; + } +} + +function markCommitTimeOfFallback() { + globalMostRecentFallbackTime = now(); +} +function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) { + if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) { + workInProgressRootLatestProcessedExpirationTime = expirationTime; + } + + if (suspenseConfig !== null) { + if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) { + workInProgressRootLatestSuspenseTimeout = expirationTime; // Most of the time we only have one config and getting wrong is not bad. + + workInProgressRootCanSuspendUsingConfig = suspenseConfig; + } + } +} +function markUnprocessedUpdateTime(expirationTime) { + if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) { + workInProgressRootNextUnprocessedUpdateTime = expirationTime; + } +} +function renderDidSuspend() { + if (workInProgressRootExitStatus === RootIncomplete) { + workInProgressRootExitStatus = RootSuspended; + } +} +function renderDidSuspendDelayIfPossible() { + if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) { + workInProgressRootExitStatus = RootSuspendedWithDelay; + } // Check if there's a lower priority update somewhere else in the tree. + + + if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) { + // Mark the current render as suspended, and then mark that there's a + // pending update. + // TODO: This should immediately interrupt the current render, instead + // of waiting until the next time we yield. + markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime$1); + markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime); + } +} +function renderDidError() { + if (workInProgressRootExitStatus !== RootCompleted) { + workInProgressRootExitStatus = RootErrored; + } +} // Called during render to determine if anything has suspended. +// Returns false if we're not sure. + +function renderHasNotSuspendedYet() { + // If something errored or completed, we can't really be sure, + // so those are false. + return workInProgressRootExitStatus === RootIncomplete; +} + +function inferTimeFromExpirationTime(expirationTime) { + // We don't know exactly when the update was scheduled, but we can infer an + // approximate start time from the expiration time. + var earliestExpirationTimeMs = expirationTimeToMs(expirationTime); + return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION; +} + +function inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) { + // We don't know exactly when the update was scheduled, but we can infer an + // approximate start time from the expiration time by subtracting the timeout + // that was added to the event time. + var earliestExpirationTimeMs = expirationTimeToMs(expirationTime); + return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION); +} // The work loop is an extremely hot path. Tell Closure not to inline it. + +/** @noinline */ + + +function workLoopSync() { + // Already timed out, so perform work without checking if we need to yield. + while (workInProgress !== null) { + workInProgress = performUnitOfWork(workInProgress); + } +} +/** @noinline */ + + +function workLoopConcurrent() { + // Perform work until Scheduler asks us to yield + while (workInProgress !== null && !shouldYield()) { + workInProgress = performUnitOfWork(workInProgress); + } +} + +function performUnitOfWork(unitOfWork) { + // The current, flushed, state of this fiber is the alternate. Ideally + // nothing should rely on this, but relying on it here means that we don't + // need an additional field on the work in progress. + var current = unitOfWork.alternate; + startWorkTimer(unitOfWork); + setCurrentFiber(unitOfWork); + var next; + + if ( (unitOfWork.mode & ProfileMode) !== NoMode) { + startProfilerTimer(unitOfWork); + next = beginWork$1(current, unitOfWork, renderExpirationTime$1); + stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true); + } else { + next = beginWork$1(current, unitOfWork, renderExpirationTime$1); + } + + resetCurrentFiber(); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + + if (next === null) { + // If this doesn't spawn new work, complete the current work. + next = completeUnitOfWork(unitOfWork); + } + + ReactCurrentOwner$2.current = null; + return next; +} + +function completeUnitOfWork(unitOfWork) { + // Attempt to complete the current unit of work, then move to the next + // sibling. If there are no more siblings, return to the parent fiber. + workInProgress = unitOfWork; + + do { + // The current, flushed, state of this fiber is the alternate. Ideally + // nothing should rely on this, but relying on it here means that we don't + // need an additional field on the work in progress. + var current = workInProgress.alternate; + var returnFiber = workInProgress.return; // Check if the work completed or if something threw. + + if ((workInProgress.effectTag & Incomplete) === NoEffect) { + setCurrentFiber(workInProgress); + var next = void 0; + + if ( (workInProgress.mode & ProfileMode) === NoMode) { + next = completeWork(current, workInProgress, renderExpirationTime$1); + } else { + startProfilerTimer(workInProgress); + next = completeWork(current, workInProgress, renderExpirationTime$1); // Update render duration assuming we didn't error. + + stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false); + } + + stopWorkTimer(workInProgress); + resetCurrentFiber(); + resetChildExpirationTime(workInProgress); + + if (next !== null) { + // Completing this fiber spawned new work. Work on that next. + return next; + } + + if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete + (returnFiber.effectTag & Incomplete) === NoEffect) { + // Append all the effects of the subtree and this fiber onto the effect + // list of the parent. The completion order of the children affects the + // side-effect order. + if (returnFiber.firstEffect === null) { + returnFiber.firstEffect = workInProgress.firstEffect; + } + + if (workInProgress.lastEffect !== null) { + if (returnFiber.lastEffect !== null) { + returnFiber.lastEffect.nextEffect = workInProgress.firstEffect; + } + + returnFiber.lastEffect = workInProgress.lastEffect; + } // If this fiber had side-effects, we append it AFTER the children's + // side-effects. We can perform certain side-effects earlier if needed, + // by doing multiple passes over the effect list. We don't want to + // schedule our own side-effect on our own list because if end up + // reusing children we'll schedule this effect onto itself since we're + // at the end. + + + var effectTag = workInProgress.effectTag; // Skip both NoWork and PerformedWork tags when creating the effect + // list. PerformedWork effect is read by React DevTools but shouldn't be + // committed. + + if (effectTag > PerformedWork) { + if (returnFiber.lastEffect !== null) { + returnFiber.lastEffect.nextEffect = workInProgress; + } else { + returnFiber.firstEffect = workInProgress; + } + + returnFiber.lastEffect = workInProgress; + } + } + } else { + // This fiber did not complete because something threw. Pop values off + // the stack without entering the complete phase. If this is a boundary, + // capture values if possible. + var _next = unwindWork(workInProgress); // Because this fiber did not complete, don't reset its expiration time. + + + if ( (workInProgress.mode & ProfileMode) !== NoMode) { + // Record the render duration for the fiber that errored. + stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false); // Include the time spent working on failed children before continuing. + + var actualDuration = workInProgress.actualDuration; + var child = workInProgress.child; + + while (child !== null) { + actualDuration += child.actualDuration; + child = child.sibling; + } + + workInProgress.actualDuration = actualDuration; + } + + if (_next !== null) { + // If completing this work spawned new work, do that next. We'll come + // back here again. + // Since we're restarting, remove anything that is not a host effect + // from the effect tag. + // TODO: The name stopFailedWorkTimer is misleading because Suspense + // also captures and restarts. + stopFailedWorkTimer(workInProgress); + _next.effectTag &= HostEffectMask; + return _next; + } + + stopWorkTimer(workInProgress); + + if (returnFiber !== null) { + // Mark the parent fiber as incomplete and clear its effect list. + returnFiber.firstEffect = returnFiber.lastEffect = null; + returnFiber.effectTag |= Incomplete; + } + } + + var siblingFiber = workInProgress.sibling; + + if (siblingFiber !== null) { + // If there is more work to do in this returnFiber, do that next. + return siblingFiber; + } // Otherwise, return to the parent + + + workInProgress = returnFiber; + } while (workInProgress !== null); // We've reached the root. + + + if (workInProgressRootExitStatus === RootIncomplete) { + workInProgressRootExitStatus = RootCompleted; + } + + return null; +} + +function getRemainingExpirationTime(fiber) { + var updateExpirationTime = fiber.expirationTime; + var childExpirationTime = fiber.childExpirationTime; + return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime; +} + +function resetChildExpirationTime(completedWork) { + if (renderExpirationTime$1 !== Never && completedWork.childExpirationTime === Never) { + // The children of this component are hidden. Don't bubble their + // expiration times. + return; + } + + var newChildExpirationTime = NoWork; // Bubble up the earliest expiration time. + + if ( (completedWork.mode & ProfileMode) !== NoMode) { + // In profiling mode, resetChildExpirationTime is also used to reset + // profiler durations. + var actualDuration = completedWork.actualDuration; + var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will + // only be updated if work is done on the fiber (i.e. it doesn't bailout). + // When work is done, it should bubble to the parent's actualDuration. If + // the fiber has not been cloned though, (meaning no work was done), then + // this value will reflect the amount of time spent working on a previous + // render. In that case it should not bubble. We determine whether it was + // cloned by comparing the child pointer. + + var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child; + var child = completedWork.child; + + while (child !== null) { + var childUpdateExpirationTime = child.expirationTime; + var childChildExpirationTime = child.childExpirationTime; + + if (childUpdateExpirationTime > newChildExpirationTime) { + newChildExpirationTime = childUpdateExpirationTime; + } + + if (childChildExpirationTime > newChildExpirationTime) { + newChildExpirationTime = childChildExpirationTime; + } + + if (shouldBubbleActualDurations) { + actualDuration += child.actualDuration; + } + + treeBaseDuration += child.treeBaseDuration; + child = child.sibling; + } + + completedWork.actualDuration = actualDuration; + completedWork.treeBaseDuration = treeBaseDuration; + } else { + var _child = completedWork.child; + + while (_child !== null) { + var _childUpdateExpirationTime = _child.expirationTime; + var _childChildExpirationTime = _child.childExpirationTime; + + if (_childUpdateExpirationTime > newChildExpirationTime) { + newChildExpirationTime = _childUpdateExpirationTime; + } + + if (_childChildExpirationTime > newChildExpirationTime) { + newChildExpirationTime = _childChildExpirationTime; + } + + _child = _child.sibling; + } + } + + completedWork.childExpirationTime = newChildExpirationTime; +} + +function commitRoot(root) { + var renderPriorityLevel = getCurrentPriorityLevel(); + runWithPriority$1(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel)); + return null; +} + +function commitRootImpl(root, renderPriorityLevel) { + do { + // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which + // means `flushPassiveEffects` will sometimes result in additional + // passive effects. So we need to keep flushing in a loop until there are + // no more pending effects. + // TODO: Might be better if `flushPassiveEffects` did not automatically + // flush synchronous work at the end, to avoid factoring hazards like this. + flushPassiveEffects(); + } while (rootWithPendingPassiveEffects !== null); + + flushRenderPhaseStrictModeWarningsInDEV(); + + if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) { + { + throw Error( "Should not already be working." ); + } + } + + var finishedWork = root.finishedWork; + var expirationTime = root.finishedExpirationTime; + + if (finishedWork === null) { + return null; + } + + root.finishedWork = null; + root.finishedExpirationTime = NoWork; + + if (!(finishedWork !== root.current)) { + { + throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); + } + } // commitRoot never returns a continuation; it always finishes synchronously. + // So we can clear these now to allow a new callback to be scheduled. + + + root.callbackNode = null; + root.callbackExpirationTime = NoWork; + root.callbackPriority = NoPriority; + root.nextKnownPendingLevel = NoWork; + startCommitTimer(); // Update the first and last pending times on this root. The new first + // pending time is whatever is left on the root fiber. + + var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork); + markRootFinishedAtTime(root, expirationTime, remainingExpirationTimeBeforeCommit); + + if (root === workInProgressRoot) { + // We can reset these now that they are finished. + workInProgressRoot = null; + workInProgress = null; + renderExpirationTime$1 = NoWork; + } // This indicates that the last root we worked on is not the same one that + // we're committing now. This most commonly happens when a suspended root + // times out. + // Get the list of effects. + + + var firstEffect; + + if (finishedWork.effectTag > PerformedWork) { + // A fiber's effect list consists only of its children, not itself. So if + // the root has an effect, we need to add it to the end of the list. The + // resulting list is the set that would belong to the root's parent, if it + // had one; that is, all the effects in the tree including the root. + if (finishedWork.lastEffect !== null) { + finishedWork.lastEffect.nextEffect = finishedWork; + firstEffect = finishedWork.firstEffect; + } else { + firstEffect = finishedWork; + } + } else { + // There is no effect on the root. + firstEffect = finishedWork.firstEffect; + } + + if (firstEffect !== null) { + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles + + ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass + // of the effect list for each phase: all mutation effects come before all + // layout effects, and so on. + // The first phase a "before mutation" phase. We use this phase to read the + // state of the host tree right before we mutate it. This is where + // getSnapshotBeforeUpdate is called. + + startCommitSnapshotEffectsTimer(); + prepareForCommit(root.containerInfo); + nextEffect = firstEffect; + + do { + { + invokeGuardedCallback(null, commitBeforeMutationEffects, null); + + if (hasCaughtError()) { + if (!(nextEffect !== null)) { + { + throw Error( "Should be working on an effect." ); + } + } + + var error = clearCaughtError(); + captureCommitPhaseError(nextEffect, error); + nextEffect = nextEffect.nextEffect; + } + } + } while (nextEffect !== null); + + stopCommitSnapshotEffectsTimer(); + + { + // Mark the current commit time to be shared by all Profilers in this + // batch. This enables them to be grouped later. + recordCommitTime(); + } // The next phase is the mutation phase, where we mutate the host tree. + + + startCommitHostEffectsTimer(); + nextEffect = firstEffect; + + do { + { + invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel); + + if (hasCaughtError()) { + if (!(nextEffect !== null)) { + { + throw Error( "Should be working on an effect." ); + } + } + + var _error = clearCaughtError(); + + captureCommitPhaseError(nextEffect, _error); + nextEffect = nextEffect.nextEffect; + } + } + } while (nextEffect !== null); + + stopCommitHostEffectsTimer(); + resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after + // the mutation phase, so that the previous tree is still current during + // componentWillUnmount, but before the layout phase, so that the finished + // work is current during componentDidMount/Update. + + root.current = finishedWork; // The next phase is the layout phase, where we call effects that read + // the host tree after it's been mutated. The idiomatic use case for this is + // layout, but class component lifecycles also fire here for legacy reasons. + + startCommitLifeCyclesTimer(); + nextEffect = firstEffect; + + do { + { + invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime); + + if (hasCaughtError()) { + if (!(nextEffect !== null)) { + { + throw Error( "Should be working on an effect." ); + } + } + + var _error2 = clearCaughtError(); + + captureCommitPhaseError(nextEffect, _error2); + nextEffect = nextEffect.nextEffect; + } + } + } while (nextEffect !== null); + + stopCommitLifeCyclesTimer(); + nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an + // opportunity to paint. + + requestPaint(); + + { + popInteractions(prevInteractions); + } + + executionContext = prevExecutionContext; + } else { + // No effects. + root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were + // no effects. + // TODO: Maybe there's a better way to report this. + + startCommitSnapshotEffectsTimer(); + stopCommitSnapshotEffectsTimer(); + + { + recordCommitTime(); + } + + startCommitHostEffectsTimer(); + stopCommitHostEffectsTimer(); + startCommitLifeCyclesTimer(); + stopCommitLifeCyclesTimer(); + } + + stopCommitTimer(); + var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; + + if (rootDoesHavePassiveEffects) { + // This commit has passive effects. Stash a reference to them. But don't + // schedule a callback until after flushing layout work. + rootDoesHavePassiveEffects = false; + rootWithPendingPassiveEffects = root; + pendingPassiveEffectsExpirationTime = expirationTime; + pendingPassiveEffectsRenderPriority = renderPriorityLevel; + } else { + // We are done with the effect chain at this point so let's clear the + // nextEffect pointers to assist with GC. If we have passive effects, we'll + // clear this in flushPassiveEffects. + nextEffect = firstEffect; + + while (nextEffect !== null) { + var nextNextEffect = nextEffect.nextEffect; + nextEffect.nextEffect = null; + nextEffect = nextNextEffect; + } + } // Check if there's remaining work on this root + + + var remainingExpirationTime = root.firstPendingTime; + + if (remainingExpirationTime !== NoWork) { + { + if (spawnedWorkDuringRender !== null) { + var expirationTimes = spawnedWorkDuringRender; + spawnedWorkDuringRender = null; + + for (var i = 0; i < expirationTimes.length; i++) { + scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions); + } + } + + schedulePendingInteractions(root, remainingExpirationTime); + } + } else { + // If there's no remaining work, we can clear the set of already failed + // error boundaries. + legacyErrorBoundariesThatAlreadyFailed = null; + } + + { + if (!rootDidHavePassiveEffects) { + // If there are no passive effects, then we can complete the pending interactions. + // Otherwise, we'll wait until after the passive effects are flushed. + // Wait to do this until after remaining work has been scheduled, + // so that we don't prematurely signal complete for interactions when there's e.g. hidden work. + finishPendingInteractions(root, expirationTime); + } + } + + if (remainingExpirationTime === Sync) { + // Count the number of times the root synchronously re-renders without + // finishing. If there are too many, it indicates an infinite update loop. + if (root === rootWithNestedUpdates) { + nestedUpdateCount++; + } else { + nestedUpdateCount = 0; + rootWithNestedUpdates = root; + } + } else { + nestedUpdateCount = 0; + } + + onCommitRoot(finishedWork.stateNode, expirationTime); // Always call this before exiting `commitRoot`, to ensure that any + // additional work on this root is scheduled. + + ensureRootIsScheduled(root); + + if (hasUncaughtError) { + hasUncaughtError = false; + var _error3 = firstUncaughtError; + firstUncaughtError = null; + throw _error3; + } + + if ((executionContext & LegacyUnbatchedContext) !== NoContext) { + // This is a legacy edge case. We just committed the initial mount of + // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired + // synchronously, but layout updates should be deferred until the end + // of the batch. + return null; + } // If layout work was scheduled, flush it now. + + + flushSyncCallbackQueue(); + return null; +} + +function commitBeforeMutationEffects() { + while (nextEffect !== null) { + var effectTag = nextEffect.effectTag; + + if ((effectTag & Snapshot) !== NoEffect) { + setCurrentFiber(nextEffect); + recordEffect(); + var current = nextEffect.alternate; + commitBeforeMutationLifeCycles(current, nextEffect); + resetCurrentFiber(); + } + + if ((effectTag & Passive) !== NoEffect) { + // If there are passive effects, schedule a callback to flush at + // the earliest opportunity. + if (!rootDoesHavePassiveEffects) { + rootDoesHavePassiveEffects = true; + scheduleCallback(NormalPriority, function () { + flushPassiveEffects(); + return null; + }); + } + } + + nextEffect = nextEffect.nextEffect; + } +} + +function commitMutationEffects(root, renderPriorityLevel) { + // TODO: Should probably move the bulk of this function to commitWork. + while (nextEffect !== null) { + setCurrentFiber(nextEffect); + var effectTag = nextEffect.effectTag; + + if (effectTag & ContentReset) { + commitResetTextContent(nextEffect); + } + + if (effectTag & Ref) { + var current = nextEffect.alternate; + + if (current !== null) { + commitDetachRef(current); + } + } // The following switch statement is only concerned about placement, + // updates, and deletions. To avoid needing to add a case for every possible + // bitmap value, we remove the secondary effects from the effect tag and + // switch on that value. + + + var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating); + + switch (primaryEffectTag) { + case Placement: + { + commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is + // inserted, before any life-cycles like componentDidMount gets called. + // TODO: findDOMNode doesn't rely on this any more but isMounted does + // and isMounted is deprecated anyway so we should be able to kill this. + + nextEffect.effectTag &= ~Placement; + break; + } + + case PlacementAndUpdate: + { + // Placement + commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is + // inserted, before any life-cycles like componentDidMount gets called. + + nextEffect.effectTag &= ~Placement; // Update + + var _current = nextEffect.alternate; + commitWork(_current, nextEffect); + break; + } + + case Hydrating: + { + nextEffect.effectTag &= ~Hydrating; + break; + } + + case HydratingAndUpdate: + { + nextEffect.effectTag &= ~Hydrating; // Update + + var _current2 = nextEffect.alternate; + commitWork(_current2, nextEffect); + break; + } + + case Update: + { + var _current3 = nextEffect.alternate; + commitWork(_current3, nextEffect); + break; + } + + case Deletion: + { + commitDeletion(root, nextEffect, renderPriorityLevel); + break; + } + } // TODO: Only record a mutation effect if primaryEffectTag is non-zero. + + + recordEffect(); + resetCurrentFiber(); + nextEffect = nextEffect.nextEffect; + } +} + +function commitLayoutEffects(root, committedExpirationTime) { + // TODO: Should probably move the bulk of this function to commitWork. + while (nextEffect !== null) { + setCurrentFiber(nextEffect); + var effectTag = nextEffect.effectTag; + + if (effectTag & (Update | Callback)) { + recordEffect(); + var current = nextEffect.alternate; + commitLifeCycles(root, current, nextEffect); + } + + if (effectTag & Ref) { + recordEffect(); + commitAttachRef(nextEffect); + } + + resetCurrentFiber(); + nextEffect = nextEffect.nextEffect; + } +} + +function flushPassiveEffects() { + if (pendingPassiveEffectsRenderPriority !== NoPriority) { + var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority; + pendingPassiveEffectsRenderPriority = NoPriority; + return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl); + } +} + +function flushPassiveEffectsImpl() { + if (rootWithPendingPassiveEffects === null) { + return false; + } + + var root = rootWithPendingPassiveEffects; + var expirationTime = pendingPassiveEffectsExpirationTime; + rootWithPendingPassiveEffects = null; + pendingPassiveEffectsExpirationTime = NoWork; + + if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) { + { + throw Error( "Cannot flush passive effects while already rendering." ); + } + } + + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + var prevInteractions = pushInteractions(root); + + { + // Note: This currently assumes there are no passive effects on the root fiber + // because the root is not part of its own effect list. + // This could change in the future. + var _effect2 = root.current.firstEffect; + + while (_effect2 !== null) { + { + setCurrentFiber(_effect2); + invokeGuardedCallback(null, commitPassiveHookEffects, null, _effect2); + + if (hasCaughtError()) { + if (!(_effect2 !== null)) { + { + throw Error( "Should be working on an effect." ); + } + } + + var _error5 = clearCaughtError(); + + captureCommitPhaseError(_effect2, _error5); + } + + resetCurrentFiber(); + } + + var nextNextEffect = _effect2.nextEffect; // Remove nextEffect pointer to assist GC + + _effect2.nextEffect = null; + _effect2 = nextNextEffect; + } + } + + { + popInteractions(prevInteractions); + finishPendingInteractions(root, expirationTime); + } + + executionContext = prevExecutionContext; + flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this + // exceeds the limit, we'll fire a warning. + + nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1; + return true; +} + +function isAlreadyFailedLegacyErrorBoundary(instance) { + return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance); +} +function markLegacyErrorBoundaryAsFailed(instance) { + if (legacyErrorBoundariesThatAlreadyFailed === null) { + legacyErrorBoundariesThatAlreadyFailed = new Set([instance]); + } else { + legacyErrorBoundariesThatAlreadyFailed.add(instance); + } +} + +function prepareToThrowUncaughtError(error) { + if (!hasUncaughtError) { + hasUncaughtError = true; + firstUncaughtError = error; + } +} + +var onUncaughtError = prepareToThrowUncaughtError; + +function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + var errorInfo = createCapturedValue(error, sourceFiber); + var update = createRootErrorUpdate(rootFiber, errorInfo, Sync); + enqueueUpdate(rootFiber, update); + var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync); + + if (root !== null) { + ensureRootIsScheduled(root); + schedulePendingInteractions(root, Sync); + } +} + +function captureCommitPhaseError(sourceFiber, error) { + if (sourceFiber.tag === HostRoot) { + // Error was thrown at the root. There is no parent, so the root + // itself should capture it. + captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error); + return; + } + + var fiber = sourceFiber.return; + + while (fiber !== null) { + if (fiber.tag === HostRoot) { + captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error); + return; + } else if (fiber.tag === ClassComponent) { + var ctor = fiber.type; + var instance = fiber.stateNode; + + if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) { + var errorInfo = createCapturedValue(error, sourceFiber); + var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync + Sync); + enqueueUpdate(fiber, update); + var root = markUpdateTimeFromFiberToRoot(fiber, Sync); + + if (root !== null) { + ensureRootIsScheduled(root); + schedulePendingInteractions(root, Sync); + } + + return; + } + } + + fiber = fiber.return; + } +} +function pingSuspendedRoot(root, thenable, suspendedTime) { + var pingCache = root.pingCache; + + if (pingCache !== null) { + // The thenable resolved, so we no longer need to memoize, because it will + // never be thrown again. + pingCache.delete(thenable); + } + + if (workInProgressRoot === root && renderExpirationTime$1 === suspendedTime) { + // Received a ping at the same priority level at which we're currently + // rendering. We might want to restart this render. This should mirror + // the logic of whether or not a root suspends once it completes. + // TODO: If we're rendering sync either due to Sync, Batched or expired, + // we should probably never restart. + // If we're suspended with delay, we'll always suspend so we can always + // restart. If we're suspended without any updates, it might be a retry. + // If it's early in the retry we can restart. We can't know for sure + // whether we'll eventually process an update during this render pass, + // but it's somewhat unlikely that we get to a ping before that, since + // getting to the root most update is usually very fast. + if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) { + // Restart from the root. Don't need to schedule a ping because + // we're already working on this tree. + prepareFreshStack(root, renderExpirationTime$1); + } else { + // Even though we can't restart right now, we might get an + // opportunity later. So we mark this render as having a ping. + workInProgressRootHasPendingPing = true; + } + + return; + } + + if (!isRootSuspendedAtTime(root, suspendedTime)) { + // The root is no longer suspended at this time. + return; + } + + var lastPingedTime = root.lastPingedTime; + + if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) { + // There's already a lower priority ping scheduled. + return; + } // Mark the time at which this ping was scheduled. + + + root.lastPingedTime = suspendedTime; + + ensureRootIsScheduled(root); + schedulePendingInteractions(root, suspendedTime); +} + +function retryTimedOutBoundary(boundaryFiber, retryTime) { + // The boundary fiber (a Suspense component or SuspenseList component) + // previously was rendered in its fallback state. One of the promises that + // suspended it has resolved, which means at least part of the tree was + // likely unblocked. Try rendering again, at a new expiration time. + if (retryTime === NoWork) { + var suspenseConfig = null; // Retries don't carry over the already committed update. + + var currentTime = requestCurrentTimeForUpdate(); + retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig); + } // TODO: Special case idle priority? + + + var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime); + + if (root !== null) { + ensureRootIsScheduled(root); + schedulePendingInteractions(root, retryTime); + } +} +function resolveRetryThenable(boundaryFiber, thenable) { + var retryTime = NoWork; // Default + + var retryCache; + + { + retryCache = boundaryFiber.stateNode; + } + + if (retryCache !== null) { + // The thenable resolved, so we no longer need to memoize, because it will + // never be thrown again. + retryCache.delete(thenable); + } + + retryTimedOutBoundary(boundaryFiber, retryTime); +} // Computes the next Just Noticeable Difference (JND) boundary. +// The theory is that a person can't tell the difference between small differences in time. +// Therefore, if we wait a bit longer than necessary that won't translate to a noticeable +// difference in the experience. However, waiting for longer might mean that we can avoid +// showing an intermediate loading state. The longer we have already waited, the harder it +// is to tell small differences in time. Therefore, the longer we've already waited, +// the longer we can wait additionally. At some point we have to give up though. +// We pick a train model where the next boundary commits at a consistent schedule. +// These particular numbers are vague estimates. We expect to adjust them based on research. + +function jnd(timeElapsed) { + return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960; +} + +function computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) { + var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0; + + if (busyMinDurationMs <= 0) { + return 0; + } + + var busyDelayMs = suspenseConfig.busyDelayMs | 0; // Compute the time until this render pass would expire. + + var currentTimeMs = now(); + var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig); + var timeElapsed = currentTimeMs - eventTimeMs; + + if (timeElapsed <= busyDelayMs) { + // If we haven't yet waited longer than the initial delay, we don't + // have to wait any additional time. + return 0; + } + + var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed; // This is the value that is passed to `setTimeout`. + + return msUntilTimeout; +} + +function checkForNestedUpdates() { + if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { + nestedUpdateCount = 0; + rootWithNestedUpdates = null; + + { + { + throw Error( "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops." ); + } + } + } + + { + if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) { + nestedPassiveUpdateCount = 0; + + error('Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.'); + } + } +} + +function flushRenderPhaseStrictModeWarningsInDEV() { + { + ReactStrictModeWarnings.flushLegacyContextWarning(); + + { + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + } + } +} + +function stopFinishedWorkLoopTimer() { + var didCompleteRoot = true; + stopWorkLoopTimer(interruptedBy, didCompleteRoot); + interruptedBy = null; +} + +function stopInterruptedWorkLoopTimer() { + // TODO: Track which fiber caused the interruption. + var didCompleteRoot = false; + stopWorkLoopTimer(interruptedBy, didCompleteRoot); + interruptedBy = null; +} + +function checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) { + if ( workInProgressRoot !== null && updateExpirationTime > renderExpirationTime$1) { + interruptedBy = fiberThatReceivedUpdate; + } +} + +var didWarnStateUpdateForUnmountedComponent = null; + +function warnAboutUpdateOnUnmountedFiberInDEV(fiber) { + { + var tag = fiber.tag; + + if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) { + // Only warn for user-defined components, not internal ones like Suspense. + return; + } + // the problematic code almost always lies inside that component. + + + var componentName = getComponentName(fiber.type) || 'ReactComponent'; + + if (didWarnStateUpdateForUnmountedComponent !== null) { + if (didWarnStateUpdateForUnmountedComponent.has(componentName)) { + return; + } + + didWarnStateUpdateForUnmountedComponent.add(componentName); + } else { + didWarnStateUpdateForUnmountedComponent = new Set([componentName]); + } + + error("Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber)); + } +} + +var beginWork$1; + +{ + var dummyFiber = null; + + beginWork$1 = function (current, unitOfWork, expirationTime) { + // If a component throws an error, we replay it again in a synchronously + // dispatched event, so that the debugger will treat it as an uncaught + // error See ReactErrorUtils for more information. + // Before entering the begin phase, copy the work-in-progress onto a dummy + // fiber. If beginWork throws, we'll use this to reset the state. + var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork); + + try { + return beginWork(current, unitOfWork, expirationTime); + } catch (originalError) { + if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') { + // Don't replay promises. Treat everything else like an error. + throw originalError; + } // Keep this code in sync with handleError; any changes here must have + // corresponding changes there. + + + resetContextDependencies(); + resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the + // same fiber again. + // Unwind the failed stack frame + + unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber. + + assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); + + if ( unitOfWork.mode & ProfileMode) { + // Reset the profiler timer. + startProfilerTimer(unitOfWork); + } // Run beginWork again. + + + invokeGuardedCallback(null, beginWork, null, current, unitOfWork, expirationTime); + + if (hasCaughtError()) { + var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`. + // Rethrow this error instead of the original one. + + throw replayError; + } else { + // This branch is reachable if the render phase is impure. + throw originalError; + } + } + }; +} + +var didWarnAboutUpdateInRender = false; +var didWarnAboutUpdateInRenderForAnotherComponent; + +{ + didWarnAboutUpdateInRenderForAnotherComponent = new Set(); +} + +function warnAboutRenderPhaseUpdatesInDEV(fiber) { + { + if (isRendering && (executionContext & RenderContext) !== NoContext) { + switch (fiber.tag) { + case FunctionComponent: + case ForwardRef: + case SimpleMemoComponent: + { + var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed. + + var dedupeKey = renderingComponentName; + + if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) { + didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey); + var setStateComponentName = getComponentName(fiber.type) || 'Unknown'; + + error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://fb.me/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName); + } + + break; + } + + case ClassComponent: + { + if (!didWarnAboutUpdateInRender) { + error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.'); + + didWarnAboutUpdateInRender = true; + } + + break; + } + } + } + } +} // a 'shared' variable that changes when act() opens/closes in tests. + + +var IsThisRendererActing = { + current: false +}; +function warnIfNotScopedWithMatchingAct(fiber) { + { + if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) { + error("It looks like you're using the wrong act() around your test interactions.\n" + 'Be sure to use the matching version of act() corresponding to your renderer:\n\n' + '// for react-dom:\n' + "import {act} from 'react-dom/test-utils';\n" + '// ...\n' + 'act(() => ...);\n\n' + '// for react-test-renderer:\n' + "import TestRenderer from 'react-test-renderer';\n" + 'const {act} = TestRenderer;\n' + '// ...\n' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber)); + } + } +} +function warnIfNotCurrentlyActingEffectsInDEV(fiber) { + { + if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) { + error('An update to %s ran an effect, but was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber)); + } + } +} + +function warnIfNotCurrentlyActingUpdatesInDEV(fiber) { + { + if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) { + error('An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber)); + } + } +} + +var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler. + +var didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked +// scheduler is the actual recommendation. The alternative could be a testing build, +// a new lib, or whatever; we dunno just yet. This message is for early adopters +// to get their tests right. + +function warnIfUnmockedScheduler(fiber) { + { + if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) { + if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) { + didWarnAboutUnmockedScheduler = true; + + error('In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler'); + } + } + } +} + +function computeThreadID(root, expirationTime) { + // Interaction threads are unique per root and expiration time. + return expirationTime * 1000 + root.interactionThreadID; +} + +function markSpawnedWork(expirationTime) { + + if (spawnedWorkDuringRender === null) { + spawnedWorkDuringRender = [expirationTime]; + } else { + spawnedWorkDuringRender.push(expirationTime); + } +} + +function scheduleInteractions(root, expirationTime, interactions) { + + if (interactions.size > 0) { + var pendingInteractionMap = root.pendingInteractionMap; + var pendingInteractions = pendingInteractionMap.get(expirationTime); + + if (pendingInteractions != null) { + interactions.forEach(function (interaction) { + if (!pendingInteractions.has(interaction)) { + // Update the pending async work count for previously unscheduled interaction. + interaction.__count++; + } + + pendingInteractions.add(interaction); + }); + } else { + pendingInteractionMap.set(expirationTime, new Set(interactions)); // Update the pending async work count for the current interactions. + + interactions.forEach(function (interaction) { + interaction.__count++; + }); + } + + var subscriber = tracing.__subscriberRef.current; + + if (subscriber !== null) { + var threadID = computeThreadID(root, expirationTime); + subscriber.onWorkScheduled(interactions, threadID); + } + } +} + +function schedulePendingInteractions(root, expirationTime) { + + scheduleInteractions(root, expirationTime, tracing.__interactionsRef.current); +} + +function startWorkOnPendingInteractions(root, expirationTime) { + // we can accurately attribute time spent working on it, And so that cascading + // work triggered during the render phase will be associated with it. + + + var interactions = new Set(); + root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) { + if (scheduledExpirationTime >= expirationTime) { + scheduledInteractions.forEach(function (interaction) { + return interactions.add(interaction); + }); + } + }); // Store the current set of interactions on the FiberRoot for a few reasons: + // We can re-use it in hot functions like performConcurrentWorkOnRoot() + // without having to recalculate it. We will also use it in commitWork() to + // pass to any Profiler onRender() hooks. This also provides DevTools with a + // way to access it when the onCommitRoot() hook is called. + + root.memoizedInteractions = interactions; + + if (interactions.size > 0) { + var subscriber = tracing.__subscriberRef.current; + + if (subscriber !== null) { + var threadID = computeThreadID(root, expirationTime); + + try { + subscriber.onWorkStarted(interactions, threadID); + } catch (error) { + // If the subscriber throws, rethrow it in a separate task + scheduleCallback(ImmediatePriority, function () { + throw error; + }); + } + } + } +} + +function finishPendingInteractions(root, committedExpirationTime) { + + var earliestRemainingTimeAfterCommit = root.firstPendingTime; + var subscriber; + + try { + subscriber = tracing.__subscriberRef.current; + + if (subscriber !== null && root.memoizedInteractions.size > 0) { + var threadID = computeThreadID(root, committedExpirationTime); + subscriber.onWorkStopped(root.memoizedInteractions, threadID); + } + } catch (error) { + // If the subscriber throws, rethrow it in a separate task + scheduleCallback(ImmediatePriority, function () { + throw error; + }); + } finally { + // Clear completed interactions from the pending Map. + // Unless the render was suspended or cascading work was scheduled, + // In which case– leave pending interactions until the subsequent render. + var pendingInteractionMap = root.pendingInteractionMap; + pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) { + // Only decrement the pending interaction count if we're done. + // If there's still work at the current priority, + // That indicates that we are waiting for suspense data. + if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) { + pendingInteractionMap.delete(scheduledExpirationTime); + scheduledInteractions.forEach(function (interaction) { + interaction.__count--; + + if (subscriber !== null && interaction.__count === 0) { + try { + subscriber.onInteractionScheduledWorkCompleted(interaction); + } catch (error) { + // If the subscriber throws, rethrow it in a separate task + scheduleCallback(ImmediatePriority, function () { + throw error; + }); + } + } + }); + } + }); + } +} + +var onScheduleFiberRoot = null; +var onCommitFiberRoot = null; +var onCommitFiberUnmount = null; +var hasLoggedError = false; +var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined'; +function injectInternals(internals) { + if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { + // No DevTools + return false; + } + + var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; + + if (hook.isDisabled) { + // This isn't a real property on the hook, but it can be set to opt out + // of DevTools integration and associated warnings and logs. + // https://github.com/facebook/react/issues/3877 + return true; + } + + if (!hook.supportsFiber) { + { + error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools'); + } // DevTools exists, even though it doesn't support Fiber. + + + return true; + } + + try { + var rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. + + if (true) { + // Only used by Fast Refresh + if (typeof hook.onScheduleFiberRoot === 'function') { + onScheduleFiberRoot = function (root, children) { + try { + hook.onScheduleFiberRoot(rendererID, root, children); + } catch (err) { + if ( true && !hasLoggedError) { + hasLoggedError = true; + + error('React instrumentation encountered an error: %s', err); + } + } + }; + } + } + + onCommitFiberRoot = function (root, expirationTime) { + try { + var didError = (root.current.effectTag & DidCapture) === DidCapture; + + if (enableProfilerTimer) { + var currentTime = getCurrentTime(); + var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); + hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError); + } else { + hook.onCommitFiberRoot(rendererID, root, undefined, didError); + } + } catch (err) { + if (true) { + if (!hasLoggedError) { + hasLoggedError = true; + + error('React instrumentation encountered an error: %s', err); + } + } + } + }; + + onCommitFiberUnmount = function (fiber) { + try { + hook.onCommitFiberUnmount(rendererID, fiber); + } catch (err) { + if (true) { + if (!hasLoggedError) { + hasLoggedError = true; + + error('React instrumentation encountered an error: %s', err); + } + } + } + }; + } catch (err) { + // Catch all errors because it is unsafe to throw during initialization. + { + error('React instrumentation encountered an error: %s.', err); + } + } // DevTools exists + + + return true; +} +function onScheduleRoot(root, children) { + if (typeof onScheduleFiberRoot === 'function') { + onScheduleFiberRoot(root, children); + } +} +function onCommitRoot(root, expirationTime) { + if (typeof onCommitFiberRoot === 'function') { + onCommitFiberRoot(root, expirationTime); + } +} +function onCommitUnmount(fiber) { + if (typeof onCommitFiberUnmount === 'function') { + onCommitFiberUnmount(fiber); + } +} + +var hasBadMapPolyfill; + +{ + hasBadMapPolyfill = false; + + try { + var nonExtensibleObject = Object.preventExtensions({}); + var testMap = new Map([[nonExtensibleObject, null]]); + var testSet = new Set([nonExtensibleObject]); // This is necessary for Rollup to not consider these unused. + // https://github.com/rollup/rollup/issues/1771 + // TODO: we can remove these if Rollup fixes the bug. + + testMap.set(0, 0); + testSet.add(0); + } catch (e) { + // TODO: Consider warning about bad polyfills + hasBadMapPolyfill = true; + } +} + +var debugCounter = 1; + +function FiberNode(tag, pendingProps, key, mode) { + // Instance + this.tag = tag; + this.key = key; + this.elementType = null; + this.type = null; + this.stateNode = null; // Fiber + + this.return = null; + this.child = null; + this.sibling = null; + this.index = 0; + this.ref = null; + this.pendingProps = pendingProps; + this.memoizedProps = null; + this.updateQueue = null; + this.memoizedState = null; + this.dependencies = null; + this.mode = mode; // Effects + + this.effectTag = NoEffect; + this.nextEffect = null; + this.firstEffect = null; + this.lastEffect = null; + this.expirationTime = NoWork; + this.childExpirationTime = NoWork; + this.alternate = null; + + { + // Note: The following is done to avoid a v8 performance cliff. + // + // Initializing the fields below to smis and later updating them with + // double values will cause Fibers to end up having separate shapes. + // This behavior/bug has something to do with Object.preventExtension(). + // Fortunately this only impacts DEV builds. + // Unfortunately it makes React unusably slow for some applications. + // To work around this, initialize the fields below with doubles. + // + // Learn more about this here: + // https://github.com/facebook/react/issues/14365 + // https://bugs.chromium.org/p/v8/issues/detail?id=8538 + this.actualDuration = Number.NaN; + this.actualStartTime = Number.NaN; + this.selfBaseDuration = Number.NaN; + this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization. + // This won't trigger the performance cliff mentioned above, + // and it simplifies other profiler code (including DevTools). + + this.actualDuration = 0; + this.actualStartTime = -1; + this.selfBaseDuration = 0; + this.treeBaseDuration = 0; + } // This is normally DEV-only except www when it adds listeners. + // TODO: remove the User Timing integration in favor of Root Events. + + + { + this._debugID = debugCounter++; + this._debugIsCurrentlyTiming = false; + } + + { + this._debugSource = null; + this._debugOwner = null; + this._debugNeedsRemount = false; + this._debugHookTypes = null; + + if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') { + Object.preventExtensions(this); + } + } +} // This is a constructor function, rather than a POJO constructor, still +// please ensure we do the following: +// 1) Nobody should add any instance methods on this. Instance methods can be +// more difficult to predict when they get optimized and they are almost +// never inlined properly in static compilers. +// 2) Nobody should rely on `instanceof Fiber` for type testing. We should +// always know when it is a fiber. +// 3) We might want to experiment with using numeric keys since they are easier +// to optimize in a non-JIT environment. +// 4) We can easily go from a constructor to a createFiber object literal if that +// is faster. +// 5) It should be easy to port this to a C struct and keep a C implementation +// compatible. + + +var createFiber = function (tag, pendingProps, key, mode) { + // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors + return new FiberNode(tag, pendingProps, key, mode); +}; + +function shouldConstruct(Component) { + var prototype = Component.prototype; + return !!(prototype && prototype.isReactComponent); +} + +function isSimpleFunctionComponent(type) { + return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined; +} +function resolveLazyComponentTag(Component) { + if (typeof Component === 'function') { + return shouldConstruct(Component) ? ClassComponent : FunctionComponent; + } else if (Component !== undefined && Component !== null) { + var $$typeof = Component.$$typeof; + + if ($$typeof === REACT_FORWARD_REF_TYPE) { + return ForwardRef; + } + + if ($$typeof === REACT_MEMO_TYPE) { + return MemoComponent; + } + } + + return IndeterminateComponent; +} // This is used to create an alternate fiber to do work on. + +function createWorkInProgress(current, pendingProps) { + var workInProgress = current.alternate; + + if (workInProgress === null) { + // We use a double buffering pooling technique because we know that we'll + // only ever need at most two versions of a tree. We pool the "other" unused + // node that we're free to reuse. This is lazily created to avoid allocating + // extra objects for things that are never updated. It also allow us to + // reclaim the extra memory if needed. + workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode); + workInProgress.elementType = current.elementType; + workInProgress.type = current.type; + workInProgress.stateNode = current.stateNode; + + { + // DEV-only fields + { + workInProgress._debugID = current._debugID; + } + + workInProgress._debugSource = current._debugSource; + workInProgress._debugOwner = current._debugOwner; + workInProgress._debugHookTypes = current._debugHookTypes; + } + + workInProgress.alternate = current; + current.alternate = workInProgress; + } else { + workInProgress.pendingProps = pendingProps; // We already have an alternate. + // Reset the effect tag. + + workInProgress.effectTag = NoEffect; // The effect list is no longer valid. + + workInProgress.nextEffect = null; + workInProgress.firstEffect = null; + workInProgress.lastEffect = null; + + { + // We intentionally reset, rather than copy, actualDuration & actualStartTime. + // This prevents time from endlessly accumulating in new commits. + // This has the downside of resetting values for different priority renders, + // But works for yielding (the common case) and should support resuming. + workInProgress.actualDuration = 0; + workInProgress.actualStartTime = -1; + } + } + + workInProgress.childExpirationTime = current.childExpirationTime; + workInProgress.expirationTime = current.expirationTime; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so + // it cannot be shared with the current fiber. + + var currentDependencies = current.dependencies; + workInProgress.dependencies = currentDependencies === null ? null : { + expirationTime: currentDependencies.expirationTime, + firstContext: currentDependencies.firstContext, + responders: currentDependencies.responders + }; // These will be overridden during the parent's reconciliation + + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + + { + workInProgress.selfBaseDuration = current.selfBaseDuration; + workInProgress.treeBaseDuration = current.treeBaseDuration; + } + + { + workInProgress._debugNeedsRemount = current._debugNeedsRemount; + + switch (workInProgress.tag) { + case IndeterminateComponent: + case FunctionComponent: + case SimpleMemoComponent: + workInProgress.type = resolveFunctionForHotReloading(current.type); + break; + + case ClassComponent: + workInProgress.type = resolveClassForHotReloading(current.type); + break; + + case ForwardRef: + workInProgress.type = resolveForwardRefForHotReloading(current.type); + break; + } + } + + return workInProgress; +} // Used to reuse a Fiber for a second pass. + +function resetWorkInProgress(workInProgress, renderExpirationTime) { + // This resets the Fiber to what createFiber or createWorkInProgress would + // have set the values to before during the first pass. Ideally this wouldn't + // be necessary but unfortunately many code paths reads from the workInProgress + // when they should be reading from current and writing to workInProgress. + // We assume pendingProps, index, key, ref, return are still untouched to + // avoid doing another reconciliation. + // Reset the effect tag but keep any Placement tags, since that's something + // that child fiber is setting, not the reconciliation. + workInProgress.effectTag &= Placement; // The effect list is no longer valid. + + workInProgress.nextEffect = null; + workInProgress.firstEffect = null; + workInProgress.lastEffect = null; + var current = workInProgress.alternate; + + if (current === null) { + // Reset to createFiber's initial values. + workInProgress.childExpirationTime = NoWork; + workInProgress.expirationTime = renderExpirationTime; + workInProgress.child = null; + workInProgress.memoizedProps = null; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.dependencies = null; + + { + // Note: We don't reset the actualTime counts. It's useful to accumulate + // actual time across multiple render passes. + workInProgress.selfBaseDuration = 0; + workInProgress.treeBaseDuration = 0; + } + } else { + // Reset to the cloned values that createWorkInProgress would've. + workInProgress.childExpirationTime = current.childExpirationTime; + workInProgress.expirationTime = current.expirationTime; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so + // it cannot be shared with the current fiber. + + var currentDependencies = current.dependencies; + workInProgress.dependencies = currentDependencies === null ? null : { + expirationTime: currentDependencies.expirationTime, + firstContext: currentDependencies.firstContext, + responders: currentDependencies.responders + }; + + { + // Note: We don't reset the actualTime counts. It's useful to accumulate + // actual time across multiple render passes. + workInProgress.selfBaseDuration = current.selfBaseDuration; + workInProgress.treeBaseDuration = current.treeBaseDuration; + } + } + + return workInProgress; +} +function createHostRootFiber(tag) { + var mode; + + if (tag === ConcurrentRoot) { + mode = ConcurrentMode | BlockingMode | StrictMode; + } else if (tag === BlockingRoot) { + mode = BlockingMode | StrictMode; + } else { + mode = NoMode; + } + + if ( isDevToolsPresent) { + // Always collect profile timings when DevTools are present. + // This enables DevTools to start capturing timing at any point– + // Without some nodes in the tree having empty base times. + mode |= ProfileMode; + } + + return createFiber(HostRoot, null, null, mode); +} +function createFiberFromTypeAndProps(type, // React$ElementType +key, pendingProps, owner, mode, expirationTime) { + var fiber; + var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. + + var resolvedType = type; + + if (typeof type === 'function') { + if (shouldConstruct(type)) { + fiberTag = ClassComponent; + + { + resolvedType = resolveClassForHotReloading(resolvedType); + } + } else { + { + resolvedType = resolveFunctionForHotReloading(resolvedType); + } + } + } else if (typeof type === 'string') { + fiberTag = HostComponent; + } else { + getTag: switch (type) { + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment(pendingProps.children, mode, expirationTime, key); + + case REACT_CONCURRENT_MODE_TYPE: + fiberTag = Mode; + mode |= ConcurrentMode | BlockingMode | StrictMode; + break; + + case REACT_STRICT_MODE_TYPE: + fiberTag = Mode; + mode |= StrictMode; + break; + + case REACT_PROFILER_TYPE: + return createFiberFromProfiler(pendingProps, mode, expirationTime, key); + + case REACT_SUSPENSE_TYPE: + return createFiberFromSuspense(pendingProps, mode, expirationTime, key); + + case REACT_SUSPENSE_LIST_TYPE: + return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key); + + default: + { + if (typeof type === 'object' && type !== null) { + switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + fiberTag = ContextProvider; + break getTag; + + case REACT_CONTEXT_TYPE: + // This is a consumer + fiberTag = ContextConsumer; + break getTag; + + case REACT_FORWARD_REF_TYPE: + fiberTag = ForwardRef; + + { + resolvedType = resolveForwardRefForHotReloading(resolvedType); + } + + break getTag; + + case REACT_MEMO_TYPE: + fiberTag = MemoComponent; + break getTag; + + case REACT_LAZY_TYPE: + fiberTag = LazyComponent; + resolvedType = null; + break getTag; + + case REACT_BLOCK_TYPE: + fiberTag = Block; + break getTag; + + } + } + + 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 ownerName = owner ? getComponentName(owner.type) : null; + + if (ownerName) { + info += '\n\nCheck the render method of `' + ownerName + '`.'; + } + } + + { + { + throw Error( "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info ); + } + } + } + } + } + + fiber = createFiber(fiberTag, pendingProps, key, mode); + fiber.elementType = type; + fiber.type = resolvedType; + fiber.expirationTime = expirationTime; + return fiber; +} +function createFiberFromElement(element, mode, expirationTime) { + var owner = null; + + { + owner = element._owner; + } + + var type = element.type; + var key = element.key; + var pendingProps = element.props; + var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime); + + { + fiber._debugSource = element._source; + fiber._debugOwner = element._owner; + } + + return fiber; +} +function createFiberFromFragment(elements, mode, expirationTime, key) { + var fiber = createFiber(Fragment, elements, key, mode); + fiber.expirationTime = expirationTime; + return fiber; +} + +function createFiberFromProfiler(pendingProps, mode, expirationTime, key) { + { + if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') { + error('Profiler must specify an "id" string and "onRender" function as props'); + } + } + + var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag. + + fiber.elementType = REACT_PROFILER_TYPE; + fiber.type = REACT_PROFILER_TYPE; + fiber.expirationTime = expirationTime; + return fiber; +} + +function createFiberFromSuspense(pendingProps, mode, expirationTime, key) { + var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag. + // This needs to be fixed in getComponentName so that it relies on the tag + // instead. + + fiber.type = REACT_SUSPENSE_TYPE; + fiber.elementType = REACT_SUSPENSE_TYPE; + fiber.expirationTime = expirationTime; + return fiber; +} +function createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) { + var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode); + + { + // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag. + // This needs to be fixed in getComponentName so that it relies on the tag + // instead. + fiber.type = REACT_SUSPENSE_LIST_TYPE; + } + + fiber.elementType = REACT_SUSPENSE_LIST_TYPE; + fiber.expirationTime = expirationTime; + return fiber; +} +function createFiberFromText(content, mode, expirationTime) { + var fiber = createFiber(HostText, content, null, mode); + fiber.expirationTime = expirationTime; + return fiber; +} +function createFiberFromHostInstanceForDeletion() { + var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type. + + fiber.elementType = 'DELETED'; + fiber.type = 'DELETED'; + return fiber; +} +function createFiberFromPortal(portal, mode, expirationTime) { + var pendingProps = portal.children !== null ? portal.children : []; + var fiber = createFiber(HostPortal, pendingProps, portal.key, mode); + fiber.expirationTime = expirationTime; + fiber.stateNode = { + containerInfo: portal.containerInfo, + pendingChildren: null, + // Used by persistent updates + implementation: portal.implementation + }; + return fiber; +} // Used for stashing WIP properties to replay failed work in DEV. + +function assignFiberPropertiesInDEV(target, source) { + if (target === null) { + // This Fiber's initial properties will always be overwritten. + // We only use a Fiber to ensure the same hidden class so DEV isn't slow. + target = createFiber(IndeterminateComponent, null, null, NoMode); + } // This is intentionally written as a list of all properties. + // We tried to use Object.assign() instead but this is called in + // the hottest path, and Object.assign() was too slow: + // https://github.com/facebook/react/issues/12502 + // This code is DEV-only so size is not a concern. + + + target.tag = source.tag; + target.key = source.key; + target.elementType = source.elementType; + target.type = source.type; + target.stateNode = source.stateNode; + target.return = source.return; + target.child = source.child; + target.sibling = source.sibling; + target.index = source.index; + target.ref = source.ref; + target.pendingProps = source.pendingProps; + target.memoizedProps = source.memoizedProps; + target.updateQueue = source.updateQueue; + target.memoizedState = source.memoizedState; + target.dependencies = source.dependencies; + target.mode = source.mode; + target.effectTag = source.effectTag; + target.nextEffect = source.nextEffect; + target.firstEffect = source.firstEffect; + target.lastEffect = source.lastEffect; + target.expirationTime = source.expirationTime; + target.childExpirationTime = source.childExpirationTime; + target.alternate = source.alternate; + + { + target.actualDuration = source.actualDuration; + target.actualStartTime = source.actualStartTime; + target.selfBaseDuration = source.selfBaseDuration; + target.treeBaseDuration = source.treeBaseDuration; + } + + { + target._debugID = source._debugID; + } + + target._debugSource = source._debugSource; + target._debugOwner = source._debugOwner; + target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming; + target._debugNeedsRemount = source._debugNeedsRemount; + target._debugHookTypes = source._debugHookTypes; + return target; +} + +function FiberRootNode(containerInfo, tag, hydrate) { + this.tag = tag; + this.current = null; + this.containerInfo = containerInfo; + this.pendingChildren = null; + this.pingCache = null; + this.finishedExpirationTime = NoWork; + this.finishedWork = null; + this.timeoutHandle = noTimeout; + this.context = null; + this.pendingContext = null; + this.hydrate = hydrate; + this.callbackNode = null; + this.callbackPriority = NoPriority; + this.firstPendingTime = NoWork; + this.firstSuspendedTime = NoWork; + this.lastSuspendedTime = NoWork; + this.nextKnownPendingLevel = NoWork; + this.lastPingedTime = NoWork; + this.lastExpiredTime = NoWork; + + { + this.interactionThreadID = tracing.unstable_getThreadID(); + this.memoizedInteractions = new Set(); + this.pendingInteractionMap = new Map(); + } +} + +function createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) { + var root = new FiberRootNode(containerInfo, tag, hydrate); + // stateNode is any. + + + var uninitializedFiber = createHostRootFiber(tag); + root.current = uninitializedFiber; + uninitializedFiber.stateNode = root; + initializeUpdateQueue(uninitializedFiber); + return root; +} +function isRootSuspendedAtTime(root, expirationTime) { + var firstSuspendedTime = root.firstSuspendedTime; + var lastSuspendedTime = root.lastSuspendedTime; + return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime; +} +function markRootSuspendedAtTime(root, expirationTime) { + var firstSuspendedTime = root.firstSuspendedTime; + var lastSuspendedTime = root.lastSuspendedTime; + + if (firstSuspendedTime < expirationTime) { + root.firstSuspendedTime = expirationTime; + } + + if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) { + root.lastSuspendedTime = expirationTime; + } + + if (expirationTime <= root.lastPingedTime) { + root.lastPingedTime = NoWork; + } + + if (expirationTime <= root.lastExpiredTime) { + root.lastExpiredTime = NoWork; + } +} +function markRootUpdatedAtTime(root, expirationTime) { + // Update the range of pending times + var firstPendingTime = root.firstPendingTime; + + if (expirationTime > firstPendingTime) { + root.firstPendingTime = expirationTime; + } // Update the range of suspended times. Treat everything lower priority or + // equal to this update as unsuspended. + + + var firstSuspendedTime = root.firstSuspendedTime; + + if (firstSuspendedTime !== NoWork) { + if (expirationTime >= firstSuspendedTime) { + // The entire suspended range is now unsuspended. + root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork; + } else if (expirationTime >= root.lastSuspendedTime) { + root.lastSuspendedTime = expirationTime + 1; + } // This is a pending level. Check if it's higher priority than the next + // known pending level. + + + if (expirationTime > root.nextKnownPendingLevel) { + root.nextKnownPendingLevel = expirationTime; + } + } +} +function markRootFinishedAtTime(root, finishedExpirationTime, remainingExpirationTime) { + // Update the range of pending times + root.firstPendingTime = remainingExpirationTime; // Update the range of suspended times. Treat everything higher priority or + // equal to this update as unsuspended. + + if (finishedExpirationTime <= root.lastSuspendedTime) { + // The entire suspended range is now unsuspended. + root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork; + } else if (finishedExpirationTime <= root.firstSuspendedTime) { + // Part of the suspended range is now unsuspended. Narrow the range to + // include everything between the unsuspended time (non-inclusive) and the + // last suspended time. + root.firstSuspendedTime = finishedExpirationTime - 1; + } + + if (finishedExpirationTime <= root.lastPingedTime) { + // Clear the pinged time + root.lastPingedTime = NoWork; + } + + if (finishedExpirationTime <= root.lastExpiredTime) { + // Clear the expired time + root.lastExpiredTime = NoWork; + } +} +function markRootExpiredAtTime(root, expirationTime) { + var lastExpiredTime = root.lastExpiredTime; + + if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) { + root.lastExpiredTime = expirationTime; + } +} + +var didWarnAboutNestedUpdates; +var didWarnAboutFindNodeInStrictMode; + +{ + didWarnAboutNestedUpdates = false; + didWarnAboutFindNodeInStrictMode = {}; +} + +function getContextForSubtree(parentComponent) { + if (!parentComponent) { + return emptyContextObject; + } + + var fiber = get(parentComponent); + var parentContext = findCurrentUnmaskedContext(fiber); + + if (fiber.tag === ClassComponent) { + var Component = fiber.type; + + if (isContextProvider(Component)) { + return processChildContext(fiber, Component, parentContext); + } + } + + return parentContext; +} + +function findHostInstanceWithWarning(component, methodName) { + { + var fiber = get(component); + + if (fiber === undefined) { + if (typeof component.render === 'function') { + { + { + throw Error( "Unable to find node on an unmounted component." ); + } + } + } else { + { + { + throw Error( "Argument appears to not be a ReactComponent. Keys: " + Object.keys(component) ); + } + } + } + } + + var hostFiber = findCurrentHostFiber(fiber); + + if (hostFiber === null) { + return null; + } + + if (hostFiber.mode & StrictMode) { + var componentName = getComponentName(fiber.type) || 'Component'; + + if (!didWarnAboutFindNodeInStrictMode[componentName]) { + didWarnAboutFindNodeInStrictMode[componentName] = true; + + if (fiber.mode & StrictMode) { + error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber)); + } else { + error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber)); + } + } + } + + return hostFiber.stateNode; + } +} + +function createContainer(containerInfo, tag, hydrate, hydrationCallbacks) { + return createFiberRoot(containerInfo, tag, hydrate); +} +function updateContainer(element, container, parentComponent, callback) { + { + onScheduleRoot(container, element); + } + + var current$1 = container.current; + var currentTime = requestCurrentTimeForUpdate(); + + { + // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests + if ('undefined' !== typeof jest) { + warnIfUnmockedScheduler(current$1); + warnIfNotScopedWithMatchingAct(current$1); + } + } + + var suspenseConfig = requestCurrentSuspenseConfig(); + var expirationTime = computeExpirationForFiber(currentTime, current$1, suspenseConfig); + var context = getContextForSubtree(parentComponent); + + if (container.context === null) { + container.context = context; + } else { + container.pendingContext = context; + } + + { + if (isRendering && current !== null && !didWarnAboutNestedUpdates) { + didWarnAboutNestedUpdates = true; + + error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown'); + } + } + + var update = createUpdate(expirationTime, suspenseConfig); // Caution: React DevTools currently depends on this property + // being called "element". + + update.payload = { + element: element + }; + callback = callback === undefined ? null : callback; + + if (callback !== null) { + { + if (typeof callback !== 'function') { + error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback); + } + } + + update.callback = callback; + } + + enqueueUpdate(current$1, update); + scheduleWork(current$1, expirationTime); + return expirationTime; +} +function getPublicRootInstance(container) { + var containerFiber = container.current; + + if (!containerFiber.child) { + return null; + } + + switch (containerFiber.child.tag) { + case HostComponent: + return getPublicInstance(containerFiber.child.stateNode); + + default: + return containerFiber.child.stateNode; + } +} + +function markRetryTimeImpl(fiber, retryTime) { + var suspenseState = fiber.memoizedState; + + if (suspenseState !== null && suspenseState.dehydrated !== null) { + if (suspenseState.retryTime < retryTime) { + suspenseState.retryTime = retryTime; + } + } +} // Increases the priority of thennables when they resolve within this boundary. + + +function markRetryTimeIfNotHydrated(fiber, retryTime) { + markRetryTimeImpl(fiber, retryTime); + var alternate = fiber.alternate; + + if (alternate) { + markRetryTimeImpl(alternate, retryTime); + } +} + +function attemptUserBlockingHydration$1(fiber) { + if (fiber.tag !== SuspenseComponent) { + // We ignore HostRoots here because we can't increase + // their priority and they should not suspend on I/O, + // since you have to wrap anything that might suspend in + // Suspense. + return; + } + + var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate()); + scheduleWork(fiber, expTime); + markRetryTimeIfNotHydrated(fiber, expTime); +} +function attemptContinuousHydration$1(fiber) { + if (fiber.tag !== SuspenseComponent) { + // We ignore HostRoots here because we can't increase + // their priority and they should not suspend on I/O, + // since you have to wrap anything that might suspend in + // Suspense. + return; + } + + scheduleWork(fiber, ContinuousHydration); + markRetryTimeIfNotHydrated(fiber, ContinuousHydration); +} +function attemptHydrationAtCurrentPriority$1(fiber) { + if (fiber.tag !== SuspenseComponent) { + // We ignore HostRoots here because we can't increase + // their priority other than synchronously flush it. + return; + } + + var currentTime = requestCurrentTimeForUpdate(); + var expTime = computeExpirationForFiber(currentTime, fiber, null); + scheduleWork(fiber, expTime); + markRetryTimeIfNotHydrated(fiber, expTime); +} +function findHostInstanceWithNoPortals(fiber) { + var hostFiber = findCurrentHostFiberWithNoPortals(fiber); + + if (hostFiber === null) { + return null; + } + + if (hostFiber.tag === FundamentalComponent) { + return hostFiber.stateNode.instance; + } + + return hostFiber.stateNode; +} + +var shouldSuspendImpl = function (fiber) { + return false; +}; + +function shouldSuspend(fiber) { + return shouldSuspendImpl(fiber); +} +var overrideHookState = null; +var overrideProps = null; +var scheduleUpdate = null; +var setSuspenseHandler = null; + +{ + var copyWithSetImpl = function (obj, path, idx, value) { + if (idx >= path.length) { + return value; + } + + var key = path[idx]; + var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here + + updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value); + return updated; + }; + + var copyWithSet = function (obj, path, value) { + return copyWithSetImpl(obj, path, 0, value); + }; // Support DevTools editable values for useState and useReducer. + + + overrideHookState = function (fiber, id, path, value) { + // For now, the "id" of stateful hooks is just the stateful hook index. + // This may change in the future with e.g. nested hooks. + var currentHook = fiber.memoizedState; + + while (currentHook !== null && id > 0) { + currentHook = currentHook.next; + id--; + } + + if (currentHook !== null) { + var newState = copyWithSet(currentHook.memoizedState, path, value); + currentHook.memoizedState = newState; + currentHook.baseState = newState; // We aren't actually adding an update to the queue, + // because there is no update we can add for useReducer hooks that won't trigger an error. + // (There's no appropriate action type for DevTools overrides.) + // As a result though, React will see the scheduled update as a noop and bailout. + // Shallow cloning props works as a workaround for now to bypass the bailout check. + + fiber.memoizedProps = _assign({}, fiber.memoizedProps); + scheduleWork(fiber, Sync); + } + }; // Support DevTools props for function components, forwardRef, memo, host components, etc. + + + overrideProps = function (fiber, path, value) { + fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); + + if (fiber.alternate) { + fiber.alternate.pendingProps = fiber.pendingProps; + } + + scheduleWork(fiber, Sync); + }; + + scheduleUpdate = function (fiber) { + scheduleWork(fiber, Sync); + }; + + setSuspenseHandler = function (newShouldSuspendImpl) { + shouldSuspendImpl = newShouldSuspendImpl; + }; +} + +function injectIntoDevTools(devToolsConfig) { + var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; + var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; + return injectInternals(_assign({}, devToolsConfig, { + overrideHookState: overrideHookState, + overrideProps: overrideProps, + setSuspenseHandler: setSuspenseHandler, + scheduleUpdate: scheduleUpdate, + currentDispatcherRef: ReactCurrentDispatcher, + findHostInstanceByFiber: function (fiber) { + var hostFiber = findCurrentHostFiber(fiber); + + if (hostFiber === null) { + return null; + } + + return hostFiber.stateNode; + }, + findFiberByHostInstance: function (instance) { + if (!findFiberByHostInstance) { + // Might not be implemented by the renderer. + return null; + } + + return findFiberByHostInstance(instance); + }, + // React Refresh + findHostInstancesForRefresh: findHostInstancesForRefresh , + scheduleRefresh: scheduleRefresh , + scheduleRoot: scheduleRoot , + setRefreshHandler: setRefreshHandler , + // Enables DevTools to append owner stacks to error messages in DEV mode. + getCurrentFiber: function () { + return current; + } + })); +} +var IsSomeRendererActing$1 = ReactSharedInternals.IsSomeRendererActing; + +function ReactDOMRoot(container, options) { + this._internalRoot = createRootImpl(container, ConcurrentRoot, options); +} + +function ReactDOMBlockingRoot(container, tag, options) { + this._internalRoot = createRootImpl(container, tag, options); +} + +ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children) { + var root = this._internalRoot; + + { + if (typeof arguments[1] === 'function') { + error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().'); + } + + var container = root.containerInfo; + + if (container.nodeType !== COMMENT_NODE) { + var hostInstance = findHostInstanceWithNoPortals(root.current); + + if (hostInstance) { + if (hostInstance.parentNode !== container) { + error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + "root.unmount() to empty a root's container."); + } + } + } + } + + updateContainer(children, root, null, null); +}; + +ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function () { + { + if (typeof arguments[0] === 'function') { + error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().'); + } + } + + var root = this._internalRoot; + var container = root.containerInfo; + updateContainer(null, root, null, function () { + unmarkContainerAsRoot(container); + }); +}; + +function createRootImpl(container, tag, options) { + // Tag is either LegacyRoot or Concurrent Root + var hydrate = options != null && options.hydrate === true; + var hydrationCallbacks = options != null && options.hydrationOptions || null; + var root = createContainer(container, tag, hydrate); + markContainerAsRoot(root.current, container); + + if (hydrate && tag !== LegacyRoot) { + var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument; + eagerlyTrapReplayableEvents(container, doc); + } + + return root; +} +function createLegacyRoot(container, options) { + return new ReactDOMBlockingRoot(container, LegacyRoot, options); +} +function isValidContainer(node) { + return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable ')); +} + +var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; +var topLevelUpdateWarnings; +var warnedAboutHydrateAPI = false; + +{ + topLevelUpdateWarnings = function (container) { + if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) { + var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current); + + if (hostInstance) { + if (hostInstance.parentNode !== container) { + error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.'); + } + } + } + + var isRootRenderedBySomeReact = !!container._reactRootContainer; + var rootEl = getReactRootElementInContainer(container); + var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl)); + + if (hasNonRootReactChild && !isRootRenderedBySomeReact) { + error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.'); + } + + if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') { + error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.'); + } + }; +} + +function getReactRootElementInContainer(container) { + if (!container) { + return null; + } + + if (container.nodeType === DOCUMENT_NODE) { + return container.documentElement; + } else { + return container.firstChild; + } +} + +function shouldHydrateDueToLegacyHeuristic(container) { + var rootElement = getReactRootElementInContainer(container); + return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME)); +} + +function legacyCreateRootFromDOMContainer(container, forceHydrate) { + var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content. + + if (!shouldHydrate) { + var warned = false; + var rootSibling; + + while (rootSibling = container.lastChild) { + { + if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) { + warned = true; + + error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.'); + } + } + + container.removeChild(rootSibling); + } + } + + { + if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) { + warnedAboutHydrateAPI = true; + + warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.'); + } + } + + return createLegacyRoot(container, shouldHydrate ? { + hydrate: true + } : undefined); +} + +function warnOnInvalidCallback$1(callback, callerName) { + { + if (callback !== null && typeof callback !== 'function') { + error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); + } + } +} + +function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) { + { + topLevelUpdateWarnings(container); + warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render'); + } // TODO: Without `any` type, Flow says "Property cannot be accessed on any + // member of intersection type." Whyyyyyy. + + + var root = container._reactRootContainer; + var fiberRoot; + + if (!root) { + // Initial mount + root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate); + fiberRoot = root._internalRoot; + + if (typeof callback === 'function') { + var originalCallback = callback; + + callback = function () { + var instance = getPublicRootInstance(fiberRoot); + originalCallback.call(instance); + }; + } // Initial mount should not be batched. + + + unbatchedUpdates(function () { + updateContainer(children, fiberRoot, parentComponent, callback); + }); + } else { + fiberRoot = root._internalRoot; + + if (typeof callback === 'function') { + var _originalCallback = callback; + + callback = function () { + var instance = getPublicRootInstance(fiberRoot); + + _originalCallback.call(instance); + }; + } // Update + + + updateContainer(children, fiberRoot, parentComponent, callback); + } + + return getPublicRootInstance(fiberRoot); +} + +function findDOMNode(componentOrElement) { + { + var owner = ReactCurrentOwner$3.current; + + if (owner !== null && owner.stateNode !== null) { + var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender; + + if (!warnedAboutRefsInRender) { + error('%s is accessing findDOMNode inside its render(). ' + '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(owner.type) || 'A component'); + } + + owner.stateNode._warnedAboutRefsInRender = true; + } + } + + if (componentOrElement == null) { + return null; + } + + if (componentOrElement.nodeType === ELEMENT_NODE) { + return componentOrElement; + } + + { + return findHostInstanceWithWarning(componentOrElement, 'findDOMNode'); + } +} +function hydrate(element, container, callback) { + if (!isValidContainer(container)) { + { + throw Error( "Target container is not a DOM element." ); + } + } + + { + var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; + + if (isModernRoot) { + error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?'); + } + } // TODO: throw or warn if we couldn't hydrate? + + + return legacyRenderSubtreeIntoContainer(null, element, container, true, callback); +} +function render(element, container, callback) { + if (!isValidContainer(container)) { + { + throw Error( "Target container is not a DOM element." ); + } + } + + { + var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; + + if (isModernRoot) { + error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?'); + } + } + + return legacyRenderSubtreeIntoContainer(null, element, container, false, callback); +} +function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { + if (!isValidContainer(containerNode)) { + { + throw Error( "Target container is not a DOM element." ); + } + } + + if (!(parentComponent != null && has(parentComponent))) { + { + throw Error( "parentComponent must be a valid React Component" ); + } + } + + return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback); +} +function unmountComponentAtNode(container) { + if (!isValidContainer(container)) { + { + throw Error( "unmountComponentAtNode(...): Target container is not a DOM element." ); + } + } + + { + var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; + + if (isModernRoot) { + error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?'); + } + } + + if (container._reactRootContainer) { + { + var rootEl = getReactRootElementInContainer(container); + var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl); + + if (renderedByDifferentReact) { + error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.'); + } + } // Unmount should not be batched. + + + unbatchedUpdates(function () { + legacyRenderSubtreeIntoContainer(null, null, container, false, function () { + // $FlowFixMe This should probably use `delete container._reactRootContainer` + container._reactRootContainer = null; + unmarkContainerAsRoot(container); + }); + }); // If you call unmountComponentAtNode twice in quick succession, you'll + // get `true` twice. That's probably fine? + + return true; + } else { + { + var _rootEl = getReactRootElementInContainer(container); + + var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl)); // Check if the container itself is a React root node. + + var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer; + + if (hasNonRootReactChild) { + error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.'); + } + } + + return false; + } +} + +function createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. +implementation) { + var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; + return { + // This tag allow us to uniquely identify this as a React Portal + $$typeof: REACT_PORTAL_TYPE, + key: key == null ? null : '' + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; +} + +var ReactVersion = '16.13.1'; + +setAttemptUserBlockingHydration(attemptUserBlockingHydration$1); +setAttemptContinuousHydration(attemptContinuousHydration$1); +setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1); +var didWarnAboutUnstableCreatePortal = false; + +{ + if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype + Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype + Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') { + error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); + } +} + +setRestoreImplementation(restoreControlledState$3); +setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1); + +function createPortal$1(children, container) { + var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + + if (!isValidContainer(container)) { + { + throw Error( "Target container is not a DOM element." ); + } + } // TODO: pass ReactDOM portal implementation as third argument + // $FlowFixMe The Flow type is opaque but there's no way to actually create it. + + + return createPortal(children, container, null, key); +} + +function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { + + return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback); +} + +function unstable_createPortal(children, container) { + var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + + { + if (!didWarnAboutUnstableCreatePortal) { + didWarnAboutUnstableCreatePortal = true; + + warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.'); + } + } + + return createPortal$1(children, container, key); +} + +var Internals = { + // Keep in sync with ReactDOMUnstableNativeDependencies.js + // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification. + Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing] +}; +var foundDevTools = injectIntoDevTools({ + findFiberByHostInstance: getClosestInstanceFromNode, + bundleType: 1 , + version: ReactVersion, + rendererPackageName: 'react-dom' +}); + +{ + if (!foundDevTools && canUseDOM && window.top === window.self) { + // If we're in Chrome or Firefox, provide a download link if not installed. + if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) { + var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://. + + if (/^(https?|file):$/.test(protocol)) { + // eslint-disable-next-line react-internal/no-production-logging + console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold'); + } + } + } +} + +exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; +exports.createPortal = createPortal$1; +exports.findDOMNode = findDOMNode; +exports.flushSync = flushSync; +exports.hydrate = hydrate; +exports.render = render; +exports.unmountComponentAtNode = unmountComponentAtNode; +exports.unstable_batchedUpdates = batchedUpdates$1; +exports.unstable_createPortal = unstable_createPortal; +exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer; +exports.version = ReactVersion; + })(); +} + + +/***/ }), + +/***/ "../../node_modules/react-dom/index.js": +/*!***********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/react-dom/index.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function checkDCE() { + /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ + if ( + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function' + ) { + return; + } + if (true) { + // This branch is unreachable because this function is only called + // in production, but the condition is true only in development. + // Therefore if the branch is still here, dead code elimination wasn't + // properly applied. + // Don't change the message. React DevTools relies on it. Also make sure + // this message doesn't occur elsewhere in this function, or it will cause + // a false positive. + throw new Error('^_^'); + } + try { + // Verify that the code above has been dead code eliminated (DCE'd). + __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); + } catch (err) { + // DevTools shouldn't crash React, no matter what. + // We should still report in case we break this code. + console.error(err); + } +} + +if (false) {} else { + module.exports = __webpack_require__(/*! ./cjs/react-dom.development.js */ "../../node_modules/react-dom/cjs/react-dom.development.js"); +} + + +/***/ }), + +/***/ "../../node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js": +/*!**************************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js ***! + \**************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** @license React v0.19.1 + * scheduler-tracing.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + + + +if (true) { + (function() { +'use strict'; + +var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs. + +var interactionIDCounter = 0; +var threadIDCounter = 0; // Set of currently traced interactions. +// Interactions "stack"– +// Meaning that newly traced interactions are appended to the previously active set. +// When an interaction goes out of scope, the previous set (if any) is restored. + +exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end. + +exports.__subscriberRef = null; + +{ + exports.__interactionsRef = { + current: new Set() + }; + exports.__subscriberRef = { + current: null + }; +} +function unstable_clear(callback) { + + var prevInteractions = exports.__interactionsRef.current; + exports.__interactionsRef.current = new Set(); + + try { + return callback(); + } finally { + exports.__interactionsRef.current = prevInteractions; + } +} +function unstable_getCurrent() { + { + return exports.__interactionsRef.current; + } +} +function unstable_getThreadID() { + return ++threadIDCounter; +} +function unstable_trace(name, timestamp, callback) { + var threadID = arguments.length > 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; + + 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; + + 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_subscribe = unstable_subscribe; +exports.unstable_trace = unstable_trace; +exports.unstable_unsubscribe = unstable_unsubscribe; +exports.unstable_wrap = unstable_wrap; + })(); +} + + +/***/ }), + +/***/ "../../node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js": +/*!******************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js ***! + \******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** @license React v0.19.1 + * scheduler.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + + + +if (true) { + (function() { +'use strict'; + +var enableSchedulerDebugging = false; +var enableProfiling = true; + +var requestHostCallback; +var requestHostTimeout; +var cancelHostTimeout; +var shouldYieldToHost; +var requestPaint; + +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 _timeoutID = null; + + var _flushCallback = function () { + if (_callback !== null) { + try { + var currentTime = exports.unstable_now(); + var hasRemainingTime = true; + + _callback(hasRemainingTime, currentTime); + + _callback = null; + } catch (e) { + setTimeout(_flushCallback, 0); + throw e; + } + } + }; + + var initialTime = Date.now(); + + exports.unstable_now = function () { + return Date.now() - initialTime; + }; + + requestHostCallback = function (cb) { + if (_callback !== null) { + // Protect against re-entrancy. + setTimeout(requestHostCallback, 0, cb); + } else { + _callback = cb; + setTimeout(_flushCallback, 0); + } + }; + + requestHostTimeout = function (cb, ms) { + _timeoutID = setTimeout(cb, ms); + }; + + cancelHostTimeout = function () { + clearTimeout(_timeoutID); + }; + + shouldYieldToHost = function () { + return false; + }; + + requestPaint = exports.unstable_forceFrameRate = function () {}; +} else { + // Capture local references to native APIs, in case a polyfill overrides them. + var performance = window.performance; + var _Date = window.Date; + var _setTimeout = window.setTimeout; + var _clearTimeout = window.clearTimeout; + + if (typeof console !== 'undefined') { + // TODO: Scheduler no longer requires these methods to be polyfilled. But + // maybe we want to continue warning if they don't exist, to preserve the + // option to rely on it in the future? + var requestAnimationFrame = window.requestAnimationFrame; + var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link + + if (typeof requestAnimationFrame !== 'function') { + // Using console['error'] to evade Babel and ESLint + 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 cancelAnimationFrame !== 'function') { + // Using console['error'] to evade Babel and ESLint + console['error']("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills'); + } + } + + if (typeof performance === 'object' && typeof performance.now === 'function') { + exports.unstable_now = function () { + return performance.now(); + }; + } else { + var _initialTime = _Date.now(); + + exports.unstable_now = function () { + return _Date.now() - _initialTime; + }; + } + + var isMessageLoopRunning = false; + var scheduledHostCallback = null; + var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main + // thread, like user events. By default, it yields multiple times per frame. + // It does not attempt to align with frame boundaries, since most tasks don't + // need to be frame aligned; for those that do, use requestAnimationFrame. + + var yieldInterval = 5; + var deadline = 0; // TODO: Make this configurable + + { + // `isInputPending` is not available. Since we have no way of knowing if + // there's pending input, always yield at the end of the frame. + shouldYieldToHost = function () { + return exports.unstable_now() >= deadline; + }; // Since we yield every frame regardless, `requestPaint` has no effect. + + + requestPaint = function () {}; + } + + exports.unstable_forceFrameRate = function (fps) { + if (fps < 0 || fps > 125) { + // Using console['error'] to evade Babel and ESLint + console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported'); + return; + } + + if (fps > 0) { + yieldInterval = Math.floor(1000 / fps); + } else { + // reset the framerate + yieldInterval = 5; + } + }; + + var performWorkUntilDeadline = function () { + if (scheduledHostCallback !== null) { + var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync + // cycle. This means there's always time remaining at the beginning of + // the message event. + + deadline = currentTime + yieldInterval; + var hasTimeRemaining = true; + + try { + var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); + + if (!hasMoreWork) { + isMessageLoopRunning = false; + scheduledHostCallback = null; + } else { + // If there's more work, schedule the next message event at the end + // of the preceding one. + port.postMessage(null); + } + } catch (error) { + // If a scheduler task throws, exit the current browser task so the + // error can be observed. + port.postMessage(null); + throw error; + } + } else { + isMessageLoopRunning = false; + } // Yielding to the browser will give it a chance to paint, so we can + }; + + var channel = new MessageChannel(); + var port = channel.port2; + channel.port1.onmessage = performWorkUntilDeadline; + + requestHostCallback = function (callback) { + scheduledHostCallback = callback; + + if (!isMessageLoopRunning) { + isMessageLoopRunning = true; + port.postMessage(null); + } + }; + + requestHostTimeout = function (callback, ms) { + taskTimeoutID = _setTimeout(function () { + callback(exports.unstable_now()); + }, ms); + }; + + cancelHostTimeout = function () { + _clearTimeout(taskTimeoutID); + + taskTimeoutID = -1; + }; +} + +function push(heap, node) { + var index = heap.length; + heap.push(node); + siftUp(heap, node, index); +} +function peek(heap) { + var first = heap[0]; + return first === undefined ? null : first; +} +function pop(heap) { + var first = heap[0]; + + if (first !== undefined) { + var last = heap.pop(); + + if (last !== first) { + heap[0] = last; + siftDown(heap, last, 0); + } + + return first; + } else { + return null; + } +} + +function siftUp(heap, node, i) { + var index = i; + + while (true) { + var parentIndex = index - 1 >>> 1; + var parent = heap[parentIndex]; + + if (parent !== undefined && compare(parent, node) > 0) { + // The parent is larger. Swap positions. + heap[parentIndex] = node; + heap[index] = parent; + index = parentIndex; + } else { + // The parent is smaller. Exit. + return; + } + } +} + +function siftDown(heap, node, i) { + var index = i; + var length = heap.length; + + while (index < length) { + var leftIndex = (index + 1) * 2 - 1; + var left = heap[leftIndex]; + var rightIndex = leftIndex + 1; + var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those. + + if (left !== undefined && compare(left, node) < 0) { + if (right !== undefined && compare(right, left) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + heap[index] = left; + heap[leftIndex] = node; + index = leftIndex; + } + } else if (right !== undefined && compare(right, node) < 0) { + heap[index] = right; + heap[rightIndex] = node; + index = rightIndex; + } else { + // Neither child is smaller. Exit. + return; + } + } +} + +function compare(a, b) { + // Compare sort index first, then task id. + var diff = a.sortIndex - b.sortIndex; + return diff !== 0 ? diff : a.id - b.id; +} + +// TODO: Use symbols? +var NoPriority = 0; +var ImmediatePriority = 1; +var UserBlockingPriority = 2; +var NormalPriority = 3; +var LowPriority = 4; +var IdlePriority = 5; + +var runIdCounter = 0; +var mainThreadIdCounter = 0; +var profilingStateSize = 4; +var sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer +typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer +typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9 +; +var profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks + +var PRIORITY = 0; +var CURRENT_TASK_ID = 1; +var CURRENT_RUN_ID = 2; +var QUEUE_SIZE = 3; + +{ + profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue + // array might include canceled tasks. + + profilingState[QUEUE_SIZE] = 0; + profilingState[CURRENT_TASK_ID] = 0; +} // Bytes per element is 4 + + +var INITIAL_EVENT_LOG_SIZE = 131072; +var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes + +var eventLogSize = 0; +var eventLogBuffer = null; +var eventLog = null; +var eventLogIndex = 0; +var TaskStartEvent = 1; +var TaskCompleteEvent = 2; +var TaskErrorEvent = 3; +var TaskCancelEvent = 4; +var TaskRunEvent = 5; +var TaskYieldEvent = 6; +var SchedulerSuspendEvent = 7; +var SchedulerResumeEvent = 8; + +function logEvent(entries) { + if (eventLog !== null) { + var offset = eventLogIndex; + eventLogIndex += entries.length; + + if (eventLogIndex + 1 > eventLogSize) { + eventLogSize *= 2; + + if (eventLogSize > MAX_EVENT_LOG_SIZE) { + // Using console['error'] to evade Babel and ESLint + console['error']("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.'); + stopLoggingProfilingEvents(); + return; + } + + var newEventLog = new Int32Array(eventLogSize * 4); + newEventLog.set(eventLog); + eventLogBuffer = newEventLog.buffer; + eventLog = newEventLog; + } + + eventLog.set(entries, offset); + } +} + +function startLoggingProfilingEvents() { + eventLogSize = INITIAL_EVENT_LOG_SIZE; + eventLogBuffer = new ArrayBuffer(eventLogSize * 4); + eventLog = new Int32Array(eventLogBuffer); + eventLogIndex = 0; +} +function stopLoggingProfilingEvents() { + var buffer = eventLogBuffer; + eventLogSize = 0; + eventLogBuffer = null; + eventLog = null; + eventLogIndex = 0; + return buffer; +} +function markTaskStart(task, ms) { + { + profilingState[QUEUE_SIZE]++; + + if (eventLog !== null) { + // performance.now returns a float, representing milliseconds. When the + // event is logged, it's coerced to an int. Convert to microseconds to + // maintain extra degrees of precision. + logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]); + } + } +} +function markTaskCompleted(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskCompleteEvent, ms * 1000, task.id]); + } + } +} +function markTaskCanceled(task, ms) { + { + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskCancelEvent, ms * 1000, task.id]); + } + } +} +function markTaskErrored(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskErrorEvent, ms * 1000, task.id]); + } + } +} +function markTaskRun(task, ms) { + { + runIdCounter++; + profilingState[PRIORITY] = task.priorityLevel; + profilingState[CURRENT_TASK_ID] = task.id; + profilingState[CURRENT_RUN_ID] = runIdCounter; + + if (eventLog !== null) { + logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]); + } + } +} +function markTaskYield(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[CURRENT_RUN_ID] = 0; + + if (eventLog !== null) { + logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]); + } + } +} +function markSchedulerSuspended(ms) { + { + mainThreadIdCounter++; + + if (eventLog !== null) { + logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]); + } + } +} +function markSchedulerUnsuspended(ms) { + { + if (eventLog !== null) { + logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]); + } + } +} + +/* eslint-disable no-var */ +// Math.pow(2, 30) - 1 +// 0b111111111111111111111111111111 + +var maxSigned31BitInt = 1073741823; // Times out immediately + +var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out + +var USER_BLOCKING_PRIORITY = 250; +var NORMAL_PRIORITY_TIMEOUT = 5000; +var LOW_PRIORITY_TIMEOUT = 10000; // Never times out + +var IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap + +var taskQueue = []; +var timerQueue = []; // Incrementing id counter. Used to maintain insertion order. + +var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. +var currentTask = null; +var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy. + +var isPerformingWork = false; +var isHostCallbackScheduled = false; +var isHostTimeoutScheduled = false; + +function advanceTimers(currentTime) { + // Check for tasks that are no longer delayed and add them to the queue. + var timer = peek(timerQueue); + + while (timer !== null) { + if (timer.callback === null) { + // Timer was cancelled. + pop(timerQueue); + } else if (timer.startTime <= currentTime) { + // Timer fired. Transfer to the task queue. + pop(timerQueue); + timer.sortIndex = timer.expirationTime; + push(taskQueue, timer); + + { + markTaskStart(timer, currentTime); + timer.isQueued = true; + } + } else { + // Remaining timers are pending. + return; + } + + timer = peek(timerQueue); + } +} + +function handleTimeout(currentTime) { + isHostTimeoutScheduled = false; + advanceTimers(currentTime); + + if (!isHostCallbackScheduled) { + if (peek(taskQueue) !== null) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } else { + var firstTimer = peek(timerQueue); + + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + } + } +} + +function flushWork(hasTimeRemaining, initialTime) { + { + markSchedulerUnsuspended(initialTime); + } // We'll need a host callback the next time work is scheduled. + + + isHostCallbackScheduled = false; + + if (isHostTimeoutScheduled) { + // We scheduled a timeout but it's no longer needed. Cancel it. + isHostTimeoutScheduled = false; + cancelHostTimeout(); + } + + isPerformingWork = true; + var previousPriorityLevel = currentPriorityLevel; + + try { + if (enableProfiling) { + try { + return workLoop(hasTimeRemaining, initialTime); + } catch (error) { + if (currentTask !== null) { + var currentTime = exports.unstable_now(); + markTaskErrored(currentTask, currentTime); + currentTask.isQueued = false; + } + + throw error; + } + } else { + // No catch in prod codepath. + return workLoop(hasTimeRemaining, initialTime); + } + } finally { + currentTask = null; + currentPriorityLevel = previousPriorityLevel; + isPerformingWork = false; + + { + var _currentTime = exports.unstable_now(); + + markSchedulerSuspended(_currentTime); + } + } +} + +function workLoop(hasTimeRemaining, initialTime) { + var currentTime = initialTime; + advanceTimers(currentTime); + currentTask = peek(taskQueue); + + while (currentTask !== null && !(enableSchedulerDebugging )) { + if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { + // This currentTask hasn't expired, and we've reached the deadline. + break; + } + + var callback = currentTask.callback; + + if (callback !== null) { + currentTask.callback = null; + currentPriorityLevel = currentTask.priorityLevel; + var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; + markTaskRun(currentTask, currentTime); + var continuationCallback = callback(didUserCallbackTimeout); + currentTime = exports.unstable_now(); + + if (typeof continuationCallback === 'function') { + currentTask.callback = continuationCallback; + markTaskYield(currentTask, currentTime); + } else { + { + markTaskCompleted(currentTask, currentTime); + currentTask.isQueued = false; + } + + if (currentTask === peek(taskQueue)) { + pop(taskQueue); + } + } + + advanceTimers(currentTime); + } else { + pop(taskQueue); + } + + currentTask = peek(taskQueue); + } // Return whether there's additional work + + + if (currentTask !== null) { + return true; + } else { + var firstTimer = peek(timerQueue); + + if (firstTimer !== null) { + requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); + } + + return false; + } +} + +function unstable_runWithPriority(priorityLevel, eventHandler) { + switch (priorityLevel) { + case ImmediatePriority: + case UserBlockingPriority: + case NormalPriority: + case LowPriority: + case IdlePriority: + break; + + default: + priorityLevel = NormalPriority; + } + + var previousPriorityLevel = currentPriorityLevel; + currentPriorityLevel = priorityLevel; + + try { + return eventHandler(); + } finally { + currentPriorityLevel = previousPriorityLevel; + } +} + +function unstable_next(eventHandler) { + var priorityLevel; + + 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; + currentPriorityLevel = priorityLevel; + + try { + return eventHandler(); + } finally { + currentPriorityLevel = previousPriorityLevel; + } +} + +function unstable_wrapCallback(callback) { + var parentPriorityLevel = currentPriorityLevel; + return function () { + // This is a fork of runWithPriority, inlined for performance. + var previousPriorityLevel = currentPriorityLevel; + currentPriorityLevel = parentPriorityLevel; + + try { + return callback.apply(this, arguments); + } finally { + currentPriorityLevel = previousPriorityLevel; + } + }; +} + +function timeoutForPriorityLevel(priorityLevel) { + switch (priorityLevel) { + case ImmediatePriority: + return IMMEDIATE_PRIORITY_TIMEOUT; + + case UserBlockingPriority: + return USER_BLOCKING_PRIORITY; + + case IdlePriority: + return IDLE_PRIORITY; + + case LowPriority: + return LOW_PRIORITY_TIMEOUT; + + case NormalPriority: + default: + return NORMAL_PRIORITY_TIMEOUT; + } +} + +function unstable_scheduleCallback(priorityLevel, callback, options) { + var currentTime = exports.unstable_now(); + var startTime; + var timeout; + + if (typeof options === 'object' && options !== null) { + var delay = options.delay; + + if (typeof delay === 'number' && delay > 0) { + startTime = currentTime + delay; + } else { + startTime = currentTime; + } + + timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel); + } else { + timeout = timeoutForPriorityLevel(priorityLevel); + startTime = currentTime; + } + + var expirationTime = startTime + timeout; + var newTask = { + id: taskIdCounter++, + callback: callback, + priorityLevel: priorityLevel, + startTime: startTime, + expirationTime: expirationTime, + sortIndex: -1 + }; + + { + newTask.isQueued = false; + } + + if (startTime > currentTime) { + // This is a delayed task. + newTask.sortIndex = startTime; + push(timerQueue, newTask); + + if (peek(taskQueue) === null && newTask === peek(timerQueue)) { + // All tasks are delayed, and this is the task with the earliest delay. + if (isHostTimeoutScheduled) { + // Cancel an existing timeout. + cancelHostTimeout(); + } else { + isHostTimeoutScheduled = true; + } // Schedule a timeout. + + + requestHostTimeout(handleTimeout, startTime - currentTime); + } + } else { + newTask.sortIndex = expirationTime; + push(taskQueue, newTask); + + { + markTaskStart(newTask, currentTime); + newTask.isQueued = true; + } // Schedule a host callback, if needed. If we're already performing work, + // wait until the next time we yield. + + + if (!isHostCallbackScheduled && !isPerformingWork) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } + } + + return newTask; +} + +function unstable_pauseExecution() { +} + +function unstable_continueExecution() { + + if (!isHostCallbackScheduled && !isPerformingWork) { + isHostCallbackScheduled = true; + requestHostCallback(flushWork); + } +} + +function unstable_getFirstCallbackNode() { + return peek(taskQueue); +} + +function unstable_cancelCallback(task) { + { + if (task.isQueued) { + var currentTime = exports.unstable_now(); + markTaskCanceled(task, currentTime); + task.isQueued = false; + } + } // Null out the callback to indicate the task has been canceled. (Can't + // remove from the queue because you can't remove arbitrary nodes from an + // array based heap, only the first one.) + + + task.callback = null; +} + +function unstable_getCurrentPriorityLevel() { + return currentPriorityLevel; +} + +function unstable_shouldYield() { + var currentTime = exports.unstable_now(); + advanceTimers(currentTime); + var firstTask = peek(taskQueue); + return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost(); +} + +var unstable_requestPaint = requestPaint; +var unstable_Profiling = { + startLoggingProfilingEvents: startLoggingProfilingEvents, + stopLoggingProfilingEvents: stopLoggingProfilingEvents, + sharedProfilingBuffer: sharedProfilingBuffer +} ; + +exports.unstable_IdlePriority = IdlePriority; +exports.unstable_ImmediatePriority = ImmediatePriority; +exports.unstable_LowPriority = LowPriority; +exports.unstable_NormalPriority = NormalPriority; +exports.unstable_Profiling = unstable_Profiling; +exports.unstable_UserBlockingPriority = UserBlockingPriority; +exports.unstable_cancelCallback = unstable_cancelCallback; +exports.unstable_continueExecution = unstable_continueExecution; +exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; +exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode; +exports.unstable_next = unstable_next; +exports.unstable_pauseExecution = unstable_pauseExecution; +exports.unstable_requestPaint = unstable_requestPaint; +exports.unstable_runWithPriority = unstable_runWithPriority; +exports.unstable_scheduleCallback = unstable_scheduleCallback; +exports.unstable_shouldYield = unstable_shouldYield; +exports.unstable_wrapCallback = unstable_wrapCallback; + })(); +} + + +/***/ }), + +/***/ "../../node_modules/react-dom/node_modules/scheduler/index.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/react-dom/node_modules/scheduler/index.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +if (false) {} else { + module.exports = __webpack_require__(/*! ./cjs/scheduler.development.js */ "../../node_modules/react-dom/node_modules/scheduler/cjs/scheduler.development.js"); +} + + +/***/ }), + +/***/ "../../node_modules/react-dom/node_modules/scheduler/tracing.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/react-dom/node_modules/scheduler/tracing.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +if (false) {} else { + module.exports = __webpack_require__(/*! ./cjs/scheduler-tracing.development.js */ "../../node_modules/react-dom/node_modules/scheduler/cjs/scheduler-tracing.development.js"); +} + + +/***/ }), + +/***/ "../../node_modules/react-is/cjs/react-is.development.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/react-is/cjs/react-is.development.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** @license React v16.9.0 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + + + +if (true) { + (function() { +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +// 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; +// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary +// (unstable) APIs that have been removed. Can we remove the symbols? +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; +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_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; +var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; +var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; + +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 || type === REACT_SUSPENSE_LIST_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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE); +} + +/** + * Forked from fbjs/warning: + * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js + * + * Only change is we use console.warn instead of console.error, + * and do nothing when 'console' is not supported. + * This really simplifies the code. + * --- + * 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 lowPriorityWarning = function () {}; + +{ + var printWarning = function (format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + 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; + +function typeOf(object) { + if (typeof object === 'object' && object !== null) { + var $$typeof = object.$$typeof; + switch ($$typeof) { + case REACT_ELEMENT_TYPE: + var type = object.type; + + switch (type) { + case REACT_ASYNC_MODE_TYPE: + case REACT_CONCURRENT_MODE_TYPE: + case REACT_FRAGMENT_TYPE: + case REACT_PROFILER_TYPE: + case REACT_STRICT_MODE_TYPE: + case REACT_SUSPENSE_TYPE: + return type; + default: + var $$typeofType = type && type.$$typeof; + + switch ($$typeofType) { + case REACT_CONTEXT_TYPE: + case REACT_FORWARD_REF_TYPE: + case REACT_PROVIDER_TYPE: + return $$typeofType; + default: + return $$typeof; + } + } + case REACT_LAZY_TYPE: + case REACT_MEMO_TYPE: + case REACT_PORTAL_TYPE: + return $$typeof; + } + } + + return undefined; +} + +// AsyncMode is deprecated along with isAsyncMode +var AsyncMode = REACT_ASYNC_MODE_TYPE; +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; +var ContextConsumer = REACT_CONTEXT_TYPE; +var ContextProvider = REACT_PROVIDER_TYPE; +var Element = REACT_ELEMENT_TYPE; +var ForwardRef = REACT_FORWARD_REF_TYPE; +var Fragment = REACT_FRAGMENT_TYPE; +var Lazy = REACT_LAZY_TYPE; +var Memo = REACT_MEMO_TYPE; +var Portal = REACT_PORTAL_TYPE; +var Profiler = REACT_PROFILER_TYPE; +var StrictMode = REACT_STRICT_MODE_TYPE; +var Suspense = REACT_SUSPENSE_TYPE; + +var hasWarnedAboutDeprecatedIsAsyncMode = false; + +// AsyncMode should be deprecated +function isAsyncMode(object) { + { + if (!hasWarnedAboutDeprecatedIsAsyncMode) { + hasWarnedAboutDeprecatedIsAsyncMode = true; + lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); + } + } + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; +} +function isConcurrentMode(object) { + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; +} +function isContextConsumer(object) { + return typeOf(object) === REACT_CONTEXT_TYPE; +} +function isContextProvider(object) { + return typeOf(object) === REACT_PROVIDER_TYPE; +} +function isElement(object) { + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; +} +function isForwardRef(object) { + return typeOf(object) === REACT_FORWARD_REF_TYPE; +} +function isFragment(object) { + return typeOf(object) === REACT_FRAGMENT_TYPE; +} +function isLazy(object) { + return typeOf(object) === REACT_LAZY_TYPE; +} +function isMemo(object) { + return typeOf(object) === REACT_MEMO_TYPE; +} +function isPortal(object) { + return typeOf(object) === REACT_PORTAL_TYPE; +} +function isProfiler(object) { + return typeOf(object) === REACT_PROFILER_TYPE; +} +function isStrictMode(object) { + return typeOf(object) === REACT_STRICT_MODE_TYPE; +} +function isSuspense(object) { + return typeOf(object) === REACT_SUSPENSE_TYPE; +} + +exports.typeOf = typeOf; +exports.AsyncMode = AsyncMode; +exports.ConcurrentMode = ConcurrentMode; +exports.ContextConsumer = ContextConsumer; +exports.ContextProvider = ContextProvider; +exports.Element = Element; +exports.ForwardRef = ForwardRef; +exports.Fragment = Fragment; +exports.Lazy = Lazy; +exports.Memo = Memo; +exports.Portal = Portal; +exports.Profiler = Profiler; +exports.StrictMode = StrictMode; +exports.Suspense = Suspense; +exports.isValidElementType = isValidElementType; +exports.isAsyncMode = isAsyncMode; +exports.isConcurrentMode = isConcurrentMode; +exports.isContextConsumer = isContextConsumer; +exports.isContextProvider = isContextProvider; +exports.isElement = isElement; +exports.isForwardRef = isForwardRef; +exports.isFragment = isFragment; +exports.isLazy = isLazy; +exports.isMemo = isMemo; +exports.isPortal = isPortal; +exports.isProfiler = isProfiler; +exports.isStrictMode = isStrictMode; +exports.isSuspense = isSuspense; + })(); +} + + +/***/ }), + +/***/ "../../node_modules/react-is/index.js": +/*!**********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/react-is/index.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +if (false) {} else { + module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../../node_modules/react-is/cjs/react-is.development.js"); +} + + +/***/ }), + +/***/ "../../node_modules/regenerator-runtime/runtime.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/regenerator-runtime/runtime.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +var runtime = (function (exports) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + exports.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + exports.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + exports.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + exports.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. + result.value = unwrapped; + resolve(result); + }, function(error) { + // If a rejected Promise was yielded, throw the rejection back + // into the async generator function so it can be handled there. + return invoke("throw", error, resolve, reject); + }); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + exports.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + exports.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return exports.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + // Note: ["return"] must be used for ES3 parsing compatibility. + if (delegate.iterator["return"]) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + exports.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + exports.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; + + // Regardless of whether this script is executing as a CommonJS module + // or not, return the runtime object so that we can declare the variable + // regeneratorRuntime in the outer scope, which allows this module to be + // injected easily by `bin/regenerator --include-runtime script.js`. + return exports; + +}( + // If this script is executing as a CommonJS module, use module.exports + // as the regeneratorRuntime namespace. Otherwise create a new empty + // object. Either way, the resulting object will be used to initialize + // the regeneratorRuntime variable at the top of this file. + true ? module.exports : undefined +)); + +try { + regeneratorRuntime = runtime; +} catch (accidentalStrictMode) { + // This module should not be running in strict mode, so the above + // assignment should always work unless something is misconfigured. Just + // in case runtime.js accidentally runs in strict mode, we can escape + // strict mode using a global Function call. This could conceivably fail + // if a Content Security Policy forbids using Function, but in that case + // the proper solution is to fix the accidental strict mode problem. If + // you've misconfigured your bundler to force strict mode and applied a + // CSP to forbid Function, and you're not willing to fix either of those + // problems, please detail your unique predicament in a GitHub issue. + Function("r", "regeneratorRuntime = r")(runtime); +} + + +/***/ }), + +/***/ "../../node_modules/regexp.prototype.flags/implementation.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/regexp.prototype.flags/implementation.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toObject = Object; +var TypeErr = TypeError; + +module.exports = function flags() { + if (this != null && this !== toObject(this)) { + throw new TypeErr('RegExp.prototype.flags getter called on non-object'); + } + var result = ''; + if (this.global) { + result += 'g'; + } + if (this.ignoreCase) { + result += 'i'; + } + if (this.multiline) { + result += 'm'; + } + if (this.dotAll) { + result += 's'; + } + if (this.unicode) { + result += 'u'; + } + if (this.sticky) { + result += 'y'; + } + return result; +}; + + +/***/ }), + +/***/ "../../node_modules/regexp.prototype.flags/index.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/regexp.prototype.flags/index.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/regexp.prototype.flags/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/regexp.prototype.flags/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "../../node_modules/regexp.prototype.flags/shim.js"); + +var flagsBound = Function.call.bind(implementation); + +define(flagsBound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = flagsBound; + + +/***/ }), + +/***/ "../../node_modules/regexp.prototype.flags/polyfill.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/regexp.prototype.flags/polyfill.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/regexp.prototype.flags/implementation.js"); + +var supportsDescriptors = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js").supportsDescriptors; +var gOPD = Object.getOwnPropertyDescriptor; +var TypeErr = TypeError; + +module.exports = function getPolyfill() { + if (!supportsDescriptors) { + throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); + } + if (/a/mig.flags === 'gim') { + var descriptor = gOPD(RegExp.prototype, 'flags'); + if (descriptor && typeof descriptor.get === 'function' && typeof (/a/).dotAll === 'boolean') { + return descriptor.get; + } + } + return implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/regexp.prototype.flags/shim.js": +/*!***********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/regexp.prototype.flags/shim.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var supportsDescriptors = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js").supportsDescriptors; +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/regexp.prototype.flags/polyfill.js"); +var gOPD = Object.getOwnPropertyDescriptor; +var defineProperty = Object.defineProperty; +var TypeErr = TypeError; +var getProto = Object.getPrototypeOf; +var regex = /a/; + +module.exports = function shimFlags() { + if (!supportsDescriptors || !getProto) { + throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); + } + var polyfill = getPolyfill(); + var proto = getProto(regex); + var descriptor = gOPD(proto, 'flags'); + if (!descriptor || descriptor.get !== polyfill) { + defineProperty(proto, 'flags', { + configurable: true, + enumerable: false, + get: polyfill + }); + } + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/setimmediate/setImmediate.js": +/*!*********************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/setimmediate/setImmediate.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { + "use strict"; + + if (global.setImmediate) { + return; + } + + var nextHandle = 1; // Spec says greater than zero + var tasksByHandle = {}; + var currentlyRunningATask = false; + var doc = global.document; + var registerImmediate; + + function setImmediate(callback) { + // Callback can either be a function or a string + if (typeof callback !== "function") { + callback = new Function("" + callback); + } + // Copy function arguments + var args = new Array(arguments.length - 1); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i + 1]; + } + // Store and register the task + var task = { callback: callback, args: args }; + tasksByHandle[nextHandle] = task; + registerImmediate(nextHandle); + return nextHandle++; + } + + function clearImmediate(handle) { + delete tasksByHandle[handle]; + } + + function run(task) { + var callback = task.callback; + var args = task.args; + switch (args.length) { + case 0: + callback(); + break; + case 1: + callback(args[0]); + break; + case 2: + callback(args[0], args[1]); + break; + case 3: + callback(args[0], args[1], args[2]); + break; + default: + callback.apply(undefined, args); + break; + } + } + + function runIfPresent(handle) { + // From the spec: "Wait until any invocations of this algorithm started before this one have completed." + // So if we're currently running a task, we'll need to delay this invocation. + if (currentlyRunningATask) { + // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a + // "too much recursion" error. + setTimeout(runIfPresent, 0, handle); + } else { + var task = tasksByHandle[handle]; + if (task) { + currentlyRunningATask = true; + try { + run(task); + } finally { + clearImmediate(handle); + currentlyRunningATask = false; + } + } + } + } + + function installNextTickImplementation() { + registerImmediate = function(handle) { + process.nextTick(function () { runIfPresent(handle); }); + }; + } + + function canUsePostMessage() { + // The test against `importScripts` prevents this implementation from being installed inside a web worker, + // where `global.postMessage` means something completely different and can't be used for this purpose. + if (global.postMessage && !global.importScripts) { + var postMessageIsAsynchronous = true; + var oldOnMessage = global.onmessage; + global.onmessage = function() { + postMessageIsAsynchronous = false; + }; + global.postMessage("", "*"); + global.onmessage = oldOnMessage; + return postMessageIsAsynchronous; + } + } + + function installPostMessageImplementation() { + // Installs an event handler on `global` for the `message` event: see + // * https://developer.mozilla.org/en/DOM/window.postMessage + // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages + + var messagePrefix = "setImmediate$" + Math.random() + "$"; + var onGlobalMessage = function(event) { + if (event.source === global && + typeof event.data === "string" && + event.data.indexOf(messagePrefix) === 0) { + runIfPresent(+event.data.slice(messagePrefix.length)); + } + }; + + if (global.addEventListener) { + global.addEventListener("message", onGlobalMessage, false); + } else { + global.attachEvent("onmessage", onGlobalMessage); + } + + registerImmediate = function(handle) { + global.postMessage(messagePrefix + handle, "*"); + }; + } + + function installMessageChannelImplementation() { + var channel = new MessageChannel(); + channel.port1.onmessage = function(event) { + var handle = event.data; + runIfPresent(handle); + }; + + registerImmediate = function(handle) { + channel.port2.postMessage(handle); + }; + } + + function installReadyStateChangeImplementation() { + var html = doc.documentElement; + registerImmediate = function(handle) { + // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted + // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. + var script = doc.createElement("script"); + script.onreadystatechange = function () { + runIfPresent(handle); + script.onreadystatechange = null; + html.removeChild(script); + script = null; + }; + html.appendChild(script); + }; + } + + function installSetTimeoutImplementation() { + registerImmediate = function(handle) { + setTimeout(runIfPresent, 0, handle); + }; + } + + // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. + var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); + attachTo = attachTo && attachTo.setTimeout ? attachTo : global; + + // Don't get fooled by e.g. browserify environments. + if ({}.toString.call(global.process) === "[object process]") { + // For Node.js before 0.9 + installNextTickImplementation(); + + } else if (canUsePostMessage()) { + // For non-IE10 modern browsers + installPostMessageImplementation(); + + } else if (global.MessageChannel) { + // For web workers, where supported + installMessageChannelImplementation(); + + } else if (doc && "onreadystatechange" in doc.createElement("script")) { + // For IE 6–8 + installReadyStateChangeImplementation(); + + } else { + // For older browsers + installSetTimeoutImplementation(); + } + + attachTo.setImmediate = setImmediate; + attachTo.clearImmediate = clearImmediate; +}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "../../node_modules/process/browser.js"))) + +/***/ }), + +/***/ "../../node_modules/stable/stable.js": +/*!*********************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/stable/stable.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +//! stable.js 0.1.8, https://github.com/Two-Screen/stable +//! © 2018 Angry Bytes and contributors. MIT licensed. + +(function (global, factory) { + true ? module.exports = factory() : + undefined; +}(this, (function () { 'use strict'; + + // A stable array sort, because `Array#sort()` is not guaranteed stable. + // This is an implementation of merge sort, without recursion. + + var stable = function (arr, comp) { + return exec(arr.slice(), comp) + }; + + stable.inplace = function (arr, comp) { + var result = exec(arr, comp); + + // This simply copies back if the result isn't in the original array, + // which happens on an odd number of passes. + if (result !== arr) { + pass(result, null, arr.length, arr); + } + + return arr + }; + + // Execute the sort using the input array and a second buffer as work space. + // Returns one of those two, containing the final result. + function exec(arr, comp) { + if (typeof(comp) !== 'function') { + comp = function (a, b) { + return String(a).localeCompare(b) + }; + } + + // Short-circuit when there's nothing to sort. + var len = arr.length; + if (len <= 1) { + return arr + } + + // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. + // Chunks are the size of the left or right hand in merge sort. + // Stop when the left-hand covers all of the array. + var buffer = new Array(len); + for (var chk = 1; chk < len; chk *= 2) { + pass(arr, comp, chk, buffer); + + var tmp = arr; + arr = buffer; + buffer = tmp; + } + + return arr + } + + // Run a single pass with the given chunk size. + var pass = function (arr, comp, chk, result) { + var len = arr.length; + var i = 0; + // Step size / double chunk size. + var dbl = chk * 2; + // Bounds of the left and right chunks. + var l, r, e; + // Iterators over the left and right chunk. + var li, ri; + + // Iterate over pairs of chunks. + for (l = 0; l < len; l += dbl) { + r = l + chk; + e = r + chk; + if (r > len) r = len; + if (e > len) e = len; + + // Iterate both chunks in parallel. + li = l; + ri = r; + while (true) { + // Compare the chunks. + if (li < r && ri < e) { + // This works for a regular `sort()` compatible comparator, + // but also for a simple comparator like: `a > b` + if (comp(arr[li], arr[ri]) <= 0) { + result[i++] = arr[li++]; + } + else { + result[i++] = arr[ri++]; + } + } + // Nothing to compare, just flush what's left. + else if (li < r) { + result[i++] = arr[li++]; + } + else if (ri < e) { + result[i++] = arr[ri++]; + } + // Both iterators are at the chunk ends. + else { + break + } + } + } + }; + + return stable; + +}))); + + +/***/ }), + +/***/ "../../node_modules/string.prototype.padend/implementation.js": +/*!**********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.padend/implementation.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var ES = __webpack_require__(/*! es-abstract/es7 */ "../../node_modules/es-abstract/es7.js"); +var slice = bind.call(Function.call, String.prototype.slice); + +module.exports = function padEnd(maxLength) { + var O = ES.RequireObjectCoercible(this); + var S = ES.ToString(O); + var stringLength = ES.ToLength(S.length); + var fillString; + if (arguments.length > 1) { + fillString = arguments[1]; + } + var filler = typeof fillString === 'undefined' ? '' : ES.ToString(fillString); + if (filler === '') { + filler = ' '; + } + var intMaxLength = ES.ToLength(maxLength); + if (intMaxLength <= stringLength) { + return S; + } + var fillLen = intMaxLength - stringLength; + while (filler.length < fillLen) { + var fLen = filler.length; + var remainingCodeUnits = fillLen - fLen; + filler += fLen > remainingCodeUnits ? slice(filler, 0, remainingCodeUnits) : filler; + } + + var truncatedStringFiller = filler.length > fillLen ? slice(filler, 0, fillLen) : filler; + return S + truncatedStringFiller; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.padend/polyfill.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.padend/polyfill.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/string.prototype.padend/implementation.js"); + +module.exports = function getPolyfill() { + return typeof String.prototype.padEnd === 'function' ? String.prototype.padEnd : implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.padend/shim.js": +/*!************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.padend/shim.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/string.prototype.padend/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function shimPadEnd() { + var polyfill = getPolyfill(); + define(String.prototype, { padEnd: polyfill }, { padEnd: function () { return String.prototype.padEnd !== polyfill; } }); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.padstart/implementation.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.padstart/implementation.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var ES = __webpack_require__(/*! es-abstract/es7 */ "../../node_modules/es-abstract/es7.js"); +var slice = bind.call(Function.call, String.prototype.slice); + +module.exports = function padStart(maxLength) { + var O = ES.RequireObjectCoercible(this); + var S = ES.ToString(O); + var stringLength = ES.ToLength(S.length); + var fillString; + if (arguments.length > 1) { + fillString = arguments[1]; + } + var filler = typeof fillString === 'undefined' ? '' : ES.ToString(fillString); + if (filler === '') { + filler = ' '; + } + var intMaxLength = ES.ToLength(maxLength); + if (intMaxLength <= stringLength) { + return S; + } + var fillLen = intMaxLength - stringLength; + while (filler.length < fillLen) { + var fLen = filler.length; + var remainingCodeUnits = fillLen - fLen; + filler += fLen > remainingCodeUnits ? slice(filler, 0, remainingCodeUnits) : filler; + } + + var truncatedStringFiller = filler.length > fillLen ? slice(filler, 0, fillLen) : filler; + return truncatedStringFiller + S; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.padstart/polyfill.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.padstart/polyfill.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/string.prototype.padstart/implementation.js"); + +module.exports = function getPolyfill() { + return typeof String.prototype.padStart === 'function' ? String.prototype.padStart : implementation; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.padstart/shim.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.padstart/shim.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/string.prototype.padstart/polyfill.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +module.exports = function shimPadStart() { + var polyfill = getPolyfill(); + define(String.prototype, { padStart: polyfill }, { padStart: function () { return String.prototype.padStart !== polyfill; } }); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.trimleft/implementation.js": +/*!************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.trimleft/implementation.js ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var replace = bind.call(Function.call, String.prototype.replace); + +/* eslint-disable no-control-regex */ +var leftWhitespace = /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*/; +/* eslint-enable no-control-regex */ + +module.exports = function trimLeft() { + return replace(this, leftWhitespace, ''); +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.trimleft/index.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.trimleft/index.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/string.prototype.trimleft/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/string.prototype.trimleft/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "../../node_modules/string.prototype.trimleft/shim.js"); + +var bound = bind.call(Function.call, getPolyfill()); + +define(bound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = bound; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.trimleft/polyfill.js": +/*!******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.trimleft/polyfill.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/string.prototype.trimleft/implementation.js"); + +module.exports = function getPolyfill() { + if (!String.prototype.trimLeft) { + return implementation; + } + var zeroWidthSpace = '\u200b'; + if (zeroWidthSpace.trimLeft() !== zeroWidthSpace) { + return implementation; + } + return String.prototype.trimLeft; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.trimleft/shim.js": +/*!**************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.trimleft/shim.js ***! + \**************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/string.prototype.trimleft/polyfill.js"); + +module.exports = function shimTrimLeft() { + var polyfill = getPolyfill(); + define( + String.prototype, + { trimLeft: polyfill }, + { trimLeft: function () { return String.prototype.trimLeft !== polyfill; } } + ); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.trimright/implementation.js": +/*!*************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.trimright/implementation.js ***! + \*************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var replace = bind.call(Function.call, String.prototype.replace); + +/* eslint-disable no-control-regex */ +var rightWhitespace = /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]*$/; +/* eslint-enable no-control-regex */ + +module.exports = function trimRight() { + return replace(this, rightWhitespace, ''); +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.trimright/index.js": +/*!****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.trimright/index.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! function-bind */ "../../node_modules/function-bind/index.js"); +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/string.prototype.trimright/implementation.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/string.prototype.trimright/polyfill.js"); +var shim = __webpack_require__(/*! ./shim */ "../../node_modules/string.prototype.trimright/shim.js"); + +var bound = bind.call(Function.call, getPolyfill()); + +define(bound, { + getPolyfill: getPolyfill, + implementation: implementation, + shim: shim +}); + +module.exports = bound; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.trimright/polyfill.js": +/*!*******************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.trimright/polyfill.js ***! + \*******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/string.prototype.trimright/implementation.js"); + +module.exports = function getPolyfill() { + if (!String.prototype.trimRight) { + return implementation; + } + var zeroWidthSpace = '\u200b'; + if (zeroWidthSpace.trimRight() !== zeroWidthSpace) { + return implementation; + } + return String.prototype.trimRight; +}; + + +/***/ }), + +/***/ "../../node_modules/string.prototype.trimright/shim.js": +/*!***************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/string.prototype.trimright/shim.js ***! + \***************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var define = __webpack_require__(/*! define-properties */ "../../node_modules/define-properties/index.js"); +var getPolyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/string.prototype.trimright/polyfill.js"); + +module.exports = function shimTrimRight() { + var polyfill = getPolyfill(); + define( + String.prototype, + { trimRight: polyfill }, + { trimRight: function () { return String.prototype.trimRight !== polyfill; } } + ); + return polyfill; +}; + + +/***/ }), + +/***/ "../../node_modules/symbol.prototype.description/auto.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/symbol.prototype.description/auto.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! ./shim */ "../../node_modules/symbol.prototype.description/shim.js")(); + + +/***/ }), + +/***/ "../../node_modules/symbol.prototype.description/implementation.js": +/*!***************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/symbol.prototype.description/implementation.js ***! + \***************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var getSymbolDescription = __webpack_require__(/*! es-abstract/helpers/getSymbolDescription */ "../../node_modules/es-abstract/helpers/getSymbolDescription.js"); + +module.exports = function description() { + return getSymbolDescription(this); +}; + + +/***/ }), + +/***/ "../../node_modules/symbol.prototype.description/polyfill.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/symbol.prototype.description/polyfill.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); + +var implementation = __webpack_require__(/*! ./implementation */ "../../node_modules/symbol.prototype.description/implementation.js"); +var gOPD = Object.getOwnPropertyDescriptor; + +module.exports = function descriptionPolyfill() { + if (!hasSymbols || typeof gOPD !== 'function') { + return null; + } + + var desc = gOPD(Symbol.prototype, 'description'); + if (!desc || typeof desc.get !== 'function') { + return implementation; + } + + var emptySymbolDesc = desc.get.call(Symbol()); + var emptyDescValid = typeof emptySymbolDesc === 'undefined' || emptySymbolDesc === ''; + if (!emptyDescValid || desc.get.call(Symbol('a')) !== 'a') { + return implementation; + } + return desc.get; +}; + + +/***/ }), + +/***/ "../../node_modules/symbol.prototype.description/shim.js": +/*!*****************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/symbol.prototype.description/shim.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/has-symbols/index.js")(); +var polyfill = __webpack_require__(/*! ./polyfill */ "../../node_modules/symbol.prototype.description/polyfill.js"); +var getInferredName = __webpack_require__(/*! es-abstract/helpers/getInferredName */ "../../node_modules/es-abstract/helpers/getInferredName.js"); + +var gOPD = Object.getOwnPropertyDescriptor; +var dP = Object.defineProperty; +var setProto = Object.setPrototypeOf; + +var define = function defineGetter(getter) { + dP(Symbol.prototype, 'description', { + configurable: true, + enumerable: false, + get: getter + }); +}; + +var shimGlobal = function shimGlobalSymbol(getter) { + var origSym = Function.apply.bind(Symbol); + var emptyStrings = Object.create ? Object.create(null) : {}; + var SymNew = function Symbol() { + var sym = origSym(this, arguments); + if (arguments.length > 0 && arguments[0] === '') { + emptyStrings[sym] = true; + } + return sym; + }; + SymNew.prototype = Symbol.prototype; + setProto(SymNew, Symbol); + Symbol = SymNew; // eslint-disable-line no-native-reassign, no-global-assign + + var boundGetter = Function.call.bind(getter); + var wrappedGetter = function description() { + /* eslint no-invalid-this: 0 */ + var symbolDescription = boundGetter(this); + if (emptyStrings[this]) { + return ''; + } + return symbolDescription; + }; + define(wrappedGetter); + return wrappedGetter; +}; + +module.exports = function shimSymbolDescription() { + if (!hasSymbols) { + return false; + } + var desc = gOPD(Symbol.prototype, 'description'); + var getter = polyfill(); + var isMissing = !desc || typeof desc.get !== 'function'; + var isBroken = !isMissing && (typeof Symbol().description !== 'undefined' || Symbol('').description !== ''); + if (isMissing || isBroken) { + if (!getInferredName) { + return shimGlobal(getter); + } + define(getter); + } + return getter; +}; + + +/***/ }), + +/***/ "../../node_modules/telejson/dist/index.js": +/*!***************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/telejson/dist/index.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.parse = exports.stringify = exports.isJSON = exports.reviver = exports.replacer = void 0; + +var _isRegex = _interopRequireDefault(__webpack_require__(/*! is-regex */ "../../node_modules/is-regex/index.js")); + +var _isFunction = _interopRequireDefault(__webpack_require__(/*! is-function */ "../../node_modules/is-function/index.js")); + +var _isSymbol = _interopRequireDefault(__webpack_require__(/*! is-symbol */ "../../node_modules/telejson/node_modules/is-symbol/index.js")); + +var _isobject = _interopRequireDefault(__webpack_require__(/*! isobject */ "../../node_modules/telejson/node_modules/isobject/index.js")); + +var _get = _interopRequireDefault(__webpack_require__(/*! lodash/get */ "../../node_modules/lodash/get.js")); + +var _memoizerific = _interopRequireDefault(__webpack_require__(/*! memoizerific */ "../../node_modules/memoizerific/memoizerific.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +var isObject = _isobject["default"]; + +var removeCodeComments = function removeCodeComments(code) { + var inQuoteChar = null; + var inBlockComment = false; + var inLineComment = false; + var inRegexLiteral = false; + var newCode = ''; + + if (code.indexOf('//') >= 0 || code.indexOf('/*') >= 0) { + for (var i = 0; i < code.length; i += 1) { + if (!inQuoteChar && !inBlockComment && !inLineComment && !inRegexLiteral) { + if (code[i] === '"' || code[i] === "'" || code[i] === '`') { + inQuoteChar = code[i]; + } else if (code[i] === '/' && code[i + 1] === '*') { + inBlockComment = true; + } else if (code[i] === '/' && code[i + 1] === '/') { + inLineComment = true; + } else if (code[i] === '/' && code[i + 1] !== '/') { + inRegexLiteral = true; + } + } else { + if (inQuoteChar && (code[i] === inQuoteChar && code[i - 1] !== '\\' || code[i] === '\n' && inQuoteChar !== '`')) { + inQuoteChar = null; + } + + if (inRegexLiteral && (code[i] === '/' && code[i - 1] !== '\\' || code[i] === '\n')) { + inRegexLiteral = false; + } + + if (inBlockComment && code[i - 1] === '/' && code[i - 2] === '*') { + inBlockComment = false; + } + + if (inLineComment && code[i] === '\n') { + inLineComment = false; + } + } + + if (!inBlockComment && !inLineComment) { + newCode += code[i]; + } + } + } else { + newCode = code; + } + + return newCode; +}; + +var cleanCode = (0, _memoizerific["default"])(10000)(function (code) { + return removeCodeComments(code).replace(/\n\s*/g, '') // remove indents & newlines + .trim(); +}); + +var convertShorthandMethods = function convertShorthandMethods(key, stringified) { + var fnHead = stringified.slice(0, stringified.indexOf('{')); + var fnBody = stringified.slice(stringified.indexOf('{')); + + if (fnHead.includes('=>')) { + // This is an arrow function + return stringified; + } + + if (fnHead.includes('function')) { + // This is an anonymous function + return stringified; + } + + var modifiedHead = fnHead; + modifiedHead = modifiedHead.replace(key, 'function'); + return modifiedHead + fnBody; +}; + +var dateFormat = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/; + +var replacer = function replacer(options) { + var objects; + var stack; + var keys; + return function replace(key, value) { + try { + // very first iteration + if (key === '') { + keys = ['root']; + objects = [{ + keys: 'root', + value: value + }]; + stack = []; + return value; + } // From the JSON.stringify's doc: + // "The object in which the key was found is provided as the replacer's this parameter." thus one can control the depth + + + while (stack.length && this !== stack[0]) { + stack.shift(); + keys.pop(); + } + + if ((0, _isRegex["default"])(value)) { + if (!options.allowRegExp) { + return undefined; + } + + return "_regexp_".concat(value.flags, "|").concat(value.source); + } + + if ((0, _isFunction["default"])(value)) { + if (!options.allowFunction) { + return undefined; + } + + var name = value.name; + var stringified = value.toString(); + + if (!stringified.match(/(\[native code\]|WEBPACK_IMPORTED_MODULE|__webpack_exports__|__webpack_require__)/)) { + return "_function_".concat(name, "|").concat(cleanCode(convertShorthandMethods(key, stringified))); + } + + return "_function_".concat(name, "|").concat(function () {}.toString()); + } + + if ((0, _isSymbol["default"])(value)) { + if (!options.allowSymbol) { + return undefined; + } + + return "_symbol_".concat(value.toString().slice(7, -1)); + } + + if (typeof value === 'string' && dateFormat.test(value)) { + if (!options.allowDate) { + return undefined; + } + + return "_date_".concat(value); + } + + if (value === undefined) { + if (!options.allowUndefined) { + return undefined; + } + + return '_undefined_'; + } + + if (typeof value === 'number') { + if (value === -Infinity) { + return '_-Infinity_'; + } + + if (value === Infinity) { + return '_Infinity_'; + } + + if (Number.isNaN(value)) { + return '_NaN_'; + } + + return value; + } + + if (typeof value === 'string') { + return value; + } + + if (typeof value === 'boolean') { + return value; + } + + if (stack.length >= options.maxDepth) { + if (Array.isArray(value)) { + return "[Array(".concat(value.length, ")]"); + } + + return '[Object]'; + } + + var found = objects.find(function (o) { + return o.value === value; + }); + + if (!found) { + if (value && isObject(value) && value.constructor && value.constructor.name && value.constructor.name !== 'Object') { + if (!options.allowClass) { + return undefined; + } + + try { + Object.assign(value, { + '_constructor-name_': value.constructor.name + }); + } catch (e) {// immutable objects can't be written to and throw + // we could make a deep copy but if the user values the correct instance name, + // the user should make the deep copy themselves. + } + } + + keys.push(key); + stack.unshift(value); + objects.push({ + keys: keys.join('.'), + value: value + }); + return value; + } // actually, here's the only place where the keys keeping is useful + + + return "_duplicate_".concat(found.keys); + } catch (e) { + return undefined; + } + }; +}; + +exports.replacer = replacer; + +var reviver = function reviver(options) { + var refs = []; + var root; + return function revive(key, value) { + // last iteration = root + if (key === '') { + root = value; // restore cyclic refs + + refs.forEach(function (_ref) { + var target = _ref.target, + container = _ref.container, + replacement = _ref.replacement; + + if (replacement === 'root') { + // eslint-disable-next-line no-param-reassign + container[target] = root; + } else { + // eslint-disable-next-line no-param-reassign + container[target] = (0, _get["default"])(root, replacement.replace('root.', '')); + } + }); + } + + if (key === '_constructor-name_') { + return value; + } // deal with instance names + + + if (isObject(value) && value['_constructor-name_']) { + var name = value['_constructor-name_']; + + if (name !== 'Object') { + // eslint-disable-next-line no-new-func + var Fn = new Function("return function ".concat(name, "(){}"))(); + Object.setPrototypeOf(value, new Fn()); + } // eslint-disable-next-line no-param-reassign + + + delete value['_constructor-name_']; + return value; + } + + if (typeof value === 'string' && value.startsWith('_function_')) { + var _ref2 = value.match(/_function_([^|]*)\|(.*)/) || [], + _ref3 = _slicedToArray(_ref2, 3), + _name = _ref3[1], + source = _ref3[2]; + + if (!options.lazyEval) { + // eslint-disable-next-line no-eval + return eval("(".concat(source, ")")); + } // lazy eval of the function + + + var result = function result() { + // eslint-disable-next-line no-eval + var f = eval("(".concat(source, ")")); + return f.apply(void 0, arguments); + }; + + Object.defineProperty(result, 'toString', { + value: function value() { + return source; + } + }); + Object.defineProperty(result, 'name', { + value: _name + }); + return result; + } + + if (typeof value === 'string' && value.startsWith('_regexp_')) { + // this split isn't working correctly + var _ref4 = value.match(/_regexp_([^|]*)\|(.*)/) || [], + _ref5 = _slicedToArray(_ref4, 3), + flags = _ref5[1], + _source = _ref5[2]; + + return new RegExp(_source, flags); + } + + if (typeof value === 'string' && value.startsWith('_date_')) { + return new Date(value.replace('_date_', '')); + } + + if (typeof value === 'string' && value.startsWith('_duplicate_')) { + refs.push({ + target: key, + container: this, + replacement: value.replace('_duplicate_', '') + }); + return null; + } + + if (typeof value === 'string' && value.startsWith('_symbol_')) { + return Symbol(value.replace('_symbol_', '')); + } + + if (typeof value === 'string' && value === '_-Infinity_') { + return -Infinity; + } + + if (typeof value === 'string' && value === '_Infinity_') { + return Infinity; + } + + if (typeof value === 'string' && value === '_NaN_') { + return NaN; + } + + return value; + }; +}; // eslint-disable-next-line no-useless-escape + + +exports.reviver = reviver; + +var isJSON = function isJSON(input) { + return input.match(/^[\[\{\"\}].*[\]\}\"]$/); +}; + +exports.isJSON = isJSON; +var defaultOptions = { + maxDepth: 10, + space: undefined, + allowFunction: true, + allowRegExp: true, + allowDate: true, + allowClass: true, + allowUndefined: true, + allowSymbol: true, + lazyEval: true +}; + +var stringify = function stringify(data) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var mergedOptions = _objectSpread({}, defaultOptions, {}, options); + + return JSON.stringify(data, replacer(mergedOptions), options.space); +}; + +exports.stringify = stringify; + +var mutator = function mutator() { + var mutated = []; + return function mutateUndefined(value) { + // JSON.parse will not output keys with value of undefined + // we map over a deeply nester object, if we find any value with `_undefined_`, we mutate it to be undefined + if (isObject(value)) { + Object.entries(value).forEach(function (_ref6) { + var _ref7 = _slicedToArray(_ref6, 2), + k = _ref7[0], + v = _ref7[1]; + + if (v === '_undefined_') { + // eslint-disable-next-line no-param-reassign + value[k] = undefined; + } else if (!mutated.includes(v)) { + mutated.push(v); + mutateUndefined(v); + } + }); + } + + if (Array.isArray(value)) { + value.forEach(function (v) { + mutated.push(v); + mutateUndefined(v); + }); + } + }; +}; + +var parse = function parse(data) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var mergedOptions = _objectSpread({}, defaultOptions, {}, options); + + var result = JSON.parse(data, reviver(mergedOptions)); + mutator()(result); + return result; +}; + +exports.parse = parse; + +/***/ }), + +/***/ "../../node_modules/telejson/node_modules/has-symbols/index.js": +/*!***********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/telejson/node_modules/has-symbols/index.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var origSymbol = global.Symbol; +var hasSymbolSham = __webpack_require__(/*! ./shams */ "../../node_modules/telejson/node_modules/has-symbols/shams.js"); + +module.exports = function hasNativeSymbols() { + if (typeof origSymbol !== 'function') { return false; } + if (typeof Symbol !== 'function') { return false; } + if (typeof origSymbol('foo') !== 'symbol') { return false; } + if (typeof Symbol('bar') !== 'symbol') { return false; } + + return hasSymbolSham(); +}; + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/telejson/node_modules/has-symbols/shams.js": +/*!***********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/telejson/node_modules/has-symbols/shams.js ***! + \***********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + var obj = {}; + var sym = Symbol('test'); + var symObj = Object(sym); + if (typeof sym === 'string') { return false; } + + if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } + if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax + if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } + + if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } + + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { return false; } + + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } + + if (typeof Object.getOwnPropertyDescriptor === 'function') { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + + +/***/ }), + +/***/ "../../node_modules/telejson/node_modules/is-symbol/index.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/telejson/node_modules/is-symbol/index.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var toStr = Object.prototype.toString; +var hasSymbols = __webpack_require__(/*! has-symbols */ "../../node_modules/telejson/node_modules/has-symbols/index.js")(); + +if (hasSymbols) { + var symToStr = Symbol.prototype.toString; + var symStringRegex = /^Symbol\(.*\)$/; + var isSymbolObject = function isRealSymbolObject(value) { + if (typeof value.valueOf() !== 'symbol') { + return false; + } + return symStringRegex.test(symToStr.call(value)); + }; + + module.exports = function isSymbol(value) { + if (typeof value === 'symbol') { + return true; + } + if (toStr.call(value) !== '[object Symbol]') { + return false; + } + try { + return isSymbolObject(value); + } catch (e) { + return false; + } + }; +} else { + + module.exports = function isSymbol(value) { + // this environment does not support Symbols. + return false && false; + }; +} + + +/***/ }), + +/***/ "../../node_modules/telejson/node_modules/isobject/index.js": +/*!********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/telejson/node_modules/isobject/index.js ***! + \********************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return isObject; }); +/*! + * isobject <https://github.com/jonschlinkert/isobject> + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; + + +/***/ }), + +/***/ "../../node_modules/timers-browserify/main.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/timers-browserify/main.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) || + (typeof self !== "undefined" && self) || + window; +var apply = Function.prototype.apply; + +// DOM APIs, for completeness + +exports.setTimeout = function() { + return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); +}; +exports.setInterval = function() { + return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); +}; +exports.clearTimeout = +exports.clearInterval = function(timeout) { + if (timeout) { + timeout.close(); + } +}; + +function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; +} +Timeout.prototype.unref = Timeout.prototype.ref = function() {}; +Timeout.prototype.close = function() { + this._clearFn.call(scope, this._id); +}; + +// Does not start the time, just sets up the members needed. +exports.enroll = function(item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; +}; + +exports.unenroll = function(item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; +}; + +exports._unrefActive = exports.active = function(item) { + clearTimeout(item._idleTimeoutId); + + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } +}; + +// setimmediate attaches itself to the global object +__webpack_require__(/*! setimmediate */ "../../node_modules/setimmediate/setImmediate.js"); +// On some exotic environments, it's not clear which object `setimmediate` was +// able to install onto. Search each possibility in the same order as the +// `setimmediate` library. +exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || + (typeof global !== "undefined" && global.setImmediate) || + (this && this.setImmediate); +exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || + (typeof global !== "undefined" && global.clearImmediate) || + (this && this.clearImmediate); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/ts-dedent/dist/index.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/ts-dedent/dist/index.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function dedent(templ) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + var strings = Array.from(typeof templ === 'string' ? [templ] : templ.raw); + strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, ''); + var indentLengths = strings.reduce(function (arr, str) { + var matches = str.match(/\n[\t ]+/g); + if (matches) { + return arr.concat(matches.map(function (match) { return match.length - 1; })); + } + return arr; + }, []); + if (indentLengths.length) { + var pattern_1 = new RegExp("\n[\t ]{" + Math.min.apply(Math, indentLengths) + "}", 'g'); + strings = strings.map(function (str) { return str.replace(pattern_1, '\n'); }); + } + strings[0] = strings[0].replace(/^\r?\n/, ''); + var string = strings[0]; + values.forEach(function (value, i) { + string += value + strings[i + 1]; + }); + return string; +} +exports.dedent = dedent; +exports.default = dedent; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ "../../node_modules/util-deprecate/browser.js": +/*!******************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/util-deprecate/browser.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) { +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/uuid/lib/bytesToUuid.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/uuid/lib/bytesToUuid.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ +var byteToHex = []; +for (var i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); +} + +function bytesToUuid(buf, offset) { + var i = offset || 0; + var bth = byteToHex; + // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + return ([bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], '-', + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]], + bth[buf[i++]], bth[buf[i++]]]).join(''); +} + +module.exports = bytesToUuid; + + +/***/ }), + +/***/ "../../node_modules/uuid/lib/rng-browser.js": +/*!****************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/uuid/lib/rng-browser.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// Unique ID creation requires a high quality random # generator. In the +// browser this is a little complicated due to unknown quality of Math.random() +// and inconsistent support for the `crypto` API. We do the best we can via +// feature-detection + +// getRandomValues needs to be invoked in a context where "this" is a Crypto +// implementation. Also, find the complete implementation of crypto on IE11. +var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) || + (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto)); + +if (getRandomValues) { + // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto + var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef + + module.exports = function whatwgRNG() { + getRandomValues(rnds8); + return rnds8; + }; +} else { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var rnds = new Array(16); + + module.exports = function mathRNG() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return rnds; + }; +} + + +/***/ }), + +/***/ "../../node_modules/uuid/v4.js": +/*!***************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/uuid/v4.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var rng = __webpack_require__(/*! ./lib/rng */ "../../node_modules/uuid/lib/rng-browser.js"); +var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ "../../node_modules/uuid/lib/bytesToUuid.js"); + +function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || bytesToUuid(rnds); +} + +module.exports = v4; + + +/***/ }), + +/***/ "../../node_modules/webpack-hot-middleware/client-overlay.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/webpack-hot-middleware/client-overlay.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/*eslint-env browser*/ + +var clientOverlay = document.createElement('div'); +clientOverlay.id = 'webpack-hot-middleware-clientOverlay'; +var styles = { + background: 'rgba(0,0,0,0.85)', + color: '#e8e8e8', + lineHeight: '1.6', + whiteSpace: 'pre', + fontFamily: 'Menlo, Consolas, monospace', + fontSize: '13px', + position: 'fixed', + zIndex: 9999, + padding: '10px', + left: 0, + right: 0, + top: 0, + bottom: 0, + overflow: 'auto', + dir: 'ltr', + textAlign: 'left', +}; + +var ansiHTML = __webpack_require__(/*! ansi-html */ "../../node_modules/ansi-html/index.js"); +var colors = { + reset: ['transparent', 'transparent'], + black: '181818', + red: 'ff3348', + green: '3fff4f', + yellow: 'ffd30e', + blue: '169be0', + magenta: 'f840b7', + cyan: '0ad8e9', + lightgrey: 'ebe7e3', + darkgrey: '6d7891', +}; + +var Entities = __webpack_require__(/*! html-entities */ "../../node_modules/html-entities/index.js").AllHtmlEntities; +var entities = new Entities(); + +function showProblems(type, lines) { + clientOverlay.innerHTML = ''; + lines.forEach(function(msg) { + msg = ansiHTML(entities.encode(msg)); + var div = document.createElement('div'); + div.style.marginBottom = '26px'; + div.innerHTML = problemType(type) + ' in ' + msg; + clientOverlay.appendChild(div); + }); + if (document.body) { + document.body.appendChild(clientOverlay); + } +} + +function clear() { + if (document.body && clientOverlay.parentNode) { + document.body.removeChild(clientOverlay); + } +} + +function problemType(type) { + var problemColors = { + errors: colors.red, + warnings: colors.yellow, + }; + var color = problemColors[type] || colors.red; + return ( + '<span style="background-color:#' + + color + + '; color:#000000; padding:3px 6px; border-radius: 4px;">' + + type.slice(0, -1).toUpperCase() + + '</span>' + ); +} + +module.exports = function(options) { + for (var color in options.ansiColors) { + if (color in colors) { + colors[color] = options.ansiColors[color]; + } + ansiHTML.setColors(colors); + } + + for (var style in options.overlayStyles) { + styles[style] = options.overlayStyles[style]; + } + + for (var key in styles) { + clientOverlay.style[key] = styles[key]; + } + + return { + showProblems: showProblems, + clear: clear, + }; +}; + +module.exports.clear = clear; +module.exports.showProblems = showProblems; + + +/***/ }), + +/***/ "../../node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/webpack-hot-middleware/client.js?reload=true&quiet=true ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(__resourceQuery, module) {/*eslint-env browser*/ +/*global __resourceQuery __webpack_public_path__*/ + +var options = { + path: '/__webpack_hmr', + timeout: 20 * 1000, + overlay: true, + reload: false, + log: true, + warn: true, + name: '', + autoConnect: true, + overlayStyles: {}, + overlayWarnings: false, + ansiColors: {}, +}; +if (true) { + var querystring = __webpack_require__(/*! querystring */ "../../node_modules/querystring-es3/index.js"); + var overrides = querystring.parse(__resourceQuery.slice(1)); + setOverrides(overrides); +} + +if (typeof window === 'undefined') { + // do nothing +} else if (typeof window.EventSource === 'undefined') { + console.warn( + "webpack-hot-middleware's client requires EventSource to work. " + + 'You should include a polyfill if you want to support this browser: ' + + 'https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events#Tools' + ); +} else { + if (options.autoConnect) { + connect(); + } +} + +/* istanbul ignore next */ +function setOptionsAndConnect(overrides) { + setOverrides(overrides); + connect(); +} + +function setOverrides(overrides) { + if (overrides.autoConnect) + options.autoConnect = overrides.autoConnect == 'true'; + if (overrides.path) options.path = overrides.path; + if (overrides.timeout) options.timeout = overrides.timeout; + if (overrides.overlay) options.overlay = overrides.overlay !== 'false'; + if (overrides.reload) options.reload = overrides.reload !== 'false'; + if (overrides.noInfo && overrides.noInfo !== 'false') { + options.log = false; + } + if (overrides.name) { + options.name = overrides.name; + } + if (overrides.quiet && overrides.quiet !== 'false') { + options.log = false; + options.warn = false; + } + + if (overrides.dynamicPublicPath) { + options.path = __webpack_require__.p + options.path; + } + + if (overrides.ansiColors) + options.ansiColors = JSON.parse(overrides.ansiColors); + if (overrides.overlayStyles) + options.overlayStyles = JSON.parse(overrides.overlayStyles); + + if (overrides.overlayWarnings) { + options.overlayWarnings = overrides.overlayWarnings == 'true'; + } +} + +function EventSourceWrapper() { + var source; + var lastActivity = new Date(); + var listeners = []; + + init(); + var timer = setInterval(function() { + if (new Date() - lastActivity > options.timeout) { + handleDisconnect(); + } + }, options.timeout / 2); + + function init() { + source = new window.EventSource(options.path); + source.onopen = handleOnline; + source.onerror = handleDisconnect; + source.onmessage = handleMessage; + } + + function handleOnline() { + if (options.log) console.log('[HMR] connected'); + lastActivity = new Date(); + } + + function handleMessage(event) { + lastActivity = new Date(); + for (var i = 0; i < listeners.length; i++) { + listeners[i](event); + } + } + + function handleDisconnect() { + clearInterval(timer); + source.close(); + setTimeout(init, options.timeout); + } + + return { + addMessageListener: function(fn) { + listeners.push(fn); + }, + }; +} + +function getEventSourceWrapper() { + if (!window.__whmEventSourceWrapper) { + window.__whmEventSourceWrapper = {}; + } + if (!window.__whmEventSourceWrapper[options.path]) { + // cache the wrapper for other entries loaded on + // the same page with the same options.path + window.__whmEventSourceWrapper[options.path] = EventSourceWrapper(); + } + return window.__whmEventSourceWrapper[options.path]; +} + +function connect() { + getEventSourceWrapper().addMessageListener(handleMessage); + + function handleMessage(event) { + if (event.data == '\uD83D\uDC93') { + return; + } + try { + processMessage(JSON.parse(event.data)); + } catch (ex) { + if (options.warn) { + console.warn('Invalid HMR message: ' + event.data + '\n' + ex); + } + } + } +} + +// the reporter needs to be a singleton on the page +// in case the client is being used by multiple bundles +// we only want to report once. +// all the errors will go to all clients +var singletonKey = '__webpack_hot_middleware_reporter__'; +var reporter; +if (typeof window !== 'undefined') { + if (!window[singletonKey]) { + window[singletonKey] = createReporter(); + } + reporter = window[singletonKey]; +} + +function createReporter() { + var strip = __webpack_require__(/*! strip-ansi */ "../../node_modules/webpack-hot-middleware/node_modules/strip-ansi/index.js"); + + var overlay; + if (typeof document !== 'undefined' && options.overlay) { + overlay = __webpack_require__(/*! ./client-overlay */ "../../node_modules/webpack-hot-middleware/client-overlay.js")({ + ansiColors: options.ansiColors, + overlayStyles: options.overlayStyles, + }); + } + + var styles = { + errors: 'color: #ff0000;', + warnings: 'color: #999933;', + }; + var previousProblems = null; + function log(type, obj) { + var newProblems = obj[type] + .map(function(msg) { + return strip(msg); + }) + .join('\n'); + if (previousProblems == newProblems) { + return; + } else { + previousProblems = newProblems; + } + + var style = styles[type]; + var name = obj.name ? "'" + obj.name + "' " : ''; + var title = '[HMR] bundle ' + name + 'has ' + obj[type].length + ' ' + type; + // NOTE: console.warn or console.error will print the stack trace + // which isn't helpful here, so using console.log to escape it. + if (console.group && console.groupEnd) { + console.group('%c' + title, style); + console.log('%c' + newProblems, style); + console.groupEnd(); + } else { + console.log( + '%c' + title + '\n\t%c' + newProblems.replace(/\n/g, '\n\t'), + style + 'font-weight: bold;', + style + 'font-weight: normal;' + ); + } + } + + return { + cleanProblemsCache: function() { + previousProblems = null; + }, + problems: function(type, obj) { + if (options.warn) { + log(type, obj); + } + if (overlay) { + if (options.overlayWarnings || type === 'errors') { + overlay.showProblems(type, obj[type]); + return false; + } + overlay.clear(); + } + return true; + }, + success: function() { + if (overlay) overlay.clear(); + }, + useCustomOverlay: function(customOverlay) { + overlay = customOverlay; + }, + }; +} + +var processUpdate = __webpack_require__(/*! ./process-update */ "../../node_modules/webpack-hot-middleware/process-update.js"); + +var customHandler; +var subscribeAllHandler; +function processMessage(obj) { + switch (obj.action) { + case 'building': + if (options.log) { + console.log( + '[HMR] bundle ' + + (obj.name ? "'" + obj.name + "' " : '') + + 'rebuilding' + ); + } + break; + case 'built': + if (options.log) { + console.log( + '[HMR] bundle ' + + (obj.name ? "'" + obj.name + "' " : '') + + 'rebuilt in ' + + obj.time + + 'ms' + ); + } + // fall through + case 'sync': + if (obj.name && options.name && obj.name !== options.name) { + return; + } + var applyUpdate = true; + if (obj.errors.length > 0) { + if (reporter) reporter.problems('errors', obj); + applyUpdate = false; + } else if (obj.warnings.length > 0) { + if (reporter) { + var overlayShown = reporter.problems('warnings', obj); + applyUpdate = overlayShown; + } + } else { + if (reporter) { + reporter.cleanProblemsCache(); + reporter.success(); + } + } + if (applyUpdate) { + processUpdate(obj.hash, obj.modules, options); + } + break; + default: + if (customHandler) { + customHandler(obj); + } + } + + if (subscribeAllHandler) { + subscribeAllHandler(obj); + } +} + +if (module) { + module.exports = { + subscribeAll: function subscribeAll(handler) { + subscribeAllHandler = handler; + }, + subscribe: function subscribe(handler) { + customHandler = handler; + }, + useCustomOverlay: function useCustomOverlay(customOverlay) { + if (reporter) reporter.useCustomOverlay(customOverlay); + }, + setOptionsAndConnect: setOptionsAndConnect, + }; +} + +/* WEBPACK VAR INJECTION */}.call(this, "?reload=true&quiet=true", __webpack_require__(/*! ./../../examples/react/node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "../../node_modules/webpack-hot-middleware/node_modules/strip-ansi/index.js": +/*!************************************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/webpack-hot-middleware/node_modules/strip-ansi/index.js ***! + \************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ansiRegex = __webpack_require__(/*! ansi-regex */ "../../node_modules/ansi-regex/index.js")(); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; + + +/***/ }), + +/***/ "../../node_modules/webpack-hot-middleware/process-update.js": +/*!*********************************************************************************************!*\ + !*** /Users/joel.arvidsson/Code/loki/node_modules/webpack-hot-middleware/process-update.js ***! + \*********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * Based heavily on https://github.com/webpack/webpack/blob/ + * c0afdf9c6abc1dd70707c594e473802a566f7b6e/hot/only-dev-server.js + * Original copyright Tobias Koppers @sokra (MIT license) + */ + +/* global window __webpack_hash__ */ + +if (false) {} + +var hmrDocsUrl = 'https://webpack.js.org/concepts/hot-module-replacement/'; // eslint-disable-line max-len + +var lastHash; +var failureStatuses = { abort: 1, fail: 1 }; +var applyOptions = { + ignoreUnaccepted: true, + ignoreDeclined: true, + ignoreErrored: true, + onUnaccepted: function(data) { + console.warn( + 'Ignored an update to unaccepted module ' + data.chain.join(' -> ') + ); + }, + onDeclined: function(data) { + console.warn( + 'Ignored an update to declined module ' + data.chain.join(' -> ') + ); + }, + onErrored: function(data) { + console.error(data.error); + console.warn( + 'Ignored an error while updating module ' + + data.moduleId + + ' (' + + data.type + + ')' + ); + }, +}; + +function upToDate(hash) { + if (hash) lastHash = hash; + return lastHash == __webpack_require__.h(); +} + +module.exports = function(hash, moduleMap, options) { + var reload = options.reload; + if (!upToDate(hash) && module.hot.status() == 'idle') { + if (options.log) console.log('[HMR] Checking for updates on the server...'); + check(); + } + + function check() { + var cb = function(err, updatedModules) { + if (err) return handleError(err); + + if (!updatedModules) { + if (options.warn) { + console.warn('[HMR] Cannot find update (Full reload needed)'); + console.warn('[HMR] (Probably because of restarting the server)'); + } + performReload(); + return null; + } + + var applyCallback = function(applyErr, renewedModules) { + if (applyErr) return handleError(applyErr); + + if (!upToDate()) check(); + + logUpdates(updatedModules, renewedModules); + }; + + var applyResult = module.hot.apply(applyOptions, applyCallback); + // webpack 2 promise + if (applyResult && applyResult.then) { + // HotModuleReplacement.runtime.js refers to the result as `outdatedModules` + applyResult.then(function(outdatedModules) { + applyCallback(null, outdatedModules); + }); + applyResult.catch(applyCallback); + } + }; + + var result = module.hot.check(false, cb); + // webpack 2 promise + if (result && result.then) { + result.then(function(updatedModules) { + cb(null, updatedModules); + }); + result.catch(cb); + } + } + + function logUpdates(updatedModules, renewedModules) { + var unacceptedModules = updatedModules.filter(function(moduleId) { + return renewedModules && renewedModules.indexOf(moduleId) < 0; + }); + + if (unacceptedModules.length > 0) { + if (options.warn) { + console.warn( + "[HMR] The following modules couldn't be hot updated: " + + '(Full reload needed)\n' + + 'This is usually because the modules which have changed ' + + '(and their parents) do not know how to hot reload themselves. ' + + 'See ' + + hmrDocsUrl + + ' for more details.' + ); + unacceptedModules.forEach(function(moduleId) { + console.warn('[HMR] - ' + (moduleMap[moduleId] || moduleId)); + }); + } + performReload(); + return; + } + + if (options.log) { + if (!renewedModules || renewedModules.length === 0) { + console.log('[HMR] Nothing hot updated.'); + } else { + console.log('[HMR] Updated modules:'); + renewedModules.forEach(function(moduleId) { + console.log('[HMR] - ' + (moduleMap[moduleId] || moduleId)); + }); + } + + if (upToDate()) { + console.log('[HMR] App is up to date.'); + } + } + } + + function handleError(err) { + if (module.hot.status() in failureStatuses) { + if (options.warn) { + console.warn('[HMR] Cannot check for update (Full reload needed)'); + console.warn('[HMR] ' + (err.stack || err.message)); + } + performReload(); + return; + } + if (options.warn) { + console.warn('[HMR] Update check failed: ' + (err.stack || err.message)); + } + } + + function performReload() { + if (reload) { + if (options.warn) console.warn('[HMR] Reloading page'); + window.location.reload(); + } + } +}; + + +/***/ }), + +/***/ "./node_modules/@storybook/addon-links/dist/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/@storybook/addon-links/dist/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { + +__webpack_require__(/*! core-js/modules/es.array.slice */ "../../node_modules/core-js/modules/es.array.slice.js"); + +__webpack_require__(/*! core-js/modules/es.object.define-properties */ "../../node_modules/core-js/modules/es.object.define-properties.js"); + +__webpack_require__(/*! core-js/modules/es.object.freeze */ "../../node_modules/core-js/modules/es.object.freeze.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.LinkTo = LinkTo; +Object.defineProperty(exports, "linkTo", { + enumerable: true, + get: function get() { + return _preview.linkTo; + } +}); +Object.defineProperty(exports, "hrefTo", { + enumerable: true, + get: function get() { + return _preview.hrefTo; + } +}); +Object.defineProperty(exports, "withLinks", { + enumerable: true, + get: function get() { + return _preview.withLinks; + } +}); + +var _tsDedent = _interopRequireDefault(__webpack_require__(/*! ts-dedent */ "../../node_modules/ts-dedent/dist/index.js")); + +var _preview = __webpack_require__(/*! ./preview */ "./node_modules/@storybook/addon-links/dist/preview.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _templateObject() { + var data = _taggedTemplateLiteral(["\n LinkTo has moved to addon-links/react:\n import LinkTo from '@storybook/addon-links/react';\n "]); + + _templateObject = function _templateObject() { + return data; + }; + + return data; +} + +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var hasWarned = false; + +function LinkTo() { + if (!hasWarned) { + // eslint-disable-next-line no-console + console.error((0, _tsDedent["default"])(_templateObject())); + hasWarned = true; + } + + return null; +} + +if (module && module.hot && module.hot.decline) { + module.hot.decline(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/@storybook/addon-links/dist/preview.js": +/*!*************************************************************!*\ + !*** ./node_modules/@storybook/addon-links/dist/preview.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.find */ "../../node_modules/core-js/modules/es.array.find.js"); + +__webpack_require__(/*! core-js/modules/es.array.from */ "../../node_modules/core-js/modules/es.array.from.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.promise */ "../../node_modules/core-js/modules/es.promise.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.string.search */ "../../node_modules/core-js/modules/es.string.search.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.withLinks = exports.hrefTo = exports.linkTo = exports.navigate = void 0; + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "../../node_modules/qs/lib/index.js")); + +var _addons = _interopRequireDefault(__webpack_require__(/*! @storybook/addons */ "../../node_modules/@storybook/addons/dist/public_api.js")); + +var _coreEvents = __webpack_require__(/*! @storybook/core-events */ "../../node_modules/@storybook/core-events/dist/index.js"); + +var _csf = __webpack_require__(/*! @storybook/csf */ "../../node_modules/@storybook/csf/dist/index.js"); + +var _clientLogger = __webpack_require__(/*! @storybook/client-logger */ "../../node_modules/@storybook/client-logger/dist/index.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +var navigate = function navigate(params) { + return _addons["default"].getChannel().emit(_coreEvents.SELECT_STORY, params); +}; + +exports.navigate = navigate; + +var generateUrl = function generateUrl(id) { + var location = _global.document.location; + + var query = _qs["default"].parse(location.search, { + ignoreQueryPrefix: true + }); + + return "".concat(location.origin + location.pathname, "?").concat(_qs["default"].stringify(Object.assign({}, query, { + id: id + }), { + encode: false + })); +}; + +var valueOrCall = function valueOrCall(args) { + return function (value) { + return typeof value === 'function' ? value.apply(void 0, _toConsumableArray(args)) : value; + }; +}; + +var linkTo = function linkTo(idOrKindInput, storyInput) { + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var resolver = valueOrCall(args); + + var _storyStore$getSelect = _global.__STORYBOOK_STORY_STORE__.getSelection(), + storyId = _storyStore$getSelect.storyId; + + var current = _global.__STORYBOOK_STORY_STORE__.fromId(storyId) || {}; + var kindVal = resolver(idOrKindInput); + var storyVal = resolver(storyInput); + + var fromid = _global.__STORYBOOK_STORY_STORE__.fromId(kindVal); + + var item = fromid || _global.__STORYBOOK_CLIENT_API__.raw().find(function (i) { + if (kindVal && storyVal) { + return i.kind === kindVal && i.story === storyVal; + } + + if (!kindVal && storyVal) { + return i.kind === current.kind && i.story === storyVal; + } + + if (kindVal && !storyVal) { + return i.kind === kindVal; + } + + if (!kindVal && !storyVal) { + return i.kind === current.kind; + } + + return false; + }); + + if (item) { + navigate({ + kind: item.kind, + story: item.story + }); + } else { + _clientLogger.logger.error('could not navigate to provided story'); + } + }; +}; + +exports.linkTo = linkTo; + +var hrefTo = function hrefTo(kind, name) { + return new Promise(function (resolve) { + var _storyStore$getSelect2 = _global.__STORYBOOK_STORY_STORE__.getSelection(), + storyId = _storyStore$getSelect2.storyId; + + var current = _global.__STORYBOOK_STORY_STORE__.fromId(storyId); + + resolve(generateUrl((0, _csf.toId)(kind || current.kind, name))); + }); +}; + +exports.hrefTo = hrefTo; + +var linksListener = function linksListener(e) { + var target = e.target; + + if (!(target instanceof _global.HTMLElement)) { + return; + } + + var element = target; + var _element$dataset = element.dataset, + kind = _element$dataset.sbKind, + story = _element$dataset.sbStory; + + if (kind || story) { + e.preventDefault(); + navigate({ + kind: kind, + story: story + }); + } +}; + +var hasListener = false; + +var on = function on() { + if (!hasListener) { + hasListener = true; + + _global.document.addEventListener('click', linksListener); + } +}; + +var off = function off() { + if (hasListener) { + hasListener = false; + + _global.document.removeEventListener('click', linksListener); + } +}; + +var withLinks = function withLinks(storyFn) { + on(); + + _addons["default"].getChannel().once(_coreEvents.STORY_CHANGED, off); + + return storyFn(); +}; + +exports.withLinks = withLinks; + +/***/ }), + +/***/ "./node_modules/@storybook/core/client.js": +/*!************************************************!*\ + !*** ./node_modules/@storybook/core/client.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./dist/client */ "./node_modules/@storybook/core/dist/client/index.js").default; + + +/***/ }), + +/***/ "./node_modules/@storybook/core/dist/client/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/@storybook/core/dist/client/index.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _preview = _interopRequireDefault(__webpack_require__(/*! ./preview */ "./node_modules/@storybook/core/dist/client/preview/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _default = _preview["default"]; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@storybook/core/dist/client/preview/NoDocs.js": +/*!********************************************************************!*\ + !*** ./node_modules/@storybook/core/dist/client/preview/NoDocs.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.NoDocs = void 0; + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var wrapper = { + fontSize: '14px', + letterSpacing: '0.2px', + margin: '10px 0' +}; +var main = { + margin: 'auto', + padding: 30, + borderRadius: 10, + background: 'rgba(0,0,0,0.03)' +}; +var heading = { + textAlign: 'center' +}; + +var _ref = +/*#__PURE__*/ +_react["default"].createElement("div", { + style: wrapper, + className: "sb-nodocs sb-wrapper" +}, _react["default"].createElement("div", { + style: main +}, _react["default"].createElement("h1", { + style: heading +}, "No Docs"), _react["default"].createElement("p", null, "Sorry, but there are no docs for the selected story. To add them, set the story's\xA0", _react["default"].createElement("code", null, "docs"), " parameter. If you think this is an error:"), _react["default"].createElement("ul", null, _react["default"].createElement("li", null, "Please check the story definition."), _react["default"].createElement("li", null, "Please check the Storybook config."), _react["default"].createElement("li", null, "Try reloading the page.")), _react["default"].createElement("p", null, "If the problem persists, check the browser console, or the terminal you've run Storybook from."))); + +var NoDocs = function NoDocs() { + return _ref; +}; + +exports.NoDocs = NoDocs; +NoDocs.displayName = "NoDocs"; + +/***/ }), + +/***/ "./node_modules/@storybook/core/dist/client/preview/index.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@storybook/core/dist/client/preview/index.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _clientApi = __webpack_require__(/*! @storybook/client-api */ "../../node_modules/@storybook/client-api/dist/index.js"); + +var _csf = __webpack_require__(/*! @storybook/csf */ "../../node_modules/@storybook/csf/dist/index.js"); + +var _start = _interopRequireDefault(__webpack_require__(/*! ./start */ "./node_modules/@storybook/core/dist/client/preview/start.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var _default = { + start: _start["default"], + toId: _csf.toId, + ClientApi: _clientApi.ClientApi, + ConfigApi: _clientApi.ConfigApi, + StoryStore: _clientApi.StoryStore +}; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@storybook/core/dist/client/preview/start.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@storybook/core/dist/client/preview/start.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.every */ "../../node_modules/core-js/modules/es.array.every.js"); + +__webpack_require__(/*! core-js/modules/es.array.filter */ "../../node_modules/core-js/modules/es.array.filter.js"); + +__webpack_require__(/*! core-js/modules/es.array.for-each */ "../../node_modules/core-js/modules/es.array.for-each.js"); + +__webpack_require__(/*! core-js/modules/es.array.from */ "../../node_modules/core-js/modules/es.array.from.js"); + +__webpack_require__(/*! core-js/modules/es.array.index-of */ "../../node_modules/core-js/modules/es.array.index-of.js"); + +__webpack_require__(/*! core-js/modules/es.array.is-array */ "../../node_modules/core-js/modules/es.array.is-array.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.map */ "../../node_modules/core-js/modules/es.array.map.js"); + +__webpack_require__(/*! core-js/modules/es.date.to-string */ "../../node_modules/core-js/modules/es.date.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.function.name */ "../../node_modules/core-js/modules/es.function.name.js"); + +__webpack_require__(/*! core-js/modules/es.map */ "../../node_modules/core-js/modules/es.map.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.promise */ "../../node_modules/core-js/modules/es.promise.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.to-string */ "../../node_modules/core-js/modules/es.regexp.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.for-each */ "../../node_modules/core-js/modules/web.dom-collections.for-each.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = start; +exports.getContext = void 0; + +__webpack_require__(/*! regenerator-runtime/runtime */ "../../node_modules/regenerator-runtime/runtime.js"); + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js")); + +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js")); + +var _utilDeprecate = _interopRequireDefault(__webpack_require__(/*! util-deprecate */ "../../node_modules/util-deprecate/browser.js")); + +var _ansiToHtml = _interopRequireDefault(__webpack_require__(/*! ansi-to-html */ "../../node_modules/ansi-to-html/lib/ansi_to_html.js")); + +var _addons = _interopRequireDefault(__webpack_require__(/*! @storybook/addons */ "../../node_modules/@storybook/addons/dist/public_api.js")); + +var _channelPostmessage = _interopRequireDefault(__webpack_require__(/*! @storybook/channel-postmessage */ "../../node_modules/@storybook/channel-postmessage/dist/index.js")); + +var _clientApi2 = __webpack_require__(/*! @storybook/client-api */ "../../node_modules/@storybook/client-api/dist/index.js"); + +var _csf = __webpack_require__(/*! @storybook/csf */ "../../node_modules/@storybook/csf/dist/index.js"); + +var _clientLogger = __webpack_require__(/*! @storybook/client-logger */ "../../node_modules/@storybook/client-logger/dist/index.js"); + +var _coreEvents = _interopRequireDefault(__webpack_require__(/*! @storybook/core-events */ "../../node_modules/@storybook/core-events/dist/index.js")); + +var _url = __webpack_require__(/*! ./url */ "./node_modules/@storybook/core/dist/client/preview/url.js"); + +var _NoDocs = __webpack_require__(/*! ./NoDocs */ "./node_modules/@storybook/core/dist/client/preview/NoDocs.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } + +function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } + +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + +var ansiConverter = new _ansiToHtml["default"]({ + escapeXML: true +}); +var classes = { + MAIN: 'sb-show-main', + NOPREVIEW: 'sb-show-nopreview', + ERROR: 'sb-show-errordisplay' +}; + +function showMain() { + _global.document.body.classList.remove(classes.NOPREVIEW); + + _global.document.body.classList.remove(classes.ERROR); + + _global.document.body.classList.add(classes.MAIN); +} + +function showNopreview() { + _global.document.body.classList.remove(classes.MAIN); + + _global.document.body.classList.remove(classes.ERROR); + + _global.document.body.classList.add(classes.NOPREVIEW); +} + +function showErrorDisplay(_ref) { + var _ref$message = _ref.message, + message = _ref$message === void 0 ? '' : _ref$message, + _ref$stack = _ref.stack, + stack = _ref$stack === void 0 ? '' : _ref$stack; + _global.document.getElementById('error-message').innerHTML = ansiConverter.toHtml(message); + _global.document.getElementById('error-stack').innerHTML = ansiConverter.toHtml(stack); + + _global.document.body.classList.remove(classes.MAIN); + + _global.document.body.classList.remove(classes.NOPREVIEW); + + _global.document.body.classList.add(classes.ERROR); +} // showError is used by the various app layers to inform the user they have done something +// wrong -- for instance returned the wrong thing from a story + + +function showError(_ref2) { + var title = _ref2.title, + description = _ref2.description; + + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_ERRORED, { + title: title, + description: description + }); + + showErrorDisplay({ + message: title, + stack: description + }); +} // showException is used if we fail to render the story and it is uncaught by the app layer + + +function showException(exception) { + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_THREW_EXCEPTION, exception); + + showErrorDisplay(exception); // Log the stack to the console. So, user could check the source code. + + _clientLogger.logger.error(exception); +} + +var isBrowser = _global.navigator && _global.navigator.userAgent && _global.navigator.userAgent !== 'storyshots' && !(_global.navigator.userAgent.indexOf('Node.js') > -1) && !(_global.navigator.userAgent.indexOf('jsdom') > -1); + +var getContext = function () { + var cache; + return function (decorateStory) { + if (cache) { + return cache; + } + + var channel = null; + + if (isBrowser) { + try { + channel = _addons["default"].getChannel(); + } catch (e) { + channel = (0, _channelPostmessage["default"])({ + page: 'preview' + }); + + _addons["default"].setChannel(channel); + } + } + + var storyStore; + var clientApi; + + if (typeof _global.window !== 'undefined' && _global.window.__STORYBOOK_CLIENT_API__) { + clientApi = _global.window.__STORYBOOK_CLIENT_API__; // eslint-disable-next-line no-underscore-dangle + + storyStore = clientApi._storyStore; + } else { + storyStore = new _clientApi2.StoryStore({ + channel: channel + }); + clientApi = new _clientApi2.ClientApi({ + storyStore: storyStore, + decorateStory: decorateStory + }); + } + + var _clientApi = clientApi, + clearDecorators = _clientApi.clearDecorators; + var configApi = new _clientApi2.ConfigApi({ + clearDecorators: clearDecorators, + storyStore: storyStore, + channel: channel, + clientApi: clientApi + }); + return { + configApi: configApi, + storyStore: storyStore, + channel: channel, + clientApi: clientApi, + showMain: showMain, + showError: showError, + showException: showException + }; + }; +}(); + +exports.getContext = getContext; + +function focusInInput(event) { + return /input|textarea/i.test(event.target.tagName) || event.target.getAttribute('contenteditable') !== null; +} + +function start(render) { + var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + decorateStory = _ref3.decorateStory; + + var context = getContext(decorateStory); + var clientApi = context.clientApi, + channel = context.channel, + configApi = context.configApi, + storyStore = context.storyStore; // Provide access to external scripts if `window` is defined. + // NOTE this is different to isBrowser, primarily for the JSDOM use case + + var previousKind = ''; + var previousStory = ''; + var previousRevision = -1; + var previousViewMode = ''; + var previousId = null; + + var renderMain = function renderMain(forceRender) { + var revision = storyStore.getRevision(); + var loadError = storyStore.getError(); + + var _storyStore$getSelect = storyStore.getSelection(), + storyId = _storyStore$getSelect.storyId, + urlViewMode = _storyStore$getSelect.viewMode; + + var data = storyStore.fromId(storyId); + + var _ref4 = data || {}, + kind = _ref4.kind, + name = _ref4.name, + getDecorated = _ref4.getDecorated, + id = _ref4.id, + parameters = _ref4.parameters, + error = _ref4.error; + + var viewMode = parameters && parameters.docsOnly ? 'docs' : urlViewMode; + var renderContext = Object.assign({}, context, {}, data, { + selectedKind: kind, + selectedStory: name, + parameters: parameters, + forceRender: forceRender + }); + + if (loadError || error) { + showErrorDisplay(loadError || error); + return; + } // Render story only if selectedKind or selectedStory have changed. + // However, we DO want the story to re-render if the store itself has changed + // (which happens at the moment when HMR occurs) + + + if (!forceRender && revision === previousRevision && viewMode === previousViewMode && kind === previousKind && name === previousStory) { + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_UNCHANGED, { + id: id, + revision: revision, + kind: kind, + name: name, + viewMode: viewMode + }); + + return; + } + + if (!forceRender && previousKind && previousStory) { + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_CHANGED, id); + } + + switch (previousViewMode) { + case 'docs': + if (previousKind != null && (kind !== previousKind || viewMode !== previousViewMode)) { + storyStore.cleanHooksForKind(previousKind); + + _reactDom["default"].unmountComponentAtNode(_global.document.getElementById('docs-root')); + } + + break; + + case 'story': + default: + if (previousId != null && (id !== previousId || viewMode !== previousViewMode)) { + storyStore.cleanHooks(previousId); + + _reactDom["default"].unmountComponentAtNode(_global.document.getElementById('root')); + } + + } // Docs view renders into a different root ID to avoid conflicts + // with the user's view layer. Therefore we need to clean up whenever + // we transition between view modes + + + if (viewMode !== previousViewMode) { + switch (viewMode) { + case 'docs': + { + showMain(); + + _global.document.getElementById('root').setAttribute('hidden', true); + + _global.document.getElementById('docs-root').removeAttribute('hidden'); + + break; + } + + case 'story': + default: + { + if (previousViewMode === 'docs') { + _global.document.getElementById('docs-root').setAttribute('hidden', true); + + _global.document.getElementById('root').removeAttribute('hidden'); + } + } + } + } // Given a cleaned up state, render the appropriate view mode + + + switch (viewMode) { + case 'docs': + { + var docs = parameters && parameters.docs || {}; + + var DocsContainer = docs.container || function (_ref5) { + var children = _ref5.children; + return _react["default"].createElement(_react["default"].Fragment, null, children); + }; + + var Page = docs.page || _NoDocs.NoDocs; + + _reactDom["default"].render(_react["default"].createElement(DocsContainer, { + context: renderContext + }, _react["default"].createElement(Page, null)), _global.document.getElementById('docs-root'), function () { + return _addons["default"].getChannel().emit(_coreEvents["default"].DOCS_RENDERED, kind); + }); + + break; + } + + case 'story': + default: + { + if (getDecorated) { + _asyncToGenerator( + /*#__PURE__*/ + regeneratorRuntime.mark(function _callee() { + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return render(renderContext); + + case 3: + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_RENDERED, id); + + _context.next = 9; + break; + + case 6: + _context.prev = 6; + _context.t0 = _context["catch"](0); + showException(_context.t0); + + case 9: + case "end": + return _context.stop(); + } + } + }, _callee, null, [[0, 6]]); + }))(); + } else { + showNopreview(); + + _addons["default"].getChannel().emit(_coreEvents["default"].STORY_MISSING, id); + } + + break; + } + } + + previousRevision = revision; + previousKind = kind; + previousStory = name; + previousViewMode = viewMode; + previousId = id; + + if (!forceRender && viewMode !== 'docs') { + _global.document.documentElement.scrollTop = 0; + _global.document.documentElement.scrollLeft = 0; + } + }; // initialize the UI + + + var renderUI = function renderUI(forceRender) { + if (isBrowser) { + try { + renderMain(forceRender); + } catch (ex) { + showException(ex); + } + } + }; + + var forceReRender = function forceReRender() { + return renderUI(true); + }; // channel can be null in NodeJS + + + if (isBrowser) { + var deprecatedToId = (0, _utilDeprecate["default"])(_csf.toId, "Passing name+kind to the SET_CURRENT_STORY event is deprecated, use a storyId instead"); + channel.on(_coreEvents["default"].FORCE_RE_RENDER, forceReRender); + channel.on(_coreEvents["default"].SET_CURRENT_STORY, function (_ref7) { + var inputStoryId = _ref7.storyId, + name = _ref7.name, + kind = _ref7.kind, + viewMode = _ref7.viewMode; + var storyId = inputStoryId; // For backwards compatibility + + if (!storyId) { + if (!name || !kind) { + throw new Error('You should pass `storyId` into SET_CURRENT_STORY'); + } + + storyId = deprecatedToId(kind, name); + } + + storyStore.setSelection({ + storyId: storyId, + viewMode: viewMode + }); + (0, _url.setPath)({ + storyId: storyId, + viewMode: viewMode + }); + }); // Handle keyboard shortcuts + + _global.window.onkeydown = function (event) { + if (!focusInInput(event)) { + // We have to pick off the keys of the event that we need on the other side + var altKey = event.altKey, + ctrlKey = event.ctrlKey, + metaKey = event.metaKey, + shiftKey = event.shiftKey, + key = event.key, + code = event.code, + keyCode = event.keyCode; + channel.emit(_coreEvents["default"].PREVIEW_KEYDOWN, { + event: { + altKey: altKey, + ctrlKey: ctrlKey, + metaKey: metaKey, + shiftKey: shiftKey, + key: key, + code: code, + keyCode: keyCode + } + }); + } + }; + } + + storyStore.on(_coreEvents["default"].STORY_INIT, function () { + var _initializePath = (0, _url.initializePath)(storyStore), + storyId = _initializePath.storyId, + viewMode = _initializePath.viewMode; + + storyStore.setSelection({ + storyId: storyId, + viewMode: viewMode + }); + }); + storyStore.on(_coreEvents["default"].STORY_RENDER, renderUI); + + if (typeof _global.window !== 'undefined') { + _global.window.__STORYBOOK_CLIENT_API__ = clientApi; + _global.window.__STORYBOOK_STORY_STORE__ = storyStore; + _global.window.__STORYBOOK_ADDONS_CHANNEL__ = channel; // may not be defined + } + + var previousExports = new Map(); + + var loadStories = function loadStories(loadable, framework) { + return function () { + var reqs = null; + + if (Array.isArray(loadable)) { + reqs = loadable; + } else if (loadable.keys) { + reqs = [loadable]; + } + + var currentExports = new Map(); + + if (reqs) { + reqs.forEach(function (req) { + req.keys().forEach(function (filename) { + var fileExports = req(filename); + currentExports.set(fileExports, typeof req.resolve === 'function' ? req.resolve(filename) : null); + }); + }); + } else { + var exported = loadable(); + + if (Array.isArray(exported) && exported.every(function (obj) { + return obj["default"] != null; + })) { + currentExports = new Map(exported.map(function (fileExports) { + return [fileExports, null]; + })); + } else if (exported) { + _clientLogger.logger.warn("Loader function passed to 'configure' should return void or an array of module exports that all contain a 'default' export. Received: ".concat(JSON.stringify(exported))); + } + } + + var removed = _toConsumableArray(previousExports.keys()).filter(function (exp) { + return !currentExports.has(exp); + }); + + removed.forEach(function (exp) { + if (exp["default"]) { + storyStore.removeStoryKind(exp["default"].title); + } + }); + + if (removed.length > 0) { + storyStore.incrementRevision(); + } + + var added = _toConsumableArray(currentExports.keys()).filter(function (exp) { + return !previousExports.has(exp); + }); + + added.forEach(function (fileExports) { + // An old-style story file + if (!fileExports["default"]) { + return; + } + + if (!fileExports["default"].title) { + throw new Error("Unexpected default export without title: ".concat(JSON.stringify(fileExports["default"]))); + } + + var meta = fileExports["default"], + __namedExportsOrder = fileExports.__namedExportsOrder, + namedExports = _objectWithoutProperties(fileExports, ["default", "__namedExportsOrder"]); + + var exports = namedExports; // prefer a user/loader provided `__namedExportsOrder` array if supplied + // we do this as es module exports are always ordered alphabetically + // see https://github.com/storybookjs/storybook/issues/9136 + + if (Array.isArray(__namedExportsOrder)) { + exports = {}; + + __namedExportsOrder.forEach(function (name) { + if (namedExports[name]) { + exports[name] = namedExports[name]; + } + }); + } + + var kindName = meta.title, + componentId = meta.id, + params = meta.parameters, + decos = meta.decorators, + component = meta.component, + subcomponents = meta.subcomponents; // We pass true here to avoid the warning about HMR. It's cool clientApi, we got this + + var kind = clientApi.storiesOf(kindName, true); // we should always have a framework, rest optional + + kind.addParameters(Object.assign({ + framework: framework, + component: component, + subcomponents: subcomponents, + fileName: currentExports.get(fileExports) + }, params)); + (decos || []).forEach(function (decorator) { + kind.addDecorator(decorator); + }); + Object.keys(exports).forEach(function (key) { + if ((0, _csf.isExportStory)(key, meta)) { + var storyFn = exports[key]; + + var _ref8 = storyFn.story || {}, + name = _ref8.name, + parameters = _ref8.parameters, + decorators = _ref8.decorators; + + if (parameters && parameters.decorators) { + (0, _utilDeprecate["default"])(function () {}, "".concat(kindName, " => ").concat(name || key, ": story.parameters.decorators is deprecated; use story.decorators instead."))(); + } + + var decoratorParams = decorators ? { + decorators: decorators + } : null; + var exportName = (0, _csf.storyNameFromExport)(key); + var idParams = { + __id: (0, _csf.toId)(componentId || kindName, exportName) + }; + kind.add(name || exportName, storyFn, Object.assign({}, parameters, {}, decoratorParams, {}, idParams)); + } + }); + }); + previousExports = currentExports; + }; + }; + + var loaded = false; + /** + * Load a collection of stories. If it has a default export, assume that it is a module-style + * file and process its named exports as stories. If not, assume it's an old-style + * storiesof file and require it. + * + * @param {*} loadable a require.context `req`, an array of `req`s, or a loader function that returns void or an array of exports + * @param {*} m - ES module object for hot-module-reloading (HMR) + * @param {*} framework - name of framework in use, e.g. "react" + */ + + var configure = function configure(loadable, m, framework) { + if (typeof m === 'string') { + throw new Error("Invalid module '".concat(m, "'. Did you forget to pass `module` as the second argument to `configure`\"?")); + } + + if (m && m.hot && m.hot.dispose) { + var _ref9 = m.hot.data || {}; + + var _ref9$previousExports = _ref9.previousExports; + previousExports = _ref9$previousExports === void 0 ? new Map() : _ref9$previousExports; + m.hot.dispose(function (data) { + loaded = false; // eslint-disable-next-line no-param-reassign + + data.previousExports = previousExports; + }); + } + + if (loaded) { + _clientLogger.logger.warn('Unexpected loaded state. Did you call `load` twice?'); + } + + loaded = true; + configApi.configure(loadStories(loadable, framework), m); + }; + + return { + configure: configure, + context: context, + clientApi: clientApi, + configApi: configApi, + forceReRender: forceReRender + }; +} + +/***/ }), + +/***/ "./node_modules/@storybook/core/dist/client/preview/url.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@storybook/core/dist/client/preview/url.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.index-of */ "../../node_modules/core-js/modules/es.array.index-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +__webpack_require__(/*! core-js/modules/es.regexp.exec */ "../../node_modules/core-js/modules/es.regexp.exec.js"); + +__webpack_require__(/*! core-js/modules/es.string.match */ "../../node_modules/core-js/modules/es.string.match.js"); + +__webpack_require__(/*! core-js/modules/es.string.search */ "../../node_modules/core-js/modules/es.string.search.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.pathToId = pathToId; +exports.initializePath = exports.parseQueryParameters = exports.getIdFromLegacyQuery = exports.setPath = void 0; + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _qs = _interopRequireDefault(__webpack_require__(/*! qs */ "../../node_modules/qs/lib/index.js")); + +var _csf = __webpack_require__(/*! @storybook/csf */ "../../node_modules/@storybook/csf/dist/index.js"); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function pathToId(path) { + var match = (path || '').match(/^\/story\/(.+)/); + + if (!match) { + throw new Error("Invalid path '".concat(path, "', must start with '/story/'")); + } + + return match[1]; +} + +var setPath = function setPath(_ref) { + var storyId = _ref.storyId, + viewMode = _ref.viewMode; + + var _qs$parse = _qs["default"].parse(_global.document.location.search, { + ignoreQueryPrefix: true + }), + path = _qs$parse.path, + selectedKind = _qs$parse.selectedKind, + selectedStory = _qs$parse.selectedStory, + rest = _objectWithoutProperties(_qs$parse, ["path", "selectedKind", "selectedStory"]); + + var newPath = "".concat(_global.document.location.pathname, "?").concat(_qs["default"].stringify(Object.assign({}, rest, { + id: storyId, + viewMode: viewMode + }))); + + _global.history.replaceState({}, '', newPath); +}; + +exports.setPath = setPath; + +var getIdFromLegacyQuery = function getIdFromLegacyQuery(_ref2, storyStore) { + var path = _ref2.path, + selectedKind = _ref2.selectedKind, + selectedStory = _ref2.selectedStory; + + if (path) { + return pathToId(path); + } + + if (selectedKind && selectedStory) { + // Look up the story ID inside the story store, since as of 5.3, the + // Story ID is not necessarily a direct function of its kind/name. + var story = storyStore.getRawStory(selectedKind, selectedStory); + + if (story) { + return story.id; + } // this will preserve existing behavior of showing a "not found" screen, + // but the inputs will be preserved in the query param to help debugging + + + return (0, _csf.toId)(selectedKind, selectedStory); + } + + return undefined; +}; + +exports.getIdFromLegacyQuery = getIdFromLegacyQuery; + +var parseQueryParameters = function parseQueryParameters(search) { + var _qs$parse2 = _qs["default"].parse(search, { + ignoreQueryPrefix: true + }), + id = _qs$parse2.id; + + return id; +}; + +exports.parseQueryParameters = parseQueryParameters; + +var initializePath = function initializePath(storyStore) { + var query = _qs["default"].parse(_global.document.location.search, { + ignoreQueryPrefix: true + }); + + var storyId = query.id, + viewMode = query.viewMode; // eslint-disable-line prefer-const + + if (!storyId) { + storyId = getIdFromLegacyQuery(query, storyStore); + + if (storyId) { + setPath({ + storyId: storyId, + viewMode: viewMode + }); + } + } + + return { + storyId: storyId, + viewMode: viewMode + }; +}; + +exports.initializePath = initializePath; + +/***/ }), + +/***/ "./node_modules/@storybook/core/dist/server/common/polyfills.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@storybook/core/dist/server/common/polyfills.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! regenerator-runtime/runtime */ "../../node_modules/regenerator-runtime/runtime.js"); + +__webpack_require__(/*! airbnb-js-shims */ "../../node_modules/airbnb-js-shims/index.js"); + +__webpack_require__(/*! core-js/features/symbol */ "../../node_modules/core-js/features/symbol/index.js"); + +/***/ }), + +/***/ "./node_modules/@storybook/core/dist/server/preview/globals.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@storybook/core/dist/server/preview/globals.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +_global.window.STORYBOOK_REACT_CLASSES = {}; + +/***/ }), + +/***/ "./node_modules/@storybook/react/demo.js": +/*!***********************************************!*\ + !*** ./node_modules/@storybook/react/demo.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* eslint-disable global-require */ +module.exports = { + Welcome: __webpack_require__(/*! ./dist/demo/Welcome */ "./node_modules/@storybook/react/dist/demo/Welcome.js").default, + Button: __webpack_require__(/*! ./dist/demo/Button */ "./node_modules/@storybook/react/dist/demo/Button.js").default, +}; + + +/***/ }), + +/***/ "./node_modules/@storybook/react/dist/client/index.js": +/*!************************************************************!*\ + !*** ./node_modules/@storybook/react/dist/client/index.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "storiesOf", { + enumerable: true, + get: function get() { + return _preview.storiesOf; + } +}); +Object.defineProperty(exports, "setAddon", { + enumerable: true, + get: function get() { + return _preview.setAddon; + } +}); +Object.defineProperty(exports, "addDecorator", { + enumerable: true, + get: function get() { + return _preview.addDecorator; + } +}); +Object.defineProperty(exports, "DecoratorFn", { + enumerable: true, + get: function get() { + return _preview.DecoratorFn; + } +}); +Object.defineProperty(exports, "addParameters", { + enumerable: true, + get: function get() { + return _preview.addParameters; + } +}); +Object.defineProperty(exports, "configure", { + enumerable: true, + get: function get() { + return _preview.configure; + } +}); +Object.defineProperty(exports, "getStorybook", { + enumerable: true, + get: function get() { + return _preview.getStorybook; + } +}); +Object.defineProperty(exports, "raw", { + enumerable: true, + get: function get() { + return _preview.raw; + } +}); +Object.defineProperty(exports, "forceReRender", { + enumerable: true, + get: function get() { + return _preview.forceReRender; + } +}); + +var _preview = __webpack_require__(/*! ./preview */ "./node_modules/@storybook/react/dist/client/preview/index.js"); + +if (module && module.hot && module.hot.decline) { + module.hot.decline(); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) + +/***/ }), + +/***/ "./node_modules/@storybook/react/dist/client/preview/globals.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@storybook/react/dist/client/preview/globals.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +if (_global.window) { + _global.window.STORYBOOK_ENV = 'react'; +} + +/***/ }), + +/***/ "./node_modules/@storybook/react/dist/client/preview/index.js": +/*!********************************************************************!*\ + !*** ./node_modules/@storybook/react/dist/client/preview/index.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.raw = exports.getStorybook = exports.forceReRender = exports.setAddon = exports.clearDecorators = exports.addParameters = exports.addDecorator = exports.configure = exports.storiesOf = void 0; + +var _client = __webpack_require__(/*! @storybook/core/client */ "./node_modules/@storybook/core/client.js"); + +__webpack_require__(/*! ./globals */ "./node_modules/@storybook/react/dist/client/preview/globals.js"); + +var _render = _interopRequireDefault(__webpack_require__(/*! ./render */ "./node_modules/@storybook/react/dist/client/preview/render.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +/* eslint-disable prefer-destructuring */ +var framework = 'react'; +var api = (0, _client.start)(_render["default"]); + +var storiesOf = function storiesOf(kind, m) { + return api.clientApi.storiesOf(kind, m).addParameters({ + framework: framework + }); +}; + +exports.storiesOf = storiesOf; + +var configure = function configure() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return api.configure.apply(api, args.concat([framework])); +}; + +exports.configure = configure; +var addDecorator = api.clientApi.addDecorator; +exports.addDecorator = addDecorator; +var addParameters = api.clientApi.addParameters; +exports.addParameters = addParameters; +var clearDecorators = api.clientApi.clearDecorators; +exports.clearDecorators = clearDecorators; +var setAddon = api.clientApi.setAddon; +exports.setAddon = setAddon; +var forceReRender = api.forceReRender; +exports.forceReRender = forceReRender; +var getStorybook = api.clientApi.getStorybook; +exports.getStorybook = getStorybook; +var raw = api.clientApi.raw; +exports.raw = raw; + +/***/ }), + +/***/ "./node_modules/@storybook/react/dist/client/preview/render.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@storybook/react/dist/client/preview/render.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.description */ "../../node_modules/core-js/modules/es.symbol.description.js"); + +__webpack_require__(/*! core-js/modules/es.symbol.iterator */ "../../node_modules/core-js/modules/es.symbol.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.array.concat */ "../../node_modules/core-js/modules/es.array.concat.js"); + +__webpack_require__(/*! core-js/modules/es.array.iterator */ "../../node_modules/core-js/modules/es.array.iterator.js"); + +__webpack_require__(/*! core-js/modules/es.object.create */ "../../node_modules/core-js/modules/es.object.create.js"); + +__webpack_require__(/*! core-js/modules/es.object.define-property */ "../../node_modules/core-js/modules/es.object.define-property.js"); + +__webpack_require__(/*! core-js/modules/es.object.get-prototype-of */ "../../node_modules/core-js/modules/es.object.get-prototype-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.set-prototype-of */ "../../node_modules/core-js/modules/es.object.set-prototype-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.to-string */ "../../node_modules/core-js/modules/es.object.to-string.js"); + +__webpack_require__(/*! core-js/modules/es.promise */ "../../node_modules/core-js/modules/es.promise.js"); + +__webpack_require__(/*! core-js/modules/es.string.iterator */ "../../node_modules/core-js/modules/es.string.iterator.js"); + +__webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "../../node_modules/core-js/modules/web.dom-collections.iterator.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = renderMain; + +__webpack_require__(/*! regenerator-runtime/runtime */ "../../node_modules/regenerator-runtime/runtime.js"); + +var _global = __webpack_require__(/*! global */ "../../node_modules/global/window.js"); + +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "./node_modules/react/index.js")); + +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "../../node_modules/react-dom/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } + +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } + +function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } + +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +var rootEl = _global.document ? _global.document.getElementById('root') : null; + +var render = function render(node, el) { + return new Promise(function (resolve) { + _reactDom["default"].render(Object({"NODE_ENV":"development","NODE_PATH":"","PUBLIC_URL":"."}).STORYBOOK_EXAMPLE_APP ? _react["default"].createElement(_react.StrictMode, null, node) : node, el, resolve); + }); +}; + +var ErrorBoundary = +/*#__PURE__*/ +function (_Component) { + _inherits(ErrorBoundary, _Component); + + function ErrorBoundary() { + var _getPrototypeOf2; + + var _this; + + _classCallCheck(this, ErrorBoundary); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ErrorBoundary)).call.apply(_getPrototypeOf2, [this].concat(args))); + _this.state = { + hasError: false + }; + return _this; + } + + _createClass(ErrorBoundary, [{ + key: "componentDidMount", + value: function componentDidMount() { + var hasError = this.state.hasError; + var showMain = this.props.showMain; + + if (!hasError) { + showMain(); + } + } + }, { + key: "componentDidCatch", + value: function componentDidCatch(err) { + var showException = this.props.showException; // message partially duplicates stack, strip it + + showException(err); + } + }, { + key: "render", + value: function render() { + var hasError = this.state.hasError; + var children = this.props.children; + return hasError ? null : children; + } + }], [{ + key: "getDerivedStateFromError", + value: function getDerivedStateFromError() { + return { + hasError: true + }; + } + }]); + + return ErrorBoundary; +}(_react.Component); + +function renderMain(_x) { + return _renderMain.apply(this, arguments); +} + +function _renderMain() { + _renderMain = _asyncToGenerator( + /*#__PURE__*/ + regeneratorRuntime.mark(function _callee(_ref) { + var StoryFn, showMain, showException, forceRender, element; + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + StoryFn = _ref.storyFn, showMain = _ref.showMain, showException = _ref.showException, forceRender = _ref.forceRender; + element = _react["default"].createElement(ErrorBoundary, { + showMain: showMain, + showException: showException + }, _react["default"].createElement(StoryFn, null)); // We need to unmount the existing set of components in the DOM node. + // Otherwise, React may not recreate instances for every story run. + // This could leads to issues like below: + // https://github.com/storybookjs/react-storybook/issues/81 + // But forceRender means that it's the same story, so we want too keep the state in that case. + + if (!forceRender) { + _reactDom["default"].unmountComponentAtNode(rootEl); + } + + _context.next = 5; + return render(element, rootEl); + + case 5: + case "end": + return _context.stop(); + } + } + }, _callee); + })); + return _renderMain.apply(this, arguments); +} + +/***/ }), + +/***/ "./node_modules/@storybook/react/dist/demo/Button.js": +/*!***********************************************************!*\ + !*** ./node_modules/@storybook/react/dist/demo/Button.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +var styles = { + border: '1px solid #eee', + borderRadius: 3, + backgroundColor: '#FFFFFF', + cursor: 'pointer', + fontSize: 15, + padding: '3px 10px', + margin: 10 +}; + +var Button = function Button(_ref) { + var children = _ref.children, + onClick = _ref.onClick; + return _react["default"].createElement("button", { + onClick: onClick, + style: styles, + type: "button" + }, children); +}; + +Button.displayName = 'Button'; +Button.defaultProps = { + onClick: function onClick() {} +}; +var _default = Button; +exports["default"] = _default; + +/***/ }), + +/***/ "./node_modules/@storybook/react/dist/demo/Welcome.js": +/*!************************************************************!*\ + !*** ./node_modules/@storybook/react/dist/demo/Welcome.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +__webpack_require__(/*! core-js/modules/es.symbol */ "../../node_modules/core-js/modules/es.symbol.js"); + +__webpack_require__(/*! core-js/modules/es.array.index-of */ "../../node_modules/core-js/modules/es.array.index-of.js"); + +__webpack_require__(/*! core-js/modules/es.object.assign */ "../../node_modules/core-js/modules/es.object.assign.js"); + +__webpack_require__(/*! core-js/modules/es.object.keys */ "../../node_modules/core-js/modules/es.object.keys.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js")); + +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../../node_modules/prop-types/index.js")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } + +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +var Main = function Main(props) { + return _react["default"].createElement("article", _extends({}, props, { + style: { + padding: 15, + lineHeight: 1.4, + fontFamily: '"Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif', + backgroundColor: '#fff', + color: '#000' + } + })); +}; + +var Title = function Title(_ref) { + var children = _ref.children, + props = _objectWithoutProperties(_ref, ["children"]); + + return _react["default"].createElement("h1", props, children); +}; + +Title.propTypes = { + children: _propTypes["default"].node +}; +Title.defaultProps = { + children: undefined +}; + +var Note = function Note(props) { + return _react["default"].createElement("p", _extends({}, props, { + style: { + opacity: 0.5 + } + })); +}; + +var InlineCode = function InlineCode(props) { + return _react["default"].createElement("code", _extends({}, props, { + style: { + fontSize: 15, + fontWeight: 600, + padding: '2px 5px', + border: '1px solid #eae9e9', + borderRadius: 4, + backgroundColor: '#f3f2f2', + color: '#3a3a3a' + } + })); +}; + +var Link = function Link(_ref2) { + var children = _ref2.children, + href = _ref2.href, + target = _ref2.target, + rel = _ref2.rel, + props = _objectWithoutProperties(_ref2, ["children", "href", "target", "rel"]); + + return _react["default"].createElement("a", _extends({ + href: href + }, props, { + target: target, + rel: rel, + style: { + color: '#1474f3', + textDecoration: 'none', + borderBottom: '1px solid #1474f3', + paddingBottom: 2 + } + }), children); +}; + +Link.propTypes = { + href: _propTypes["default"].string, + children: _propTypes["default"].node +}; +Link.defaultProps = { + href: undefined, + children: undefined +}; + +var NavButton = function NavButton(_ref3) { + var children = _ref3.children, + onClick = _ref3.onClick, + props = _objectWithoutProperties(_ref3, ["children", "onClick"]); + + return _react["default"].createElement("button", _extends({}, props, { + type: "button", + onClick: onClick, + style: { + color: '#1474f3', + textDecoration: 'none', + borderBottom: '1px solid #1474f3', + paddingBottom: 2, + borderTop: 'none', + borderRight: 'none', + borderLeft: 'none', + backgroundColor: 'transparent', + padding: 0, + cursor: 'pointer', + font: 'inherit' + } + }), children); +}; + +NavButton.propTypes = { + children: _propTypes["default"].node +}; +NavButton.defaultProps = { + children: undefined +}; + +var Welcome = function Welcome(_ref4) { + var showApp = _ref4.showApp; + return _react["default"].createElement(Main, null, _react["default"].createElement(Title, null, "Welcome to storybook"), _react["default"].createElement("p", null, "This is a UI component dev environment for your app."), _react["default"].createElement("p", null, "We've added some basic stories inside the ", _react["default"].createElement(InlineCode, null, "src/stories"), " directory.", _react["default"].createElement("br", null), "A story is a single state of one or more UI components. You can have as many stories as you want.", _react["default"].createElement("br", null), "(Basically a story is like a visual test case.)"), _react["default"].createElement("p", null, "See these sample ", _react["default"].createElement(NavButton, { + onClick: showApp + }, "stories"), " for a component called\xA0", _react["default"].createElement(InlineCode, null, "Button"), "."), _react["default"].createElement("p", null, "Just like that, you can add your own components as stories.", _react["default"].createElement("br", null), "You can also edit those components and see changes right away.", _react["default"].createElement("br", null), "(Try editing the ", _react["default"].createElement(InlineCode, null, "Button"), " stories located at\xA0", _react["default"].createElement(InlineCode, null, "src/stories/1-Button.stories.js"), ".)"), _react["default"].createElement("p", null, "Usually we create stories with smaller UI components in the app.", _react["default"].createElement("br", null), "Have a look at the\xA0", _react["default"].createElement(Link, { + href: "https://storybook.js.org/basics/writing-stories", + target: "_blank", + rel: "noopener noreferrer" + }, "Writing Stories"), "\xA0section in our documentation."), _react["default"].createElement(Note, null, _react["default"].createElement("b", null, "NOTE:"), _react["default"].createElement("br", null), "Have a look at the ", _react["default"].createElement(InlineCode, null, ".storybook/webpack.config.js"), " to add webpack loaders and plugins you are using in this project.")); +}; + +exports["default"] = Welcome; +Welcome.displayName = 'Welcome'; +Welcome.defaultProps = { + showApp: null +}; + +/***/ }), + +/***/ "./node_modules/react/cjs/react.development.js": +/*!*****************************************************!*\ + !*** ./node_modules/react/cjs/react.development.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** @license React v16.13.1 + * react.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + + + +if (true) { + (function() { +'use strict'; + +var _assign = __webpack_require__(/*! object-assign */ "../../node_modules/object-assign/index.js"); +var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "../../node_modules/prop-types/checkPropTypes.js"); + +var ReactVersion = '16.13.1'; + +// 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; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary +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_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; +var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; +var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; +var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; +var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; +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; +} + +/** + * Keeps track of the current dispatcher. + */ +var ReactCurrentDispatcher = { + /** + * @internal + * @type {ReactComponent} + */ + current: null +}; + +/** + * Keeps track of the current batch's configuration such as how long an update + * should suspend for if it needs to. + */ +var ReactCurrentBatchConfig = { + suspense: 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 = /^(.*)[\\\/]/; +function describeComponentFrame (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') { + error('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_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'; + + case REACT_SUSPENSE_LIST_TYPE: + return 'SuspenseList'; + } + + 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_BLOCK_TYPE: + return getComponentName(type.render); + + case REACT_LAZY_TYPE: + { + var thenable = type; + var resolvedThenable = refineResolvedLazyComponent(thenable); + + if (resolvedThenable) { + return getComponentName(resolvedThenable); + } + + break; + } + } + } + + 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; + }; +} + +/** + * Used by act() to track whether you're inside an act() scope. + */ +var IsSomeRendererActing = { + current: false +}; + +var ReactSharedInternals = { + ReactCurrentDispatcher: ReactCurrentDispatcher, + ReactCurrentBatchConfig: ReactCurrentBatchConfig, + ReactCurrentOwner: ReactCurrentOwner, + IsSomeRendererActing: IsSomeRendererActing, + // 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: {} + }); +} + +// by calls to these methods by a Babel plugin. +// +// In PROD (or in packages without access to React internals), +// they are left as they are instead. + +function warn(format) { + { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + printWarning('warn', format, args); + } +} +function error(format) { + { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + printWarning('error', format, args); + } +} + +function printWarning(level, format, args) { + // When changing this logic, you might want to also + // update consoleWithStackDev.www.js as well. + { + var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0; + + if (!hasExistingStack) { + var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; + var stack = ReactDebugCurrentFrame.getStackAddendum(); + + if (stack !== '') { + format += '%s'; + args = args.concat([stack]); + } + } + + var argsWithFormat = args.map(function (item) { + return '' + item; + }); // Careful: RN currently depends on this prefix + + argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it + // breaks IE9: https://github.com/facebook/react/issues/13610 + // eslint-disable-next-line react-internal/no-production-logging + + Function.prototype.apply.call(console[level], 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 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; + } + + error("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) { + if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) { + { + throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." ); + } + } + + 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 () { + warn('%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; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; +var RESERVED_PROPS = { + key: true, + ref: true, + __self: true, + __source: true +}; +var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; + +{ + didWarnAboutStringRefs = {}; +} + +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; + + error('%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; + + error('%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 + }); +} + +function warnIfStringRefCannotBeAutoConverted(config) { + { + if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { + var componentName = getComponentName(ReactCurrentOwner.current.type); + + if (!didWarnAboutStringRefs[componentName]) { + error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref); + + didWarnAboutStringRefs[componentName] = 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, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @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. + * @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; // 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; + + { + warnIfStringRefCannotBeAutoConverted(config); + } + } + + 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); +} +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) { + if (!!(element === null || element === undefined)) { + { + throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." ); + } + } + + var propName; // 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; + + 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; + var nextName; + 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) { + if (!didWarnAboutMaps) { + warn('Using Maps as children is deprecated and will be removed in ' + 'a future major release. Consider converting children to ' + 'an array of keyed ReactElements instead.'); + } + + didWarnAboutMaps = true; + } + } + + var iterator = iteratorFn.call(children); + var step; + 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; + + { + { + throw Error( "Objects are not valid as a React child (found: " + (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) { + if (!isValidElement(children)) { + { + throw Error( "React.Children.only expected to receive a single React element child." ); + } + } + + return children; +} + +function createContext(defaultValue, calculateChangedBits) { + if (calculateChangedBits === undefined) { + calculateChangedBits = null; + } else { + { + if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') { + error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits); + } + } + } + + 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; + + error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> 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; + + error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> 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; + var propTypes; + Object.defineProperties(lazyType, { + defaultProps: { + configurable: true, + get: function () { + return defaultProps; + }, + set: function (newDefaultProps) { + error('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) { + error('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) { + error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); + } else if (typeof render !== 'function') { + error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); + } else { + if (render.length !== 0 && render.length !== 2) { + error('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.'); + } + } + + if (render != null) { + if (render.defaultProps != null || render.propTypes != null) { + error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); + } + } + } + + 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 || type === REACT_SUSPENSE_LIST_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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); +} + +function memo(type, compare) { + { + if (!isValidElementType(type)) { + error('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; + + if (!(dispatcher !== null)) { + { + throw Error( "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." ); + } + } + + return dispatcher; +} + +function useContext(Context, unstable_observedBits) { + var dispatcher = resolveDispatcher(); + + { + if (unstable_observedBits !== undefined) { + error('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' : ''); + } // 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) { + error('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) { + error('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, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useEffect(create, deps); +} +function useLayoutEffect(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useLayoutEffect(create, deps); +} +function useCallback(callback, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useCallback(callback, deps); +} +function useMemo(create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useMemo(create, deps); +} +function useImperativeHandle(ref, create, deps) { + var dispatcher = resolveDispatcher(); + return dispatcher.useImperativeHandle(ref, create, deps); +} +function useDebugValue(value, formatterFn) { + { + var dispatcher = resolveDispatcher(); + return dispatcher.useDebugValue(value, formatterFn); + } +} + +var propTypesMisspellWarningShown; + +{ + 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(source) { + if (source !== undefined) { + var fileName = source.fileName.replace(/^.*[\\\/]/, ''); + var lineNumber = source.lineNumber; + return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; + } + + return ''; +} + +function getSourceInfoErrorAddendumForProps(elementProps) { + if (elementProps !== null && elementProps !== undefined) { + return getSourceInfoErrorAddendum(elementProps.__source); + } + + 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); + + { + error('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; + + 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; + + 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; + + error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown'); + } + + if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { + error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); + } + } +} +/** + * 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') { + error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); + + break; + } + } + + if (fragment.ref !== null) { + error('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 = getSourceInfoErrorAddendumForProps(props); + + if (sourceInfo) { + info += sourceInfo; + } else { + info += getDeclarationErrorAddendum(); + } + + var typeString; + + 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; + } + + { + error('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; +} +var didWarnAboutDeprecatedCreateFactory = false; +function createFactoryWithValidation(type) { + var validatedFactory = createElementWithValidation.bind(null, type); + validatedFactory.type = type; + + { + if (!didWarnAboutDeprecatedCreateFactory) { + didWarnAboutDeprecatedCreateFactory = true; + + warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); + } // Legacy hook: remove it + + + Object.defineProperty(validatedFactory, 'type', { + enumerable: false, + get: function () { + warn('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; +} + +{ + + try { + var frozenObject = Object.freeze({}); + var testMap = new Map([[frozenObject, null]]); + var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused. + // https://github.com/rollup/rollup/issues/1771 + // TODO: we can remove these if Rollup fixes the bug. + + testMap.set(0, 0); + testSet.add(0); + } catch (e) { + } +} + +var createElement$1 = createElementWithValidation ; +var cloneElement$1 = cloneElementWithValidation ; +var createFactory = createFactoryWithValidation ; +var Children = { + map: mapChildren, + forEach: forEachChildren, + count: countChildren, + toArray: toArray, + only: onlyChild +}; + +exports.Children = Children; +exports.Component = Component; +exports.Fragment = REACT_FRAGMENT_TYPE; +exports.Profiler = REACT_PROFILER_TYPE; +exports.PureComponent = PureComponent; +exports.StrictMode = REACT_STRICT_MODE_TYPE; +exports.Suspense = REACT_SUSPENSE_TYPE; +exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals; +exports.cloneElement = cloneElement$1; +exports.createContext = createContext; +exports.createElement = createElement$1; +exports.createFactory = createFactory; +exports.createRef = createRef; +exports.forwardRef = forwardRef; +exports.isValidElement = isValidElement; +exports.lazy = lazy; +exports.memo = memo; +exports.useCallback = useCallback; +exports.useContext = useContext; +exports.useDebugValue = useDebugValue; +exports.useEffect = useEffect; +exports.useImperativeHandle = useImperativeHandle; +exports.useLayoutEffect = useLayoutEffect; +exports.useMemo = useMemo; +exports.useReducer = useReducer; +exports.useRef = useRef; +exports.useState = useState; +exports.version = ReactVersion; + })(); +} + + +/***/ }), + +/***/ "./node_modules/react/index.js": +/*!*************************************!*\ + !*** ./node_modules/react/index.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +if (false) {} else { + module.exports = __webpack_require__(/*! ./cjs/react.development.js */ "./node_modules/react/cjs/react.development.js"); +} + + +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ "./node_modules/webpack/buildin/harmony-module.js": +/*!*******************************************!*\ + !*** (webpack)/buildin/harmony-module.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function(originalModule) { + if (!originalModule.webpackPolyfill) { + var module = Object.create(originalModule); + // module.parent = undefined by default + if (!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + Object.defineProperty(module, "exports", { + enumerable: true + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }), + +/***/ "./node_modules/webpack/buildin/module.js": +/*!***********************************!*\ + !*** (webpack)/buildin/module.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function(module) { + if (!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if (!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; + + +/***/ }) + +}]); +//# sourceMappingURL=vendors~main.cf4424013badd87a0545.bundle.js.map \ No newline at end of file diff --git a/fixtures/storybook-static/iframe.html b/fixtures/storybook-static/iframe.html index ed812ae2..85b3370c 100644 --- a/fixtures/storybook-static/iframe.html +++ b/fixtures/storybook-static/iframe.html @@ -1,23 +1,74 @@ +<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Storybook

No Preview

Sorry, but you either have no stories or none are selected somehow.

  • Please check the Storybook config.
  • Try reloading the page.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

\ No newline at end of file diff --git a/fixtures/storybook-static/main.e6418033799b6f9163d0.bundle.js b/fixtures/storybook-static/main.e6418033799b6f9163d0.bundle.js new file mode 100644 index 00000000..4bb040ea --- /dev/null +++ b/fixtures/storybook-static/main.e6418033799b6f9163d0.bundle.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{298:function(module,exports){var pendingPromises=[];module.exports={registerPendingPromise:function registerPendingPromise(promise){pendingPromises.push(promise)},resetPendingPromises:function resetPendingPromises(){pendingPromises=[]},awaitReady:function awaitReady(){return Promise.all(pendingPromises.splice(0)).then((function(){return!pendingPromises.length||awaitReady()}))}}},303:function(module,exports,__webpack_require__){__webpack_require__(304),__webpack_require__(464),__webpack_require__(465),module.exports=__webpack_require__(665)},326:function(module,exports){},343:function(module,exports){},358:function(module,exports){},370:function(module,exports){},389:function(module,exports){},465:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__(466)},466:function(module,exports,__webpack_require__){__webpack_require__(467)()},467:function(module,exports,__webpack_require__){const configureStorybookReact=__webpack_require__(468);module.exports=configureStorybookReact},468:function(module,exports,__webpack_require__){const storybook=__webpack_require__(469),{createStorybookConfigurator:createStorybookConfigurator}=__webpack_require__(655);module.exports=createStorybookConfigurator(storybook)},655:function(module,exports,__webpack_require__){const addLokiSessionMarker=__webpack_require__(656),awaitLokiReady=__webpack_require__(657),createStorybookConfigurator=__webpack_require__(658),disableAnimations=__webpack_require__(661),disablePointerEvents=__webpack_require__(662),getSelectorBoxSize=__webpack_require__(663),getStories=__webpack_require__(664);module.exports={addLokiSessionMarker:addLokiSessionMarker,awaitLokiReady:awaitLokiReady,createStorybookConfigurator:createStorybookConfigurator,disableAnimations:disableAnimations,disablePointerEvents:disablePointerEvents,getSelectorBoxSize:getSelectorBoxSize,getStories:getStories}},656:function(module,exports){module.exports=window=>{window.document.querySelector(":root").setAttribute("loki-test",!0),window._isLokiTest=!0}},657:function(module,exports){module.exports=window=>window.loki&&window.loki.awaitReady&&window.loki.awaitReady()},658:function(module,exports,__webpack_require__){const{decorateStorybook:decorateStorybook,registerPendingPromise:registerPendingPromise,resetPendingPromises:resetPendingPromises,awaitReady:awaitReady}=__webpack_require__(659);module.exports=function createConfigurator(storybook){return function configureStorybook(){"object"==typeof window&&(window.loki||(window.loki={}),window.loki.getStorybook=decorateStorybook(storybook),window.loki.registerPendingPromise=registerPendingPromise,window.loki.resetPendingPromises=resetPendingPromises,window.loki.awaitReady=awaitReady)}}},659:function(module,exports,__webpack_require__){const decorateStorybook=__webpack_require__(660),readyStateManager=__webpack_require__(298);module.exports=Object.assign({decorateStorybook:decorateStorybook},readyStateManager)},660:function(module,exports,__webpack_require__){const readyStateManager=__webpack_require__(298);let warnedSkipDeprecation=!1,warnedAsyncDeprecation=!1;module.exports=function decorateStorybook(storybook){const originalStoriesOf=storybook.storiesOf;function wrapWithSkipStory(add,kind,isDeprecatedCall){return function skipStory(story,storyFn,parameters={}){return isDeprecatedCall&&!warnedSkipDeprecation&&(warnedSkipDeprecation=!0,console.warn("[DEPRECATED] `.add.skip(...)` is deprecated. Please use `.lokiSkip(...)` instead.")),add(story,storyFn,{...parameters,loki:{...parameters.loki||{},skip:!0}})}}function wrapWithAsyncStory(add,isDeprecatedCall){return function skipStory(story,storyFn,parameters){return isDeprecatedCall&&!warnedAsyncDeprecation&&(warnedAsyncDeprecation=!0,console.warn("[DEPRECATED] `.add.async(...)` is deprecated. Please use `.lokiAsync(...)` instead.")),add(story,(function render(context){var resolveAsyncStory=null;readyStateManager.resetPendingPromises(),readyStateManager.registerPendingPromise(new Promise((function(resolve){resolveAsyncStory=resolve})));return storyFn(Object.assign({done:function(){resolveAsyncStory&&resolveAsyncStory(),resolveAsyncStory=null}},context))}),parameters)}}function storiesOf(kind,module){const stories=originalStoriesOf(kind,module);return stories.add.skip=wrapWithSkipStory(stories.add.bind(stories),0,!0),stories.add.async=wrapWithAsyncStory(stories.add.bind(stories),!0),stories.add.async.skip=wrapWithSkipStory(stories.add.async,0,!0),stories.add.skip.async=wrapWithAsyncStory(stories.add.skip,!0),stories}const descriptor=Object.getOwnPropertyDescriptor(storybook,"storiesOf");return descriptor.writable?storybook.storiesOf=storiesOf:descriptor.configurable&&Object.defineProperty(storybook,"storiesOf",{configurable:!0,enumerable:!0,get:function(){return storiesOf}}),storybook.setAddon({lokiSkip:function(...args){return wrapWithSkipStory(this.add.bind(this),this.kind)(...args)},lokiAsync:function(...args){return wrapWithAsyncStory(this.add.bind(this))(...args)},lokiAsyncSkip:function(...args){return wrapWithSkipStory(wrapWithAsyncStory(this.add.bind(this)),this.kind)(...args)}}),function getStorybook(){return storybook.raw().filter(({parameters:parameters})=>!parameters||!parameters.loki||!parameters.loki.skip)}}},661:function(module,exports){module.exports=window=>{let currentFrame=1;let resolveRAF,resolveRAFTimer;const callbacks=[],now=()=>10*currentFrame*16;window.requestAnimationFrame=callback=>(currentFrame<1e3&&(callbacks.push(callback),1===callbacks.length&&(setTimeout(()=>{currentFrame++,callbacks.splice(0).forEach(c=>c(now())),resolveRAFTimer=setTimeout(()=>{resolveRAF(),resolveRAF=null,resolveRAFTimer=null},50)},0),resolveRAF||window.loki.registerPendingPromise(new Promise(resolve=>{resolveRAF=resolve})),resolveRAFTimer&&(clearTimeout(resolveRAFTimer),resolveRAFTimer=null))),-1),window.performance.now=now,window.document.addEventListener("DOMContentLoaded",()=>{const styleElement=window.document.createElement("style");window.document.documentElement.appendChild(styleElement),styleElement.sheet.insertRule("\n *, :before, :after {\n -webkit-transition: none !important;\n transition: none !important;\n -webkit-animation: none !important;\n animation: none !important;\n will-change: auto !important;\n }\n ")})}},662:function(module,exports){module.exports=window=>{window.document.addEventListener("DOMContentLoaded",()=>{const styleElement=window.document.createElement("style");window.document.documentElement.appendChild(styleElement),styleElement.sheet.insertRule("\n * {\n pointer-events: none !important;\n }\n ")})}},663:function(module,exports){module.exports=(window,selector)=>{const elements=Array.from(window.document.querySelectorAll(selector)).filter(element=>{const style=window.getComputedStyle(element);return!("hidden"===style.visibility||"none"===style.display||"0"===style.opacity||("0px"===style.width||"0px"===style.height)&&"0px"===style.padding)}).filter((element,index,array)=>!array.some(node=>node!==element&&element.contains(node)));if(0===elements.length)throw new Error("No visible elements found");return elements.map(element=>element.getBoundingClientRect()).reduce((domRect,{x:x,y:y,width:width,height:height})=>{if(!domRect)return{x:x,y:y,width:width,height:height};const xMin=Math.min(domRect.x,x),yMin=Math.min(domRect.y,y);return{x:xMin,y:yMin,width:Math.max(domRect.x+domRect.width,x+width)-xMin,height:Math.max(domRect.y+domRect.height,y+height)-yMin}})}},664:function(module,exports){module.exports=window=>{const getStorybook=window.loki&&window.loki.getStorybook;if(!getStorybook)throw new Error("Loki addon not registered. Add `import 'loki/configure-react'` to your .storybook/preview.js file.");return getStorybook().map(component=>({id:component.id,kind:component.kind,story:component.story}))}},665:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),function(module){var _storybook_react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(301);module._StorybookPreserveDecorators=!0,Object(_storybook_react__WEBPACK_IMPORTED_MODULE_0__.configure)([__webpack_require__(676)],module)}.call(this,__webpack_require__(666)(module))},676:function(module,exports,__webpack_require__){var map={"./stories/0-Welcome.stories.js":677,"./stories/1-Button.stories.js":684};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){if(!__webpack_require__.o(map,req)){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}return map[req]}webpackContext.keys=function webpackContextKeys(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id=676},677:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"ToStorybook",(function(){return ToStorybook}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(18),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_storybook_addon_links__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(302),_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(63);__webpack_exports__.default={title:"Welcome",component:_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__.Welcome};var ToStorybook=function(){return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__.Welcome,{showApp:Object(_storybook_addon_links__WEBPACK_IMPORTED_MODULE_1__.linkTo)("Button")})};ToStorybook.displayName="ToStorybook",ToStorybook.story={name:"to Storybook"},ToStorybook.__docgenInfo={description:"",methods:[],displayName:"ToStorybook"},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/stories/0-Welcome.stories.js"]={name:"ToStorybook",docgenInfo:ToStorybook.__docgenInfo,path:"src/stories/0-Welcome.stories.js"})},684:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"Text",(function(){return Text})),__webpack_require__.d(__webpack_exports__,"Emoji",(function(){return Emoji}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(18),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(173),_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(63);__webpack_exports__.default={title:"Button",component:_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__.Button};var Text=function(){return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__.Button,{onClick:Object(_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__.action)("clicked")},"Hello Button")};Text.displayName="Text";var _ref=react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span",{role:"img","aria-label":"so cool"},"😀 😎 👍 💯"),Emoji=function(){return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_storybook_react_demo__WEBPACK_IMPORTED_MODULE_2__.Button,{onClick:Object(_storybook_addon_actions__WEBPACK_IMPORTED_MODULE_1__.action)("clicked")},_ref)};Emoji.displayName="Emoji",Text.__docgenInfo={description:"",methods:[],displayName:"Text"},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/stories/1-Button.stories.js"]={name:"Text",docgenInfo:Text.__docgenInfo,path:"src/stories/1-Button.stories.js"}),Emoji.__docgenInfo={description:"",methods:[],displayName:"Emoji"},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/stories/1-Button.stories.js"]={name:"Emoji",docgenInfo:Emoji.__docgenInfo,path:"src/stories/1-Button.stories.js"})}},[[303,1,2]]]); +//# sourceMappingURL=main.e6418033799b6f9163d0.bundle.js.map \ No newline at end of file diff --git a/fixtures/storybook-static/runtime~main.e6418033799b6f9163d0.bundle.js b/fixtures/storybook-static/runtime~main.e6418033799b6f9163d0.bundle.js new file mode 100644 index 00000000..eb47c5c3 --- /dev/null +++ b/fixtures/storybook-static/runtime~main.e6418033799b6f9163d0.bundle.js @@ -0,0 +1,2 @@ +!function(modules){function webpackJsonpCallback(data){for(var moduleId,chunkId,chunkIds=data[0],moreModules=data[1],executeModules=data[2],i=0,resolves=[];i2?arguments[2]:{},props=keys(map);hasSymbols&&(props=props.concat(Object.getOwnPropertySymbols(map))),foreach(props,function(name){defineProperty(object,name,map[name],predicates[name])})};defineProperties.supportsDescriptors=!!supportsDescriptors,module.exports=defineProperties},function(module,exports,__webpack_require__){"use strict";var implementation=__webpack_require__(256);module.exports=Function.prototype.bind||implementation},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _typeof2=__webpack_require__(21),_typeof3=_interopRequireDefault(_typeof2),_themes=__webpack_require__(166),themes=function(obj){if(obj&&obj.__esModule)return obj;var newObj={};if(null!=obj)for(var key in obj)Object.prototype.hasOwnProperty.call(obj,key)&&(newObj[key]=obj[key]);return newObj.default=obj,newObj}(_themes),_base=__webpack_require__(357),_base2=_interopRequireDefault(_base),styles=Object.keys(themes).reduce(function(styles,themeName){return styles[themeName]=(0,_base2.default)(themes[themeName]),styles},{}),createStyles=function(key,theme){return"string"==typeof theme?styles[theme][key]:"object"===(void 0===theme?"undefined":(0,_typeof3.default)(theme))?(0,_base2.default)(theme)[key]:styles.chromeLight[key]};exports.default=createStyles},function(module,exports,__webpack_require__){var aFunction=__webpack_require__(65);module.exports=function(fn,that,length){if(aFunction(fn),void 0===that)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},function(module,exports,__webpack_require__){var dP=__webpack_require__(22),createDesc=__webpack_require__(57);module.exports=__webpack_require__(25)?function(object,key,value){return dP.f(object,key,createDesc(1,value))}:function(object,key,value){return object[key]=value,object}},function(module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(it,key){return hasOwnProperty.call(it,key)}},function(module,exports,__webpack_require__){"use strict";var _prodInvariant=__webpack_require__(4),oneArgumentPooler=(__webpack_require__(1),function(copyFieldsFrom){var Klass=this;if(Klass.instancePool.length){var instance=Klass.instancePool.pop();return Klass.call(instance,copyFieldsFrom),instance}return new Klass(copyFieldsFrom)}),twoArgumentPooler=function(a1,a2){var Klass=this;if(Klass.instancePool.length){var instance=Klass.instancePool.pop();return Klass.call(instance,a1,a2),instance}return new Klass(a1,a2)},threeArgumentPooler=function(a1,a2,a3){var Klass=this;if(Klass.instancePool.length){var instance=Klass.instancePool.pop();return Klass.call(instance,a1,a2,a3),instance}return new Klass(a1,a2,a3)},fourArgumentPooler=function(a1,a2,a3,a4){var Klass=this;if(Klass.instancePool.length){var instance=Klass.instancePool.pop();return Klass.call(instance,a1,a2,a3,a4),instance}return new Klass(a1,a2,a3,a4)},standardReleaser=function(instance){var Klass=this;instance instanceof Klass||_prodInvariant("25"),instance.destructor(),Klass.instancePool.length1){for(var childArray=Array(childrenLength),i=0;i1){for(var childArray=Array(childrenLength),i=0;i=0||Object.prototype.hasOwnProperty.call(obj,i)&&(target[i]=obj[i]);return target}},function(module,exports,__webpack_require__){"use strict";function checkMask(value,bitmask){return(value&bitmask)===bitmask}var _prodInvariant=__webpack_require__(4),DOMPropertyInjection=(__webpack_require__(1),{MUST_USE_PROPERTY:1,HAS_BOOLEAN_VALUE:4,HAS_NUMERIC_VALUE:8,HAS_POSITIVE_NUMERIC_VALUE:24,HAS_OVERLOADED_BOOLEAN_VALUE:32,injectDOMPropertyConfig:function(domPropertyConfig){var Injection=DOMPropertyInjection,Properties=domPropertyConfig.Properties||{},DOMAttributeNamespaces=domPropertyConfig.DOMAttributeNamespaces||{},DOMAttributeNames=domPropertyConfig.DOMAttributeNames||{},DOMPropertyNames=domPropertyConfig.DOMPropertyNames||{},DOMMutationMethods=domPropertyConfig.DOMMutationMethods||{};domPropertyConfig.isCustomAttribute&&DOMProperty._isCustomAttributeFunctions.push(domPropertyConfig.isCustomAttribute);for(var propName in Properties){DOMProperty.properties.hasOwnProperty(propName)&&_prodInvariant("48",propName);var lowerCased=propName.toLowerCase(),propConfig=Properties[propName],propertyInfo={attributeName:lowerCased,attributeNamespace:null,propertyName:propName,mutationMethod:null,mustUseProperty:checkMask(propConfig,Injection.MUST_USE_PROPERTY),hasBooleanValue:checkMask(propConfig,Injection.HAS_BOOLEAN_VALUE),hasNumericValue:checkMask(propConfig,Injection.HAS_NUMERIC_VALUE),hasPositiveNumericValue:checkMask(propConfig,Injection.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:checkMask(propConfig,Injection.HAS_OVERLOADED_BOOLEAN_VALUE)};if(propertyInfo.hasBooleanValue+propertyInfo.hasNumericValue+propertyInfo.hasOverloadedBooleanValue<=1||_prodInvariant("50",propName),DOMAttributeNames.hasOwnProperty(propName)){var attributeName=DOMAttributeNames[propName];propertyInfo.attributeName=attributeName}DOMAttributeNamespaces.hasOwnProperty(propName)&&(propertyInfo.attributeNamespace=DOMAttributeNamespaces[propName]),DOMPropertyNames.hasOwnProperty(propName)&&(propertyInfo.propertyName=DOMPropertyNames[propName]),DOMMutationMethods.hasOwnProperty(propName)&&(propertyInfo.mutationMethod=DOMMutationMethods[propName]),DOMProperty.properties[propName]=propertyInfo}}}),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",DOMProperty={ID_ATTRIBUTE_NAME:"data-reactid",ROOT_ATTRIBUTE_NAME:"data-reactroot",ATTRIBUTE_NAME_START_CHAR:ATTRIBUTE_NAME_START_CHAR,ATTRIBUTE_NAME_CHAR:ATTRIBUTE_NAME_START_CHAR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(attributeName){for(var i=0;i=O.length?{value:void 0,done:!0}:(point=$at(O,index),this._i+=point.length,{value:point,done:!1})})},function(module,exports,__webpack_require__){var bind=__webpack_require__(30);module.exports=bind.call(Function.call,Object.prototype.hasOwnProperty)},function(module,exports,__webpack_require__){"use strict";function reactProdInvariant(code){for(var argCount=arguments.length-1,message="Minified React error #"+code+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+code,argIdx=0;argIdx1)for(var i=1;i]/,createMicrosoftUnsafeLocalFunction=__webpack_require__(117),setInnerHTML=createMicrosoftUnsafeLocalFunction(function(node,html){if(node.namespaceURI!==DOMNamespaces.svg||"innerHTML"in node)node.innerHTML=html;else{reusableSVGContainer=reusableSVGContainer||document.createElement("div"),reusableSVGContainer.innerHTML=""+html+"";for(var svgNode=reusableSVGContainer.firstChild;svgNode.firstChild;)node.appendChild(svgNode.firstChild)}});if(ExecutionEnvironment.canUseDOM){var testElement=document.createElement("div");testElement.innerHTML=" ",""===testElement.innerHTML&&(setInnerHTML=function(node,html){if(node.parentNode&&node.parentNode.replaceChild(node,node),WHITESPACE_TEST.test(html)||"<"===html[0]&&NONVISIBLE_TEST.test(html)){node.innerHTML=String.fromCharCode(65279)+html;var textNode=node.firstChild;1===textNode.data.length?node.removeChild(textNode):textNode.deleteData(0,1)}else node.innerHTML=html}),testElement=null}module.exports=setInnerHTML},function(module,exports,__webpack_require__){"use strict";function escapeHtml(string){var str=""+string,match=matchHtmlRegExp.exec(str);if(!match)return str;var escape,html="",index=0,lastIndex=0;for(index=match.index;index]/;module.exports=escapeTextContentForBrowser},function(module,exports,__webpack_require__){"use strict";function getListeningForDocument(mountAt){return Object.prototype.hasOwnProperty.call(mountAt,topListenersIDKey)||(mountAt[topListenersIDKey]=reactTopListenersCounter++,alreadyListeningTo[mountAt[topListenersIDKey]]={}),alreadyListeningTo[mountAt[topListenersIDKey]]}var hasEventPageXY,_assign=__webpack_require__(7),EventPluginRegistry=__webpack_require__(109),ReactEventEmitterMixin=__webpack_require__(414),ViewportMetrics=__webpack_require__(190),getVendorPrefixedEventName=__webpack_require__(415),isEventSupported=__webpack_require__(113),alreadyListeningTo={},isMonitoringScrollValue=!1,reactTopListenersCounter=0,topEventMapping={topAbort:"abort",topAnimationEnd:getVendorPrefixedEventName("animationend")||"animationend",topAnimationIteration:getVendorPrefixedEventName("animationiteration")||"animationiteration",topAnimationStart:getVendorPrefixedEventName("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:getVendorPrefixedEventName("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},topListenersIDKey="_reactListenersID"+String(Math.random()).slice(2),ReactBrowserEventEmitter=_assign({},ReactEventEmitterMixin,{ReactEventListener:null,injection:{injectReactEventListener:function(ReactEventListener){ReactEventListener.setHandleTopLevel(ReactBrowserEventEmitter.handleTopLevel),ReactBrowserEventEmitter.ReactEventListener=ReactEventListener}},setEnabled:function(enabled){ReactBrowserEventEmitter.ReactEventListener&&ReactBrowserEventEmitter.ReactEventListener.setEnabled(enabled)},isEnabled:function(){return!(!ReactBrowserEventEmitter.ReactEventListener||!ReactBrowserEventEmitter.ReactEventListener.isEnabled())},listenTo:function(registrationName,contentDocumentHandle){for(var mountAt=contentDocumentHandle,isListening=getListeningForDocument(mountAt),dependencies=EventPluginRegistry.registrationNameDependencies[registrationName],i=0;i0?min(toInteger(it),9007199254740991):0}},function(module,exports,__webpack_require__){var anObject=__webpack_require__(23),dPs=__webpack_require__(217),enumBugKeys=__webpack_require__(97),IE_PROTO=__webpack_require__(95)("IE_PROTO"),Empty=function(){},createDict=function(){var iframeDocument,iframe=__webpack_require__(98)("iframe"),i=enumBugKeys.length;for(iframe.style.display="none",__webpack_require__(158).appendChild(iframe),iframe.src="javascript:",iframeDocument=iframe.contentWindow.document,iframeDocument.open(),iframeDocument.write("