` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `
` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport useEventCallback from '../utils/useEventCallback';\nvar useEnhancedEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n/**\n * @ignore - internal component.\n */\n\nfunction Ripple(props) {\n var classes = props.classes,\n _props$pulsate = props.pulsate,\n pulsate = _props$pulsate === void 0 ? false : _props$pulsate,\n rippleX = props.rippleX,\n rippleY = props.rippleY,\n rippleSize = props.rippleSize,\n inProp = props.in,\n _props$onExited = props.onExited,\n onExited = _props$onExited === void 0 ? function () {} : _props$onExited,\n timeout = props.timeout;\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n leaving = _React$useState2[0],\n setLeaving = _React$useState2[1];\n\n var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n var rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n var handleExited = useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority\n\n useEnhancedEffect(function () {\n if (!inProp) {\n // react-transition-group#onExit\n setLeaving(true); // react-transition-group#onExited\n\n var timeoutId = setTimeout(handleExited, timeout);\n return function () {\n clearTimeout(timeoutId);\n };\n }\n\n return undefined;\n }, [handleExited, inProp, timeout]);\n return React.createElement(\"span\", {\n className: rippleClassName,\n style: rippleStyles\n }, React.createElement(\"span\", {\n className: childClassName\n }));\n}\n\nprocess.env.NODE_ENV !== \"production\" ? Ripple.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore - injected from TransitionGroup\n */\n in: PropTypes.bool,\n\n /**\n * @ignore - injected from TransitionGroup\n */\n onExited: PropTypes.func,\n\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: PropTypes.bool,\n\n /**\n * Diameter of the ripple.\n */\n rippleSize: PropTypes.number,\n\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: PropTypes.number,\n\n /**\n * Vertical position of the ripple center.\n */\n rippleY: PropTypes.number,\n\n /**\n * exit delay\n */\n timeout: PropTypes.number.isRequired\n} : void 0;\nexport default Ripple;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { TransitionGroup } from 'react-transition-group';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport Ripple from './Ripple';\nvar DURATION = 550;\nexport var DELAY_RIPPLE = 80;\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n display: 'block',\n position: 'absolute',\n overflow: 'hidden',\n borderRadius: 'inherit',\n width: '100%',\n height: '100%',\n left: 0,\n top: 0,\n pointerEvents: 'none',\n zIndex: 0\n },\n\n /* Styles applied to the internal `Ripple` components `ripple` class. */\n ripple: {\n opacity: 0,\n position: 'absolute'\n },\n\n /* Styles applied to the internal `Ripple` components `rippleVisible` class. */\n rippleVisible: {\n opacity: 0.3,\n transform: 'scale(1)',\n animation: \"$mui-ripple-enter \".concat(DURATION, \"ms \").concat(theme.transitions.easing.easeInOut)\n },\n\n /* Styles applied to the internal `Ripple` components `ripplePulsate` class. */\n ripplePulsate: {\n animationDuration: \"\".concat(theme.transitions.duration.shorter, \"ms\")\n },\n\n /* Styles applied to the internal `Ripple` components `child` class. */\n child: {\n opacity: 1,\n display: 'block',\n width: '100%',\n height: '100%',\n borderRadius: '50%',\n backgroundColor: 'currentColor'\n },\n\n /* Styles applied to the internal `Ripple` components `childLeaving` class. */\n childLeaving: {\n opacity: 0,\n animation: \"$mui-ripple-exit \".concat(DURATION, \"ms \").concat(theme.transitions.easing.easeInOut)\n },\n\n /* Styles applied to the internal `Ripple` components `childPulsate` class. */\n childPulsate: {\n position: 'absolute',\n left: 0,\n top: 0,\n animation: \"$mui-ripple-pulsate 2500ms \".concat(theme.transitions.easing.easeInOut, \" 200ms infinite\")\n },\n '@keyframes mui-ripple-enter': {\n '0%': {\n transform: 'scale(0)',\n opacity: 0.1\n },\n '100%': {\n transform: 'scale(1)',\n opacity: 0.3\n }\n },\n '@keyframes mui-ripple-exit': {\n '0%': {\n opacity: 1\n },\n '100%': {\n opacity: 0\n }\n },\n '@keyframes mui-ripple-pulsate': {\n '0%': {\n transform: 'scale(1)'\n },\n '50%': {\n transform: 'scale(0.92)'\n },\n '100%': {\n transform: 'scale(1)'\n }\n }\n };\n}; // TODO v5: Make private\n\nvar TouchRipple = React.forwardRef(function TouchRipple(props, ref) {\n var _props$center = props.center,\n centerProp = _props$center === void 0 ? false : _props$center,\n classes = props.classes,\n className = props.className,\n other = _objectWithoutProperties(props, [\"center\", \"classes\", \"className\"]);\n\n var _React$useState = React.useState([]),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n ripples = _React$useState2[0],\n setRipples = _React$useState2[1];\n\n var nextKey = React.useRef(0);\n var rippleCallback = React.useRef(null);\n React.useEffect(function () {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]); // Used to filter out mouse emulated events on mobile.\n\n var ignoringMouseDown = React.useRef(false); // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n\n var startTimer = React.useRef(null); // This is the hook called once the previous timeout is ready.\n\n var startTimerCommit = React.useRef(null);\n var container = React.useRef(null);\n React.useEffect(function () {\n return function () {\n clearTimeout(startTimer.current);\n };\n }, []);\n var startCommit = React.useCallback(function (params) {\n var pulsate = params.pulsate,\n rippleX = params.rippleX,\n rippleY = params.rippleY,\n rippleSize = params.rippleSize,\n cb = params.cb;\n setRipples(function (oldRipples) {\n return [].concat(_toConsumableArray(oldRipples), [React.createElement(Ripple, {\n key: nextKey.current,\n classes: classes,\n timeout: DURATION,\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n })]);\n });\n nextKey.current += 1;\n rippleCallback.current = cb;\n }, [classes]);\n var start = React.useCallback(function () {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var cb = arguments.length > 2 ? arguments[2] : undefined;\n var _options$pulsate = options.pulsate,\n pulsate = _options$pulsate === void 0 ? false : _options$pulsate,\n _options$center = options.center,\n center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,\n _options$fakeElement = options.fakeElement,\n fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;\n\n if (event.type === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n\n if (event.type === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n\n var element = fakeElement ? null : container.current;\n var rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n }; // Get the size of the ripple\n\n var rippleX;\n var rippleY;\n var rippleSize;\n\n if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n var clientX = event.clientX ? event.clientX : event.touches[0].clientX;\n var clientY = event.clientY ? event.clientY : event.touches[0].clientY;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n\n if (center) {\n rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); // For some reason the animation is broken on Mobile Chrome if the size if even.\n\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));\n } // Touche devices\n\n\n if (event.touches) {\n // Prepare the ripple effect.\n startTimerCommit.current = function () {\n startCommit({\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize,\n cb: cb\n });\n }; // Delay the execution of the ripple effect.\n\n\n startTimer.current = setTimeout(function () {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n }, DELAY_RIPPLE); // We have to make a tradeoff with this value.\n } else {\n startCommit({\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize,\n cb: cb\n });\n }\n }, [centerProp, startCommit]);\n var pulsate = React.useCallback(function () {\n start({}, {\n pulsate: true\n });\n }, [start]);\n var stop = React.useCallback(function (event, cb) {\n clearTimeout(startTimer.current); // The touch interaction occurs too quickly.\n // We still want to show ripple effect.\n\n if (event.type === 'touchend' && startTimerCommit.current) {\n event.persist();\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.current = setTimeout(function () {\n stop(event, cb);\n });\n return;\n }\n\n startTimerCommit.current = null;\n setRipples(function (oldRipples) {\n if (oldRipples.length > 0) {\n return oldRipples.slice(1);\n }\n\n return oldRipples;\n });\n rippleCallback.current = cb;\n }, []);\n React.useImperativeHandle(ref, function () {\n return {\n pulsate: pulsate,\n start: start,\n stop: stop\n };\n }, [pulsate, start, stop]);\n return React.createElement(\"span\", _extends({\n className: clsx(classes.root, className),\n ref: container\n }, other), React.createElement(TransitionGroup, {\n component: null,\n exit: true\n }, ripples));\n}); // TODO cleanup after https://github.com/reactjs/react-docgen/pull/378 is released\n\nfunction withMuiName(Component) {\n Component.muiName = 'MuiTouchRipple';\n return Component;\n}\n\nprocess.env.NODE_ENV !== \"production\" ? TouchRipple.propTypes = {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: PropTypes.bool,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore\n */\n className: PropTypes.string\n} : void 0;\nexport default withStyles(styles, {\n flip: false,\n name: 'MuiTouchRipple'\n})(withMuiName(React.memo(TouchRipple)));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport clsx from 'clsx';\nimport { elementTypeAcceptingRef } from '@material-ui/utils';\nimport { useForkRef } from '../utils/reactHelpers';\nimport useEventCallback from '../utils/useEventCallback';\nimport withStyles from '../styles/withStyles';\nimport NoSsr from '../NoSsr';\nimport { useIsFocusVisible } from '../utils/focusVisible';\nimport TouchRipple from './TouchRipple';\nexport var styles = {\n /* Styles applied to the root element. */\n root: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n // Remove grey highlight\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n '-moz-appearance': 'none',\n // Reset\n '-webkit-appearance': 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n\n },\n '&$disabled': {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n }\n },\n\n /* Pseudo-class applied to the root element if `disabled={true}`. */\n disabled: {},\n\n /* Pseudo-class applied to the root element if keyboard focused. */\n focusVisible: {}\n};\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\n\nvar ButtonBase = React.forwardRef(function ButtonBase(props, ref) {\n var action = props.action,\n buttonRefProp = props.buttonRef,\n _props$centerRipple = props.centerRipple,\n centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,\n children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n _props$component = props.component,\n component = _props$component === void 0 ? 'button' : _props$component,\n disabled = props.disabled,\n _props$disableRipple = props.disableRipple,\n disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,\n _props$disableTouchRi = props.disableTouchRipple,\n disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,\n _props$focusRipple = props.focusRipple,\n focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,\n focusVisibleClassName = props.focusVisibleClassName,\n onBlur = props.onBlur,\n onClick = props.onClick,\n onFocus = props.onFocus,\n onFocusVisible = props.onFocusVisible,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp,\n onMouseDown = props.onMouseDown,\n onMouseLeave = props.onMouseLeave,\n onMouseUp = props.onMouseUp,\n onTouchEnd = props.onTouchEnd,\n onTouchMove = props.onTouchMove,\n onTouchStart = props.onTouchStart,\n onDragLeave = props.onDragLeave,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n TouchRippleProps = props.TouchRippleProps,\n _props$type = props.type,\n type = _props$type === void 0 ? 'button' : _props$type,\n other = _objectWithoutProperties(props, [\"action\", \"buttonRef\", \"centerRipple\", \"children\", \"classes\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"onBlur\", \"onClick\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"onDragLeave\", \"tabIndex\", \"TouchRippleProps\", \"type\"]);\n\n var buttonRef = React.useRef(null);\n\n function getButtonNode() {\n // #StrictMode ready\n return ReactDOM.findDOMNode(buttonRef.current);\n }\n\n var rippleRef = React.useRef(null);\n\n var _React$useState = React.useState(false),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n focusVisible = _React$useState2[0],\n setFocusVisible = _React$useState2[1];\n\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n\n var _useIsFocusVisible = useIsFocusVisible(),\n isFocusVisible = _useIsFocusVisible.isFocusVisible,\n onBlurVisible = _useIsFocusVisible.onBlurVisible,\n focusVisibleRef = _useIsFocusVisible.ref;\n\n React.useImperativeHandle(action, function () {\n return {\n focusVisible: function focusVisible() {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n };\n }, []);\n React.useEffect(function () {\n if (focusVisible && focusRipple && !disableRipple) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible]);\n\n function useRippleHandler(rippleAction, eventCallback) {\n var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;\n return useEventCallback(function (event) {\n if (eventCallback) {\n eventCallback(event);\n }\n\n var ignore = event.defaultPrevented || skipRippleAction;\n\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n\n return true;\n });\n }\n\n var handleMouseDown = useRippleHandler('start', onMouseDown);\n var handleDragLeave = useRippleHandler('stop', onDragLeave);\n var handleMouseUp = useRippleHandler('stop', onMouseUp);\n var handleMouseLeave = useRippleHandler('stop', function (event) {\n if (focusVisible) {\n event.preventDefault();\n }\n\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n var handleTouchStart = useRippleHandler('start', onTouchStart);\n var handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n var handleTouchMove = useRippleHandler('stop', onTouchMove);\n var handleBlur = useRippleHandler('stop', function (event) {\n if (focusVisible) {\n onBlurVisible(event);\n setFocusVisible(false);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n var handleFocus = useEventCallback(function (event) {\n if (disabled) {\n return;\n } // Fix for https://github.com/facebook/react/issues/7769\n\n\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n\n if (isFocusVisible(event)) {\n setFocusVisible(true);\n\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n\n if (onFocus) {\n onFocus(event);\n }\n });\n /**\n * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n\n var keydownRef = React.useRef(false);\n var handleKeyDown = useEventCallback(function (event) {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n event.persist();\n rippleRef.current.stop(event, function () {\n rippleRef.current.start(event);\n });\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n var button = getButtonNode(); // Keyboard accessibility for non interactive elements\n\n if (event.target === event.currentTarget && component && component !== 'button' && (event.key === ' ' || event.key === 'Enter') && !(button.tagName === 'A' && button.href)) {\n event.preventDefault();\n\n if (onClick) {\n onClick(event);\n }\n }\n });\n var handleKeyUp = useEventCallback(function (event) {\n if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible) {\n keydownRef.current = false;\n event.persist();\n rippleRef.current.stop(event, function () {\n rippleRef.current.pulsate(event);\n });\n }\n\n if (onKeyUp) {\n onKeyUp(event);\n }\n });\n var className = clsx(classes.root, classNameProp, focusVisible && [classes.focusVisible, focusVisibleClassName], disabled && classes.disabled);\n var ComponentProp = component;\n\n if (ComponentProp === 'button' && other.href) {\n ComponentProp = 'a';\n }\n\n var buttonProps = {};\n\n if (ComponentProp === 'button') {\n buttonProps.type = type;\n buttonProps.disabled = disabled;\n } else {\n if (ComponentProp !== 'a' || !other.href) {\n buttonProps.role = 'button';\n }\n\n buttonProps['aria-disabled'] = disabled;\n }\n\n var handleUserRef = useForkRef(buttonRefProp, ref);\n var handleOwnRef = useForkRef(focusVisibleRef, buttonRef);\n var handleRef = useForkRef(handleUserRef, handleOwnRef);\n return React.createElement(ComponentProp, _extends({\n className: className,\n onBlur: handleBlur,\n onClick: onClick,\n onFocus: handleFocus,\n onKeyDown: handleKeyDown,\n onKeyUp: handleKeyUp,\n onMouseDown: handleMouseDown,\n onMouseLeave: handleMouseLeave,\n onMouseUp: handleMouseUp,\n onDragLeave: handleDragLeave,\n onTouchEnd: handleTouchEnd,\n onTouchMove: handleTouchMove,\n onTouchStart: handleTouchStart,\n ref: handleRef,\n tabIndex: disabled ? -1 : tabIndex\n }, buttonProps, other), children, !disableRipple && !disabled ? React.createElement(NoSsr, null, React.createElement(TouchRipple, _extends({\n ref: rippleRef,\n center: centerRipple\n }, TouchRippleProps))) : null);\n});\nprocess.env.NODE_ENV !== \"production\" ? ButtonBase.propTypes = {\n /**\n * A ref for imperative actions.\n * It currently only supports `focusVisible()` action.\n */\n action: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n\n /**\n * Use that prop to pass a ref callback to the native button component.\n * @deprecated Use `ref` instead\n */\n buttonRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),\n\n /**\n * If `true`, the ripples will be centered.\n * They won't start at the cursor interaction position.\n */\n centerRipple: PropTypes.bool,\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: elementTypeAcceptingRef,\n\n /**\n * If `true`, the base button will be disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, the ripple effect will be disabled.\n *\n * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure\n * to highlight the element by applying separate styles with the `focusVisibleClassName`.\n */\n disableRipple: PropTypes.bool,\n\n /**\n * If `true`, the touch ripple effect will be disabled.\n */\n disableTouchRipple: PropTypes.bool,\n\n /**\n * If `true`, the base button will have a keyboard focus ripple.\n * `disableRipple` must also be `false`.\n */\n focusRipple: PropTypes.bool,\n\n /**\n * This prop can help a person know which element has the keyboard focus.\n * The class name will be applied when the element gain the focus through a keyboard interaction.\n * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).\n * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/master/explainer.md).\n * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components\n * if needed.\n */\n focusVisibleClassName: PropTypes.string,\n\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n\n /**\n * @ignore\n */\n onClick: PropTypes.func,\n\n /**\n * @ignore\n */\n onDragLeave: PropTypes.func,\n\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n\n /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onFocusVisible: PropTypes.func,\n\n /**\n * @ignore\n */\n onKeyDown: PropTypes.func,\n\n /**\n * @ignore\n */\n onKeyUp: PropTypes.func,\n\n /**\n * @ignore\n */\n onMouseDown: PropTypes.func,\n\n /**\n * @ignore\n */\n onMouseLeave: PropTypes.func,\n\n /**\n * @ignore\n */\n onMouseUp: PropTypes.func,\n\n /**\n * @ignore\n */\n onTouchEnd: PropTypes.func,\n\n /**\n * @ignore\n */\n onTouchMove: PropTypes.func,\n\n /**\n * @ignore\n */\n onTouchStart: PropTypes.func,\n\n /**\n * @ignore\n */\n role: PropTypes.string,\n\n /**\n * @ignore\n */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * Props applied to the `TouchRipple` element.\n */\n TouchRippleProps: PropTypes.object,\n\n /**\n * Used to control the button's purpose.\n * This prop passes the value to the `type` attribute of the native button component.\n */\n type: PropTypes.oneOf(['submit', 'reset', 'button'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiButtonBase'\n})(ButtonBase);","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar LoggingService =\n/** @class */\nfunction () {\n function LoggingService() {}\n\n LoggingService.prototype.warnUnityContentRemoveNotAvailable = function (additionalDetials) {\n this.warn(\"Your version of Unity does not support unloading the WebGL Player.\", \"This preverts ReactUnityWebGL from unmounting this component properly.\", \"Please consider updating to Unity 2019.1 or newer, or reload the page\", \"to free the WebGL Player from the memory. See the follow link for more details:\", \"https://github.com/elraccoone/react-unity-webgl/issues/22\", additionalDetials);\n };\n\n LoggingService.prototype.errorUnityLoaderNotFound = function (additionalDetials) {\n this.error(\"Unable to use the Unity Loader, please make sure you've imported\", \"the Unity Loader the correct way. You might have entered an incorrect\", \"path to the UnityLoader.js. The path is not relative to your bundle,\", \"but to your index html file. See the follow link for more details: \", \"https://github.com/elraccoone/react-unity-webgl/issues/31\", additionalDetials);\n };\n\n LoggingService.prototype.warn = function () {\n var messages = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n messages[_i] = arguments[_i];\n }\n\n console.warn(messages.filter(function (_) {\n return typeof _ !== \"undefined\";\n }).join(\" \"));\n };\n\n LoggingService.prototype.error = function () {\n var messages = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n messages[_i] = arguments[_i];\n }\n\n console.error(messages.filter(function (_) {\n return typeof _ !== \"undefined\";\n }).join(\" \"));\n };\n\n return LoggingService;\n}();\n\nexports.loggingService = new LoggingService();","\"use strict\";\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n/**\n * Check if `obj` is an object.\n *\n * @param {Object} obj\n * @return {Boolean}\n * @api private\n */\n\n\nfunction isObject(obj) {\n return obj !== null && _typeof(obj) === 'object';\n}\n\nmodule.exports = isObject;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","/**\r\n * Parses an URI\r\n *\r\n * @author Steven Levithan (MIT license)\r\n * @api private\r\n */\nvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\nvar parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'];\n\nmodule.exports = function parseuri(str) {\n var src = str,\n b = str.indexOf('['),\n e = str.indexOf(']');\n\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n\n var m = re.exec(str || ''),\n uri = {},\n i = 14;\n\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n\n return uri;\n};","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};","module.exports = isBuf;\nvar withNativeBuffer = typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function';\nvar withNativeArrayBuffer = typeof ArrayBuffer === 'function';\n\nvar isView = function isView(obj) {\n return typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;\n};\n/**\n * Returns true if obj is a buffer or an arraybuffer.\n *\n * @api private\n */\n\n\nfunction isBuf(obj) {\n return withNativeBuffer && Buffer.isBuffer(obj) || withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj));\n}","/**\n * Module dependencies.\n */\nvar eio = require('engine.io-client');\n\nvar Socket = require('./socket');\n\nvar Emitter = require('component-emitter');\n\nvar parser = require('socket.io-parser');\n\nvar on = require('./on');\n\nvar bind = require('component-bind');\n\nvar debug = require('debug')('socket.io-client:manager');\n\nvar indexOf = require('indexof');\n\nvar Backoff = require('backo2');\n/**\n * IE6+ hasOwnProperty\n */\n\n\nvar has = Object.prototype.hasOwnProperty;\n/**\n * Module exports\n */\n\nmodule.exports = Manager;\n/**\n * `Manager` constructor.\n *\n * @param {String} engine instance or engine uri/opts\n * @param {Object} options\n * @api public\n */\n\nfunction Manager(uri, opts) {\n if (!(this instanceof Manager)) return new Manager(uri, opts);\n\n if (uri && 'object' === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n\n opts = opts || {};\n opts.path = opts.path || '/socket.io';\n this.nsps = {};\n this.subs = [];\n this.opts = opts;\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor(opts.randomizationFactor || 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor()\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this.readyState = 'closed';\n this.uri = uri;\n this.connecting = [];\n this.lastPing = null;\n this.encoding = false;\n this.packetBuffer = [];\n\n var _parser = opts.parser || parser;\n\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this.autoConnect = opts.autoConnect !== false;\n if (this.autoConnect) this.open();\n}\n/**\n * Propagate given event to sockets and emit on `this`\n *\n * @api private\n */\n\n\nManager.prototype.emitAll = function () {\n this.emit.apply(this, arguments);\n\n for (var nsp in this.nsps) {\n if (has.call(this.nsps, nsp)) {\n this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n }\n }\n};\n/**\n * Update `socket.id` of all sockets\n *\n * @api private\n */\n\n\nManager.prototype.updateSocketIds = function () {\n for (var nsp in this.nsps) {\n if (has.call(this.nsps, nsp)) {\n this.nsps[nsp].id = this.generateId(nsp);\n }\n }\n};\n/**\n * generate `socket.id` for the given `nsp`\n *\n * @param {String} nsp\n * @return {String}\n * @api private\n */\n\n\nManager.prototype.generateId = function (nsp) {\n return (nsp === '/' ? '' : nsp + '#') + this.engine.id;\n};\n/**\n * Mix in `Emitter`.\n */\n\n\nEmitter(Manager.prototype);\n/**\n * Sets the `reconnection` config.\n *\n * @param {Boolean} true/false if it should automatically reconnect\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnection = function (v) {\n if (!arguments.length) return this._reconnection;\n this._reconnection = !!v;\n return this;\n};\n/**\n * Sets the reconnection attempts config.\n *\n * @param {Number} max reconnection attempts before giving up\n * @return {Manager} self or value\n * @api public\n */\n\n\nManager.prototype.reconnectionAttempts = function (v) {\n if (!arguments.length) return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n};\n/**\n * Sets the delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\n\nManager.prototype.reconnectionDelay = function (v) {\n if (!arguments.length) return this._reconnectionDelay;\n this._reconnectionDelay = v;\n this.backoff && this.backoff.setMin(v);\n return this;\n};\n\nManager.prototype.randomizationFactor = function (v) {\n if (!arguments.length) return this._randomizationFactor;\n this._randomizationFactor = v;\n this.backoff && this.backoff.setJitter(v);\n return this;\n};\n/**\n * Sets the maximum delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\n\nManager.prototype.reconnectionDelayMax = function (v) {\n if (!arguments.length) return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n this.backoff && this.backoff.setMax(v);\n return this;\n};\n/**\n * Sets the connection timeout. `false` to disable\n *\n * @return {Manager} self or value\n * @api public\n */\n\n\nManager.prototype.timeout = function (v) {\n if (!arguments.length) return this._timeout;\n this._timeout = v;\n return this;\n};\n/**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @api private\n */\n\n\nManager.prototype.maybeReconnectOnOpen = function () {\n // Only try to reconnect if it's the first time we're connecting\n if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n};\n/**\n * Sets the current transport `socket`.\n *\n * @param {Function} optional, callback\n * @return {Manager} self\n * @api public\n */\n\n\nManager.prototype.open = Manager.prototype.connect = function (fn, opts) {\n debug('readyState %s', this.readyState);\n if (~this.readyState.indexOf('open')) return this;\n debug('opening %s', this.uri);\n this.engine = eio(this.uri, this.opts);\n var socket = this.engine;\n var self = this;\n this.readyState = 'opening';\n this.skipReconnect = false; // emit `open`\n\n var openSub = on(socket, 'open', function () {\n self.onopen();\n fn && fn();\n }); // emit `connect_error`\n\n var errorSub = on(socket, 'error', function (data) {\n debug('connect_error');\n self.cleanup();\n self.readyState = 'closed';\n self.emitAll('connect_error', data);\n\n if (fn) {\n var err = new Error('Connection error');\n err.data = data;\n fn(err);\n } else {\n // Only do this if there is no fn to handle the error\n self.maybeReconnectOnOpen();\n }\n }); // emit `connect_timeout`\n\n if (false !== this._timeout) {\n var timeout = this._timeout;\n debug('connect attempt will timeout after %d', timeout); // set timer\n\n var timer = setTimeout(function () {\n debug('connect attempt timed out after %d', timeout);\n openSub.destroy();\n socket.close();\n socket.emit('error', 'timeout');\n self.emitAll('connect_timeout', timeout);\n }, timeout);\n this.subs.push({\n destroy: function destroy() {\n clearTimeout(timer);\n }\n });\n }\n\n this.subs.push(openSub);\n this.subs.push(errorSub);\n return this;\n};\n/**\n * Called upon transport open.\n *\n * @api private\n */\n\n\nManager.prototype.onopen = function () {\n debug('open'); // clear old subs\n\n this.cleanup(); // mark as open\n\n this.readyState = 'open';\n this.emit('open'); // add new subs\n\n var socket = this.engine;\n this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n};\n/**\n * Called upon a ping.\n *\n * @api private\n */\n\n\nManager.prototype.onping = function () {\n this.lastPing = new Date();\n this.emitAll('ping');\n};\n/**\n * Called upon a packet.\n *\n * @api private\n */\n\n\nManager.prototype.onpong = function () {\n this.emitAll('pong', new Date() - this.lastPing);\n};\n/**\n * Called with data.\n *\n * @api private\n */\n\n\nManager.prototype.ondata = function (data) {\n this.decoder.add(data);\n};\n/**\n * Called when parser fully decodes a packet.\n *\n * @api private\n */\n\n\nManager.prototype.ondecoded = function (packet) {\n this.emit('packet', packet);\n};\n/**\n * Called upon socket error.\n *\n * @api private\n */\n\n\nManager.prototype.onerror = function (err) {\n debug('error', err);\n this.emitAll('error', err);\n};\n/**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @api public\n */\n\n\nManager.prototype.socket = function (nsp, opts) {\n var socket = this.nsps[nsp];\n\n if (!socket) {\n socket = new Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n var self = this;\n socket.on('connecting', onConnecting);\n socket.on('connect', function () {\n socket.id = self.generateId(nsp);\n });\n\n if (this.autoConnect) {\n // manually call here since connecting event is fired before listening\n onConnecting();\n }\n }\n\n function onConnecting() {\n if (!~indexOf(self.connecting, socket)) {\n self.connecting.push(socket);\n }\n }\n\n return socket;\n};\n/**\n * Called upon a socket close.\n *\n * @param {Socket} socket\n */\n\n\nManager.prototype.destroy = function (socket) {\n var index = indexOf(this.connecting, socket);\n if (~index) this.connecting.splice(index, 1);\n if (this.connecting.length) return;\n this.close();\n};\n/**\n * Writes a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\n\nManager.prototype.packet = function (packet) {\n debug('writing packet %j', packet);\n var self = this;\n if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;\n\n if (!self.encoding) {\n // encode, then write to engine with result\n self.encoding = true;\n this.encoder.encode(packet, function (encodedPackets) {\n for (var i = 0; i < encodedPackets.length; i++) {\n self.engine.write(encodedPackets[i], packet.options);\n }\n\n self.encoding = false;\n self.processPacketQueue();\n });\n } else {\n // add packet to the queue\n self.packetBuffer.push(packet);\n }\n};\n/**\n * If packet buffer is non-empty, begins encoding the\n * next packet in line.\n *\n * @api private\n */\n\n\nManager.prototype.processPacketQueue = function () {\n if (this.packetBuffer.length > 0 && !this.encoding) {\n var pack = this.packetBuffer.shift();\n this.packet(pack);\n }\n};\n/**\n * Clean up transport subscriptions and packet buffer.\n *\n * @api private\n */\n\n\nManager.prototype.cleanup = function () {\n debug('cleanup');\n var subsLength = this.subs.length;\n\n for (var i = 0; i < subsLength; i++) {\n var sub = this.subs.shift();\n sub.destroy();\n }\n\n this.packetBuffer = [];\n this.encoding = false;\n this.lastPing = null;\n this.decoder.destroy();\n};\n/**\n * Close the current socket.\n *\n * @api private\n */\n\n\nManager.prototype.close = Manager.prototype.disconnect = function () {\n debug('disconnect');\n this.skipReconnect = true;\n this.reconnecting = false;\n\n if ('opening' === this.readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n\n this.backoff.reset();\n this.readyState = 'closed';\n if (this.engine) this.engine.close();\n};\n/**\n * Called upon engine close.\n *\n * @api private\n */\n\n\nManager.prototype.onclose = function (reason) {\n debug('onclose');\n this.cleanup();\n this.backoff.reset();\n this.readyState = 'closed';\n this.emit('close', reason);\n\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n};\n/**\n * Attempt a reconnection.\n *\n * @api private\n */\n\n\nManager.prototype.reconnect = function () {\n if (this.reconnecting || this.skipReconnect) return this;\n var self = this;\n\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n debug('reconnect failed');\n this.backoff.reset();\n this.emitAll('reconnect_failed');\n this.reconnecting = false;\n } else {\n var delay = this.backoff.duration();\n debug('will wait %dms before reconnect attempt', delay);\n this.reconnecting = true;\n var timer = setTimeout(function () {\n if (self.skipReconnect) return;\n debug('attempting reconnect');\n self.emitAll('reconnect_attempt', self.backoff.attempts);\n self.emitAll('reconnecting', self.backoff.attempts); // check again for the case socket closed in above events\n\n if (self.skipReconnect) return;\n self.open(function (err) {\n if (err) {\n debug('reconnect attempt error');\n self.reconnecting = false;\n self.reconnect();\n self.emitAll('reconnect_error', err.data);\n } else {\n debug('reconnect success');\n self.onreconnect();\n }\n });\n }, delay);\n this.subs.push({\n destroy: function destroy() {\n clearTimeout(timer);\n }\n });\n }\n};\n/**\n * Called upon successful reconnect.\n *\n * @api private\n */\n\n\nManager.prototype.onreconnect = function () {\n var attempt = this.backoff.attempts;\n this.reconnecting = false;\n this.backoff.reset();\n this.updateSocketIds();\n this.emitAll('reconnect', attempt);\n};","/**\n * Module dependencies\n */\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\n\nvar XHR = require('./polling-xhr');\n\nvar JSONP = require('./polling-jsonp');\n\nvar websocket = require('./websocket');\n/**\n * Export transports.\n */\n\n\nexports.polling = polling;\nexports.websocket = websocket;\n/**\n * Polling transport polymorphic constructor.\n * Decides on xhr vs jsonp based on feature detection.\n *\n * @api private\n */\n\nfunction polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port; // some user agents have empty `location.port`\n\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n}","/**\n * Module dependencies.\n */\nvar Transport = require('../transport');\n\nvar parseqs = require('parseqs');\n\nvar parser = require('engine.io-parser');\n\nvar inherit = require('component-inherit');\n\nvar yeast = require('yeast');\n\nvar debug = require('debug')('engine.io-client:polling');\n/**\n * Module exports.\n */\n\n\nmodule.exports = Polling;\n/**\n * Is XHR2 supported?\n */\n\nvar hasXHR2 = function () {\n var XMLHttpRequest = require('xmlhttprequest-ssl');\n\n var xhr = new XMLHttpRequest({\n xdomain: false\n });\n return null != xhr.responseType;\n}();\n/**\n * Polling interface.\n *\n * @param {Object} opts\n * @api private\n */\n\n\nfunction Polling(opts) {\n var forceBase64 = opts && opts.forceBase64;\n\n if (!hasXHR2 || forceBase64) {\n this.supportsBinary = false;\n }\n\n Transport.call(this, opts);\n}\n/**\n * Inherits from Transport.\n */\n\n\ninherit(Polling, Transport);\n/**\n * Transport name.\n */\n\nPolling.prototype.name = 'polling';\n/**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @api private\n */\n\nPolling.prototype.doOpen = function () {\n this.poll();\n};\n/**\n * Pauses polling.\n *\n * @param {Function} callback upon buffers are flushed and transport is paused\n * @api private\n */\n\n\nPolling.prototype.pause = function (onPause) {\n var self = this;\n this.readyState = 'pausing';\n\n function pause() {\n debug('paused');\n self.readyState = 'paused';\n onPause();\n }\n\n if (this.polling || !this.writable) {\n var total = 0;\n\n if (this.polling) {\n debug('we are currently polling - waiting to pause');\n total++;\n this.once('pollComplete', function () {\n debug('pre-pause polling complete');\n --total || pause();\n });\n }\n\n if (!this.writable) {\n debug('we are currently writing - waiting to pause');\n total++;\n this.once('drain', function () {\n debug('pre-pause writing complete');\n --total || pause();\n });\n }\n } else {\n pause();\n }\n};\n/**\n * Starts polling cycle.\n *\n * @api public\n */\n\n\nPolling.prototype.poll = function () {\n debug('polling');\n this.polling = true;\n this.doPoll();\n this.emit('poll');\n};\n/**\n * Overloads onData to detect payloads.\n *\n * @api private\n */\n\n\nPolling.prototype.onData = function (data) {\n var self = this;\n debug('polling got data %s', data);\n\n var callback = function callback(packet, index, total) {\n // if its the first message we consider the transport open\n if ('opening' === self.readyState) {\n self.onOpen();\n } // if its a close packet, we close the ongoing requests\n\n\n if ('close' === packet.type) {\n self.onClose();\n return false;\n } // otherwise bypass onData and handle the message\n\n\n self.onPacket(packet);\n }; // decode payload\n\n\n parser.decodePayload(data, this.socket.binaryType, callback); // if an event did not trigger closing\n\n if ('closed' !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emit('pollComplete');\n\n if ('open' === this.readyState) {\n this.poll();\n } else {\n debug('ignoring poll - transport state \"%s\"', this.readyState);\n }\n }\n};\n/**\n * For polling, send a close packet.\n *\n * @api private\n */\n\n\nPolling.prototype.doClose = function () {\n var self = this;\n\n function close() {\n debug('writing close packet');\n self.write([{\n type: 'close'\n }]);\n }\n\n if ('open' === this.readyState) {\n debug('transport open - closing');\n close();\n } else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n debug('transport not open - deferring close');\n this.once('open', close);\n }\n};\n/**\n * Writes a packets payload.\n *\n * @param {Array} data packets\n * @param {Function} drain callback\n * @api private\n */\n\n\nPolling.prototype.write = function (packets) {\n var self = this;\n this.writable = false;\n\n var callbackfn = function callbackfn() {\n self.writable = true;\n self.emit('drain');\n };\n\n parser.encodePayload(packets, this.supportsBinary, function (data) {\n self.doWrite(data, callbackfn);\n });\n};\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\n\nPolling.prototype.uri = function () {\n var query = this.query || {};\n var schema = this.secure ? 'https' : 'http';\n var port = ''; // cache busting is forced\n\n if (false !== this.timestampRequests) {\n query[this.timestampParam] = yeast();\n }\n\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n\n query = parseqs.encode(query); // avoid port if default for schema\n\n if (this.port && ('https' === schema && Number(this.port) !== 443 || 'http' === schema && Number(this.port) !== 80)) {\n port = ':' + this.port;\n } // prepend ? to query\n\n\n if (query.length) {\n query = '?' + query;\n }\n\n var ipv6 = this.hostname.indexOf(':') !== -1;\n return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};","/* global Blob File */\n\n/*\n * Module requirements.\n */\nvar isArray = require('isarray');\n\nvar toString = Object.prototype.toString;\nvar withNativeBlob = typeof Blob === 'function' || typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]';\nvar withNativeFile = typeof File === 'function' || typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]';\n/**\n * Module exports.\n */\n\nmodule.exports = hasBinary;\n/**\n * Checks for binary data.\n *\n * Supports Buffer, ArrayBuffer, Blob and File.\n *\n * @param {Object} anything\n * @api public\n */\n\nfunction hasBinary(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n if (isArray(obj)) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (hasBinary(obj[i])) {\n return true;\n }\n }\n\n return false;\n }\n\n if (typeof Buffer === 'function' && Buffer.isBuffer && Buffer.isBuffer(obj) || typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File) {\n return true;\n } // see: https://github.com/Automattic/has-binary/pull/4\n\n\n if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {\n return hasBinary(obj.toJSON(), true);\n }\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n return true;\n }\n }\n\n return false;\n}","'use strict';\n\nvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''),\n length = 64,\n map = {},\n seed = 0,\n i = 0,\n prev;\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\n\nfunction encode(num) {\n var encoded = '';\n\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n\n return encoded;\n}\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\n\n\nfunction decode(str) {\n var decoded = 0;\n\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n\n return decoded;\n}\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\n\n\nfunction yeast() {\n var now = encode(+new Date());\n if (now !== prev) return seed = 0, prev = now;\n return now + '.' + encode(seed++);\n} //\n// Map each character to its index.\n//\n\n\nfor (; i < length; i++) {\n map[alphabet[i]] = i;\n} //\n// Expose the `yeast`, `encode` and `decode` functions.\n//\n\n\nyeast.encode = encode;\nyeast.decode = decode;\nmodule.exports = yeast;","var indexOf = [].indexOf;\n\nmodule.exports = function (arr, obj) {\n if (indexOf) return arr.indexOf(obj);\n\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n\n return -1;\n};","/**\n * Module dependencies.\n */\nvar parser = require('socket.io-parser');\n\nvar Emitter = require('component-emitter');\n\nvar toArray = require('to-array');\n\nvar on = require('./on');\n\nvar bind = require('component-bind');\n\nvar debug = require('debug')('socket.io-client:socket');\n\nvar parseqs = require('parseqs');\n\nvar hasBin = require('has-binary2');\n/**\n * Module exports.\n */\n\n\nmodule.exports = exports = Socket;\n/**\n * Internal events (blacklisted).\n * These events can't be emitted by the user.\n *\n * @api private\n */\n\nvar events = {\n connect: 1,\n connect_error: 1,\n connect_timeout: 1,\n connecting: 1,\n disconnect: 1,\n error: 1,\n reconnect: 1,\n reconnect_attempt: 1,\n reconnect_failed: 1,\n reconnect_error: 1,\n reconnecting: 1,\n ping: 1,\n pong: 1\n};\n/**\n * Shortcut to `Emitter#emit`.\n */\n\nvar emit = Emitter.prototype.emit;\n/**\n * `Socket` constructor.\n *\n * @api public\n */\n\nfunction Socket(io, nsp, opts) {\n this.io = io;\n this.nsp = nsp;\n this.json = this; // compat\n\n this.ids = 0;\n this.acks = {};\n this.receiveBuffer = [];\n this.sendBuffer = [];\n this.connected = false;\n this.disconnected = true;\n this.flags = {};\n\n if (opts && opts.query) {\n this.query = opts.query;\n }\n\n if (this.io.autoConnect) this.open();\n}\n/**\n * Mix in `Emitter`.\n */\n\n\nEmitter(Socket.prototype);\n/**\n * Subscribe to open, close and packet events\n *\n * @api private\n */\n\nSocket.prototype.subEvents = function () {\n if (this.subs) return;\n var io = this.io;\n this.subs = [on(io, 'open', bind(this, 'onopen')), on(io, 'packet', bind(this, 'onpacket')), on(io, 'close', bind(this, 'onclose'))];\n};\n/**\n * \"Opens\" the socket.\n *\n * @api public\n */\n\n\nSocket.prototype.open = Socket.prototype.connect = function () {\n if (this.connected) return this;\n this.subEvents();\n this.io.open(); // ensure open\n\n if ('open' === this.io.readyState) this.onopen();\n this.emit('connecting');\n return this;\n};\n/**\n * Sends a `message` event.\n *\n * @return {Socket} self\n * @api public\n */\n\n\nSocket.prototype.send = function () {\n var args = toArray(arguments);\n args.unshift('message');\n this.emit.apply(this, args);\n return this;\n};\n/**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @param {String} event name\n * @return {Socket} self\n * @api public\n */\n\n\nSocket.prototype.emit = function (ev) {\n if (events.hasOwnProperty(ev)) {\n emit.apply(this, arguments);\n return this;\n }\n\n var args = toArray(arguments);\n var packet = {\n type: (this.flags.binary !== undefined ? this.flags.binary : hasBin(args)) ? parser.BINARY_EVENT : parser.EVENT,\n data: args\n };\n packet.options = {};\n packet.options.compress = !this.flags || false !== this.flags.compress; // event ack callback\n\n if ('function' === typeof args[args.length - 1]) {\n debug('emitting packet with ack id %d', this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n\n if (this.connected) {\n this.packet(packet);\n } else {\n this.sendBuffer.push(packet);\n }\n\n this.flags = {};\n return this;\n};\n/**\n * Sends a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\n\nSocket.prototype.packet = function (packet) {\n packet.nsp = this.nsp;\n this.io.packet(packet);\n};\n/**\n * Called upon engine `open`.\n *\n * @api private\n */\n\n\nSocket.prototype.onopen = function () {\n debug('transport is open - connecting'); // write connect packet if necessary\n\n if ('/' !== this.nsp) {\n if (this.query) {\n var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;\n debug('sending connect packet with query %s', query);\n this.packet({\n type: parser.CONNECT,\n query: query\n });\n } else {\n this.packet({\n type: parser.CONNECT\n });\n }\n }\n};\n/**\n * Called upon engine `close`.\n *\n * @param {String} reason\n * @api private\n */\n\n\nSocket.prototype.onclose = function (reason) {\n debug('close (%s)', reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emit('disconnect', reason);\n};\n/**\n * Called with socket packet.\n *\n * @param {Object} packet\n * @api private\n */\n\n\nSocket.prototype.onpacket = function (packet) {\n var sameNamespace = packet.nsp === this.nsp;\n var rootNamespaceError = packet.type === parser.ERROR && packet.nsp === '/';\n if (!sameNamespace && !rootNamespaceError) return;\n\n switch (packet.type) {\n case parser.CONNECT:\n this.onconnect();\n break;\n\n case parser.EVENT:\n this.onevent(packet);\n break;\n\n case parser.BINARY_EVENT:\n this.onevent(packet);\n break;\n\n case parser.ACK:\n this.onack(packet);\n break;\n\n case parser.BINARY_ACK:\n this.onack(packet);\n break;\n\n case parser.DISCONNECT:\n this.ondisconnect();\n break;\n\n case parser.ERROR:\n this.emit('error', packet.data);\n break;\n }\n};\n/**\n * Called upon a server event.\n *\n * @param {Object} packet\n * @api private\n */\n\n\nSocket.prototype.onevent = function (packet) {\n var args = packet.data || [];\n debug('emitting event %j', args);\n\n if (null != packet.id) {\n debug('attaching ack callback to event');\n args.push(this.ack(packet.id));\n }\n\n if (this.connected) {\n emit.apply(this, args);\n } else {\n this.receiveBuffer.push(args);\n }\n};\n/**\n * Produces an ack callback to emit with an event.\n *\n * @api private\n */\n\n\nSocket.prototype.ack = function (id) {\n var self = this;\n var sent = false;\n return function () {\n // prevent double callbacks\n if (sent) return;\n sent = true;\n var args = toArray(arguments);\n debug('sending ack %j', args);\n self.packet({\n type: hasBin(args) ? parser.BINARY_ACK : parser.ACK,\n id: id,\n data: args\n });\n };\n};\n/**\n * Called upon a server acknowlegement.\n *\n * @param {Object} packet\n * @api private\n */\n\n\nSocket.prototype.onack = function (packet) {\n var ack = this.acks[packet.id];\n\n if ('function' === typeof ack) {\n debug('calling ack %s with %j', packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n } else {\n debug('bad ack %s', packet.id);\n }\n};\n/**\n * Called upon server connect.\n *\n * @api private\n */\n\n\nSocket.prototype.onconnect = function () {\n this.connected = true;\n this.disconnected = false;\n this.emit('connect');\n this.emitBuffered();\n};\n/**\n * Emit buffered events (received and emitted).\n *\n * @api private\n */\n\n\nSocket.prototype.emitBuffered = function () {\n var i;\n\n for (i = 0; i < this.receiveBuffer.length; i++) {\n emit.apply(this, this.receiveBuffer[i]);\n }\n\n this.receiveBuffer = [];\n\n for (i = 0; i < this.sendBuffer.length; i++) {\n this.packet(this.sendBuffer[i]);\n }\n\n this.sendBuffer = [];\n};\n/**\n * Called upon server disconnect.\n *\n * @api private\n */\n\n\nSocket.prototype.ondisconnect = function () {\n debug('server disconnect (%s)', this.nsp);\n this.destroy();\n this.onclose('io server disconnect');\n};\n/**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @api private.\n */\n\n\nSocket.prototype.destroy = function () {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n for (var i = 0; i < this.subs.length; i++) {\n this.subs[i].destroy();\n }\n\n this.subs = null;\n }\n\n this.io.destroy(this);\n};\n/**\n * Disconnects the socket manually.\n *\n * @return {Socket} self\n * @api public\n */\n\n\nSocket.prototype.close = Socket.prototype.disconnect = function () {\n if (this.connected) {\n debug('performing disconnect (%s)', this.nsp);\n this.packet({\n type: parser.DISCONNECT\n });\n } // remove socket from pool\n\n\n this.destroy();\n\n if (this.connected) {\n // fire events\n this.onclose('io client disconnect');\n }\n\n return this;\n};\n/**\n * Sets the compress flag.\n *\n * @param {Boolean} if `true`, compresses the sending data\n * @return {Socket} self\n * @api public\n */\n\n\nSocket.prototype.compress = function (compress) {\n this.flags.compress = compress;\n return this;\n};\n/**\n * Sets the binary flag\n *\n * @param {Boolean} whether the emitted data contains binary\n * @return {Socket} self\n * @api public\n */\n\n\nSocket.prototype.binary = function (binary) {\n this.flags.binary = binary;\n return this;\n};","/**\n * Module exports.\n */\nmodule.exports = on;\n/**\n * Helper for subscriptions.\n *\n * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n * @param {String} event name\n * @param {Function} callback\n * @api public\n */\n\nfunction on(obj, ev, fn) {\n obj.on(ev, fn);\n return {\n destroy: function destroy() {\n obj.removeListener(ev, fn);\n }\n };\n}","/**\n * Slice reference.\n */\nvar slice = [].slice;\n/**\n * Bind `obj` to `fn`.\n *\n * @param {Object} obj\n * @param {Function|String} fn or string\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function (obj, fn) {\n if ('string' == typeof fn) fn = obj[fn];\n if ('function' != typeof fn) throw new Error('bind() requires a function');\n var args = slice.call(arguments, 2);\n return function () {\n return fn.apply(obj, args.concat(slice.call(arguments)));\n };\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport warning from 'warning';\nimport { getDisplayName } from '@material-ui/utils';\n\nfunction mergeClasses() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var baseClasses = options.baseClasses,\n newClasses = options.newClasses,\n Component = options.Component;\n\n if (!newClasses) {\n return baseClasses;\n }\n\n var nextClasses = _extends({}, baseClasses);\n\n if (process.env.NODE_ENV !== 'production' && typeof newClasses === 'string') {\n process.env.NODE_ENV !== \"production\" ? warning(false, [\"Material-UI: the value `\".concat(newClasses, \"` \") + \"provided to the classes prop of \".concat(getDisplayName(Component), \" is incorrect.\"), 'You might want to use the className prop instead.'].join('\\n')) : void 0;\n return baseClasses;\n }\n\n Object.keys(newClasses).forEach(function (key) {\n process.env.NODE_ENV !== \"production\" ? warning(baseClasses[key] || !newClasses[key], [\"Material-UI: the key `\".concat(key, \"` \") + \"provided to the classes prop is not implemented in \".concat(getDisplayName(Component), \".\"), \"You can only override one of the following: \".concat(Object.keys(baseClasses).join(','), \".\")].join('\\n')) : void 0;\n process.env.NODE_ENV !== \"production\" ? warning(!newClasses[key] || typeof newClasses[key] === 'string', [\"Material-UI: the key `\".concat(key, \"` \") + \"provided to the classes prop is not valid for \".concat(getDisplayName(Component), \".\"), \"You need to provide a non empty string instead of: \".concat(newClasses[key], \".\")].join('\\n')) : void 0;\n\n if (newClasses[key]) {\n nextClasses[key] = \"\".concat(baseClasses[key], \" \").concat(newClasses[key]);\n }\n });\n return nextClasses;\n}\n\nexport default mergeClasses;","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n RESISTANCE_COEF: 0.6,\n // This value is closed to what browsers are using internally to\n // trigger a native scroll.\n UNCERTAINTY_THRESHOLD: 3 // px\n\n};\nexports.default = _default;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport React from 'react';\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport { chainPropTypes, getDisplayName } from '@material-ui/utils';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport makeStyles from '../makeStyles';\n\nfunction omit(input, fields) {\n var output = {};\n Object.keys(input).forEach(function (prop) {\n if (fields.indexOf(prop) === -1) {\n output[prop] = input[prop];\n }\n });\n return output;\n} // styled-components's API removes the mapping between components and styles.\n// Using components as a low-level styling construct can be simpler.\n\n\nfunction styled(Component) {\n var componentCreator = function componentCreator(style) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n stylesOptions = _objectWithoutProperties(options, [\"name\"]);\n\n if (process.env.NODE_ENV !== 'production' && Component === undefined) {\n throw new Error(['You are calling styled(Component)(style) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production' && !name) {\n // Provide a better DX outside production.\n var displayName = getDisplayName(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n\n var stylesOrCreator = typeof style === 'function' ? function (theme) {\n return {\n root: function root(props) {\n return style(_extends({\n theme: theme\n }, props));\n }\n };\n } : {\n root: style\n };\n var useStyles = makeStyles(stylesOrCreator, _extends({\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var filterProps;\n var propTypes = {};\n\n if (style.filterProps) {\n filterProps = style.filterProps;\n delete style.filterProps;\n }\n /* eslint-disable react/forbid-foreign-prop-types */\n\n\n if (style.propTypes) {\n propTypes = style.propTypes;\n delete style.propTypes;\n }\n /* eslint-enable react/forbid-foreign-prop-types */\n\n\n var StyledComponent = React.forwardRef(function StyledComponent(props, ref) {\n var children = props.children,\n classNameProp = props.className,\n clone = props.clone,\n ComponentProp = props.component,\n other = _objectWithoutProperties(props, [\"children\", \"className\", \"clone\", \"component\"]);\n\n var classes = useStyles(props);\n var className = clsx(classes.root, classNameProp);\n\n if (clone) {\n return React.cloneElement(children, {\n className: clsx(children.props.className, className)\n });\n }\n\n var spread = other;\n\n if (filterProps) {\n spread = omit(spread, filterProps);\n }\n\n if (typeof children === 'function') {\n return children(_extends({\n className: className\n }, spread));\n }\n\n var FinalComponent = ComponentProp || Component;\n return React.createElement(FinalComponent, _extends({\n ref: ref,\n className: className\n }, spread), children);\n });\n process.env.NODE_ENV !== \"production\" ? StyledComponent.propTypes = _extends({\n /**\n * A render function or node.\n */\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * If `true`, the component will recycle it's children DOM element.\n * It's using `React.cloneElement` internally.\n */\n clone: chainPropTypes(PropTypes.bool, function (props) {\n if (props.clone && props.component) {\n return new Error('You can not use the clone and component prop at the same time.');\n }\n\n return null;\n }),\n\n /**\n * The component used for the root node.\n * Either a string to use a DOM element or a component.\n */\n component: PropTypes.elementType\n }, propTypes) : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n StyledComponent.displayName = \"Styled(\".concat(classNamePrefix, \")\");\n }\n\n hoistNonReactStatics(StyledComponent, Component);\n return StyledComponent;\n };\n\n return componentCreator;\n}\n\nexport default styled;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","/* -*- Mode: js; js-indent-level: 2; -*- */\n\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nvar base64VLQ = require('./base64-vlq');\n\nvar util = require('./util');\n\nvar ArraySet = require('./array-set').ArraySet;\n\nvar MappingList = require('./mapping-list').MappingList;\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\n\n\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\n\nSourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n};\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\n\n\nSourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n};\n/**\n * Set the source content for a source file.\n */\n\n\nSourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n};\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\n\n\nSourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile; // If aSourceFile is omitted, we will use the file property of the SourceMap\n\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\\'s \"file\" property. Both were omitted.');\n }\n\n sourceFile = aSourceMapConsumer.file;\n }\n\n var sourceRoot = this._sourceRoot; // Make \"sourceFile\" relative if an absolute Url is passed.\n\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n } // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n\n\n var newSources = new ArraySet();\n var newNames = new ArraySet(); // Find mappings for the \"sourceFile\"\n\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source);\n }\n\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n }, this);\n\n this._sources = newSources;\n this._names = newNames; // Copy sourcesContents of applied map.\n\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n};\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\n\n\nSourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n } else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {\n // Cases 2 and 3.\n return;\n } else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n};\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\n\n\nSourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = '';\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n } else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx; // lines are stored 0-based in SourceMap spec version 3\n\n next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n};\n\nSourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;\n }, this);\n};\n/**\n * Externalize the source map.\n */\n\n\nSourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n\n if (this._file != null) {\n map.file = this._file;\n }\n\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n};\n/**\n * Render the source map being generated to a string.\n */\n\n\nSourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n};\n\nexports.SourceMapGenerator = SourceMapGenerator;","/* -*- Mode: js; js-indent-level: 2; -*- */\n\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar base64 = require('./base64'); // A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\n\nvar VLQ_BASE_SHIFT = 5; // binary: 100000\n\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT; // binary: 011111\n\nvar VLQ_BASE_MASK = VLQ_BASE - 1; // binary: 100000\n\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\n\nfunction toVLQSigned(aValue) {\n return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;\n}\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\n\n\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative ? -shifted : shifted;\n}\n/**\n * Returns the base 64 VLQ encoded value.\n */\n\n\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\n\n\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};","/* -*- Mode: js; js-indent-level: 2; -*- */\n\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nvar util = require('./util');\n\nvar has = Object.prototype.hasOwnProperty;\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\n\nfunction ArraySet() {\n this._array = [];\n this._set = Object.create(null);\n}\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\n\n\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n\n return set;\n};\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\n\n\nArraySet.prototype.size = function ArraySet_size() {\n return Object.getOwnPropertyNames(this._set).length;\n};\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\n\n\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = util.toSetString(aStr);\n var isDuplicate = has.call(this._set, sStr);\n var idx = this._array.length;\n\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n\n if (!isDuplicate) {\n this._set[sStr] = idx;\n }\n};\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\n\n\nArraySet.prototype.has = function ArraySet_has(aStr) {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n};\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\n\n\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n var sStr = util.toSetString(aStr);\n\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\n\n\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n\n throw new Error('No element indexed by ' + aIdx);\n};\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\n\n\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;","export default function symbolObservablePonyfill(root) {\n var result;\n var Symbol = root.Symbol;\n\n if (typeof Symbol === 'function') {\n if (Symbol.observable) {\n result = Symbol.observable;\n } else {\n result = Symbol('observable');\n Symbol.observable = result;\n }\n } else {\n result = '@@observable';\n }\n\n return result;\n}\n;","!function (e) {\n var n = /iPhone/i,\n t = /iPod/i,\n r = /iPad/i,\n a = /\\bAndroid(?:.+)Mobile\\b/i,\n p = /Android/i,\n b = /\\bAndroid(?:.+)SD4930UR\\b/i,\n l = /\\bAndroid(?:.+)(?:KF[A-Z]{2,4})\\b/i,\n f = /Windows Phone/i,\n s = /\\bWindows(?:.+)ARM\\b/i,\n u = /BlackBerry/i,\n c = /BB10/i,\n h = /Opera Mini/i,\n v = /\\b(CriOS|Chrome)(?:.+)Mobile/i,\n w = /Mobile(?:.+)Firefox\\b/i;\n\n function m(e, i) {\n return e.test(i);\n }\n\n function i(e) {\n var i = e || (\"undefined\" != typeof navigator ? navigator.userAgent : \"\"),\n o = i.split(\"[FBAN\");\n void 0 !== o[1] && (i = o[0]), void 0 !== (o = i.split(\"Twitter\"))[1] && (i = o[0]);\n var d = {\n apple: {\n phone: m(n, i) && !m(f, i),\n ipod: m(t, i),\n tablet: !m(n, i) && m(r, i) && !m(f, i),\n device: (m(n, i) || m(t, i) || m(r, i)) && !m(f, i)\n },\n amazon: {\n phone: m(b, i),\n tablet: !m(b, i) && m(l, i),\n device: m(b, i) || m(l, i)\n },\n android: {\n phone: !m(f, i) && m(b, i) || !m(f, i) && m(a, i),\n tablet: !m(f, i) && !m(b, i) && !m(a, i) && (m(l, i) || m(p, i)),\n device: !m(f, i) && (m(b, i) || m(l, i) || m(a, i) || m(p, i)) || m(/\\bokhttp\\b/i, i)\n },\n windows: {\n phone: m(f, i),\n tablet: m(s, i),\n device: m(f, i) || m(s, i)\n },\n other: {\n blackberry: m(u, i),\n blackberry10: m(c, i),\n opera: m(h, i),\n firefox: m(w, i),\n chrome: m(v, i),\n device: m(u, i) || m(c, i) || m(h, i) || m(w, i) || m(v, i)\n }\n };\n return d.any = d.apple.device || d.android.device || d.windows.device || d.other.device, d.phone = d.apple.phone || d.android.phone || d.windows.phone, d.tablet = d.apple.tablet || d.android.tablet || d.windows.tablet, d;\n }\n\n \"undefined\" != typeof module && module.exports && \"undefined\" == typeof window ? module.exports = i : \"undefined\" != typeof module && module.exports && \"undefined\" != typeof window ? (module.exports = i(), module.exports.isMobile = i) : \"function\" == typeof define && define.amd ? define([], e.isMobile = i()) : e.isMobile = i();\n}(this);","var _get = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/get\");\n\nvar _regeneratorRuntime = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/regenerator\");\n\nvar _asyncToGenerator = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/asyncToGenerator\");\n\nvar _possibleConstructorReturn = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/possibleConstructorReturn\");\n\nvar _getPrototypeOf = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/getPrototypeOf\");\n\nvar _inherits = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/inherits\");\n\nvar _classCallCheck2 = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/classCallCheck\");\n\nvar _createClass = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/createClass\");\n\nvar _slicedToArray = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/slicedToArray\");\n\nvar _toConsumableArray = require(\"C:\\\\Users\\\\Admin\\\\old-risa-webclient\\\\node_modules\\\\@babel\\\\runtime/helpers/toConsumableArray\");\n\n/*!\n * SkyWay Copyright(c) 2019 NTT Communications Corporation\n * peerjs Copyright(c) 2013 Michelle Bu \n */\n(function webpackUniversalModuleDefinition(root, factory) {\n if (typeof exports === 'object' && typeof module === 'object') module.exports = factory();else if (typeof define === 'function' && define.amd) define([], factory);else if (typeof exports === 'object') exports[\"Peer\"] = factory();else root[\"Peer\"] = factory();\n})(window, function () {\n return (\n /******/\n function (modules) {\n // webpackBootstrap\n\n /******/\n // The module cache\n\n /******/\n var installedModules = {};\n /******/\n\n /******/\n // The require function\n\n /******/\n\n function __webpack_require__(moduleId) {\n /******/\n\n /******/\n // Check if module is in cache\n\n /******/\n if (installedModules[moduleId]) {\n /******/\n return installedModules[moduleId].exports;\n /******/\n }\n /******/\n // Create a new module (and put it into the cache)\n\n /******/\n\n\n var module = installedModules[moduleId] = {\n /******/\n i: moduleId,\n\n /******/\n l: false,\n\n /******/\n exports: {}\n /******/\n\n };\n /******/\n\n /******/\n // Execute the module function\n\n /******/\n\n modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n /******/\n\n /******/\n // Flag the module as loaded\n\n /******/\n\n module.l = true;\n /******/\n\n /******/\n // Return the exports of the module\n\n /******/\n\n return module.exports;\n /******/\n }\n /******/\n\n /******/\n\n /******/\n // expose the modules object (__webpack_modules__)\n\n /******/\n\n\n __webpack_require__.m = modules;\n /******/\n\n /******/\n // expose the module cache\n\n /******/\n\n __webpack_require__.c = installedModules;\n /******/\n\n /******/\n // define getter function for harmony exports\n\n /******/\n\n __webpack_require__.d = function (exports, name, getter) {\n /******/\n if (!__webpack_require__.o(exports, name)) {\n /******/\n Object.defineProperty(exports, name, {\n enumerable: true,\n get: getter\n });\n /******/\n }\n /******/\n\n };\n /******/\n\n /******/\n // define __esModule on exports\n\n /******/\n\n\n __webpack_require__.r = function (exports) {\n /******/\n if (typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n /******/\n Object.defineProperty(exports, Symbol.toStringTag, {\n value: 'Module'\n });\n /******/\n }\n /******/\n\n\n Object.defineProperty(exports, '__esModule', {\n value: true\n });\n /******/\n };\n /******/\n\n /******/\n // create a fake namespace object\n\n /******/\n // mode & 1: value is a module id, require it\n\n /******/\n // mode & 2: merge all properties of value into the ns\n\n /******/\n // mode & 4: return value when already ns object\n\n /******/\n // mode & 8|1: behave like require\n\n /******/\n\n\n __webpack_require__.t = function (value, mode) {\n /******/\n if (mode & 1) value = __webpack_require__(value);\n /******/\n\n if (mode & 8) return value;\n /******/\n\n if (mode & 4 && typeof value === 'object' && value && value.__esModule) return value;\n /******/\n\n var ns = Object.create(null);\n /******/\n\n __webpack_require__.r(ns);\n /******/\n\n\n Object.defineProperty(ns, 'default', {\n enumerable: true,\n value: value\n });\n /******/\n\n if (mode & 2 && typeof value != 'string') for (var key in value) {\n __webpack_require__.d(ns, key, function (key) {\n return value[key];\n }.bind(null, key));\n }\n /******/\n\n return ns;\n /******/\n };\n /******/\n\n /******/\n // getDefaultExport function for compatibility with non-harmony modules\n\n /******/\n\n\n __webpack_require__.n = function (module) {\n /******/\n var getter = module && module.__esModule ?\n /******/\n function getDefault() {\n return module['default'];\n } :\n /******/\n function getModuleExports() {\n return module;\n };\n /******/\n\n __webpack_require__.d(getter, 'a', getter);\n /******/\n\n\n return getter;\n /******/\n };\n /******/\n\n /******/\n // Object.prototype.hasOwnProperty.call\n\n /******/\n\n\n __webpack_require__.o = function (object, property) {\n return Object.prototype.hasOwnProperty.call(object, property);\n };\n /******/\n\n /******/\n // __webpack_public_path__\n\n /******/\n\n\n __webpack_require__.p = \"\";\n /******/\n\n /******/\n\n /******/\n // Load entry module and return exports\n\n /******/\n\n return __webpack_require__(__webpack_require__.s = \"./src/peer.js\");\n /******/\n }(\n /************************************************************************/\n\n /******/\n {\n /***/\n \"./node_modules/after/index.js\":\n /*!*************************************!*\\\n !*** ./node_modules/after/index.js ***!\n \\*************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesAfterIndexJs(module, exports) {\n module.exports = after;\n\n function after(count, callback, err_cb) {\n var bail = false;\n err_cb = err_cb || noop;\n proxy.count = count;\n return count === 0 ? callback() : proxy;\n\n function proxy(err, result) {\n if (proxy.count <= 0) {\n throw new Error('after called too many times');\n }\n\n --proxy.count; // after first error, rest are passed to err_cb\n\n if (err) {\n bail = true;\n callback(err); // future error callbacks will go to error handler\n\n callback = err_cb;\n } else if (proxy.count === 0 && !bail) {\n callback(null, result);\n }\n }\n }\n\n function noop() {}\n /***/\n\n },\n\n /***/\n \"./node_modules/arraybuffer.slice/index.js\":\n /*!*************************************************!*\\\n !*** ./node_modules/arraybuffer.slice/index.js ***!\n \\*************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesArraybufferSliceIndexJs(module, exports) {\n /**\n * An abstraction for slicing an arraybuffer even when\n * ArrayBuffer.prototype.slice is not supported\n *\n * @api public\n */\n module.exports = function (arraybuffer, start, end) {\n var bytes = arraybuffer.byteLength;\n start = start || 0;\n end = end || bytes;\n\n if (arraybuffer.slice) {\n return arraybuffer.slice(start, end);\n }\n\n if (start < 0) {\n start += bytes;\n }\n\n if (end < 0) {\n end += bytes;\n }\n\n if (end > bytes) {\n end = bytes;\n }\n\n if (start >= bytes || start >= end || bytes === 0) {\n return new ArrayBuffer(0);\n }\n\n var abv = new Uint8Array(arraybuffer);\n var result = new Uint8Array(end - start);\n\n for (var i = start, ii = 0; i < end; i++, ii++) {\n result[ii] = abv[i];\n }\n\n return result.buffer;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/backo2/index.js\":\n /*!**************************************!*\\\n !*** ./node_modules/backo2/index.js ***!\n \\**************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesBacko2IndexJs(module, exports) {\n /**\n * Expose `Backoff`.\n */\n module.exports = Backoff;\n /**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\n\n function Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n }\n /**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\n\n\n Backoff.prototype.duration = function () {\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n\n return Math.min(ms, this.max) | 0;\n };\n /**\n * Reset the number of attempts.\n *\n * @api public\n */\n\n\n Backoff.prototype.reset = function () {\n this.attempts = 0;\n };\n /**\n * Set the minimum duration\n *\n * @api public\n */\n\n\n Backoff.prototype.setMin = function (min) {\n this.ms = min;\n };\n /**\n * Set the maximum duration\n *\n * @api public\n */\n\n\n Backoff.prototype.setMax = function (max) {\n this.max = max;\n };\n /**\n * Set the jitter\n *\n * @api public\n */\n\n\n Backoff.prototype.setJitter = function (jitter) {\n this.jitter = jitter;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js\":\n /*!*******************************************************************!*\\\n !*** ./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js ***!\n \\*******************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesBase64ArraybufferLibBase64ArraybufferJs(module, exports) {\n /*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n (function () {\n \"use strict\";\n\n var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"; // Use a lookup table to find the index.\n\n var lookup = new Uint8Array(256);\n\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n\n exports.encode = function (arraybuffer) {\n var bytes = new Uint8Array(arraybuffer),\n i,\n len = bytes.length,\n base64 = \"\";\n\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64 += chars[bytes[i + 2] & 63];\n }\n\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + \"=\";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + \"==\";\n }\n\n return base64;\n };\n\n exports.decode = function (base64) {\n var bufferLength = base64.length * 0.75,\n len = base64.length,\n i,\n p = 0,\n encoded1,\n encoded2,\n encoded3,\n encoded4;\n\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n\n var arraybuffer = new ArrayBuffer(bufferLength),\n bytes = new Uint8Array(arraybuffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n\n return arraybuffer;\n };\n })();\n /***/\n\n },\n\n /***/\n \"./node_modules/base64-js/index.js\":\n /*!*****************************************!*\\\n !*** ./node_modules/base64-js/index.js ***!\n \\*****************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesBase64JsIndexJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n exports.byteLength = byteLength;\n exports.toByteArray = toByteArray;\n exports.fromByteArray = fromByteArray;\n var lookup = [];\n var revLookup = [];\n var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;\n var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i];\n revLookup[code.charCodeAt(i)] = i;\n }\n\n revLookup['-'.charCodeAt(0)] = 62;\n revLookup['_'.charCodeAt(0)] = 63;\n\n function placeHoldersCount(b64) {\n var len = b64.length;\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4');\n } // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n\n\n return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;\n }\n\n function byteLength(b64) {\n // base64 is 4/3 + up to two characters of the original data\n return b64.length * 3 / 4 - placeHoldersCount(b64);\n }\n\n function toByteArray(b64) {\n var i, l, tmp, placeHolders, arr;\n var len = b64.length;\n placeHolders = placeHoldersCount(b64);\n arr = new Arr(len * 3 / 4 - placeHolders); // if there are placeholders, only get up to the last complete 4 chars\n\n l = placeHolders > 0 ? len - 4 : len;\n var L = 0;\n\n for (i = 0; i < l; i += 4) {\n tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];\n arr[L++] = tmp >> 16 & 0xFF;\n arr[L++] = tmp >> 8 & 0xFF;\n arr[L++] = tmp & 0xFF;\n }\n\n if (placeHolders === 2) {\n tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;\n arr[L++] = tmp & 0xFF;\n } else if (placeHolders === 1) {\n tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;\n arr[L++] = tmp >> 8 & 0xFF;\n arr[L++] = tmp & 0xFF;\n }\n\n return arr;\n }\n\n function tripletToBase64(num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];\n }\n\n function encodeChunk(uint8, start, end) {\n var tmp;\n var output = [];\n\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];\n output.push(tripletToBase64(tmp));\n }\n\n return output.join('');\n }\n\n function fromByteArray(uint8) {\n var tmp;\n var len = uint8.length;\n var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes\n\n var output = '';\n var parts = [];\n var maxChunkLength = 16383; // must be multiple of 3\n // go through the array every three bytes, we'll deal with trailing stuff later\n\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));\n } // pad the end with zeros, but make sure to not forget the extra bytes\n\n\n if (extraBytes === 1) {\n tmp = uint8[len - 1];\n output += lookup[tmp >> 2];\n output += lookup[tmp << 4 & 0x3F];\n output += '==';\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1];\n output += lookup[tmp >> 10];\n output += lookup[tmp >> 4 & 0x3F];\n output += lookup[tmp << 2 & 0x3F];\n output += '=';\n }\n\n parts.push(output);\n return parts.join('');\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/blob/index.js\":\n /*!************************************!*\\\n !*** ./node_modules/blob/index.js ***!\n \\************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesBlobIndexJs(module, exports, __webpack_require__) {\n /* WEBPACK VAR INJECTION */\n (function (global) {\n /**\n * Create a blob builder even when vendor prefixes exist\n */\n var BlobBuilder = global.BlobBuilder || global.WebKitBlobBuilder || global.MSBlobBuilder || global.MozBlobBuilder;\n /**\n * Check if Blob constructor is supported\n */\n\n var blobSupported = function () {\n try {\n var a = new Blob(['hi']);\n return a.size === 2;\n } catch (e) {\n return false;\n }\n }();\n /**\n * Check if Blob constructor supports ArrayBufferViews\n * Fails in Safari 6, so we need to map to ArrayBuffers there.\n */\n\n\n var blobSupportsArrayBufferView = blobSupported && function () {\n try {\n var b = new Blob([new Uint8Array([1, 2])]);\n return b.size === 2;\n } catch (e) {\n return false;\n }\n }();\n /**\n * Check if BlobBuilder is supported\n */\n\n\n var blobBuilderSupported = BlobBuilder && BlobBuilder.prototype.append && BlobBuilder.prototype.getBlob;\n /**\n * Helper function that maps ArrayBufferViews to ArrayBuffers\n * Used by BlobBuilder constructor and old browsers that didn't\n * support it in the Blob constructor.\n */\n\n function mapArrayBufferViews(ary) {\n for (var i = 0; i < ary.length; i++) {\n var chunk = ary[i];\n\n if (chunk.buffer instanceof ArrayBuffer) {\n var buf = chunk.buffer; // if this is a subarray, make a copy so we only\n // include the subarray region from the underlying buffer\n\n if (chunk.byteLength !== buf.byteLength) {\n var copy = new Uint8Array(chunk.byteLength);\n copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n buf = copy.buffer;\n }\n\n ary[i] = buf;\n }\n }\n }\n\n function BlobBuilderConstructor(ary, options) {\n options = options || {};\n var bb = new BlobBuilder();\n mapArrayBufferViews(ary);\n\n for (var i = 0; i < ary.length; i++) {\n bb.append(ary[i]);\n }\n\n return options.type ? bb.getBlob(options.type) : bb.getBlob();\n }\n\n ;\n\n function BlobConstructor(ary, options) {\n mapArrayBufferViews(ary);\n return new Blob(ary, options || {});\n }\n\n ;\n\n module.exports = function () {\n if (blobSupported) {\n return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n } else if (blobBuilderSupported) {\n return BlobBuilderConstructor;\n } else {\n return undefined;\n }\n }();\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../webpack/buildin/global.js */\n \"./node_modules/webpack/buildin/global.js\"));\n /***/\n },\n\n /***/\n \"./node_modules/component-bind/index.js\":\n /*!**********************************************!*\\\n !*** ./node_modules/component-bind/index.js ***!\n \\**********************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesComponentBindIndexJs(module, exports) {\n /**\n * Slice reference.\n */\n var slice = [].slice;\n /**\n * Bind `obj` to `fn`.\n *\n * @param {Object} obj\n * @param {Function|String} fn or string\n * @return {Function}\n * @api public\n */\n\n module.exports = function (obj, fn) {\n if ('string' == typeof fn) fn = obj[fn];\n if ('function' != typeof fn) throw new Error('bind() requires a function');\n var args = slice.call(arguments, 2);\n return function () {\n return fn.apply(obj, args.concat(slice.call(arguments)));\n };\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/component-emitter/index.js\":\n /*!*************************************************!*\\\n !*** ./node_modules/component-emitter/index.js ***!\n \\*************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesComponentEmitterIndexJs(module, exports, __webpack_require__) {\n /**\r\n * Expose `Emitter`.\r\n */\n if (true) {\n module.exports = Emitter;\n }\n /**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\n\n\n function Emitter(obj) {\n if (obj) return mixin(obj);\n }\n\n ;\n /**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\n\n function mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n\n return obj;\n }\n /**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\n\n\n Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) {\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn);\n return this;\n };\n /**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\n\n\n Emitter.prototype.once = function (event, fn) {\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n };\n /**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\n\n\n Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) {\n this._callbacks = this._callbacks || {}; // all\n\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n } // specific event\n\n\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this; // remove all handlers\n\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n } // remove specific handler\n\n\n var cb;\n\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n return this;\n };\n /**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\n\n\n Emitter.prototype.emit = function (event) {\n this._callbacks = this._callbacks || {};\n var args = [].slice.call(arguments, 1),\n callbacks = this._callbacks['$' + event];\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n };\n /**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\n\n\n Emitter.prototype.listeners = function (event) {\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n };\n /**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\n\n\n Emitter.prototype.hasListeners = function (event) {\n return !!this.listeners(event).length;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/component-inherit/index.js\":\n /*!*************************************************!*\\\n !*** ./node_modules/component-inherit/index.js ***!\n \\*************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesComponentInheritIndexJs(module, exports) {\n module.exports = function (a, b) {\n var fn = function fn() {};\n\n fn.prototype = b.prototype;\n a.prototype = new fn();\n a.prototype.constructor = a;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/decode-uri-component/index.js\":\n /*!****************************************************!*\\\n !*** ./node_modules/decode-uri-component/index.js ***!\n \\****************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesDecodeUriComponentIndexJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n var token = '%[a-f0-9]{2}';\n var singleMatcher = new RegExp(token, 'gi');\n var multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\n function decodeComponents(components, split) {\n try {\n // Try to decode the entire string first\n return decodeURIComponent(components.join(''));\n } catch (err) {// Do nothing\n }\n\n if (components.length === 1) {\n return components;\n }\n\n split = split || 1; // Split the array in 2 parts\n\n var left = components.slice(0, split);\n var right = components.slice(split);\n return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n }\n\n function decode(input) {\n try {\n return decodeURIComponent(input);\n } catch (err) {\n var tokens = input.match(singleMatcher);\n\n for (var i = 1; i < tokens.length; i++) {\n input = decodeComponents(tokens, i).join('');\n tokens = input.match(singleMatcher);\n }\n\n return input;\n }\n }\n\n function customDecodeURIComponent(input) {\n // Keep track of all the replacements and prefill the map with the `BOM`\n var replaceMap = {\n '%FE%FF': \"\\uFFFD\\uFFFD\",\n '%FF%FE': \"\\uFFFD\\uFFFD\"\n };\n var match = multiMatcher.exec(input);\n\n while (match) {\n try {\n // Decode as big chunks as possible\n replaceMap[match[0]] = decodeURIComponent(match[0]);\n } catch (err) {\n var result = decode(match[0]);\n\n if (result !== match[0]) {\n replaceMap[match[0]] = result;\n }\n }\n\n match = multiMatcher.exec(input);\n } // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\n\n replaceMap['%C2'] = \"\\uFFFD\";\n var entries = Object.keys(replaceMap);\n\n for (var i = 0; i < entries.length; i++) {\n // Replace all decoded components\n var key = entries[i];\n input = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n }\n\n return input;\n }\n\n module.exports = function (encodedURI) {\n if (typeof encodedURI !== 'string') {\n throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n }\n\n try {\n encodedURI = encodedURI.replace(/\\+/g, ' '); // Try the built in decoder first\n\n return decodeURIComponent(encodedURI);\n } catch (err) {\n // Fallback to a more advanced decoder\n return customDecodeURIComponent(encodedURI);\n }\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/detect-browser/index.js\":\n /*!**********************************************!*\\\n !*** ./node_modules/detect-browser/index.js ***!\n \\**********************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesDetectBrowserIndexJs(module, exports, __webpack_require__) {\n \"use strict\";\n /* WEBPACK VAR INJECTION */\n\n (function (process) {\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n\n var BrowserInfo =\n /** @class */\n function () {\n function BrowserInfo(name, version, os) {\n this.name = name;\n this.version = version;\n this.os = os;\n }\n\n return BrowserInfo;\n }();\n\n exports.BrowserInfo = BrowserInfo;\n\n var NodeInfo =\n /** @class */\n function () {\n function NodeInfo(version) {\n this.version = version;\n this.name = 'node';\n this.os = process.platform;\n }\n\n return NodeInfo;\n }();\n\n exports.NodeInfo = NodeInfo;\n\n var BotInfo =\n /** @class */\n function () {\n function BotInfo() {\n this.bot = true; // NOTE: deprecated test name instead\n\n this.name = 'bot';\n this.version = null;\n this.os = null;\n }\n\n return BotInfo;\n }();\n\n exports.BotInfo = BotInfo; // tslint:disable-next-line:max-line-length\n\n var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;\n var SEARCHBOT_OS_REGEX = /(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves\\/Teoma)|(ia_archiver)/;\n var REQUIRED_VERSION_PARTS = 3;\n var userAgentRules = [['aol', /AOLShield\\/([0-9\\._]+)/], ['edge', /Edge\\/([0-9\\._]+)/], ['yandexbrowser', /YaBrowser\\/([0-9\\._]+)/], ['vivaldi', /Vivaldi\\/([0-9\\.]+)/], ['kakaotalk', /KAKAOTALK\\s([0-9\\.]+)/], ['samsung', /SamsungBrowser\\/([0-9\\.]+)/], ['silk', /\\bSilk\\/([0-9._-]+)\\b/], ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/], ['phantomjs', /PhantomJS\\/([0-9\\.]+)(:?\\s|$)/], ['crios', /CriOS\\/([0-9\\.]+)(:?\\s|$)/], ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/], ['fxios', /FxiOS\\/([0-9\\.]+)/], ['opera-mini', /Opera Mini.*Version\\/([0-9\\.]+)/], ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/], ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)$/], ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/], ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/], ['ie', /MSIE\\s(7\\.0)/], ['bb10', /BB10;\\sTouch.*Version\\/([0-9\\.]+)/], ['android', /Android\\s([0-9\\.]+)/], ['ios', /Version\\/([0-9\\._]+).*Mobile.*Safari.*/], ['safari', /Version\\/([0-9\\._]+).*Safari/], ['facebook', /FBAV\\/([0-9\\.]+)/], ['instagram', /Instagram\\s([0-9\\.]+)/], ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Mobile/], ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Gecko\\)$/], ['searchbot', SEARCHBOX_UA_REGEX]];\n var operatingSystemRules = [['iOS', /iP(hone|od|ad)/], ['Android OS', /Android/], ['BlackBerry OS', /BlackBerry|BB10/], ['Windows Mobile', /IEMobile/], ['Amazon OS', /Kindle/], ['Windows 3.11', /Win16/], ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/], ['Windows 98', /(Windows 98)|(Win98)/], ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/], ['Windows XP', /(Windows NT 5.1)|(Windows XP)/], ['Windows Server 2003', /(Windows NT 5.2)/], ['Windows Vista', /(Windows NT 6.0)/], ['Windows 7', /(Windows NT 6.1)/], ['Windows 8', /(Windows NT 6.2)/], ['Windows 8.1', /(Windows NT 6.3)/], ['Windows 10', /(Windows NT 10.0)/], ['Windows ME', /Windows ME/], ['Open BSD', /OpenBSD/], ['Sun OS', /SunOS/], ['Chrome OS', /CrOS/], ['Linux', /(Linux)|(X11)/], ['Mac OS', /(Mac_PowerPC)|(Macintosh)/], ['QNX', /QNX/], ['BeOS', /BeOS/], ['OS/2', /OS\\/2/], ['Search Bot', SEARCHBOT_OS_REGEX]];\n\n function detect() {\n if (typeof navigator !== 'undefined') {\n return parseUserAgent(navigator.userAgent);\n }\n\n return getNodeVersion();\n }\n\n exports.detect = detect;\n\n function parseUserAgent(ua) {\n // opted for using reduce here rather than Array#first with a regex.test call\n // this is primarily because using the reduce we only perform the regex\n // execution once rather than once for the test and for the exec again below\n // probably something that needs to be benchmarked though\n var matchedRule = ua !== '' && userAgentRules.reduce(function (matched, _a) {\n var browser = _a[0],\n regex = _a[1];\n\n if (matched) {\n return matched;\n }\n\n var uaMatch = regex.exec(ua);\n return !!uaMatch && [browser, uaMatch];\n }, false);\n\n if (!matchedRule) {\n return null;\n }\n\n var name = matchedRule[0],\n match = matchedRule[1];\n\n if (name === 'searchbot') {\n return new BotInfo();\n }\n\n var versionParts = match[1] && match[1].split(/[._]/).slice(0, 3);\n\n if (versionParts) {\n if (versionParts.length < REQUIRED_VERSION_PARTS) {\n versionParts = versionParts.concat(createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length));\n }\n } else {\n versionParts = [];\n }\n\n return new BrowserInfo(name, versionParts.join('.'), detectOS(ua));\n }\n\n exports.parseUserAgent = parseUserAgent;\n\n function detectOS(ua) {\n for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {\n var _a = operatingSystemRules[ii],\n os = _a[0],\n regex = _a[1];\n var match = regex.test(ua);\n\n if (match) {\n return os;\n }\n }\n\n return null;\n }\n\n exports.detectOS = detectOS;\n\n function getNodeVersion() {\n var isNode = typeof process !== 'undefined' && process.version;\n return isNode ? new NodeInfo(process.version.slice(1)) : null;\n }\n\n exports.getNodeVersion = getNodeVersion;\n\n function createVersionParts(count) {\n var output = [];\n\n for (var ii = 0; ii < count; ii++) {\n output.push('0');\n }\n\n return output;\n }\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../process/browser.js */\n \"./node_modules/process/browser.js\"));\n /***/\n },\n\n /***/\n \"./node_modules/engine.io-parser/lib/browser.js\":\n /*!******************************************************!*\\\n !*** ./node_modules/engine.io-parser/lib/browser.js ***!\n \\******************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesEngineIoParserLibBrowserJs(module, exports, __webpack_require__) {\n /* WEBPACK VAR INJECTION */\n (function (global) {\n /**\n * Module dependencies.\n */\n var keys = __webpack_require__(\n /*! ./keys */\n \"./node_modules/engine.io-parser/lib/keys.js\");\n\n var hasBinary = __webpack_require__(\n /*! has-binary2 */\n \"./node_modules/has-binary2/index.js\");\n\n var sliceBuffer = __webpack_require__(\n /*! arraybuffer.slice */\n \"./node_modules/arraybuffer.slice/index.js\");\n\n var after = __webpack_require__(\n /*! after */\n \"./node_modules/after/index.js\");\n\n var utf8 = __webpack_require__(\n /*! ./utf8 */\n \"./node_modules/engine.io-parser/lib/utf8.js\");\n\n var base64encoder;\n\n if (global && global.ArrayBuffer) {\n base64encoder = __webpack_require__(\n /*! base64-arraybuffer */\n \"./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js\");\n }\n /**\n * Check if we are running an android browser. That requires us to use\n * ArrayBuffer with polling transports...\n *\n * http://ghinda.net/jpeg-blob-ajax-android/\n */\n\n\n var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n /**\n * Check if we are running in PhantomJS.\n * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n * https://github.com/ariya/phantomjs/issues/11395\n * @type boolean\n */\n\n var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);\n /**\n * When true, avoids using Blobs to encode payloads.\n * @type boolean\n */\n\n var dontSendBlobs = isAndroid || isPhantomJS;\n /**\n * Current protocol version.\n */\n\n exports.protocol = 3;\n /**\n * Packet types.\n */\n\n var packets = exports.packets = {\n open: 0 // non-ws\n ,\n close: 1 // non-ws\n ,\n ping: 2,\n pong: 3,\n message: 4,\n upgrade: 5,\n noop: 6\n };\n var packetslist = keys(packets);\n /**\n * Premade error packet.\n */\n\n var err = {\n type: 'error',\n data: 'parser error'\n };\n /**\n * Create a blob api even for blob builder when vendor prefixes exist\n */\n\n var Blob = __webpack_require__(\n /*! blob */\n \"./node_modules/blob/index.js\");\n /**\n * Encodes a packet.\n *\n * [ ]\n *\n * Example:\n *\n * 5hello world\n * 3\n * 4\n *\n * Binary is encoded in an identical principle\n *\n * @api private\n */\n\n\n exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n if (typeof supportsBinary === 'function') {\n callback = supportsBinary;\n supportsBinary = false;\n }\n\n if (typeof utf8encode === 'function') {\n callback = utf8encode;\n utf8encode = null;\n }\n\n var data = packet.data === undefined ? undefined : packet.data.buffer || packet.data;\n\n if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n return encodeArrayBuffer(packet, supportsBinary, callback);\n } else if (Blob && data instanceof global.Blob) {\n return encodeBlob(packet, supportsBinary, callback);\n } // might be an object with { base64: true, data: dataAsBase64String }\n\n\n if (data && data.base64) {\n return encodeBase64Object(packet, callback);\n } // Sending data as a utf-8 string\n\n\n var encoded = packets[packet.type]; // data fragment is optional\n\n if (undefined !== packet.data) {\n encoded += utf8encode ? utf8.encode(String(packet.data), {\n strict: false\n }) : String(packet.data);\n }\n\n return callback('' + encoded);\n };\n\n function encodeBase64Object(packet, callback) {\n // packet data is an object { base64: true, data: dataAsBase64String }\n var message = 'b' + exports.packets[packet.type] + packet.data.data;\n return callback(message);\n }\n /**\n * Encode packet helpers for binary types\n */\n\n\n function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n resultBuffer[0] = packets[packet.type];\n\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i + 1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n }\n\n function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var fr = new FileReader();\n\n fr.onload = function () {\n packet.data = fr.result;\n exports.encodePacket(packet, supportsBinary, true, callback);\n };\n\n return fr.readAsArrayBuffer(packet.data);\n }\n\n function encodeBlob(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n if (dontSendBlobs) {\n return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n }\n\n var length = new Uint8Array(1);\n length[0] = packets[packet.type];\n var blob = new Blob([length.buffer, packet.data]);\n return callback(blob);\n }\n /**\n * Encodes a packet with binary data in a base64 string\n *\n * @param {Object} packet, has `type` and `data`\n * @return {String} base64 encoded message\n */\n\n\n exports.encodeBase64Packet = function (packet, callback) {\n var message = 'b' + exports.packets[packet.type];\n\n if (Blob && packet.data instanceof global.Blob) {\n var fr = new FileReader();\n\n fr.onload = function () {\n var b64 = fr.result.split(',')[1];\n callback(message + b64);\n };\n\n return fr.readAsDataURL(packet.data);\n }\n\n var b64data;\n\n try {\n b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n } catch (e) {\n // iPhone Safari doesn't let you apply with typed arrays\n var typed = new Uint8Array(packet.data);\n var basic = new Array(typed.length);\n\n for (var i = 0; i < typed.length; i++) {\n basic[i] = typed[i];\n }\n\n b64data = String.fromCharCode.apply(null, basic);\n }\n\n message += global.btoa(b64data);\n return callback(message);\n };\n /**\n * Decodes a packet. Changes format to Blob if requested.\n *\n * @return {Object} with `type` and `data` (if any)\n * @api private\n */\n\n\n exports.decodePacket = function (data, binaryType, utf8decode) {\n if (data === undefined) {\n return err;\n } // String data\n\n\n if (typeof data === 'string') {\n if (data.charAt(0) === 'b') {\n return exports.decodeBase64Packet(data.substr(1), binaryType);\n }\n\n if (utf8decode) {\n data = tryDecode(data);\n\n if (data === false) {\n return err;\n }\n }\n\n var type = data.charAt(0);\n\n if (Number(type) != type || !packetslist[type]) {\n return err;\n }\n\n if (data.length > 1) {\n return {\n type: packetslist[type],\n data: data.substring(1)\n };\n } else {\n return {\n type: packetslist[type]\n };\n }\n }\n\n var asArray = new Uint8Array(data);\n var type = asArray[0];\n var rest = sliceBuffer(data, 1);\n\n if (Blob && binaryType === 'blob') {\n rest = new Blob([rest]);\n }\n\n return {\n type: packetslist[type],\n data: rest\n };\n };\n\n function tryDecode(data) {\n try {\n data = utf8.decode(data, {\n strict: false\n });\n } catch (e) {\n return false;\n }\n\n return data;\n }\n /**\n * Decodes a packet encoded in a base64 string\n *\n * @param {String} base64 encoded message\n * @return {Object} with `type` and `data` (if any)\n */\n\n\n exports.decodeBase64Packet = function (msg, binaryType) {\n var type = packetslist[msg.charAt(0)];\n\n if (!base64encoder) {\n return {\n type: type,\n data: {\n base64: true,\n data: msg.substr(1)\n }\n };\n }\n\n var data = base64encoder.decode(msg.substr(1));\n\n if (binaryType === 'blob' && Blob) {\n data = new Blob([data]);\n }\n\n return {\n type: type,\n data: data\n };\n };\n /**\n * Encodes multiple messages (payload).\n *\n * :data\n *\n * Example:\n *\n * 11:hello world2:hi\n *\n * If any contents are binary, they will be encoded as base64 strings. Base64\n * encoded strings are marked with a b before the length specifier\n *\n * @param {Array} packets\n * @api private\n */\n\n\n exports.encodePayload = function (packets, supportsBinary, callback) {\n if (typeof supportsBinary === 'function') {\n callback = supportsBinary;\n supportsBinary = null;\n }\n\n var isBinary = hasBinary(packets);\n\n if (supportsBinary && isBinary) {\n if (Blob && !dontSendBlobs) {\n return exports.encodePayloadAsBlob(packets, callback);\n }\n\n return exports.encodePayloadAsArrayBuffer(packets, callback);\n }\n\n if (!packets.length) {\n return callback('0:');\n }\n\n function setLengthHeader(message) {\n return message.length + ':' + message;\n }\n\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function (message) {\n doneCallback(null, setLengthHeader(message));\n });\n }\n\n map(packets, encodeOne, function (err, results) {\n return callback(results.join(''));\n });\n };\n /**\n * Async array map using after\n */\n\n\n function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function eachWithIndex(i, el, cb) {\n each(el, function (error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n }\n /*\n * Decodes data when a payload is maybe expected. Possible binary contents are\n * decoded from their base64 representation\n *\n * @param {String} data, callback method\n * @api public\n */\n\n\n exports.decodePayload = function (data, binaryType, callback) {\n if (typeof data !== 'string') {\n return exports.decodePayloadAsBinary(data, binaryType, callback);\n }\n\n if (typeof binaryType === 'function') {\n callback = binaryType;\n binaryType = null;\n }\n\n var packet;\n\n if (data === '') {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n var length = '',\n n,\n msg;\n\n for (var i = 0, l = data.length; i < l; i++) {\n var chr = data.charAt(i);\n\n if (chr !== ':') {\n length += chr;\n continue;\n }\n\n if (length === '' || length != (n = Number(length))) {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n msg = data.substr(i + 1, n);\n\n if (length != msg.length) {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n\n if (msg.length) {\n packet = exports.decodePacket(msg, binaryType, false);\n\n if (err.type === packet.type && err.data === packet.data) {\n // parser error in individual packet - ignoring payload\n return callback(err, 0, 1);\n }\n\n var ret = callback(packet, i + n, l);\n if (false === ret) return;\n } // advance cursor\n\n\n i += n;\n length = '';\n }\n\n if (length !== '') {\n // parser error - ignoring payload\n return callback(err, 0, 1);\n }\n };\n /**\n * Encodes multiple messages (payload) as binary.\n *\n * <1 = binary, 0 = string>[...]\n *\n * Example:\n * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n *\n * @param {Array} packets\n * @return {ArrayBuffer} encoded payload\n * @api private\n */\n\n\n exports.encodePayloadAsArrayBuffer = function (packets, callback) {\n if (!packets.length) {\n return callback(new ArrayBuffer(0));\n }\n\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, true, true, function (data) {\n return doneCallback(null, data);\n });\n }\n\n map(packets, encodeOne, function (err, encodedPackets) {\n var totalLength = encodedPackets.reduce(function (acc, p) {\n var len;\n\n if (typeof p === 'string') {\n len = p.length;\n } else {\n len = p.byteLength;\n }\n\n return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n }, 0);\n var resultArray = new Uint8Array(totalLength);\n var bufferIndex = 0;\n encodedPackets.forEach(function (p) {\n var isString = typeof p === 'string';\n var ab = p;\n\n if (isString) {\n var view = new Uint8Array(p.length);\n\n for (var i = 0; i < p.length; i++) {\n view[i] = p.charCodeAt(i);\n }\n\n ab = view.buffer;\n }\n\n if (isString) {\n // not true binary\n resultArray[bufferIndex++] = 0;\n } else {\n // true binary\n resultArray[bufferIndex++] = 1;\n }\n\n var lenStr = ab.byteLength.toString();\n\n for (var i = 0; i < lenStr.length; i++) {\n resultArray[bufferIndex++] = parseInt(lenStr[i]);\n }\n\n resultArray[bufferIndex++] = 255;\n var view = new Uint8Array(ab);\n\n for (var i = 0; i < view.length; i++) {\n resultArray[bufferIndex++] = view[i];\n }\n });\n return callback(resultArray.buffer);\n });\n };\n /**\n * Encode as Blob\n */\n\n\n exports.encodePayloadAsBlob = function (packets, callback) {\n function encodeOne(packet, doneCallback) {\n exports.encodePacket(packet, true, true, function (encoded) {\n var binaryIdentifier = new Uint8Array(1);\n binaryIdentifier[0] = 1;\n\n if (typeof encoded === 'string') {\n var view = new Uint8Array(encoded.length);\n\n for (var i = 0; i < encoded.length; i++) {\n view[i] = encoded.charCodeAt(i);\n }\n\n encoded = view.buffer;\n binaryIdentifier[0] = 0;\n }\n\n var len = encoded instanceof ArrayBuffer ? encoded.byteLength : encoded.size;\n var lenStr = len.toString();\n var lengthAry = new Uint8Array(lenStr.length + 1);\n\n for (var i = 0; i < lenStr.length; i++) {\n lengthAry[i] = parseInt(lenStr[i]);\n }\n\n lengthAry[lenStr.length] = 255;\n\n if (Blob) {\n var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n doneCallback(null, blob);\n }\n });\n }\n\n map(packets, encodeOne, function (err, results) {\n return callback(new Blob(results));\n });\n };\n /*\n * Decodes data when a payload is maybe expected. Strings are decoded by\n * interpreting each byte as a key code for entries marked to start with 0. See\n * description of encodePayloadAsBinary\n *\n * @param {ArrayBuffer} data, callback method\n * @api public\n */\n\n\n exports.decodePayloadAsBinary = function (data, binaryType, callback) {\n if (typeof binaryType === 'function') {\n callback = binaryType;\n binaryType = null;\n }\n\n var bufferTail = data;\n var buffers = [];\n\n while (bufferTail.byteLength > 0) {\n var tailArray = new Uint8Array(bufferTail);\n var isString = tailArray[0] === 0;\n var msgLength = '';\n\n for (var i = 1;; i++) {\n if (tailArray[i] === 255) break; // 310 = char length of Number.MAX_VALUE\n\n if (msgLength.length > 310) {\n return callback(err, 0, 1);\n }\n\n msgLength += tailArray[i];\n }\n\n bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n msgLength = parseInt(msgLength);\n var msg = sliceBuffer(bufferTail, 0, msgLength);\n\n if (isString) {\n try {\n msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n } catch (e) {\n // iPhone Safari doesn't let you apply to typed arrays\n var typed = new Uint8Array(msg);\n msg = '';\n\n for (var i = 0; i < typed.length; i++) {\n msg += String.fromCharCode(typed[i]);\n }\n }\n }\n\n buffers.push(msg);\n bufferTail = sliceBuffer(bufferTail, msgLength);\n }\n\n var total = buffers.length;\n buffers.forEach(function (buffer, i) {\n callback(exports.decodePacket(buffer, binaryType, true), i, total);\n });\n };\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../../webpack/buildin/global.js */\n \"./node_modules/webpack/buildin/global.js\"));\n /***/\n },\n\n /***/\n \"./node_modules/engine.io-parser/lib/keys.js\":\n /*!***************************************************!*\\\n !*** ./node_modules/engine.io-parser/lib/keys.js ***!\n \\***************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesEngineIoParserLibKeysJs(module, exports) {\n /**\n * Gets the keys for an object.\n *\n * @return {Array} keys\n * @api private\n */\n module.exports = Object.keys || function keys(obj) {\n var arr = [];\n var has = Object.prototype.hasOwnProperty;\n\n for (var i in obj) {\n if (has.call(obj, i)) {\n arr.push(i);\n }\n }\n\n return arr;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/engine.io-parser/lib/utf8.js\":\n /*!***************************************************!*\\\n !*** ./node_modules/engine.io-parser/lib/utf8.js ***!\n \\***************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesEngineIoParserLibUtf8Js(module, exports, __webpack_require__) {\n /* WEBPACK VAR INJECTION */\n (function (module, global) {\n var __WEBPACK_AMD_DEFINE_RESULT__;\n /*! https://mths.be/utf8js v2.1.2 by @mathias */\n\n\n ;\n\n (function (root) {\n // Detect free variables `exports`\n var freeExports = typeof exports == 'object' && exports; // Detect free variable `module`\n\n var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js or Browserified code,\n // and use it as `root`\n\n var freeGlobal = typeof global == 'object' && global;\n\n if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n root = freeGlobal;\n }\n /*--------------------------------------------------------------------------*/\n\n\n var stringFromCharCode = String.fromCharCode; // Taken from https://mths.be/punycode\n\n function ucs2decode(string) {\n var output = [];\n var counter = 0;\n var length = string.length;\n var value;\n var extra;\n\n while (counter < length) {\n value = string.charCodeAt(counter++);\n\n if (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n // high surrogate, and there is a next character\n extra = string.charCodeAt(counter++);\n\n if ((extra & 0xFC00) == 0xDC00) {\n // low surrogate\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // unmatched surrogate; only append this code unit, in case the next\n // code unit is the high surrogate of a surrogate pair\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n\n return output;\n } // Taken from https://mths.be/punycode\n\n\n function ucs2encode(array) {\n var length = array.length;\n var index = -1;\n var value;\n var output = '';\n\n while (++index < length) {\n value = array[index];\n\n if (value > 0xFFFF) {\n value -= 0x10000;\n output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n value = 0xDC00 | value & 0x3FF;\n }\n\n output += stringFromCharCode(value);\n }\n\n return output;\n }\n\n function checkScalarValue(codePoint, strict) {\n if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n if (strict) {\n throw Error('Lone surrogate U+' + codePoint.toString(16).toUpperCase() + ' is not a scalar value');\n }\n\n return false;\n }\n\n return true;\n }\n /*--------------------------------------------------------------------------*/\n\n\n function createByte(codePoint, shift) {\n return stringFromCharCode(codePoint >> shift & 0x3F | 0x80);\n }\n\n function encodeCodePoint(codePoint, strict) {\n if ((codePoint & 0xFFFFFF80) == 0) {\n // 1-byte sequence\n return stringFromCharCode(codePoint);\n }\n\n var symbol = '';\n\n if ((codePoint & 0xFFFFF800) == 0) {\n // 2-byte sequence\n symbol = stringFromCharCode(codePoint >> 6 & 0x1F | 0xC0);\n } else if ((codePoint & 0xFFFF0000) == 0) {\n // 3-byte sequence\n if (!checkScalarValue(codePoint, strict)) {\n codePoint = 0xFFFD;\n }\n\n symbol = stringFromCharCode(codePoint >> 12 & 0x0F | 0xE0);\n symbol += createByte(codePoint, 6);\n } else if ((codePoint & 0xFFE00000) == 0) {\n // 4-byte sequence\n symbol = stringFromCharCode(codePoint >> 18 & 0x07 | 0xF0);\n symbol += createByte(codePoint, 12);\n symbol += createByte(codePoint, 6);\n }\n\n symbol += stringFromCharCode(codePoint & 0x3F | 0x80);\n return symbol;\n }\n\n function utf8encode(string, opts) {\n opts = opts || {};\n var strict = false !== opts.strict;\n var codePoints = ucs2decode(string);\n var length = codePoints.length;\n var index = -1;\n var codePoint;\n var byteString = '';\n\n while (++index < length) {\n codePoint = codePoints[index];\n byteString += encodeCodePoint(codePoint, strict);\n }\n\n return byteString;\n }\n /*--------------------------------------------------------------------------*/\n\n\n function readContinuationByte() {\n if (byteIndex >= byteCount) {\n throw Error('Invalid byte index');\n }\n\n var continuationByte = byteArray[byteIndex] & 0xFF;\n byteIndex++;\n\n if ((continuationByte & 0xC0) == 0x80) {\n return continuationByte & 0x3F;\n } // If we end up here, it’s not a continuation byte\n\n\n throw Error('Invalid continuation byte');\n }\n\n function decodeSymbol(strict) {\n var byte1;\n var byte2;\n var byte3;\n var byte4;\n var codePoint;\n\n if (byteIndex > byteCount) {\n throw Error('Invalid byte index');\n }\n\n if (byteIndex == byteCount) {\n return false;\n } // Read first byte\n\n\n byte1 = byteArray[byteIndex] & 0xFF;\n byteIndex++; // 1-byte sequence (no continuation bytes)\n\n if ((byte1 & 0x80) == 0) {\n return byte1;\n } // 2-byte sequence\n\n\n if ((byte1 & 0xE0) == 0xC0) {\n byte2 = readContinuationByte();\n codePoint = (byte1 & 0x1F) << 6 | byte2;\n\n if (codePoint >= 0x80) {\n return codePoint;\n } else {\n throw Error('Invalid continuation byte');\n }\n } // 3-byte sequence (may include unpaired surrogates)\n\n\n if ((byte1 & 0xF0) == 0xE0) {\n byte2 = readContinuationByte();\n byte3 = readContinuationByte();\n codePoint = (byte1 & 0x0F) << 12 | byte2 << 6 | byte3;\n\n if (codePoint >= 0x0800) {\n return checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;\n } else {\n throw Error('Invalid continuation byte');\n }\n } // 4-byte sequence\n\n\n if ((byte1 & 0xF8) == 0xF0) {\n byte2 = readContinuationByte();\n byte3 = readContinuationByte();\n byte4 = readContinuationByte();\n codePoint = (byte1 & 0x07) << 0x12 | byte2 << 0x0C | byte3 << 0x06 | byte4;\n\n if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n return codePoint;\n }\n }\n\n throw Error('Invalid UTF-8 detected');\n }\n\n var byteArray;\n var byteCount;\n var byteIndex;\n\n function utf8decode(byteString, opts) {\n opts = opts || {};\n var strict = false !== opts.strict;\n byteArray = ucs2decode(byteString);\n byteCount = byteArray.length;\n byteIndex = 0;\n var codePoints = [];\n var tmp;\n\n while ((tmp = decodeSymbol(strict)) !== false) {\n codePoints.push(tmp);\n }\n\n return ucs2encode(codePoints);\n }\n /*--------------------------------------------------------------------------*/\n\n\n var utf8 = {\n 'version': '2.1.2',\n 'encode': utf8encode,\n 'decode': utf8decode\n }; // Some AMD build optimizers, like r.js, check for specific condition patterns\n // like the following:\n\n if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n return utf8;\n }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {\n var key, hasOwnProperty, object;\n }\n })(this);\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../../webpack/buildin/module.js */\n \"./node_modules/webpack/buildin/module.js\")(module), __webpack_require__(\n /*! ./../../webpack/buildin/global.js */\n \"./node_modules/webpack/buildin/global.js\"));\n /***/\n },\n\n /***/\n \"./node_modules/enum/dist/enum.js\":\n /*!****************************************!*\\\n !*** ./node_modules/enum/dist/enum.js ***!\n \\****************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesEnumDistEnumJs(module, exports, __webpack_require__) {\n \"use strict\";\n /* WEBPACK VAR INJECTION */\n\n (function (global) {\n var _interopRequire = function _interopRequire(obj) {\n return obj && obj.__esModule ? obj[\"default\"] : obj;\n };\n\n var _classCallCheck = function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var EnumItem = _interopRequire(__webpack_require__(\n /*! ./enumItem */\n \"./node_modules/enum/dist/enumItem.js\"));\n\n var isString = __webpack_require__(\n /*! ./isType */\n \"./node_modules/enum/dist/isType.js\").isString;\n\n var indexOf = __webpack_require__(\n /*! ./indexOf */\n \"./node_modules/enum/dist/indexOf.js\").indexOf;\n\n var isBuffer = _interopRequire(__webpack_require__(\n /*! is-buffer */\n \"./node_modules/is-buffer/index.js\"));\n\n var endianness = \"LE\"; // for react-native\n\n /**\n * Represents an Enum with enum items.\n * @param {Array || Object} map This are the enum items.\n * @param {String || Object} options This are options. [optional]\n */\n\n var Enum = function () {\n function Enum(map, options) {\n var _this = this;\n\n _classCallCheck(this, Enum);\n /* implement the \"ref type interface\", so that Enum types can\n * be used in `node-ffi` function declarations and invokations.\n * In C, these Enums act as `uint32_t` types.\n *\n * https://github.com/TooTallNate/ref#the-type-interface\n */\n\n\n this.size = 4;\n this.indirection = 1;\n\n if (options && isString(options)) {\n options = {\n name: options\n };\n }\n\n this._options = options || {};\n this._options.separator = this._options.separator || \" | \";\n this._options.endianness = this._options.endianness || endianness;\n this._options.ignoreCase = this._options.ignoreCase || false;\n this._options.freez = this._options.freez || false;\n this.enums = [];\n\n if (map.length) {\n this._enumLastIndex = map.length;\n var array = map;\n map = {};\n\n for (var i = 0; i < array.length; i++) {\n map[array[i]] = Math.pow(2, i);\n }\n }\n\n for (var member in map) {\n guardReservedKeys(this._options.name, member);\n this[member] = new EnumItem(member, map[member], {\n ignoreCase: this._options.ignoreCase\n });\n this.enums.push(this[member]);\n }\n\n this._enumMap = map;\n\n if (this._options.ignoreCase) {\n this.getLowerCaseEnums = function () {\n var res = {};\n\n for (var i = 0, len = this.enums.length; i < len; i++) {\n res[this.enums[i].key.toLowerCase()] = this.enums[i];\n }\n\n return res;\n };\n }\n\n if (this._options.name) {\n this.name = this._options.name;\n }\n\n var isFlaggable = function isFlaggable() {\n for (var i = 0, len = _this.enums.length; i < len; i++) {\n var e = _this.enums[i];\n\n if (!(e.value !== 0 && !(e.value & e.value - 1))) {\n return false;\n }\n }\n\n return true;\n };\n\n this.isFlaggable = isFlaggable();\n\n if (this._options.freez) {\n this.freezeEnums(); //this will make instances of Enum non-extensible\n }\n }\n /**\n * Returns the appropriate EnumItem key.\n * @param {EnumItem || String || Number} key The object to get with.\n * @return {String} The get result.\n */\n\n\n Enum.prototype.getKey = function getKey(value) {\n var item = this.get(value);\n\n if (item) {\n return item.key;\n }\n };\n /**\n * Returns the appropriate EnumItem value.\n * @param {EnumItem || String || Number} key The object to get with.\n * @return {Number} The get result.\n */\n\n\n Enum.prototype.getValue = function getValue(key) {\n var item = this.get(key);\n\n if (item) {\n return item.value;\n }\n };\n /**\n * Returns the appropriate EnumItem.\n * @param {EnumItem || String || Number} key The object to get with.\n * @return {EnumItem} The get result.\n */\n\n\n Enum.prototype.get = function get(key, offset) {\n if (key === null || key === undefined) {\n return;\n } // Buffer instance support, part of the ref Type interface\n\n\n if (isBuffer(key)) {\n key = key[\"readUInt32\" + this._options.endianness](offset || 0);\n }\n\n if (EnumItem.isEnumItem(key)) {\n var foundIndex = indexOf.call(this.enums, key);\n\n if (foundIndex >= 0) {\n return key;\n }\n\n if (!this.isFlaggable || this.isFlaggable && key.key.indexOf(this._options.separator) < 0) {\n return;\n }\n\n return this.get(key.key);\n } else if (isString(key)) {\n var enums = this;\n\n if (this._options.ignoreCase) {\n enums = this.getLowerCaseEnums();\n key = key.toLowerCase();\n }\n\n if (key.indexOf(this._options.separator) > 0) {\n var parts = key.split(this._options.separator);\n var value = 0;\n\n for (var i = 0; i < parts.length; i++) {\n var part = parts[i];\n value |= enums[part].value;\n }\n\n return new EnumItem(key, value);\n } else {\n return enums[key];\n }\n } else {\n for (var m in this) {\n if (this.hasOwnProperty(m)) {\n if (this[m].value === key) {\n return this[m];\n }\n }\n }\n\n var result = null;\n\n if (this.isFlaggable) {\n for (var n in this) {\n if (this.hasOwnProperty(n)) {\n if ((key & this[n].value) !== 0) {\n if (result) {\n result += this._options.separator;\n } else {\n result = \"\";\n }\n\n result += n;\n }\n }\n }\n }\n\n return this.get(result || null);\n }\n };\n /**\n * Sets the Enum \"value\" onto the give `buffer` at the specified `offset`.\n * Part of the ref \"Type interface\".\n *\n * @param {Buffer} buffer The Buffer instance to write to.\n * @param {Number} offset The offset in the buffer to write to. Default 0.\n * @param {EnumItem || String || Number} value The EnumItem to write.\n */\n\n\n Enum.prototype.set = function set(buffer, offset, value) {\n var item = this.get(value);\n\n if (item) {\n return buffer[\"writeUInt32\" + this._options.endianness](item.value, offset || 0);\n }\n };\n /**\n * Define freezeEnums() as a property of the prototype.\n * make enumerable items nonconfigurable and deep freeze the properties. Throw Error on property setter.\n */\n\n\n Enum.prototype.freezeEnums = function freezeEnums() {\n function envSupportsFreezing() {\n return Object.isFrozen && Object.isSealed && Object.getOwnPropertyNames && Object.getOwnPropertyDescriptor && Object.defineProperties && Object.__defineGetter__ && Object.__defineSetter__;\n }\n\n function freezer(o) {\n var props = Object.getOwnPropertyNames(o);\n props.forEach(function (p) {\n if (!Object.getOwnPropertyDescriptor(o, p).configurable) {\n return;\n }\n\n Object.defineProperties(o, p, {\n writable: false,\n configurable: false\n });\n });\n return o;\n }\n\n function getPropertyValue(value) {\n return value;\n }\n\n function deepFreezeEnums(o) {\n if (typeof o !== \"object\" || o === null || Object.isFrozen(o) || Object.isSealed(o)) {\n return;\n }\n\n for (var key in o) {\n if (o.hasOwnProperty(key)) {\n o.__defineGetter__(key, getPropertyValue.bind(null, o[key]));\n\n o.__defineSetter__(key, function throwPropertySetError(value) {\n throw TypeError(\"Cannot redefine property; Enum Type is not extensible.\");\n });\n\n deepFreezeEnums(o[key]);\n }\n }\n\n if (Object.freeze) {\n Object.freeze(o);\n } else {\n freezer(o);\n }\n }\n\n if (envSupportsFreezing()) {\n deepFreezeEnums(this);\n }\n\n return this;\n };\n /**\n * Returns JSON object representation of this Enum.\n * @return {String} JSON object representation of this Enum.\n */\n\n\n Enum.prototype.toJSON = function toJSON() {\n return this._enumMap;\n };\n /**\n * Extends the existing Enum with a New Map.\n * @param {Array} map Map to extend from\n */\n\n\n Enum.prototype.extend = function extend(map) {\n if (map.length) {\n var array = map;\n map = {};\n\n for (var i = 0; i < array.length; i++) {\n var exponent = this._enumLastIndex + i;\n map[array[i]] = Math.pow(2, exponent);\n }\n\n for (var member in map) {\n guardReservedKeys(this._options.name, member);\n this[member] = new EnumItem(member, map[member], {\n ignoreCase: this._options.ignoreCase\n });\n this.enums.push(this[member]);\n }\n\n for (var key in this._enumMap) {\n map[key] = this._enumMap[key];\n }\n\n this._enumLastIndex += map.length;\n this._enumMap = map;\n\n if (this._options.freez) {\n this.freezeEnums(); //this will make instances of new Enum non-extensible\n }\n }\n };\n /**\n * Registers the Enum Type globally in node.js.\n * @param {String} key Global variable. [optional]\n */\n\n\n Enum.register = function register() {\n var key = arguments[0] === undefined ? \"Enum\" : arguments[0];\n\n if (!global[key]) {\n global[key] = Enum;\n }\n };\n\n return Enum;\n }();\n\n module.exports = Enum; // private\n\n var reservedKeys = [\"_options\", \"get\", \"getKey\", \"getValue\", \"enums\", \"isFlaggable\", \"_enumMap\", \"toJSON\", \"_enumLastIndex\"];\n\n function guardReservedKeys(customName, key) {\n if (customName && key === \"name\" || indexOf.call(reservedKeys, key) >= 0) {\n throw new Error(\"Enum key \" + key + \" is a reserved word!\");\n }\n }\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../../webpack/buildin/global.js */\n \"./node_modules/webpack/buildin/global.js\"));\n /***/\n },\n\n /***/\n \"./node_modules/enum/dist/enumItem.js\":\n /*!********************************************!*\\\n !*** ./node_modules/enum/dist/enumItem.js ***!\n \\********************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesEnumDistEnumItemJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n var _classCallCheck = function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n };\n\n var _isType = __webpack_require__(\n /*! ./isType */\n \"./node_modules/enum/dist/isType.js\");\n\n var isObject = _isType.isObject;\n var isString = _isType.isString;\n /**\n * Represents an Item of an Enum.\n * @param {String} key The Enum key.\n * @param {Number} value The Enum value.\n */\n\n var EnumItem = function () {\n /*constructor reference so that, this.constructor===EnumItem//=>true */\n function EnumItem(key, value) {\n var options = arguments[2] === undefined ? {} : arguments[2];\n\n _classCallCheck(this, EnumItem);\n\n this.key = key;\n this.value = value;\n this._options = options;\n this._options.ignoreCase = this._options.ignoreCase || false;\n }\n /**\n * Checks if the flagged EnumItem has the passing object.\n * @param {EnumItem || String || Number} value The object to check with.\n * @return {Boolean} The check result.\n */\n\n\n EnumItem.prototype.has = function has(value) {\n if (EnumItem.isEnumItem(value)) {\n return (this.value & value.value) !== 0;\n } else if (isString(value)) {\n if (this._options.ignoreCase) {\n return this.key.toLowerCase().indexOf(value.toLowerCase()) >= 0;\n }\n\n return this.key.indexOf(value) >= 0;\n } else {\n return (this.value & value) !== 0;\n }\n };\n /**\n * Checks if the EnumItem is the same as the passing object.\n * @param {EnumItem || String || Number} key The object to check with.\n * @return {Boolean} The check result.\n */\n\n\n EnumItem.prototype.is = function is(key) {\n if (EnumItem.isEnumItem(key)) {\n return this.key === key.key;\n } else if (isString(key)) {\n if (this._options.ignoreCase) {\n return this.key.toLowerCase() === key.toLowerCase();\n }\n\n return this.key === key;\n } else {\n return this.value === key;\n }\n };\n /**\n * Returns String representation of this EnumItem.\n * @return {String} String representation of this EnumItem.\n */\n\n\n EnumItem.prototype.toString = function toString() {\n return this.key;\n };\n /**\n * Returns JSON object representation of this EnumItem.\n * @return {String} JSON object representation of this EnumItem.\n */\n\n\n EnumItem.prototype.toJSON = function toJSON() {\n return this.key;\n };\n /**\n * Returns the value to compare with.\n * @return {String} The value to compare with.\n */\n\n\n EnumItem.prototype.valueOf = function valueOf() {\n return this.value;\n };\n\n EnumItem.isEnumItem = function isEnumItem(value) {\n return value instanceof EnumItem || isObject(value) && value.key !== undefined && value.value !== undefined;\n };\n\n return EnumItem;\n }();\n\n module.exports = EnumItem;\n /***/\n },\n\n /***/\n \"./node_modules/enum/dist/indexOf.js\":\n /*!*******************************************!*\\\n !*** ./node_modules/enum/dist/indexOf.js ***!\n \\*******************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesEnumDistIndexOfJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n exports.__esModule = true;\n\n var indexOf = Array.prototype.indexOf || function (find, i\n /*opt*/\n ) {\n if (i === undefined) i = 0;\n if (i < 0) i += this.length;\n if (i < 0) i = 0;\n\n for (var n = this.length; i < n; i++) {\n if (i in this && this[i] === find) return i;\n }\n\n return -1;\n };\n\n exports.indexOf = indexOf;\n /***/\n },\n\n /***/\n \"./node_modules/enum/dist/isType.js\":\n /*!******************************************!*\\\n !*** ./node_modules/enum/dist/isType.js ***!\n \\******************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesEnumDistIsTypeJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n exports.__esModule = true;\n\n var isType = function isType(type, value) {\n return typeof value === type;\n };\n\n exports.isType = isType;\n\n var isObject = function isObject(value) {\n return isType(\"object\", value);\n };\n\n exports.isObject = isObject;\n\n var isString = function isString(value) {\n return isType(\"string\", value);\n };\n\n exports.isString = isString;\n /***/\n },\n\n /***/\n \"./node_modules/enum/index.js\":\n /*!************************************!*\\\n !*** ./node_modules/enum/index.js ***!\n \\************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesEnumIndexJs(module, exports, __webpack_require__) {\n module.exports = __webpack_require__(\n /*! ./dist/enum */\n \"./node_modules/enum/dist/enum.js\");\n /***/\n },\n\n /***/\n \"./node_modules/has-binary2/index.js\":\n /*!*******************************************!*\\\n !*** ./node_modules/has-binary2/index.js ***!\n \\*******************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesHasBinary2IndexJs(module, exports, __webpack_require__) {\n /* WEBPACK VAR INJECTION */\n (function (global) {\n /* global Blob File */\n\n /*\n * Module requirements.\n */\n var isArray = __webpack_require__(\n /*! isarray */\n \"./node_modules/has-binary2/node_modules/isarray/index.js\");\n\n var toString = Object.prototype.toString;\n var withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\n var withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n /**\n * Module exports.\n */\n\n module.exports = hasBinary;\n /**\n * Checks for binary data.\n *\n * Supports Buffer, ArrayBuffer, Blob and File.\n *\n * @param {Object} anything\n * @api public\n */\n\n function hasBinary(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n if (isArray(obj)) {\n for (var i = 0, l = obj.length; i < l; i++) {\n if (hasBinary(obj[i])) {\n return true;\n }\n }\n\n return false;\n }\n\n if (typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj) || typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File) {\n return true;\n } // see: https://github.com/Automattic/has-binary/pull/4\n\n\n if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {\n return hasBinary(obj.toJSON(), true);\n }\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n return true;\n }\n }\n\n return false;\n }\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../webpack/buildin/global.js */\n \"./node_modules/webpack/buildin/global.js\"));\n /***/\n },\n\n /***/\n \"./node_modules/has-binary2/node_modules/isarray/index.js\":\n /*!****************************************************************!*\\\n !*** ./node_modules/has-binary2/node_modules/isarray/index.js ***!\n \\****************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesHasBinary2Node_modulesIsarrayIndexJs(module, exports) {\n var toString = {}.toString;\n\n module.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/has-cors/index.js\":\n /*!****************************************!*\\\n !*** ./node_modules/has-cors/index.js ***!\n \\****************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesHasCorsIndexJs(module, exports) {\n /**\n * Module exports.\n *\n * Logic borrowed from Modernizr:\n *\n * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n */\n try {\n module.exports = typeof XMLHttpRequest !== 'undefined' && 'withCredentials' in new XMLHttpRequest();\n } catch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n module.exports = false;\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/ieee754/index.js\":\n /*!***************************************!*\\\n !*** ./node_modules/ieee754/index.js ***!\n \\***************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesIeee754IndexJs(module, exports) {\n exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = -7;\n var i = isLE ? nBytes - 1 : 0;\n var d = isLE ? -1 : 1;\n var s = buffer[offset + i];\n i += d;\n e = s & (1 << -nBits) - 1;\n s >>= -nBits;\n nBits += eLen;\n\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : (s ? -1 : 1) * Infinity;\n } else {\n m = m + Math.pow(2, mLen);\n e = e - eBias;\n }\n\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen);\n };\n\n exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c;\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;\n var i = isLE ? 0 : nBytes - 1;\n var d = isLE ? 1 : -1;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n value = Math.abs(value);\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0;\n e = eMax;\n } else {\n e = Math.floor(Math.log(value) / Math.LN2);\n\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * Math.pow(2, 1 - eBias);\n }\n\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);\n e = 0;\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = e << mLen | m;\n eLen += mLen;\n\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/indexof/index.js\":\n /*!***************************************!*\\\n !*** ./node_modules/indexof/index.js ***!\n \\***************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesIndexofIndexJs(module, exports) {\n var indexOf = [].indexOf;\n\n module.exports = function (arr, obj) {\n if (indexOf) return arr.indexOf(obj);\n\n for (var i = 0; i < arr.length; ++i) {\n if (arr[i] === obj) return i;\n }\n\n return -1;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/is-buffer/index.js\":\n /*!*****************************************!*\\\n !*** ./node_modules/is-buffer/index.js ***!\n \\*****************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesIsBufferIndexJs(module, exports) {\n /*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n // The _isBuffer check is for Safari 5-7 support, because it's missing\n // Object.prototype.constructor. Remove this eventually\n module.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);\n };\n\n function isBuffer(obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);\n } // For Node v0.10 support. Remove this eventually.\n\n\n function isSlowBuffer(obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0));\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/isarray/index.js\":\n /*!***************************************!*\\\n !*** ./node_modules/isarray/index.js ***!\n \\***************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesIsarrayIndexJs(module, exports) {\n var toString = {}.toString;\n\n module.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/js-binarypack/lib/binarypack.js\":\n /*!******************************************************!*\\\n !*** ./node_modules/js-binarypack/lib/binarypack.js ***!\n \\******************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesJsBinarypackLibBinarypackJs(module, exports, __webpack_require__) {\n var BufferBuilder = __webpack_require__(\n /*! ./bufferbuilder */\n \"./node_modules/js-binarypack/lib/bufferbuilder.js\").BufferBuilder;\n\n var binaryFeatures = __webpack_require__(\n /*! ./bufferbuilder */\n \"./node_modules/js-binarypack/lib/bufferbuilder.js\").binaryFeatures;\n\n var BinaryPack = {\n unpack: function unpack(data) {\n var unpacker = new Unpacker(data);\n return unpacker.unpack();\n },\n pack: function pack(data) {\n var packer = new Packer();\n packer.pack(data);\n var buffer = packer.getBuffer();\n return buffer;\n }\n };\n module.exports = BinaryPack;\n\n function Unpacker(data) {\n // Data is ArrayBuffer\n this.index = 0;\n this.dataBuffer = data;\n this.dataView = new Uint8Array(this.dataBuffer);\n this.length = this.dataBuffer.byteLength;\n }\n\n Unpacker.prototype.unpack = function () {\n var type = this.unpack_uint8();\n\n if (type < 0x80) {\n var positive_fixnum = type;\n return positive_fixnum;\n } else if ((type ^ 0xe0) < 0x20) {\n var negative_fixnum = (type ^ 0xe0) - 0x20;\n return negative_fixnum;\n }\n\n var size;\n\n if ((size = type ^ 0xa0) <= 0x0f) {\n return this.unpack_raw(size);\n } else if ((size = type ^ 0xb0) <= 0x0f) {\n return this.unpack_string(size);\n } else if ((size = type ^ 0x90) <= 0x0f) {\n return this.unpack_array(size);\n } else if ((size = type ^ 0x80) <= 0x0f) {\n return this.unpack_map(size);\n }\n\n switch (type) {\n case 0xc0:\n return null;\n\n case 0xc1:\n return undefined;\n\n case 0xc2:\n return false;\n\n case 0xc3:\n return true;\n\n case 0xca:\n return this.unpack_float();\n\n case 0xcb:\n return this.unpack_double();\n\n case 0xcc:\n return this.unpack_uint8();\n\n case 0xcd:\n return this.unpack_uint16();\n\n case 0xce:\n return this.unpack_uint32();\n\n case 0xcf:\n return this.unpack_uint64();\n\n case 0xd0:\n return this.unpack_int8();\n\n case 0xd1:\n return this.unpack_int16();\n\n case 0xd2:\n return this.unpack_int32();\n\n case 0xd3:\n return this.unpack_int64();\n\n case 0xd4:\n return undefined;\n\n case 0xd5:\n return undefined;\n\n case 0xd6:\n return undefined;\n\n case 0xd7:\n return undefined;\n\n case 0xd8:\n size = this.unpack_uint16();\n return this.unpack_string(size);\n\n case 0xd9:\n size = this.unpack_uint32();\n return this.unpack_string(size);\n\n case 0xda:\n size = this.unpack_uint16();\n return this.unpack_raw(size);\n\n case 0xdb:\n size = this.unpack_uint32();\n return this.unpack_raw(size);\n\n case 0xdc:\n size = this.unpack_uint16();\n return this.unpack_array(size);\n\n case 0xdd:\n size = this.unpack_uint32();\n return this.unpack_array(size);\n\n case 0xde:\n size = this.unpack_uint16();\n return this.unpack_map(size);\n\n case 0xdf:\n size = this.unpack_uint32();\n return this.unpack_map(size);\n }\n };\n\n Unpacker.prototype.unpack_uint8 = function () {\n var _byte = this.dataView[this.index] & 0xff;\n\n this.index++;\n return _byte;\n };\n\n Unpacker.prototype.unpack_uint16 = function () {\n var bytes = this.read(2);\n var uint16 = (bytes[0] & 0xff) * 256 + (bytes[1] & 0xff);\n this.index += 2;\n return uint16;\n };\n\n Unpacker.prototype.unpack_uint32 = function () {\n var bytes = this.read(4);\n var uint32 = ((bytes[0] * 256 + bytes[1]) * 256 + bytes[2]) * 256 + bytes[3];\n this.index += 4;\n return uint32;\n };\n\n Unpacker.prototype.unpack_uint64 = function () {\n var bytes = this.read(8);\n var uint64 = ((((((bytes[0] * 256 + bytes[1]) * 256 + bytes[2]) * 256 + bytes[3]) * 256 + bytes[4]) * 256 + bytes[5]) * 256 + bytes[6]) * 256 + bytes[7];\n this.index += 8;\n return uint64;\n };\n\n Unpacker.prototype.unpack_int8 = function () {\n var uint8 = this.unpack_uint8();\n return uint8 < 0x80 ? uint8 : uint8 - (1 << 8);\n };\n\n Unpacker.prototype.unpack_int16 = function () {\n var uint16 = this.unpack_uint16();\n return uint16 < 0x8000 ? uint16 : uint16 - (1 << 16);\n };\n\n Unpacker.prototype.unpack_int32 = function () {\n var uint32 = this.unpack_uint32();\n return uint32 < Math.pow(2, 31) ? uint32 : uint32 - Math.pow(2, 32);\n };\n\n Unpacker.prototype.unpack_int64 = function () {\n var uint64 = this.unpack_uint64();\n return uint64 < Math.pow(2, 63) ? uint64 : uint64 - Math.pow(2, 64);\n };\n\n Unpacker.prototype.unpack_raw = function (size) {\n if (this.length < this.index + size) {\n throw new Error('BinaryPackFailure: index is out of range' + ' ' + this.index + ' ' + size + ' ' + this.length);\n }\n\n var buf = this.dataBuffer.slice(this.index, this.index + size);\n this.index += size; //buf = util.bufferToString(buf);\n\n return buf;\n };\n\n Unpacker.prototype.unpack_string = function (size) {\n var bytes = this.read(size);\n var i = 0,\n str = '',\n c,\n code;\n\n while (i < size) {\n c = bytes[i];\n\n if (c < 128) {\n str += String.fromCharCode(c);\n i++;\n } else if ((c ^ 0xc0) < 32) {\n code = (c ^ 0xc0) << 6 | bytes[i + 1] & 63;\n str += String.fromCharCode(code);\n i += 2;\n } else {\n code = (c & 15) << 12 | (bytes[i + 1] & 63) << 6 | bytes[i + 2] & 63;\n str += String.fromCharCode(code);\n i += 3;\n }\n }\n\n this.index += size;\n return str;\n };\n\n Unpacker.prototype.unpack_array = function (size) {\n var objects = new Array(size);\n\n for (var i = 0; i < size; i++) {\n objects[i] = this.unpack();\n }\n\n return objects;\n };\n\n Unpacker.prototype.unpack_map = function (size) {\n var map = {};\n\n for (var i = 0; i < size; i++) {\n var key = this.unpack();\n var value = this.unpack();\n map[key] = value;\n }\n\n return map;\n };\n\n Unpacker.prototype.unpack_float = function () {\n var uint32 = this.unpack_uint32();\n var sign = uint32 >> 31;\n var exp = (uint32 >> 23 & 0xff) - 127;\n var fraction = uint32 & 0x7fffff | 0x800000;\n return (sign == 0 ? 1 : -1) * fraction * Math.pow(2, exp - 23);\n };\n\n Unpacker.prototype.unpack_double = function () {\n var h32 = this.unpack_uint32();\n var l32 = this.unpack_uint32();\n var sign = h32 >> 31;\n var exp = (h32 >> 20 & 0x7ff) - 1023;\n var hfrac = h32 & 0xfffff | 0x100000;\n var frac = hfrac * Math.pow(2, exp - 20) + l32 * Math.pow(2, exp - 52);\n return (sign == 0 ? 1 : -1) * frac;\n };\n\n Unpacker.prototype.read = function (length) {\n var j = this.index;\n\n if (j + length <= this.length) {\n return this.dataView.subarray(j, j + length);\n } else {\n throw new Error('BinaryPackFailure: read index out of range');\n }\n };\n\n function Packer() {\n this.bufferBuilder = new BufferBuilder();\n }\n\n Packer.prototype.getBuffer = function () {\n return this.bufferBuilder.getBuffer();\n };\n\n Packer.prototype.pack = function (value) {\n var type = typeof value;\n\n if (type == 'string') {\n this.pack_string(value);\n } else if (type == 'number') {\n if (Math.floor(value) === value) {\n this.pack_integer(value);\n } else {\n this.pack_double(value);\n }\n } else if (type == 'boolean') {\n if (value === true) {\n this.bufferBuilder.append(0xc3);\n } else if (value === false) {\n this.bufferBuilder.append(0xc2);\n }\n } else if (type == 'undefined') {\n this.bufferBuilder.append(0xc0);\n } else if (type == 'object') {\n if (value === null) {\n this.bufferBuilder.append(0xc0);\n } else {\n var constructor = value.constructor;\n\n if (constructor == Array) {\n this.pack_array(value);\n } else if (constructor == Blob || constructor == File) {\n this.pack_bin(value);\n } else if (constructor == ArrayBuffer) {\n if (binaryFeatures.useArrayBufferView) {\n this.pack_bin(new Uint8Array(value));\n } else {\n this.pack_bin(value);\n }\n } else if ('BYTES_PER_ELEMENT' in value) {\n if (binaryFeatures.useArrayBufferView) {\n this.pack_bin(new Uint8Array(value.buffer));\n } else {\n this.pack_bin(value.buffer);\n }\n } else if (constructor == Object) {\n this.pack_object(value);\n } else if (constructor == Date) {\n this.pack_string(value.toString());\n } else if (typeof value.toBinaryPack == 'function') {\n this.bufferBuilder.append(value.toBinaryPack());\n } else {\n throw new Error('Type \"' + constructor.toString() + '\" not yet supported');\n }\n }\n } else {\n throw new Error('Type \"' + type + '\" not yet supported');\n }\n\n this.bufferBuilder.flush();\n };\n\n Packer.prototype.pack_bin = function (blob) {\n var length = blob.length || blob.byteLength || blob.size;\n\n if (length <= 0x0f) {\n this.pack_uint8(0xa0 + length);\n } else if (length <= 0xffff) {\n this.bufferBuilder.append(0xda);\n this.pack_uint16(length);\n } else if (length <= 0xffffffff) {\n this.bufferBuilder.append(0xdb);\n this.pack_uint32(length);\n } else {\n throw new Error('Invalid length');\n }\n\n this.bufferBuilder.append(blob);\n };\n\n Packer.prototype.pack_string = function (str) {\n var length = utf8Length(str);\n\n if (length <= 0x0f) {\n this.pack_uint8(0xb0 + length);\n } else if (length <= 0xffff) {\n this.bufferBuilder.append(0xd8);\n this.pack_uint16(length);\n } else if (length <= 0xffffffff) {\n this.bufferBuilder.append(0xd9);\n this.pack_uint32(length);\n } else {\n throw new Error('Invalid length');\n }\n\n this.bufferBuilder.append(str);\n };\n\n Packer.prototype.pack_array = function (ary) {\n var length = ary.length;\n\n if (length <= 0x0f) {\n this.pack_uint8(0x90 + length);\n } else if (length <= 0xffff) {\n this.bufferBuilder.append(0xdc);\n this.pack_uint16(length);\n } else if (length <= 0xffffffff) {\n this.bufferBuilder.append(0xdd);\n this.pack_uint32(length);\n } else {\n throw new Error('Invalid length');\n }\n\n for (var i = 0; i < length; i++) {\n this.pack(ary[i]);\n }\n };\n\n Packer.prototype.pack_integer = function (num) {\n if (-0x20 <= num && num <= 0x7f) {\n this.bufferBuilder.append(num & 0xff);\n } else if (0x00 <= num && num <= 0xff) {\n this.bufferBuilder.append(0xcc);\n this.pack_uint8(num);\n } else if (-0x80 <= num && num <= 0x7f) {\n this.bufferBuilder.append(0xd0);\n this.pack_int8(num);\n } else if (0x0000 <= num && num <= 0xffff) {\n this.bufferBuilder.append(0xcd);\n this.pack_uint16(num);\n } else if (-0x8000 <= num && num <= 0x7fff) {\n this.bufferBuilder.append(0xd1);\n this.pack_int16(num);\n } else if (0x00000000 <= num && num <= 0xffffffff) {\n this.bufferBuilder.append(0xce);\n this.pack_uint32(num);\n } else if (-0x80000000 <= num && num <= 0x7fffffff) {\n this.bufferBuilder.append(0xd2);\n this.pack_int32(num);\n } else if (-0x8000000000000000 <= num && num <= 0x7FFFFFFFFFFFFFFF) {\n this.bufferBuilder.append(0xd3);\n this.pack_int64(num);\n } else if (0x0000000000000000 <= num && num <= 0xFFFFFFFFFFFFFFFF) {\n this.bufferBuilder.append(0xcf);\n this.pack_uint64(num);\n } else {\n throw new Error('Invalid integer');\n }\n };\n\n Packer.prototype.pack_double = function (num) {\n var sign = 0;\n\n if (num < 0) {\n sign = 1;\n num = -num;\n }\n\n var exp = Math.floor(Math.log(num) / Math.LN2);\n var frac0 = num / Math.pow(2, exp) - 1;\n var frac1 = Math.floor(frac0 * Math.pow(2, 52));\n var b32 = Math.pow(2, 32);\n var h32 = sign << 31 | exp + 1023 << 20 | frac1 / b32 & 0x0fffff;\n var l32 = frac1 % b32;\n this.bufferBuilder.append(0xcb);\n this.pack_int32(h32);\n this.pack_int32(l32);\n };\n\n Packer.prototype.pack_object = function (obj) {\n var keys = Object.keys(obj);\n var length = keys.length;\n\n if (length <= 0x0f) {\n this.pack_uint8(0x80 + length);\n } else if (length <= 0xffff) {\n this.bufferBuilder.append(0xde);\n this.pack_uint16(length);\n } else if (length <= 0xffffffff) {\n this.bufferBuilder.append(0xdf);\n this.pack_uint32(length);\n } else {\n throw new Error('Invalid length');\n }\n\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n this.pack(prop);\n this.pack(obj[prop]);\n }\n }\n };\n\n Packer.prototype.pack_uint8 = function (num) {\n this.bufferBuilder.append(num);\n };\n\n Packer.prototype.pack_uint16 = function (num) {\n this.bufferBuilder.append(num >> 8);\n this.bufferBuilder.append(num & 0xff);\n };\n\n Packer.prototype.pack_uint32 = function (num) {\n var n = num & 0xffffffff;\n this.bufferBuilder.append((n & 0xff000000) >>> 24);\n this.bufferBuilder.append((n & 0x00ff0000) >>> 16);\n this.bufferBuilder.append((n & 0x0000ff00) >>> 8);\n this.bufferBuilder.append(n & 0x000000ff);\n };\n\n Packer.prototype.pack_uint64 = function (num) {\n var high = num / Math.pow(2, 32);\n var low = num % Math.pow(2, 32);\n this.bufferBuilder.append((high & 0xff000000) >>> 24);\n this.bufferBuilder.append((high & 0x00ff0000) >>> 16);\n this.bufferBuilder.append((high & 0x0000ff00) >>> 8);\n this.bufferBuilder.append(high & 0x000000ff);\n this.bufferBuilder.append((low & 0xff000000) >>> 24);\n this.bufferBuilder.append((low & 0x00ff0000) >>> 16);\n this.bufferBuilder.append((low & 0x0000ff00) >>> 8);\n this.bufferBuilder.append(low & 0x000000ff);\n };\n\n Packer.prototype.pack_int8 = function (num) {\n this.bufferBuilder.append(num & 0xff);\n };\n\n Packer.prototype.pack_int16 = function (num) {\n this.bufferBuilder.append((num & 0xff00) >> 8);\n this.bufferBuilder.append(num & 0xff);\n };\n\n Packer.prototype.pack_int32 = function (num) {\n this.bufferBuilder.append(num >>> 24 & 0xff);\n this.bufferBuilder.append((num & 0x00ff0000) >>> 16);\n this.bufferBuilder.append((num & 0x0000ff00) >>> 8);\n this.bufferBuilder.append(num & 0x000000ff);\n };\n\n Packer.prototype.pack_int64 = function (num) {\n var high = Math.floor(num / Math.pow(2, 32));\n var low = num % Math.pow(2, 32);\n this.bufferBuilder.append((high & 0xff000000) >>> 24);\n this.bufferBuilder.append((high & 0x00ff0000) >>> 16);\n this.bufferBuilder.append((high & 0x0000ff00) >>> 8);\n this.bufferBuilder.append(high & 0x000000ff);\n this.bufferBuilder.append((low & 0xff000000) >>> 24);\n this.bufferBuilder.append((low & 0x00ff0000) >>> 16);\n this.bufferBuilder.append((low & 0x0000ff00) >>> 8);\n this.bufferBuilder.append(low & 0x000000ff);\n };\n\n function _utf8Replace(m) {\n var code = m.charCodeAt(0);\n if (code <= 0x7ff) return '00';\n if (code <= 0xffff) return '000';\n if (code <= 0x1fffff) return '0000';\n if (code <= 0x3ffffff) return '00000';\n return '000000';\n }\n\n function utf8Length(str) {\n if (str.length > 600) {\n // Blob method faster for large strings\n return new Blob([str]).size;\n } else {\n return str.replace(/[^\\u0000-\\u007F]/g, _utf8Replace).length;\n }\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/js-binarypack/lib/bufferbuilder.js\":\n /*!*********************************************************!*\\\n !*** ./node_modules/js-binarypack/lib/bufferbuilder.js ***!\n \\*********************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesJsBinarypackLibBufferbuilderJs(module, exports) {\n var binaryFeatures = {};\n\n binaryFeatures.useBlobBuilder = function () {\n try {\n new Blob([]);\n return false;\n } catch (e) {\n return true;\n }\n }();\n\n binaryFeatures.useArrayBufferView = !binaryFeatures.useBlobBuilder && function () {\n try {\n return new Blob([new Uint8Array([])]).size === 0;\n } catch (e) {\n return true;\n }\n }();\n\n module.exports.binaryFeatures = binaryFeatures;\n var BlobBuilder = module.exports.BlobBuilder;\n\n if (typeof window != 'undefined') {\n BlobBuilder = module.exports.BlobBuilder = window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder || window.BlobBuilder;\n }\n\n function BufferBuilder() {\n this._pieces = [];\n this._parts = [];\n }\n\n BufferBuilder.prototype.append = function (data) {\n if (typeof data === 'number') {\n this._pieces.push(data);\n } else {\n this.flush();\n\n this._parts.push(data);\n }\n };\n\n BufferBuilder.prototype.flush = function () {\n if (this._pieces.length > 0) {\n var buf = new Uint8Array(this._pieces);\n\n if (!binaryFeatures.useArrayBufferView) {\n buf = buf.buffer;\n }\n\n this._parts.push(buf);\n\n this._pieces = [];\n }\n };\n\n BufferBuilder.prototype.getBuffer = function () {\n this.flush();\n\n if (binaryFeatures.useBlobBuilder) {\n var builder = new BlobBuilder();\n\n for (var i = 0, ii = this._parts.length; i < ii; i++) {\n builder.append(this._parts[i]);\n }\n\n return builder.getBlob();\n } else {\n return new Blob(this._parts);\n }\n };\n\n module.exports.BufferBuilder = BufferBuilder;\n /***/\n },\n\n /***/\n \"./node_modules/ms/index.js\":\n /*!**********************************!*\\\n !*** ./node_modules/ms/index.js ***!\n \\**********************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesMsIndexJs(module, exports) {\n /**\n * Helpers.\n */\n var s = 1000;\n var m = s * 60;\n var h = m * 60;\n var d = h * 24;\n var y = d * 365.25;\n /**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\n module.exports = function (val, options) {\n options = options || {};\n var type = typeof val;\n\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n\n throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));\n };\n /**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\n\n function parse(str) {\n str = String(str);\n\n if (str.length > 100) {\n return;\n }\n\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n\n if (!match) {\n return;\n }\n\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n\n default:\n return undefined;\n }\n }\n /**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\n\n function fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n\n return ms + 'ms';\n }\n /**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\n\n function fmtLong(ms) {\n return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';\n }\n /**\n * Pluralization helper.\n */\n\n\n function plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n\n return Math.ceil(ms / n) + ' ' + name + 's';\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/node-libs-browser/node_modules/buffer/index.js\":\n /*!*********************************************************************!*\\\n !*** ./node_modules/node-libs-browser/node_modules/buffer/index.js ***!\n \\*********************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesNodeLibsBrowserNode_modulesBufferIndexJs(module, exports, __webpack_require__) {\n \"use strict\";\n /* WEBPACK VAR INJECTION */\n\n (function (global) {\n /*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n /* eslint-disable no-proto */\n var base64 = __webpack_require__(\n /*! base64-js */\n \"./node_modules/base64-js/index.js\");\n\n var ieee754 = __webpack_require__(\n /*! ieee754 */\n \"./node_modules/ieee754/index.js\");\n\n var isArray = __webpack_require__(\n /*! isarray */\n \"./node_modules/isarray/index.js\");\n\n exports.Buffer = Buffer;\n exports.SlowBuffer = SlowBuffer;\n exports.INSPECT_MAX_BYTES = 50;\n /**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n \n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\n\n Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport();\n /*\n * Export kMaxLength after typed array support is determined.\n */\n\n exports.kMaxLength = kMaxLength();\n\n function typedArraySupport() {\n try {\n var arr = new Uint8Array(1);\n arr.__proto__ = {\n __proto__: Uint8Array.prototype,\n foo: function foo() {\n return 42;\n }\n };\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray`\n } catch (e) {\n return false;\n }\n }\n\n function kMaxLength() {\n return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;\n }\n\n function createBuffer(that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length');\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length);\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length);\n }\n\n that.length = length;\n }\n\n return that;\n }\n /**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\n\n function Buffer(arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length);\n } // Common case.\n\n\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return allocUnsafe(this, arg);\n }\n\n return from(this, arg, encodingOrOffset, length);\n }\n\n Buffer.poolSize = 8192; // not used by this implementation\n // TODO: Legacy, not needed anymore. Remove in next major version.\n\n Buffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype;\n return arr;\n };\n\n function from(that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number');\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length);\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset);\n }\n\n return fromObject(that, value);\n }\n /**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\n\n\n Buffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length);\n };\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype;\n Buffer.__proto__ = Uint8Array;\n\n if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n });\n }\n }\n\n function assertSize(size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number');\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative');\n }\n }\n\n function alloc(that, size, fill, encoding) {\n assertSize(size);\n\n if (size <= 0) {\n return createBuffer(that, size);\n }\n\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);\n }\n\n return createBuffer(that, size);\n }\n /**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\n\n\n Buffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding);\n };\n\n function allocUnsafe(that, size) {\n assertSize(size);\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0;\n }\n }\n\n return that;\n }\n /**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\n\n\n Buffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size);\n };\n /**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\n\n\n Buffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size);\n };\n\n function fromString(that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8';\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding');\n }\n\n var length = byteLength(string, encoding) | 0;\n that = createBuffer(that, length);\n var actual = that.write(string, encoding);\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual);\n }\n\n return that;\n }\n\n function fromArrayLike(that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0;\n that = createBuffer(that, length);\n\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255;\n }\n\n return that;\n }\n\n function fromArrayBuffer(that, array, byteOffset, length) {\n array.byteLength; // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds');\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds');\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array);\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset);\n } else {\n array = new Uint8Array(array, byteOffset, length);\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array;\n that.__proto__ = Buffer.prototype;\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array);\n }\n\n return that;\n }\n\n function fromObject(that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0;\n that = createBuffer(that, len);\n\n if (that.length === 0) {\n return that;\n }\n\n obj.copy(that, 0, 0, len);\n return that;\n }\n\n if (obj) {\n if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0);\n }\n\n return fromArrayLike(that, obj);\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data);\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');\n }\n\n function checked(length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');\n }\n\n return length | 0;\n }\n\n function SlowBuffer(length) {\n if (+length != length) {\n // eslint-disable-line eqeqeq\n length = 0;\n }\n\n return Buffer.alloc(+length);\n }\n\n Buffer.isBuffer = function isBuffer(b) {\n return !!(b != null && b._isBuffer);\n };\n\n Buffer.compare = function compare(a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers');\n }\n\n if (a === b) return 0;\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n };\n\n Buffer.isEncoding = function isEncoding(encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true;\n\n default:\n return false;\n }\n };\n\n Buffer.concat = function concat(list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0);\n }\n\n var i;\n\n if (length === undefined) {\n length = 0;\n\n for (i = 0; i < list.length; ++i) {\n length += list[i].length;\n }\n }\n\n var buffer = Buffer.allocUnsafe(length);\n var pos = 0;\n\n for (i = 0; i < list.length; ++i) {\n var buf = list[i];\n\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers');\n }\n\n buf.copy(buffer, pos);\n pos += buf.length;\n }\n\n return buffer;\n };\n\n function byteLength(string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length;\n }\n\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength;\n }\n\n if (typeof string !== 'string') {\n string = '' + string;\n }\n\n var len = string.length;\n if (len === 0) return 0; // Use a for loop to avoid recursion\n\n var loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len;\n\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length;\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2;\n\n case 'hex':\n return len >>> 1;\n\n case 'base64':\n return base64ToBytes(string).length;\n\n default:\n if (loweredCase) return utf8ToBytes(string).length; // assume utf8\n\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n }\n\n Buffer.byteLength = byteLength;\n\n function slowToString(encoding, start, end) {\n var loweredCase = false; // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n\n if (start === undefined || start < 0) {\n start = 0;\n } // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n\n\n if (start > this.length) {\n return '';\n }\n\n if (end === undefined || end > this.length) {\n end = this.length;\n }\n\n if (end <= 0) {\n return '';\n } // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n\n\n end >>>= 0;\n start >>>= 0;\n\n if (end <= start) {\n return '';\n }\n\n if (!encoding) encoding = 'utf8';\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end);\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end);\n\n case 'ascii':\n return asciiSlice(this, start, end);\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end);\n\n case 'base64':\n return base64Slice(this, start, end);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end);\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);\n encoding = (encoding + '').toLowerCase();\n loweredCase = true;\n }\n }\n } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n // Buffer instances.\n\n\n Buffer.prototype._isBuffer = true;\n\n function swap(b, n, m) {\n var i = b[n];\n b[n] = b[m];\n b[m] = i;\n }\n\n Buffer.prototype.swap16 = function swap16() {\n var len = this.length;\n\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits');\n }\n\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1);\n }\n\n return this;\n };\n\n Buffer.prototype.swap32 = function swap32() {\n var len = this.length;\n\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits');\n }\n\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3);\n swap(this, i + 1, i + 2);\n }\n\n return this;\n };\n\n Buffer.prototype.swap64 = function swap64() {\n var len = this.length;\n\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits');\n }\n\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7);\n swap(this, i + 1, i + 6);\n swap(this, i + 2, i + 5);\n swap(this, i + 3, i + 4);\n }\n\n return this;\n };\n\n Buffer.prototype.toString = function toString() {\n var length = this.length | 0;\n if (length === 0) return '';\n if (arguments.length === 0) return utf8Slice(this, 0, length);\n return slowToString.apply(this, arguments);\n };\n\n Buffer.prototype.equals = function equals(b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');\n if (this === b) return true;\n return Buffer.compare(this, b) === 0;\n };\n\n Buffer.prototype.inspect = function inspect() {\n var str = '';\n var max = exports.INSPECT_MAX_BYTES;\n\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');\n if (this.length > max) str += ' ... ';\n }\n\n return '';\n };\n\n Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer');\n }\n\n if (start === undefined) {\n start = 0;\n }\n\n if (end === undefined) {\n end = target ? target.length : 0;\n }\n\n if (thisStart === undefined) {\n thisStart = 0;\n }\n\n if (thisEnd === undefined) {\n thisEnd = this.length;\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index');\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0;\n }\n\n if (thisStart >= thisEnd) {\n return -1;\n }\n\n if (start >= end) {\n return 1;\n }\n\n start >>>= 0;\n end >>>= 0;\n thisStart >>>= 0;\n thisEnd >>>= 0;\n if (this === target) return 0;\n var x = thisEnd - thisStart;\n var y = end - start;\n var len = Math.min(x, y);\n var thisCopy = this.slice(thisStart, thisEnd);\n var targetCopy = target.slice(start, end);\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i];\n y = targetCopy[i];\n break;\n }\n }\n\n if (x < y) return -1;\n if (y < x) return 1;\n return 0;\n }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n // OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n //\n // Arguments:\n // - buffer - a Buffer to search\n // - val - a string, Buffer, or number\n // - byteOffset - an index into `buffer`; will be clamped to an int32\n // - encoding - an optional encoding, relevant is val is a string\n // - dir - true for indexOf, false for lastIndexOf\n\n\n function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1; // Normalize byteOffset\n\n if (typeof byteOffset === 'string') {\n encoding = byteOffset;\n byteOffset = 0;\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff;\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000;\n }\n\n byteOffset = +byteOffset; // Coerce to Number.\n\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : buffer.length - 1;\n } // Normalize byteOffset: negative offsets start from the end of the buffer\n\n\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset;\n\n if (byteOffset >= buffer.length) {\n if (dir) return -1;else byteOffset = buffer.length - 1;\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0;else return -1;\n } // Normalize val\n\n\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding);\n } // Finally, search either indexOf (if dir is true) or lastIndexOf\n\n\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1;\n }\n\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir);\n } else if (typeof val === 'number') {\n val = val & 0xFF; // Search for a byte value [0-255]\n\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);\n }\n }\n\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);\n }\n\n throw new TypeError('val must be string, number or Buffer');\n }\n\n function arrayIndexOf(arr, val, byteOffset, encoding, dir) {\n var indexSize = 1;\n var arrLength = arr.length;\n var valLength = val.length;\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase();\n\n if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1;\n }\n\n indexSize = 2;\n arrLength /= 2;\n valLength /= 2;\n byteOffset /= 2;\n }\n }\n\n function read(buf, i) {\n if (indexSize === 1) {\n return buf[i];\n } else {\n return buf.readUInt16BE(i * indexSize);\n }\n }\n\n var i;\n\n if (dir) {\n var foundIndex = -1;\n\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i;\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;\n } else {\n if (foundIndex !== -1) i -= i - foundIndex;\n foundIndex = -1;\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;\n\n for (i = byteOffset; i >= 0; i--) {\n var found = true;\n\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false;\n break;\n }\n }\n\n if (found) return i;\n }\n }\n\n return -1;\n }\n\n Buffer.prototype.includes = function includes(val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1;\n };\n\n Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true);\n };\n\n Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false);\n };\n\n function hexWrite(buf, string, offset, length) {\n offset = Number(offset) || 0;\n var remaining = buf.length - offset;\n\n if (!length) {\n length = remaining;\n } else {\n length = Number(length);\n\n if (length > remaining) {\n length = remaining;\n }\n } // must be an even number of digits\n\n\n var strLen = string.length;\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');\n\n if (length > strLen / 2) {\n length = strLen / 2;\n }\n\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16);\n if (isNaN(parsed)) return i;\n buf[offset + i] = parsed;\n }\n\n return i;\n }\n\n function utf8Write(buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);\n }\n\n function asciiWrite(buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length);\n }\n\n function latin1Write(buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length);\n }\n\n function base64Write(buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length);\n }\n\n function ucs2Write(buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);\n }\n\n Buffer.prototype.write = function write(string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8';\n length = this.length;\n offset = 0; // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset;\n length = this.length;\n offset = 0; // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0;\n\n if (isFinite(length)) {\n length = length | 0;\n if (encoding === undefined) encoding = 'utf8';\n } else {\n encoding = length;\n length = undefined;\n } // legacy write(string, encoding, offset, length) - remove in v0.13\n\n } else {\n throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');\n }\n\n var remaining = this.length - offset;\n if (length === undefined || length > remaining) length = remaining;\n\n if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds');\n }\n\n if (!encoding) encoding = 'utf8';\n var loweredCase = false;\n\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length);\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length);\n\n case 'ascii':\n return asciiWrite(this, string, offset, length);\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length);\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length);\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length);\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);\n encoding = ('' + encoding).toLowerCase();\n loweredCase = true;\n }\n }\n };\n\n Buffer.prototype.toJSON = function toJSON() {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n };\n };\n\n function base64Slice(buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf);\n } else {\n return base64.fromByteArray(buf.slice(start, end));\n }\n }\n\n function utf8Slice(buf, start, end) {\n end = Math.min(buf.length, end);\n var res = [];\n var i = start;\n\n while (i < end) {\n var firstByte = buf[i];\n var codePoint = null;\n var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint;\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte;\n }\n\n break;\n\n case 2:\n secondByte = buf[i + 1];\n\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;\n\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 3:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;\n\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint;\n }\n }\n\n break;\n\n case 4:\n secondByte = buf[i + 1];\n thirdByte = buf[i + 2];\n fourthByte = buf[i + 3];\n\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;\n\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint;\n }\n }\n\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD;\n bytesPerSequence = 1;\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000;\n res.push(codePoint >>> 10 & 0x3FF | 0xD800);\n codePoint = 0xDC00 | codePoint & 0x3FF;\n }\n\n res.push(codePoint);\n i += bytesPerSequence;\n }\n\n return decodeCodePointsArray(res);\n } // Based on http://stackoverflow.com/a/22747272/680742, the browser with\n // the lowest limit is Chrome, with 0x10000 args.\n // We go 1 magnitude less, for safety\n\n\n var MAX_ARGUMENTS_LENGTH = 0x1000;\n\n function decodeCodePointsArray(codePoints) {\n var len = codePoints.length;\n\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints); // avoid extra slice()\n } // Decode in chunks to avoid \"call stack size exceeded\".\n\n\n var res = '';\n var i = 0;\n\n while (i < len) {\n res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));\n }\n\n return res;\n }\n\n function asciiSlice(buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F);\n }\n\n return ret;\n }\n\n function latin1Slice(buf, start, end) {\n var ret = '';\n end = Math.min(buf.length, end);\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i]);\n }\n\n return ret;\n }\n\n function hexSlice(buf, start, end) {\n var len = buf.length;\n if (!start || start < 0) start = 0;\n if (!end || end < 0 || end > len) end = len;\n var out = '';\n\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i]);\n }\n\n return out;\n }\n\n function utf16leSlice(buf, start, end) {\n var bytes = buf.slice(start, end);\n var res = '';\n\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);\n }\n\n return res;\n }\n\n Buffer.prototype.slice = function slice(start, end) {\n var len = this.length;\n start = ~~start;\n end = end === undefined ? len : ~~end;\n\n if (start < 0) {\n start += len;\n if (start < 0) start = 0;\n } else if (start > len) {\n start = len;\n }\n\n if (end < 0) {\n end += len;\n if (end < 0) end = 0;\n } else if (end > len) {\n end = len;\n }\n\n if (end < start) end = start;\n var newBuf;\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end);\n newBuf.__proto__ = Buffer.prototype;\n } else {\n var sliceLen = end - start;\n newBuf = new Buffer(sliceLen, undefined);\n\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start];\n }\n }\n\n return newBuf;\n };\n /*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\n\n\n function checkOffset(offset, ext, length) {\n if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');\n }\n\n Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var val = this[offset];\n var mul = 1;\n var i = 0;\n\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n return val;\n };\n\n Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length);\n }\n\n var val = this[offset + --byteLength];\n var mul = 1;\n\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul;\n }\n\n return val;\n };\n\n Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n return this[offset];\n };\n\n Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] | this[offset + 1] << 8;\n };\n\n Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n return this[offset] << 8 | this[offset + 1];\n };\n\n Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;\n };\n\n Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);\n };\n\n Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var val = this[offset];\n var mul = 1;\n var i = 0;\n\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul;\n }\n\n mul *= 0x80;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n };\n\n Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {\n offset = offset | 0;\n byteLength = byteLength | 0;\n if (!noAssert) checkOffset(offset, byteLength, this.length);\n var i = byteLength;\n var mul = 1;\n var val = this[offset + --i];\n\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul;\n }\n\n mul *= 0x80;\n if (val >= mul) val -= Math.pow(2, 8 * byteLength);\n return val;\n };\n\n Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length);\n if (!(this[offset] & 0x80)) return this[offset];\n return (0xff - this[offset] + 1) * -1;\n };\n\n Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset] | this[offset + 1] << 8;\n return val & 0x8000 ? val | 0xFFFF0000 : val;\n };\n\n Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length);\n var val = this[offset + 1] | this[offset] << 8;\n return val & 0x8000 ? val | 0xFFFF0000 : val;\n };\n\n Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;\n };\n\n Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];\n };\n\n Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, true, 23, 4);\n };\n\n Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length);\n return ieee754.read(this, offset, false, 23, 4);\n };\n\n Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, true, 52, 8);\n };\n\n Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length);\n return ieee754.read(this, offset, false, 52, 8);\n };\n\n function checkInt(buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance');\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds');\n if (offset + ext > buf.length) throw new RangeError('Index out of range');\n }\n\n Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var mul = 1;\n var i = 0;\n this[offset] = value & 0xFF;\n\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = value / mul & 0xFF;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n byteLength = byteLength | 0;\n\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1;\n checkInt(this, value, offset, byteLength, maxBytes, 0);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n this[offset + i] = value & 0xFF;\n\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = value / mul & 0xFF;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n this[offset] = value & 0xff;\n return offset + 1;\n };\n\n function objectWriteUInt16(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1;\n\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;\n }\n }\n\n Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n\n return offset + 2;\n };\n\n Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8;\n this[offset + 1] = value & 0xff;\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n\n return offset + 2;\n };\n\n function objectWriteUInt32(buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1;\n\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;\n }\n }\n\n Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = value >>> 24;\n this[offset + 2] = value >>> 16;\n this[offset + 1] = value >>> 8;\n this[offset] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n\n return offset + 4;\n };\n\n Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n\n return offset + 4;\n };\n\n Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = 0;\n var mul = 1;\n var sub = 0;\n this[offset] = value & 0xFF;\n\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {\n value = +value;\n offset = offset | 0;\n\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1);\n checkInt(this, value, offset, byteLength, limit - 1, -limit);\n }\n\n var i = byteLength - 1;\n var mul = 1;\n var sub = 0;\n this[offset + i] = value & 0xFF;\n\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1;\n }\n\n this[offset + i] = (value / mul >> 0) - sub & 0xFF;\n }\n\n return offset + byteLength;\n };\n\n Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);\n if (value < 0) value = 0xff + value + 1;\n this[offset] = value & 0xff;\n return offset + 1;\n };\n\n Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n } else {\n objectWriteUInt16(this, value, offset, true);\n }\n\n return offset + 2;\n };\n\n Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 8;\n this[offset + 1] = value & 0xff;\n } else {\n objectWriteUInt16(this, value, offset, false);\n }\n\n return offset + 2;\n };\n\n Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value & 0xff;\n this[offset + 1] = value >>> 8;\n this[offset + 2] = value >>> 16;\n this[offset + 3] = value >>> 24;\n } else {\n objectWriteUInt32(this, value, offset, true);\n }\n\n return offset + 4;\n };\n\n Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {\n value = +value;\n offset = offset | 0;\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);\n if (value < 0) value = 0xffffffff + value + 1;\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = value >>> 24;\n this[offset + 1] = value >>> 16;\n this[offset + 2] = value >>> 8;\n this[offset + 3] = value & 0xff;\n } else {\n objectWriteUInt32(this, value, offset, false);\n }\n\n return offset + 4;\n };\n\n function checkIEEE754(buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range');\n if (offset < 0) throw new RangeError('Index out of range');\n }\n\n function writeFloat(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 23, 4);\n return offset + 4;\n }\n\n Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert);\n };\n\n Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert);\n };\n\n function writeDouble(buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);\n }\n\n ieee754.write(buf, value, offset, littleEndian, 52, 8);\n return offset + 8;\n }\n\n Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert);\n };\n\n Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert);\n }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\n\n\n Buffer.prototype.copy = function copy(target, targetStart, start, end) {\n if (!start) start = 0;\n if (!end && end !== 0) end = this.length;\n if (targetStart >= target.length) targetStart = target.length;\n if (!targetStart) targetStart = 0;\n if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done\n\n if (end === start) return 0;\n if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions\n\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds');\n }\n\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');\n if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob?\n\n if (end > this.length) end = this.length;\n\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start;\n }\n\n var len = end - start;\n var i;\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start];\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start];\n }\n } else {\n Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);\n }\n\n return len;\n }; // Usage:\n // buffer.fill(number[, offset[, end]])\n // buffer.fill(buffer[, offset[, end]])\n // buffer.fill(string[, offset[, end]][, encoding])\n\n\n Buffer.prototype.fill = function fill(val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start;\n start = 0;\n end = this.length;\n } else if (typeof end === 'string') {\n encoding = end;\n end = this.length;\n }\n\n if (val.length === 1) {\n var code = val.charCodeAt(0);\n\n if (code < 256) {\n val = code;\n }\n }\n\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string');\n }\n\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding);\n }\n } else if (typeof val === 'number') {\n val = val & 255;\n } // Invalid ranges are not set to a default, so can range check early.\n\n\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index');\n }\n\n if (end <= start) {\n return this;\n }\n\n start = start >>> 0;\n end = end === undefined ? this.length : end >>> 0;\n if (!val) val = 0;\n var i;\n\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val;\n }\n } else {\n var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());\n var len = bytes.length;\n\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len];\n }\n }\n\n return this;\n }; // HELPER FUNCTIONS\n // ================\n\n\n var INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g;\n\n function base64clean(str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to ''\n\n if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n\n while (str.length % 4 !== 0) {\n str = str + '=';\n }\n\n return str;\n }\n\n function stringtrim(str) {\n if (str.trim) return str.trim();\n return str.replace(/^\\s+|\\s+$/g, '');\n }\n\n function toHex(n) {\n if (n < 16) return '0' + n.toString(16);\n return n.toString(16);\n }\n\n function utf8ToBytes(string, units) {\n units = units || Infinity;\n var codePoint;\n var length = string.length;\n var leadSurrogate = null;\n var bytes = [];\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i); // is surrogate component\n\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue;\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n continue;\n } // valid lead\n\n\n leadSurrogate = codePoint;\n continue;\n } // 2 leads in a row\n\n\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n leadSurrogate = codePoint;\n continue;\n } // valid surrogate pair\n\n\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);\n }\n\n leadSurrogate = null; // encode utf8\n\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break;\n bytes.push(codePoint);\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break;\n bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break;\n bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break;\n bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);\n } else {\n throw new Error('Invalid code point');\n }\n }\n\n return bytes;\n }\n\n function asciiToBytes(str) {\n var byteArray = [];\n\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF);\n }\n\n return byteArray;\n }\n\n function utf16leToBytes(str, units) {\n var c, hi, lo;\n var byteArray = [];\n\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break;\n c = str.charCodeAt(i);\n hi = c >> 8;\n lo = c % 256;\n byteArray.push(lo);\n byteArray.push(hi);\n }\n\n return byteArray;\n }\n\n function base64ToBytes(str) {\n return base64.toByteArray(base64clean(str));\n }\n\n function blitBuffer(src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if (i + offset >= dst.length || i >= src.length) break;\n dst[i + offset] = src[i];\n }\n\n return i;\n }\n\n function isnan(val) {\n return val !== val; // eslint-disable-line no-self-compare\n }\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../../../webpack/buildin/global.js */\n \"./node_modules/webpack/buildin/global.js\"));\n /***/\n },\n\n /***/\n \"./node_modules/node-libs-browser/node_modules/events/events.js\":\n /*!**********************************************************************!*\\\n !*** ./node_modules/node-libs-browser/node_modules/events/events.js ***!\n \\**********************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesNodeLibsBrowserNode_modulesEventsEventsJs(module, exports) {\n // Copyright Joyent, Inc. and other Node contributors.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a\n // copy of this software and associated documentation files (the\n // \"Software\"), to deal in the Software without restriction, including\n // without limitation the rights to use, copy, modify, merge, publish,\n // distribute, sublicense, and/or sell copies of the Software, and to permit\n // persons to whom the Software is furnished to do so, subject to the\n // following conditions:\n //\n // The above copyright notice and this permission notice shall be included\n // in all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\n function EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n }\n\n module.exports = EventEmitter; // Backwards-compat with node 0.10.x\n\n EventEmitter.EventEmitter = EventEmitter;\n EventEmitter.prototype._events = undefined;\n EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are\n // added to it. This is a useful default which helps finding memory leaks.\n\n EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows\n // that to be increased. Set to zero for unlimited.\n\n EventEmitter.prototype.setMaxListeners = function (n) {\n if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n };\n\n EventEmitter.prototype.emit = function (type) {\n var er, handler, len, args, i, listeners;\n if (!this._events) this._events = {}; // If there is no 'error' event listener then throw.\n\n if (type === 'error') {\n if (!this._events.error || isObject(this._events.error) && !this._events.error.length) {\n er = arguments[1];\n\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n if (isUndefined(handler)) return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n\n case 2:\n handler.call(this, arguments[1]);\n break;\n\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n\n for (i = 0; i < len; i++) {\n listeners[i].apply(this, args);\n }\n }\n\n return true;\n };\n\n EventEmitter.prototype.addListener = function (type, listener) {\n var m;\n if (!isFunction(listener)) throw TypeError('listener must be a function');\n if (!this._events) this._events = {}; // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n\n if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener);\n if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;else if (isObject(this._events[type])) // If we've already got an array, just append.\n this._events[type].push(listener);else // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener]; // Check for listener leak\n\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length);\n\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n };\n\n EventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\n EventEmitter.prototype.once = function (type, listener) {\n if (!isFunction(listener)) throw TypeError('listener must be a function');\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n return this;\n }; // emits a 'removeListener' event iff the listener was removed\n\n\n EventEmitter.prototype.removeListener = function (type, listener) {\n var list, position, length, i;\n if (!isFunction(listener)) throw TypeError('listener must be a function');\n if (!this._events || !this._events[type]) return this;\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener || isFunction(list.listener) && list.listener === listener) {\n delete this._events[type];\n if (this._events.removeListener) this.emit('removeListener', type, listener);\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener || list[i].listener && list[i].listener === listener) {\n position = i;\n break;\n }\n }\n\n if (position < 0) return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener) this.emit('removeListener', type, listener);\n }\n\n return this;\n };\n\n EventEmitter.prototype.removeAllListeners = function (type) {\n var key, listeners;\n if (!this._events) return this; // not listening for removeListener, no need to emit\n\n if (!this._events.removeListener) {\n if (arguments.length === 0) this._events = {};else if (this._events[type]) delete this._events[type];\n return this;\n } // emit removeListener for all listeners on all events\n\n\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length) {\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n }\n\n delete this._events[type];\n return this;\n };\n\n EventEmitter.prototype.listeners = function (type) {\n var ret;\n if (!this._events || !this._events[type]) ret = [];else if (isFunction(this._events[type])) ret = [this._events[type]];else ret = this._events[type].slice();\n return ret;\n };\n\n EventEmitter.prototype.listenerCount = function (type) {\n if (this._events) {\n var evlistener = this._events[type];\n if (isFunction(evlistener)) return 1;else if (evlistener) return evlistener.length;\n }\n\n return 0;\n };\n\n EventEmitter.listenerCount = function (emitter, type) {\n return emitter.listenerCount(type);\n };\n\n function isFunction(arg) {\n return typeof arg === 'function';\n }\n\n function isNumber(arg) {\n return typeof arg === 'number';\n }\n\n function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n }\n\n function isUndefined(arg) {\n return arg === void 0;\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/object-sizeof/byte_size.js\":\n /*!*************************************************!*\\\n !*** ./node_modules/object-sizeof/byte_size.js ***!\n \\*************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesObjectSizeofByte_sizeJs(module, exports) {\n /**\n * Byte sizes are taken from ECMAScript Language Specification\n * http://www.ecma-international.org/ecma-262/5.1/\n * http://bclary.com/2004/11/07/#a-4.3.16\n */\n module.exports = {\n STRING: 2,\n BOOLEAN: 4,\n NUMBER: 8\n };\n /***/\n },\n\n /***/\n \"./node_modules/object-sizeof/index.js\":\n /*!*********************************************!*\\\n !*** ./node_modules/object-sizeof/index.js ***!\n \\*********************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesObjectSizeofIndexJs(module, exports, __webpack_require__) {\n \"use strict\"; // Copyright 2014 Andrei Karpushonak\n\n var ECMA_SIZES = __webpack_require__(\n /*! ./byte_size */\n \"./node_modules/object-sizeof/byte_size.js\");\n\n var Buffer = __webpack_require__(\n /*! buffer */\n \"./node_modules/node-libs-browser/node_modules/buffer/index.js\").Buffer;\n /**\n * Main module's entry point\n * Calculates Bytes for the provided parameter\n * @param object - handles object/string/boolean/buffer\n * @returns {*}\n */\n\n\n function sizeof(object) {\n if (object !== null && typeof object === 'object') {\n if (Buffer.isBuffer(object)) {\n return object.length;\n } else {\n var bytes = 0;\n\n for (var key in object) {\n if (!Object.hasOwnProperty.call(object, key)) {\n continue;\n }\n\n bytes += sizeof(key);\n\n try {\n bytes += sizeof(object[key]);\n } catch (ex) {\n if (ex instanceof RangeError) {\n // circular reference detected, final result might be incorrect\n // let's be nice and not throw an exception\n bytes = 0;\n }\n }\n }\n\n return bytes;\n }\n } else if (typeof object === 'string') {\n return object.length * ECMA_SIZES.STRING;\n } else if (typeof object === 'boolean') {\n return ECMA_SIZES.BOOLEAN;\n } else if (typeof object === 'number') {\n return ECMA_SIZES.NUMBER;\n } else {\n return 0;\n }\n }\n\n module.exports = sizeof;\n /***/\n },\n\n /***/\n \"./node_modules/parseqs/index.js\":\n /*!***************************************!*\\\n !*** ./node_modules/parseqs/index.js ***!\n \\***************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesParseqsIndexJs(module, exports) {\n /**\r\n * Compiles a querystring\r\n * Returns string representation of the object\r\n *\r\n * @param {Object}\r\n * @api private\r\n */\n exports.encode = function (obj) {\n var str = '';\n\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length) str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n\n return str;\n };\n /**\r\n * Parses a simple querystring into an object\r\n *\r\n * @param {String} qs\r\n * @api private\r\n */\n\n\n exports.decode = function (qs) {\n var qry = {};\n var pairs = qs.split('&');\n\n for (var i = 0, l = pairs.length; i < l; i++) {\n var pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n\n return qry;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/parseuri/index.js\":\n /*!****************************************!*\\\n !*** ./node_modules/parseuri/index.js ***!\n \\****************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesParseuriIndexJs(module, exports) {\n /**\r\n * Parses an URI\r\n *\r\n * @author Steven Levithan (MIT license)\r\n * @api private\r\n */\n var re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\n var parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'];\n\n module.exports = function parseuri(str) {\n var src = str,\n b = str.indexOf('['),\n e = str.indexOf(']');\n\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n\n var m = re.exec(str || ''),\n uri = {},\n i = 14;\n\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n\n return uri;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/process/browser.js\":\n /*!*****************************************!*\\\n !*** ./node_modules/process/browser.js ***!\n \\*****************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesProcessBrowserJs(module, exports) {\n // shim for using process in browser\n var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it\n // don't break things. But we need to wrap it in a try catch in case it is\n // wrapped in strict mode code which doesn't define any globals. It's inside a\n // function because try/catches deoptimize in certain engines.\n\n var cachedSetTimeout;\n var cachedClearTimeout;\n\n function defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n }\n\n function defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n }\n\n (function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n })();\n\n function runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n } // if setTimeout wasn't available but was latter defined\n\n\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // 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\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n }\n\n function runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n } // if clearTimeout wasn't available but was latter defined\n\n\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // 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.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n }\n\n var queue = [];\n var draining = false;\n var currentQueue;\n var queueIndex = -1;\n\n function cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n\n draining = false;\n\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n\n if (queue.length) {\n drainQueue();\n }\n }\n\n function drainQueue() {\n if (draining) {\n return;\n }\n\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n var len = queue.length;\n\n while (len) {\n currentQueue = queue;\n queue = [];\n\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n\n queueIndex = -1;\n len = queue.length;\n }\n\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n }\n\n process.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n\n queue.push(new Item(fun, args));\n\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n }; // v8 likes predictible objects\n\n\n function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n }\n\n Item.prototype.run = function () {\n this.fun.apply(null, this.array);\n };\n\n process.title = 'browser';\n process.browser = true;\n process.env = {};\n process.argv = [];\n process.version = ''; // empty string to avoid regexp issues\n\n process.versions = {};\n\n function noop() {}\n\n process.on = noop;\n process.addListener = noop;\n process.once = noop;\n process.off = noop;\n process.removeListener = noop;\n process.removeAllListeners = noop;\n process.emit = noop;\n process.prependListener = noop;\n process.prependOnceListener = noop;\n\n process.listeners = function (name) {\n return [];\n };\n\n process.binding = function (name) {\n throw new Error('process.binding is not supported');\n };\n\n process.cwd = function () {\n return '/';\n };\n\n process.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n };\n\n process.umask = function () {\n return 0;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/query-string/index.js\":\n /*!********************************************!*\\\n !*** ./node_modules/query-string/index.js ***!\n \\********************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesQueryStringIndexJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n var strictUriEncode = __webpack_require__(\n /*! strict-uri-encode */\n \"./node_modules/strict-uri-encode/index.js\");\n\n var decodeComponent = __webpack_require__(\n /*! decode-uri-component */\n \"./node_modules/decode-uri-component/index.js\");\n\n function encoderForArrayFormat(options) {\n switch (options.arrayFormat) {\n case 'index':\n return function (key) {\n return function (result, value) {\n var index = result.length;\n\n if (value === undefined) {\n return result;\n }\n\n if (value === null) {\n return [].concat(_toConsumableArray(result), [[encode(key, options), '[', index, ']'].join('')]);\n }\n\n return [].concat(_toConsumableArray(result), [[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')]);\n };\n };\n\n case 'bracket':\n return function (key) {\n return function (result, value) {\n if (value === undefined) {\n return result;\n }\n\n if (value === null) {\n return [].concat(_toConsumableArray(result), [[encode(key, options), '[]'].join('')]);\n }\n\n return [].concat(_toConsumableArray(result), [[encode(key, options), '[]=', encode(value, options)].join('')]);\n };\n };\n\n case 'comma':\n return function (key) {\n return function (result, value, index) {\n if (!value) {\n return result;\n }\n\n if (index === 0) {\n return [[encode(key, options), '=', encode(value, options)].join('')];\n }\n\n return [[result, encode(value, options)].join(',')];\n };\n };\n\n default:\n return function (key) {\n return function (result, value) {\n if (value === undefined) {\n return result;\n }\n\n if (value === null) {\n return [].concat(_toConsumableArray(result), [encode(key, options)]);\n }\n\n return [].concat(_toConsumableArray(result), [[encode(key, options), '=', encode(value, options)].join('')]);\n };\n };\n }\n }\n\n function parserForArrayFormat(options) {\n var result;\n\n switch (options.arrayFormat) {\n case 'index':\n return function (key, value, accumulator) {\n result = /\\[(\\d*)\\]$/.exec(key);\n key = key.replace(/\\[\\d*\\]$/, '');\n\n if (!result) {\n accumulator[key] = value;\n return;\n }\n\n if (accumulator[key] === undefined) {\n accumulator[key] = {};\n }\n\n accumulator[key][result[1]] = value;\n };\n\n case 'bracket':\n return function (key, value, accumulator) {\n result = /(\\[\\])$/.exec(key);\n key = key.replace(/\\[\\]$/, '');\n\n if (!result) {\n accumulator[key] = value;\n return;\n }\n\n if (accumulator[key] === undefined) {\n accumulator[key] = [value];\n return;\n }\n\n accumulator[key] = [].concat(accumulator[key], value);\n };\n\n case 'comma':\n return function (key, value, accumulator) {\n var isArray = typeof value === 'string' && value.split('').indexOf(',') > -1;\n var newValue = isArray ? value.split(',') : value;\n accumulator[key] = newValue;\n };\n\n default:\n return function (key, value, accumulator) {\n if (accumulator[key] === undefined) {\n accumulator[key] = value;\n return;\n }\n\n accumulator[key] = [].concat(accumulator[key], value);\n };\n }\n }\n\n function encode(value, options) {\n if (options.encode) {\n return options.strict ? strictUriEncode(value) : encodeURIComponent(value);\n }\n\n return value;\n }\n\n function decode(value, options) {\n if (options.decode) {\n return decodeComponent(value);\n }\n\n return value;\n }\n\n function keysSorter(input) {\n if (Array.isArray(input)) {\n return input.sort();\n }\n\n if (typeof input === 'object') {\n return keysSorter(Object.keys(input)).sort(function (a, b) {\n return Number(a) - Number(b);\n }).map(function (key) {\n return input[key];\n });\n }\n\n return input;\n }\n\n function extract(input) {\n var queryStart = input.indexOf('?');\n\n if (queryStart === -1) {\n return '';\n }\n\n return input.slice(queryStart + 1);\n }\n\n function parse(input, options) {\n options = Object.assign({\n decode: true,\n arrayFormat: 'none'\n }, options);\n var formatter = parserForArrayFormat(options); // Create an object with no prototype\n\n var ret = Object.create(null);\n\n if (typeof input !== 'string') {\n return ret;\n }\n\n input = input.trim().replace(/^[?#&]/, '');\n\n if (!input) {\n return ret;\n }\n\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = input.split('&')[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var param = _step.value;\n\n var _param$replace$split = param.replace(/\\+/g, ' ').split('='),\n _param$replace$split2 = _slicedToArray(_param$replace$split, 2),\n key = _param$replace$split2[0],\n value = _param$replace$split2[1]; // Missing `=` should be `null`:\n // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n\n\n value = value === undefined ? null : decode(value, options);\n formatter(decode(key, options), value, ret);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return Object.keys(ret).sort().reduce(function (result, key) {\n var value = ret[key];\n\n if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {\n // Sort object keys, not values\n result[key] = keysSorter(value);\n } else {\n result[key] = value;\n }\n\n return result;\n }, Object.create(null));\n }\n\n exports.extract = extract;\n exports.parse = parse;\n\n exports.stringify = function (object, options) {\n if (!object) {\n return '';\n }\n\n options = Object.assign({\n encode: true,\n strict: true,\n arrayFormat: 'none'\n }, options);\n var formatter = encoderForArrayFormat(options);\n var keys = Object.keys(object);\n\n if (options.sort !== false) {\n keys.sort(options.sort);\n }\n\n return keys.map(function (key) {\n var value = object[key];\n\n if (value === undefined) {\n return '';\n }\n\n if (value === null) {\n return encode(key, options);\n }\n\n if (Array.isArray(value)) {\n return value.reduce(formatter(key), []).join('&');\n }\n\n return encode(key, options) + '=' + encode(value, options);\n }).filter(function (x) {\n return x.length > 0;\n }).join('&');\n };\n\n exports.parseUrl = function (input, options) {\n var hashStart = input.indexOf('#');\n\n if (hashStart !== -1) {\n input = input.slice(0, hashStart);\n }\n\n return {\n url: input.split('?')[0] || '',\n query: parse(extract(input), options)\n };\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/sdp-interop/lib/array-equals.js\":\n /*!******************************************************!*\\\n !*** ./node_modules/sdp-interop/lib/array-equals.js ***!\n \\******************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpInteropLibArrayEqualsJs(module, exports) {\n /* Copyright @ 2015 Atlassian Pty Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n module.exports = function arrayEquals(array) {\n // if the other array is a falsy value, return\n if (!array) return false; // compare lengths - can save a lot of time\n\n if (this.length != array.length) return false;\n\n for (var i = 0, l = this.length; i < l; i++) {\n // Check if we have nested arrays\n if (this[i] instanceof Array && array[i] instanceof Array) {\n // recurse into the nested arrays\n if (!arrayEquals.apply(this[i], [array[i]])) return false;\n } else if (this[i] != array[i]) {\n // Warning - two different object instances will never be equal:\n // {x:20} != {x:20}\n return false;\n }\n }\n\n return true;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/sdp-interop/lib/index.js\":\n /*!***********************************************!*\\\n !*** ./node_modules/sdp-interop/lib/index.js ***!\n \\***********************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpInteropLibIndexJs(module, exports, __webpack_require__) {\n /* Copyright @ 2015 Atlassian Pty Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n exports.Interop = __webpack_require__(\n /*! ./interop */\n \"./node_modules/sdp-interop/lib/interop.js\");\n /***/\n },\n\n /***/\n \"./node_modules/sdp-interop/lib/interop.js\":\n /*!*************************************************!*\\\n !*** ./node_modules/sdp-interop/lib/interop.js ***!\n \\*************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpInteropLibInteropJs(module, exports, __webpack_require__) {\n \"use strict\";\n /* Copyright @ 2015 Atlassian Pty Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n /* global RTCSessionDescription */\n\n /* global RTCIceCandidate */\n\n /* jshint -W097 */\n\n var transform = __webpack_require__(\n /*! ./transform */\n \"./node_modules/sdp-interop/lib/transform.js\");\n\n var arrayEquals = __webpack_require__(\n /*! ./array-equals */\n \"./node_modules/sdp-interop/lib/array-equals.js\");\n\n function Interop() {\n /**\n * This map holds the most recent Unified Plan offer/answer SDP that was\n * converted to Plan B, with the SDP type ('offer' or 'answer') as keys and\n * the SDP string as values.\n *\n * @type {{}}\n */\n this.cache = {\n mlB2UMap: {},\n mlU2BMap: {}\n };\n }\n\n module.exports = Interop;\n /**\n * Changes the candidate args to match with the related Unified Plan\n */\n\n Interop.prototype.candidateToUnifiedPlan = function (candidate) {\n var cand = new RTCIceCandidate(candidate);\n cand.sdpMLineIndex = this.cache.mlB2UMap[cand.sdpMLineIndex];\n /* TODO: change sdpMid to (audio|video)-SSRC */\n\n return cand;\n };\n /**\n * Changes the candidate args to match with the related Plan B\n */\n\n\n Interop.prototype.candidateToPlanB = function (candidate) {\n var cand = new RTCIceCandidate(candidate);\n\n if (cand.sdpMid.indexOf('audio') === 0) {\n cand.sdpMid = 'audio';\n } else if (cand.sdpMid.indexOf('video') === 0) {\n cand.sdpMid = 'video';\n } else {\n throw new Error('candidate with ' + cand.sdpMid + ' not allowed');\n }\n\n cand.sdpMLineIndex = this.cache.mlU2BMap[cand.sdpMLineIndex];\n return cand;\n };\n /**\n * Returns the index of the first m-line with the given media type and with a\n * direction which allows sending, in the last Unified Plan description with\n * type \"answer\" converted to Plan B. Returns {null} if there is no saved\n * answer, or if none of its m-lines with the given type allow sending.\n * @param type the media type (\"audio\" or \"video\").\n * @returns {*}\n */\n\n\n Interop.prototype.getFirstSendingIndexFromAnswer = function (type) {\n if (!this.cache.answer) {\n return null;\n }\n\n var session = transform.parse(this.cache.answer);\n\n if (session && session.media && Array.isArray(session.media)) {\n for (var i = 0; i < session.media.length; i++) {\n if (session.media[i].type == type && (!session.media[i].direction\n /* default to sendrecv */\n || session.media[i].direction === 'sendrecv' || session.media[i].direction === 'sendonly')) {\n return i;\n }\n }\n }\n\n return null;\n };\n /**\n * This method transforms a Unified Plan SDP to an equivalent Plan B SDP. A\n * PeerConnection wrapper transforms the SDP to Plan B before passing it to the\n * application.\n *\n * @param desc\n * @returns {*}\n */\n\n\n Interop.prototype.toPlanB = function (desc) {\n var self = this; //#region Preliminary input validation.\n\n if (typeof desc !== 'object' || desc === null || typeof desc.sdp !== 'string') {\n console.warn('An empty description was passed as an argument.');\n return desc;\n } // Objectify the SDP for easier manipulation.\n\n\n var session = transform.parse(desc.sdp); // If the SDP contains no media, there's nothing to transform.\n\n if (typeof session.media === 'undefined' || !Array.isArray(session.media) || session.media.length === 0) {\n console.warn('The description has no media.');\n return desc;\n } // Try some heuristics to \"make sure\" this is a Unified Plan SDP. Plan B\n // SDP has a video, an audio and a data \"channel\" at most.\n\n\n if (session.media.length <= 3 && session.media.every(function (m) {\n return ['video', 'audio', 'data'].indexOf(m.mid) !== -1;\n })) {\n console.warn('This description does not look like Unified Plan.');\n return desc;\n } //#endregion\n // HACK https://bugzilla.mozilla.org/show_bug.cgi?id=1113443\n\n\n var sdp = desc.sdp;\n var rewrite = false;\n\n for (var i = 0; i < session.media.length; i++) {\n var uLine = session.media[i];\n uLine.rtp.forEach(function (rtp) {\n if (rtp.codec === 'NULL') {\n rewrite = true;\n var offer = transform.parse(self.cache.offer);\n rtp.codec = offer.media[i].rtp[0].codec;\n }\n });\n }\n\n if (rewrite) {\n sdp = transform.write(session);\n } // Unified Plan SDP is our \"precious\". Cache it for later use in the Plan B\n // -> Unified Plan transformation.\n\n\n this.cache[desc.type] = sdp; //#region Convert from Unified Plan to Plan B.\n // We rebuild the session.media array.\n\n var media = session.media;\n session.media = []; // Associative array that maps channel types to channel objects for fast\n // access to channel objects by their type, e.g. type2bl['audio']->channel\n // obj.\n\n var type2bl = {}; // Used to build the group:BUNDLE value after the channels construction\n // loop.\n\n var types = []; // Used to aggregate the directions of the m-lines.\n\n var directionResult = {};\n media.forEach(function (uLine) {\n // rtcp-mux is required in the Plan B SDP.\n if ((typeof uLine.rtcpMux !== 'string' || uLine.rtcpMux !== 'rtcp-mux') && uLine.direction !== 'inactive') {\n throw new Error('Cannot convert to Plan B because m-lines ' + 'without the rtcp-mux attribute were found.');\n } // If we don't have a channel for this uLine.type OR the selected is\n // inactive, then select this uLine as the channel basis.\n\n\n if (typeof type2bl[uLine.type] === 'undefined' || type2bl[uLine.type].direction === 'inactive') {\n type2bl[uLine.type] = uLine;\n }\n }); // Implode the Unified Plan m-lines/tracks into Plan B channels.\n\n media.forEach(function (uLine) {\n var type = uLine.type;\n\n if (type === 'application') {\n session.media.push(uLine);\n types.push(uLine.mid);\n return;\n } // Add sources to the channel and handle a=msid.\n\n\n if (typeof uLine.sources === 'object') {\n Object.keys(uLine.sources).forEach(function (ssrc) {\n if (typeof type2bl[type].sources !== 'object') type2bl[type].sources = {}; // Assign the sources to the channel.\n\n type2bl[type].sources[ssrc] = uLine.sources[ssrc];\n\n if (typeof uLine.msid !== 'undefined') {\n // In Plan B the msid is an SSRC attribute. Also, we don't\n // care about the obsolete label and mslabel attributes.\n //\n // Note that it is not guaranteed that the uLine will\n // have an msid. recvonly channels in particular don't have\n // one.\n type2bl[type].sources[ssrc].msid = uLine.msid;\n } // NOTE ssrcs in ssrc groups will share msids, as\n // draft-uberti-rtcweb-plan-00 mandates.\n\n });\n } // Add ssrc groups to the channel.\n\n\n if (typeof uLine.ssrcGroups !== 'undefined' && Array.isArray(uLine.ssrcGroups)) {\n // Create the ssrcGroups array, if it's not defined.\n if (typeof type2bl[type].ssrcGroups === 'undefined' || !Array.isArray(type2bl[type].ssrcGroups)) {\n type2bl[type].ssrcGroups = [];\n }\n\n type2bl[type].ssrcGroups = type2bl[type].ssrcGroups.concat(uLine.ssrcGroups);\n }\n\n var direction = uLine.direction;\n directionResult[type] = (directionResult[type] || 0\n /* inactive */\n ) | directionMasks[direction || 'inactive'];\n\n if (type2bl[type] === uLine) {\n // Plan B mids are in ['audio', 'video', 'data']\n uLine.mid = type; // Plan B doesn't support/need the bundle-only attribute.\n\n delete uLine.bundleOnly; // In Plan B the msid is an SSRC attribute.\n\n delete uLine.msid;\n\n if (direction !== 'inactive') {\n // Used to build the group:BUNDLE value after this loop.\n types.push(type);\n } // Add the channel to the new media array.\n\n\n session.media.push(uLine);\n }\n }); // We regenerate the BUNDLE group with the new mids.\n\n session.groups.some(function (group) {\n if (group.type === 'BUNDLE') {\n group.mids = types.join(' ');\n return true;\n }\n }); // msid semantic\n\n session.msidSemantic = {\n semantic: 'WMS',\n token: '*'\n };\n var resStr = transform.write(session);\n return new RTCSessionDescription({\n type: desc.type,\n sdp: resStr\n }); //#endregion\n };\n /**\n * This method transforms a Plan B SDP to an equivalent Unified Plan SDP. A\n * PeerConnection wrapper transforms the SDP to Unified Plan before passing it\n * to FF.\n *\n * @param desc\n * @returns {*}\n */\n\n\n Interop.prototype.toUnifiedPlan = function (desc) {\n var self = this; //#region Preliminary input validation.\n\n if (typeof desc !== 'object' || desc === null || typeof desc.sdp !== 'string') {\n console.warn('An empty description was passed as an argument.');\n return desc;\n }\n\n var session = transform.parse(desc.sdp); // If the SDP contains no media, there's nothing to transform.\n\n if (typeof session.media === 'undefined' || !Array.isArray(session.media) || session.media.length === 0) {\n console.warn('The description has no media.');\n return desc;\n } // Try some heuristics to \"make sure\" this is a Plan B SDP. Plan B SDP has\n // a video, an audio and a data \"channel\" at most.\n\n\n if (session.media.length > 3 || !session.media.every(function (m) {\n return ['video', 'audio', 'data'].indexOf(m.mid) !== -1;\n })) {\n console.warn('This description does not look like Plan B.');\n return desc;\n } // Make sure this Plan B SDP can be converted to a Unified Plan SDP.\n\n\n var mids = [];\n session.media.forEach(function (m) {\n mids.push(m.mid);\n });\n var hasBundle = false;\n\n if (typeof session.groups !== 'undefined' && Array.isArray(session.groups)) {\n hasBundle = session.groups.every(function (g) {\n return g.type !== 'BUNDLE' || arrayEquals.apply(g.mids.sort(), [mids.sort()]);\n });\n }\n\n if (!hasBundle) {\n throw new Error(\"Cannot convert to Unified Plan because m-lines that\" + \" are not bundled were found.\");\n } //#endregion\n //#region Convert from Plan B to Unified Plan.\n // Unfortunately, a Plan B offer/answer doesn't have enough information to\n // rebuild an equivalent Unified Plan offer/answer.\n //\n // For example, if this is a local answer (in Unified Plan style) that we\n // convert to Plan B prior to handing it over to the application (the\n // PeerConnection wrapper called us, for instance, after a successful\n // createAnswer), we want to remember the m-line at which we've seen the\n // (local) SSRC. That's because when the application wants to do call the\n // SLD method, forcing us to do the inverse transformation (from Plan B to\n // Unified Plan), we need to know to which m-line to assign the (local)\n // SSRC. We also need to know all the other m-lines that the original\n // answer had and include them in the transformed answer as well.\n //\n // Another example is if this is a remote offer that we convert to Plan B\n // prior to giving it to the application, we want to remember the mid at\n // which we've seen the (remote) SSRC.\n //\n // In the iteration that follows, we use the cached Unified Plan (if it\n // exists) to assign mids to ssrcs.\n\n\n var cached;\n\n if (typeof this.cache[desc.type] !== 'undefined') {\n cached = transform.parse(this.cache[desc.type]);\n }\n\n var recvonlySsrcs = {\n audio: {},\n video: {}\n }; // A helper map that sends mids to m-line objects. We use it later to\n // rebuild the Unified Plan style session.media array.\n\n var mid2ul = {};\n var bIdx = 0;\n var uIdx = 0;\n session.media.forEach(function (bLine) {\n if ((typeof bLine.rtcpMux !== 'string' || bLine.rtcpMux !== 'rtcp-mux') && bLine.direction !== 'inactive') {\n throw new Error(\"Cannot convert to Unified Plan because m-lines \" + \"without the rtcp-mux attribute were found.\");\n }\n\n if (bLine.type === 'application') {\n mid2ul[bLine.mid] = bLine;\n return;\n } // With rtcp-mux and bundle all the channels should have the same ICE\n // stuff.\n\n\n var sources = bLine.sources;\n var ssrcGroups = bLine.ssrcGroups;\n var candidates = bLine.candidates;\n var iceUfrag = bLine.iceUfrag;\n var icePwd = bLine.icePwd;\n var fingerprint = bLine.fingerprint;\n var port = bLine.port; // We'll use the \"bLine\" object as a prototype for each new \"mLine\"\n // that we create, but first we need to clean it up a bit.\n\n delete bLine.sources;\n delete bLine.ssrcGroups;\n delete bLine.candidates;\n delete bLine.iceUfrag;\n delete bLine.icePwd;\n delete bLine.fingerprint;\n delete bLine.port;\n delete bLine.mid; // inverted ssrc group map\n\n var ssrc2group = {};\n\n if (typeof ssrcGroups !== 'undefined' && Array.isArray(ssrcGroups)) {\n ssrcGroups.forEach(function (ssrcGroup) {\n // TODO(gp) find out how to receive simulcast with FF. For the\n // time being, hide it.\n if (ssrcGroup.semantics === 'SIM') {\n return;\n } // XXX This might brake if an SSRC is in more than one group\n // for some reason.\n\n\n if (typeof ssrcGroup.ssrcs !== 'undefined' && Array.isArray(ssrcGroup.ssrcs)) {\n ssrcGroup.ssrcs.forEach(function (ssrc) {\n if (typeof ssrc2group[ssrc] === 'undefined') {\n ssrc2group[ssrc] = [];\n }\n\n ssrc2group[ssrc].push(ssrcGroup);\n });\n }\n });\n } // ssrc to m-line index.\n\n\n var ssrc2ml = {};\n\n if (typeof sources === 'object') {\n // Explode the Plan B channel sources with one m-line per source.\n Object.keys(sources).forEach(function (ssrc) {\n // The (unified) m-line for this SSRC. We either create it from\n // scratch or, if it's a grouped SSRC, we re-use a related\n // mline. In other words, if the source is grouped with another\n // source, put the two together in the same m-line.\n var uLine; // We assume here that we are the answerer in the O/A, so any\n // offers which we translate come from the remote side, while\n // answers are local. So the check below is to make that we\n // handle receive-only SSRCs in a special way only if they come\n // from the remote side.\n\n if (desc.type === 'offer') {\n // We want to detect SSRCs which are used by a remote peer\n // in an m-line with direction=recvonly (i.e. they are\n // being used for RTCP only).\n // This information would have gotten lost if the remote\n // peer used Unified Plan and their local description was\n // translated to Plan B. So we use the lack of an MSID\n // attribute to deduce a \"receive only\" SSRC.\n if (!sources[ssrc].msid) {\n recvonlySsrcs[bLine.type][ssrc] = sources[ssrc]; // Receive-only SSRCs must not create new m-lines. We\n // will assign them to an existing m-line later.\n\n return;\n }\n }\n\n if (typeof ssrc2group[ssrc] !== 'undefined' && Array.isArray(ssrc2group[ssrc])) {\n ssrc2group[ssrc].some(function (ssrcGroup) {\n // ssrcGroup.ssrcs *is* an Array, no need to check\n // again here.\n return ssrcGroup.ssrcs.some(function (related) {\n if (typeof ssrc2ml[related] === 'object') {\n uLine = ssrc2ml[related];\n return true;\n }\n });\n });\n }\n\n if (typeof uLine === 'object') {\n // the m-line already exists. Just add the source.\n uLine.sources[ssrc] = sources[ssrc];\n delete sources[ssrc].msid;\n } else {\n // Use the \"bLine\" as a prototype for the \"uLine\".\n uLine = Object.create(bLine);\n ssrc2ml[ssrc] = uLine;\n\n if (typeof sources[ssrc].msid !== 'undefined') {\n // Assign the msid of the source to the m-line. Note\n // that it is not guaranteed that the source will have\n // msid. In particular \"recvonly\" sources don't have an\n // msid. Note that \"recvonly\" is a term only defined\n // for m-lines.\n uLine.msid = sources[ssrc].msid;\n delete sources[ssrc].msid;\n } // We assign one SSRC per media line.\n\n\n uLine.sources = {};\n uLine.sources[ssrc] = sources[ssrc];\n uLine.ssrcGroups = ssrc2group[ssrc]; // Use the cached Unified Plan SDP (if it exists) to assign\n // SSRCs to mids.\n\n if (typeof cached !== 'undefined' && typeof cached.media !== 'undefined' && Array.isArray(cached.media)) {\n cached.media.forEach(function (m) {\n if (typeof m.sources === 'object') {\n Object.keys(m.sources).forEach(function (s) {\n if (s === ssrc) {\n uLine.mid = m.mid;\n }\n });\n }\n });\n }\n\n if (typeof uLine.mid === 'undefined') {\n // If this is an SSRC that we see for the first time\n // assign it a new mid. This is typically the case when\n // this method is called to transform a remote\n // description for the first time or when there is a\n // new SSRC in the remote description because a new\n // peer has joined the conference. Local SSRCs should\n // have already been added to the map in the toPlanB\n // method.\n //\n // Because FF generates answers in Unified Plan style,\n // we MUST already have a cached answer with all the\n // local SSRCs mapped to some m-line/mid.\n if (desc.type === 'answer') {\n throw new Error(\"An unmapped SSRC was found.\");\n }\n\n uLine.mid = [bLine.type, '-', ssrc].join('');\n } // Include the candidates in the 1st media line.\n\n\n uLine.candidates = candidates;\n uLine.iceUfrag = iceUfrag;\n uLine.icePwd = icePwd;\n uLine.fingerprint = fingerprint;\n uLine.port = port;\n mid2ul[uLine.mid] = uLine;\n self.cache.mlU2BMap[uIdx] = bIdx;\n\n if (typeof self.cache.mlB2UMap[bIdx] === 'undefined') {\n self.cache.mlB2UMap[bIdx] = uIdx;\n }\n\n uIdx++;\n }\n });\n }\n\n bIdx++;\n }); // Rebuild the media array in the right order and add the missing mLines\n // (missing from the Plan B SDP).\n\n session.media = [];\n mids = []; // reuse\n\n if (desc.type === 'answer') {\n // The media lines in the answer must match the media lines in the\n // offer. The order is important too. Here we assume that Firefox is\n // the answerer, so we merely have to use the reconstructed (unified)\n // answer to update the cached (unified) answer accordingly.\n //\n // In the general case, one would have to use the cached (unified)\n // offer to find the m-lines that are missing from the reconstructed\n // answer, potentially grabbing them from the cached (unified) answer.\n // One has to be careful with this approach because inactive m-lines do\n // not always have an mid, making it tricky (impossible?) to find where\n // exactly and which m-lines are missing from the reconstructed answer.\n for (var i = 0; i < cached.media.length; i++) {\n var uLine = cached.media[i];\n\n if (typeof mid2ul[uLine.mid] === 'undefined') {\n // The mid isn't in the reconstructed (unified) answer.\n // This is either a (unified) m-line containing a remote\n // track only, or a (unified) m-line containing a remote\n // track and a local track that has been removed.\n // In either case, it MUST exist in the cached\n // (unified) answer.\n //\n // In case this is a removed local track, clean-up\n // the (unified) m-line and make sure it's 'recvonly' or\n // 'inactive'.\n delete uLine.msid;\n delete uLine.sources;\n delete uLine.ssrcGroups;\n if (!uLine.direction || uLine.direction === 'sendrecv') uLine.direction = 'recvonly';else if (uLine.direction === 'sendonly') uLine.direction = 'inactive';\n } else {// This is an (unified) m-line/channel that contains a local\n // track (sendrecv or sendonly channel) or it's a unified\n // recvonly m-line/channel. In either case, since we're\n // going from PlanB -> Unified Plan this m-line MUST\n // exist in the cached answer.\n }\n\n session.media.push(uLine);\n\n if (typeof uLine.mid === 'string') {\n // inactive lines don't/may not have an mid.\n mids.push(uLine.mid);\n }\n }\n } else {\n // SDP offer/answer (and the JSEP spec) forbids removing an m-section\n // under any circumstances. If we are no longer interested in sending a\n // track, we just remove the msid and ssrc attributes and set it to\n // either a=recvonly (as the reofferer, we must use recvonly if the\n // other side was previously sending on the m-section, but we can also\n // leave the possibility open if it wasn't previously in use), or\n // a=inactive.\n if (typeof cached !== 'undefined' && typeof cached.media !== 'undefined' && Array.isArray(cached.media)) {\n cached.media.forEach(function (uLine) {\n mids.push(uLine.mid);\n\n if (typeof mid2ul[uLine.mid] !== 'undefined') {\n session.media.push(mid2ul[uLine.mid]);\n } else {\n delete uLine.msid;\n delete uLine.sources;\n delete uLine.ssrcGroups;\n if (!uLine.direction || uLine.direction === 'sendrecv') uLine.direction = 'recvonly';\n if (!uLine.direction || uLine.direction === 'sendonly') uLine.direction = 'inactive';\n session.media.push(uLine);\n }\n });\n } // Add all the remaining (new) m-lines of the transformed SDP.\n\n\n Object.keys(mid2ul).forEach(function (mid) {\n if (mids.indexOf(mid) === -1) {\n mids.push(mid);\n\n if (mid2ul[mid].direction === 'recvonly') {\n // This is a remote recvonly channel. Add its SSRC to the\n // appropriate sendrecv or sendonly channel.\n // TODO(gp) what if we don't have sendrecv/sendonly\n // channel?\n session.media.some(function (uLine) {\n if ((uLine.direction === 'sendrecv' || uLine.direction === 'sendonly') && uLine.type === mid2ul[mid].type) {\n // mid2ul[mid] shouldn't have any ssrc-groups\n Object.keys(mid2ul[mid].sources).forEach(function (ssrc) {\n uLine.sources[ssrc] = mid2ul[mid].sources[ssrc];\n });\n return true;\n }\n });\n } else {\n session.media.push(mid2ul[mid]);\n }\n }\n });\n } // After we have constructed the Plan Unified m-lines we can figure out\n // where (in which m-line) to place the 'recvonly SSRCs'.\n // Note: we assume here that we are the answerer in the O/A, so any offers\n // which we translate come from the remote side, while answers are local\n // (and so our last local description is cached as an 'answer').\n\n\n [\"audio\", \"video\"].forEach(function (type) {\n if (!session || !session.media || !Array.isArray(session.media)) return;\n var idx = null;\n\n if (Object.keys(recvonlySsrcs[type]).length > 0) {\n idx = self.getFirstSendingIndexFromAnswer(type);\n\n if (idx === null) {\n // If this is the first offer we receive, we don't have a\n // cached answer. Assume that we will be sending media using\n // the first m-line for each media type.\n for (var i = 0; i < session.media.length; i++) {\n if (session.media[i].type === type) {\n idx = i;\n break;\n }\n }\n }\n }\n\n if (idx && session.media.length > idx) {\n var mLine = session.media[idx];\n Object.keys(recvonlySsrcs[type]).forEach(function (ssrc) {\n if (mLine.sources && mLine.sources[ssrc]) {\n console.warn(\"Replacing an existing SSRC.\");\n }\n\n if (!mLine.sources) {\n mLine.sources = {};\n }\n\n mLine.sources[ssrc] = recvonlySsrcs[type][ssrc];\n });\n }\n }); // We regenerate the BUNDLE group (since we regenerated the mids)\n\n session.groups.some(function (group) {\n if (group.type === 'BUNDLE') {\n group.mids = mids.join(' ');\n return true;\n }\n }); // msid semantic\n\n session.msidSemantic = {\n semantic: 'WMS',\n token: '*'\n };\n var resStr = transform.write(session); // Cache the transformed SDP (Unified Plan) for later re-use in this\n // function.\n\n this.cache[desc.type] = resStr;\n return new RTCSessionDescription({\n type: desc.type,\n sdp: resStr\n }); //#endregion\n };\n /**\n * Maps the direction strings to their binary representation. The binary\n * representation of the directions will contain only 2 bits. The least\n * significant bit will indicate the receiving direction and the other bit will\n * indicate the sending direction.\n *\n * @type {Map}\n */\n\n\n var directionMasks = {\n 'inactive': 0,\n // 00\n 'recvonly': 1,\n // 01\n 'sendonly': 2,\n // 10\n 'sendrecv': 3 // 11\n\n /**\n * Parses a number into direction string.\n *\n * @param {number} direction - The number to be parsed.\n * @returns {string} - The parsed direction string.\n */\n\n };\n\n function parseDirection(direction) {\n // Filter all other bits except the 2 less significant.\n var directionMask = direction & 3;\n\n switch (directionMask) {\n case 0:\n return 'inactive';\n\n case 1:\n return 'recvonly';\n\n case 2:\n return 'sendonly';\n\n case 3:\n return 'sendrecv';\n }\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/sdp-interop/lib/transform.js\":\n /*!***************************************************!*\\\n !*** ./node_modules/sdp-interop/lib/transform.js ***!\n \\***************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpInteropLibTransformJs(module, exports, __webpack_require__) {\n /* Copyright @ 2015 Atlassian Pty Ltd\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n var transform = __webpack_require__(\n /*! sdp-transform */\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/index.js\");\n\n exports.write = function (session, opts) {\n if (typeof session !== 'undefined' && typeof session.media !== 'undefined' && Array.isArray(session.media)) {\n session.media.forEach(function (mLine) {\n // expand sources to ssrcs\n if (typeof mLine.sources !== 'undefined' && Object.keys(mLine.sources).length !== 0) {\n mLine.ssrcs = [];\n Object.keys(mLine.sources).forEach(function (ssrc) {\n var source = mLine.sources[ssrc];\n Object.keys(source).forEach(function (attribute) {\n mLine.ssrcs.push({\n id: ssrc,\n attribute: attribute,\n value: source[attribute]\n });\n });\n });\n delete mLine.sources;\n } // join ssrcs in ssrc groups\n\n\n if (typeof mLine.ssrcGroups !== 'undefined' && Array.isArray(mLine.ssrcGroups)) {\n mLine.ssrcGroups.forEach(function (ssrcGroup) {\n if (typeof ssrcGroup.ssrcs !== 'undefined' && Array.isArray(ssrcGroup.ssrcs)) {\n ssrcGroup.ssrcs = ssrcGroup.ssrcs.join(' ');\n }\n });\n }\n });\n } // join group mids\n\n\n if (typeof session !== 'undefined' && typeof session.groups !== 'undefined' && Array.isArray(session.groups)) {\n session.groups.forEach(function (g) {\n if (typeof g.mids !== 'undefined' && Array.isArray(g.mids)) {\n g.mids = g.mids.join(' ');\n }\n });\n }\n\n return transform.write(session, opts);\n };\n\n exports.parse = function (sdp) {\n var session = transform.parse(sdp);\n\n if (typeof session !== 'undefined' && typeof session.media !== 'undefined' && Array.isArray(session.media)) {\n session.media.forEach(function (mLine) {\n // group sources attributes by ssrc\n if (typeof mLine.ssrcs !== 'undefined' && Array.isArray(mLine.ssrcs)) {\n mLine.sources = {};\n mLine.ssrcs.forEach(function (ssrc) {\n if (!mLine.sources[ssrc.id]) mLine.sources[ssrc.id] = {};\n mLine.sources[ssrc.id][ssrc.attribute] = ssrc.value;\n });\n delete mLine.ssrcs;\n } // split ssrcs in ssrc groups\n\n\n if (typeof mLine.ssrcGroups !== 'undefined' && Array.isArray(mLine.ssrcGroups)) {\n mLine.ssrcGroups.forEach(function (ssrcGroup) {\n if (typeof ssrcGroup.ssrcs === 'string') {\n ssrcGroup.ssrcs = ssrcGroup.ssrcs.split(' ');\n }\n });\n }\n });\n } // split group mids\n\n\n if (typeof session !== 'undefined' && typeof session.groups !== 'undefined' && Array.isArray(session.groups)) {\n session.groups.forEach(function (g) {\n if (typeof g.mids === 'string') {\n g.mids = g.mids.split(' ');\n }\n });\n }\n\n return session;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/grammar.js\":\n /*!****************************************************************************!*\\\n !*** ./node_modules/sdp-interop/node_modules/sdp-transform/lib/grammar.js ***!\n \\****************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpInteropNode_modulesSdpTransformLibGrammarJs(module, exports) {\n var grammar = module.exports = {\n v: [{\n name: 'version',\n reg: /^(\\d*)$/\n }],\n o: [{\n //o=- 20518 0 IN IP4 203.0.113.1\n // NB: sessionId will be a String in most cases because it is huge\n name: 'origin',\n reg: /^(\\S*) (\\d*) (\\d*) (\\S*) IP(\\d) (\\S*)/,\n names: ['username', 'sessionId', 'sessionVersion', 'netType', 'ipVer', 'address'],\n format: '%s %s %d %s IP%d %s'\n }],\n // default parsing of these only (though some of these feel outdated)\n s: [{\n name: 'name'\n }],\n i: [{\n name: 'description'\n }],\n u: [{\n name: 'uri'\n }],\n e: [{\n name: 'email'\n }],\n p: [{\n name: 'phone'\n }],\n z: [{\n name: 'timezones'\n }],\n // TODO: this one can actually be parsed properly..\n r: [{\n name: 'repeats'\n }],\n // TODO: this one can also be parsed properly\n //k: [{}], // outdated thing ignored\n t: [{\n //t=0 0\n name: 'timing',\n reg: /^(\\d*) (\\d*)/,\n names: ['start', 'stop'],\n format: '%d %d'\n }],\n c: [{\n //c=IN IP4 10.47.197.26\n name: 'connection',\n reg: /^IN IP(\\d) (\\S*)/,\n names: ['version', 'ip'],\n format: 'IN IP%d %s'\n }],\n b: [{\n //b=AS:4000\n push: 'bandwidth',\n reg: /^(TIAS|AS|CT|RR|RS):(\\d*)/,\n names: ['type', 'limit'],\n format: '%s:%s'\n }],\n m: [{\n //m=video 51744 RTP/AVP 126 97 98 34 31\n // NB: special - pushes to session\n // TODO: rtp/fmtp should be filtered by the payloads found here?\n reg: /^(\\w*) (\\d*) ([\\w\\/]*)(?: (.*))?/,\n names: ['type', 'port', 'protocol', 'payloads'],\n format: '%s %d %s %s'\n }],\n a: [{\n //a=rtpmap:110 opus/48000/2\n push: 'rtp',\n reg: /^rtpmap:(\\d*) ([\\w\\-\\.]*)(?:\\s*\\/(\\d*)(?:\\s*\\/(\\S*))?)?/,\n names: ['payload', 'codec', 'rate', 'encoding'],\n format: function format(o) {\n return o.encoding ? 'rtpmap:%d %s/%s/%s' : o.rate ? 'rtpmap:%d %s/%s' : 'rtpmap:%d %s';\n }\n }, {\n //a=fmtp:108 profile-level-id=24;object=23;bitrate=64000\n //a=fmtp:111 minptime=10; useinbandfec=1\n push: 'fmtp',\n reg: /^fmtp:(\\d*) ([\\S| ]*)/,\n names: ['payload', 'config'],\n format: 'fmtp:%d %s'\n }, {\n //a=control:streamid=0\n name: 'control',\n reg: /^control:(.*)/,\n format: 'control:%s'\n }, {\n //a=rtcp:65179 IN IP4 193.84.77.194\n name: 'rtcp',\n reg: /^rtcp:(\\d*)(?: (\\S*) IP(\\d) (\\S*))?/,\n names: ['port', 'netType', 'ipVer', 'address'],\n format: function format(o) {\n return o.address != null ? 'rtcp:%d %s IP%d %s' : 'rtcp:%d';\n }\n }, {\n //a=rtcp-fb:98 trr-int 100\n push: 'rtcpFbTrrInt',\n reg: /^rtcp-fb:(\\*|\\d*) trr-int (\\d*)/,\n names: ['payload', 'value'],\n format: 'rtcp-fb:%d trr-int %d'\n }, {\n //a=rtcp-fb:98 nack rpsi\n push: 'rtcpFb',\n reg: /^rtcp-fb:(\\*|\\d*) ([\\w-_]*)(?: ([\\w-_]*))?/,\n names: ['payload', 'type', 'subtype'],\n format: function format(o) {\n return o.subtype != null ? 'rtcp-fb:%s %s %s' : 'rtcp-fb:%s %s';\n }\n }, {\n //a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\n //a=extmap:1/recvonly URI-gps-string\n push: 'ext',\n reg: /^extmap:(\\d+)(?:\\/(\\w+))? (\\S*)(?: (\\S*))?/,\n names: ['value', 'direction', 'uri', 'config'],\n format: function format(o) {\n return 'extmap:%d' + (o.direction ? '/%s' : '%v') + ' %s' + (o.config ? ' %s' : '');\n }\n }, {\n //a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:PS1uQCVeeCFCanVmcjkpPywjNWhcYD0mXXtxaVBR|2^20|1:32\n push: 'crypto',\n reg: /^crypto:(\\d*) ([\\w_]*) (\\S*)(?: (\\S*))?/,\n names: ['id', 'suite', 'config', 'sessionConfig'],\n format: function format(o) {\n return o.sessionConfig != null ? 'crypto:%d %s %s %s' : 'crypto:%d %s %s';\n }\n }, {\n //a=setup:actpass\n name: 'setup',\n reg: /^setup:(\\w*)/,\n format: 'setup:%s'\n }, {\n //a=mid:1\n name: 'mid',\n reg: /^mid:([^\\s]*)/,\n format: 'mid:%s'\n }, {\n //a=msid:0c8b064d-d807-43b4-b434-f92a889d8587 98178685-d409-46e0-8e16-7ef0db0db64a\n name: 'msid',\n reg: /^msid:(.*)/,\n format: 'msid:%s'\n }, {\n //a=ptime:20\n name: 'ptime',\n reg: /^ptime:(\\d*)/,\n format: 'ptime:%d'\n }, {\n //a=maxptime:60\n name: 'maxptime',\n reg: /^maxptime:(\\d*)/,\n format: 'maxptime:%d'\n }, {\n //a=sendrecv\n name: 'direction',\n reg: /^(sendrecv|recvonly|sendonly|inactive)/\n }, {\n //a=ice-lite\n name: 'icelite',\n reg: /^(ice-lite)/\n }, {\n //a=ice-ufrag:F7gI\n name: 'iceUfrag',\n reg: /^ice-ufrag:(\\S*)/,\n format: 'ice-ufrag:%s'\n }, {\n //a=ice-pwd:x9cml/YzichV2+XlhiMu8g\n name: 'icePwd',\n reg: /^ice-pwd:(\\S*)/,\n format: 'ice-pwd:%s'\n }, {\n //a=fingerprint:SHA-1 00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33\n name: 'fingerprint',\n reg: /^fingerprint:(\\S*) (\\S*)/,\n names: ['type', 'hash'],\n format: 'fingerprint:%s %s'\n }, {\n //a=candidate:0 1 UDP 2113667327 203.0.113.1 54400 typ host\n //a=candidate:1162875081 1 udp 2113937151 192.168.34.75 60017 typ host generation 0 network-id 3 network-cost 10\n //a=candidate:3289912957 2 udp 1845501695 193.84.77.194 60017 typ srflx raddr 192.168.34.75 rport 60017 generation 0 network-id 3 network-cost 10\n //a=candidate:229815620 1 tcp 1518280447 192.168.150.19 60017 typ host tcptype active generation 0 network-id 3 network-cost 10\n //a=candidate:3289912957 2 tcp 1845501695 193.84.77.194 60017 typ srflx raddr 192.168.34.75 rport 60017 tcptype passive generation 0 network-id 3 network-cost 10\n push: 'candidates',\n reg: /^candidate:(\\S*) (\\d*) (\\S*) (\\d*) (\\S*) (\\d*) typ (\\S*)(?: raddr (\\S*) rport (\\d*))?(?: tcptype (\\S*))?(?: generation (\\d*))?(?: network-id (\\d*))?(?: network-cost (\\d*))?/,\n names: ['foundation', 'component', 'transport', 'priority', 'ip', 'port', 'type', 'raddr', 'rport', 'tcptype', 'generation', 'network-id', 'network-cost'],\n format: function format(o) {\n var str = 'candidate:%s %d %s %d %s %d typ %s';\n str += o.raddr != null ? ' raddr %s rport %d' : '%v%v'; // NB: candidate has three optional chunks, so %void middles one if it's missing\n\n str += o.tcptype != null ? ' tcptype %s' : '%v';\n\n if (o.generation != null) {\n str += ' generation %d';\n }\n\n str += o['network-id'] != null ? ' network-id %d' : '%v';\n str += o['network-cost'] != null ? ' network-cost %d' : '%v';\n return str;\n }\n }, {\n //a=end-of-candidates (keep after the candidates line for readability)\n name: 'endOfCandidates',\n reg: /^(end-of-candidates)/\n }, {\n //a=remote-candidates:1 203.0.113.1 54400 2 203.0.113.1 54401 ...\n name: 'remoteCandidates',\n reg: /^remote-candidates:(.*)/,\n format: 'remote-candidates:%s'\n }, {\n //a=ice-options:google-ice\n name: 'iceOptions',\n reg: /^ice-options:(\\S*)/,\n format: 'ice-options:%s'\n }, {\n //a=ssrc:2566107569 cname:t9YU8M1UxTF8Y1A1\n push: 'ssrcs',\n reg: /^ssrc:(\\d*) ([\\w_]*)(?::(.*))?/,\n names: ['id', 'attribute', 'value'],\n format: function format(o) {\n var str = 'ssrc:%d';\n\n if (o.attribute != null) {\n str += ' %s';\n\n if (o.value != null) {\n str += ':%s';\n }\n }\n\n return str;\n }\n }, {\n //a=ssrc-group:FEC 1 2\n //a=ssrc-group:FEC-FR 3004364195 1080772241\n push: 'ssrcGroups',\n // token-char = %x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 / %x41-5A / %x5E-7E\n reg: /^ssrc-group:([\\x21\\x23\\x24\\x25\\x26\\x27\\x2A\\x2B\\x2D\\x2E\\w]*) (.*)/,\n names: ['semantics', 'ssrcs'],\n format: 'ssrc-group:%s %s'\n }, {\n //a=msid-semantic: WMS Jvlam5X3SX1OP6pn20zWogvaKJz5Hjf9OnlV\n name: 'msidSemantic',\n reg: /^msid-semantic:\\s?(\\w*) (\\S*)/,\n names: ['semantic', 'token'],\n format: 'msid-semantic: %s %s' // space after ':' is not accidental\n\n }, {\n //a=group:BUNDLE audio video\n push: 'groups',\n reg: /^group:(\\w*) (.*)/,\n names: ['type', 'mids'],\n format: 'group:%s %s'\n }, {\n //a=rtcp-mux\n name: 'rtcpMux',\n reg: /^(rtcp-mux)/\n }, {\n //a=rtcp-rsize\n name: 'rtcpRsize',\n reg: /^(rtcp-rsize)/\n }, {\n //a=sctpmap:5000 webrtc-datachannel 1024\n name: 'sctpmap',\n reg: /^sctpmap:([\\w_\\/]*) (\\S*)(?: (\\S*))?/,\n names: ['sctpmapNumber', 'app', 'maxMessageSize'],\n format: function format(o) {\n return o.maxMessageSize != null ? 'sctpmap:%s %s %s' : 'sctpmap:%s %s';\n }\n }, {\n //a=x-google-flag:conference\n name: 'xGoogleFlag',\n reg: /^x-google-flag:([^\\s]*)/,\n format: 'x-google-flag:%s'\n }, {\n //a=rid:1 send max-width=1280;max-height=720;max-fps=30;depend=0\n push: 'rids',\n reg: /^rid:([\\d\\w]+) (\\w+)(?: ([\\S| ]*))?/,\n names: ['id', 'direction', 'params'],\n format: function format(o) {\n return o.params ? 'rid:%s %s %s' : 'rid:%s %s';\n }\n }, {\n //a=imageattr:97 send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320] recv [x=330,y=250]\n //a=imageattr:* send [x=800,y=640] recv *\n //a=imageattr:100 recv [x=320,y=240]\n push: 'imageattrs',\n reg: new RegExp( //a=imageattr:97\n '^imageattr:(\\\\d+|\\\\*)' + //send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320]\n '[\\\\s\\\\t]+(send|recv)[\\\\s\\\\t]+(\\\\*|\\\\[\\\\S+\\\\](?:[\\\\s\\\\t]+\\\\[\\\\S+\\\\])*)' + //recv [x=330,y=250]\n '(?:[\\\\s\\\\t]+(recv|send)[\\\\s\\\\t]+(\\\\*|\\\\[\\\\S+\\\\](?:[\\\\s\\\\t]+\\\\[\\\\S+\\\\])*))?'),\n names: ['pt', 'dir1', 'attrs1', 'dir2', 'attrs2'],\n format: function format(o) {\n return 'imageattr:%s %s %s' + (o.dir2 ? ' %s %s' : '');\n }\n }, {\n //a=simulcast:send 1,2,3;~4,~5 recv 6;~7,~8\n //a=simulcast:recv 1;4,5 send 6;7\n name: 'simulcast',\n reg: new RegExp( //a=simulcast:\n '^simulcast:' + //send 1,2,3;~4,~5\n '(send|recv) ([a-zA-Z0-9\\\\-_~;,]+)' + //space + recv 6;~7,~8\n '(?:\\\\s?(send|recv) ([a-zA-Z0-9\\\\-_~;,]+))?' + //end\n '$'),\n names: ['dir1', 'list1', 'dir2', 'list2'],\n format: function format(o) {\n return 'simulcast:%s %s' + (o.dir2 ? ' %s %s' : '');\n }\n }, {\n //Old simulcast draft 03 (implemented by Firefox)\n // https://tools.ietf.org/html/draft-ietf-mmusic-sdp-simulcast-03\n //a=simulcast: recv pt=97;98 send pt=97\n //a=simulcast: send rid=5;6;7 paused=6,7\n name: 'simulcast_03',\n reg: /^simulcast:[\\s\\t]+([\\S+\\s\\t]+)$/,\n names: ['value'],\n format: 'simulcast: %s'\n }, {\n //a=framerate:25\n //a=framerate:29.97\n name: 'framerate',\n reg: /^framerate:(\\d+(?:$|\\.\\d+))/,\n format: 'framerate:%s'\n }, {\n // any a= that we don't understand is kepts verbatim on media.invalid\n push: 'invalid',\n names: ['value']\n }]\n }; // set sensible defaults to avoid polluting the grammar with boring details\n\n Object.keys(grammar).forEach(function (key) {\n var objs = grammar[key];\n objs.forEach(function (obj) {\n if (!obj.reg) {\n obj.reg = /(.*)/;\n }\n\n if (!obj.format) {\n obj.format = '%s';\n }\n });\n });\n /***/\n },\n\n /***/\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/index.js\":\n /*!**************************************************************************!*\\\n !*** ./node_modules/sdp-interop/node_modules/sdp-transform/lib/index.js ***!\n \\**************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpInteropNode_modulesSdpTransformLibIndexJs(module, exports, __webpack_require__) {\n var parser = __webpack_require__(\n /*! ./parser */\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/parser.js\");\n\n var writer = __webpack_require__(\n /*! ./writer */\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/writer.js\");\n\n exports.write = writer;\n exports.parse = parser.parse;\n exports.parseFmtpConfig = parser.parseFmtpConfig;\n exports.parseParams = parser.parseParams;\n exports.parsePayloads = parser.parsePayloads;\n exports.parseRemoteCandidates = parser.parseRemoteCandidates;\n exports.parseImageAttributes = parser.parseImageAttributes;\n exports.parseSimulcastStreamList = parser.parseSimulcastStreamList;\n /***/\n },\n\n /***/\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/parser.js\":\n /*!***************************************************************************!*\\\n !*** ./node_modules/sdp-interop/node_modules/sdp-transform/lib/parser.js ***!\n \\***************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpInteropNode_modulesSdpTransformLibParserJs(module, exports, __webpack_require__) {\n var toIntIfInt = function toIntIfInt(v) {\n return String(Number(v)) === v ? Number(v) : v;\n };\n\n var attachProperties = function attachProperties(match, location, names, rawName) {\n if (rawName && !names) {\n location[rawName] = toIntIfInt(match[1]);\n } else {\n for (var i = 0; i < names.length; i += 1) {\n if (match[i + 1] != null) {\n location[names[i]] = toIntIfInt(match[i + 1]);\n }\n }\n }\n };\n\n var parseReg = function parseReg(obj, location, content) {\n var needsBlank = obj.name && obj.names;\n\n if (obj.push && !location[obj.push]) {\n location[obj.push] = [];\n } else if (needsBlank && !location[obj.name]) {\n location[obj.name] = {};\n }\n\n var keyLocation = obj.push ? {} : // blank object that will be pushed\n needsBlank ? location[obj.name] : location; // otherwise, named location or root\n\n attachProperties(content.match(obj.reg), keyLocation, obj.names, obj.name);\n\n if (obj.push) {\n location[obj.push].push(keyLocation);\n }\n };\n\n var grammar = __webpack_require__(\n /*! ./grammar */\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/grammar.js\");\n\n var validLine = RegExp.prototype.test.bind(/^([a-z])=(.*)/);\n\n exports.parse = function (sdp) {\n var session = {},\n media = [],\n location = session; // points at where properties go under (one of the above)\n // parse lines we understand\n\n sdp.split(/(\\r\\n|\\r|\\n)/).filter(validLine).forEach(function (l) {\n var type = l[0];\n var content = l.slice(2);\n\n if (type === 'm') {\n media.push({\n rtp: [],\n fmtp: []\n });\n location = media[media.length - 1]; // point at latest media line\n }\n\n for (var j = 0; j < (grammar[type] || []).length; j += 1) {\n var obj = grammar[type][j];\n\n if (obj.reg.test(content)) {\n return parseReg(obj, location, content);\n }\n }\n });\n session.media = media; // link it up\n\n return session;\n };\n\n var paramReducer = function paramReducer(acc, expr) {\n var s = expr.split(/=(.+)/, 2);\n\n if (s.length === 2) {\n acc[s[0]] = toIntIfInt(s[1]);\n }\n\n return acc;\n };\n\n exports.parseParams = function (str) {\n return str.split(/\\;\\s?/).reduce(paramReducer, {});\n }; // For backward compatibility - alias will be removed in 3.0.0\n\n\n exports.parseFmtpConfig = exports.parseParams;\n\n exports.parsePayloads = function (str) {\n return str.split(' ').map(Number);\n };\n\n exports.parseRemoteCandidates = function (str) {\n var candidates = [];\n var parts = str.split(' ').map(toIntIfInt);\n\n for (var i = 0; i < parts.length; i += 3) {\n candidates.push({\n component: parts[i],\n ip: parts[i + 1],\n port: parts[i + 2]\n });\n }\n\n return candidates;\n };\n\n exports.parseImageAttributes = function (str) {\n return str.split(' ').map(function (item) {\n return item.substring(1, item.length - 1).split(',').reduce(paramReducer, {});\n });\n };\n\n exports.parseSimulcastStreamList = function (str) {\n return str.split(';').map(function (stream) {\n return stream.split(',').map(function (format) {\n var scid,\n paused = false;\n\n if (format[0] !== '~') {\n scid = toIntIfInt(format);\n } else {\n scid = toIntIfInt(format.substring(1, format.length));\n paused = true;\n }\n\n return {\n scid: scid,\n paused: paused\n };\n });\n });\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/writer.js\":\n /*!***************************************************************************!*\\\n !*** ./node_modules/sdp-interop/node_modules/sdp-transform/lib/writer.js ***!\n \\***************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpInteropNode_modulesSdpTransformLibWriterJs(module, exports, __webpack_require__) {\n var grammar = __webpack_require__(\n /*! ./grammar */\n \"./node_modules/sdp-interop/node_modules/sdp-transform/lib/grammar.js\"); // customized util.format - discards excess arguments and can void middle ones\n\n\n var formatRegExp = /%[sdv%]/g;\n\n var format = function format(formatStr) {\n var i = 1;\n var args = arguments;\n var len = args.length;\n return formatStr.replace(formatRegExp, function (x) {\n if (i >= len) {\n return x; // missing argument\n }\n\n var arg = args[i];\n i += 1;\n\n switch (x) {\n case '%%':\n return '%';\n\n case '%s':\n return String(arg);\n\n case '%d':\n return Number(arg);\n\n case '%v':\n return '';\n }\n }); // NB: we discard excess arguments - they are typically undefined from makeLine\n };\n\n var makeLine = function makeLine(type, obj, location) {\n var str = obj.format instanceof Function ? obj.format(obj.push ? location : location[obj.name]) : obj.format;\n var args = [type + '=' + str];\n\n if (obj.names) {\n for (var i = 0; i < obj.names.length; i += 1) {\n var n = obj.names[i];\n\n if (obj.name) {\n args.push(location[obj.name][n]);\n } else {\n // for mLine and push attributes\n args.push(location[obj.names[i]]);\n }\n }\n } else {\n args.push(location[obj.name]);\n }\n\n return format.apply(null, args);\n }; // RFC specified order\n // TODO: extend this with all the rest\n\n\n var defaultOuterOrder = ['v', 'o', 's', 'i', 'u', 'e', 'p', 'c', 'b', 't', 'r', 'z', 'a'];\n var defaultInnerOrder = ['i', 'c', 'b', 'a'];\n\n module.exports = function (session, opts) {\n opts = opts || {}; // ensure certain properties exist\n\n if (session.version == null) {\n session.version = 0; // 'v=0' must be there (only defined version atm)\n }\n\n if (session.name == null) {\n session.name = ' '; // 's= ' must be there if no meaningful name set\n }\n\n session.media.forEach(function (mLine) {\n if (mLine.payloads == null) {\n mLine.payloads = '';\n }\n });\n var outerOrder = opts.outerOrder || defaultOuterOrder;\n var innerOrder = opts.innerOrder || defaultInnerOrder;\n var sdp = []; // loop through outerOrder for matching properties on session\n\n outerOrder.forEach(function (type) {\n grammar[type].forEach(function (obj) {\n if (obj.name in session && session[obj.name] != null) {\n sdp.push(makeLine(type, obj, session));\n } else if (obj.push in session && session[obj.push] != null) {\n session[obj.push].forEach(function (el) {\n sdp.push(makeLine(type, obj, el));\n });\n }\n });\n }); // then for each media line, follow the innerOrder\n\n session.media.forEach(function (mLine) {\n sdp.push(makeLine('m', grammar.m[0], mLine));\n innerOrder.forEach(function (type) {\n grammar[type].forEach(function (obj) {\n if (obj.name in mLine && mLine[obj.name] != null) {\n sdp.push(makeLine(type, obj, mLine));\n } else if (obj.push in mLine && mLine[obj.push] != null) {\n mLine[obj.push].forEach(function (el) {\n sdp.push(makeLine(type, obj, el));\n });\n }\n });\n });\n });\n return sdp.join('\\r\\n') + '\\r\\n';\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/sdp-transform/lib/grammar.js\":\n /*!***************************************************!*\\\n !*** ./node_modules/sdp-transform/lib/grammar.js ***!\n \\***************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpTransformLibGrammarJs(module, exports) {\n var grammar = module.exports = {\n v: [{\n name: 'version',\n reg: /^(\\d*)$/\n }],\n o: [{\n //o=- 20518 0 IN IP4 203.0.113.1\n // NB: sessionId will be a String in most cases because it is huge\n name: 'origin',\n reg: /^(\\S*) (\\d*) (\\d*) (\\S*) IP(\\d) (\\S*)/,\n names: ['username', 'sessionId', 'sessionVersion', 'netType', 'ipVer', 'address'],\n format: '%s %s %d %s IP%d %s'\n }],\n // default parsing of these only (though some of these feel outdated)\n s: [{\n name: 'name'\n }],\n i: [{\n name: 'description'\n }],\n u: [{\n name: 'uri'\n }],\n e: [{\n name: 'email'\n }],\n p: [{\n name: 'phone'\n }],\n z: [{\n name: 'timezones'\n }],\n // TODO: this one can actually be parsed properly..\n r: [{\n name: 'repeats'\n }],\n // TODO: this one can also be parsed properly\n //k: [{}], // outdated thing ignored\n t: [{\n //t=0 0\n name: 'timing',\n reg: /^(\\d*) (\\d*)/,\n names: ['start', 'stop'],\n format: '%d %d'\n }],\n c: [{\n //c=IN IP4 10.47.197.26\n name: 'connection',\n reg: /^IN IP(\\d) (\\S*)/,\n names: ['version', 'ip'],\n format: 'IN IP%d %s'\n }],\n b: [{\n //b=AS:4000\n push: 'bandwidth',\n reg: /^(TIAS|AS|CT|RR|RS):(\\d*)/,\n names: ['type', 'limit'],\n format: '%s:%s'\n }],\n m: [{\n //m=video 51744 RTP/AVP 126 97 98 34 31\n // NB: special - pushes to session\n // TODO: rtp/fmtp should be filtered by the payloads found here?\n reg: /^(\\w*) (\\d*) ([\\w\\/]*)(?: (.*))?/,\n names: ['type', 'port', 'protocol', 'payloads'],\n format: '%s %d %s %s'\n }],\n a: [{\n //a=rtpmap:110 opus/48000/2\n push: 'rtp',\n reg: /^rtpmap:(\\d*) ([\\w\\-\\.]*)(?:\\s*\\/(\\d*)(?:\\s*\\/(\\S*))?)?/,\n names: ['payload', 'codec', 'rate', 'encoding'],\n format: function format(o) {\n return o.encoding ? 'rtpmap:%d %s/%s/%s' : o.rate ? 'rtpmap:%d %s/%s' : 'rtpmap:%d %s';\n }\n }, {\n //a=fmtp:108 profile-level-id=24;object=23;bitrate=64000\n //a=fmtp:111 minptime=10; useinbandfec=1\n push: 'fmtp',\n reg: /^fmtp:(\\d*) ([\\S| ]*)/,\n names: ['payload', 'config'],\n format: 'fmtp:%d %s'\n }, {\n //a=control:streamid=0\n name: 'control',\n reg: /^control:(.*)/,\n format: 'control:%s'\n }, {\n //a=rtcp:65179 IN IP4 193.84.77.194\n name: 'rtcp',\n reg: /^rtcp:(\\d*)(?: (\\S*) IP(\\d) (\\S*))?/,\n names: ['port', 'netType', 'ipVer', 'address'],\n format: function format(o) {\n return o.address != null ? 'rtcp:%d %s IP%d %s' : 'rtcp:%d';\n }\n }, {\n //a=rtcp-fb:98 trr-int 100\n push: 'rtcpFbTrrInt',\n reg: /^rtcp-fb:(\\*|\\d*) trr-int (\\d*)/,\n names: ['payload', 'value'],\n format: 'rtcp-fb:%d trr-int %d'\n }, {\n //a=rtcp-fb:98 nack rpsi\n push: 'rtcpFb',\n reg: /^rtcp-fb:(\\*|\\d*) ([\\w-_]*)(?: ([\\w-_]*))?/,\n names: ['payload', 'type', 'subtype'],\n format: function format(o) {\n return o.subtype != null ? 'rtcp-fb:%s %s %s' : 'rtcp-fb:%s %s';\n }\n }, {\n //a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\n //a=extmap:1/recvonly URI-gps-string\n push: 'ext',\n reg: /^extmap:(\\d+)(?:\\/(\\w+))? (\\S*)(?: (\\S*))?/,\n names: ['value', 'direction', 'uri', 'config'],\n format: function format(o) {\n return 'extmap:%d' + (o.direction ? '/%s' : '%v') + ' %s' + (o.config ? ' %s' : '');\n }\n }, {\n //a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:PS1uQCVeeCFCanVmcjkpPywjNWhcYD0mXXtxaVBR|2^20|1:32\n push: 'crypto',\n reg: /^crypto:(\\d*) ([\\w_]*) (\\S*)(?: (\\S*))?/,\n names: ['id', 'suite', 'config', 'sessionConfig'],\n format: function format(o) {\n return o.sessionConfig != null ? 'crypto:%d %s %s %s' : 'crypto:%d %s %s';\n }\n }, {\n //a=setup:actpass\n name: 'setup',\n reg: /^setup:(\\w*)/,\n format: 'setup:%s'\n }, {\n //a=mid:1\n name: 'mid',\n reg: /^mid:([^\\s]*)/,\n format: 'mid:%s'\n }, {\n //a=msid:0c8b064d-d807-43b4-b434-f92a889d8587 98178685-d409-46e0-8e16-7ef0db0db64a\n name: 'msid',\n reg: /^msid:(.*)/,\n format: 'msid:%s'\n }, {\n //a=ptime:20\n name: 'ptime',\n reg: /^ptime:(\\d*)/,\n format: 'ptime:%d'\n }, {\n //a=maxptime:60\n name: 'maxptime',\n reg: /^maxptime:(\\d*)/,\n format: 'maxptime:%d'\n }, {\n //a=sendrecv\n name: 'direction',\n reg: /^(sendrecv|recvonly|sendonly|inactive)/\n }, {\n //a=ice-lite\n name: 'icelite',\n reg: /^(ice-lite)/\n }, {\n //a=ice-ufrag:F7gI\n name: 'iceUfrag',\n reg: /^ice-ufrag:(\\S*)/,\n format: 'ice-ufrag:%s'\n }, {\n //a=ice-pwd:x9cml/YzichV2+XlhiMu8g\n name: 'icePwd',\n reg: /^ice-pwd:(\\S*)/,\n format: 'ice-pwd:%s'\n }, {\n //a=fingerprint:SHA-1 00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33\n name: 'fingerprint',\n reg: /^fingerprint:(\\S*) (\\S*)/,\n names: ['type', 'hash'],\n format: 'fingerprint:%s %s'\n }, {\n //a=candidate:0 1 UDP 2113667327 203.0.113.1 54400 typ host\n //a=candidate:1162875081 1 udp 2113937151 192.168.34.75 60017 typ host generation 0 network-id 3 network-cost 10\n //a=candidate:3289912957 2 udp 1845501695 193.84.77.194 60017 typ srflx raddr 192.168.34.75 rport 60017 generation 0 network-id 3 network-cost 10\n //a=candidate:229815620 1 tcp 1518280447 192.168.150.19 60017 typ host tcptype active generation 0 network-id 3 network-cost 10\n //a=candidate:3289912957 2 tcp 1845501695 193.84.77.194 60017 typ srflx raddr 192.168.34.75 rport 60017 tcptype passive generation 0 network-id 3 network-cost 10\n push: 'candidates',\n reg: /^candidate:(\\S*) (\\d*) (\\S*) (\\d*) (\\S*) (\\d*) typ (\\S*)(?: raddr (\\S*) rport (\\d*))?(?: tcptype (\\S*))?(?: generation (\\d*))?(?: network-id (\\d*))?(?: network-cost (\\d*))?/,\n names: ['foundation', 'component', 'transport', 'priority', 'ip', 'port', 'type', 'raddr', 'rport', 'tcptype', 'generation', 'network-id', 'network-cost'],\n format: function format(o) {\n var str = 'candidate:%s %d %s %d %s %d typ %s';\n str += o.raddr != null ? ' raddr %s rport %d' : '%v%v'; // NB: candidate has three optional chunks, so %void middles one if it's missing\n\n str += o.tcptype != null ? ' tcptype %s' : '%v';\n\n if (o.generation != null) {\n str += ' generation %d';\n }\n\n str += o['network-id'] != null ? ' network-id %d' : '%v';\n str += o['network-cost'] != null ? ' network-cost %d' : '%v';\n return str;\n }\n }, {\n //a=end-of-candidates (keep after the candidates line for readability)\n name: 'endOfCandidates',\n reg: /^(end-of-candidates)/\n }, {\n //a=remote-candidates:1 203.0.113.1 54400 2 203.0.113.1 54401 ...\n name: 'remoteCandidates',\n reg: /^remote-candidates:(.*)/,\n format: 'remote-candidates:%s'\n }, {\n //a=ice-options:google-ice\n name: 'iceOptions',\n reg: /^ice-options:(\\S*)/,\n format: 'ice-options:%s'\n }, {\n //a=ssrc:2566107569 cname:t9YU8M1UxTF8Y1A1\n push: 'ssrcs',\n reg: /^ssrc:(\\d*) ([\\w_-]*)(?::(.*))?/,\n names: ['id', 'attribute', 'value'],\n format: function format(o) {\n var str = 'ssrc:%d';\n\n if (o.attribute != null) {\n str += ' %s';\n\n if (o.value != null) {\n str += ':%s';\n }\n }\n\n return str;\n }\n }, {\n //a=ssrc-group:FEC 1 2\n //a=ssrc-group:FEC-FR 3004364195 1080772241\n push: 'ssrcGroups',\n // token-char = %x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 / %x41-5A / %x5E-7E\n reg: /^ssrc-group:([\\x21\\x23\\x24\\x25\\x26\\x27\\x2A\\x2B\\x2D\\x2E\\w]*) (.*)/,\n names: ['semantics', 'ssrcs'],\n format: 'ssrc-group:%s %s'\n }, {\n //a=msid-semantic: WMS Jvlam5X3SX1OP6pn20zWogvaKJz5Hjf9OnlV\n name: 'msidSemantic',\n reg: /^msid-semantic:\\s?(\\w*) (\\S*)/,\n names: ['semantic', 'token'],\n format: 'msid-semantic: %s %s' // space after ':' is not accidental\n\n }, {\n //a=group:BUNDLE audio video\n push: 'groups',\n reg: /^group:(\\w*) (.*)/,\n names: ['type', 'mids'],\n format: 'group:%s %s'\n }, {\n //a=rtcp-mux\n name: 'rtcpMux',\n reg: /^(rtcp-mux)/\n }, {\n //a=rtcp-rsize\n name: 'rtcpRsize',\n reg: /^(rtcp-rsize)/\n }, {\n //a=sctpmap:5000 webrtc-datachannel 1024\n name: 'sctpmap',\n reg: /^sctpmap:([\\w_\\/]*) (\\S*)(?: (\\S*))?/,\n names: ['sctpmapNumber', 'app', 'maxMessageSize'],\n format: function format(o) {\n return o.maxMessageSize != null ? 'sctpmap:%s %s %s' : 'sctpmap:%s %s';\n }\n }, {\n //a=x-google-flag:conference\n name: 'xGoogleFlag',\n reg: /^x-google-flag:([^\\s]*)/,\n format: 'x-google-flag:%s'\n }, {\n //a=rid:1 send max-width=1280;max-height=720;max-fps=30;depend=0\n push: 'rids',\n reg: /^rid:([\\d\\w]+) (\\w+)(?: ([\\S| ]*))?/,\n names: ['id', 'direction', 'params'],\n format: function format(o) {\n return o.params ? 'rid:%s %s %s' : 'rid:%s %s';\n }\n }, {\n //a=imageattr:97 send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320] recv [x=330,y=250]\n //a=imageattr:* send [x=800,y=640] recv *\n //a=imageattr:100 recv [x=320,y=240]\n push: 'imageattrs',\n reg: new RegExp( //a=imageattr:97\n '^imageattr:(\\\\d+|\\\\*)' + //send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320]\n '[\\\\s\\\\t]+(send|recv)[\\\\s\\\\t]+(\\\\*|\\\\[\\\\S+\\\\](?:[\\\\s\\\\t]+\\\\[\\\\S+\\\\])*)' + //recv [x=330,y=250]\n '(?:[\\\\s\\\\t]+(recv|send)[\\\\s\\\\t]+(\\\\*|\\\\[\\\\S+\\\\](?:[\\\\s\\\\t]+\\\\[\\\\S+\\\\])*))?'),\n names: ['pt', 'dir1', 'attrs1', 'dir2', 'attrs2'],\n format: function format(o) {\n return 'imageattr:%s %s %s' + (o.dir2 ? ' %s %s' : '');\n }\n }, {\n //a=simulcast:send 1,2,3;~4,~5 recv 6;~7,~8\n //a=simulcast:recv 1;4,5 send 6;7\n name: 'simulcast',\n reg: new RegExp( //a=simulcast:\n '^simulcast:' + //send 1,2,3;~4,~5\n '(send|recv) ([a-zA-Z0-9\\\\-_~;,]+)' + //space + recv 6;~7,~8\n '(?:\\\\s?(send|recv) ([a-zA-Z0-9\\\\-_~;,]+))?' + //end\n '$'),\n names: ['dir1', 'list1', 'dir2', 'list2'],\n format: function format(o) {\n return 'simulcast:%s %s' + (o.dir2 ? ' %s %s' : '');\n }\n }, {\n //Old simulcast draft 03 (implemented by Firefox)\n // https://tools.ietf.org/html/draft-ietf-mmusic-sdp-simulcast-03\n //a=simulcast: recv pt=97;98 send pt=97\n //a=simulcast: send rid=5;6;7 paused=6,7\n name: 'simulcast_03',\n reg: /^simulcast:[\\s\\t]+([\\S+\\s\\t]+)$/,\n names: ['value'],\n format: 'simulcast: %s'\n }, {\n //a=framerate:25\n //a=framerate:29.97\n name: 'framerate',\n reg: /^framerate:(\\d+(?:$|\\.\\d+))/,\n format: 'framerate:%s'\n }, {\n // RFC4570\n //a=source-filter: incl IN IP4 239.5.2.31 10.1.15.5\n name: 'sourceFilter',\n reg: /^source-filter: *(excl|incl) (\\S*) (IP4|IP6|\\*) (\\S*) (.*)/,\n names: ['filterMode', 'netType', 'addressTypes', 'destAddress', 'srcList'],\n format: 'source-filter: %s %s %s %s %s'\n }, {\n //a=bundle-only\n name: 'bundleOnly',\n reg: /^(bundle-only)/\n }, {\n //a=label:1\n name: 'label',\n reg: /^label:(.+)/,\n format: 'label:%s'\n }, {\n // RFC version 26 for SCTP over DTLS\n // https://tools.ietf.org/html/draft-ietf-mmusic-sctp-sdp-26#section-5\n name: 'sctpPort',\n reg: /^sctp-port:(\\d+)$/,\n format: 'sctp-port:%s'\n }, {\n // RFC version 26 for SCTP over DTLS\n // https://tools.ietf.org/html/draft-ietf-mmusic-sctp-sdp-26#section-6\n name: 'maxMessageSize',\n reg: /^max-message-size:(\\d+)$/,\n format: 'max-message-size:%s'\n }, {\n // any a= that we don't understand is kepts verbatim on media.invalid\n push: 'invalid',\n names: ['value']\n }]\n }; // set sensible defaults to avoid polluting the grammar with boring details\n\n Object.keys(grammar).forEach(function (key) {\n var objs = grammar[key];\n objs.forEach(function (obj) {\n if (!obj.reg) {\n obj.reg = /(.*)/;\n }\n\n if (!obj.format) {\n obj.format = '%s';\n }\n });\n });\n /***/\n },\n\n /***/\n \"./node_modules/sdp-transform/lib/index.js\":\n /*!*************************************************!*\\\n !*** ./node_modules/sdp-transform/lib/index.js ***!\n \\*************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpTransformLibIndexJs(module, exports, __webpack_require__) {\n var parser = __webpack_require__(\n /*! ./parser */\n \"./node_modules/sdp-transform/lib/parser.js\");\n\n var writer = __webpack_require__(\n /*! ./writer */\n \"./node_modules/sdp-transform/lib/writer.js\");\n\n exports.write = writer;\n exports.parse = parser.parse;\n exports.parseFmtpConfig = parser.parseFmtpConfig;\n exports.parseParams = parser.parseParams;\n exports.parsePayloads = parser.parsePayloads;\n exports.parseRemoteCandidates = parser.parseRemoteCandidates;\n exports.parseImageAttributes = parser.parseImageAttributes;\n exports.parseSimulcastStreamList = parser.parseSimulcastStreamList;\n /***/\n },\n\n /***/\n \"./node_modules/sdp-transform/lib/parser.js\":\n /*!**************************************************!*\\\n !*** ./node_modules/sdp-transform/lib/parser.js ***!\n \\**************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpTransformLibParserJs(module, exports, __webpack_require__) {\n var toIntIfInt = function toIntIfInt(v) {\n return String(Number(v)) === v ? Number(v) : v;\n };\n\n var attachProperties = function attachProperties(match, location, names, rawName) {\n if (rawName && !names) {\n location[rawName] = toIntIfInt(match[1]);\n } else {\n for (var i = 0; i < names.length; i += 1) {\n if (match[i + 1] != null) {\n location[names[i]] = toIntIfInt(match[i + 1]);\n }\n }\n }\n };\n\n var parseReg = function parseReg(obj, location, content) {\n var needsBlank = obj.name && obj.names;\n\n if (obj.push && !location[obj.push]) {\n location[obj.push] = [];\n } else if (needsBlank && !location[obj.name]) {\n location[obj.name] = {};\n }\n\n var keyLocation = obj.push ? {} : // blank object that will be pushed\n needsBlank ? location[obj.name] : location; // otherwise, named location or root\n\n attachProperties(content.match(obj.reg), keyLocation, obj.names, obj.name);\n\n if (obj.push) {\n location[obj.push].push(keyLocation);\n }\n };\n\n var grammar = __webpack_require__(\n /*! ./grammar */\n \"./node_modules/sdp-transform/lib/grammar.js\");\n\n var validLine = RegExp.prototype.test.bind(/^([a-z])=(.*)/);\n\n exports.parse = function (sdp) {\n var session = {},\n media = [],\n location = session; // points at where properties go under (one of the above)\n // parse lines we understand\n\n sdp.split(/(\\r\\n|\\r|\\n)/).filter(validLine).forEach(function (l) {\n var type = l[0];\n var content = l.slice(2);\n\n if (type === 'm') {\n media.push({\n rtp: [],\n fmtp: []\n });\n location = media[media.length - 1]; // point at latest media line\n }\n\n for (var j = 0; j < (grammar[type] || []).length; j += 1) {\n var obj = grammar[type][j];\n\n if (obj.reg.test(content)) {\n return parseReg(obj, location, content);\n }\n }\n });\n session.media = media; // link it up\n\n return session;\n };\n\n var paramReducer = function paramReducer(acc, expr) {\n var s = expr.split(/=(.+)/, 2);\n\n if (s.length === 2) {\n acc[s[0]] = toIntIfInt(s[1]);\n } else if (s.length === 1 && expr.length > 1) {\n acc[s[0]] = undefined;\n }\n\n return acc;\n };\n\n exports.parseParams = function (str) {\n return str.split(/\\;\\s?/).reduce(paramReducer, {});\n }; // For backward compatibility - alias will be removed in 3.0.0\n\n\n exports.parseFmtpConfig = exports.parseParams;\n\n exports.parsePayloads = function (str) {\n return str.split(' ').map(Number);\n };\n\n exports.parseRemoteCandidates = function (str) {\n var candidates = [];\n var parts = str.split(' ').map(toIntIfInt);\n\n for (var i = 0; i < parts.length; i += 3) {\n candidates.push({\n component: parts[i],\n ip: parts[i + 1],\n port: parts[i + 2]\n });\n }\n\n return candidates;\n };\n\n exports.parseImageAttributes = function (str) {\n return str.split(' ').map(function (item) {\n return item.substring(1, item.length - 1).split(',').reduce(paramReducer, {});\n });\n };\n\n exports.parseSimulcastStreamList = function (str) {\n return str.split(';').map(function (stream) {\n return stream.split(',').map(function (format) {\n var scid,\n paused = false;\n\n if (format[0] !== '~') {\n scid = toIntIfInt(format);\n } else {\n scid = toIntIfInt(format.substring(1, format.length));\n paused = true;\n }\n\n return {\n scid: scid,\n paused: paused\n };\n });\n });\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/sdp-transform/lib/writer.js\":\n /*!**************************************************!*\\\n !*** ./node_modules/sdp-transform/lib/writer.js ***!\n \\**************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSdpTransformLibWriterJs(module, exports, __webpack_require__) {\n var grammar = __webpack_require__(\n /*! ./grammar */\n \"./node_modules/sdp-transform/lib/grammar.js\"); // customized util.format - discards excess arguments and can void middle ones\n\n\n var formatRegExp = /%[sdv%]/g;\n\n var format = function format(formatStr) {\n var i = 1;\n var args = arguments;\n var len = args.length;\n return formatStr.replace(formatRegExp, function (x) {\n if (i >= len) {\n return x; // missing argument\n }\n\n var arg = args[i];\n i += 1;\n\n switch (x) {\n case '%%':\n return '%';\n\n case '%s':\n return String(arg);\n\n case '%d':\n return Number(arg);\n\n case '%v':\n return '';\n }\n }); // NB: we discard excess arguments - they are typically undefined from makeLine\n };\n\n var makeLine = function makeLine(type, obj, location) {\n var str = obj.format instanceof Function ? obj.format(obj.push ? location : location[obj.name]) : obj.format;\n var args = [type + '=' + str];\n\n if (obj.names) {\n for (var i = 0; i < obj.names.length; i += 1) {\n var n = obj.names[i];\n\n if (obj.name) {\n args.push(location[obj.name][n]);\n } else {\n // for mLine and push attributes\n args.push(location[obj.names[i]]);\n }\n }\n } else {\n args.push(location[obj.name]);\n }\n\n return format.apply(null, args);\n }; // RFC specified order\n // TODO: extend this with all the rest\n\n\n var defaultOuterOrder = ['v', 'o', 's', 'i', 'u', 'e', 'p', 'c', 'b', 't', 'r', 'z', 'a'];\n var defaultInnerOrder = ['i', 'c', 'b', 'a'];\n\n module.exports = function (session, opts) {\n opts = opts || {}; // ensure certain properties exist\n\n if (session.version == null) {\n session.version = 0; // 'v=0' must be there (only defined version atm)\n }\n\n if (session.name == null) {\n session.name = ' '; // 's= ' must be there if no meaningful name set\n }\n\n session.media.forEach(function (mLine) {\n if (mLine.payloads == null) {\n mLine.payloads = '';\n }\n });\n var outerOrder = opts.outerOrder || defaultOuterOrder;\n var innerOrder = opts.innerOrder || defaultInnerOrder;\n var sdp = []; // loop through outerOrder for matching properties on session\n\n outerOrder.forEach(function (type) {\n grammar[type].forEach(function (obj) {\n if (obj.name in session && session[obj.name] != null) {\n sdp.push(makeLine(type, obj, session));\n } else if (obj.push in session && session[obj.push] != null) {\n session[obj.push].forEach(function (el) {\n sdp.push(makeLine(type, obj, el));\n });\n }\n });\n }); // then for each media line, follow the innerOrder\n\n session.media.forEach(function (mLine) {\n sdp.push(makeLine('m', grammar.m[0], mLine));\n innerOrder.forEach(function (type) {\n grammar[type].forEach(function (obj) {\n if (obj.name in mLine && mLine[obj.name] != null) {\n sdp.push(makeLine(type, obj, mLine));\n } else if (obj.push in mLine && mLine[obj.push] != null) {\n mLine[obj.push].forEach(function (el) {\n sdp.push(makeLine(type, obj, el));\n });\n }\n });\n });\n });\n return sdp.join('\\r\\n') + '\\r\\n';\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/lib/index.js\":\n /*!****************************************************!*\\\n !*** ./node_modules/socket.io-client/lib/index.js ***!\n \\****************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientLibIndexJs(module, exports, __webpack_require__) {\n /**\n * Module dependencies.\n */\n var url = __webpack_require__(\n /*! ./url */\n \"./node_modules/socket.io-client/lib/url.js\");\n\n var parser = __webpack_require__(\n /*! socket.io-parser */\n \"./node_modules/socket.io-client/node_modules/socket.io-parser/index.js\");\n\n var Manager = __webpack_require__(\n /*! ./manager */\n \"./node_modules/socket.io-client/lib/manager.js\");\n\n var debug = __webpack_require__(\n /*! debug */\n \"./node_modules/socket.io-client/node_modules/debug/src/browser.js\")('socket.io-client');\n /**\n * Module exports.\n */\n\n\n module.exports = exports = lookup;\n /**\n * Managers cache.\n */\n\n var cache = exports.managers = {};\n /**\n * Looks up an existing `Manager` for multiplexing.\n * If the user summons:\n *\n * `io('http://localhost/a');`\n * `io('http://localhost/b');`\n *\n * We reuse the existing instance based on same scheme/port/host,\n * and we initialize sockets for each namespace.\n *\n * @api public\n */\n\n function lookup(uri, opts) {\n if (typeof uri === 'object') {\n opts = uri;\n uri = undefined;\n }\n\n opts = opts || {};\n var parsed = url(uri);\n var source = parsed.source;\n var id = parsed.id;\n var path = parsed.path;\n var sameNamespace = cache[id] && path in cache[id].nsps;\n var newConnection = opts.forceNew || opts['force new connection'] || false === opts.multiplex || sameNamespace;\n var io;\n\n if (newConnection) {\n debug('ignoring socket cache for %s', source);\n io = Manager(source, opts);\n } else {\n if (!cache[id]) {\n debug('new io instance for %s', source);\n cache[id] = Manager(source, opts);\n }\n\n io = cache[id];\n }\n\n if (parsed.query && !opts.query) {\n opts.query = parsed.query;\n }\n\n return io.socket(parsed.path, opts);\n }\n /**\n * Protocol version.\n *\n * @api public\n */\n\n\n exports.protocol = parser.protocol;\n /**\n * `connect`.\n *\n * @param {String} uri\n * @api public\n */\n\n exports.connect = lookup;\n /**\n * Expose constructors for standalone build.\n *\n * @api public\n */\n\n exports.Manager = __webpack_require__(\n /*! ./manager */\n \"./node_modules/socket.io-client/lib/manager.js\");\n exports.Socket = __webpack_require__(\n /*! ./socket */\n \"./node_modules/socket.io-client/lib/socket.js\");\n /***/\n },\n\n /***/\n \"./node_modules/socket.io-client/lib/manager.js\":\n /*!******************************************************!*\\\n !*** ./node_modules/socket.io-client/lib/manager.js ***!\n \\******************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientLibManagerJs(module, exports, __webpack_require__) {\n /**\n * Module dependencies.\n */\n var eio = __webpack_require__(\n /*! engine.io-client */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/index.js\");\n\n var Socket = __webpack_require__(\n /*! ./socket */\n \"./node_modules/socket.io-client/lib/socket.js\");\n\n var Emitter = __webpack_require__(\n /*! component-emitter */\n \"./node_modules/component-emitter/index.js\");\n\n var parser = __webpack_require__(\n /*! socket.io-parser */\n \"./node_modules/socket.io-client/node_modules/socket.io-parser/index.js\");\n\n var on = __webpack_require__(\n /*! ./on */\n \"./node_modules/socket.io-client/lib/on.js\");\n\n var bind = __webpack_require__(\n /*! component-bind */\n \"./node_modules/component-bind/index.js\");\n\n var debug = __webpack_require__(\n /*! debug */\n \"./node_modules/socket.io-client/node_modules/debug/src/browser.js\")('socket.io-client:manager');\n\n var indexOf = __webpack_require__(\n /*! indexof */\n \"./node_modules/indexof/index.js\");\n\n var Backoff = __webpack_require__(\n /*! backo2 */\n \"./node_modules/backo2/index.js\");\n /**\n * IE6+ hasOwnProperty\n */\n\n\n var has = Object.prototype.hasOwnProperty;\n /**\n * Module exports\n */\n\n module.exports = Manager;\n /**\n * `Manager` constructor.\n *\n * @param {String} engine instance or engine uri/opts\n * @param {Object} options\n * @api public\n */\n\n function Manager(uri, opts) {\n if (!(this instanceof Manager)) return new Manager(uri, opts);\n\n if (uri && 'object' === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n\n opts = opts || {};\n opts.path = opts.path || '/socket.io';\n this.nsps = {};\n this.subs = [];\n this.opts = opts;\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor(opts.randomizationFactor || 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor()\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this.readyState = 'closed';\n this.uri = uri;\n this.connecting = [];\n this.lastPing = null;\n this.encoding = false;\n this.packetBuffer = [];\n\n var _parser = opts.parser || parser;\n\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this.autoConnect = opts.autoConnect !== false;\n if (this.autoConnect) this.open();\n }\n /**\n * Propagate given event to sockets and emit on `this`\n *\n * @api private\n */\n\n\n Manager.prototype.emitAll = function () {\n this.emit.apply(this, arguments);\n\n for (var nsp in this.nsps) {\n if (has.call(this.nsps, nsp)) {\n this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n }\n }\n };\n /**\n * Update `socket.id` of all sockets\n *\n * @api private\n */\n\n\n Manager.prototype.updateSocketIds = function () {\n for (var nsp in this.nsps) {\n if (has.call(this.nsps, nsp)) {\n this.nsps[nsp].id = this.generateId(nsp);\n }\n }\n };\n /**\n * generate `socket.id` for the given `nsp`\n *\n * @param {String} nsp\n * @return {String}\n * @api private\n */\n\n\n Manager.prototype.generateId = function (nsp) {\n return (nsp === '/' ? '' : nsp + '#') + this.engine.id;\n };\n /**\n * Mix in `Emitter`.\n */\n\n\n Emitter(Manager.prototype);\n /**\n * Sets the `reconnection` config.\n *\n * @param {Boolean} true/false if it should automatically reconnect\n * @return {Manager} self or value\n * @api public\n */\n\n Manager.prototype.reconnection = function (v) {\n if (!arguments.length) return this._reconnection;\n this._reconnection = !!v;\n return this;\n };\n /**\n * Sets the reconnection attempts config.\n *\n * @param {Number} max reconnection attempts before giving up\n * @return {Manager} self or value\n * @api public\n */\n\n\n Manager.prototype.reconnectionAttempts = function (v) {\n if (!arguments.length) return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n };\n /**\n * Sets the delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\n\n Manager.prototype.reconnectionDelay = function (v) {\n if (!arguments.length) return this._reconnectionDelay;\n this._reconnectionDelay = v;\n this.backoff && this.backoff.setMin(v);\n return this;\n };\n\n Manager.prototype.randomizationFactor = function (v) {\n if (!arguments.length) return this._randomizationFactor;\n this._randomizationFactor = v;\n this.backoff && this.backoff.setJitter(v);\n return this;\n };\n /**\n * Sets the maximum delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\n\n Manager.prototype.reconnectionDelayMax = function (v) {\n if (!arguments.length) return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n this.backoff && this.backoff.setMax(v);\n return this;\n };\n /**\n * Sets the connection timeout. `false` to disable\n *\n * @return {Manager} self or value\n * @api public\n */\n\n\n Manager.prototype.timeout = function (v) {\n if (!arguments.length) return this._timeout;\n this._timeout = v;\n return this;\n };\n /**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @api private\n */\n\n\n Manager.prototype.maybeReconnectOnOpen = function () {\n // Only try to reconnect if it's the first time we're connecting\n if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n };\n /**\n * Sets the current transport `socket`.\n *\n * @param {Function} optional, callback\n * @return {Manager} self\n * @api public\n */\n\n\n Manager.prototype.open = Manager.prototype.connect = function (fn, opts) {\n debug('readyState %s', this.readyState);\n if (~this.readyState.indexOf('open')) return this;\n debug('opening %s', this.uri);\n this.engine = eio(this.uri, this.opts);\n var socket = this.engine;\n var self = this;\n this.readyState = 'opening';\n this.skipReconnect = false; // emit `open`\n\n var openSub = on(socket, 'open', function () {\n self.onopen();\n fn && fn();\n }); // emit `connect_error`\n\n var errorSub = on(socket, 'error', function (data) {\n debug('connect_error');\n self.cleanup();\n self.readyState = 'closed';\n self.emitAll('connect_error', data);\n\n if (fn) {\n var err = new Error('Connection error');\n err.data = data;\n fn(err);\n } else {\n // Only do this if there is no fn to handle the error\n self.maybeReconnectOnOpen();\n }\n }); // emit `connect_timeout`\n\n if (false !== this._timeout) {\n var timeout = this._timeout;\n debug('connect attempt will timeout after %d', timeout); // set timer\n\n var timer = setTimeout(function () {\n debug('connect attempt timed out after %d', timeout);\n openSub.destroy();\n socket.close();\n socket.emit('error', 'timeout');\n self.emitAll('connect_timeout', timeout);\n }, timeout);\n this.subs.push({\n destroy: function destroy() {\n clearTimeout(timer);\n }\n });\n }\n\n this.subs.push(openSub);\n this.subs.push(errorSub);\n return this;\n };\n /**\n * Called upon transport open.\n *\n * @api private\n */\n\n\n Manager.prototype.onopen = function () {\n debug('open'); // clear old subs\n\n this.cleanup(); // mark as open\n\n this.readyState = 'open';\n this.emit('open'); // add new subs\n\n var socket = this.engine;\n this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n };\n /**\n * Called upon a ping.\n *\n * @api private\n */\n\n\n Manager.prototype.onping = function () {\n this.lastPing = new Date();\n this.emitAll('ping');\n };\n /**\n * Called upon a packet.\n *\n * @api private\n */\n\n\n Manager.prototype.onpong = function () {\n this.emitAll('pong', new Date() - this.lastPing);\n };\n /**\n * Called with data.\n *\n * @api private\n */\n\n\n Manager.prototype.ondata = function (data) {\n this.decoder.add(data);\n };\n /**\n * Called when parser fully decodes a packet.\n *\n * @api private\n */\n\n\n Manager.prototype.ondecoded = function (packet) {\n this.emit('packet', packet);\n };\n /**\n * Called upon socket error.\n *\n * @api private\n */\n\n\n Manager.prototype.onerror = function (err) {\n debug('error', err);\n this.emitAll('error', err);\n };\n /**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @api public\n */\n\n\n Manager.prototype.socket = function (nsp, opts) {\n var socket = this.nsps[nsp];\n\n if (!socket) {\n socket = new Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n var self = this;\n socket.on('connecting', onConnecting);\n socket.on('connect', function () {\n socket.id = self.generateId(nsp);\n });\n\n if (this.autoConnect) {\n // manually call here since connecting event is fired before listening\n onConnecting();\n }\n }\n\n function onConnecting() {\n if (!~indexOf(self.connecting, socket)) {\n self.connecting.push(socket);\n }\n }\n\n return socket;\n };\n /**\n * Called upon a socket close.\n *\n * @param {Socket} socket\n */\n\n\n Manager.prototype.destroy = function (socket) {\n var index = indexOf(this.connecting, socket);\n if (~index) this.connecting.splice(index, 1);\n if (this.connecting.length) return;\n this.close();\n };\n /**\n * Writes a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\n\n Manager.prototype.packet = function (packet) {\n debug('writing packet %j', packet);\n var self = this;\n if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;\n\n if (!self.encoding) {\n // encode, then write to engine with result\n self.encoding = true;\n this.encoder.encode(packet, function (encodedPackets) {\n for (var i = 0; i < encodedPackets.length; i++) {\n self.engine.write(encodedPackets[i], packet.options);\n }\n\n self.encoding = false;\n self.processPacketQueue();\n });\n } else {\n // add packet to the queue\n self.packetBuffer.push(packet);\n }\n };\n /**\n * If packet buffer is non-empty, begins encoding the\n * next packet in line.\n *\n * @api private\n */\n\n\n Manager.prototype.processPacketQueue = function () {\n if (this.packetBuffer.length > 0 && !this.encoding) {\n var pack = this.packetBuffer.shift();\n this.packet(pack);\n }\n };\n /**\n * Clean up transport subscriptions and packet buffer.\n *\n * @api private\n */\n\n\n Manager.prototype.cleanup = function () {\n debug('cleanup');\n var subsLength = this.subs.length;\n\n for (var i = 0; i < subsLength; i++) {\n var sub = this.subs.shift();\n sub.destroy();\n }\n\n this.packetBuffer = [];\n this.encoding = false;\n this.lastPing = null;\n this.decoder.destroy();\n };\n /**\n * Close the current socket.\n *\n * @api private\n */\n\n\n Manager.prototype.close = Manager.prototype.disconnect = function () {\n debug('disconnect');\n this.skipReconnect = true;\n this.reconnecting = false;\n\n if ('opening' === this.readyState) {\n // `onclose` will not fire because\n // an open event never happened\n this.cleanup();\n }\n\n this.backoff.reset();\n this.readyState = 'closed';\n if (this.engine) this.engine.close();\n };\n /**\n * Called upon engine close.\n *\n * @api private\n */\n\n\n Manager.prototype.onclose = function (reason) {\n debug('onclose');\n this.cleanup();\n this.backoff.reset();\n this.readyState = 'closed';\n this.emit('close', reason);\n\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n };\n /**\n * Attempt a reconnection.\n *\n * @api private\n */\n\n\n Manager.prototype.reconnect = function () {\n if (this.reconnecting || this.skipReconnect) return this;\n var self = this;\n\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n debug('reconnect failed');\n this.backoff.reset();\n this.emitAll('reconnect_failed');\n this.reconnecting = false;\n } else {\n var delay = this.backoff.duration();\n debug('will wait %dms before reconnect attempt', delay);\n this.reconnecting = true;\n var timer = setTimeout(function () {\n if (self.skipReconnect) return;\n debug('attempting reconnect');\n self.emitAll('reconnect_attempt', self.backoff.attempts);\n self.emitAll('reconnecting', self.backoff.attempts); // check again for the case socket closed in above events\n\n if (self.skipReconnect) return;\n self.open(function (err) {\n if (err) {\n debug('reconnect attempt error');\n self.reconnecting = false;\n self.reconnect();\n self.emitAll('reconnect_error', err.data);\n } else {\n debug('reconnect success');\n self.onreconnect();\n }\n });\n }, delay);\n this.subs.push({\n destroy: function destroy() {\n clearTimeout(timer);\n }\n });\n }\n };\n /**\n * Called upon successful reconnect.\n *\n * @api private\n */\n\n\n Manager.prototype.onreconnect = function () {\n var attempt = this.backoff.attempts;\n this.reconnecting = false;\n this.backoff.reset();\n this.updateSocketIds();\n this.emitAll('reconnect', attempt);\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/lib/on.js\":\n /*!*************************************************!*\\\n !*** ./node_modules/socket.io-client/lib/on.js ***!\n \\*************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientLibOnJs(module, exports) {\n /**\n * Module exports.\n */\n module.exports = on;\n /**\n * Helper for subscriptions.\n *\n * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n * @param {String} event name\n * @param {Function} callback\n * @api public\n */\n\n function on(obj, ev, fn) {\n obj.on(ev, fn);\n return {\n destroy: function destroy() {\n obj.removeListener(ev, fn);\n }\n };\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/lib/socket.js\":\n /*!*****************************************************!*\\\n !*** ./node_modules/socket.io-client/lib/socket.js ***!\n \\*****************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientLibSocketJs(module, exports, __webpack_require__) {\n /**\n * Module dependencies.\n */\n var parser = __webpack_require__(\n /*! socket.io-parser */\n \"./node_modules/socket.io-client/node_modules/socket.io-parser/index.js\");\n\n var Emitter = __webpack_require__(\n /*! component-emitter */\n \"./node_modules/component-emitter/index.js\");\n\n var toArray = __webpack_require__(\n /*! to-array */\n \"./node_modules/to-array/index.js\");\n\n var on = __webpack_require__(\n /*! ./on */\n \"./node_modules/socket.io-client/lib/on.js\");\n\n var bind = __webpack_require__(\n /*! component-bind */\n \"./node_modules/component-bind/index.js\");\n\n var debug = __webpack_require__(\n /*! debug */\n \"./node_modules/socket.io-client/node_modules/debug/src/browser.js\")('socket.io-client:socket');\n\n var parseqs = __webpack_require__(\n /*! parseqs */\n \"./node_modules/parseqs/index.js\");\n\n var hasBin = __webpack_require__(\n /*! has-binary2 */\n \"./node_modules/has-binary2/index.js\");\n /**\n * Module exports.\n */\n\n\n module.exports = exports = Socket;\n /**\n * Internal events (blacklisted).\n * These events can't be emitted by the user.\n *\n * @api private\n */\n\n var events = {\n connect: 1,\n connect_error: 1,\n connect_timeout: 1,\n connecting: 1,\n disconnect: 1,\n error: 1,\n reconnect: 1,\n reconnect_attempt: 1,\n reconnect_failed: 1,\n reconnect_error: 1,\n reconnecting: 1,\n ping: 1,\n pong: 1\n };\n /**\n * Shortcut to `Emitter#emit`.\n */\n\n var emit = Emitter.prototype.emit;\n /**\n * `Socket` constructor.\n *\n * @api public\n */\n\n function Socket(io, nsp, opts) {\n this.io = io;\n this.nsp = nsp;\n this.json = this; // compat\n\n this.ids = 0;\n this.acks = {};\n this.receiveBuffer = [];\n this.sendBuffer = [];\n this.connected = false;\n this.disconnected = true;\n this.flags = {};\n\n if (opts && opts.query) {\n this.query = opts.query;\n }\n\n if (this.io.autoConnect) this.open();\n }\n /**\n * Mix in `Emitter`.\n */\n\n\n Emitter(Socket.prototype);\n /**\n * Subscribe to open, close and packet events\n *\n * @api private\n */\n\n Socket.prototype.subEvents = function () {\n if (this.subs) return;\n var io = this.io;\n this.subs = [on(io, 'open', bind(this, 'onopen')), on(io, 'packet', bind(this, 'onpacket')), on(io, 'close', bind(this, 'onclose'))];\n };\n /**\n * \"Opens\" the socket.\n *\n * @api public\n */\n\n\n Socket.prototype.open = Socket.prototype.connect = function () {\n if (this.connected) return this;\n this.subEvents();\n this.io.open(); // ensure open\n\n if ('open' === this.io.readyState) this.onopen();\n this.emit('connecting');\n return this;\n };\n /**\n * Sends a `message` event.\n *\n * @return {Socket} self\n * @api public\n */\n\n\n Socket.prototype.send = function () {\n var args = toArray(arguments);\n args.unshift('message');\n this.emit.apply(this, args);\n return this;\n };\n /**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @param {String} event name\n * @return {Socket} self\n * @api public\n */\n\n\n Socket.prototype.emit = function (ev) {\n if (events.hasOwnProperty(ev)) {\n emit.apply(this, arguments);\n return this;\n }\n\n var args = toArray(arguments);\n var packet = {\n type: (this.flags.binary !== undefined ? this.flags.binary : hasBin(args)) ? parser.BINARY_EVENT : parser.EVENT,\n data: args\n };\n packet.options = {};\n packet.options.compress = !this.flags || false !== this.flags.compress; // event ack callback\n\n if ('function' === typeof args[args.length - 1]) {\n debug('emitting packet with ack id %d', this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n\n if (this.connected) {\n this.packet(packet);\n } else {\n this.sendBuffer.push(packet);\n }\n\n this.flags = {};\n return this;\n };\n /**\n * Sends a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\n\n Socket.prototype.packet = function (packet) {\n packet.nsp = this.nsp;\n this.io.packet(packet);\n };\n /**\n * Called upon engine `open`.\n *\n * @api private\n */\n\n\n Socket.prototype.onopen = function () {\n debug('transport is open - connecting'); // write connect packet if necessary\n\n if ('/' !== this.nsp) {\n if (this.query) {\n var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;\n debug('sending connect packet with query %s', query);\n this.packet({\n type: parser.CONNECT,\n query: query\n });\n } else {\n this.packet({\n type: parser.CONNECT\n });\n }\n }\n };\n /**\n * Called upon engine `close`.\n *\n * @param {String} reason\n * @api private\n */\n\n\n Socket.prototype.onclose = function (reason) {\n debug('close (%s)', reason);\n this.connected = false;\n this.disconnected = true;\n delete this.id;\n this.emit('disconnect', reason);\n };\n /**\n * Called with socket packet.\n *\n * @param {Object} packet\n * @api private\n */\n\n\n Socket.prototype.onpacket = function (packet) {\n var sameNamespace = packet.nsp === this.nsp;\n var rootNamespaceError = packet.type === parser.ERROR && packet.nsp === '/';\n if (!sameNamespace && !rootNamespaceError) return;\n\n switch (packet.type) {\n case parser.CONNECT:\n this.onconnect();\n break;\n\n case parser.EVENT:\n this.onevent(packet);\n break;\n\n case parser.BINARY_EVENT:\n this.onevent(packet);\n break;\n\n case parser.ACK:\n this.onack(packet);\n break;\n\n case parser.BINARY_ACK:\n this.onack(packet);\n break;\n\n case parser.DISCONNECT:\n this.ondisconnect();\n break;\n\n case parser.ERROR:\n this.emit('error', packet.data);\n break;\n }\n };\n /**\n * Called upon a server event.\n *\n * @param {Object} packet\n * @api private\n */\n\n\n Socket.prototype.onevent = function (packet) {\n var args = packet.data || [];\n debug('emitting event %j', args);\n\n if (null != packet.id) {\n debug('attaching ack callback to event');\n args.push(this.ack(packet.id));\n }\n\n if (this.connected) {\n emit.apply(this, args);\n } else {\n this.receiveBuffer.push(args);\n }\n };\n /**\n * Produces an ack callback to emit with an event.\n *\n * @api private\n */\n\n\n Socket.prototype.ack = function (id) {\n var self = this;\n var sent = false;\n return function () {\n // prevent double callbacks\n if (sent) return;\n sent = true;\n var args = toArray(arguments);\n debug('sending ack %j', args);\n self.packet({\n type: hasBin(args) ? parser.BINARY_ACK : parser.ACK,\n id: id,\n data: args\n });\n };\n };\n /**\n * Called upon a server acknowlegement.\n *\n * @param {Object} packet\n * @api private\n */\n\n\n Socket.prototype.onack = function (packet) {\n var ack = this.acks[packet.id];\n\n if ('function' === typeof ack) {\n debug('calling ack %s with %j', packet.id, packet.data);\n ack.apply(this, packet.data);\n delete this.acks[packet.id];\n } else {\n debug('bad ack %s', packet.id);\n }\n };\n /**\n * Called upon server connect.\n *\n * @api private\n */\n\n\n Socket.prototype.onconnect = function () {\n this.connected = true;\n this.disconnected = false;\n this.emit('connect');\n this.emitBuffered();\n };\n /**\n * Emit buffered events (received and emitted).\n *\n * @api private\n */\n\n\n Socket.prototype.emitBuffered = function () {\n var i;\n\n for (i = 0; i < this.receiveBuffer.length; i++) {\n emit.apply(this, this.receiveBuffer[i]);\n }\n\n this.receiveBuffer = [];\n\n for (i = 0; i < this.sendBuffer.length; i++) {\n this.packet(this.sendBuffer[i]);\n }\n\n this.sendBuffer = [];\n };\n /**\n * Called upon server disconnect.\n *\n * @api private\n */\n\n\n Socket.prototype.ondisconnect = function () {\n debug('server disconnect (%s)', this.nsp);\n this.destroy();\n this.onclose('io server disconnect');\n };\n /**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @api private.\n */\n\n\n Socket.prototype.destroy = function () {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n for (var i = 0; i < this.subs.length; i++) {\n this.subs[i].destroy();\n }\n\n this.subs = null;\n }\n\n this.io.destroy(this);\n };\n /**\n * Disconnects the socket manually.\n *\n * @return {Socket} self\n * @api public\n */\n\n\n Socket.prototype.close = Socket.prototype.disconnect = function () {\n if (this.connected) {\n debug('performing disconnect (%s)', this.nsp);\n this.packet({\n type: parser.DISCONNECT\n });\n } // remove socket from pool\n\n\n this.destroy();\n\n if (this.connected) {\n // fire events\n this.onclose('io client disconnect');\n }\n\n return this;\n };\n /**\n * Sets the compress flag.\n *\n * @param {Boolean} if `true`, compresses the sending data\n * @return {Socket} self\n * @api public\n */\n\n\n Socket.prototype.compress = function (compress) {\n this.flags.compress = compress;\n return this;\n };\n /**\n * Sets the binary flag\n *\n * @param {Boolean} whether the emitted data contains binary\n * @return {Socket} self\n * @api public\n */\n\n\n Socket.prototype.binary = function (binary) {\n this.flags.binary = binary;\n return this;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/lib/url.js\":\n /*!**************************************************!*\\\n !*** ./node_modules/socket.io-client/lib/url.js ***!\n \\**************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientLibUrlJs(module, exports, __webpack_require__) {\n /**\n * Module dependencies.\n */\n var parseuri = __webpack_require__(\n /*! parseuri */\n \"./node_modules/parseuri/index.js\");\n\n var debug = __webpack_require__(\n /*! debug */\n \"./node_modules/socket.io-client/node_modules/debug/src/browser.js\")('socket.io-client:url');\n /**\n * Module exports.\n */\n\n\n module.exports = url;\n /**\n * URL parser.\n *\n * @param {String} url\n * @param {Object} An object meant to mimic window.location.\n * Defaults to window.location.\n * @api public\n */\n\n function url(uri, loc) {\n var obj = uri; // default to window.location\n\n loc = loc || typeof location !== 'undefined' && location;\n if (null == uri) uri = loc.protocol + '//' + loc.host; // relative path support\n\n if ('string' === typeof uri) {\n if ('/' === uri.charAt(0)) {\n if ('/' === uri.charAt(1)) {\n uri = loc.protocol + uri;\n } else {\n uri = loc.host + uri;\n }\n }\n\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n debug('protocol-less url %s', uri);\n\n if ('undefined' !== typeof loc) {\n uri = loc.protocol + '//' + uri;\n } else {\n uri = 'https://' + uri;\n }\n } // parse\n\n\n debug('parse %s', uri);\n obj = parseuri(uri);\n } // make sure we treat `localhost:80` and `localhost` equally\n\n\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = '80';\n } else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = '443';\n }\n }\n\n obj.path = obj.path || '/';\n var ipv6 = obj.host.indexOf(':') !== -1;\n var host = ipv6 ? '[' + obj.host + ']' : obj.host; // define unique id\n\n obj.id = obj.protocol + '://' + host + ':' + obj.port; // define href\n\n obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : ':' + obj.port);\n return obj;\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/node_modules/debug/src/browser.js\":\n /*!*************************************************************************!*\\\n !*** ./node_modules/socket.io-client/node_modules/debug/src/browser.js ***!\n \\*************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientNode_modulesDebugSrcBrowserJs(module, exports, __webpack_require__) {\n /* WEBPACK VAR INJECTION */\n (function (process) {\n /**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n exports = module.exports = __webpack_require__(\n /*! ./debug */\n \"./node_modules/socket.io-client/node_modules/debug/src/debug.js\");\n exports.log = log;\n exports.formatArgs = formatArgs;\n exports.save = save;\n exports.load = load;\n exports.useColors = useColors;\n exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();\n /**\n * Colors.\n */\n\n exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];\n /**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n function useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n } // Internet Explorer and Edge do not support colors.\n\n\n if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n return false;\n } // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\n\n return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773\n typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker\n typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/);\n }\n /**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\n\n exports.formatters.j = function (v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n };\n /**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\n\n function formatArgs(args) {\n var useColors = this.useColors;\n args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);\n if (!useColors) return;\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit'); // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function (match) {\n if ('%%' === match) return;\n index++;\n\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n args.splice(lastC, 0, c);\n }\n /**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\n\n function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n }\n /**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\n\n function save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch (e) {}\n }\n /**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\n\n function load() {\n var r;\n\n try {\n r = exports.storage.debug;\n } catch (e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\n\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n }\n /**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\n\n exports.enable(load());\n /**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\n function localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n }\n /* WEBPACK VAR INJECTION */\n\n }).call(this, __webpack_require__(\n /*! ./../../../../process/browser.js */\n \"./node_modules/process/browser.js\"));\n /***/\n },\n\n /***/\n \"./node_modules/socket.io-client/node_modules/debug/src/debug.js\":\n /*!***********************************************************************!*\\\n !*** ./node_modules/socket.io-client/node_modules/debug/src/debug.js ***!\n \\***********************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientNode_modulesDebugSrcDebugJs(module, exports, __webpack_require__) {\n /**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\n exports.coerce = coerce;\n exports.disable = disable;\n exports.enable = enable;\n exports.enabled = enabled;\n exports.humanize = __webpack_require__(\n /*! ms */\n \"./node_modules/ms/index.js\");\n /**\n * Active `debug` instances.\n */\n\n exports.instances = [];\n /**\n * The currently active debug mode names, and names to skip.\n */\n\n exports.names = [];\n exports.skips = [];\n /**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\n exports.formatters = {};\n /**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\n function selectColor(namespace) {\n var hash = 0,\n i;\n\n for (i in namespace) {\n hash = (hash << 5) - hash + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n }\n /**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\n\n function createDebug(namespace) {\n var prevTime;\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n var self = debug; // set `diff` timestamp\n\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr; // turn the `arguments` into a proper Array\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n } // apply any `formatters` transformations\n\n\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format`\n\n args.splice(index, 1);\n index--;\n }\n\n return match;\n }); // apply env-specific formatting (colors, etc.)\n\n exports.formatArgs.call(self, args);\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n debug.destroy = destroy; // env-specific initialization logic for debug instances\n\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n exports.instances.push(debug);\n return debug;\n }\n\n function destroy() {\n var index = exports.instances.indexOf(this);\n\n if (index !== -1) {\n exports.instances.splice(index, 1);\n return true;\n } else {\n return false;\n }\n }\n /**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\n\n function enable(namespaces) {\n exports.save(namespaces);\n exports.names = [];\n exports.skips = [];\n var i;\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n\n namespaces = split[i].replace(/\\*/g, '.*?');\n\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n\n for (i = 0; i < exports.instances.length; i++) {\n var instance = exports.instances[i];\n instance.enabled = exports.enabled(instance.namespace);\n }\n }\n /**\n * Disable debug output.\n *\n * @api public\n */\n\n\n function disable() {\n exports.enable('');\n }\n /**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\n\n function enabled(name) {\n if (name[name.length - 1] === '*') {\n return true;\n }\n\n var i, len;\n\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\n\n function coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/index.js\":\n /*!**********************************************************************************!*\\\n !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/index.js ***!\n \\**********************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientNode_modulesEngineIoClientLibIndexJs(module, exports, __webpack_require__) {\n module.exports = __webpack_require__(\n /*! ./socket */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/socket.js\");\n /**\n * Exports parser\n *\n * @api public\n *\n */\n\n module.exports.parser = __webpack_require__(\n /*! engine.io-parser */\n \"./node_modules/engine.io-parser/lib/browser.js\");\n /***/\n },\n\n /***/\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/socket.js\":\n /*!***********************************************************************************!*\\\n !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/socket.js ***!\n \\***********************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientNode_modulesEngineIoClientLibSocketJs(module, exports, __webpack_require__) {\n /**\n * Module dependencies.\n */\n var transports = __webpack_require__(\n /*! ./transports/index */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/index.js\");\n\n var Emitter = __webpack_require__(\n /*! component-emitter */\n \"./node_modules/component-emitter/index.js\");\n\n var debug = __webpack_require__(\n /*! debug */\n \"./node_modules/socket.io-client/node_modules/debug/src/browser.js\")('engine.io-client:socket');\n\n var index = __webpack_require__(\n /*! indexof */\n \"./node_modules/indexof/index.js\");\n\n var parser = __webpack_require__(\n /*! engine.io-parser */\n \"./node_modules/engine.io-parser/lib/browser.js\");\n\n var parseuri = __webpack_require__(\n /*! parseuri */\n \"./node_modules/parseuri/index.js\");\n\n var parseqs = __webpack_require__(\n /*! parseqs */\n \"./node_modules/parseqs/index.js\");\n /**\n * Module exports.\n */\n\n\n module.exports = Socket;\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri or options\n * @param {Object} options\n * @api public\n */\n\n function Socket(uri, opts) {\n if (!(this instanceof Socket)) return new Socket(uri, opts);\n opts = opts || {};\n\n if (uri && 'object' === typeof uri) {\n opts = uri;\n uri = null;\n }\n\n if (uri) {\n uri = parseuri(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';\n opts.port = uri.port;\n if (uri.query) opts.query = uri.query;\n } else if (opts.host) {\n opts.hostname = parseuri(opts.host).host;\n }\n\n this.secure = null != opts.secure ? opts.secure : typeof location !== 'undefined' && 'https:' === location.protocol;\n\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? '443' : '80';\n }\n\n this.agent = opts.agent || false;\n this.hostname = opts.hostname || (typeof location !== 'undefined' ? location.hostname : 'localhost');\n this.port = opts.port || (typeof location !== 'undefined' && location.port ? location.port : this.secure ? 443 : 80);\n this.query = opts.query || {};\n if ('string' === typeof this.query) this.query = parseqs.decode(this.query);\n this.upgrade = false !== opts.upgrade;\n this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n this.forceJSONP = !!opts.forceJSONP;\n this.jsonp = false !== opts.jsonp;\n this.forceBase64 = !!opts.forceBase64;\n this.enablesXDR = !!opts.enablesXDR;\n this.timestampParam = opts.timestampParam || 't';\n this.timestampRequests = opts.timestampRequests;\n this.transports = opts.transports || ['polling', 'websocket'];\n this.transportOptions = opts.transportOptions || {};\n this.readyState = '';\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.policyPort = opts.policyPort || 843;\n this.rememberUpgrade = opts.rememberUpgrade || false;\n this.binaryType = null;\n this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n this.perMessageDeflate = false !== opts.perMessageDeflate ? opts.perMessageDeflate || {} : false;\n if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n\n if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n this.perMessageDeflate.threshold = 1024;\n } // SSL options for Node.js client\n\n\n this.pfx = opts.pfx || null;\n this.key = opts.key || null;\n this.passphrase = opts.passphrase || null;\n this.cert = opts.cert || null;\n this.ca = opts.ca || null;\n this.ciphers = opts.ciphers || null;\n this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;\n this.forceNode = !!opts.forceNode; // detect ReactNative environment\n\n this.isReactNative = typeof navigator !== 'undefined' && typeof navigator.product === 'string' && navigator.product.toLowerCase() === 'reactnative'; // other options for Node.js or ReactNative client\n\n if (typeof self === 'undefined' || this.isReactNative) {\n if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n this.extraHeaders = opts.extraHeaders;\n }\n\n if (opts.localAddress) {\n this.localAddress = opts.localAddress;\n }\n } // set on handshake\n\n\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null; // set on heartbeat\n\n this.pingIntervalTimer = null;\n this.pingTimeoutTimer = null;\n this.open();\n }\n\n Socket.priorWebsocketSuccess = false;\n /**\n * Mix in `Emitter`.\n */\n\n Emitter(Socket.prototype);\n /**\n * Protocol version.\n *\n * @api public\n */\n\n Socket.protocol = parser.protocol; // this is an int\n\n /**\n * Expose deps for legacy compatibility\n * and standalone browser access.\n */\n\n Socket.Socket = Socket;\n Socket.Transport = __webpack_require__(\n /*! ./transport */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transport.js\");\n Socket.transports = __webpack_require__(\n /*! ./transports/index */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/index.js\");\n Socket.parser = __webpack_require__(\n /*! engine.io-parser */\n \"./node_modules/engine.io-parser/lib/browser.js\");\n /**\n * Creates transport of the given type.\n *\n * @param {String} transport name\n * @return {Transport}\n * @api private\n */\n\n Socket.prototype.createTransport = function (name) {\n debug('creating transport \"%s\"', name);\n var query = clone(this.query); // append engine.io protocol identifier\n\n query.EIO = parser.protocol; // transport name\n\n query.transport = name; // per-transport options\n\n var options = this.transportOptions[name] || {}; // session id if we already have one\n\n if (this.id) query.sid = this.id;\n var transport = new transports[name]({\n query: query,\n socket: this,\n agent: options.agent || this.agent,\n hostname: options.hostname || this.hostname,\n port: options.port || this.port,\n secure: options.secure || this.secure,\n path: options.path || this.path,\n forceJSONP: options.forceJSONP || this.forceJSONP,\n jsonp: options.jsonp || this.jsonp,\n forceBase64: options.forceBase64 || this.forceBase64,\n enablesXDR: options.enablesXDR || this.enablesXDR,\n timestampRequests: options.timestampRequests || this.timestampRequests,\n timestampParam: options.timestampParam || this.timestampParam,\n policyPort: options.policyPort || this.policyPort,\n pfx: options.pfx || this.pfx,\n key: options.key || this.key,\n passphrase: options.passphrase || this.passphrase,\n cert: options.cert || this.cert,\n ca: options.ca || this.ca,\n ciphers: options.ciphers || this.ciphers,\n rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,\n perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,\n extraHeaders: options.extraHeaders || this.extraHeaders,\n forceNode: options.forceNode || this.forceNode,\n localAddress: options.localAddress || this.localAddress,\n requestTimeout: options.requestTimeout || this.requestTimeout,\n protocols: options.protocols || void 0,\n isReactNative: this.isReactNative\n });\n return transport;\n };\n\n function clone(obj) {\n var o = {};\n\n for (var i in obj) {\n if (obj.hasOwnProperty(i)) {\n o[i] = obj[i];\n }\n }\n\n return o;\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @api private\n */\n\n\n Socket.prototype.open = function () {\n var transport;\n\n if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {\n transport = 'websocket';\n } else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n var self = this;\n setTimeout(function () {\n self.emit('error', 'No transports available');\n }, 0);\n return;\n } else {\n transport = this.transports[0];\n }\n\n this.readyState = 'opening'; // Retry with the next transport if the transport is disabled (jsonp: false)\n\n try {\n transport = this.createTransport(transport);\n } catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n\n transport.open();\n this.setTransport(transport);\n };\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @api private\n */\n\n\n Socket.prototype.setTransport = function (transport) {\n debug('setting transport %s', transport.name);\n var self = this;\n\n if (this.transport) {\n debug('clearing existing transport %s', this.transport.name);\n this.transport.removeAllListeners();\n } // set up transport\n\n\n this.transport = transport; // set up transport listeners\n\n transport.on('drain', function () {\n self.onDrain();\n }).on('packet', function (packet) {\n self.onPacket(packet);\n }).on('error', function (e) {\n self.onError(e);\n }).on('close', function () {\n self.onClose('transport close');\n });\n };\n /**\n * Probes a transport.\n *\n * @param {String} transport name\n * @api private\n */\n\n\n Socket.prototype.probe = function (name) {\n debug('probing transport \"%s\"', name);\n var transport = this.createTransport(name, {\n probe: 1\n });\n var failed = false;\n var self = this;\n Socket.priorWebsocketSuccess = false;\n\n function onTransportOpen() {\n if (self.onlyBinaryUpgrades) {\n var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n failed = failed || upgradeLosesBinary;\n }\n\n if (failed) return;\n debug('probe transport \"%s\" opened', name);\n transport.send([{\n type: 'ping',\n data: 'probe'\n }]);\n transport.once('packet', function (msg) {\n if (failed) return;\n\n if ('pong' === msg.type && 'probe' === msg.data) {\n debug('probe transport \"%s\" pong', name);\n self.upgrading = true;\n self.emit('upgrading', transport);\n if (!transport) return;\n Socket.priorWebsocketSuccess = 'websocket' === transport.name;\n debug('pausing current transport \"%s\"', self.transport.name);\n self.transport.pause(function () {\n if (failed) return;\n if ('closed' === self.readyState) return;\n debug('changing transport and sending upgrade packet');\n cleanup();\n self.setTransport(transport);\n transport.send([{\n type: 'upgrade'\n }]);\n self.emit('upgrade', transport);\n transport = null;\n self.upgrading = false;\n self.flush();\n });\n } else {\n debug('probe transport \"%s\" failed', name);\n var err = new Error('probe error');\n err.transport = transport.name;\n self.emit('upgradeError', err);\n }\n });\n }\n\n function freezeTransport() {\n if (failed) return; // Any callback called by transport should be ignored since now\n\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n } // Handle any error that happens while probing\n\n\n function onerror(err) {\n var error = new Error('probe error: ' + err);\n error.transport = transport.name;\n freezeTransport();\n debug('probe transport \"%s\" failed because of error: %s', name, err);\n self.emit('upgradeError', error);\n }\n\n function onTransportClose() {\n onerror('transport closed');\n } // When the socket is closed while we're probing\n\n\n function onclose() {\n onerror('socket closed');\n } // When the socket is upgraded while we're probing\n\n\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n freezeTransport();\n }\n } // Remove all listeners on the transport and on self\n\n\n function cleanup() {\n transport.removeListener('open', onTransportOpen);\n transport.removeListener('error', onerror);\n transport.removeListener('close', onTransportClose);\n self.removeListener('close', onclose);\n self.removeListener('upgrading', onupgrade);\n }\n\n transport.once('open', onTransportOpen);\n transport.once('error', onerror);\n transport.once('close', onTransportClose);\n this.once('close', onclose);\n this.once('upgrading', onupgrade);\n transport.open();\n };\n /**\n * Called when connection is deemed open.\n *\n * @api public\n */\n\n\n Socket.prototype.onOpen = function () {\n debug('socket open');\n this.readyState = 'open';\n Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;\n this.emit('open');\n this.flush(); // we check for `readyState` in case an `open`\n // listener already closed the socket\n\n if ('open' === this.readyState && this.upgrade && this.transport.pause) {\n debug('starting upgrade probes');\n\n for (var i = 0, l = this.upgrades.length; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n };\n /**\n * Handles a packet.\n *\n * @api private\n */\n\n\n Socket.prototype.onPacket = function (packet) {\n if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n this.emit('packet', packet); // Socket is live - any packet counts\n\n this.emit('heartbeat');\n\n switch (packet.type) {\n case 'open':\n this.onHandshake(JSON.parse(packet.data));\n break;\n\n case 'pong':\n this.setPing();\n this.emit('pong');\n break;\n\n case 'error':\n var err = new Error('server error');\n err.code = packet.data;\n this.onError(err);\n break;\n\n case 'message':\n this.emit('data', packet.data);\n this.emit('message', packet.data);\n break;\n }\n } else {\n debug('packet received with socket readyState \"%s\"', this.readyState);\n }\n };\n /**\n * Called upon handshake completion.\n *\n * @param {Object} handshake obj\n * @api private\n */\n\n\n Socket.prototype.onHandshake = function (data) {\n this.emit('handshake', data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.onOpen(); // In case open handler closes socket\n\n if ('closed' === this.readyState) return;\n this.setPing(); // Prolong liveness of socket on heartbeat\n\n this.removeListener('heartbeat', this.onHeartbeat);\n this.on('heartbeat', this.onHeartbeat);\n };\n /**\n * Resets ping timeout.\n *\n * @api private\n */\n\n\n Socket.prototype.onHeartbeat = function (timeout) {\n clearTimeout(this.pingTimeoutTimer);\n var self = this;\n self.pingTimeoutTimer = setTimeout(function () {\n if ('closed' === self.readyState) return;\n self.onClose('ping timeout');\n }, timeout || self.pingInterval + self.pingTimeout);\n };\n /**\n * Pings server every `this.pingInterval` and expects response\n * within `this.pingTimeout` or closes connection.\n *\n * @api private\n */\n\n\n Socket.prototype.setPing = function () {\n var self = this;\n clearTimeout(self.pingIntervalTimer);\n self.pingIntervalTimer = setTimeout(function () {\n debug('writing ping packet - expecting pong within %sms', self.pingTimeout);\n self.ping();\n self.onHeartbeat(self.pingTimeout);\n }, self.pingInterval);\n };\n /**\n * Sends a ping packet.\n *\n * @api private\n */\n\n\n Socket.prototype.ping = function () {\n var self = this;\n this.sendPacket('ping', function () {\n self.emit('ping');\n });\n };\n /**\n * Called on `drain` event\n *\n * @api private\n */\n\n\n Socket.prototype.onDrain = function () {\n this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit('drain');\n } else {\n this.flush();\n }\n };\n /**\n * Flush write buffers.\n *\n * @api private\n */\n\n\n Socket.prototype.flush = function () {\n if ('closed' !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) {\n debug('flushing %d packets in socket', this.writeBuffer.length);\n this.transport.send(this.writeBuffer); // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n\n this.prevBufferLen = this.writeBuffer.length;\n this.emit('flush');\n }\n };\n /**\n * Sends a message.\n *\n * @param {String} message.\n * @param {Function} callback function.\n * @param {Object} options.\n * @return {Socket} for chaining.\n * @api public\n */\n\n\n Socket.prototype.write = Socket.prototype.send = function (msg, options, fn) {\n this.sendPacket('message', msg, options, fn);\n return this;\n };\n /**\n * Sends a packet.\n *\n * @param {String} packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} callback function.\n * @api private\n */\n\n\n Socket.prototype.sendPacket = function (type, data, options, fn) {\n if ('function' === typeof data) {\n fn = data;\n data = undefined;\n }\n\n if ('function' === typeof options) {\n fn = options;\n options = null;\n }\n\n if ('closing' === this.readyState || 'closed' === this.readyState) {\n return;\n }\n\n options = options || {};\n options.compress = false !== options.compress;\n var packet = {\n type: type,\n data: data,\n options: options\n };\n this.emit('packetCreate', packet);\n this.writeBuffer.push(packet);\n if (fn) this.once('flush', fn);\n this.flush();\n };\n /**\n * Closes the connection.\n *\n * @api private\n */\n\n\n Socket.prototype.close = function () {\n if ('opening' === this.readyState || 'open' === this.readyState) {\n this.readyState = 'closing';\n var self = this;\n\n if (this.writeBuffer.length) {\n this.once('drain', function () {\n if (this.upgrading) {\n waitForUpgrade();\n } else {\n close();\n }\n });\n } else if (this.upgrading) {\n waitForUpgrade();\n } else {\n close();\n }\n }\n\n function close() {\n self.onClose('forced close');\n debug('socket closing - telling transport to close');\n self.transport.close();\n }\n\n function cleanupAndClose() {\n self.removeListener('upgrade', cleanupAndClose);\n self.removeListener('upgradeError', cleanupAndClose);\n close();\n }\n\n function waitForUpgrade() {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n self.once('upgrade', cleanupAndClose);\n self.once('upgradeError', cleanupAndClose);\n }\n\n return this;\n };\n /**\n * Called upon transport error\n *\n * @api private\n */\n\n\n Socket.prototype.onError = function (err) {\n debug('socket error %j', err);\n Socket.priorWebsocketSuccess = false;\n this.emit('error', err);\n this.onClose('transport error', err);\n };\n /**\n * Called upon transport close.\n *\n * @api private\n */\n\n\n Socket.prototype.onClose = function (reason, desc) {\n if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n debug('socket close with reason: \"%s\"', reason);\n var self = this; // clear timers\n\n clearTimeout(this.pingIntervalTimer);\n clearTimeout(this.pingTimeoutTimer); // stop event from firing again for transport\n\n this.transport.removeAllListeners('close'); // ensure transport won't stay open\n\n this.transport.close(); // ignore further transport communication\n\n this.transport.removeAllListeners(); // set ready state\n\n this.readyState = 'closed'; // clear session id\n\n this.id = null; // emit close event\n\n this.emit('close', reason, desc); // clean buffers after, so users can still\n // grab the buffers on `close` event\n\n self.writeBuffer = [];\n self.prevBufferLen = 0;\n }\n };\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} server upgrades\n * @api private\n *\n */\n\n\n Socket.prototype.filterUpgrades = function (upgrades) {\n var filteredUpgrades = [];\n\n for (var i = 0, j = upgrades.length; i < j; i++) {\n if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n }\n\n return filteredUpgrades;\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transport.js\":\n /*!**************************************************************************************!*\\\n !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transport.js ***!\n \\**************************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientNode_modulesEngineIoClientLibTransportJs(module, exports, __webpack_require__) {\n /**\n * Module dependencies.\n */\n var parser = __webpack_require__(\n /*! engine.io-parser */\n \"./node_modules/engine.io-parser/lib/browser.js\");\n\n var Emitter = __webpack_require__(\n /*! component-emitter */\n \"./node_modules/component-emitter/index.js\");\n /**\n * Module exports.\n */\n\n\n module.exports = Transport;\n /**\n * Transport abstract constructor.\n *\n * @param {Object} options.\n * @api private\n */\n\n function Transport(opts) {\n this.path = opts.path;\n this.hostname = opts.hostname;\n this.port = opts.port;\n this.secure = opts.secure;\n this.query = opts.query;\n this.timestampParam = opts.timestampParam;\n this.timestampRequests = opts.timestampRequests;\n this.readyState = '';\n this.agent = opts.agent || false;\n this.socket = opts.socket;\n this.enablesXDR = opts.enablesXDR; // SSL options for Node.js client\n\n this.pfx = opts.pfx;\n this.key = opts.key;\n this.passphrase = opts.passphrase;\n this.cert = opts.cert;\n this.ca = opts.ca;\n this.ciphers = opts.ciphers;\n this.rejectUnauthorized = opts.rejectUnauthorized;\n this.forceNode = opts.forceNode; // results of ReactNative environment detection\n\n this.isReactNative = opts.isReactNative; // other options for Node.js client\n\n this.extraHeaders = opts.extraHeaders;\n this.localAddress = opts.localAddress;\n }\n /**\n * Mix in `Emitter`.\n */\n\n\n Emitter(Transport.prototype);\n /**\n * Emits an error.\n *\n * @param {String} str\n * @return {Transport} for chaining\n * @api public\n */\n\n Transport.prototype.onError = function (msg, desc) {\n var err = new Error(msg);\n err.type = 'TransportError';\n err.description = desc;\n this.emit('error', err);\n return this;\n };\n /**\n * Opens the transport.\n *\n * @api public\n */\n\n\n Transport.prototype.open = function () {\n if ('closed' === this.readyState || '' === this.readyState) {\n this.readyState = 'opening';\n this.doOpen();\n }\n\n return this;\n };\n /**\n * Closes the transport.\n *\n * @api private\n */\n\n\n Transport.prototype.close = function () {\n if ('opening' === this.readyState || 'open' === this.readyState) {\n this.doClose();\n this.onClose();\n }\n\n return this;\n };\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n * @api private\n */\n\n\n Transport.prototype.send = function (packets) {\n if ('open' === this.readyState) {\n this.write(packets);\n } else {\n throw new Error('Transport not open');\n }\n };\n /**\n * Called upon open\n *\n * @api private\n */\n\n\n Transport.prototype.onOpen = function () {\n this.readyState = 'open';\n this.writable = true;\n this.emit('open');\n };\n /**\n * Called with data.\n *\n * @param {String} data\n * @api private\n */\n\n\n Transport.prototype.onData = function (data) {\n var packet = parser.decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n };\n /**\n * Called with a decoded packet.\n */\n\n\n Transport.prototype.onPacket = function (packet) {\n this.emit('packet', packet);\n };\n /**\n * Called upon close.\n *\n * @api private\n */\n\n\n Transport.prototype.onClose = function () {\n this.readyState = 'closed';\n this.emit('close');\n };\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/index.js\":\n /*!*********************************************************************************************!*\\\n !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/index.js ***!\n \\*********************************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientNode_modulesEngineIoClientLibTransportsIndexJs(module, exports, __webpack_require__) {\n /**\n * Module dependencies\n */\n var XMLHttpRequest = __webpack_require__(\n /*! xmlhttprequest-ssl */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/xmlhttprequest.js\");\n\n var XHR = __webpack_require__(\n /*! ./polling-xhr */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-xhr.js\");\n\n var JSONP = __webpack_require__(\n /*! ./polling-jsonp */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-jsonp.js\");\n\n var websocket = __webpack_require__(\n /*! ./websocket */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/websocket.js\");\n /**\n * Export transports.\n */\n\n\n exports.polling = polling;\n exports.websocket = websocket;\n /**\n * Polling transport polymorphic constructor.\n * Decides on xhr vs jsonp based on feature detection.\n *\n * @api private\n */\n\n function polling(opts) {\n var xhr;\n var xd = false;\n var xs = false;\n var jsonp = false !== opts.jsonp;\n\n if (typeof location !== 'undefined') {\n var isSSL = 'https:' === location.protocol;\n var port = location.port; // some user agents have empty `location.port`\n\n if (!port) {\n port = isSSL ? 443 : 80;\n }\n\n xd = opts.hostname !== location.hostname || port !== opts.port;\n xs = opts.secure !== isSSL;\n }\n\n opts.xdomain = xd;\n opts.xscheme = xs;\n xhr = new XMLHttpRequest(opts);\n\n if ('open' in xhr && !opts.forceJSONP) {\n return new XHR(opts);\n } else {\n if (!jsonp) throw new Error('JSONP disabled');\n return new JSONP(opts);\n }\n }\n /***/\n\n },\n\n /***/\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-jsonp.js\":\n /*!*****************************************************************************************************!*\\\n !*** ./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling-jsonp.js ***!\n \\*****************************************************************************************************/\n\n /*! no static exports found */\n\n /*! ModuleConcatenation bailout: Module is not an ECMAScript module */\n\n /***/\n function node_modulesSocketIoClientNode_modulesEngineIoClientLibTransportsPollingJsonpJs(module, exports, __webpack_require__) {\n /* WEBPACK VAR INJECTION */\n (function (global) {\n /**\n * Module requirements.\n */\n var Polling = __webpack_require__(\n /*! ./polling */\n \"./node_modules/socket.io-client/node_modules/engine.io-client/lib/transports/polling.js\");\n\n var inherit = __webpack_require__(\n /*! component-inherit */\n \"./node_modules/component-inherit/index.js\");\n /**\n * Module exports.\n */\n\n\n module.exports = JSONPPolling;\n /**\n * Cached regular expressions.\n */\n\n var rNewline = /\\n/g;\n var rEscapedNewline = /\\\\n/g;\n /**\n * Global JSONP callbacks.\n */\n\n var callbacks;\n /**\n * Noop.\n */\n\n function empty() {}\n /**\n * Until https://github.com/tc39/proposal-global is shipped.\n */\n\n\n function glob() {\n return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};\n }\n /**\n * JSONP Polling constructor.\n *\n * @param {Object} opts.\n * @api public\n */\n\n\n function JSONPPolling(opts) {\n Polling.call(this, opts);\n this.query = this.query || {}; // define global callbacks array if not present\n // we do this here (lazily) to avoid unneeded global pollution\n\n if (!callbacks) {\n // we need to consider multiple engines in the same page\n var global = glob();\n callbacks = global.___eio = global.___eio || [];\n } // callback identifier\n\n\n this.index = callbacks.length; // add callback to jsonp global\n\n var self = this;\n callbacks.push(function (msg) {\n self.onData(msg);\n }); // append to query string\n\n this.query.j = this.index; // prevent spurious errors from being emitted when the window is unloaded\n\n if (typeof addEventListener === 'function') {\n addEventListener('beforeunload', function () {\n if (self.script) self.script.onerror = empty;\n }, false);\n }\n }\n /**\n * Inherits from Polling.\n */\n\n\n inherit(JSONPPolling, Polling);\n /*\n * JSONP only supports binary as base64 encoded strings\n */\n\n JSONPPolling.prototype.supportsBinary = false;\n /**\n * Closes the socket.\n *\n * @api private\n */\n\n JSONPPolling.prototype.doClose = function () {\n if (this.script) {\n this.script.parentNode.removeChild(this.script);\n this.script = null;\n }\n\n if (this.form) {\n this.form.parentNode.removeChild(this.form);\n this.form = null;\n this.iframe = null;\n }\n\n Polling.prototype.doClose.call(this);\n };\n /**\n * Starts a poll cycle.\n *\n * @api private\n */\n\n\n JSONPPolling.prototype.doPoll = function () {\n var self = this;\n var script = document.createElement('script');\n\n if (this.script) {\n this.script.parentNode.removeChild(this.script);\n this.script = null;\n }\n\n script.async = true;\n script.src = this.uri();\n\n script.onerror = function (e) {\n self.onError('jsonp poll error', e);\n };\n\n var insertAt = document.getElementsByTagName('script')[0];\n\n if (insertAt) {\n insertAt.parentNode.insertBefore(script, insertAt);\n } else {\n (document.head || document.body).appendChild(script);\n }\n\n this.script = script;\n var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);\n\n if (isUAgecko) {\n setTimeout(function () {\n var iframe = document.createElement('iframe');\n document.body.appendChild(iframe);\n document.body.removeChild(iframe);\n }, 100);\n }\n };\n /**\n * Writes with a hidden iframe.\n *\n * @param {String} data to send\n * @param {Function} called upon flush.\n * @api private\n */\n\n\n JSONPPolling.prototype.doWrite = function (data, fn) {\n var self = this;\n\n if (!this.form) {\n var form = document.createElement('form');\n var area = document.createElement('textarea');\n var id = this.iframeId = 'eio_iframe_' + this.index;\n var iframe;\n form.className = 'socketio';\n form.style.position = 'absolute';\n form.style.top = '-1000px';\n form.style.left = '-1000px';\n form.target = id;\n form.method = 'POST';\n form.setAttribute('accept-charset', 'utf-8');\n area.name = 'd';\n form.appendChild(area);\n document.body.appendChild(form);\n this.form = form;\n this.area = area;\n }\n\n this.form.action = this.uri();\n\n function complete() {\n initIframe();\n fn();\n }\n\n function initIframe() {\n if (self.iframe) {\n try {\n self.form.removeChild(self.iframe);\n } catch (e) {\n self.onError('jsonp polling iframe removal error', e);\n }\n }\n\n try {\n // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n var html = '