akkoma/priv/static/packs/containers/media_container.js.map
FloatingGhost 0d012ebea1 Revert "Merge branch 'remove/mastofe' into 'develop'"
This reverts commit 6b3842cf50, reversing
changes made to 6b1282a829.
2022-01-08 21:44:37 +00:00

1 line
1.2 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["webpack:///./node_modules/lodash/isObject.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/ui/util/reduced_motion.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/ui/util/optional_motion.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/components/relative_timestamp.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/actions/importer/normalizer.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/components/relative_timestamp.js","webpack:///./node_modules/react-redux-loading-bar/build/loading_bar_ducks.js","webpack:///./node_modules/react-swipeable-views-core/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack:///./node_modules/react-motion/lib/Motion.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/locales/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/api.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/is_mobile.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/api.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/containers/media_container.js","webpack:///./node_modules/classnames/index.js","webpack:///./node_modules/react-redux/es/components/Context.js","webpack:///./node_modules/react-redux/es/utils/batch.js","webpack:///./node_modules/react-redux/es/utils/Subscription.js","webpack:///./node_modules/react-redux/es/components/Provider.js","webpack:///./node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js","webpack:///./node_modules/react-redux/es/components/connectAdvanced.js","webpack:///./node_modules/react-redux/es/utils/shallowEqual.js","webpack:///./node_modules/react-redux/es/connect/wrapMapToProps.js","webpack:///./node_modules/react-redux/es/connect/mapDispatchToProps.js","webpack:///./node_modules/react-redux/es/connect/mapStateToProps.js","webpack:///./node_modules/react-redux/es/connect/mergeProps.js","webpack:///./node_modules/react-redux/es/connect/selectorFactory.js","webpack:///./node_modules/react-redux/es/connect/connect.js","webpack:///./node_modules/react-redux/es/hooks/useReduxContext.js","webpack:///./node_modules/react-redux/es/hooks/useStore.js","webpack:///./node_modules/react-redux/es/hooks/useDispatch.js","webpack:///./node_modules/react-redux/es/hooks/useSelector.js","webpack:///./node_modules/react-redux/es/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/is_mobile.js","webpack:///./node_modules/lodash/_baseGetTag.js","webpack:///./node_modules/lodash/isObjectLike.js","webpack:///./node_modules/react-immutable-proptypes/dist/ImmutablePropTypes.js","webpack:///./node_modules/lodash/_Symbol.js","webpack:///./node_modules/blurhash/dist/error.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/actions/importer/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/initial_state.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/actions/importer/index.js","webpack:///./node_modules/http-link-header/lib/link.js","webpack:///./node_modules/symbol-observable/es/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/html.js","webpack:///./node_modules/react-immutable-pure-component/lib/react-immutable-pure-component.es.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/components/permalink.js","webpack:///./node_modules/blurhash/dist/index.js","webpack:///./node_modules/react-swipeable-views/lib/index.js","webpack:///./node_modules/lodash/isSymbol.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/initial_state.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/utils/html.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/audio/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/audio/index.js","webpack:///./node_modules/axios/lib/helpers/bind.js","webpack:///./node_modules/axios/lib/helpers/buildURL.js","webpack:///./node_modules/axios/lib/cancel/isCancel.js","webpack:///./node_modules/axios/lib/defaults.js","webpack:///./node_modules/axios/lib/adapters/xhr.js","webpack:///./node_modules/axios/lib/core/createError.js","webpack:///./node_modules/axios/lib/core/mergeConfig.js","webpack:///./node_modules/axios/lib/cancel/Cancel.js","webpack:///./node_modules/react-redux-loading-bar/build/loading_bar.js","webpack:///./node_modules/blurhash/dist/base83.js","webpack:///./node_modules/blurhash/dist/utils.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/interopRequireDefault.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/components/icon.js","webpack:///./node_modules/react-swipeable-views-core/lib/constant.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/emoji/unicode_to_filename.js","webpack:///./node_modules/wavesurfer.js/dist/wavesurfer.js","webpack:///./node_modules/symbol-observable/es/ponyfill.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/fullscreen.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/ui/util/fullscreen.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/components/icon.js","webpack:///./node_modules/lodash/_freeGlobal.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/components/gifv.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/components/gifv.js","webpack:///./node_modules/react-motion/lib/mapToZero.js","webpack:///./node_modules/react-motion/lib/stripStyle.js","webpack:///./node_modules/react-motion/lib/stepper.js","webpack:///./node_modules/react-motion/node_modules/performance-now/lib/performance-now.js","webpack:///./node_modules/raf/index.js","webpack:///./node_modules/react-motion/lib/shouldStopAnimation.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/components/permalink.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/idna.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/ui/components/zoomable_image.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/ui/components/image_loader.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/ui/components/media_modal.js","webpack:///./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack:///./node_modules/wicg-inert/src/inert.js","webpack:///(webpack)/buildin/harmony-module.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/emoji/unicode_to_filename.js","webpack:///./node_modules/axios/lib/axios.js","webpack:///./node_modules/axios/lib/core/Axios.js","webpack:///./node_modules/axios/lib/core/InterceptorManager.js","webpack:///./node_modules/axios/lib/core/dispatchRequest.js","webpack:///./node_modules/axios/lib/core/transformData.js","webpack:///./node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack:///./node_modules/axios/lib/core/settle.js","webpack:///./node_modules/axios/lib/core/enhanceError.js","webpack:///./node_modules/axios/lib/core/buildFullPath.js","webpack:///./node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack:///./node_modules/axios/lib/helpers/combineURLs.js","webpack:///./node_modules/axios/lib/helpers/parseHeaders.js","webpack:///./node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack:///./node_modules/react-motion/lib/spring.js","webpack:///./node_modules/axios/lib/helpers/cookies.js","webpack:///./node_modules/axios/lib/cancel/CancelToken.js","webpack:///./node_modules/axios/lib/helpers/spread.js","webpack:///./node_modules/lodash/now.js","webpack:///./node_modules/lodash/toNumber.js","webpack:///./node_modules/lodash/_getRawTag.js","webpack:///./node_modules/lodash/_objectToString.js","webpack:///./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","webpack:///./node_modules/react-redux-loading-bar/build/loading_bar_middleware.js","webpack:///./node_modules/react-redux-loading-bar/build/immutable.js","webpack:///./node_modules/performance-now/lib/performance-now.js","webpack:///./node_modules/react-motion/lib/presets.js","webpack:///./node_modules/blurhash/dist/decode.js","webpack:///./node_modules/blurhash/dist/encode.js","webpack:///./node_modules/react-swipeable-views/lib/SwipeableViews.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/extends.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/objectWithoutProperties.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/classCallCheck.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/createClass.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/typeof.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/inherits.js","webpack:///./node_modules/react-swipeable-views/node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack:///./node_modules/react-swipeable-views-core/lib/index.js","webpack:///./node_modules/react-swipeable-views-core/lib/checkIndexBounds.js","webpack:///./node_modules/react-swipeable-views-core/lib/computeIndex.js","webpack:///./node_modules/react-swipeable-views-core/lib/getDisplaySameSlide.js","webpack:///./node_modules/react-swipeable-views-core/lib/mod.js","webpack:///./node_modules/history/es/warnAboutDeprecatedESMImport.js","webpack:///./node_modules/history/es/createBrowserHistory.js","webpack:///./node_modules/immutable/dist/immutable.js","webpack:///./node_modules/axios/lib/utils.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/components/icon_button.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/scrollbar.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/components/modal_root.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/utils/scrollbar.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/components/modal_root.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/ui/components/image_loader.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/ui/components/media_modal.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/actions/polls.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/components/poll.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/emoji/emoji.js","webpack:///./node_modules/escape-html/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/components/icon_button.js","webpack:///./node_modules/lodash/throttle.js","webpack:///./node_modules/react-redux-loading-bar/build/index.js","webpack:///./node_modules/axios/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/emoji/index.js","webpack:///./node_modules/lodash/debounce.js","webpack:///./node_modules/detect-passive-events/lib/index.js","webpack:///./node_modules/warning/warning.js","webpack:///./node_modules/lodash/_root.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/containers/media_container.js","webpack:///./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/emoji/emoji_unicode_mapping_light.js","webpack:///./node_modules/redux/es/redux.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/video/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/mastodon/features/video/index.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/actions/importer/normalizer.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/reduced_motion.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/optional_motion.js","webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/util/emoji/emoji_unicode_mapping_light.js"],"names":["module","exports","value","type","stylesToKeep","ReducedMotion","render","this","props","style","defaultStyle","children","Object","keys","forEach","key","includes","val","React","Component","reduceMotion","Motion","messages","defineMessages","today","just_now","seconds","minutes","hours","days","moments_remaining","seconds_remaining","minutes_remaining","hours_remaining","days_remaining","dateFormatOptions","hour12","year","month","day","hour","minute","shortDateFormatOptions","DAY","timeAgoString","intl","date","now","timeGiven","delta","getTime","formatMessage","number","Math","floor","getFullYear","formatDate","RelativeTimestamp","injectIntl","shouldComponentUpdate","nextProps","nextState","timestamp","locale","state","componentWillReceiveProps","setState","componentDidMount","_scheduleNextUpdate","componentWillUpdate","componentWillUnmount","clearTimeout","_timer","Date","unitDelay","units","getUnitDelay","absDelta","abs","selectUnits","unitRemainder","delay","max","setTimeout","futureDate","relativeTime","timeRemainingString","dateTime","title","domParser","DOMParser","makeEmojiMap","record","emojis","reduce","obj","emoji","shortcode","searchTextFromRawStatus","status","searchContent","spoiler_text","content","concat","poll","options","map","option","join","replace","parseFromString","documentElement","textContent","normalizeAccount","account","emojiMap","displayName","display_name","trim","length","username","display_name_html","emojify","escapeTextContentForBrowser","note_emojified","note","fields","pair","name_emojified","name","value_emojified","value_plain","unescapeHTML","moved","id","normalizeStatus","normalOldStatus","normalStatus","reblog","search_index","get","contentHtml","spoilerHtml","hidden","spoilerText","expandSpoilers","sensitive","normalizePoll","normalPoll","index","voted","own_votes","title_emojified","normalizeAnnouncement","announcement","normalAnnouncement","defineProperty","_extends","assign","target","i","arguments","source","prototype","hasOwnProperty","call","_defineProperty","enumerable","configurable","writable","showLoading","scope","undefined","DEFAULT_SCOPE","SHOW","payload","hideLoading","HIDE","resetLoading","RESET","loadingBarReducer","action","_ref$scope","__esModule","default","_createClass","defineProperties","descriptor","Constructor","protoProps","staticProps","_interopRequireDefault","_mapToZero2","_stripStyle2","_stepper4","_performanceNow2","_raf2","_shouldStopAnimation2","_react2","_propTypes2","msPerFrame","_React$Component","_this","instance","TypeError","_classCallCheck","wasAnimating","animationID","prevTime","accumulatedTime","unreadPropStyle","clearUnreadPropStyle","destStyle","dirty","_state","currentStyle","currentVelocity","lastIdealStyle","lastIdealVelocity","styleValue","startAnimationIfNecessary","propsStyle","onRest","currentTime","timeDelta","currentFrameCompletion","framesToCatchUp","newLastIdealStyle","newLastIdealVelocity","newCurrentStyle","newCurrentVelocity","newLastIdealStyleValue","newLastIdealVelocityValue","_stepper","stiffness","damping","precision","_stepper2","nextIdealX","nextIdealV","defaultState","subClass","superClass","create","constructor","setPrototypeOf","__proto__","_inherits","objectOf","oneOfType","object","isRequired","func","_props","cancel","renderedChildren","Children","only","getLinks","response","headers","link","LinkHeader","parse","refs","getState","axios","getIn","transformResponse","data","JSON","Exception","LAYOUT_BREAKPOINT","isMobile","width","iOS","test","navigator","userAgent","window","MSStream","userTouching","listenerOptions","detectPassiveEvents","hasSupport","passive","isUserTouching","isIOS","addEventListener","touchListener","removeEventListener","getLocale","localeData","addLocaleData","MEDIA_COMPONENTS","MediaGallery","Video","Card","Poll","Hashtag","Audio","MediaContainer","media","time","document","body","classList","add","marginRight","getScrollbarWidth","video","ImmutableList","remove","components","component","componentName","getAttribute","card","hashtag","fromJS","onOpenVideo","handleOpenVideo","onOpenMedia","handleOpenMedia","ReactDOM","createPortal","onClose","handleCloseMedia","PureComponent","hasOwn","classNames","classes","arg","argType","push","Array","isArray","inner","apply","ReactReduxContext","createContext","callback","getBatch","nullListeners","notify","Subscription","store","parentSub","unsubscribe","listeners","handleChangeWrapper","bind","_proto","addNestedSub","listener","trySubscribe","subscribe","notifyNestedSubs","onStateChange","isSubscribed","Boolean","batch","first","last","clear","next","prev","tryUnsubscribe","_ref","context","contextValue","subscription","previousState","Context","createElement","Provider","useIsomorphicLayoutEffect","EMPTY_ARRAY","NO_SUBSCRIPTION_ARRAY","storeStateUpdatesReducer","updateCount","useIsomorphicLayoutEffectWithArgs","effectFunc","effectArgs","dependencies","captureWrapperProps","lastWrapperProps","lastChildProps","renderIsScheduled","wrapperProps","actualChildProps","childPropsFromStoreUpdate","current","subscribeUpdates","shouldHandleStateChanges","childPropsSelector","forceComponentUpdateDispatch","didUnsubscribe","lastThrownError","checkForUpdates","newChildProps","error","latestStoreState","e","initStateUpdates","connectAdvanced","selectorFactory","_ref2","_ref2$getDisplayName","getDisplayName","_ref2$methodName","methodName","_ref2$renderCountProp","renderCountProp","_ref2$shouldHandleSta","_ref2$storeKey","storeKey","_ref2$forwardRef","withRef","forwardRef","_ref2$context","connectOptions","WrappedComponent","wrappedComponentName","selectorFactoryOptions","pure","usePureOnlyMemo","ConnectFunction","_useMemo","forwardedRef","propsContext","ContextToUse","Consumer","didStoreComeFromProps","dispatch","createChildSelector","_useMemo2","overriddenContextValue","_useReducer","previousStateUpdateResult","renderedWrappedComponent","ref","Connect","memo","forwarded","is","x","y","shallowEqual","objA","objB","keysA","keysB","wrapMapToPropsConstant","getConstant","constant","constantSelector","dependsOnOwnProps","getDependsOnOwnProps","mapToProps","wrapMapToPropsFunc","proxy","stateOrDispatch","ownProps","mapDispatchToProps","mapStateToProps","defaultMergeProps","stateProps","dispatchProps","mergeProps","mergedProps","areMergedPropsEqual","hasRunOnce","nextMergedProps","wrapMergePropsFunc","impureFinalPropsSelectorFactory","pureFinalPropsSelectorFactory","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","hasRunAtLeastOnce","handleSubsequentCalls","nextOwnProps","nextStateProps","statePropsChanged","propsChanged","stateChanged","finalPropsSelectorFactory","initMapStateToProps","initMapDispatchToProps","initMergeProps","match","factories","result","Error","strictEqual","a","b","createConnect","_temp","_ref$connectHOC","connectHOC","_ref$mapStateToPropsF","mapStateToPropsFactories","_ref$mapDispatchToPro","mapDispatchToPropsFactories","_ref$mergePropsFactor","mergePropsFactories","_ref$selectorFactory","_ref3","_ref3$pure","_ref3$areStatesEqual","_ref3$areOwnPropsEqua","_ref3$areStatePropsEq","_ref3$areMergedPropsE","extraOptions","createStoreHook","useReduxContext","createDispatchHook","useStore","useDispatch","refEquality","createSelectorHook","selector","equalityFn","_useReduxContext","contextSub","selectedState","forceRender","s","latestSubscriptionCallbackError","latestSelector","latestSelectedState","err","message","stack","newSelectedState","useSelectorWithStoreAndSubscription","newBatch","useSelector","columns","forceSingleColumn","Symbol","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","toStringTag","ImmutablePropTypes","Immutable","ANONYMOUS","productionTypeChecker","invariant","getProductionTypeChecker","getPropType","propValue","propType","RegExp","Iterable","toSource","split","createChainableTypeChecker","validate","checkType","propName","location","propFullName","_len","rest","_key","chainedCheckType","createIterableSubclassTypeChecker","subclassName","validator","immutableClassName","immutableClassTypeValidator","isIterable","listOf","mapOf","orderedMapOf","setOf","orderedSetOf","stackOf","iterableOf","recordOf","shape","contains","mapContains","orderedMapContains","list","orderedMap","set","orderedSet","seq","iterable","indexed","isIndexed","keyed","isKeyed","_extendStatics","__extends","d","p","__","ValidationError","_super","ACCOUNT_IMPORT","ACCOUNTS_IMPORT","STATUS_IMPORT","STATUSES_IMPORT","POLLS_IMPORT","pushUnique","array","every","element","importAccount","importStatus","importPolls","polls","importFetchedAccount","importFetchedAccounts","accounts","normalAccounts","processAccount","importAccounts","importFetchedStatus","importFetchedStatuses","statuses","normalStatuses","processStatus","importStatuses","importFetchedPoll","prop","getElementById","initialState","local_settings","localStorage","getItem","getMeta","meta","autoPlayGif","displayMedia","unfollowModal","boostModal","favouriteModal","deleteModal","me","searchEnabled","maxChars","pollLimits","poll_limits","mascot","profile_directory","isStaff","defaultContentType","useBlurhash","usePendingItems","useSystemEmojiFont","showTrends","deleteOthersNotice","rights","COMPATIBLE_ENCODING_PATTERN","WS_TRIM_PATTERN","WS_CHAR_PATTERN","WS_FOLD_PATTERN","DELIMITER_PATTERN","WS_DELIMITER_PATTERN","STATE","hasWhitespace","skipWhitespace","offset","needsQuotes","Link","rel","links","attr","toLowerCase","has","slice","end","indexOf","uri","attrValue","isSingleOccurenceAttr","parseExtendedValue","toString","formatAttribute","isCompatibleEncoding","isTokenAttr","escapeQuotes","parts","exec","language","encoding","decodeURIComponent","formatExtendedAttribute","toUpperCase","Buffer","isBuffer","encodeURIComponent","item","root","self","global","html","wrapper","innerHTML","ImmutablePureComponent","ReferenceError","_possibleConstructorReturn","getPrototypeOf","_this2","updateOnProps","updateOnStates","Permalink","button","ctrlKey","metaKey","onInterceptClick","preventDefault","router","history","mastodonBackSteps","to","className","href","other","onClick","handleClick","PropTypes","decode_1","decode","isBlurhashValid","encode_1","encode","m","__export","_default","baseGetTag","isObjectLike","symbolTag","invitesEnabled","repository","source_url","version","cropImages","play","pause","mute","unmute","download","duration","paused","muted","volume","v","volWidth","volOffset","c","waveform","preload","loaded","wavesurfer","createBackend","createPeakCache","load","src","toggleInteraction","setMute","handleMouseVolSlide","handleVolumeMouseUp","stopPropagation","rect","getBoundingClientRect","clientX","left","isNaN","slideamt","setVolume","_updateWaveform","componentDidUpdate","prevProps","destroy","height","peaks","progressColor","getComputedStyle","querySelector","getPropertyValue","waveColor","WaveSurfer","container","barWidth","cursorWidth","backend","interact","on","getDuration","getCurrentTime","alt","editable","volumeWidth","volumeHandleLoc","volHandleOffset","display","aria-label","setWaveformRef","togglePlay","fixedWidth","toggleMute","onMouseDown","handleVolumeMouseDown","setVolumeRef","tabIndex","formatTime","top","inView","innerHeight","clientHeight","trailing","handleScroll","fn","thisArg","args","utils","url","params","paramsSerializer","serializedParams","isURLSearchParams","isDate","toISOString","isObject","stringify","hashmarkIndex","__CANCEL__","normalizeHeaderName","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","isUndefined","adapter","defaults","XMLHttpRequest","process","transformRequest","isFormData","isArrayBuffer","isStream","isFile","isBlob","isArrayBufferView","buffer","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","validateStatus","common","method","merge","settle","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","config","Promise","resolve","reject","requestData","requestHeaders","request","auth","password","Authorization","btoa","fullPath","baseURL","open","onreadystatechange","readyState","responseURL","responseHeaders","getAllResponseHeaders","responseType","responseText","statusText","onabort","onerror","ontimeout","timeoutErrorMessage","isStandardBrowserEnv","cookies","xsrfValue","withCredentials","read","setRequestHeader","onDownloadProgress","onUploadProgress","upload","cancelToken","promise","then","abort","send","enhanceError","code","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","deepMerge","axiosKeys","otherKeys","filter","Cancel","LoadingBar","TERMINATING_ANIMATION_DURATION","ANIMATION_DURATION","PROGRESS_INCREASE","MAX_PROGRESS","UPDATE_TIME","_react","_reactLifecyclesCompat","_propTypes","_reactRedux","_loading_bar_ducks","percent","_Component","reset","terminatingAnimationTimeoutId","newPercent","progressIncrease","cos","PI","simulateProgress","prevState","maxProgress","start","stop","clearInterval","progressIntervalId","setInterval","updateTime","terminatingAnimationDuration","isShown","showFastActions","animationDuration","opacity","transform","msTransform","WebkitTransform","MozTransform","OTransform","transformOrigin","msTransformOrigin","WebkitTransformOrigin","MozTransformOrigin","OTransformOrigin","transition","msTransition","WebkitTransition","MozTransition","OTransition","willChange","backgroundColor","position","buildStyle","loading","shouldStart","shouldStop","propTypes","string","bool","defaultProps","polyfill","ConnectedLoadingBar","connect","loadingBar","digitCharacters","decode83","str","encode83","n","digit","pow","sRGBToLinear","linearTosRGB","min","round","sign","signPow","exp","Icon","role","RESISTANCE_COEF","UNCERTAINTY_THRESHOLD","unicodeToFilename","charCode","charCodeAt","factory","modules","installedModules","__webpack_require__","moduleId","l","getter","o","r","t","mode","ns","property","debounce","wait","immediate","later","debounced","callNow","flush","_style","_getId","_defineProperties","CanvasEntry","wave","waveCtx","progress","progressCtx","canvasContextAttributes","getContext","elementWidth","totalWidth","offsetLeft","elementSize","hasProgressCanvas","clearRect","canvas","fillStyle","radius","fillRectToContext","ctx","drawRoundedRect","fillRect","beginPath","moveTo","lineTo","quadraticCurveTo","closePath","fill","absmax","halfH","offsetY","drawLineToContext","peak","h","canvasStart","canvasEnd","scale","halfOffset","absmaxHalf","halfPixel","j","format","quality","toBlob","toDataURL","util","_typeof","cache","_getRequireWildcardCache","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","_interopRequireWildcard","WeakMap","iterator","_assertThisInitialized","_getPrototypeOf","_setPrototypeOf","Drawer","_util$Observer","pixelRatio","lastPos","el","styles","appendChild","userSelect","webkitUserSelect","fillParent","scrollParent","overflowX","hideScrollbar","overflowY","setupWrapperEvents","noPrevent","targetTouches","bbox","nominalWidth","parentWidth","getWidth","rtl","right","scrollLeft","scrollWidth","scrollbarHeight","offsetHeight","clientY","bottom","fireEvent","handleEvent","setWidth","clearWave","drawBars","drawWave","recenterOnPosition","half","clientWidth","maxScroll","rate","autoCenterRate","updateSize","_progress","minPxDelta","pos","autoCenter","newPos","autoCenterImmediately","updateProgress","unAll","parentNode","removeChild","channelIndex","Observer","_drawer","_drawer2","MultiCanvas","_Drawer","maxCanvasWidth","maxCanvasElementWidth","canvases","progressWave","EntryClass","drawingContextAttributes","overlap","ceil","barRadius","createWrapper","createElements","zIndex","overflow","boxSizing","borderRightStyle","pointerEvents","addCanvas","updateCursor","borderRightWidth","borderRightColor","cursorColor","requiredCanvases","removeCanvas","canvasWidth","lastCanvas","entry","updateDimensions","leftOffset","initWave","initProgress","lastEntry","parentElement","pop","_this3","prepareDraw","hasMinVals","peakIndexScale","bar","step","barGap","barMinHeight","_this4","reflectedPeaks","len","drawLine","_this5","setFillStyles","drawLines","startCanvas","endCanvas","intersection","x1","y1","x2","y2","fillRects","_this6","frame","channels","splitChannels","setHeight","channelPeaks","barHeight","normalize","some","all","getImage","images","_get","receiver","Reflect","base","_superPropBase","MediaElementWebAudio","_MediaElement","sourceMediaElement","setPlaybackRate","audioRate","createTimer","createVolumeNode","createScriptNode","createAnalyserNode","createMediaElementSource","mediaElement","ac","analyser","_webaudio","MediaElement","_WebAudio","playbackRate","mediaType","elementPosition","isMuted","onPlayEnd","mediaListeners","canplay","ended","seeked","event","volumechange","onAudioProcess","isPaused","controls","mediaControls","autoplay","prevMedia","_load","elt","HTMLMediaElement","_setupMediaListeners","explicitDuration","Infinity","seekable","clearPlayEnd","seekTo","setPlayEnd","_onPlayEnd","un","deviceId","setSinkId","destroyed","removeMediaElementOnDestroy","PeakCache","clearPeakCache","peakCacheRanges","peakCacheLength","uncachedRanges","arr","sort","uncachedRangePairs","peakCacheRangePairs","_observer","xhr","fired100","header","lengthComputable","total","dest","console","warn","sources","fetchHeaders","Headers","fetchRequest","Request","controller","AbortController","append","fetchOptions","credentials","redirect","referrer","signal","fetch","progressAvailable","contentLength","onProgress","Response","ReadableStream","ProgressHandler","errMsg","ok","arrayBuffer","json","blob","text","catch","_reader","getReader","parseInt","done","close","byteLength","enqueue","_requestAnimationFrame","prefix","random","substring","_ajax","_max","_min","_extend","_frame","_debounce","_preventClick","_fetch","values","largest","smallest","Number","handlers","splice","handler","_len2","_key2","preventClickHandler","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","_mediaelement","_peakcache","_mediaelementWebaudio","defaultParams","audioContext","audioScriptProcessor","dragSelection","desynchronized","forceDecode","loopSelection","mediaContainer","minPxPerSec","partialRender","devicePixelRatio","screen","deviceXDPI","logicalXDPI","plugins","renderer","responsive","skipLength","backends","WebAudio","setBackgroundColor","savedVolume","tmpEvents","currentRequest","arraybuffer","drawer","peakCache","supportsWebAudio","Backend","initialisedPluginList","isDestroyed","isReady","prevWidth","_onResize","init","registerPlugins","createDrawer","plugin","addPlugin","deferInit","initPlugin","pluginStaticProp","Instance","getOwnPropertyNames","destroyPlugin","drawBuffer","getPlayedPercents","newVolume","getVolume","_this7","skip","seekAndCenter","recenter","_this8","isFinite","oldScrollParent","getPlaybackRate","filters","color","background","newRanges","addRangeToPeakCache","getPeaks","drawPeaks","pxPerSec","_this9","decodeArrayBuffer","loadDecodedBuffer","_this10","reader","FileReader","loadArrayBuffer","readAsArrayBuffer","empty","preloadIgnoreReasons","activeReasons","reason","loadBuffer","loadMediaElement","_this11","once","getArrayBuffer","setPeaks","urlOrElt","_this12","loadElt","_this13","_this14","fetchFile","percentComplete","accuracy","noWindow","disconnectSource","cancelAjax","clearTmpEvents","destroyAllPlugins","VERSION","PLAYING","PAUSED","FINISHED","_this$stateBehaviors","_this$states","offlineAudioContext","stateBehaviors","addOnAudioProcess","startPosition","getPlayedTime","removeOnAudioProcess","getAudioContext","lastPlay","scheduledPause","states","gainNode","mergedPeaks","offlineAc","scriptNode","splitPeaks","AudioContext","webkitAudioContext","WaveSurferAudioContext","sampleRate","WaveSurferOfflineAudioContext","OfflineAudioContext","webkitOfflineAudioContext","setLength","disconnect","setFilters","disconnectFilters","curr","createScriptProcessor","scriptBufferSize","createJavaScriptNode","destination","onaudioprocess","createAnalyser","createGain","createGainNode","audio","createMediaStreamDestination","srcObject","stream","gain","setValueAtTime","errback","getOfflineAudioContext","decodeAudioData","numberOfChannels","newBuffer","createBuffer","sampleSize","sampleStep","chan","getChannelData","closeAudioContext","createSource","createBufferSource","noteGrainOn","noteOff","adjustedTime","resume","symbolObservablePonyfill","observable","isFullscreen","fullscreenElement","webkitFullscreenElement","mozFullScreenElement","exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","attachFullscreenListener","detachFullscreenListener","freeGlobal","GIFV","loop","autoPlay","playsInline","onLoadedData","handleLoadedData","ret","secondPerFrame","destX","k","newV","newX","reusedTuple","getNanoSeconds","hrtime","loadTime","performance","hr","vendors","suffix","raf","caf","queue","_now","cp","cancelled","handle","cancelAnimationFrame","domain","part","punycode","MIN_SCALE","MAX_SCALE","getMidpoint","p1","p2","getDistance","sqrt","clamp","ZoomableImage","touches","lastDistance","scrollTop","scrollHeight","distance","midpoint","zoom","lastMidpoint","image","handleTouchStart","removers","handleTouchMove","removeEventListeners","nextScale","nextScrollLeft","nextScrollTop","setContainerRef","setImageRef","ImageLoader","previewSrc","Image","handleError","handleLoad","canvasContext","drawImage","offsetWidth","loadImage","loadPreviewCanvas","hasSize","loadOriginalImage","clearPreviewCanvas","setCanvasRef","_canvasContext","previous","previewState","MediaModal","navigationHidden","size","getIndex","currentTarget","handlePrevClick","handleNextClick","handleKeyDown","pathname","unlistenHistory","listen","goBack","pagination","leftNav","rightNav","handleChangeIndex","data-index","toggleNavigation","preview","blurhash","startTime","onCloseVideo","detailed","toArray","navigationClassName","containerStyle","alignItems","onChangeIndex","handleSwipe","icon","handleStatusClick","defaultMessage","_objectWithoutPropertiesLoose","excluded","sourceKeys","matches","Element","msMatchesSelector","_focusableElementsString","InertRoot","rootElement","inertManager","_inertManager","_rootElement","_managedNodes","Set","hasAttribute","_savedAriaHidden","setAttribute","_makeSubtreeUnfocusable","MutationObserver","_onMutation","observe","attributes","childList","subtree","destructor","removeAttribute","inertNode","_unmanageNode","node","startNode","composedTreeWalk","_visitNode","activeElement","nodeType","Node","DOCUMENT_FRAGMENT_NODE","blur","focus","ELEMENT_NODE","_adoptInertRoot","_manageNode","register","deregister","delete","_unmanageSubtree","inertSubroot","getInertRoot","setInert","managedNodes","savedInertNode","records","addedNodes","removedNodes","attributeName","managedNode","ariaHidden","InertNode","inertRoot","_node","_overrodeFocusMethod","_inertRoots","_savedTabIndex","_destroyed","ensureUntabbable","_proto2","_throwIfDestroyed","hasSavedTabIndex","addInertRoot","removeInertRoot","shadowRootAncestor","shadowRoot","localName","distributedNodes","getDistributedNodes","slot","_distributedNodes","assignedNodes","flatten","_i","child","firstChild","nextSibling","addInertStyle","InertManager","_document","Map","_watchForInert","head","_onDocumentLoaded","_proto3","inert","parent","querySelectorAll","inertElement","inertElements","unshift","originalModule","webpackPolyfill","Axios","mergeConfig","createInstance","defaultConfig","extend","instanceConfig","CancelToken","isCancel","promises","spread","InterceptorManager","dispatchRequest","interceptors","chain","interceptor","fulfilled","rejected","shift","getUri","use","eject","transformData","throwIfCancellationRequested","throwIfRequested","fns","normalizedName","isAxiosError","toJSON","description","fileName","lineNumber","columnNumber","isAbsoluteURL","combineURLs","requestedURL","relativeURL","ignoreDuplicateOf","parsed","line","substr","originURL","msie","urlParsingNode","resolveURL","protocol","host","search","hash","hostname","port","charAt","requestURL","isString","_presets","_presets2","noWobble","write","expires","path","secure","cookie","isNumber","toGMTString","executor","resolvePromise","token","isSymbol","NAN","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","valueOf","isBinary","objectProto","nativeObjectToString","isOwn","tag","unmasked","componentWillMount","getDerivedStateFromProps","__reactInternalSnapshotFlag","__reactInternalSnapshot","getSnapshotBeforeUpdate","isReactComponent","foundWillMountName","foundWillReceivePropsName","foundWillUpdateName","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate","newApiName","maybeSnapshot","snapshot","__suppressDeprecationWarning","_slicedToArray","_arr","_n","_d","_e","_s","sliceIterator","promiseTypeSuffixes","defaultTypeSuffixes","_promiseTypeSuffixes","PENDING","FULFILLED","REJECTED","isPending","isFulfilled","isRejected","actionScope","_loading_bar","moduleLoadTime","nodeLoadTime","upTime","uptime","gentle","wobbly","stiff","base83_1","utils_1","error_1","validateBlurhash","sizeFlag","numY","numX","errorReason","decodeDC","intR","intG","intB","decodeAC","maximumValue","quantR","quantG","quantB","punch","colors","bytesPerRow","pixels","Uint8ClampedArray","g","basis","componentX","componentY","factors","_loop_1","_loop_2","normalisation","factor","basisFunction","multiplyBasisFunction","dc","actualMaximumValue","quantisedMaximumValue","encodeAC","getDomTreeShapes","findNativeHandler","_extends2","_objectWithoutProperties2","_classCallCheck2","_createClass2","_possibleConstructorReturn2","_getPrototypeOf2","_inherits2","_reactSwipeableViewsCore","direction","WebkitFlexShrink","flexShrink","axisProperties","flexDirection","translate","rotationMatrix","scrollPosition","scrollLength","clientLength","createTransition","easeFunction","applyRotationMatrix","touch","axis","pageX","pageY","adaptMouse","rootNode","domTreeShapes","nodeWhoClaimedTheScroll","startX","goingForward","areNotAtStart","areNotAtEnd","SwipeableViews","containerNode","ignoreNextScrollEvents","viewLength","lastX","vx","startY","isSwiping","started","startIndex","transitionListener","touchMoveListener","activeSlide","indexCurrent","firstRenderTimeout","setRootNode","setContainerNode","setActiveSlide","updateHeight","handleSwipeStart","computedStyle","transformValues","rootStyle","tranformNormalized","paddingLeft","paddingRight","handleSwipeMove","_this$props","ignoreNativeScroll","onSwitching","resistance","dx","dy","count","_computeIndex","computeIndex","setIndexCurrent","displaySameSlide","isDragging","handleSwipeEnd","indexNew","indexLatest","threshold","hysteresis","indexMax","handleTransitionEnd","onTouchStart","handleTouchEnd","onTouchEnd","handleMouseDown","persist","handleMouseUp","onMouseUp","handleMouseLeave","onMouseLeave","handleMouseMove","onMouseMove","onScroll","heightLatest","renderOnlyActive","disableLazyLoading","swipeableViews","slideUpdateHeight","disabled","getDisplaySameSlide","animateTransitions","onTransitionEnd","_this$props2","animateHeight","containerStyleProp","enableMouseEvents","slideStyleProp","slideStyle","slideClassName","springConfig","_this$state","touchEvents","mouseEvents","additionalTranstion","WebkitFlexDirection","indexChild","childContextTypes","objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","assertThisInitialized","_typeof2","_checkIndexBounds","_constant","_getDisplaySameSlide","_mod","newStartX","getChildrenKey","oldKey","q","SLICE$0","createClass","ctor","Seq","KeyedIterable","KeyedSeq","IndexedIterable","IndexedSeq","SetIterable","isAssociative","SetSeq","maybeIterable","IS_ITERABLE_SENTINEL","maybeKeyed","IS_KEYED_SENTINEL","maybeIndexed","IS_INDEXED_SENTINEL","maybeAssociative","isOrdered","maybeOrdered","IS_ORDERED_SENTINEL","Keyed","Indexed","SHIFT","SIZE","MASK","NOT_SET","CHANGE_LENGTH","DID_ALTER","MakeRef","SetRef","OwnerID","arrCopy","newArr","ii","ensureSize","iter","__iterate","returnTrue","wrapIndex","uint32Index","NaN","wholeSlice","begin","resolveBegin","resolveIndex","resolveEnd","defaultIndex","ITERATE_KEYS","ITERATE_VALUES","ITERATE_ENTRIES","REAL_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","ITERATOR_SYMBOL","Iterator","iteratorValue","iteratorResult","iteratorDone","hasIterator","getIteratorFn","isIterator","maybeIterator","getIterator","iteratorFn","isArrayLike","emptySequence","toSeq","maybeIndexedSeqFromValue","ObjectSeq","seqFromValue","toKeyedSeq","fromEntrySeq","keyedSeqFromValue","entrySeq","toIndexedSeq","indexedSeqFromValue","toSetSeq","KEYS","VALUES","ENTRIES","inspect","of","__toString","cacheResult","_cache","__iterateUncached","reverse","seqIterate","__iterator","seqIterator","isSeq","EMPTY_SEQ","EMPTY_REPEAT","EMPTY_RANGE","IS_SEQ_SENTINEL","ArraySeq","_array","_object","_keys","IterableSeq","_iterable","IteratorSeq","_iterator","_iteratorCache","maybeSeq","useKeys","maxIndex","__iteratorUncached","converter","fromJSWith","parentJSON","isPlainObj","fromJSDefault","toList","toMap","valueA","valueB","equals","deepEqual","__hash","notAssociative","entries","flipped","_","allEqual","bSize","Repeat","times","_value","condition","Range","_start","_end","_step","Collection","KeyedCollection","IndexedCollection","SetCollection","notSetValue","iterations","searchValue","lastIndexOf","this$0","possibleIndex","offsetValue","imul","smi","i32","STRING_HASH_CACHE_MIN_STRLEN","stringHashCache","hashString","STRING_HASH_CACHE_SIZE","STRING_HASH_CACHE_MAX_SIZE","cachedHashString","hashCode","usingWeakMap","weakMap","UID_HASH_KEY","canDefineProperty","uniqueID","getIENodeHash","objHashUID","isExtensible","hashJSObj","assertNotInfinite","emptyMap","isMap","withMutations","maybeMap","IS_MAP_SENTINEL","keyValues","_root","updateMap","setIn","keyPath","updateIn","deleteIn","update","updater","updatedValue","updateInDeepMap","existing","keyPathIter","isNotSet","existingValue","newValue","nextExisting","nextUpdated","forceIterator","__ownerID","__altered","mergeIntoMapWith","mergeWith","merger","iters","mergeIn","mergeDeep","deepMerger","mergeDeepWith","deepMergerWith","mergeDeepIn","comparator","OrderedMap","sortFactory","sortBy","mapper","mutable","asMutable","wasAltered","__ensureOwner","asImmutable","MapIterator","iterate","ownerID","makeMap","EMPTY_MAP","MapPrototype","ArrayMapNode","BitmapIndexedNode","bitmap","nodes","HashArrayMapNode","HashCollisionNode","keyHash","ValueNode","_type","_reverse","_stack","mapIteratorFrame","mapIteratorValue","__prev","newRoot","newSize","didChangeSize","didAlter","updateNode","isLeafNode","mergeIntoNode","newNode","idx1","idx2","iterables","mergeIntoCollectionWith","nextValue","collection","mergeIntoMap","popCount","idx","canEdit","newArray","removeIn","removed","exists","MAX_ARRAY_MAP_SIZE","createNodes","isEditable","newEntries","bit","keyHashFrag","MAX_BITMAP_INDEXED_SIZE","including","expandedNodes","expandNodes","newBitmap","newNodes","newLen","after","spliceOut","spliceIn","newCount","MIN_HASH_ARRAY_MAP_SIZE","excluding","packedII","packedNodes","packNodes","keyMatch","subNode","List","emptyList","isList","makeList","VNode","setSize","maybeList","IS_LIST_SENTINEL","listNodeFor","_origin","setListBounds","newTail","_tail","getTailOffset","_capacity","updateVNode","_level","updateList","insert","oldSize","mergeIntoListWith","iterateList","DONE","ListPrototype","removeBefore","level","originIndex","newChild","removingFirst","oldChild","editableVNode","removeAfter","sizeIndex","EMPTY_LIST","EMPTY_ORDERED_MAP","tailPos","tail","iterateNodeOrLeaf","from","iterateLeaf","iterateNode","origin","capacity","nodeHas","lowerNode","newLowerNode","rawIndex","owner","oldOrigin","oldCapacity","newOrigin","newCapacity","newLevel","offsetShift","oldTailOffset","newTailOffset","oldTail","beginIndex","maxSize","emptyOrderedMap","isOrderedMap","maybeOrderedMap","makeOrderedMap","omap","_map","_list","updateOrderedMap","newMap","newList","flip","ToKeyedSequence","_iter","_useKeys","ToIndexedSequence","ToSetSequence","FromEntriesSequence","flipFactory","flipSequence","makeSequence","reversedSequence","cacheResultThrough","mapFactory","mappedSequence","reverseFactory","filterFactory","predicate","filterSequence","sliceFactory","originalSize","resolvedBegin","resolvedEnd","sliceSize","resolvedSize","sliceSeq","skipped","isSkipping","skipWhileFactory","skipSequence","skipping","concatFactory","isKeyedIterable","singleton","concatSeq","sum","flattenFactory","depth","flatSequence","stopped","flatDeep","currentDepth","defaultComparator","maxFactory","maxCompare","comp","zipWithFactory","keyIter","zipper","zipSequence","iterators","isDone","steps","reify","validateEntry","resolveSize","iterableClass","Record","defaultValues","hasInitialized","RecordType","names","setProp","setProps","RecordTypePrototype","_name","_defaultValues","RecordPrototype","valueSeq","indexedIterable","recordName","defaultVal","_empty","makeRecord","likeRecord","emptySet","isSet","maybeSet","IS_SET_SENTINEL","fromKeys","keySeq","updateSet","union","intersect","originalSet","subtract","OrderedSet","__make","EMPTY_SET","SetPrototype","__empty","makeSet","emptyOrderedSet","isOrderedSet","maybeOrderedSet","EMPTY_ORDERED_SET","OrderedSetPrototype","makeOrderedSet","Stack","emptyStack","isStack","unshiftAll","maybeStack","IS_STACK_SENTINEL","_head","peek","makeStack","pushAll","EMPTY_STACK","StackPrototype","mixin","methods","keyCopier","toJS","__toJS","toObject","toOrderedMap","toOrderedSet","toSet","toStack","__toStringMapper","returnValue","find","findEntry","sideEffect","separator","joined","isFirst","reducer","initialReduction","reduction","useFirst","reduceRight","reversed","not","butLast","isEmpty","countBy","grouper","groups","countByFactory","entriesSequence","entryMapper","filterNot","found","findKey","findLast","findLastEntry","findLastKey","flatMap","coerce","flatMapFactory","searchKey","searchKeyPath","nested","groupBy","isKeyedIter","groupByFactory","hasIn","isSubset","isSuperset","keyOf","keyMapper","lastKeyOf","maxBy","neg","defaultNegComparator","minBy","amount","skipLast","skipWhile","skipUntil","take","takeLast","takeWhile","takeSequence","iterating","takeWhileFactory","takeUntil","ordered","murmurHashOfSize","hashMerge","hashIterable","IterablePrototype","quoteString","mapEntries","mapKeys","KeyedIterablePrototype","String","defaultZipper","findIndex","removeNum","numArgs","spliced","findLastIndex","interpose","interposedSequence","interposeFactory","interleave","zipped","interleaved","zip","zipWith","isFunction","FormData","ArrayBuffer","isView","pipe","URLSearchParams","product","assignValue","IconButton","activate","deactivate","onKeyPress","onKeyDown","animate","active","fontSize","lineHeight","activeStyle","label","textAlign","expanded","inverted","overlay","pressed","overlayed","aria-pressed","aria-expanded","handleKeyPress","aria-hidden","cachedScrollbarWidth","scrollbarWidth","outer","visibility","getActualScrollbarWidth","ModalRoot","revealed","keyCode","noEsc","focusable","shiftKey","childNodes","handleKeyUp","createHistory","getSiblings","sibling","preventScroll","handleModalClose","handleModalOpen","mastodonModalOpen","visible","setRef","innerWidth","vote","pollId","choices","voteRequest","api","post","voteSuccess","voteFail","fetchPoll","fetchPollRequest","fetchPollSuccess","fetchPollFail","closed","selected","expired","tmp","_toggleOption","expires_at","_setupTimer","renderOption","optionIndex","showResults","pollVotesCount","leading","titleEmojified","selectable","checked","onChange","handleOptionChange","checkbox","handleOptionKeyPress","aria-checked","dangerouslySetInnerHTML","__html","spring","timeRemaining","votesCount","handleVote","handleRefresh","trie","Trie","unicodeMapping","assetHost","env","CDN_HOST","customEmojis","tagCharsWithEmojis","rtn","tagChars","invisible","codePointAt","rend","replacement","lt","shortname","filename","static_url","startsWith","shortCode","buildCustomEmojis","short_names","emoticons","keywords","imageUrl","custom","customCategory","categoriesFromEmojis","matchHtmlRegExp","escape","lastIndex","FUNC_ERROR_TEXT","loadingBarMiddleware","ImmutableLoadingBar","_loading_bar2","_loading_bar_middleware2","_immutable2","toNumber","nativeMax","nativeMin","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","maxing","invokeFunc","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","timeWaiting","remainingWait","isInvoking","leadingEdge","noop","warning","freeSelf","Function","require","shortCodesToEmojiData","emojisWithoutShortCodes","processEmojiMapData","emojiMapData","native","randomString","ActionTypes","INIT","REPLACE","PROBE_UNKNOWN_ACTION","isPlainObject","proto","createStore","preloadedState","enhancer","currentReducer","currentState","currentListeners","nextListeners","isDispatching","ensureCanMutateNextListeners","replaceReducer","nextReducer","outerSubscribe","observer","observeState","bindActionCreator","actionCreator","bindActionCreators","actionCreators","boundActionCreators","ownKeys","enumerableOnly","sym","_objectSpread2","getOwnPropertyDescriptors","compose","funcs","applyMiddleware","middlewares","_dispatch","middlewareAPI","middleware","hide","expand","fullscreen","exit_fullscreen","secondsNum","findElementPosition","box","docEl","clientLeft","pageXOffset","clientTop","pageYOffset","getPointerPosition","boxW","boxH","boxY","boxX","changedTouches","dragging","containerWidth","hovered","player","cacheWidth","seek","_decode","onToggleVisibility","buffered","preview_url","handleFullscreenChange","preventPlayback","imageData","ImageData","putImageData","inline","letterbox","fullwidth","playerStyle","computedClass","inactive","setPlayerRef","tabindex","onMouseEnter","handleMouseEnter","handleMouseDownRoot","setVideoRef","poster","onPlay","handlePlay","onPause","handlePause","onTimeUpdate","handleTimeUpdate","handleProgress","onVolumeChange","handleVolumeChange","toggleReveal","setSeekRef","autoFocus","handleCloseVideo","toggleFullscreen","handleClickRoot"],"mappings":";2EA8BAA,EAAOC,QALP,SAAkBC,GAChB,IAAIC,SAAcD,EAClB,OAAgB,MAATA,IAA0B,UAARC,GAA4B,YAARA,K,yGCrB/C,IAAMC,EAAe,CAAC,UAAW,qBAqClBC,E,4GAtBbC,OAAA,WAAU,IAAD,EAEmCC,KAAKC,MAAvCC,EAFD,EAECA,MAAOC,EAFR,EAEQA,aAAcC,EAFtB,EAEsBA,SAW7B,OATAC,OAAOC,KAAKJ,GAAOK,SAAQ,SAAAC,GAjBV,IAACb,EAkBZE,EAAaY,SAASD,KAK1BN,EAAMM,GAAOL,EAAaK,GArBL,iBAFLb,EAuB8BO,EAAMM,KArBnBb,GAAS,QAASA,EAASA,EAAMe,IAAMf,MAyBxE,YAAC,IAAD,CAAQO,MAAOA,EAAOC,aAAcA,QAApC,EACGC,I,GAvBmBO,IAAMC,WCTnBC,QAAef,EAAgBgB,K,+MCA9C,IAAMC,EAAWC,YAAe,CAC9BC,MAAM,CAAD,iDACLC,SAAS,CAAD,kDACRC,QAAQ,CAAD,uDACPC,QAAQ,CAAD,uDACPC,MAAM,CAAD,qDACLC,KAAK,CAAD,oDACJC,kBAAkB,CAAD,gEACjBC,kBAAkB,CAAD,sGACjBC,kBAAkB,CAAD,sGACjBC,gBAAgB,CAAD,gGACfC,eAAe,CAAD,+FAGVC,EAAoB,CACxBC,QAAQ,EACRC,KAAM,UACNC,MAAO,QACPC,IAAK,UACLC,KAAM,UACNC,OAAQ,WAGJC,EAAyB,CAC7BJ,MAAO,QACPC,IAAK,WAMDI,EAAS,MAiCFC,EAAgB,SAACC,EAAMC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B,QAG/DiC,EAGF,SAASK,EAAsBC,GACpC,IAAMC,EAAkB,qBAAQD,GAC1BvC,EAAWxB,EAAagE,GAI9B,OAFAA,EAAmBd,YAAcnB,kBAAQiC,EAAmBrD,QAASa,GAE9DwC,I,wGCvFT,IAAMvJ,EAAe,CAAC,UAAW,qBAqClBC,E,4GAtBbC,OAAA,WAAU,IAAD,EAEmCC,KAAKC,MAAvCC,EAFD,EAECA,MAAOC,EAFR,EAEQA,aAAcC,EAFtB,EAEsBA,SAW7B,OATAC,OAAOC,KAAKJ,GAAOK,SAAQ,SAAAC,GAjBV,IAACb,EAkBZE,EAAaY,SAASD,KAK1BN,EAAMM,GAAOL,EAAaK,GArBL,iBAFLb,EAuB8BO,EAAMM,KArBnBb,GAAS,QAASA,EAASA,EAAMe,IAAMf,MAyBxE,YAAC,IAAD,CAAQO,MAAOA,EAAOC,aAAcA,QAApC,EACGC,I,GAvBmBO,IAAMC,WCTnBC,QAAef,EAAgBgB,K,yBCM1CooF,EAAQ,KALVC,E,KAIAC,G,qBAEMnrD,EAAsBirD,EAAQ,KAA9BjrD,kBAGFunD,EAAiB,GAEvB,SAAS6D,EAAoBC,EAAc7C,GAAY,IAC/C8C,EAAqBD,EADyB,GACtChD,EAAagD,EADyB,GAE/ChD,IAEHA,EAAWroD,EAAkBsrD,IAE/B/D,EAAe+D,GAAU,CACvB9C,UAAWA,EACXH,SAAUA,GAIdjmF,OAAOC,KAAK6oF,GAAuB5oF,SAAQ,SAACkmF,GACnB0C,EAAsB1C,GADW,GAE3ClmF,SAAQ,SAAA+oF,GAAY,OAAID,EAAoBC,EAAc7C,SAEzE2C,EAAwB7oF,SAAQ,SAAA+oF,GAAY,OAAID,EAAoBC,MAEpE7pF,EAAOC,QAAU8lF","file":"containers/media_container.js","sourcesContent":["/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;","// Like react-motion's Motion, but reduces all animations to cross-fades\n// for the benefit of users with motion sickness.\nimport React from 'react';\nimport Motion from 'react-motion/lib/Motion';\nimport PropTypes from 'prop-types';\n\nconst stylesToKeep = ['opacity', 'backgroundOpacity'];\n\nconst extractValue = (value) => {\n // This is either an object with a \"val\" property or it's a number\n return (typeof value === 'object' && value && 'val' in value) ? value.val : value;\n};\n\nclass ReducedMotion extends React.Component {\n\n static propTypes = {\n defaultStyle: PropTypes.object,\n style: PropTypes.object,\n children: PropTypes.func,\n }\n\n render() {\n\n const { style, defaultStyle, children } = this.props;\n\n Object.keys(style).forEach(key => {\n if (stylesToKeep.includes(key)) {\n return;\n }\n // If it's setting an x or height or scale or some other value, we need\n // to preserve the end-state value without actually animating it\n style[key] = defaultStyle[key] = extractValue(style[key]);\n });\n\n return (\n <Motion style={style} defaultStyle={defaultStyle}>\n {children}\n </Motion>\n );\n }\n\n}\n\nexport default ReducedMotion;\n","import { reduceMotion } from '../../../initial_state';\nimport ReducedMotion from './reduced_motion';\nimport Motion from 'react-motion/lib/Motion';\n\nexport default reduceMotion ? ReducedMotion : Motion;\n","import React from 'react';\nimport { injectIntl, defineMessages } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nconst messages = defineMessages({\n today: { id: 'relative_time.today', defaultMessage: 'today' },\n just_now: { id: 'relative_time.just_now', defaultMessage: 'now' },\n seconds: { id: 'relative_time.seconds', defaultMessage: '{number}s' },\n minutes: { id: 'relative_time.minutes', defaultMessage: '{number}m' },\n hours: { id: 'relative_time.hours', defaultMessage: '{number}h' },\n days: { id: 'relative_time.days', defaultMessage: '{number}d' },\n moments_remaining: { id: 'time_remaining.moments', defaultMessage: 'Moments remaining' },\n seconds_remaining: { id: 'time_remaining.seconds', defaultMessage: '{number, plural, one {# second} other {# seconds}} left' },\n minutes_remaining: { id: 'time_remaining.minutes', defaultMessage: '{number, plural, one {# minute} other {# minutes}} left' },\n hours_remaining: { id: 'time_remaining.hours', defaultMessage: '{number, plural, one {# hour} other {# hours}} left' },\n days_remaining: { id: 'time_remaining.days', defaultMessage: '{number, plural, one {# day} other {# days}} left' },\n});\n\nconst dateFormatOptions = {\n hour12: false,\n year: 'numeric',\n month: 'short',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n};\n\nconst shortDateFormatOptions = {\n month: 'short',\n day: 'numeric',\n};\n\nconst SECOND = 1000;\nconst MINUTE = 1000 * 60;\nconst HOUR = 1000 * 60 * 60;\nconst DAY = 1000 * 60 * 60 * 24;\n\nconst MAX_DELAY = 2147483647;\n\nconst selectUnits = delta => {\n const absDelta = Math.abs(delta);\n\n if (absDelta < MINUTE) {\n return 'second';\n } else if (absDelta < HOUR) {\n return 'minute';\n } else if (absDelta < DAY) {\n return 'hour';\n }\n\n return 'day';\n};\n\nconst getUnitDelay = units => {\n switch (units) {\n case 'second':\n return SECOND;\n case 'minute':\n return MINUTE;\n case 'hour':\n return HOUR;\n case 'day':\n return DAY;\n default:\n return MAX_DELAY;\n }\n};\n\nexport const timeAgoString = (intl, date, now, year, timeGiven = true) => {\n const delta = now - date.getTime();\n\n let relativeTime;\n\n if (delta < DAY && !timeGiven) {\n relativeTime = intl.formatMessage(messages.today);\n } else if (delta < 10 * SECOND) {\n relativeTime = intl.formatMessage(messages.just_now);\n } else if (delta < 7 * DAY) {\n if (delta < MINUTE) {\n relativeTime = intl.formatMessage(messages.seconds, { number: Math.floor(delta / SECOND) });\n } else if (delta < HOUR) {\n relativeTime = intl.formatMessage(messages.minutes, { number: Math.floor(delta / MINUTE) });\n } else if (delta < DAY) {\n relativeTime = intl.formatMessage(messages.hours, { number: Math.floor(delta / HOUR) });\n } else {\n relativeTime = intl.formatMessage(messages.days, { number: Math.floor(delta / DAY) });\n }\n } else if (date.getFullYear() === year) {\n relativeTime = intl.formatDate(date, shortDateFormatOptions);\n } else {\n relativeTime = intl.formatDate(date, { ...shortDateFormatOptions, year: 'numeric' });\n }\n\n return relativeTime;\n};\n\nconst timeRemainingString = (intl, date, now, timeGiven = true) => {\n const delta = date.getTime() - now;\n\n let relativeTime;\n\n if (delta < DAY && !timeGiven) {\n relativeTime = intl.formatMessage(messages.today);\n } else if (delta < 10 * SECOND) {\n relativeTime = intl.formatMessage(messages.moments_remaining);\n } else if (delta < MINUTE) {\n relativeTime = intl.formatMessage(messages.seconds_remaining, { number: Math.floor(delta / SECOND) });\n } else if (delta < HOUR) {\n relativeTime = intl.formatMessage(messages.minutes_remaining, { number: Math.floor(delta / MINUTE) });\n } else if (delta < DAY) {\n relativeTime = intl.formatMessage(messages.hours_remaining, { number: Math.floor(delta / HOUR) });\n } else {\n relativeTime = intl.formatMessage(messages.days_remaining, { number: Math.floor(delta / DAY) });\n }\n\n return relativeTime;\n};\n\nexport default @injectIntl\nclass RelativeTimestamp extends React.Component {\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n timestamp: PropTypes.string.isRequired,\n year: PropTypes.number.isRequired,\n futureDate: PropTypes.bool,\n };\n\n state = {\n now: this.props.intl.now(),\n };\n\n static defaultProps = {\n year: (new Date()).getFullYear(),\n };\n\n shouldComponentUpdate (nextProps, nextState) {\n // As of right now the locale doesn't change without a new page load,\n // but we might as well check in case that ever changes.\n return this.props.timestamp !== nextProps.timestamp ||\n this.props.intl.locale !== nextProps.intl.locale ||\n this.state.now !== nextState.now;\n }\n\n componentWillReceiveProps (nextProps) {\n if (this.props.timestamp !== nextProps.timestamp) {\n this.setState({ now: this.props.intl.now() });\n }\n }\n\n componentDidMount () {\n this._scheduleNextUpdate(this.props, this.state);\n }\n\n componentWillUpdate (nextProps, nextState) {\n this._scheduleNextUpdate(nextProps, nextState);\n }\n\n componentWillUnmount () {\n clearTimeout(this._timer);\n }\n\n _scheduleNextUpdate (props, state) {\n clearTimeout(this._timer);\n\n const { timestamp } = props;\n const delta = (new Date(timestamp)).getTime() - state.now;\n const unitDelay = getUnitDelay(selectUnits(delta));\n const unitRemainder = Math.abs(delta % unitDelay);\n const updateInterval = 1000 * 10;\n const delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder);\n\n this._timer = setTimeout(() => {\n this.setState({ now: this.props.intl.now() });\n }, delay);\n }\n\n render () {\n const { timestamp, intl, year, futureDate } = this.props;\n\n const timeGiven = timestamp.includes('T');\n const date = new Date(timestamp);\n const relativeTime = futureDate ? timeRemainingString(intl, date, this.state.now, timeGiven) : timeAgoString(intl, date, this.state.now, year, timeGiven);\n\n return (\n <time dateTime={timestamp} title={intl.formatDate(date, dateFormatOptions)}>\n {relativeTime}\n </time>\n );\n }\n\n}\n","import escapeTextContentForBrowser from 'escape-html';\nimport emojify from '../../features/emoji/emoji';\nimport { unescapeHTML } from '../../utils/html';\nimport { expandSpoilers } from '../../initial_state';\n\nconst domParser = new DOMParser();\n\nconst makeEmojiMap = record => record.emojis.reduce((obj, emoji) => {\n obj[`:${emoji.shortcode}:`] = emoji;\n return obj;\n}, {});\n\nexport function searchTextFromRawStatus (status) {\n const spoilerText = status.spoiler_text || '';\n const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).join('\\n\\n').replace(/<br\\s*\\/?>/g, '\\n').replace(/<\\/p><p>/g, '\\n\\n');\n return domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;\n}\n\nexport function normalizeAccount(account) {\n account = { ...account };\n\n const emojiMap = makeEmojiMap(account);\n const displayName = account.display_name.trim().length === 0 ? account.username : account.display_name;\n\n account.display_name_html = emojify(escapeTextContentForBrowser(displayName), emojiMap);\n account.note_emojified = emojify(account.note, emojiMap);\n\n if (account.fields) {\n account.fields = account.fields.map(pair => ({\n ...pair,\n name_emojified: emojify(escapeTextContentForBrowser(pair.name), emojiMap),\n value_emojified: emojify(pair.value, emojiMap),\n value_plain: unescapeHTML(pair.value),\n }));\n }\n\n if (account.moved) {\n account.moved = account.moved.id;\n }\n\n return account;\n}\n\nexport function normalizeStatus(status, normalOldStatus) {\n const normalStatus = { ...status };\n normalStatus.account = status.account.id;\n\n if (status.reblog && status.reblog.id) {\n normalStatus.reblog = status.reblog.id;\n }\n\n if (status.poll && status.poll.id) {\n normalStatus.poll = status.poll.id;\n }\n\n // Only calculate these values when status first encountered\n // Otherwise keep the ones already in the reducer\n if (normalOldStatus) {\n normalStatus.search_index = normalOldStatus.get('search_index');\n normalStatus.contentHtml = normalOldStatus.get('contentHtml');\n normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml');\n normalStatus.hidden = normalOldStatus.get('hidden');\n } else {\n const spoilerText = normalStatus.spoiler_text || '';\n const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).join('\\n\\n').replace(/<br\\s*\\/?>/g, '\\n').replace(/<\\/p><p>/g, '\\n\\n');\n const emojiMap = makeEmojiMap(normalStatus);\n\n normalStatus.search_index = domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;\n normalStatus.contentHtml = emojify(normalStatus.content, emojiMap);\n normalStatus.spoilerHtml = emojify(escapeTextContentForBrowser(spoilerText), emojiMap);\n normalStatus.hidden = expandSpoilers ? false : spoilerText.length > 0 || normalStatus.sensitive;\n }\n\n return normalStatus;\n}\n\nexport function normalizePoll(poll) {\n const normalPoll = { ...poll };\n const emojiMap = makeEmojiMap(normalPoll);\n\n normalPoll.options = poll.options.map((option, index) => ({\n ...option,\n voted: poll.own_votes && poll.own_votes.includes(index),\n title_emojified: emojify(escapeTextContentForBrowser(option.title), emojiMap),\n }));\n\n return normalPoll;\n}\n\nexport function normalizeAnnouncement(announcement) {\n const normalAnnouncement = { ...announcement };\n const emojiMap = makeEmojiMap(normalAnnouncement);\n\n normalAnnouncement.contentHtml = emojify(normalAnnouncement.content, emojiMap);\n\n return normalAnnouncement;\n}\n","import React from 'react';\nimport { injectIntl, defineMessages } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nconst messages = defineMessages({\n today: { id: 'relative_time.today', defaultMessage: 'today' },\n just_now: { id: 'relative_time.just_now', defaultMessage: 'now' },\n seconds: { id: 'relative_time.seconds', defaultMessage: '{number}s' },\n minutes: { id: 'relative_time.minutes', defaultMessage: '{number}m' },\n hours: { id: 'relative_time.hours', defaultMessage: '{number}h' },\n days: { id: 'relative_time.days', defaultMessage: '{number}d' },\n moments_remaining: { id: 'time_remaining.moments', defaultMessage: 'Moments remaining' },\n seconds_remaining: { id: 'time_remaining.seconds', defaultMessage: '{number, plural, one {# second} other {# seconds}} left' },\n minutes_remaining: { id: 'time_remaining.minutes', defaultMessage: '{number, plural, one {# minute} other {# minutes}} left' },\n hours_remaining: { id: 'time_remaining.hours', defaultMessage: '{number, plural, one {# hour} other {# hours}} left' },\n days_remaining: { id: 'time_remaining.days', defaultMessage: '{number, plural, one {# day} other {# days}} left' },\n});\n\nconst dateFormatOptions = {\n hour12: false,\n year: 'numeric',\n month: 'short',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n};\n\nconst shortDateFormatOptions = {\n month: 'short',\n day: 'numeric',\n};\n\nconst SECOND = 1000;\nconst MINUTE = 1000 * 60;\nconst HOUR = 1000 * 60 * 60;\nconst DAY = 1000 * 60 * 60 * 24;\n\nconst MAX_DELAY = 2147483647;\n\nconst selectUnits = delta => {\n const absDelta = Math.abs(delta);\n\n if (absDelta < MINUTE) {\n return 'second';\n } else if (absDelta < HOUR) {\n return 'minute';\n } else if (absDelta < DAY) {\n return 'hour';\n }\n\n return 'day';\n};\n\nconst getUnitDelay = units => {\n switch (units) {\n case 'second':\n return SECOND;\n case 'minute':\n return MINUTE;\n case 'hour':\n return HOUR;\n case 'day':\n return DAY;\n default:\n return MAX_DELAY;\n }\n};\n\nexport const timeAgoString = (intl, date, now, year, timeGiven = true) => {\n const delta = now - date.getTime();\n\n let relativeTime;\n\n if (delta < DAY && !timeGiven) {\n relativeTime = intl.formatMessage(messages.today);\n } else if (delta < 10 * SECOND) {\n relativeTime = intl.formatMessage(messages.just_now);\n } else if (delta < 7 * DAY) {\n if (delta < MINUTE) {\n relativeTime = intl.formatMessage(messages.seconds, { number: Math.floor(delta / SECOND) });\n } else if (delta < HOUR) {\n relativeTime = intl.formatMessage(messages.minutes, { number: Math.floor(delta / MINUTE) });\n } else if (delta < DAY) {\n relativeTime = intl.formatMessage(messages.hours, { number: Math.floor(delta / HOUR) });\n } else {\n relativeTime = intl.formatMessage(messages.days, { number: Math.floor(delta / DAY) });\n }\n } else if (date.getFullYear() === year) {\n relativeTime = intl.formatDate(date, shortDateFormatOptions);\n } else {\n relativeTime = intl.formatDate(date, { ...shortDateFormatOptions, year: 'numeric' });\n }\n\n return relativeTime;\n};\n\nconst timeRemainingString = (intl, date, now, timeGiven = true) => {\n const delta = date.getTime() - now;\n\n let relativeTime;\n\n if (delta < DAY && !timeGiven) {\n relativeTime = intl.formatMessage(messages.today);\n } else if (delta < 10 * SECOND) {\n relativeTime = intl.formatMessage(messages.moments_remaining);\n } else if (delta < MINUTE) {\n relativeTime = intl.formatMessage(messages.seconds_remaining, { number: Math.floor(delta / SECOND) });\n } else if (delta < HOUR) {\n relativeTime = intl.formatMessage(messages.minutes_remaining, { number: Math.floor(delta / MINUTE) });\n } else if (delta < DAY) {\n relativeTime = intl.formatMessage(messages.hours_remaining, { number: Math.floor(delta / HOUR) });\n } else {\n relativeTime = intl.formatMessage(messages.days_remaining, { number: Math.floor(delta / DAY) });\n }\n\n return relativeTime;\n};\n\nexport default @injectIntl\nclass RelativeTimestamp extends React.Component {\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n timestamp: PropTypes.string.isRequired,\n year: PropTypes.number.isRequired,\n futureDate: PropTypes.bool,\n };\n\n state = {\n now: this.props.intl.now(),\n };\n\n static defaultProps = {\n year: (new Date()).getFullYear(),\n };\n\n shouldComponentUpdate (nextProps, nextState) {\n // As of right now the locale doesn't change without a new page load,\n // but we might as well check in case that ever changes.\n return this.props.timestamp !== nextProps.timestamp ||\n this.props.intl.locale !== nextProps.intl.locale ||\n this.state.now !== nextState.now;\n }\n\n componentWillReceiveProps (nextProps) {\n if (this.props.timestamp !== nextProps.timestamp) {\n this.setState({ now: this.props.intl.now() });\n }\n }\n\n componentDidMount () {\n this._scheduleNextUpdate(this.props, this.state);\n }\n\n componentWillUpdate (nextProps, nextState) {\n this._scheduleNextUpdate(nextProps, nextState);\n }\n\n componentWillUnmount () {\n clearTimeout(this._timer);\n }\n\n _scheduleNextUpdate (props, state) {\n clearTimeout(this._timer);\n\n const { timestamp } = props;\n const delta = (new Date(timestamp)).getTime() - state.now;\n const unitDelay = getUnitDelay(selectUnits(delta));\n const unitRemainder = Math.abs(delta % unitDelay);\n const updateInterval = 1000 * 10;\n const delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder);\n\n this._timer = setTimeout(() => {\n this.setState({ now: this.props.intl.now() });\n }, delay);\n }\n\n render () {\n const { timestamp, intl, year, futureDate } = this.props;\n\n const timeGiven = timestamp.includes('T');\n const date = new Date(timestamp);\n const relativeTime = futureDate ? timeRemainingString(intl, date, this.state.now, timeGiven) : timeAgoString(intl, date, this.state.now, year, timeGiven);\n\n return (\n <time dateTime={timestamp} title={intl.formatDate(date, dateFormatOptions)}>\n {relativeTime}\n </time>\n );\n }\n\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nexports.showLoading = showLoading;\nexports.hideLoading = hideLoading;\nexports.resetLoading = resetLoading;\nexports.loadingBarReducer = loadingBarReducer;\n\nfunction _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\nvar SHOW = exports.SHOW = 'loading-bar/SHOW';\nvar HIDE = exports.HIDE = 'loading-bar/HIDE';\nvar RESET = exports.RESET = 'loading-bar/RESET';\nvar DEFAULT_SCOPE = exports.DEFAULT_SCOPE = 'default';\n\nfunction showLoading() {\n var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_SCOPE;\n return {\n type: SHOW,\n payload: {\n scope: scope\n }\n };\n}\n\nfunction hideLoading() {\n var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_SCOPE;\n return {\n type: HIDE,\n payload: {\n scope: scope\n }\n };\n}\n\nfunction resetLoading() {\n var scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_SCOPE;\n return {\n type: RESET,\n payload: {\n scope: scope\n }\n };\n}\n\nfunction loadingBarReducer() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _ref = action.payload || {},\n _ref$scope = _ref.scope,\n scope = _ref$scope === undefined ? DEFAULT_SCOPE : _ref$scope;\n\n switch (action.type) {\n case SHOW:\n return _extends({}, state, _defineProperty({}, scope, (state[scope] || 0) + 1));\n\n case HIDE:\n return _extends({}, state, _defineProperty({}, scope, Math.max(0, (state[scope] || 1) - 1)));\n\n case RESET:\n return _extends({}, state, _defineProperty({}, scope, 0));\n\n default:\n return state;\n }\n}","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\nvar Motion = function (_React$Component) {\n _inherits(Motion, _React$Component);\n\n _createClass(Motion, null, [{\n key: 'propTypes',\n value: {\n // TOOD: warn against putting a config in here\n defaultStyle: _propTypes2['default'].objectOf(_propTypes2['default'].number),\n style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired,\n children: _propTypes2['default'].func.isRequired,\n onRest: _propTypes2['default'].func\n },\n enumerable: true\n }]);\n\n function Motion(props) {\n var _this = this;\n\n _classCallCheck(this, Motion);\n\n _React$Component.call(this, props);\n\n this.wasAnimating = false;\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyle = null;\n\n this.clearUnreadPropStyle = function (destStyle) {\n var dirty = false;\n var _state = _this.state;\n var currentStyle = _state.currentStyle;\n var currentVelocity = _state.currentVelocity;\n var lastIdealStyle = _state.lastIdealStyle;\n var lastIdealVelocity = _state.lastIdealVelocity;\n\n for (var key in destStyle) {\n if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {\n continue;\n }\n\n var styleValue = destStyle[key];\n\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n currentStyle = _extends({}, currentStyle);\n currentVelocity = _extends({}, currentVelocity);\n lastIdealStyle = _extends({}, lastIdealStyle);\n lastIdealVelocity = _extends({}, lastIdealVelocity);\n }\n\n currentStyle[key] = styleValue;\n currentVelocity[key] = 0;\n lastIdealStyle[key] = styleValue;\n lastIdealVelocity[key] = 0;\n }\n }\n\n if (dirty) {\n _this.setState({\n currentStyle: currentStyle,\n currentVelocity: currentVelocity,\n lastIdealStyle: lastIdealStyle,\n lastIdealVelocity: lastIdealVelocity\n });\n }\n };\n\n this.startAnimationIfNecessary = function () {\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n // check if we need to animate in the first place\n var propsStyle = _this.props.style;\n\n if (_shouldStopAnimation2['default'](_this.state.currentStyle, propsStyle, _this.state.currentVelocity)) {\n if (_this.wasAnimating && _this.props.onRest) {\n _this.props.onRest();\n } // no need to cancel animationID here; shouldn't have any in flight\n\n\n _this.animationID = null;\n _this.wasAnimating = false;\n _this.accumulatedTime = 0;\n return;\n }\n\n _this.wasAnimating = true;\n\n var currentTime = timestamp || _performanceNow2['default']();\n\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta; // more than 10 frames? prolly switched browser tab. Restart\n\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n\n _this.startAnimationIfNecessary();\n\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n\n for (var key in propsStyle) {\n if (!Object.prototype.hasOwnProperty.call(propsStyle, key)) {\n continue;\n }\n\n var styleValue = propsStyle[key];\n\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = _this.state.lastIdealStyle[key];\n var newLastIdealVelocityValue = _this.state.lastIdealVelocity[key];\n\n for (var i = 0; i < framesToCatchUp; i++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n _this.animationID = null; // the amount we're looped over above\n\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyle: newCurrentStyle,\n currentVelocity: newCurrentVelocity,\n lastIdealStyle: newLastIdealStyle,\n lastIdealVelocity: newLastIdealVelocity\n });\n\n _this.unreadPropStyle = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n Motion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyle = _props.defaultStyle;\n var style = _props.style;\n\n var currentStyle = defaultStyle || _stripStyle2['default'](style);\n\n var currentVelocity = _mapToZero2['default'](currentStyle);\n\n return {\n currentStyle: currentStyle,\n currentVelocity: currentVelocity,\n lastIdealStyle: currentStyle,\n lastIdealVelocity: currentVelocity\n };\n }; // it's possible that currentStyle's value is stale: if props is immediately\n // changed from 0 to 400 to spring(0) again, the async currentStyle is still\n // at 0 (didn't have time to tick and interpolate even once). If we naively\n // compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n // In reality currentStyle should be 400\n\n\n Motion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n Motion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyle != null) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyle);\n }\n\n this.unreadPropStyle = props.style;\n\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n Motion.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n\n this.animationID = null;\n }\n };\n\n Motion.prototype.render = function render() {\n var renderedChildren = this.props.children(this.state.currentStyle);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return Motion;\n}(_react2['default'].Component);\n\nexports['default'] = Motion;\nmodule.exports = exports['default']; // after checking for unreadPropStyle != null, we manually go set the\n// non-interpolating values (those that are a number, without a spring\n// config)","export * from 'locales';\n","import axios from 'axios';\nimport LinkHeader from 'http-link-header';\n\nexport const getLinks = response => {\n const value = response.headers.link;\n\n if (!value) {\n return { refs: [] };\n }\n\n return LinkHeader.parse(value);\n};\n\nexport default getState => axios.create({\n headers: getState ? {\n 'Authorization': `Bearer ${getState().getIn(['meta', 'access_token'], '')}`,\n } : {},\n\n transformResponse: [function (data) {\n try {\n return JSON.parse(data);\n } catch(Exception) {\n return data;\n }\n }],\n});\n","import detectPassiveEvents from 'detect-passive-events';\n\nconst LAYOUT_BREAKPOINT = 630;\n\nexport function isMobile(width) {\n return width <= LAYOUT_BREAKPOINT;\n};\n\nconst iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n\nlet userTouching = false;\nlet listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;\n\nfunction touchListener() {\n userTouching = true;\n window.removeEventListener('touchstart', touchListener, listenerOptions);\n}\n\nwindow.addEventListener('touchstart', touchListener, listenerOptions);\n\nexport function isUserTouching() {\n return userTouching;\n}\n\nexport function isIOS() {\n return iOS;\n};\n","import axios from 'axios';\nimport LinkHeader from 'http-link-header';\n\nexport const getLinks = response => {\n const value = response.headers.link;\n\n if (!value) {\n return { refs: [] };\n }\n\n return LinkHeader.parse(value);\n};\n\nexport default getState => axios.create({\n headers: getState ? {\n 'Authorization': `Bearer ${getState().getIn(['meta', 'access_token'], '')}`,\n } : {},\n\n transformResponse: [function (data) {\n try {\n return JSON.parse(data);\n } catch(Exception) {\n return data;\n }\n }],\n});\n","import React, { PureComponent, Fragment } from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { IntlProvider, addLocaleData } from 'react-intl';\nimport { List as ImmutableList, fromJS } from 'immutable';\nimport { getLocale } from 'mastodon/locales';\nimport { getScrollbarWidth } from 'mastodon/utils/scrollbar';\nimport MediaGallery from 'mastodon/components/media_gallery';\nimport Poll from 'mastodon/components/poll';\nimport Hashtag from 'mastodon/components/hashtag';\nimport ModalRoot from 'mastodon/components/modal_root';\nimport MediaModal from 'mastodon/features/ui/components/media_modal';\nimport Video from 'mastodon/features/video';\nimport Card from 'mastodon/features/status/components/card';\nimport Audio from 'mastodon/features/audio';\n\nconst { localeData, messages } = getLocale();\naddLocaleData(localeData);\n\nconst MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll, Hashtag, Audio };\n\nexport default class MediaContainer extends PureComponent {\n\n static propTypes = {\n locale: PropTypes.string.isRequired,\n components: PropTypes.object.isRequired,\n };\n\n state = {\n media: null,\n index: null,\n time: null,\n };\n\n handleOpenMedia = (media, index) => {\n document.body.classList.add('with-modals--active');\n document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;\n\n this.setState({ media, index });\n }\n\n handleOpenVideo = (video, time) => {\n const media = ImmutableList([video]);\n\n document.body.classList.add('with-modals--active');\n document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;\n\n this.setState({ media, time });\n }\n\n handleCloseMedia = () => {\n document.body.classList.remove('with-modals--active');\n document.documentElement.style.marginRight = 0;\n\n this.setState({ media: null, index: null, time: null });\n }\n\n render () {\n const { locale, components } = this.props;\n\n return (\n <IntlProvider locale={locale} messages={messages}>\n <Fragment>\n {[].map.call(components, (component, i) => {\n const componentName = component.getAttribute('data-component');\n const Component = MEDIA_COMPONENTS[componentName];\n const { media, card, poll, hashtag, ...props } = JSON.parse(component.getAttribute('data-props'));\n\n Object.assign(props, {\n ...(media ? { media: fromJS(media) } : {}),\n ...(card ? { card: fromJS(card) } : {}),\n ...(poll ? { poll: fromJS(poll) } : {}),\n ...(hashtag ? { hashtag: fromJS(hashtag) } : {}),\n\n ...(componentName === 'Video' ? {\n onOpenVideo: this.handleOpenVideo,\n } : {\n onOpenMedia: this.handleOpenMedia,\n }),\n });\n\n return ReactDOM.createPortal(\n <Component {...props} key={`media-${i}`} />,\n component,\n );\n })}\n\n <ModalRoot onClose={this.handleCloseMedia}>\n {this.state.media && (\n <MediaModal\n media={this.state.media}\n index={this.state.index || 0}\n time={this.state.time}\n onClose={this.handleCloseMedia}\n />\n )}\n </ModalRoot>\n </Fragment>\n </IntlProvider>\n );\n }\n\n}\n","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n\n/* global define */\n(function () {\n 'use strict';\n\n var hasOwn = {}.hasOwnProperty;\n\n function classNames() {\n var classes = [];\n\n for (var i = 0; i < arguments.length; i++) {\n var arg = arguments[i];\n if (!arg) continue;\n var argType = typeof arg;\n\n if (argType === 'string' || argType === 'number') {\n classes.push(arg);\n } else if (Array.isArray(arg) && arg.length) {\n var inner = classNames.apply(null, arg);\n\n if (inner) {\n classes.push(inner);\n }\n } else if (argType === 'object') {\n for (var key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(' ');\n }\n\n if (typeof module !== 'undefined' && module.exports) {\n classNames.default = classNames;\n module.exports = classNames;\n } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n // register as 'classnames', consistent with npm package name\n define('classnames', [], function () {\n return classNames;\n });\n } else {\n window.classNames = classNames;\n }\n})();","import React from 'react';\nexport var ReactReduxContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== 'production') {\n ReactReduxContext.displayName = 'ReactRedux';\n}\n\nexport default ReactReduxContext;","// Default to a dummy \"batch\" implementation that just runs the callback\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\nvar batch = defaultNoopBatch; // Allow injecting another batching function later\n\nexport var setBatch = function setBatch(newBatch) {\n return batch = newBatch;\n}; // Supply a getter just to skip dealing with ESM bindings\n\nexport var getBatch = function getBatch() {\n return batch;\n};","import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nvar nullListeners = {\n notify: function notify() {}\n};\n\nfunction createListenerCollection() {\n var batch = getBatch();\n var first = null;\n var last = null;\n return {\n clear: function clear() {\n first = null;\n last = null;\n },\n notify: function notify() {\n batch(function () {\n var listener = first;\n\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get: function get() {\n var listeners = [];\n var listener = first;\n\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n\n return listeners;\n },\n subscribe: function subscribe(callback) {\n var isSubscribed = true;\n var listener = last = {\n callback: callback,\n next: null,\n prev: last\n };\n\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\n\nvar Subscription = /*#__PURE__*/function () {\n function Subscription(store, parentSub) {\n this.store = store;\n this.parentSub = parentSub;\n this.unsubscribe = null;\n this.listeners = nullListeners;\n this.handleChangeWrapper = this.handleChangeWrapper.bind(this);\n }\n\n var _proto = Subscription.prototype;\n\n _proto.addNestedSub = function addNestedSub(listener) {\n this.trySubscribe();\n return this.listeners.subscribe(listener);\n };\n\n _proto.notifyNestedSubs = function notifyNestedSubs() {\n this.listeners.notify();\n };\n\n _proto.handleChangeWrapper = function handleChangeWrapper() {\n if (this.onStateChange) {\n this.onStateChange();\n }\n };\n\n _proto.isSubscribed = function isSubscribed() {\n return Boolean(this.unsubscribe);\n };\n\n _proto.trySubscribe = function trySubscribe() {\n if (!this.unsubscribe) {\n this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.handleChangeWrapper) : this.store.subscribe(this.handleChangeWrapper);\n this.listeners = createListenerCollection();\n }\n };\n\n _proto.tryUnsubscribe = function tryUnsubscribe() {\n if (this.unsubscribe) {\n this.unsubscribe();\n this.unsubscribe = null;\n this.listeners.clear();\n this.listeners = nullListeners;\n }\n };\n\n return Subscription;\n}();\n\nexport { Subscription as default };","import React, { useMemo, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { ReactReduxContext } from './Context';\nimport Subscription from '../utils/Subscription';\n\nfunction Provider(_ref) {\n var store = _ref.store,\n context = _ref.context,\n children = _ref.children;\n var contextValue = useMemo(function () {\n var subscription = new Subscription(store);\n subscription.onStateChange = subscription.notifyNestedSubs;\n return {\n store: store,\n subscription: subscription\n };\n }, [store]);\n var previousState = useMemo(function () {\n return store.getState();\n }, [store]);\n useEffect(function () {\n var subscription = contextValue.subscription;\n subscription.trySubscribe();\n\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n\n return function () {\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n };\n }, [contextValue, previousState]);\n var Context = context || ReactReduxContext;\n return React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nif (process.env.NODE_ENV !== 'production') {}\n\nexport default Provider;","import { useEffect, useLayoutEffect } from 'react'; // React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\n\nexport var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport hoistStatics from 'hoist-non-react-statics';\nimport React, { useContext, useMemo, useRef, useReducer } from 'react';\nimport { isValidElementType, isContextConsumer } from 'react-is';\nimport Subscription from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from './Context'; // Define some constant arrays just to avoid re-creating these\n\nvar EMPTY_ARRAY = [];\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\n\nvar stringifyComponent = function stringifyComponent(Comp) {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\n\nfunction storeStateUpdatesReducer(state, action) {\n var updateCount = state[1];\n return [action.payload, updateCount + 1];\n}\n\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(function () {\n return effectFunc.apply(void 0, effectArgs);\n }, dependencies);\n}\n\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n // We want to capture the wrapper props and child props we used for later comparisons\n lastWrapperProps.current = wrapperProps;\n lastChildProps.current = actualChildProps;\n renderIsScheduled.current = false; // If the render was from a store update, clear out that reference and cascade the subscriber update\n\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\n\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch) {\n // If we're not subscribed to the store, nothing to do here\n if (!shouldHandleStateChanges) return; // Capture values for checking if and when this component unmounts\n\n var didUnsubscribe = false;\n var lastThrownError = null; // We'll run this callback every time a store subscription update propagates to this component\n\n var checkForUpdates = function checkForUpdates() {\n if (didUnsubscribe) {\n // Don't run stale listeners.\n // Redux doesn't guarantee unsubscriptions happen until next dispatch.\n return;\n }\n\n var latestStoreState = store.getState();\n var newChildProps, error;\n\n try {\n // Actually run the selector with the most recent store state and wrapper props\n // to determine what the child props should be\n newChildProps = childPropsSelector(latestStoreState, lastWrapperProps.current);\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n\n if (!error) {\n lastThrownError = null;\n } // If the child props haven't changed, nothing to do here - cascade the subscription update\n\n\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n // Save references to the new child props. Note that we track the \"child props from store update\"\n // as a ref instead of a useState/useReducer because we need a way to determine if that value has\n // been processed. If this went into useState/useReducer, we couldn't clear out the value without\n // forcing another re-render, which we don't want.\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true; // If the child props _did_ change (or we caught an error), this wrapper component needs to re-render\n\n forceComponentUpdateDispatch({\n type: 'STORE_UPDATED',\n payload: {\n error: error\n }\n });\n }\n }; // Actually subscribe to the nearest connected ancestor (or store)\n\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe(); // Pull data from the store after first render in case the store has\n // changed since we began.\n\n checkForUpdates();\n\n var unsubscribeWrapper = function unsubscribeWrapper() {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n\n if (lastThrownError) {\n // It's possible that we caught an error due to a bad mapState function, but the\n // parent re-rendered without this component and we're about to unmount.\n // This shouldn't happen as long as we do top-down subscriptions correctly, but\n // if we ever do those wrong, this throw will surface the error in our tests.\n // In that case, throw the error from here so it doesn't get lost.\n throw lastThrownError;\n }\n };\n\n return unsubscribeWrapper;\n}\n\nvar initStateUpdates = function initStateUpdates() {\n return [null, 0];\n};\n\nexport default function connectAdvanced(\n/*\r\n selectorFactory is a func that is responsible for returning the selector function used to\r\n compute new props from state, props, and dispatch. For example:\r\n export default connectAdvanced((dispatch, options) => (state, props) => ({\r\n thing: state.things[props.thingId],\r\n saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)),\r\n }))(YourComponent)\r\n Access to dispatch is provided to the factory so selectorFactories can bind actionCreators\r\n outside of their selector as an optimization. Options passed to connectAdvanced are passed to\r\n the selectorFactory, along with displayName and WrappedComponent, as the second argument.\r\n Note that selectorFactory is responsible for all caching/memoization of inbound and outbound\r\n props. Do not use connectAdvanced directly without memoizing results between calls to your\r\n selector, otherwise the Connect component will re-render on every state or props change.\r\n*/\nselectorFactory, // options object:\n_ref) {\n if (_ref === void 0) {\n _ref = {};\n }\n\n var _ref2 = _ref,\n _ref2$getDisplayName = _ref2.getDisplayName,\n getDisplayName = _ref2$getDisplayName === void 0 ? function (name) {\n return \"ConnectAdvanced(\" + name + \")\";\n } : _ref2$getDisplayName,\n _ref2$methodName = _ref2.methodName,\n methodName = _ref2$methodName === void 0 ? 'connectAdvanced' : _ref2$methodName,\n _ref2$renderCountProp = _ref2.renderCountProp,\n renderCountProp = _ref2$renderCountProp === void 0 ? undefined : _ref2$renderCountProp,\n _ref2$shouldHandleSta = _ref2.shouldHandleStateChanges,\n shouldHandleStateChanges = _ref2$shouldHandleSta === void 0 ? true : _ref2$shouldHandleSta,\n _ref2$storeKey = _ref2.storeKey,\n storeKey = _ref2$storeKey === void 0 ? 'store' : _ref2$storeKey,\n _ref2$withRef = _ref2.withRef,\n withRef = _ref2$withRef === void 0 ? false : _ref2$withRef,\n _ref2$forwardRef = _ref2.forwardRef,\n forwardRef = _ref2$forwardRef === void 0 ? false : _ref2$forwardRef,\n _ref2$context = _ref2.context,\n context = _ref2$context === void 0 ? ReactReduxContext : _ref2$context,\n connectOptions = _objectWithoutPropertiesLoose(_ref2, [\"getDisplayName\", \"methodName\", \"renderCountProp\", \"shouldHandleStateChanges\", \"storeKey\", \"withRef\", \"forwardRef\", \"context\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (renderCountProp !== undefined) {\n throw new Error(\"renderCountProp is removed. render counting is built into the latest React Dev Tools profiling extension\");\n }\n\n if (withRef) {\n throw new Error('withRef is removed. To access the wrapped instance, use a ref on the connected component');\n }\n\n var customStoreWarningMessage = 'To use a custom Redux store for specific components, create a custom React context with ' + \"React.createContext(), and pass the context object to React Redux's Provider and specific components\" + ' like: <Provider context={MyContext}><ConnectedComponent context={MyContext} /></Provider>. ' + 'You may also pass a {context : MyContext} option to connect';\n\n if (storeKey !== 'store') {\n throw new Error('storeKey has been removed and does not do anything. ' + customStoreWarningMessage);\n }\n }\n\n var Context = context;\n return function wrapWithConnect(WrappedComponent) {\n if (process.env.NODE_ENV !== 'production' && !isValidElementType(WrappedComponent)) {\n throw new Error(\"You must pass a component to the function returned by \" + (methodName + \". Instead received \" + stringifyComponent(WrappedComponent)));\n }\n\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\n var displayName = getDisplayName(wrappedComponentName);\n\n var selectorFactoryOptions = _extends({}, connectOptions, {\n getDisplayName: getDisplayName,\n methodName: methodName,\n renderCountProp: renderCountProp,\n shouldHandleStateChanges: shouldHandleStateChanges,\n storeKey: storeKey,\n displayName: displayName,\n wrappedComponentName: wrappedComponentName,\n WrappedComponent: WrappedComponent\n });\n\n var pure = connectOptions.pure;\n\n function createChildSelector(store) {\n return selectorFactory(store.dispatch, selectorFactoryOptions);\n } // If we aren't running in \"pure\" mode, we don't want to memoize values.\n // To avoid conditionally calling hooks, we fall back to a tiny wrapper\n // that just executes the given callback immediately.\n\n\n var usePureOnlyMemo = pure ? useMemo : function (callback) {\n return callback();\n };\n\n function ConnectFunction(props) {\n var _useMemo = useMemo(function () {\n // Distinguish between actual \"data\" props that were passed to the wrapper component,\n // and values needed to control behavior (forwarded refs, alternate context instances).\n // To maintain the wrapperProps object reference, memoize this destructuring.\n var forwardedRef = props.forwardedRef,\n wrapperProps = _objectWithoutPropertiesLoose(props, [\"forwardedRef\"]);\n\n return [props.context, forwardedRef, wrapperProps];\n }, [props]),\n propsContext = _useMemo[0],\n forwardedRef = _useMemo[1],\n wrapperProps = _useMemo[2];\n\n var ContextToUse = useMemo(function () {\n // Users may optionally pass in a custom context instance to use instead of our ReactReduxContext.\n // Memoize the check that determines which context instance we should use.\n return propsContext && propsContext.Consumer && isContextConsumer(React.createElement(propsContext.Consumer, null)) ? propsContext : Context;\n }, [propsContext, Context]); // Retrieve the store and ancestor subscription via context, if available\n\n var contextValue = useContext(ContextToUse); // The store _must_ exist as either a prop or in context.\n // We'll check to see if it _looks_ like a Redux store first.\n // This allows us to pass through a `store` prop that is just a plain value.\n\n var didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n var didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n\n if (process.env.NODE_ENV !== 'production' && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\"Could not find \\\"store\\\" in the context of \" + (\"\\\"\" + displayName + \"\\\". Either wrap the root component in a <Provider>, \") + \"or pass a custom React context provider to <Provider> and the corresponding \" + (\"React context consumer to \" + displayName + \" in connect options.\"));\n } // Based on the previous check, one of these must be true\n\n\n var store = didStoreComeFromProps ? props.store : contextValue.store;\n var childPropsSelector = useMemo(function () {\n // The child props selector needs the store reference as an input.\n // Re-create this selector whenever the store changes.\n return createChildSelector(store);\n }, [store]);\n\n var _useMemo2 = useMemo(function () {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY; // This Subscription's source should match where store came from: props vs. context. A component\n // connected to the store via props shouldn't use subscription from context, or vice versa.\n\n var subscription = new Subscription(store, didStoreComeFromProps ? null : contextValue.subscription); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in\n // the middle of the notification loop, where `subscription` will then be null. This can\n // probably be avoided if Subscription's listeners logic is changed to not call listeners\n // that have been unsubscribed in the middle of the notification loop.\n\n var notifyNestedSubs = subscription.notifyNestedSubs.bind(subscription);\n return [subscription, notifyNestedSubs];\n }, [store, didStoreComeFromProps, contextValue]),\n subscription = _useMemo2[0],\n notifyNestedSubs = _useMemo2[1]; // Determine what {store, subscription} value should be put into nested context, if necessary,\n // and memoize that value to avoid unnecessary context updates.\n\n\n var overriddenContextValue = useMemo(function () {\n if (didStoreComeFromProps) {\n // This component is directly subscribed to a store from props.\n // We don't want descendants reading from this store - pass down whatever\n // the existing context value is from the nearest connected ancestor.\n return contextValue;\n } // Otherwise, put this component's subscription instance into context, so that\n // connected descendants won't update until after this component is done\n\n\n return _extends({}, contextValue, {\n subscription: subscription\n });\n }, [didStoreComeFromProps, contextValue, subscription]); // We need to force this wrapper component to re-render whenever a Redux store update\n // causes a change to the calculated child component props (or we caught an error in mapState)\n\n var _useReducer = useReducer(storeStateUpdatesReducer, EMPTY_ARRAY, initStateUpdates),\n _useReducer$ = _useReducer[0],\n previousStateUpdateResult = _useReducer$[0],\n forceComponentUpdateDispatch = _useReducer[1]; // Propagate any mapState/mapDispatch errors upwards\n\n\n if (previousStateUpdateResult && previousStateUpdateResult.error) {\n throw previousStateUpdateResult.error;\n } // Set up refs to coordinate values between the subscription effect and the render logic\n\n\n var lastChildProps = useRef();\n var lastWrapperProps = useRef(wrapperProps);\n var childPropsFromStoreUpdate = useRef();\n var renderIsScheduled = useRef(false);\n var actualChildProps = usePureOnlyMemo(function () {\n // Tricky logic here:\n // - This render may have been triggered by a Redux store update that produced new child props\n // - However, we may have gotten new wrapper props after that\n // If we have new child props, and the same wrapper props, we know we should use the new child props as-is.\n // But, if we have new wrapper props, those might change the child props, so we have to recalculate things.\n // So, we'll use the child props from store update only if the wrapper props are the same as last time.\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n } // TODO We're reading the store directly in render() here. Bad idea?\n // This will likely cause Bad Things (TM) to happen in Concurrent Mode.\n // Note that we do this because on renders _not_ caused by store updates, we need the latest store state\n // to determine what the child props should be.\n\n\n return childPropsSelector(store.getState(), wrapperProps);\n }, [store, previousStateUpdateResult, wrapperProps]); // We need this to execute synchronously every time we re-render. However, React warns\n // about useLayoutEffect in SSR, so we try to detect environment and fall back to\n // just useEffect instead to avoid the warning, since neither will run anyway.\n\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, actualChildProps, childPropsFromStoreUpdate, notifyNestedSubs]); // Our re-subscribe logic only runs when the store/subscription setup changes\n\n useIsomorphicLayoutEffectWithArgs(subscribeUpdates, [shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, childPropsFromStoreUpdate, notifyNestedSubs, forceComponentUpdateDispatch], [store, subscription, childPropsSelector]); // Now that all that's done, we can finally try to actually render the child component.\n // We memoize the elements for the rendered child component as an optimization.\n\n var renderedWrappedComponent = useMemo(function () {\n return React.createElement(WrappedComponent, _extends({}, actualChildProps, {\n ref: forwardedRef\n }));\n }, [forwardedRef, WrappedComponent, actualChildProps]); // If React sees the exact same element reference as last time, it bails out of re-rendering\n // that child, same as if it was wrapped in React.memo() or returned false from shouldComponentUpdate.\n\n var renderedChild = useMemo(function () {\n if (shouldHandleStateChanges) {\n // If this component is subscribed to store updates, we need to pass its own\n // subscription instance down to our descendants. That means rendering the same\n // Context instance, and putting a different value into the context.\n return React.createElement(ContextToUse.Provider, {\n value: overriddenContextValue\n }, renderedWrappedComponent);\n }\n\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n } // If we're in \"pure\" mode, ensure our wrapper component only re-renders when incoming props have changed.\n\n\n var Connect = pure ? React.memo(ConnectFunction) : ConnectFunction;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = displayName;\n\n if (forwardRef) {\n var forwarded = React.forwardRef(function forwardConnectRef(props, ref) {\n return React.createElement(Connect, _extends({}, props, {\n forwardedRef: ref\n }));\n });\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return hoistStatics(forwarded, WrappedComponent);\n }\n\n return hoistStatics(Connect, WrappedComponent);\n };\n}","function is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\n\nexport default function shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n\n for (var i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}","import verifyPlainObject from '../utils/verifyPlainObject';\nexport function wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch, options) {\n var constant = getConstant(dispatch, options);\n\n function constantSelector() {\n return constant;\n }\n\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n} // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args\n// to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine\n// whether mapToProps needs to be invoked when props have changed.\n//\n// A length of one signals that mapToProps does not depend on props from the parent component.\n// A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and\n// therefore not reporting its length accurately..\n\nexport function getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n} // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction,\n// this function wraps mapToProps in a proxy function which does several things:\n//\n// * Detects whether the mapToProps function being called depends on props, which\n// is used by selectorFactory to decide if it should reinvoke on props changes.\n//\n// * On first call, handles mapToProps if returns another function, and treats that\n// new function as the true mapToProps for subsequent calls.\n//\n// * On first call, verifies the first result is a plain object, in order to warn\n// the developer that their mapToProps function is not returning a valid result.\n//\n\nexport function wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, _ref) {\n var displayName = _ref.displayName;\n\n var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch);\n }; // allow detectFactoryAndVerify to get ownProps\n\n\n proxy.dependsOnOwnProps = true;\n\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n var props = proxy(stateOrDispatch, ownProps);\n\n if (typeof props === 'function') {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(props, displayName, methodName);\n return props;\n };\n\n return proxy;\n };\n}","import { bindActionCreators } from 'redux';\nimport { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapDispatchToPropsIsFunction(mapDispatchToProps) {\n return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined;\n}\nexport function whenMapDispatchToPropsIsMissing(mapDispatchToProps) {\n return !mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) {\n return {\n dispatch: dispatch\n };\n }) : undefined;\n}\nexport function whenMapDispatchToPropsIsObject(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) {\n return bindActionCreators(mapDispatchToProps, dispatch);\n }) : undefined;\n}\nexport default [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject];","import { wrapMapToPropsConstant, wrapMapToPropsFunc } from './wrapMapToProps';\nexport function whenMapStateToPropsIsFunction(mapStateToProps) {\n return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined;\n}\nexport function whenMapStateToPropsIsMissing(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(function () {\n return {};\n }) : undefined;\n}\nexport default [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport verifyPlainObject from '../utils/verifyPlainObject';\nexport function defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return _extends({}, ownProps, {}, stateProps, {}, dispatchProps);\n}\nexport function wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, _ref) {\n var displayName = _ref.displayName,\n pure = _ref.pure,\n areMergedPropsEqual = _ref.areMergedPropsEqual;\n var hasRunOnce = false;\n var mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n\n if (hasRunOnce) {\n if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== 'production') verifyPlainObject(mergedProps, displayName, 'mergeProps');\n }\n\n return mergedProps;\n };\n };\n}\nexport function whenMergePropsIsFunction(mergeProps) {\n return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined;\n}\nexport function whenMergePropsIsOmitted(mergeProps) {\n return !mergeProps ? function () {\n return defaultMergeProps;\n } : undefined;\n}\nexport default [whenMergePropsIsFunction, whenMergePropsIsOmitted];","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport verifySubselectors from './verifySubselectors';\nexport function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) {\n return function impureFinalPropsSelector(state, ownProps) {\n return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps);\n };\n}\nexport function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) {\n var areStatesEqual = _ref.areStatesEqual,\n areOwnPropsEqual = _ref.areOwnPropsEqual,\n areStatePropsEqual = _ref.areStatePropsEqual;\n var hasRunAtLeastOnce = false;\n var state;\n var ownProps;\n var stateProps;\n var dispatchProps;\n var mergedProps;\n\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleNewState() {\n var nextStateProps = mapStateToProps(state, ownProps);\n var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n\n function handleSubsequentCalls(nextState, nextOwnProps) {\n var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n var stateChanged = !areStatesEqual(nextState, state);\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n} // TODO: Add more comments\n// If pure is true, the selector returned by selectorFactory will memoize its results,\n// allowing connectAdvanced's shouldComponentUpdate to return false if final\n// props have not changed. If false, the selector will always return a new\n// object and shouldComponentUpdate will always return true.\n\nexport default function finalPropsSelectorFactory(dispatch, _ref2) {\n var initMapStateToProps = _ref2.initMapStateToProps,\n initMapDispatchToProps = _ref2.initMapDispatchToProps,\n initMergeProps = _ref2.initMergeProps,\n options = _objectWithoutPropertiesLoose(_ref2, [\"initMapStateToProps\", \"initMapDispatchToProps\", \"initMergeProps\"]);\n\n var mapStateToProps = initMapStateToProps(dispatch, options);\n var mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n var mergeProps = initMergeProps(dispatch, options);\n\n if (process.env.NODE_ENV !== 'production') {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName);\n }\n\n var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory;\n return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport connectAdvanced from '../components/connectAdvanced';\nimport shallowEqual from '../utils/shallowEqual';\nimport defaultMapDispatchToPropsFactories from './mapDispatchToProps';\nimport defaultMapStateToPropsFactories from './mapStateToProps';\nimport defaultMergePropsFactories from './mergeProps';\nimport defaultSelectorFactory from './selectorFactory';\n/*\r\n connect is a facade over connectAdvanced. It turns its args into a compatible\r\n selectorFactory, which has the signature:\r\n\r\n (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps\r\n \r\n connect passes its args to connectAdvanced as options, which will in turn pass them to\r\n selectorFactory each time a Connect component instance is instantiated or hot reloaded.\r\n\r\n selectorFactory returns a final props selector from its mapStateToProps,\r\n mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps,\r\n mergePropsFactories, and pure args.\r\n\r\n The resulting final props selector is called by the Connect component instance whenever\r\n it receives new props or store state.\r\n */\n\nfunction match(arg, factories, name) {\n for (var i = factories.length - 1; i >= 0; i--) {\n var result = factories[i](arg);\n if (result) return result;\n }\n\n return function (dispatch, options) {\n throw new Error(\"Invalid value of type \" + typeof arg + \" for \" + name + \" argument when connecting component \" + options.wrappedComponentName + \".\");\n };\n}\n\nfunction strictEqual(a, b) {\n return a === b;\n} // createConnect with default args builds the 'official' connect behavior. Calling it with\n// different options opens up some testing and extensibility scenarios\n\n\nexport function createConnect(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$connectHOC = _ref.connectHOC,\n connectHOC = _ref$connectHOC === void 0 ? connectAdvanced : _ref$connectHOC,\n _ref$mapStateToPropsF = _ref.mapStateToPropsFactories,\n mapStateToPropsFactories = _ref$mapStateToPropsF === void 0 ? defaultMapStateToPropsFactories : _ref$mapStateToPropsF,\n _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories,\n mapDispatchToPropsFactories = _ref$mapDispatchToPro === void 0 ? defaultMapDispatchToPropsFactories : _ref$mapDispatchToPro,\n _ref$mergePropsFactor = _ref.mergePropsFactories,\n mergePropsFactories = _ref$mergePropsFactor === void 0 ? defaultMergePropsFactories : _ref$mergePropsFactor,\n _ref$selectorFactory = _ref.selectorFactory,\n selectorFactory = _ref$selectorFactory === void 0 ? defaultSelectorFactory : _ref$selectorFactory;\n\n return function connect(mapStateToProps, mapDispatchToProps, mergeProps, _ref2) {\n if (_ref2 === void 0) {\n _ref2 = {};\n }\n\n var _ref3 = _ref2,\n _ref3$pure = _ref3.pure,\n pure = _ref3$pure === void 0 ? true : _ref3$pure,\n _ref3$areStatesEqual = _ref3.areStatesEqual,\n areStatesEqual = _ref3$areStatesEqual === void 0 ? strictEqual : _ref3$areStatesEqual,\n _ref3$areOwnPropsEqua = _ref3.areOwnPropsEqual,\n areOwnPropsEqual = _ref3$areOwnPropsEqua === void 0 ? shallowEqual : _ref3$areOwnPropsEqua,\n _ref3$areStatePropsEq = _ref3.areStatePropsEqual,\n areStatePropsEqual = _ref3$areStatePropsEq === void 0 ? shallowEqual : _ref3$areStatePropsEq,\n _ref3$areMergedPropsE = _ref3.areMergedPropsEqual,\n areMergedPropsEqual = _ref3$areMergedPropsE === void 0 ? shallowEqual : _ref3$areMergedPropsE,\n extraOptions = _objectWithoutPropertiesLoose(_ref3, [\"pure\", \"areStatesEqual\", \"areOwnPropsEqual\", \"areStatePropsEqual\", \"areMergedPropsEqual\"]);\n\n var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps');\n var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps');\n var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps');\n return connectHOC(selectorFactory, _extends({\n // used in error messages\n methodName: 'connect',\n // used to compute Connect's displayName from the wrapped component's displayName.\n getDisplayName: function getDisplayName(name) {\n return \"Connect(\" + name + \")\";\n },\n // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes\n shouldHandleStateChanges: Boolean(mapStateToProps),\n // passed through to selectorFactory\n initMapStateToProps: initMapStateToProps,\n initMapDispatchToProps: initMapDispatchToProps,\n initMergeProps: initMergeProps,\n pure: pure,\n areStatesEqual: areStatesEqual,\n areOwnPropsEqual: areOwnPropsEqual,\n areStatePropsEqual: areStatePropsEqual,\n areMergedPropsEqual: areMergedPropsEqual\n }, extraOptions));\n };\n}\nexport default /*#__PURE__*/createConnect();","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\n/**\r\n * A hook to access the value of the `ReactReduxContext`. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @returns {any} the value of the `ReactReduxContext`\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useReduxContext } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const { store } = useReduxContext()\r\n * return <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport function useReduxContext() {\n var contextValue = useContext(ReactReduxContext);\n\n if (process.env.NODE_ENV !== 'production' && !contextValue) {\n throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');\n }\n\n return contextValue;\n}","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\n/**\r\n * Hook factory, which creates a `useStore` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useStore` hook bound to the specified context.\r\n */\n\nexport function createStoreHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useStore() {\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store;\n\n return store;\n };\n}\n/**\r\n * A hook to access the redux store.\r\n *\r\n * @returns {any} the redux store\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useStore } from 'react-redux'\r\n *\r\n * export const ExampleComponent = () => {\r\n * const store = useStore()\r\n * return <div>{store.getState()}</div>\r\n * }\r\n */\n\nexport var useStore = /*#__PURE__*/createStoreHook();","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\r\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useDispatch` hook bound to the specified context.\r\n */\n\nexport function createDispatchHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useStore = context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n var store = useStore();\n return store.dispatch;\n };\n}\n/**\r\n * A hook to access the redux `dispatch` function.\r\n *\r\n * @returns {any|function} redux store's `dispatch` function\r\n *\r\n * @example\r\n *\r\n * import React, { useCallback } from 'react'\r\n * import { useDispatch } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const dispatch = useDispatch()\r\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\r\n * return (\r\n * <div>\r\n * <span>{value}</span>\r\n * <button onClick={increaseCounter}>Increase counter</button>\r\n * </div>\r\n * )\r\n * }\r\n */\n\nexport var useDispatch = /*#__PURE__*/createDispatchHook();","import { useReducer, useRef, useMemo, useContext } from 'react';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport Subscription from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from '../components/Context';\n\nvar refEquality = function refEquality(a, b) {\n return a === b;\n};\n\nfunction useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {\n var _useReducer = useReducer(function (s) {\n return s + 1;\n }, 0),\n forceRender = _useReducer[1];\n\n var subscription = useMemo(function () {\n return new Subscription(store, contextSub);\n }, [store, contextSub]);\n var latestSubscriptionCallbackError = useRef();\n var latestSelector = useRef();\n var latestSelectedState = useRef();\n var selectedState;\n\n try {\n if (selector !== latestSelector.current || latestSubscriptionCallbackError.current) {\n selectedState = selector(store.getState());\n } else {\n selectedState = latestSelectedState.current;\n }\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n err.message += \"\\nThe error may be correlated with this previous error:\\n\" + latestSubscriptionCallbackError.current.stack + \"\\n\\n\";\n }\n\n throw err;\n }\n\n useIsomorphicLayoutEffect(function () {\n latestSelector.current = selector;\n latestSelectedState.current = selectedState;\n latestSubscriptionCallbackError.current = undefined;\n });\n useIsomorphicLayoutEffect(function () {\n function checkForUpdates() {\n try {\n var newSelectedState = latestSelector.current(store.getState());\n\n if (equalityFn(newSelectedState, latestSelectedState.current)) {\n return;\n }\n\n latestSelectedState.current = newSelectedState;\n } catch (err) {\n // we ignore all errors here, since when the component\n // is re-rendered, the selectors are called again, and\n // will throw again, if neither props nor store state\n // changed\n latestSubscriptionCallbackError.current = err;\n }\n\n forceRender({});\n }\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n return function () {\n return subscription.tryUnsubscribe();\n };\n }, [store, subscription]);\n return selectedState;\n}\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useSelector(selector, equalityFn) {\n if (equalityFn === void 0) {\n equalityFn = refEquality;\n }\n\n if (process.env.NODE_ENV !== 'production' && !selector) {\n throw new Error(\"You must pass a selector to useSelectors\");\n }\n\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store,\n contextSub = _useReduxContext.subscription;\n\n return useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return <div>{counter}</div>\r\n * }\r\n */\n\nexport var useSelector = /*#__PURE__*/createSelectorHook();","import Provider from './components/Provider';\nimport connectAdvanced from './components/connectAdvanced';\nimport { ReactReduxContext } from './components/Context';\nimport connect from './connect/connect';\nimport { useDispatch, createDispatchHook } from './hooks/useDispatch';\nimport { useSelector, createSelectorHook } from './hooks/useSelector';\nimport { useStore, createStoreHook } from './hooks/useStore';\nimport { setBatch } from './utils/batch';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport shallowEqual from './utils/shallowEqual';\nsetBatch(batch);\nexport { Provider, connectAdvanced, ReactReduxContext, connect, batch, useDispatch, createDispatchHook, useSelector, createSelectorHook, useStore, createStoreHook, shallowEqual };","import detectPassiveEvents from 'detect-passive-events';\nimport { forceSingleColumn } from 'flavours/glitch/util/initial_state';\n\nconst LAYOUT_BREAKPOINT = 630;\n\nexport function isMobile(width, columns) {\n switch (columns) {\n case 'multiple':\n return false;\n case 'single':\n return true;\n default:\n return forceSingleColumn || width <= LAYOUT_BREAKPOINT;\n }\n};\n\nconst iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n\nlet userTouching = false;\nlet listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;\n\nfunction touchListener() {\n userTouching = true;\n window.removeEventListener('touchstart', touchListener, listenerOptions);\n}\n\nwindow.addEventListener('touchstart', touchListener, listenerOptions);\n\nexport function isUserTouching() {\n return userTouching;\n}\n\nexport function isIOS() {\n return iOS;\n};\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n/** `Object#toString` result references. */\n\n\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n/** Built-in value references. */\n\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n\n return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);\n}\n\nmodule.exports = baseGetTag;","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;","/**\n * This is a straight rip-off of the React.js ReactPropTypes.js proptype validators,\n * modified to make it possible to validate Immutable.js data.\n * ImmutableTypes.listOf is patterned after React.PropTypes.arrayOf, but for Immutable.List\n * ImmutableTypes.shape is based on React.PropTypes.shape, but for any Immutable.Iterable\n */\n\"use strict\";\n\nvar Immutable = require(\"immutable\");\n\nvar ANONYMOUS = \"<<anonymous>>\";\nvar ImmutablePropTypes;\n\nif (process.env.NODE_ENV !== \"production\") {\n ImmutablePropTypes = {\n listOf: createListOfTypeChecker,\n mapOf: createMapOfTypeChecker,\n orderedMapOf: createOrderedMapOfTypeChecker,\n setOf: createSetOfTypeChecker,\n orderedSetOf: createOrderedSetOfTypeChecker,\n stackOf: createStackOfTypeChecker,\n iterableOf: createIterableOfTypeChecker,\n recordOf: createRecordOfTypeChecker,\n shape: createShapeChecker,\n contains: createShapeChecker,\n mapContains: createMapContainsChecker,\n orderedMapContains: createOrderedMapContainsChecker,\n // Primitive Types\n list: createImmutableTypeChecker(\"List\", Immutable.List.isList),\n map: createImmutableTypeChecker(\"Map\", Immutable.Map.isMap),\n orderedMap: createImmutableTypeChecker(\"OrderedMap\", Immutable.OrderedMap.isOrderedMap),\n set: createImmutableTypeChecker(\"Set\", Immutable.Set.isSet),\n orderedSet: createImmutableTypeChecker(\"OrderedSet\", Immutable.OrderedSet.isOrderedSet),\n stack: createImmutableTypeChecker(\"Stack\", Immutable.Stack.isStack),\n seq: createImmutableTypeChecker(\"Seq\", Immutable.Seq.isSeq),\n record: createImmutableTypeChecker(\"Record\", function (isRecord) {\n return isRecord instanceof Immutable.Record;\n }),\n iterable: createImmutableTypeChecker(\"Iterable\", Immutable.Iterable.isIterable)\n };\n} else {\n var productionTypeChecker = function productionTypeChecker() {\n invariant(false, \"ImmutablePropTypes type checking code is stripped in production.\");\n };\n\n productionTypeChecker.isRequired = productionTypeChecker;\n\n var getProductionTypeChecker = function getProductionTypeChecker() {\n return productionTypeChecker;\n };\n\n ImmutablePropTypes = {\n listOf: getProductionTypeChecker,\n mapOf: getProductionTypeChecker,\n orderedMapOf: getProductionTypeChecker,\n setOf: getProductionTypeChecker,\n orderedSetOf: getProductionTypeChecker,\n stackOf: getProductionTypeChecker,\n iterableOf: getProductionTypeChecker,\n recordOf: getProductionTypeChecker,\n shape: getProductionTypeChecker,\n contains: getProductionTypeChecker,\n mapContains: getProductionTypeChecker,\n orderedMapContains: getProductionTypeChecker,\n // Primitive Types\n list: productionTypeChecker,\n map: productionTypeChecker,\n orderedMap: productionTypeChecker,\n set: productionTypeChecker,\n orderedSet: productionTypeChecker,\n stack: productionTypeChecker,\n seq: productionTypeChecker,\n record: productionTypeChecker,\n iterable: productionTypeChecker\n };\n}\n\nImmutablePropTypes.iterable.indexed = createIterableSubclassTypeChecker(\"Indexed\", Immutable.Iterable.isIndexed);\nImmutablePropTypes.iterable.keyed = createIterableSubclassTypeChecker(\"Keyed\", Immutable.Iterable.isKeyed);\n\nfunction getPropType(propValue) {\n var propType = typeof propValue;\n\n if (Array.isArray(propValue)) {\n return \"array\";\n }\n\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return \"object\";\n }\n\n if (propValue instanceof Immutable.Iterable) {\n return \"Immutable.\" + propValue.toSource().split(\" \")[0];\n }\n\n return propType;\n}\n\nfunction createChainableTypeChecker(validate) {\n function checkType(isRequired, props, propName, componentName, location, propFullName) {\n for (var _len = arguments.length, rest = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {\n rest[_key - 6] = arguments[_key];\n }\n\n propFullName = propFullName || propName;\n componentName = componentName || ANONYMOUS;\n\n if (props[propName] == null) {\n var locationName = location;\n\n if (isRequired) {\n return new Error(\"Required \" + locationName + \" `\" + propFullName + \"` was not specified in \" + (\"`\" + componentName + \"`.\"));\n }\n } else {\n return validate.apply(undefined, [props, propName, componentName, location, propFullName].concat(rest));\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n return chainedCheckType;\n}\n\nfunction createImmutableTypeChecker(immutableClassName, immutableClassTypeValidator) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n\n if (!immutableClassTypeValidator(propValue)) {\n var propType = getPropType(propValue);\n return new Error(\"Invalid \" + location + \" `\" + propFullName + \"` of type `\" + propType + \"` \" + (\"supplied to `\" + componentName + \"`, expected `\" + immutableClassName + \"`.\"));\n }\n\n return null;\n }\n\n return createChainableTypeChecker(validate);\n}\n\nfunction createIterableSubclassTypeChecker(subclassName, validator) {\n return createImmutableTypeChecker(\"Iterable.\" + subclassName, function (propValue) {\n return Immutable.Iterable.isIterable(propValue) && validator(propValue);\n });\n}\n\nfunction createIterableTypeChecker(typeChecker, immutableClassName, immutableClassTypeValidator) {\n function validate(props, propName, componentName, location, propFullName) {\n for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n rest[_key - 5] = arguments[_key];\n }\n\n var propValue = props[propName];\n\n if (!immutableClassTypeValidator(propValue)) {\n var locationName = location;\n var propType = getPropType(propValue);\n return new Error(\"Invalid \" + locationName + \" `\" + propFullName + \"` of type \" + (\"`\" + propType + \"` supplied to `\" + componentName + \"`, expected an Immutable.js \" + immutableClassName + \".\"));\n }\n\n if (typeof typeChecker !== \"function\") {\n return new Error(\"Invalid typeChecker supplied to `\" + componentName + \"` \" + (\"for propType `\" + propFullName + \"`, expected a function.\"));\n }\n\n var propValues = propValue.valueSeq().toArray();\n\n for (var i = 0, len = propValues.length; i < len; i++) {\n var error = typeChecker.apply(undefined, [propValues, i, componentName, location, \"\" + propFullName + \"[\" + i + \"]\"].concat(rest));\n\n if (error instanceof Error) {\n return error;\n }\n }\n }\n\n return createChainableTypeChecker(validate);\n}\n\nfunction createKeysTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n rest[_key - 5] = arguments[_key];\n }\n\n var propValue = props[propName];\n\n if (typeof typeChecker !== \"function\") {\n return new Error(\"Invalid keysTypeChecker (optional second argument) supplied to `\" + componentName + \"` \" + (\"for propType `\" + propFullName + \"`, expected a function.\"));\n }\n\n var keys = propValue.keySeq().toArray();\n\n for (var i = 0, len = keys.length; i < len; i++) {\n var error = typeChecker.apply(undefined, [keys, i, componentName, location, \"\" + propFullName + \" -> key(\" + keys[i] + \")\"].concat(rest));\n\n if (error instanceof Error) {\n return error;\n }\n }\n }\n\n return createChainableTypeChecker(validate);\n}\n\nfunction createListOfTypeChecker(typeChecker) {\n return createIterableTypeChecker(typeChecker, \"List\", Immutable.List.isList);\n}\n\nfunction createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, immutableClassName, immutableClassTypeValidator) {\n function validate() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return createIterableTypeChecker(valuesTypeChecker, immutableClassName, immutableClassTypeValidator).apply(undefined, args) || keysTypeChecker && createKeysTypeChecker(keysTypeChecker).apply(undefined, args);\n }\n\n return createChainableTypeChecker(validate);\n}\n\nfunction createMapOfTypeChecker(valuesTypeChecker, keysTypeChecker) {\n return createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, \"Map\", Immutable.Map.isMap);\n}\n\nfunction createOrderedMapOfTypeChecker(valuesTypeChecker, keysTypeChecker) {\n return createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, \"OrderedMap\", Immutable.OrderedMap.isOrderedMap);\n}\n\nfunction createSetOfTypeChecker(typeChecker) {\n return createIterableTypeChecker(typeChecker, \"Set\", Immutable.Set.isSet);\n}\n\nfunction createOrderedSetOfTypeChecker(typeChecker) {\n return createIterableTypeChecker(typeChecker, \"OrderedSet\", Immutable.OrderedSet.isOrderedSet);\n}\n\nfunction createStackOfTypeChecker(typeChecker) {\n return createIterableTypeChecker(typeChecker, \"Stack\", Immutable.Stack.isStack);\n}\n\nfunction createIterableOfTypeChecker(typeChecker) {\n return createIterableTypeChecker(typeChecker, \"Iterable\", Immutable.Iterable.isIterable);\n}\n\nfunction createRecordOfTypeChecker(recordKeys) {\n function validate(props, propName, componentName, location, propFullName) {\n for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n rest[_key - 5] = arguments[_key];\n }\n\n var propValue = props[propName];\n\n if (!(propValue instanceof Immutable.Record)) {\n var propType = getPropType(propValue);\n var locationName = location;\n return new Error(\"Invalid \" + locationName + \" `\" + propFullName + \"` of type `\" + propType + \"` \" + (\"supplied to `\" + componentName + \"`, expected an Immutable.js Record.\"));\n }\n\n for (var key in recordKeys) {\n var checker = recordKeys[key];\n\n if (!checker) {\n continue;\n }\n\n var mutablePropValue = propValue.toObject();\n var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, \"\" + propFullName + \".\" + key].concat(rest));\n\n if (error) {\n return error;\n }\n }\n }\n\n return createChainableTypeChecker(validate);\n} // there is some irony in the fact that shapeTypes is a standard hash and not an immutable collection\n\n\nfunction createShapeTypeChecker(shapeTypes) {\n var immutableClassName = arguments[1] === undefined ? \"Iterable\" : arguments[1];\n var immutableClassTypeValidator = arguments[2] === undefined ? Immutable.Iterable.isIterable : arguments[2];\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {\n rest[_key - 5] = arguments[_key];\n }\n\n var propValue = props[propName];\n\n if (!immutableClassTypeValidator(propValue)) {\n var propType = getPropType(propValue);\n var locationName = location;\n return new Error(\"Invalid \" + locationName + \" `\" + propFullName + \"` of type `\" + propType + \"` \" + (\"supplied to `\" + componentName + \"`, expected an Immutable.js \" + immutableClassName + \".\"));\n }\n\n var mutablePropValue = propValue.toObject();\n\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n\n if (!checker) {\n continue;\n }\n\n var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, \"\" + propFullName + \".\" + key].concat(rest));\n\n if (error) {\n return error;\n }\n }\n }\n\n return createChainableTypeChecker(validate);\n}\n\nfunction createShapeChecker(shapeTypes) {\n return createShapeTypeChecker(shapeTypes);\n}\n\nfunction createMapContainsChecker(shapeTypes) {\n return createShapeTypeChecker(shapeTypes, \"Map\", Immutable.Map.isMap);\n}\n\nfunction createOrderedMapContainsChecker(shapeTypes) {\n return createShapeTypeChecker(shapeTypes, \"OrderedMap\", Immutable.OrderedMap.isOrderedMap);\n}\n\nmodule.exports = ImmutablePropTypes;","var root = require('./_root');\n/** Built-in value references. */\n\n\nvar Symbol = root.Symbol;\nmodule.exports = Symbol;","\"use strict\";\n\nvar __extends = this && this.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (b.hasOwnProperty(p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar ValidationError =\n/** @class */\nfunction (_super) {\n __extends(ValidationError, _super);\n\n function ValidationError(message) {\n var _this = _super.call(this, message) || this;\n\n _this.name = \"ValidationError\";\n _this.message = message;\n return _this;\n }\n\n return ValidationError;\n}(Error);\n\nexports.ValidationError = ValidationError;","import { normalizeAccount, normalizeStatus, normalizePoll } from './normalizer';\n\nexport const ACCOUNT_IMPORT = 'ACCOUNT_IMPORT';\nexport const ACCOUNTS_IMPORT = 'ACCOUNTS_IMPORT';\nexport const STATUS_IMPORT = 'STATUS_IMPORT';\nexport const STATUSES_IMPORT = 'STATUSES_IMPORT';\nexport const POLLS_IMPORT = 'POLLS_IMPORT';\n\nfunction pushUnique(array, object) {\n if (array.every(element => element.id !== object.id)) {\n array.push(object);\n }\n}\n\nexport function importAccount(account) {\n return { type: ACCOUNT_IMPORT, account };\n}\n\nexport function importAccounts(accounts) {\n return { type: ACCOUNTS_IMPORT, accounts };\n}\n\nexport function importStatus(status) {\n return { type: STATUS_IMPORT, status };\n}\n\nexport function importStatuses(statuses) {\n return { type: STATUSES_IMPORT, statuses };\n}\n\nexport function importPolls(polls) {\n return { type: POLLS_IMPORT, polls };\n}\n\nexport function importFetchedAccount(account) {\n return importFetchedAccounts([account]);\n}\n\nexport function importFetchedAccounts(accounts) {\n const normalAccounts = [];\n\n function processAccount(account) {\n pushUnique(normalAccounts, normalizeAccount(account));\n\n if (account.moved) {\n processAccount(account.moved);\n }\n }\n\n accounts.forEach(processAccount);\n\n return importAccounts(normalAccounts);\n}\n\nexport function importFetchedStatus(status) {\n return importFetchedStatuses([status]);\n}\n\nexport function importFetchedStatuses(statuses) {\n return (dispatch, getState) => {\n const accounts = [];\n const normalStatuses = [];\n const polls = [];\n\n function processStatus(status) {\n pushUnique(normalStatuses, normalizeStatus(status, getState().getIn(['statuses', status.id])));\n pushUnique(accounts, status.account);\n\n if (status.reblog && status.reblog.id) {\n processStatus(status.reblog);\n }\n\n if (status.poll && status.poll.id) {\n pushUnique(polls, normalizePoll(status.poll));\n }\n }\n\n statuses.forEach(processStatus);\n\n dispatch(importPolls(polls));\n dispatch(importFetchedAccounts(accounts));\n dispatch(importStatuses(normalStatuses));\n };\n}\n\nexport function importFetchedPoll(poll) {\n return dispatch => {\n dispatch(importPolls([normalizePoll(poll)]));\n };\n}\n","const element = document.getElementById('initial-state');\nconst initialState = element && function () {\n const result = JSON.parse(element.textContent);\n try {\n result.local_settings = JSON.parse(localStorage.getItem('mastodon-settings'));\n } catch (e) {\n result.local_settings = {};\n }\n return result;\n}();\n\nconst getMeta = (prop) => initialState && initialState.meta && initialState.meta[prop];\nconst getRight = (prop) => initialState && initialState.rights && initialState.rights[prop];\n\nexport const reduceMotion = getMeta('reduce_motion');\nexport const autoPlayGif = getMeta('auto_play_gif');\nexport const displaySensitiveMedia = getMeta('display_sensitive_media');\nexport const displayMedia = getMeta('display_media') || (getMeta('display_sensitive_media') ? 'show_all' : 'default');\nexport const unfollowModal = getMeta('unfollow_modal');\nexport const boostModal = getMeta('boost_modal');\nexport const favouriteModal = getMeta('favourite_modal');\nexport const deleteModal = getMeta('delete_modal');\nexport const me = getMeta('me');\nexport const searchEnabled = getMeta('search_enabled');\nexport const maxChars = getMeta('max_toot_chars') || 500;\nexport const pollLimits = (initialState && initialState.poll_limits);\nexport const invitesEnabled = getMeta('invites_enabled');\nexport const version = getMeta('version');\nexport const mascot = getMeta('mascot');\nexport const profile_directory = getMeta('profile_directory');\nexport const isStaff = getMeta('is_staff');\nexport const defaultContentType = getMeta('default_content_type');\nexport const forceSingleColumn = getMeta('advanced_layout') === false;\nexport const useBlurhash = getMeta('use_blurhash');\nexport const usePendingItems = getMeta('use_pending_items');\nexport const useSystemEmojiFont = getMeta('system_emoji_font');\nexport const showTrends = getMeta('trends');\n\nexport const deleteOthersNotice = getRight('delete_others_notice');\n\nexport default initialState;\n","import { normalizeAccount, normalizeStatus, normalizePoll } from './normalizer';\n\nexport const ACCOUNT_IMPORT = 'ACCOUNT_IMPORT';\nexport const ACCOUNTS_IMPORT = 'ACCOUNTS_IMPORT';\nexport const STATUS_IMPORT = 'STATUS_IMPORT';\nexport const STATUSES_IMPORT = 'STATUSES_IMPORT';\nexport const POLLS_IMPORT = 'POLLS_IMPORT';\n\nfunction pushUnique(array, object) {\n if (array.every(element => element.id !== object.id)) {\n array.push(object);\n }\n}\n\nexport function importAccount(account) {\n return { type: ACCOUNT_IMPORT, account };\n}\n\nexport function importAccounts(accounts) {\n return { type: ACCOUNTS_IMPORT, accounts };\n}\n\nexport function importStatus(status) {\n return { type: STATUS_IMPORT, status };\n}\n\nexport function importStatuses(statuses) {\n return { type: STATUSES_IMPORT, statuses };\n}\n\nexport function importPolls(polls) {\n return { type: POLLS_IMPORT, polls };\n}\n\nexport function importFetchedAccount(account) {\n return importFetchedAccounts([account]);\n}\n\nexport function importFetchedAccounts(accounts) {\n const normalAccounts = [];\n\n function processAccount(account) {\n pushUnique(normalAccounts, normalizeAccount(account));\n\n if (account.moved) {\n processAccount(account.moved);\n }\n }\n\n accounts.forEach(processAccount);\n\n return importAccounts(normalAccounts);\n}\n\nexport function importFetchedStatus(status) {\n return importFetchedStatuses([status]);\n}\n\nexport function importFetchedStatuses(statuses) {\n return (dispatch, getState) => {\n const accounts = [];\n const normalStatuses = [];\n const polls = [];\n\n function processStatus(status) {\n pushUnique(normalStatuses, normalizeStatus(status, getState().getIn(['statuses', status.id])));\n pushUnique(accounts, status.account);\n\n if (status.reblog && status.reblog.id) {\n processStatus(status.reblog);\n }\n\n if (status.poll && status.poll.id) {\n pushUnique(polls, normalizePoll(status.poll));\n }\n }\n\n statuses.forEach(processStatus);\n\n dispatch(importPolls(polls));\n dispatch(importFetchedAccounts(accounts));\n dispatch(importStatuses(normalStatuses));\n };\n}\n\nexport function importFetchedPoll(poll) {\n return dispatch => {\n dispatch(importPolls([normalizePoll(poll)]));\n };\n}\n","'use strict';\n\nvar COMPATIBLE_ENCODING_PATTERN = /^utf-?8|ascii|utf-?16-?le|ucs-?2|base-?64|latin-?1$/i;\nvar WS_TRIM_PATTERN = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\nvar WS_CHAR_PATTERN = /\\s|\\uFEFF|\\xA0/;\nvar WS_FOLD_PATTERN = /\\r?\\n[\\x20\\x09]+/g;\nvar DELIMITER_PATTERN = /[;,\"]/;\nvar WS_DELIMITER_PATTERN = /[;,\"]|\\s/;\nvar STATE = {\n IDLE: 1 << 0,\n URI: 1 << 1,\n ATTR: 1 << 2\n};\n\nfunction trim(value) {\n return value.replace(WS_TRIM_PATTERN, '');\n}\n\nfunction hasWhitespace(value) {\n return WS_CHAR_PATTERN.test(value);\n}\n\nfunction skipWhitespace(value, offset) {\n while (hasWhitespace(value[offset])) {\n offset++;\n }\n\n return offset;\n}\n\nfunction needsQuotes(value) {\n return WS_DELIMITER_PATTERN.test(value);\n}\n\nvar Link = /*#__PURE__*/function () {\n /**\n * Link\n * @constructor\n * @param {String} [value]\n * @returns {Link}\n */\n function Link(value) {\n /** @type {Array} URI references */\n this.refs = [];\n\n if (value) {\n this.parse(value);\n }\n }\n /**\n * Get refs with given relation type\n * @param {String} value\n * @returns {Array<Object>}\n */\n\n\n var _proto = Link.prototype;\n\n _proto.rel = function rel(value) {\n var links = [];\n\n for (var i = 0; i < this.refs.length; i++) {\n if (this.refs[i].rel === value) {\n links.push(this.refs[i]);\n }\n }\n\n return links;\n }\n /**\n * Get refs where given attribute has a given value\n * @param {String} attr\n * @param {String} value\n * @returns {Array<Object>}\n */\n ;\n\n _proto.get = function get(attr, value) {\n attr = attr.toLowerCase();\n var links = [];\n\n for (var i = 0; i < this.refs.length; i++) {\n if (this.refs[i][attr] === value) {\n links.push(this.refs[i]);\n }\n }\n\n return links;\n };\n\n _proto.set = function set(link) {\n this.refs.push(link);\n return this;\n };\n\n _proto.has = function has(attr, value) {\n attr = attr.toLowerCase();\n\n for (var i = 0; i < this.refs.length; i++) {\n if (this.refs[i][attr] === value) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto.parse = function parse(value, offset) {\n offset = offset || 0;\n value = offset ? value.slice(offset) : value; // Trim & unfold folded lines\n\n value = trim(value).replace(WS_FOLD_PATTERN, '');\n var state = STATE.IDLE;\n var length = value.length;\n var offset = 0;\n var ref = null;\n\n while (offset < length) {\n if (state === STATE.IDLE) {\n if (hasWhitespace(value[offset])) {\n offset++;\n continue;\n } else if (value[offset] === '<') {\n var end = value.indexOf('>', offset);\n if (end === -1) throw new Error('Expected end of URI delimiter at offset ' + offset);\n ref = {\n uri: value.slice(offset + 1, end)\n };\n this.refs.push(ref);\n offset = end;\n state = STATE.URI;\n } else {\n throw new Error('Unexpected character \"' + value[offset] + '\" at offset ' + offset);\n }\n\n offset++;\n } else if (state === STATE.URI) {\n if (hasWhitespace(value[offset])) {\n offset++;\n continue;\n } else if (value[offset] === ';') {\n state = STATE.ATTR;\n offset++;\n } else if (value[offset] === ',') {\n state = STATE.IDLE;\n offset++;\n } else {\n throw new Error('Unexpected character \"' + value[offset] + '\" at offset ' + offset);\n }\n } else if (state === STATE.ATTR) {\n if (value[offset] === ';' || hasWhitespace(value[offset])) {\n offset++;\n continue;\n }\n\n var end = value.indexOf('=', offset);\n if (end === -1) throw new Error('Expected attribute delimiter at offset ' + offset);\n var attr = trim(value.slice(offset, end)).toLowerCase();\n var attrValue = '';\n offset = end + 1;\n offset = skipWhitespace(value, offset);\n\n if (value[offset] === '\"') {\n offset++;\n\n while (offset < length) {\n if (value[offset] === '\"') {\n offset++;\n break;\n }\n\n if (value[offset] === '\\\\') {\n offset++;\n }\n\n attrValue += value[offset];\n offset++;\n }\n } else {\n var end = offset + 1;\n\n while (!DELIMITER_PATTERN.test(value[end]) && end < length) {\n end++;\n }\n\n attrValue = value.slice(offset, end);\n offset = end;\n }\n\n if (ref[attr] && Link.isSingleOccurenceAttr(attr)) {// Ignore multiples of attributes which may only appear once\n } else if (attr[attr.length - 1] === '*') {\n ref[attr] = Link.parseExtendedValue(attrValue);\n } else {\n attrValue = attr === 'rel' || attr === 'type' ? attrValue.toLowerCase() : attrValue;\n\n if (ref[attr] != null) {\n if (Array.isArray(ref[attr])) {\n ref[attr].push(attrValue);\n } else {\n ref[attr] = [ref[attr], attrValue];\n }\n } else {\n ref[attr] = attrValue;\n }\n }\n\n switch (value[offset]) {\n case ',':\n state = STATE.IDLE;\n break;\n\n case ';':\n state = STATE.ATTR;\n break;\n }\n\n offset++;\n } else {\n throw new Error('Unknown parser state \"' + state + '\"');\n }\n }\n\n ref = null;\n return this;\n };\n\n _proto.toString = function toString() {\n var refs = [];\n var link = '';\n var ref = null;\n\n for (var i = 0; i < this.refs.length; i++) {\n ref = this.refs[i];\n link = Object.keys(this.refs[i]).reduce(function (link, attr) {\n if (attr === 'uri') return link;\n return link + '; ' + Link.formatAttribute(attr, ref[attr]);\n }, '<' + ref.uri + '>');\n refs.push(link);\n }\n\n return refs.join(', ');\n };\n\n return Link;\n}();\n/**\n * Determines whether an encoding can be\n * natively handled with a `Buffer`\n * @param {String} value\n * @returns {Boolean}\n */\n\n\nLink.isCompatibleEncoding = function (value) {\n return COMPATIBLE_ENCODING_PATTERN.test(value);\n};\n\nLink.parse = function (value, offset) {\n return new Link().parse(value, offset);\n};\n\nLink.isSingleOccurenceAttr = function (attr) {\n return attr === 'rel' || attr === 'type' || attr === 'media' || attr === 'title' || attr === 'title*';\n};\n\nLink.isTokenAttr = function (attr) {\n return attr === 'rel' || attr === 'type' || attr === 'anchor';\n};\n\nLink.escapeQuotes = function (value) {\n return value.replace(/\"/g, '\\\\\"');\n};\n/**\n * Parses an extended value and attempts to decode it\n * @internal\n * @param {String} value\n * @return {Object}\n */\n\n\nLink.parseExtendedValue = function (value) {\n var parts = /([^']+)?(?:'([^']+)')?(.+)/.exec(value);\n return {\n language: parts[2].toLowerCase(),\n encoding: Link.isCompatibleEncoding(parts[1]) ? null : parts[1].toLowerCase(),\n value: Link.isCompatibleEncoding(parts[1]) ? decodeURIComponent(parts[3]) : parts[3]\n };\n};\n/**\n * Format a given extended attribute and it's value\n * @param {String} attr\n * @param {Object} data\n * @return {String}\n */\n\n\nLink.formatExtendedAttribute = function (attr, data) {\n var encoding = (data.encoding || 'utf-8').toUpperCase();\n var language = data.language || 'en';\n var encodedValue = '';\n\n if (Buffer.isBuffer(data.value) && Link.isCompatibleEncoding(encoding)) {\n encodedValue = data.value.toString(encoding);\n } else if (Buffer.isBuffer(data.value)) {\n encodedValue = data.value.toString('hex').replace(/[0-9a-f]{2}/gi, '%$1');\n } else {\n encodedValue = encodeURIComponent(data.value);\n }\n\n return attr + '=' + encoding + '\\'' + language + '\\'' + encodedValue;\n};\n/**\n * Format a given attribute and it's value\n * @param {String} attr\n * @param {String|Object} value\n * @return {String}\n */\n\n\nLink.formatAttribute = function (attr, value) {\n if (Array.isArray(value)) {\n return value.map(function (item) {\n return Link.formatAttribute(attr, item);\n }).join('; ');\n }\n\n if (attr[attr.length - 1] === '*' || typeof value !== 'string') {\n return Link.formatExtendedAttribute(attr, value);\n }\n\n if (Link.isTokenAttr(attr)) {\n value = needsQuotes(value) ? '\"' + Link.escapeQuotes(value) + '\"' : Link.escapeQuotes(value);\n } else if (needsQuotes(value)) {\n value = encodeURIComponent(value); // We don't need to escape <SP> <,> <;> within quotes\n\n value = value.replace(/%20/g, ' ').replace(/%2C/g, ',').replace(/%3B/g, ';');\n value = '\"' + value + '\"';\n }\n\n return attr + '=' + value;\n};\n\nmodule.exports = Link;","/* global window */\nimport ponyfill from './ponyfill.js';\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;","export const unescapeHTML = (html) => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = html.replace(/<br\\s*\\/?>/g, '\\n').replace(/<\\/p><p>/g, '\\n\\n').replace(/<[^>]*>/g, '');\n return wrapper.textContent;\n};\n","import React from 'react';\nimport { is } from 'immutable';\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar ImmutablePureComponent = function (_React$Component) {\n _inherits(ImmutablePureComponent, _React$Component);\n\n function ImmutablePureComponent() {\n _classCallCheck(this, ImmutablePureComponent);\n\n return _possibleConstructorReturn(this, (ImmutablePureComponent.__proto__ || Object.getPrototypeOf(ImmutablePureComponent)).apply(this, arguments));\n }\n\n _createClass(ImmutablePureComponent, [{\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate(nextProps) {\n var _this2 = this;\n\n var nextState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var state = this.state || {};\n return !(this.updateOnProps || Object.keys(_extends({}, nextProps, this.props))).every(function (p) {\n return is(nextProps[p], _this2.props[p]);\n }) || !(this.updateOnStates || Object.keys(_extends({}, nextState, state))).every(function (s) {\n return is(nextState[s], state[s]);\n });\n }\n }]);\n\n return ImmutablePureComponent;\n}(React.Component);\n\nexport { ImmutablePureComponent };\nexport default ImmutablePureComponent;","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class Permalink extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n className: PropTypes.string,\n href: PropTypes.string.isRequired,\n to: PropTypes.string.isRequired,\n children: PropTypes.node,\n onInterceptClick: PropTypes.func,\n };\n\n handleClick = (e) => {\n if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n if (this.props.onInterceptClick && this.props.onInterceptClick()) {\n e.preventDefault();\n return;\n }\n\n if (this.context.router) {\n e.preventDefault();\n let state = {...this.context.router.history.location.state};\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n this.context.router.history.push(this.props.to, state);\n }\n }\n }\n\n render () {\n const {\n children,\n className,\n href,\n to,\n onInterceptClick,\n ...other\n } = this.props;\n\n return (\n <a target='_blank' href={href} onClick={this.handleClick} {...other} className={`permalink${className ? ' ' + className : ''}`}>\n {children}\n </a>\n );\n }\n\n}\n","\"use strict\";\n\nfunction __export(m) {\n for (var p in m) {\n if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n }\n}\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar decode_1 = require(\"./decode\");\n\nexports.decode = decode_1.default;\nexports.isBlurhashValid = decode_1.isBlurhashValid;\n\nvar encode_1 = require(\"./encode\");\n\nexports.encode = encode_1.default;\n\n__export(require(\"./error\"));","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _SwipeableViews = _interopRequireDefault(require(\"./SwipeableViews\"));\n\nvar _default = _SwipeableViews.default;\nexports.default = _default;","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n/** `Object#toString` result references. */\n\n\nvar symbolTag = '[object Symbol]';\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n\nfunction isSymbol(value) {\n return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;\n}\n\nmodule.exports = isSymbol;","const element = document.getElementById('initial-state');\nconst initialState = element && JSON.parse(element.textContent);\n\nconst getMeta = (prop) => initialState && initialState.meta && initialState.meta[prop];\nconst getRight = (prop) => initialState && initialState.rights && initialState.rights[prop];\n\nexport const reduceMotion = getMeta('reduce_motion');\nexport const autoPlayGif = getMeta('auto_play_gif');\nexport const displayMedia = getMeta('display_media');\nexport const expandSpoilers = getMeta('expand_spoilers');\nexport const unfollowModal = getMeta('unfollow_modal');\nexport const boostModal = getMeta('boost_modal');\nexport const deleteModal = getMeta('delete_modal');\nexport const me = getMeta('me');\nexport const searchEnabled = getMeta('search_enabled');\nexport const maxChars = getMeta('max_toot_chars') || 500;\nexport const invitesEnabled = getMeta('invites_enabled');\nexport const repository = getMeta('repository');\nexport const source_url = getMeta('source_url');\nexport const version = getMeta('version');\nexport const mascot = getMeta('mascot');\nexport const profile_directory = getMeta('profile_directory');\nexport const isStaff = getMeta('is_staff');\nexport const forceSingleColumn = !getMeta('advanced_layout');\nexport const useBlurhash = getMeta('use_blurhash');\nexport const usePendingItems = getMeta('use_pending_items');\nexport const showTrends = getMeta('trends');\nexport const title = getMeta('title');\nexport const cropImages = getMeta('crop_images');\n\nexport const deleteOthersNotice = getRight('delete_others_notice');\n\nexport default initialState;\n","// NB: This function can still return unsafe HTML\nexport const unescapeHTML = (html) => {\n const wrapper = document.createElement('div');\n wrapper.innerHTML = html.replace(/<br\\s*\\/?>/g, '\\n').replace(/<\\/p><p>/g, '\\n\\n').replace(/<[^>]*>/g, '');\n return wrapper.textContent;\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport WaveSurfer from 'wavesurfer.js';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport { formatTime } from 'flavours/glitch/features/video';\nimport Icon from 'flavours/glitch/components/icon';\nimport classNames from 'classnames';\nimport { throttle } from 'lodash';\n\nconst messages = defineMessages({\n play: { id: 'video.play', defaultMessage: 'Play' },\n pause: { id: 'video.pause', defaultMessage: 'Pause' },\n mute: { id: 'video.mute', defaultMessage: 'Mute sound' },\n unmute: { id: 'video.unmute', defaultMessage: 'Unmute sound' },\n download: { id: 'video.download', defaultMessage: 'Download file' },\n});\n\nexport default @injectIntl\nclass Audio extends React.PureComponent {\n\n static propTypes = {\n src: PropTypes.string.isRequired,\n alt: PropTypes.string,\n duration: PropTypes.number,\n peaks: PropTypes.arrayOf(PropTypes.number),\n height: PropTypes.number,\n preload: PropTypes.bool,\n editable: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n currentTime: 0,\n duration: null,\n paused: true,\n muted: false,\n volume: 0.5,\n };\n\n // hard coded in components.scss\n // any way to get ::before values programatically?\n\n volWidth = 50;\n\n volOffset = 70;\n\n volHandleOffset = v => {\n const offset = v * this.volWidth + this.volOffset;\n return (offset > 110) ? 110 : offset;\n }\n\n setVolumeRef = c => {\n this.volume = c;\n }\n\n setWaveformRef = c => {\n this.waveform = c;\n }\n\n componentDidMount () {\n if (this.waveform) {\n this._updateWaveform();\n }\n }\n\n componentDidUpdate (prevProps) {\n if (this.waveform && prevProps.src !== this.props.src) {\n this._updateWaveform();\n }\n }\n\n componentWillUnmount () {\n if (this.wavesurfer) {\n this.wavesurfer.destroy();\n this.wavesurfer = null;\n }\n }\n\n _updateWaveform () {\n const { src, height, duration, peaks, preload } = this.props;\n\n const progressColor = window.getComputedStyle(document.querySelector('.audio-player__progress-placeholder')).getPropertyValue('background-color');\n const waveColor = window.getComputedStyle(document.querySelector('.audio-player__wave-placeholder')).getPropertyValue('background-color');\n\n if (this.wavesurfer) {\n this.wavesurfer.destroy();\n this.loaded = false;\n }\n\n const wavesurfer = WaveSurfer.create({\n container: this.waveform,\n height,\n barWidth: 3,\n cursorWidth: 0,\n progressColor,\n waveColor,\n backend: 'MediaElement',\n interact: preload,\n });\n\n wavesurfer.setVolume(this.state.volume);\n\n if (preload) {\n wavesurfer.load(src);\n this.loaded = true;\n } else {\n wavesurfer.load(src, peaks, 'none', duration);\n this.loaded = false;\n }\n\n wavesurfer.on('ready', () => this.setState({ duration: Math.floor(wavesurfer.getDuration()) }));\n wavesurfer.on('audioprocess', () => this.setState({ currentTime: Math.floor(wavesurfer.getCurrentTime()) }));\n wavesurfer.on('pause', () => this.setState({ paused: true }));\n wavesurfer.on('play', () => this.setState({ paused: false }));\n wavesurfer.on('volume', volume => this.setState({ volume }));\n wavesurfer.on('mute', muted => this.setState({ muted }));\n\n this.wavesurfer = wavesurfer;\n }\n\n togglePlay = () => {\n if (this.state.paused) {\n if (!this.props.preload && !this.loaded) {\n this.wavesurfer.createBackend();\n this.wavesurfer.createPeakCache();\n this.wavesurfer.load(this.props.src);\n this.wavesurfer.toggleInteraction();\n this.loaded = true;\n }\n\n this.wavesurfer.play();\n this.setState({ paused: false });\n } else {\n this.wavesurfer.pause();\n this.setState({ paused: true });\n }\n }\n\n toggleMute = () => {\n this.wavesurfer.setMute(!this.state.muted);\n }\n\n handleVolumeMouseDown = e => {\n document.addEventListener('mousemove', this.handleMouseVolSlide, true);\n document.addEventListener('mouseup', this.handleVolumeMouseUp, true);\n document.addEventListener('touchmove', this.handleMouseVolSlide, true);\n document.addEventListener('touchend', this.handleVolumeMouseUp, true);\n\n this.handleMouseVolSlide(e);\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleVolumeMouseUp = () => {\n document.removeEventListener('mousemove', this.handleMouseVolSlide, true);\n document.removeEventListener('mouseup', this.handleVolumeMouseUp, true);\n document.removeEventListener('touchmove', this.handleMouseVolSlide, true);\n document.removeEventListener('touchend', this.handleVolumeMouseUp, true);\n }\n\n handleMouseVolSlide = throttle(e => {\n const rect = this.volume.getBoundingClientRect();\n const x = (e.clientX - rect.left) / this.volWidth; // x position within the element.\n\n if(!isNaN(x)) {\n let slideamt = x;\n\n if (x > 1) {\n slideamt = 1;\n } else if(x < 0) {\n slideamt = 0;\n }\n\n this.wavesurfer.setVolume(slideamt);\n }\n }, 60);\n\n render () {\n const { height, intl, alt, editable } = this.props;\n const { paused, muted, volume, currentTime } = this.state;\n\n const volumeWidth = muted ? 0 : volume * this.volWidth;\n const volumeHandleLoc = muted ? this.volHandleOffset(0) : this.volHandleOffset(volume);\n\n return (\n <div className={classNames('audio-player', { editable })}>\n <div className='audio-player__progress-placeholder' style={{ display: 'none' }} />\n <div className='audio-player__wave-placeholder' style={{ display: 'none' }} />\n\n <div\n className='audio-player__waveform'\n aria-label={alt}\n title={alt}\n style={{ height }}\n ref={this.setWaveformRef}\n />\n\n <div className='video-player__controls active'>\n <div className='video-player__buttons-bar'>\n <div className='video-player__buttons left'>\n <button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} onClick={this.togglePlay}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button>\n <button type='button' title={intl.formatMessage(muted ? messages.unmute : messages.mute)} aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} onClick={this.toggleMute}><Icon id={muted ? 'volume-off' : 'volume-up'} fixedWidth /></button>\n\n <div className='video-player__volume' onMouseDown={this.handleVolumeMouseDown} ref={this.setVolumeRef}>\n &nbsp;\n <div className='video-player__volume__current' style={{ width: `${volumeWidth}px` }} />\n\n <span\n className={classNames('video-player__volume__handle')}\n tabIndex='0'\n style={{ left: `${volumeHandleLoc}px` }}\n />\n </div>\n\n <span>\n <span className='video-player__time-current'>{formatTime(currentTime)}</span>\n <span className='video-player__time-sep'>/</span>\n <span className='video-player__time-total'>{formatTime(this.state.duration || Math.floor(this.props.duration))}</span>\n </span>\n </div>\n\n <div className='video-player__buttons right'>\n <button type='button' title={intl.formatMessage(messages.download)} aria-label={intl.formatMessage(messages.download)}>\n <a className='video-player__download__icon' href={this.props.src} download>\n <Icon id={'download'} fixedWidth />\n </a>\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport WaveSurfer from 'wavesurfer.js';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport { formatTime } from 'mastodon/features/video';\nimport Icon from 'mastodon/components/icon';\nimport classNames from 'classnames';\nimport { throttle } from 'lodash';\n\nconst messages = defineMessages({\n play: { id: 'video.play', defaultMessage: 'Play' },\n pause: { id: 'video.pause', defaultMessage: 'Pause' },\n mute: { id: 'video.mute', defaultMessage: 'Mute sound' },\n unmute: { id: 'video.unmute', defaultMessage: 'Unmute sound' },\n download: { id: 'video.download', defaultMessage: 'Download file' },\n});\n\nexport default @injectIntl\nclass Audio extends React.PureComponent {\n\n static propTypes = {\n src: PropTypes.string.isRequired,\n alt: PropTypes.string,\n duration: PropTypes.number,\n peaks: PropTypes.arrayOf(PropTypes.number),\n height: PropTypes.number,\n preload: PropTypes.bool,\n editable: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n currentTime: 0,\n duration: null,\n paused: true,\n muted: false,\n volume: 0.5,\n };\n\n // Hard coded in components.scss\n // Any way to get ::before values programatically?\n volWidth = 50;\n volOffset = 70;\n\n volHandleOffset = v => {\n const offset = v * this.volWidth + this.volOffset;\n\n return (offset > 110) ? 110 : offset;\n }\n\n setVolumeRef = c => {\n this.volume = c;\n }\n\n setWaveformRef = c => {\n this.waveform = c;\n }\n\n componentDidMount () {\n if (this.waveform) {\n this._updateWaveform();\n }\n\n window.addEventListener('scroll', this.handleScroll);\n }\n\n componentDidUpdate (prevProps) {\n if (this.waveform && prevProps.src !== this.props.src) {\n this._updateWaveform();\n }\n }\n\n componentWillUnmount () {\n window.removeEventListener('scroll', this.handleScroll);\n\n if (this.wavesurfer) {\n this.wavesurfer.destroy();\n this.wavesurfer = null;\n }\n }\n\n _updateWaveform () {\n const { src, height, duration, peaks, preload } = this.props;\n\n const progressColor = window.getComputedStyle(document.querySelector('.audio-player__progress-placeholder')).getPropertyValue('background-color');\n const waveColor = window.getComputedStyle(document.querySelector('.audio-player__wave-placeholder')).getPropertyValue('background-color');\n\n if (this.wavesurfer) {\n this.wavesurfer.destroy();\n this.loaded = false;\n }\n\n const wavesurfer = WaveSurfer.create({\n container: this.waveform,\n height,\n barWidth: 3,\n cursorWidth: 0,\n progressColor,\n waveColor,\n backend: 'MediaElement',\n interact: preload,\n });\n\n wavesurfer.setVolume(this.state.volume);\n\n if (preload) {\n wavesurfer.load(src);\n this.loaded = true;\n } else {\n wavesurfer.load(src, peaks, 'none', duration);\n this.loaded = false;\n }\n\n wavesurfer.on('ready', () => this.setState({ duration: Math.floor(wavesurfer.getDuration()) }));\n wavesurfer.on('audioprocess', () => this.setState({ currentTime: Math.floor(wavesurfer.getCurrentTime()) }));\n wavesurfer.on('pause', () => this.setState({ paused: true }));\n wavesurfer.on('play', () => this.setState({ paused: false }));\n wavesurfer.on('volume', volume => this.setState({ volume }));\n wavesurfer.on('mute', muted => this.setState({ muted }));\n\n this.wavesurfer = wavesurfer;\n }\n\n togglePlay = () => {\n if (this.state.paused) {\n if (!this.props.preload && !this.loaded) {\n this.wavesurfer.createBackend();\n this.wavesurfer.createPeakCache();\n this.wavesurfer.load(this.props.src);\n this.wavesurfer.toggleInteraction();\n this.loaded = true;\n }\n\n this.setState({ paused: false }, () => this.wavesurfer.play());\n } else {\n this.setState({ paused: true }, () => this.wavesurfer.pause());\n }\n }\n\n toggleMute = () => {\n const muted = !this.state.muted;\n this.setState({ muted }, () => this.wavesurfer.setMute(muted));\n }\n\n handleVolumeMouseDown = e => {\n document.addEventListener('mousemove', this.handleMouseVolSlide, true);\n document.addEventListener('mouseup', this.handleVolumeMouseUp, true);\n document.addEventListener('touchmove', this.handleMouseVolSlide, true);\n document.addEventListener('touchend', this.handleVolumeMouseUp, true);\n\n this.handleMouseVolSlide(e);\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleVolumeMouseUp = () => {\n document.removeEventListener('mousemove', this.handleMouseVolSlide, true);\n document.removeEventListener('mouseup', this.handleVolumeMouseUp, true);\n document.removeEventListener('touchmove', this.handleMouseVolSlide, true);\n document.removeEventListener('touchend', this.handleVolumeMouseUp, true);\n }\n\n handleMouseVolSlide = throttle(e => {\n const rect = this.volume.getBoundingClientRect();\n const x = (e.clientX - rect.left) / this.volWidth; // x position within the element.\n\n if(!isNaN(x)) {\n let slideamt = x;\n\n if (x > 1) {\n slideamt = 1;\n } else if(x < 0) {\n slideamt = 0;\n }\n\n this.wavesurfer.setVolume(slideamt);\n }\n }, 60);\n\n handleScroll = throttle(() => {\n if (!this.waveform || !this.wavesurfer) {\n return;\n }\n\n const { top, height } = this.waveform.getBoundingClientRect();\n const inView = (top <= (window.innerHeight || document.documentElement.clientHeight)) && (top + height >= 0);\n\n if (!this.state.paused && !inView) {\n this.setState({ paused: true }, () => this.wavesurfer.pause());\n }\n }, 150, { trailing: true })\n\n render () {\n const { height, intl, alt, editable } = this.props;\n const { paused, muted, volume, currentTime } = this.state;\n\n const volumeWidth = muted ? 0 : volume * this.volWidth;\n const volumeHandleLoc = muted ? this.volHandleOffset(0) : this.volHandleOffset(volume);\n\n return (\n <div className={classNames('audio-player', { editable })}>\n <div className='audio-player__progress-placeholder' style={{ display: 'none' }} />\n <div className='audio-player__wave-placeholder' style={{ display: 'none' }} />\n\n <div\n className='audio-player__waveform'\n aria-label={alt}\n title={alt}\n style={{ height }}\n ref={this.setWaveformRef}\n />\n\n <div className='video-player__controls active'>\n <div className='video-player__buttons-bar'>\n <div className='video-player__buttons left'>\n <button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} onClick={this.togglePlay}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button>\n <button type='button' title={intl.formatMessage(muted ? messages.unmute : messages.mute)} aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} onClick={this.toggleMute}><Icon id={muted ? 'volume-off' : 'volume-up'} fixedWidth /></button>\n\n <div className='video-player__volume' onMouseDown={this.handleVolumeMouseDown} ref={this.setVolumeRef}>\n &nbsp;\n <div className='video-player__volume__current' style={{ width: `${volumeWidth}px` }} />\n\n <span\n className={classNames('video-player__volume__handle')}\n tabIndex='0'\n style={{ left: `${volumeHandleLoc}px` }}\n />\n </div>\n\n <span>\n <span className='video-player__time-current'>{formatTime(currentTime)}</span>\n <span className='video-player__time-sep'>/</span>\n <span className='video-player__time-total'>{formatTime(this.state.duration || Math.floor(this.props.duration))}</span>\n </span>\n </div>\n\n <div className='video-player__buttons right'>\n <button type='button' title={intl.formatMessage(messages.download)} aria-label={intl.formatMessage(messages.download)}>\n <a className='video-player__download__icon' href={this.props.src} download>\n <Icon id={'download'} fixedWidth />\n </a>\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n}\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\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 return fn.apply(thisArg, args);\n };\n};","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n}\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\n\n\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};","'use strict';\n\nvar utils = require('./utils');\n\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) || utils.isArrayBuffer(data) || utils.isBuffer(data) || utils.isStream(data) || utils.isFile(data) || utils.isBlob(data)) {\n return data;\n }\n\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n\n return data;\n }],\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) {\n /* Ignore */\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n maxContentLength: -1,\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\nmodule.exports = defaults;","'use strict';\n\nvar utils = require('./../utils');\n\nvar settle = require('./../core/settle');\n\nvar buildURL = require('./../helpers/buildURL');\n\nvar buildFullPath = require('../core/buildFullPath');\n\nvar parseHeaders = require('./../helpers/parseHeaders');\n\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\n\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest(); // HTTP basic authentication\n\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); // Set the request timeout in MS\n\n request.timeout = config.timeout; // Listen for ready state\n\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n } // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n\n\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n } // Prepare the response\n\n\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n settle(resolve, reject, response); // Clean up request\n\n request = null;\n }; // Handle browser request cancellation (as opposed to a manual cancellation)\n\n\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request)); // Clean up request\n\n request = null;\n }; // Handle low level network errors\n\n\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request)); // Clean up request\n\n request = null;\n }; // Handle timeout\n\n\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', request)); // Clean up request\n\n request = null;\n }; // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies'); // Add xsrf header\n\n\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n } // Add headers to the request\n\n\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n } // Add withCredentials to request if needed\n\n\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n } // Add responseType to request if needed\n\n\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n } // Handle progress if needed\n\n\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n } // Not all browsers support upload events\n\n\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel); // Clean up request\n\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n } // Send the request\n\n\n request.send(requestData);\n });\n};","'use strict';\n\nvar enhanceError = require('./enhanceError');\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\n\n\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};","'use strict';\n\nvar utils = require('../utils');\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\n\n\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];\n var defaultToConfig2Keys = ['baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer', 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken', 'socketPath'];\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n }\n });\n utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {\n if (utils.isObject(config2[prop])) {\n config[prop] = utils.deepMerge(config1[prop], config2[prop]);\n } else if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (utils.isObject(config1[prop])) {\n config[prop] = utils.deepMerge(config1[prop]);\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys);\n var otherKeys = Object.keys(config2).filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n return config;\n};","'use strict';\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\n\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\nmodule.exports = Cancel;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.LoadingBar = exports.TERMINATING_ANIMATION_DURATION = exports.ANIMATION_DURATION = exports.PROGRESS_INCREASE = exports.MAX_PROGRESS = exports.UPDATE_TIME = undefined;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactLifecyclesCompat = require('react-lifecycles-compat');\n\nvar _propTypes = require('prop-types');\n\nvar _reactRedux = require('react-redux');\n\nvar _loading_bar_ducks = require('./loading_bar_ducks');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar UPDATE_TIME = exports.UPDATE_TIME = 200;\nvar MAX_PROGRESS = exports.MAX_PROGRESS = 99;\nvar PROGRESS_INCREASE = exports.PROGRESS_INCREASE = 10;\nvar ANIMATION_DURATION = exports.ANIMATION_DURATION = UPDATE_TIME * 4;\nvar TERMINATING_ANIMATION_DURATION = exports.TERMINATING_ANIMATION_DURATION = UPDATE_TIME / 2;\nvar initialState = {\n percent: 0,\n status: 'hidden'\n};\n\nvar LoadingBar = function (_Component) {\n _inherits(LoadingBar, _Component);\n\n function LoadingBar() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, LoadingBar);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = LoadingBar.__proto__ || Object.getPrototypeOf(LoadingBar)).call.apply(_ref, [this].concat(args))), _this), _this.state = _extends({}, initialState), _this.reset = function () {\n _this.terminatingAnimationTimeoutId = null;\n\n _this.setState(initialState);\n }, _this.newPercent = function (percent, progressIncrease) {\n // Use cosine as a smoothing function\n // It could be any function to slow down progress near the ending 100%\n var smoothedProgressIncrease = progressIncrease * Math.cos(percent * (Math.PI / 2 / 100));\n return percent + smoothedProgressIncrease;\n }, _this.simulateProgress = function () {\n _this.setState(function (prevState, _ref2) {\n var maxProgress = _ref2.maxProgress,\n progressIncrease = _ref2.progressIncrease;\n var percent = prevState.percent;\n\n var newPercent = _this.newPercent(percent, progressIncrease);\n\n if (newPercent <= maxProgress) {\n percent = newPercent;\n }\n\n return {\n percent: percent\n };\n });\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(LoadingBar, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n if (this.state.status === 'starting') {\n this.start();\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n if (prevState.status !== this.state.status) {\n if (this.state.status === 'starting') {\n this.start();\n }\n\n if (this.state.status === 'stopping') {\n this.stop();\n }\n }\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearInterval(this.progressIntervalId);\n clearTimeout(this.terminatingAnimationTimeoutId);\n }\n }, {\n key: 'start',\n value: function start() {\n this.progressIntervalId = setInterval(this.simulateProgress, this.props.updateTime);\n this.setState({\n status: 'running'\n });\n }\n }, {\n key: 'stop',\n value: function stop() {\n clearInterval(this.progressIntervalId);\n this.progressIntervalId = null;\n var terminatingAnimationDuration = this.isShown() || this.props.showFastActions ? TERMINATING_ANIMATION_DURATION : 0;\n this.terminatingAnimationTimeoutId = setTimeout(this.reset, terminatingAnimationDuration);\n this.setState({\n percent: 100\n });\n }\n }, {\n key: 'isShown',\n value: function isShown() {\n return this.state.percent > 0 && this.state.percent <= 100;\n }\n }, {\n key: 'buildStyle',\n value: function buildStyle() {\n var animationDuration = this.state.status === 'stopping' ? TERMINATING_ANIMATION_DURATION : ANIMATION_DURATION; //\n // browser css3 animation compatibility\n // Style keys are camelCased in order to be\n // consistent with accessing the properties on DOM nodes from JS\n // (e.g. node.style.backgroundImage).\n // Vendor prefixes other than ms should begin with a capital letter.\n // This is why WebkitTransition has an uppercase “W”.\n // https://reactjs.org/docs/dom-elements.html#style\n\n var style = {\n opacity: '1',\n transform: 'scaleX(' + this.state.percent / 100 + ')',\n msTransform: 'scaleX(' + this.state.percent / 100 + ')',\n WebkitTransform: 'scaleX(' + this.state.percent / 100 + ')',\n MozTransform: 'scaleX(' + this.state.percent / 100 + ')',\n OTransform: 'scaleX(' + this.state.percent / 100 + ')',\n transformOrigin: 'left',\n msTransformOrigin: 'left',\n WebkitTransformOrigin: 'left',\n MozTransformOrigin: 'left',\n OTransformOrigin: 'left',\n transition: 'transform ' + animationDuration + 'ms linear',\n msTransition: '-ms-transform ' + animationDuration + 'ms linear',\n WebkitTransition: '-webkit-transform ' + animationDuration + 'ms linear',\n MozTransition: '-moz-transform ' + animationDuration + 'ms linear',\n OTransition: '-o-transform ' + animationDuration + 'ms linear',\n width: '100%',\n willChange: 'transform, opacity' // Use default styling if there's no CSS class applied\n\n };\n\n if (!this.props.className) {\n style.height = '3px';\n style.backgroundColor = 'red';\n style.position = 'absolute';\n }\n\n if (this.isShown()) {\n style.opacity = '1';\n } else {\n style.opacity = '0';\n }\n\n return _extends({}, style, this.props.style);\n }\n }, {\n key: 'render',\n value: function render() {\n if (this.state.status === 'hidden') {\n return _react2.default.createElement('div', null);\n }\n\n return _react2.default.createElement('div', null, _react2.default.createElement('div', {\n style: this.buildStyle(),\n className: this.props.className\n }), _react2.default.createElement('div', {\n style: {\n display: 'table',\n clear: 'both'\n }\n }));\n }\n }], [{\n key: 'shouldStart',\n value: function shouldStart(props, state) {\n return props.loading > 0 && ['hidden', 'stopping'].indexOf(state.status) >= 0;\n }\n }, {\n key: 'shouldStop',\n value: function shouldStop(props, state) {\n return props.loading === 0 && ['starting', 'running'].indexOf(state.status) >= 0;\n }\n }, {\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(nextProps, prevState) {\n if (LoadingBar.shouldStart(nextProps, prevState)) {\n return {\n status: 'starting'\n };\n }\n\n if (LoadingBar.shouldStop(nextProps, prevState)) {\n return {\n status: 'stopping'\n };\n }\n\n return null;\n }\n }]);\n\n return LoadingBar;\n}(_react.Component);\n\nLoadingBar.propTypes = {\n className: _propTypes.string,\n loading: _propTypes.number,\n maxProgress: _propTypes.number,\n progressIncrease: _propTypes.number,\n showFastActions: _propTypes.bool,\n updateTime: _propTypes.number,\n scope: _propTypes.string,\n style: _propTypes.object\n};\nLoadingBar.defaultProps = {\n className: '',\n loading: 0,\n maxProgress: MAX_PROGRESS,\n progressIncrease: PROGRESS_INCREASE,\n showFastActions: false,\n style: {},\n updateTime: UPDATE_TIME,\n scope: _loading_bar_ducks.DEFAULT_SCOPE\n};\n\nvar mapStateToProps = function mapStateToProps(state, ownProps) {\n return {\n loading: state.loadingBar[ownProps.scope || _loading_bar_ducks.DEFAULT_SCOPE]\n };\n};\n\n(0, _reactLifecyclesCompat.polyfill)(LoadingBar);\nvar ConnectedLoadingBar = (0, _reactRedux.connect)(mapStateToProps)(LoadingBar);\nexports.LoadingBar = LoadingBar;\nexports.default = ConnectedLoadingBar;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar digitCharacters = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\", \"#\", \"$\", \"%\", \"*\", \"+\", \",\", \"-\", \".\", \":\", \";\", \"=\", \"?\", \"@\", \"[\", \"]\", \"^\", \"_\", \"{\", \"|\", \"}\", \"~\"];\n\nexports.decode83 = function (str) {\n var value = 0;\n\n for (var i = 0; i < str.length; i++) {\n var c = str[i];\n var digit = digitCharacters.indexOf(c);\n value = value * 83 + digit;\n }\n\n return value;\n};\n\nexports.encode83 = function (n, length) {\n var result = \"\";\n\n for (var i = 1; i <= length; i++) {\n var digit = Math.floor(n) / Math.pow(83, length - i) % 83;\n result += digitCharacters[Math.floor(digit)];\n }\n\n return result;\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nexports.sRGBToLinear = function (value) {\n var v = value / 255;\n\n if (v <= 0.04045) {\n return v / 12.92;\n } else {\n return Math.pow((v + 0.055) / 1.055, 2.4);\n }\n};\n\nexports.linearTosRGB = function (value) {\n var v = Math.max(0, Math.min(1, value));\n\n if (v <= 0.0031308) {\n return Math.round(v * 12.92 * 255 + 0.5);\n } else {\n return Math.round((1.055 * Math.pow(v, 1 / 2.4) - 0.055) * 255 + 0.5);\n }\n};\n\nexports.sign = function (n) {\n return n < 0 ? -1 : 1;\n};\n\nexports.signPow = function (val, exp) {\n return exports.sign(val) * Math.pow(Math.abs(val), exp);\n};","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nmodule.exports = _interopRequireDefault;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nexport default class Icon extends React.PureComponent {\n\n static propTypes = {\n id: PropTypes.string.isRequired,\n className: PropTypes.string,\n fixedWidth: PropTypes.bool,\n };\n\n render () {\n const { id, className, fixedWidth, ...other } = this.props;\n\n return (\n <i role='img' className={classNames('fa', `fa-${id}`, className, { 'fa-fw': fixedWidth })} {...other} />\n );\n }\n\n}\n","\"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;","// taken from:\n// https://github.com/twitter/twemoji/blob/47732c7/twemoji-generator.js#L848-L866\nexports.unicodeToFilename = (str) => {\n let result = '';\n let charCode = 0;\n let p = 0;\n let i = 0;\n while (i < str.length) {\n charCode = str.charCodeAt(i++);\n if (p) {\n if (result.length > 0) {\n result += '-';\n }\n result += (0x10000 + ((p - 0xD800) << 10) + (charCode - 0xDC00)).toString(16);\n p = 0;\n } else if (0xD800 <= charCode && charCode <= 0xDBFF) {\n p = charCode;\n } else {\n if (result.length > 0) {\n result += '-';\n }\n result += charCode.toString(16);\n }\n }\n return result;\n};\n","/*!\n * wavesurfer.js 3.3.1 (2020-01-14)\n * https://github.com/katspaugh/wavesurfer.js\n * @license BSD-3-Clause\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(\"WaveSurfer\", [], factory);else if (typeof exports === 'object') exports[\"WaveSurfer\"] = factory();else root[\"WaveSurfer\"] = 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/wavesurfer.js\");\n /******/\n }(\n /************************************************************************/\n\n /******/\n {\n /***/\n \"./node_modules/debounce/index.js\":\n /*!****************************************!*\\\n !*** ./node_modules/debounce/index.js ***!\n \\****************************************/\n\n /*! no static exports found */\n\n /***/\n function node_modulesDebounceIndexJs(module, exports) {\n /**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\n function debounce(func, wait, immediate) {\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n }\n\n ;\n\n var debounced = function debounced() {\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function () {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n debounced.flush = function () {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n }\n\n ; // Adds compatibility for ES modules\n\n debounce.debounce = debounce;\n module.exports = debounce;\n /***/\n },\n\n /***/\n \"./src/drawer.canvasentry.js\":\n /*!***********************************!*\\\n !*** ./src/drawer.canvasentry.js ***!\n \\***********************************/\n\n /*! no static exports found */\n\n /***/\n function srcDrawerCanvasentryJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n var _style = _interopRequireDefault(__webpack_require__(\n /*! ./util/style */\n \"./src/util/style.js\"));\n\n var _getId = _interopRequireDefault(__webpack_require__(\n /*! ./util/get-id */\n \"./src/util/get-id.js\"));\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n /**\n * The `CanvasEntry` class represents an element consisting of a wave `canvas`\n * and an (optional) progress wave `canvas`.\n *\n * The `MultiCanvas` renderer uses one or more `CanvasEntry` instances to\n * render a waveform, depending on the zoom level.\n */\n\n\n var CanvasEntry = /*#__PURE__*/function () {\n function CanvasEntry() {\n _classCallCheck(this, CanvasEntry);\n /**\n * The wave node\n *\n * @type {HTMLCanvasElement}\n */\n\n\n this.wave = null;\n /**\n * The wave canvas rendering context\n *\n * @type {CanvasRenderingContext2D}\n */\n\n this.waveCtx = null;\n /**\n * The (optional) progress wave node\n *\n * @type {HTMLCanvasElement}\n */\n\n this.progress = null;\n /**\n * The (optional) progress wave canvas rendering context\n *\n * @type {CanvasRenderingContext2D}\n */\n\n this.progressCtx = null;\n /**\n * Start of the area the canvas should render, between 0 and 1\n *\n * @type {number}\n * @private\n */\n\n this.start = 0;\n /**\n * End of the area the canvas should render, between 0 and 1\n *\n * @type {number}\n * @private\n */\n\n this.end = 1;\n /**\n * Unique identifier for this entry\n *\n * @type {string}\n */\n\n this.id = (0, _getId.default)(this.constructor.name.toLowerCase() + '_');\n /**\n * Canvas 2d context attributes\n *\n * @type {object}\n */\n\n this.canvasContextAttributes = {};\n }\n /**\n * Store the wave canvas element and create the 2D rendering context\n *\n * @param {HTMLCanvasElement} element The wave `canvas` element.\n */\n\n\n _createClass(CanvasEntry, [{\n key: \"initWave\",\n value: function initWave(element) {\n this.wave = element;\n this.waveCtx = this.wave.getContext('2d', this.canvasContextAttributes);\n }\n /**\n * Store the progress wave canvas element and create the 2D rendering\n * context\n *\n * @param {HTMLCanvasElement} element The progress wave `canvas` element.\n */\n\n }, {\n key: \"initProgress\",\n value: function initProgress(element) {\n this.progress = element;\n this.progressCtx = this.progress.getContext('2d', this.canvasContextAttributes);\n }\n /**\n * Update the dimensions\n *\n * @param {number} elementWidth Width of the entry\n * @param {number} totalWidth Total width of the multi canvas renderer\n * @param {number} width The new width of the element\n * @param {number} height The new height of the element\n */\n\n }, {\n key: \"updateDimensions\",\n value: function updateDimensions(elementWidth, totalWidth, width, height) {\n // where the canvas starts and ends in the waveform, represented as a\n // decimal between 0 and 1\n this.start = this.wave.offsetLeft / totalWidth || 0;\n this.end = this.start + elementWidth / totalWidth; // set wave canvas dimensions\n\n this.wave.width = width;\n this.wave.height = height;\n var elementSize = {\n width: elementWidth + 'px'\n };\n (0, _style.default)(this.wave, elementSize);\n\n if (this.hasProgressCanvas) {\n // set progress canvas dimensions\n this.progress.width = width;\n this.progress.height = height;\n (0, _style.default)(this.progress, elementSize);\n }\n }\n /**\n * Clear the wave and progress rendering contexts\n */\n\n }, {\n key: \"clearWave\",\n value: function clearWave() {\n // wave\n this.waveCtx.clearRect(0, 0, this.waveCtx.canvas.width, this.waveCtx.canvas.height); // progress\n\n if (this.hasProgressCanvas) {\n this.progressCtx.clearRect(0, 0, this.progressCtx.canvas.width, this.progressCtx.canvas.height);\n }\n }\n /**\n * Set the fill styles for wave and progress\n *\n * @param {string} waveColor Fill color for the wave canvas\n * @param {?string} progressColor Fill color for the progress canvas\n */\n\n }, {\n key: \"setFillStyles\",\n value: function setFillStyles(waveColor, progressColor) {\n this.waveCtx.fillStyle = waveColor;\n\n if (this.hasProgressCanvas) {\n this.progressCtx.fillStyle = progressColor;\n }\n }\n /**\n * Draw a rectangle for wave and progress\n *\n * @param {number} x X start position\n * @param {number} y Y start position\n * @param {number} width Width of the rectangle\n * @param {number} height Height of the rectangle\n * @param {number} radius Radius of the rectangle\n */\n\n }, {\n key: \"fillRects\",\n value: function fillRects(x, y, width, height, radius) {\n this.fillRectToContext(this.waveCtx, x, y, width, height, radius);\n\n if (this.hasProgressCanvas) {\n this.fillRectToContext(this.progressCtx, x, y, width, height, radius);\n }\n }\n /**\n * Draw the actual rectangle on a `canvas` element\n *\n * @private\n * @param {CanvasRenderingContext2D} ctx Rendering context of target canvas\n * @param {number} x X start position\n * @param {number} y Y start position\n * @param {number} width Width of the rectangle\n * @param {number} height Height of the rectangle\n * @param {number} radius Radius of the rectangle\n */\n\n }, {\n key: \"fillRectToContext\",\n value: function fillRectToContext(ctx, x, y, width, height, radius) {\n if (!ctx) {\n return;\n }\n\n if (radius) {\n this.drawRoundedRect(ctx, x, y, width, height, radius);\n } else {\n ctx.fillRect(x, y, width, height);\n }\n }\n /**\n * Draw a rounded rectangle on Canvas\n *\n * @private\n * @param {CanvasRenderingContext2D} ctx Canvas context\n * @param {number} x X-position of the rectangle\n * @param {number} y Y-position of the rectangle\n * @param {number} width Width of the rectangle\n * @param {number} height Height of the rectangle\n * @param {number} radius Radius of the rectangle\n *\n * @return {void}\n * @example drawRoundedRect(ctx, 50, 50, 5, 10, 3)\n */\n\n }, {\n key: \"drawRoundedRect\",\n value: function drawRoundedRect(ctx, x, y, width, height, radius) {\n if (height === 0) {\n return;\n } // peaks are float values from -1 to 1. Use absolute height values in\n // order to correctly calculate rounded rectangle coordinates\n\n\n if (height < 0) {\n height *= -1;\n y -= height;\n }\n\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.lineTo(x + width - radius, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n ctx.lineTo(x + width, y + height - radius);\n ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n ctx.lineTo(x + radius, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n ctx.lineTo(x, y + radius);\n ctx.quadraticCurveTo(x, y, x + radius, y);\n ctx.closePath();\n ctx.fill();\n }\n /**\n * Render the actual wave and progress lines\n *\n * @param {number[]} peaks Array with peaks data\n * @param {number} absmax Maximum peak value (absolute)\n * @param {number} halfH Half the height of the waveform\n * @param {number} offsetY Offset to the top\n * @param {number} start The x-offset of the beginning of the area that\n * should be rendered\n * @param {number} end The x-offset of the end of the area that\n * should be rendered\n */\n\n }, {\n key: \"drawLines\",\n value: function drawLines(peaks, absmax, halfH, offsetY, start, end) {\n this.drawLineToContext(this.waveCtx, peaks, absmax, halfH, offsetY, start, end);\n\n if (this.hasProgressCanvas) {\n this.drawLineToContext(this.progressCtx, peaks, absmax, halfH, offsetY, start, end);\n }\n }\n /**\n * Render the actual waveform line on a `canvas` element\n *\n * @private\n * @param {CanvasRenderingContext2D} ctx Rendering context of target canvas\n * @param {number[]} peaks Array with peaks data\n * @param {number} absmax Maximum peak value (absolute)\n * @param {number} halfH Half the height of the waveform\n * @param {number} offsetY Offset to the top\n * @param {number} start The x-offset of the beginning of the area that\n * should be rendered\n * @param {number} end The x-offset of the end of the area that\n * should be rendered\n */\n\n }, {\n key: \"drawLineToContext\",\n value: function drawLineToContext(ctx, peaks, absmax, halfH, offsetY, start, end) {\n if (!ctx) {\n return;\n }\n\n var length = peaks.length / 2;\n var first = Math.round(length * this.start); // use one more peak value to make sure we join peaks at ends -- unless,\n // of course, this is the last canvas\n\n var last = Math.round(length * this.end) + 1;\n var canvasStart = first;\n var canvasEnd = last;\n var scale = this.wave.width / (canvasEnd - canvasStart - 1); // optimization\n\n var halfOffset = halfH + offsetY;\n var absmaxHalf = absmax / halfH;\n ctx.beginPath();\n ctx.moveTo((canvasStart - first) * scale, halfOffset);\n ctx.lineTo((canvasStart - first) * scale, halfOffset - Math.round((peaks[2 * canvasStart] || 0) / absmaxHalf));\n var i, peak, h;\n\n for (i = canvasStart; i < canvasEnd; i++) {\n peak = peaks[2 * i] || 0;\n h = Math.round(peak / absmaxHalf);\n ctx.lineTo((i - first) * scale + this.halfPixel, halfOffset - h);\n } // draw the bottom edge going backwards, to make a single\n // closed hull to fill\n\n\n var j = canvasEnd - 1;\n\n for (j; j >= canvasStart; j--) {\n peak = peaks[2 * j + 1] || 0;\n h = Math.round(peak / absmaxHalf);\n ctx.lineTo((j - first) * scale + this.halfPixel, halfOffset - h);\n }\n\n ctx.lineTo((canvasStart - first) * scale, halfOffset - Math.round((peaks[2 * canvasStart + 1] || 0) / absmaxHalf));\n ctx.closePath();\n ctx.fill();\n }\n /**\n * Destroys this entry\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.waveCtx = null;\n this.wave = null;\n this.progressCtx = null;\n this.progress = null;\n }\n /**\n * Return image data of the wave `canvas` element\n *\n * When using a `type` of `'blob'`, this will return a `Promise` that\n * resolves with a `Blob` instance.\n *\n * @param {string} format='image/png' An optional value of a format type.\n * @param {number} quality=0.92 An optional value between 0 and 1.\n * @param {string} type='dataURL' Either 'dataURL' or 'blob'.\n * @return {string|Promise} When using the default `'dataURL'` `type` this\n * returns a data URL. When using the `'blob'` `type` this returns a\n * `Promise` that resolves with a `Blob` instance.\n */\n\n }, {\n key: \"getImage\",\n value: function getImage(format, quality, type) {\n var _this = this;\n\n if (type === 'blob') {\n return new Promise(function (resolve) {\n _this.wave.toBlob(resolve, format, quality);\n });\n } else if (type === 'dataURL') {\n return this.wave.toDataURL(format, quality);\n }\n }\n }]);\n\n return CanvasEntry;\n }();\n\n exports.default = CanvasEntry;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/drawer.js\":\n /*!***********************!*\\\n !*** ./src/drawer.js ***!\n \\***********************/\n\n /*! no static exports found */\n\n /***/\n function srcDrawerJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n var util = _interopRequireWildcard(__webpack_require__(\n /*! ./util */\n \"./src/util/index.js\"));\n\n function _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n }\n\n function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj.default = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n }\n\n function _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 function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n /**\n * Parent class for renderers\n *\n * @extends {Observer}\n */\n\n\n var Drawer = /*#__PURE__*/function (_util$Observer) {\n _inherits(Drawer, _util$Observer);\n /**\n * @param {HTMLElement} container The container node of the wavesurfer instance\n * @param {WavesurferParams} params The wavesurfer initialisation options\n */\n\n\n function Drawer(container, params) {\n var _this;\n\n _classCallCheck(this, Drawer);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Drawer).call(this));\n /** @private */\n\n _this.container = container;\n /**\n * @type {WavesurferParams}\n * @private\n */\n\n _this.params = params;\n /**\n * The width of the renderer\n * @type {number}\n */\n\n _this.width = 0;\n /**\n * The height of the renderer\n * @type {number}\n */\n\n _this.height = params.height * _this.params.pixelRatio;\n /** @private */\n\n _this.lastPos = 0;\n /**\n * The `<wave>` element which is added to the container\n * @type {HTMLElement}\n */\n\n _this.wrapper = null;\n return _this;\n }\n /**\n * Alias of `util.style`\n *\n * @param {HTMLElement} el The element that the styles will be applied to\n * @param {Object} styles The map of propName: attribute, both are used as-is\n * @return {HTMLElement} el\n */\n\n\n _createClass(Drawer, [{\n key: \"style\",\n value: function style(el, styles) {\n return util.style(el, styles);\n }\n /**\n * Create the wrapper `<wave>` element, style it and set up the events for\n * interaction\n */\n\n }, {\n key: \"createWrapper\",\n value: function createWrapper() {\n this.wrapper = this.container.appendChild(document.createElement('wave'));\n this.style(this.wrapper, {\n display: 'block',\n position: 'relative',\n userSelect: 'none',\n webkitUserSelect: 'none',\n height: this.params.height + 'px'\n });\n\n if (this.params.fillParent || this.params.scrollParent) {\n this.style(this.wrapper, {\n width: '100%',\n overflowX: this.params.hideScrollbar ? 'hidden' : 'auto',\n overflowY: 'hidden'\n });\n }\n\n this.setupWrapperEvents();\n }\n /**\n * Handle click event\n *\n * @param {Event} e Click event\n * @param {?boolean} noPrevent Set to true to not call `e.preventDefault()`\n * @return {number} Playback position from 0 to 1\n */\n\n }, {\n key: \"handleEvent\",\n value: function handleEvent(e, noPrevent) {\n !noPrevent && e.preventDefault();\n var clientX = e.targetTouches ? e.targetTouches[0].clientX : e.clientX;\n var bbox = this.wrapper.getBoundingClientRect();\n var nominalWidth = this.width;\n var parentWidth = this.getWidth();\n var progress;\n\n if (!this.params.fillParent && nominalWidth < parentWidth) {\n progress = (this.params.rtl ? bbox.right - clientX : clientX - bbox.left) * (this.params.pixelRatio / nominalWidth) || 0;\n\n if (progress > 1) {\n progress = 1;\n }\n } else {\n progress = ((this.params.rtl ? bbox.right - clientX : clientX - bbox.left) + this.wrapper.scrollLeft) / this.wrapper.scrollWidth || 0;\n }\n\n return progress;\n }\n /**\n * @private\n */\n\n }, {\n key: \"setupWrapperEvents\",\n value: function setupWrapperEvents() {\n var _this2 = this;\n\n this.wrapper.addEventListener('click', function (e) {\n var scrollbarHeight = _this2.wrapper.offsetHeight - _this2.wrapper.clientHeight;\n\n if (scrollbarHeight !== 0) {\n // scrollbar is visible. Check if click was on it\n var bbox = _this2.wrapper.getBoundingClientRect();\n\n if (e.clientY >= bbox.bottom - scrollbarHeight) {\n // ignore mousedown as it was on the scrollbar\n return;\n }\n }\n\n if (_this2.params.interact) {\n _this2.fireEvent('click', e, _this2.handleEvent(e));\n }\n });\n this.wrapper.addEventListener('dblclick', function (e) {\n if (_this2.params.interact) {\n _this2.fireEvent('dblclick', e, _this2.handleEvent(e));\n }\n });\n this.wrapper.addEventListener('scroll', function (e) {\n return _this2.fireEvent('scroll', e);\n });\n }\n /**\n * Draw peaks on the canvas\n *\n * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays\n * for split channel rendering\n * @param {number} length The width of the area that should be drawn\n * @param {number} start The x-offset of the beginning of the area that\n * should be rendered\n * @param {number} end The x-offset of the end of the area that should be\n * rendered\n */\n\n }, {\n key: \"drawPeaks\",\n value: function drawPeaks(peaks, length, start, end) {\n if (!this.setWidth(length)) {\n this.clearWave();\n }\n\n this.params.barWidth ? this.drawBars(peaks, 0, start, end) : this.drawWave(peaks, 0, start, end);\n }\n /**\n * Scroll to the beginning\n */\n\n }, {\n key: \"resetScroll\",\n value: function resetScroll() {\n if (this.wrapper !== null) {\n this.wrapper.scrollLeft = 0;\n }\n }\n /**\n * Recenter the view-port at a certain percent of the waveform\n *\n * @param {number} percent Value from 0 to 1 on the waveform\n */\n\n }, {\n key: \"recenter\",\n value: function recenter(percent) {\n var position = this.wrapper.scrollWidth * percent;\n this.recenterOnPosition(position, true);\n }\n /**\n * Recenter the view-port on a position, either scroll there immediately or\n * in steps of 5 pixels\n *\n * @param {number} position X-offset in pixels\n * @param {boolean} immediate Set to true to immediately scroll somewhere\n */\n\n }, {\n key: \"recenterOnPosition\",\n value: function recenterOnPosition(position, immediate) {\n var scrollLeft = this.wrapper.scrollLeft;\n var half = ~~(this.wrapper.clientWidth / 2);\n var maxScroll = this.wrapper.scrollWidth - this.wrapper.clientWidth;\n var target = position - half;\n var offset = target - scrollLeft;\n\n if (maxScroll == 0) {\n // no need to continue if scrollbar is not there\n return;\n } // if the cursor is currently visible...\n\n\n if (!immediate && -half <= offset && offset < half) {\n // set rate at which waveform is centered\n var rate = this.params.autoCenterRate; // make rate depend on width of view and length of waveform\n\n rate /= half;\n rate *= maxScroll;\n offset = Math.max(-rate, Math.min(rate, offset));\n target = scrollLeft + offset;\n } // limit target to valid range (0 to maxScroll)\n\n\n target = Math.max(0, Math.min(maxScroll, target)); // no use attempting to scroll if we're not moving\n\n if (target != scrollLeft) {\n this.wrapper.scrollLeft = target;\n }\n }\n /**\n * Get the current scroll position in pixels\n *\n * @return {number} Horizontal scroll position in pixels\n */\n\n }, {\n key: \"getScrollX\",\n value: function getScrollX() {\n var x = 0;\n\n if (this.wrapper) {\n var pixelRatio = this.params.pixelRatio;\n x = Math.round(this.wrapper.scrollLeft * pixelRatio); // In cases of elastic scroll (safari with mouse wheel) you can\n // scroll beyond the limits of the container\n // Calculate and floor the scrollable extent to make sure an out\n // of bounds value is not returned\n // Ticket #1312\n\n if (this.params.scrollParent) {\n var maxScroll = ~~(this.wrapper.scrollWidth * pixelRatio - this.getWidth());\n x = Math.min(maxScroll, Math.max(0, x));\n }\n }\n\n return x;\n }\n /**\n * Get the width of the container\n *\n * @return {number} The width of the container\n */\n\n }, {\n key: \"getWidth\",\n value: function getWidth() {\n return Math.round(this.container.clientWidth * this.params.pixelRatio);\n }\n /**\n * Set the width of the container\n *\n * @param {number} width The new width of the container\n * @return {boolean} Whether the width of the container was updated or not\n */\n\n }, {\n key: \"setWidth\",\n value: function setWidth(width) {\n if (this.width == width) {\n return false;\n }\n\n this.width = width;\n\n if (this.params.fillParent || this.params.scrollParent) {\n this.style(this.wrapper, {\n width: ''\n });\n } else {\n this.style(this.wrapper, {\n width: ~~(this.width / this.params.pixelRatio) + 'px'\n });\n }\n\n this.updateSize();\n return true;\n }\n /**\n * Set the height of the container\n *\n * @param {number} height The new height of the container.\n * @return {boolean} Whether the height of the container was updated or not\n */\n\n }, {\n key: \"setHeight\",\n value: function setHeight(height) {\n if (height == this.height) {\n return false;\n }\n\n this.height = height;\n this.style(this.wrapper, {\n height: ~~(this.height / this.params.pixelRatio) + 'px'\n });\n this.updateSize();\n return true;\n }\n /**\n * Called by wavesurfer when progress should be rendered\n *\n * @param {number} progress From 0 to 1\n */\n\n }, {\n key: \"progress\",\n value: function progress(_progress) {\n var minPxDelta = 1 / this.params.pixelRatio;\n var pos = Math.round(_progress * this.width) * minPxDelta;\n\n if (pos < this.lastPos || pos - this.lastPos >= minPxDelta) {\n this.lastPos = pos;\n\n if (this.params.scrollParent && this.params.autoCenter) {\n var newPos = ~~(this.wrapper.scrollWidth * _progress);\n this.recenterOnPosition(newPos, this.params.autoCenterImmediately);\n }\n\n this.updateProgress(pos);\n }\n }\n /**\n * This is called when wavesurfer is destroyed\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.unAll();\n\n if (this.wrapper) {\n if (this.wrapper.parentNode == this.container) {\n this.container.removeChild(this.wrapper);\n }\n\n this.wrapper = null;\n }\n }\n /* Renderer-specific methods */\n\n /**\n * Called after cursor related params have changed.\n *\n * @abstract\n */\n\n }, {\n key: \"updateCursor\",\n value: function updateCursor() {}\n /**\n * Called when the size of the container changes so the renderer can adjust\n *\n * @abstract\n */\n\n }, {\n key: \"updateSize\",\n value: function updateSize() {}\n /**\n * Draw a waveform with bars\n *\n * @abstract\n * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays for split channel\n * rendering\n * @param {number} channelIndex The index of the current channel. Normally\n * should be 0\n * @param {number} start The x-offset of the beginning of the area that\n * should be rendered\n * @param {number} end The x-offset of the end of the area that should be\n * rendered\n */\n\n }, {\n key: \"drawBars\",\n value: function drawBars(peaks, channelIndex, start, end) {}\n /**\n * Draw a waveform\n *\n * @abstract\n * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays for split channel\n * rendering\n * @param {number} channelIndex The index of the current channel. Normally\n * should be 0\n * @param {number} start The x-offset of the beginning of the area that\n * should be rendered\n * @param {number} end The x-offset of the end of the area that should be\n * rendered\n */\n\n }, {\n key: \"drawWave\",\n value: function drawWave(peaks, channelIndex, start, end) {}\n /**\n * Clear the waveform\n *\n * @abstract\n */\n\n }, {\n key: \"clearWave\",\n value: function clearWave() {}\n /**\n * Render the new progress\n *\n * @abstract\n * @param {number} position X-Offset of progress position in pixels\n */\n\n }, {\n key: \"updateProgress\",\n value: function updateProgress(position) {}\n }]);\n\n return Drawer;\n }(util.Observer);\n\n exports.default = Drawer;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/drawer.multicanvas.js\":\n /*!***********************************!*\\\n !*** ./src/drawer.multicanvas.js ***!\n \\***********************************/\n\n /*! no static exports found */\n\n /***/\n function srcDrawerMulticanvasJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n var _drawer = _interopRequireDefault(__webpack_require__(\n /*! ./drawer */\n \"./src/drawer.js\"));\n\n var util = _interopRequireWildcard(__webpack_require__(\n /*! ./util */\n \"./src/util/index.js\"));\n\n var _drawer2 = _interopRequireDefault(__webpack_require__(\n /*! ./drawer.canvasentry */\n \"./src/drawer.canvasentry.js\"));\n\n function _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n }\n\n function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj.default = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n }\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _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 function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n /**\n * MultiCanvas renderer for wavesurfer. Is currently the default and sole\n * builtin renderer.\n *\n * A `MultiCanvas` consists of one or more `CanvasEntry` instances, depending\n * on the zoom level.\n */\n\n\n var MultiCanvas = /*#__PURE__*/function (_Drawer) {\n _inherits(MultiCanvas, _Drawer);\n /**\n * @param {HTMLElement} container The container node of the wavesurfer instance\n * @param {WavesurferParams} params The wavesurfer initialisation options\n */\n\n\n function MultiCanvas(container, params) {\n var _this;\n\n _classCallCheck(this, MultiCanvas);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MultiCanvas).call(this, container, params));\n /**\n * @type {number}\n * @private\n */\n\n _this.maxCanvasWidth = params.maxCanvasWidth;\n /**\n * @private\n * @type {number}\n */\n\n _this.maxCanvasElementWidth = Math.round(params.maxCanvasWidth / params.pixelRatio);\n /**\n * Whether or not the progress wave is rendered. If the `waveColor`\n * and `progressColor` are the same color it is not.\n *\n * @type {boolean}\n */\n\n _this.hasProgressCanvas = params.waveColor != params.progressColor;\n /**\n * @private\n * @type {number}\n */\n\n _this.halfPixel = 0.5 / params.pixelRatio;\n /**\n * List of `CanvasEntry` instances.\n *\n * @private\n * @type {Array}\n */\n\n _this.canvases = [];\n /**\n * @private\n * @type {HTMLElement}\n */\n\n _this.progressWave = null;\n /**\n * Class used to generate entries.\n *\n * @private\n * @type {function}\n */\n\n _this.EntryClass = _drawer2.default;\n /**\n * Canvas 2d context attributes.\n *\n * @private\n * @type {object}\n */\n\n _this.canvasContextAttributes = params.drawingContextAttributes;\n /**\n * Overlap added between entries to prevent vertical white stripes\n * between `canvas` elements.\n *\n * @type {number}\n */\n\n _this.overlap = 2 * Math.ceil(params.pixelRatio / 2);\n /**\n * The radius of the wave bars. Makes bars rounded\n *\n * @private\n * @type {number}\n */\n\n _this.barRadius = params.barRadius || 0;\n return _this;\n }\n /**\n * Initialize the drawer\n */\n\n\n _createClass(MultiCanvas, [{\n key: \"init\",\n value: function init() {\n this.createWrapper();\n this.createElements();\n }\n /**\n * Create the canvas elements and style them\n *\n * @private\n */\n\n }, {\n key: \"createElements\",\n value: function createElements() {\n this.progressWave = this.wrapper.appendChild(this.style(document.createElement('wave'), {\n position: 'absolute',\n zIndex: 3,\n left: 0,\n top: 0,\n bottom: 0,\n overflow: 'hidden',\n width: '0',\n display: 'none',\n boxSizing: 'border-box',\n borderRightStyle: 'solid',\n pointerEvents: 'none'\n }));\n this.addCanvas();\n this.updateCursor();\n }\n /**\n * Update cursor style\n */\n\n }, {\n key: \"updateCursor\",\n value: function updateCursor() {\n this.style(this.progressWave, {\n borderRightWidth: this.params.cursorWidth + 'px',\n borderRightColor: this.params.cursorColor\n });\n }\n /**\n * Adjust to the updated size by adding or removing canvases\n */\n\n }, {\n key: \"updateSize\",\n value: function updateSize() {\n var _this2 = this;\n\n var totalWidth = Math.round(this.width / this.params.pixelRatio);\n var requiredCanvases = Math.ceil(totalWidth / (this.maxCanvasElementWidth + this.overlap)); // add required canvases\n\n while (this.canvases.length < requiredCanvases) {\n this.addCanvas();\n } // remove older existing canvases, if any\n\n\n while (this.canvases.length > requiredCanvases) {\n this.removeCanvas();\n }\n\n var canvasWidth = this.maxCanvasWidth + this.overlap;\n var lastCanvas = this.canvases.length - 1;\n this.canvases.forEach(function (entry, i) {\n if (i == lastCanvas) {\n canvasWidth = _this2.width - _this2.maxCanvasWidth * lastCanvas;\n }\n\n _this2.updateDimensions(entry, canvasWidth, _this2.height);\n\n entry.clearWave();\n });\n }\n /**\n * Add a canvas to the canvas list\n *\n * @private\n */\n\n }, {\n key: \"addCanvas\",\n value: function addCanvas() {\n var entry = new this.EntryClass();\n entry.canvasContextAttributes = this.canvasContextAttributes;\n entry.hasProgressCanvas = this.hasProgressCanvas;\n entry.halfPixel = this.halfPixel;\n var leftOffset = this.maxCanvasElementWidth * this.canvases.length; // wave\n\n entry.initWave(this.wrapper.appendChild(this.style(document.createElement('canvas'), {\n position: 'absolute',\n zIndex: 2,\n left: leftOffset + 'px',\n top: 0,\n bottom: 0,\n height: '100%',\n pointerEvents: 'none'\n }))); // progress\n\n if (this.hasProgressCanvas) {\n entry.initProgress(this.progressWave.appendChild(this.style(document.createElement('canvas'), {\n position: 'absolute',\n left: leftOffset + 'px',\n top: 0,\n bottom: 0,\n height: '100%'\n })));\n }\n\n this.canvases.push(entry);\n }\n /**\n * Pop single canvas from the list\n *\n * @private\n */\n\n }, {\n key: \"removeCanvas\",\n value: function removeCanvas() {\n var lastEntry = this.canvases[this.canvases.length - 1]; // wave\n\n lastEntry.wave.parentElement.removeChild(lastEntry.wave); // progress\n\n if (this.hasProgressCanvas) {\n lastEntry.progress.parentElement.removeChild(lastEntry.progress);\n } // cleanup\n\n\n if (lastEntry) {\n lastEntry.destroy();\n lastEntry = null;\n }\n\n this.canvases.pop();\n }\n /**\n * Update the dimensions of a canvas element\n *\n * @private\n * @param {CanvasEntry} entry Target entry\n * @param {number} width The new width of the element\n * @param {number} height The new height of the element\n */\n\n }, {\n key: \"updateDimensions\",\n value: function updateDimensions(entry, width, height) {\n var elementWidth = Math.round(width / this.params.pixelRatio);\n var totalWidth = Math.round(this.width / this.params.pixelRatio); // update canvas dimensions\n\n entry.updateDimensions(elementWidth, totalWidth, width, height); // style element\n\n this.style(this.progressWave, {\n display: 'block'\n });\n }\n /**\n * Clear the whole multi-canvas\n */\n\n }, {\n key: \"clearWave\",\n value: function clearWave() {\n this.canvases.forEach(function (entry) {\n return entry.clearWave();\n });\n }\n /**\n * Draw a waveform with bars\n *\n * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays\n * for split channel rendering\n * @param {number} channelIndex The index of the current channel. Normally\n * should be 0. Must be an integer.\n * @param {number} start The x-offset of the beginning of the area that\n * should be rendered\n * @param {number} end The x-offset of the end of the area that should be\n * rendered\n * @returns {void}\n */\n\n }, {\n key: \"drawBars\",\n value: function drawBars(peaks, channelIndex, start, end) {\n var _this3 = this;\n\n return this.prepareDraw(peaks, channelIndex, start, end, function (_ref) {\n var absmax = _ref.absmax,\n hasMinVals = _ref.hasMinVals,\n height = _ref.height,\n offsetY = _ref.offsetY,\n halfH = _ref.halfH,\n peaks = _ref.peaks; // if drawBars was called within ws.empty we don't pass a start and\n // don't want anything to happen\n\n if (start === undefined) {\n return;\n } // Skip every other value if there are negatives.\n\n\n var peakIndexScale = hasMinVals ? 2 : 1;\n var length = peaks.length / peakIndexScale;\n var bar = _this3.params.barWidth * _this3.params.pixelRatio;\n var gap = _this3.params.barGap === null ? Math.max(_this3.params.pixelRatio, ~~(bar / 2)) : Math.max(_this3.params.pixelRatio, _this3.params.barGap * _this3.params.pixelRatio);\n var step = bar + gap;\n var scale = length / _this3.width;\n var first = start;\n var last = end;\n var i = first;\n\n for (i; i < last; i += step) {\n var peak = peaks[Math.floor(i * scale * peakIndexScale)] || 0;\n var h = Math.round(peak / absmax * halfH);\n /* in case of silences, allow the user to specify that we\n * always draw *something* (normally a 1px high bar) */\n\n if (h == 0 && _this3.params.barMinHeight) h = _this3.params.barMinHeight;\n\n _this3.fillRect(i + _this3.halfPixel, halfH - h + offsetY, bar + _this3.halfPixel, h * 2, _this3.barRadius);\n }\n });\n }\n /**\n * Draw a waveform\n *\n * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays\n * for split channel rendering\n * @param {number} channelIndex The index of the current channel. Normally\n * should be 0\n * @param {number?} start The x-offset of the beginning of the area that\n * should be rendered (If this isn't set only a flat line is rendered)\n * @param {number?} end The x-offset of the end of the area that should be\n * rendered\n * @returns {void}\n */\n\n }, {\n key: \"drawWave\",\n value: function drawWave(peaks, channelIndex, start, end) {\n var _this4 = this;\n\n return this.prepareDraw(peaks, channelIndex, start, end, function (_ref2) {\n var absmax = _ref2.absmax,\n hasMinVals = _ref2.hasMinVals,\n height = _ref2.height,\n offsetY = _ref2.offsetY,\n halfH = _ref2.halfH,\n peaks = _ref2.peaks;\n\n if (!hasMinVals) {\n var reflectedPeaks = [];\n var len = peaks.length;\n var i = 0;\n\n for (i; i < len; i++) {\n reflectedPeaks[2 * i] = peaks[i];\n reflectedPeaks[2 * i + 1] = -peaks[i];\n }\n\n peaks = reflectedPeaks;\n } // if drawWave was called within ws.empty we don't pass a start and\n // end and simply want a flat line\n\n\n if (start !== undefined) {\n _this4.drawLine(peaks, absmax, halfH, offsetY, start, end);\n } // always draw a median line\n\n\n _this4.fillRect(0, halfH + offsetY - _this4.halfPixel, _this4.width, _this4.halfPixel, _this4.barRadius);\n });\n }\n /**\n * Tell the canvas entries to render their portion of the waveform\n *\n * @private\n * @param {number[]} peaks Peaks data\n * @param {number} absmax Maximum peak value (absolute)\n * @param {number} halfH Half the height of the waveform\n * @param {number} offsetY Offset to the top\n * @param {number} start The x-offset of the beginning of the area that\n * should be rendered\n * @param {number} end The x-offset of the end of the area that\n * should be rendered\n */\n\n }, {\n key: \"drawLine\",\n value: function drawLine(peaks, absmax, halfH, offsetY, start, end) {\n var _this5 = this;\n\n this.canvases.forEach(function (entry) {\n _this5.setFillStyles(entry);\n\n entry.drawLines(peaks, absmax, halfH, offsetY, start, end);\n });\n }\n /**\n * Draw a rectangle on the multi-canvas\n *\n * @param {number} x X-position of the rectangle\n * @param {number} y Y-position of the rectangle\n * @param {number} width Width of the rectangle\n * @param {number} height Height of the rectangle\n * @param {number} radius Radius of the rectangle\n */\n\n }, {\n key: \"fillRect\",\n value: function fillRect(x, y, width, height, radius) {\n var startCanvas = Math.floor(x / this.maxCanvasWidth);\n var endCanvas = Math.min(Math.ceil((x + width) / this.maxCanvasWidth) + 1, this.canvases.length);\n var i = startCanvas;\n\n for (i; i < endCanvas; i++) {\n var entry = this.canvases[i];\n var leftOffset = i * this.maxCanvasWidth;\n var intersection = {\n x1: Math.max(x, i * this.maxCanvasWidth),\n y1: y,\n x2: Math.min(x + width, i * this.maxCanvasWidth + entry.wave.width),\n y2: y + height\n };\n\n if (intersection.x1 < intersection.x2) {\n this.setFillStyles(entry);\n entry.fillRects(intersection.x1 - leftOffset, intersection.y1, intersection.x2 - intersection.x1, intersection.y2 - intersection.y1, radius);\n }\n }\n }\n /**\n * Performs preparation tasks and calculations which are shared by `drawBars`\n * and `drawWave`\n *\n * @private\n * @param {number[]|Number.<Array[]>} peaks Can also be an array of arrays for\n * split channel rendering\n * @param {number} channelIndex The index of the current channel. Normally\n * should be 0\n * @param {number?} start The x-offset of the beginning of the area that\n * should be rendered. If this isn't set only a flat line is rendered\n * @param {number?} end The x-offset of the end of the area that should be\n * rendered\n * @param {function} fn The render function to call, e.g. `drawWave`\n * @returns {void}\n */\n\n }, {\n key: \"prepareDraw\",\n value: function prepareDraw(peaks, channelIndex, start, end, fn) {\n var _this6 = this;\n\n return util.frame(function () {\n // Split channels and call this function with the channelIndex set\n if (peaks[0] instanceof Array) {\n var channels = peaks;\n\n if (_this6.params.splitChannels) {\n _this6.setHeight(channels.length * _this6.params.height * _this6.params.pixelRatio);\n\n return channels.forEach(function (channelPeaks, i) {\n return _this6.prepareDraw(channelPeaks, i, start, end, fn);\n });\n }\n\n peaks = channels[0];\n } // calculate maximum modulation value, either from the barHeight\n // parameter or if normalize=true from the largest value in the peak\n // set\n\n\n var absmax = 1 / _this6.params.barHeight;\n\n if (_this6.params.normalize) {\n var max = util.max(peaks);\n var min = util.min(peaks);\n absmax = -min > max ? -min : max;\n } // Bar wave draws the bottom only as a reflection of the top,\n // so we don't need negative values\n\n\n var hasMinVals = [].some.call(peaks, function (val) {\n return val < 0;\n });\n var height = _this6.params.height * _this6.params.pixelRatio;\n var offsetY = height * channelIndex || 0;\n var halfH = height / 2;\n return fn({\n absmax: absmax,\n hasMinVals: hasMinVals,\n height: height,\n offsetY: offsetY,\n halfH: halfH,\n peaks: peaks\n });\n })();\n }\n /**\n * Set the fill styles for a certain entry (wave and progress)\n *\n * @private\n * @param {CanvasEntry} entry Target entry\n */\n\n }, {\n key: \"setFillStyles\",\n value: function setFillStyles(entry) {\n entry.setFillStyles(this.params.waveColor, this.params.progressColor);\n }\n /**\n * Return image data of the multi-canvas\n *\n * When using a `type` of `'blob'`, this will return a `Promise`.\n *\n * @param {string} format='image/png' An optional value of a format type.\n * @param {number} quality=0.92 An optional value between 0 and 1.\n * @param {string} type='dataURL' Either 'dataURL' or 'blob'.\n * @return {string|string[]|Promise} When using the default `'dataURL'`\n * `type` this returns a single data URL or an array of data URLs,\n * one for each canvas. When using the `'blob'` `type` this returns a\n * `Promise` that resolves with an array of `Blob` instances, one for each\n * canvas.\n */\n\n }, {\n key: \"getImage\",\n value: function getImage(format, quality, type) {\n if (type === 'blob') {\n return Promise.all(this.canvases.map(function (entry) {\n return entry.getImage(format, quality, type);\n }));\n } else if (type === 'dataURL') {\n var images = this.canvases.map(function (entry) {\n return entry.getImage(format, quality, type);\n });\n return images.length > 1 ? images : images[0];\n }\n }\n /**\n * Render the new progress\n *\n * @param {number} position X-offset of progress position in pixels\n */\n\n }, {\n key: \"updateProgress\",\n value: function updateProgress(position) {\n this.style(this.progressWave, {\n width: position + 'px'\n });\n }\n }]);\n\n return MultiCanvas;\n }(_drawer.default);\n\n exports.default = MultiCanvas;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/mediaelement-webaudio.js\":\n /*!**************************************!*\\\n !*** ./src/mediaelement-webaudio.js ***!\n \\**************************************/\n\n /*! no static exports found */\n\n /***/\n function srcMediaelementWebaudioJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n var _mediaelement = _interopRequireDefault(__webpack_require__(\n /*! ./mediaelement */\n \"./src/mediaelement.js\"));\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _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 function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n }\n\n function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n /**\n * MediaElementWebAudio backend: allows to load audio as HTML5 audio tag and use it with WebAudio API.\n * Setting the MediaElementWebAudio backend, there is the possibility to load audio of big dimensions, using the WebAudio API features.\n * The audio to load is an HTML5 audio tag, so you have to use the same methods of MediaElement backend for loading and playback.\n * In this way, the audio resource is not loaded entirely from server, but in ranges, since you load an HTML5 audio tag.\n * In this way, filters and other functionalities can be performed like with WebAudio backend, but without decoding\n * internally audio data, that caused crashing of the browser. You have to give also peaks, so the audio data are not decoded.\n *\n * @since 3.2.0\n */\n\n\n var MediaElementWebAudio = /*#__PURE__*/function (_MediaElement) {\n _inherits(MediaElementWebAudio, _MediaElement);\n /**\n * Construct the backend\n *\n * @param {WavesurferParams} params Wavesurfer parameters\n */\n\n\n function MediaElementWebAudio(params) {\n var _this;\n\n _classCallCheck(this, MediaElementWebAudio);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MediaElementWebAudio).call(this, params));\n /** @private */\n\n _this.params = params;\n /** @private */\n\n _this.sourceMediaElement = null;\n return _this;\n }\n /**\n * Initialise the backend, called in `wavesurfer.createBackend()`\n */\n\n\n _createClass(MediaElementWebAudio, [{\n key: \"init\",\n value: function init() {\n this.setPlaybackRate(this.params.audioRate);\n this.createTimer();\n this.createVolumeNode();\n this.createScriptNode();\n this.createAnalyserNode();\n }\n /**\n * Private method called by both `load` (from url)\n * and `loadElt` (existing media element) methods.\n *\n * @param {HTMLMediaElement} media HTML5 Audio or Video element\n * @param {number[]|Number.<Array[]>} peaks Array of peak data\n * @private\n */\n\n }, {\n key: \"_load\",\n value: function _load(media, peaks) {\n _get(_getPrototypeOf(MediaElementWebAudio.prototype), \"_load\", this).call(this, media, peaks);\n\n this.createMediaElementSource(media);\n }\n /**\n * Create MediaElementSource node\n *\n * @since 3.2.0\n * @param {HTMLMediaElement} mediaElement HTML5 Audio to load\n */\n\n }, {\n key: \"createMediaElementSource\",\n value: function createMediaElementSource(mediaElement) {\n this.sourceMediaElement = this.ac.createMediaElementSource(mediaElement);\n this.sourceMediaElement.connect(this.analyser);\n }\n }]);\n\n return MediaElementWebAudio;\n }(_mediaelement.default);\n\n exports.default = MediaElementWebAudio;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/mediaelement.js\":\n /*!*****************************!*\\\n !*** ./src/mediaelement.js ***!\n \\*****************************/\n\n /*! no static exports found */\n\n /***/\n function srcMediaelementJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n var _webaudio = _interopRequireDefault(__webpack_require__(\n /*! ./webaudio */\n \"./src/webaudio.js\"));\n\n var util = _interopRequireWildcard(__webpack_require__(\n /*! ./util */\n \"./src/util/index.js\"));\n\n function _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n }\n\n function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj.default = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n }\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _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 function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n }\n\n function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n /**\n * MediaElement backend\n */\n\n\n var MediaElement = /*#__PURE__*/function (_WebAudio) {\n _inherits(MediaElement, _WebAudio);\n /**\n * Construct the backend\n *\n * @param {WavesurferParams} params Wavesurfer parameters\n */\n\n\n function MediaElement(params) {\n var _this;\n\n _classCallCheck(this, MediaElement);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(MediaElement).call(this, params));\n /** @private */\n\n _this.params = params;\n /**\n * Initially a dummy media element to catch errors. Once `_load` is\n * called, this will contain the actual `HTMLMediaElement`.\n * @private\n */\n\n _this.media = {\n currentTime: 0,\n duration: 0,\n paused: true,\n playbackRate: 1,\n play: function play() {},\n pause: function pause() {},\n volume: 0\n };\n /** @private */\n\n _this.mediaType = params.mediaType.toLowerCase();\n /** @private */\n\n _this.elementPosition = params.elementPosition;\n /** @private */\n\n _this.peaks = null;\n /** @private */\n\n _this.playbackRate = 1;\n /** @private */\n\n _this.volume = 1;\n /** @private */\n\n _this.isMuted = false;\n /** @private */\n\n _this.buffer = null;\n /** @private */\n\n _this.onPlayEnd = null;\n /** @private */\n\n _this.mediaListeners = {};\n return _this;\n }\n /**\n * Initialise the backend, called in `wavesurfer.createBackend()`\n */\n\n\n _createClass(MediaElement, [{\n key: \"init\",\n value: function init() {\n this.setPlaybackRate(this.params.audioRate);\n this.createTimer();\n }\n /**\n * Attach event listeners to media element.\n */\n\n }, {\n key: \"_setupMediaListeners\",\n value: function _setupMediaListeners() {\n var _this2 = this;\n\n this.mediaListeners.error = function () {\n _this2.fireEvent('error', 'Error loading media element');\n };\n\n this.mediaListeners.canplay = function () {\n _this2.fireEvent('canplay');\n };\n\n this.mediaListeners.ended = function () {\n _this2.fireEvent('finish');\n }; // listen to and relay play, pause and seeked events to enable\n // playback control from the external media element\n\n\n this.mediaListeners.play = function () {\n _this2.fireEvent('play');\n };\n\n this.mediaListeners.pause = function () {\n _this2.fireEvent('pause');\n };\n\n this.mediaListeners.seeked = function (event) {\n _this2.fireEvent('seek');\n };\n\n this.mediaListeners.volumechange = function (event) {\n _this2.isMuted = _this2.media.muted;\n\n if (_this2.isMuted) {\n _this2.volume = 0;\n } else {\n _this2.volume = _this2.media.volume;\n }\n\n _this2.fireEvent('volume');\n }; // reset event listeners\n\n\n Object.keys(this.mediaListeners).forEach(function (id) {\n _this2.media.removeEventListener(id, _this2.mediaListeners[id]);\n\n _this2.media.addEventListener(id, _this2.mediaListeners[id]);\n });\n }\n /**\n * Create a timer to provide a more precise `audioprocess` event.\n */\n\n }, {\n key: \"createTimer\",\n value: function createTimer() {\n var _this3 = this;\n\n var onAudioProcess = function onAudioProcess() {\n if (_this3.isPaused()) {\n return;\n }\n\n _this3.fireEvent('audioprocess', _this3.getCurrentTime()); // Call again in the next frame\n\n\n util.frame(onAudioProcess)();\n };\n\n this.on('play', onAudioProcess); // Update the progress one more time to prevent it from being stuck in\n // case of lower framerates\n\n this.on('pause', function () {\n _this3.fireEvent('audioprocess', _this3.getCurrentTime());\n });\n }\n /**\n * Create media element with url as its source,\n * and append to container element.\n *\n * @param {string} url Path to media file\n * @param {HTMLElement} container HTML element\n * @param {number[]|Number.<Array[]>} peaks Array of peak data\n * @param {string} preload HTML 5 preload attribute value\n * @throws Will throw an error if the `url` argument is not a valid media\n * element.\n */\n\n }, {\n key: \"load\",\n value: function load(url, container, peaks, preload) {\n var media = document.createElement(this.mediaType);\n media.controls = this.params.mediaControls;\n media.autoplay = this.params.autoplay || false;\n media.preload = preload == null ? 'auto' : preload;\n media.src = url;\n media.style.width = '100%';\n var prevMedia = container.querySelector(this.mediaType);\n\n if (prevMedia) {\n container.removeChild(prevMedia);\n }\n\n container.appendChild(media);\n\n this._load(media, peaks);\n }\n /**\n * Load existing media element.\n *\n * @param {HTMLMediaElement} elt HTML5 Audio or Video element\n * @param {number[]|Number.<Array[]>} peaks Array of peak data\n */\n\n }, {\n key: \"loadElt\",\n value: function loadElt(elt, peaks) {\n elt.controls = this.params.mediaControls;\n elt.autoplay = this.params.autoplay || false;\n\n this._load(elt, peaks);\n }\n /**\n * Method called by both `load` (from url)\n * and `loadElt` (existing media element) methods.\n *\n * @param {HTMLMediaElement} media HTML5 Audio or Video element\n * @param {number[]|Number.<Array[]>} peaks Array of peak data\n * @throws Will throw an error if the `media` argument is not a valid media\n * element.\n * @private\n */\n\n }, {\n key: \"_load\",\n value: function _load(media, peaks) {\n // verify media element is valid\n if (!(media instanceof HTMLMediaElement) || typeof media.addEventListener === 'undefined') {\n throw new Error('media parameter is not a valid media element');\n } // load must be called manually on iOS, otherwise peaks won't draw\n // until a user interaction triggers load --> 'ready' event\n\n\n if (typeof media.load == 'function') {\n // Resets the media element and restarts the media resource. Any\n // pending events are discarded. How much media data is fetched is\n // still affected by the preload attribute.\n media.load();\n }\n\n this.media = media;\n\n this._setupMediaListeners();\n\n this.peaks = peaks;\n this.onPlayEnd = null;\n this.buffer = null;\n this.isMuted = media.muted;\n this.setPlaybackRate(this.playbackRate);\n this.setVolume(this.volume);\n }\n /**\n * Used by `wavesurfer.isPlaying()` and `wavesurfer.playPause()`\n *\n * @return {boolean} Media paused or not\n */\n\n }, {\n key: \"isPaused\",\n value: function isPaused() {\n return !this.media || this.media.paused;\n }\n /**\n * Used by `wavesurfer.getDuration()`\n *\n * @return {number} Duration\n */\n\n }, {\n key: \"getDuration\",\n value: function getDuration() {\n if (this.explicitDuration) {\n return this.explicitDuration;\n }\n\n var duration = (this.buffer || this.media).duration;\n\n if (duration >= Infinity) {\n // streaming audio\n duration = this.media.seekable.end(0);\n }\n\n return duration;\n }\n /**\n * Returns the current time in seconds relative to the audio-clip's\n * duration.\n *\n * @return {number} Current time\n */\n\n }, {\n key: \"getCurrentTime\",\n value: function getCurrentTime() {\n return this.media && this.media.currentTime;\n }\n /**\n * Get the position from 0 to 1\n *\n * @return {number} Current position\n */\n\n }, {\n key: \"getPlayedPercents\",\n value: function getPlayedPercents() {\n return this.getCurrentTime() / this.getDuration() || 0;\n }\n /**\n * Get the audio source playback rate.\n *\n * @return {number} Playback rate\n */\n\n }, {\n key: \"getPlaybackRate\",\n value: function getPlaybackRate() {\n return this.playbackRate || this.media.playbackRate;\n }\n /**\n * Set the audio source playback rate.\n *\n * @param {number} value Playback rate\n */\n\n }, {\n key: \"setPlaybackRate\",\n value: function setPlaybackRate(value) {\n this.playbackRate = value || 1;\n this.media.playbackRate = this.playbackRate;\n }\n /**\n * Used by `wavesurfer.seekTo()`\n *\n * @param {number} start Position to start at in seconds\n */\n\n }, {\n key: \"seekTo\",\n value: function seekTo(start) {\n if (start != null) {\n this.media.currentTime = start;\n }\n\n this.clearPlayEnd();\n }\n /**\n * Plays the loaded audio region.\n *\n * @param {number} start Start offset in seconds, relative to the beginning\n * of a clip.\n * @param {number} end When to stop, relative to the beginning of a clip.\n * @emits MediaElement#play\n * @return {Promise} Result\n */\n\n }, {\n key: \"play\",\n value: function play(start, end) {\n this.seekTo(start);\n var promise = this.media.play();\n end && this.setPlayEnd(end);\n return promise;\n }\n /**\n * Pauses the loaded audio.\n *\n * @emits MediaElement#pause\n * @return {Promise} Result\n */\n\n }, {\n key: \"pause\",\n value: function pause() {\n var promise;\n\n if (this.media) {\n promise = this.media.pause();\n }\n\n this.clearPlayEnd();\n return promise;\n }\n /**\n * Set the play end\n *\n * @param {number} end Where to end\n */\n\n }, {\n key: \"setPlayEnd\",\n value: function setPlayEnd(end) {\n var _this4 = this;\n\n this.clearPlayEnd();\n\n this._onPlayEnd = function (time) {\n if (time >= end) {\n _this4.pause();\n\n _this4.seekTo(end);\n }\n };\n\n this.on('audioprocess', this._onPlayEnd);\n }\n /** @private */\n\n }, {\n key: \"clearPlayEnd\",\n value: function clearPlayEnd() {\n if (this._onPlayEnd) {\n this.un('audioprocess', this._onPlayEnd);\n this._onPlayEnd = null;\n }\n }\n /**\n * Compute the max and min value of the waveform when broken into\n * <length> subranges.\n *\n * @param {number} length How many subranges to break the waveform into.\n * @param {number} first First sample in the required range.\n * @param {number} last Last sample in the required range.\n * @return {number[]|Number.<Array[]>} Array of 2*<length> peaks or array of\n * arrays of peaks consisting of (max, min) values for each subrange.\n */\n\n }, {\n key: \"getPeaks\",\n value: function getPeaks(length, first, last) {\n if (this.buffer) {\n return _get(_getPrototypeOf(MediaElement.prototype), \"getPeaks\", this).call(this, length, first, last);\n }\n\n return this.peaks || [];\n }\n /**\n * Set the sink id for the media player\n *\n * @param {string} deviceId String value representing audio device id.\n * @returns {Promise} A Promise that resolves to `undefined` when there\n * are no errors.\n */\n\n }, {\n key: \"setSinkId\",\n value: function setSinkId(deviceId) {\n if (deviceId) {\n if (!this.media.setSinkId) {\n return Promise.reject(new Error('setSinkId is not supported in your browser'));\n }\n\n return this.media.setSinkId(deviceId);\n }\n\n return Promise.reject(new Error('Invalid deviceId: ' + deviceId));\n }\n /**\n * Get the current volume\n *\n * @return {number} value A floating point value between 0 and 1.\n */\n\n }, {\n key: \"getVolume\",\n value: function getVolume() {\n return this.volume;\n }\n /**\n * Set the audio volume\n *\n * @param {number} value A floating point value between 0 and 1.\n */\n\n }, {\n key: \"setVolume\",\n value: function setVolume(value) {\n this.volume = value; // no need to change when it's already at that volume\n\n if (this.media.volume !== this.volume) {\n this.media.volume = this.volume;\n }\n }\n /**\n * This is called when wavesurfer is destroyed\n *\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n var _this5 = this;\n\n this.pause();\n this.unAll();\n this.destroyed = true; // cleanup media event listeners\n\n Object.keys(this.mediaListeners).forEach(function (id) {\n if (_this5.media) {\n _this5.media.removeEventListener(id, _this5.mediaListeners[id]);\n }\n });\n\n if (this.params.removeMediaElementOnDestroy && this.media && this.media.parentNode) {\n this.media.parentNode.removeChild(this.media);\n }\n\n this.media = null;\n }\n }]);\n\n return MediaElement;\n }(_webaudio.default);\n\n exports.default = MediaElement;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/peakcache.js\":\n /*!**************************!*\\\n !*** ./src/peakcache.js ***!\n \\**************************/\n\n /*! no static exports found */\n\n /***/\n function srcPeakcacheJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n /**\n * Caches the decoded peaks data to improve rendering speed for large audio\n *\n * Is used if the option parameter `partialRender` is set to `true`\n */\n\n\n var PeakCache = /*#__PURE__*/function () {\n /**\n * Instantiate cache\n */\n function PeakCache() {\n _classCallCheck(this, PeakCache);\n\n this.clearPeakCache();\n }\n /**\n * Empty the cache\n */\n\n\n _createClass(PeakCache, [{\n key: \"clearPeakCache\",\n value: function clearPeakCache() {\n /**\n * Flat array with entries that are always in pairs to mark the\n * beginning and end of each subrange. This is a convenience so we can\n * iterate over the pairs for easy set difference operations.\n * @private\n */\n this.peakCacheRanges = [];\n /**\n * Length of the entire cachable region, used for resetting the cache\n * when this changes (zoom events, for instance).\n * @private\n */\n\n this.peakCacheLength = -1;\n }\n /**\n * Add a range of peaks to the cache\n *\n * @param {number} length The length of the range\n * @param {number} start The x offset of the start of the range\n * @param {number} end The x offset of the end of the range\n * @return {Number.<Array[]>} Array with arrays of numbers\n */\n\n }, {\n key: \"addRangeToPeakCache\",\n value: function addRangeToPeakCache(length, start, end) {\n if (length != this.peakCacheLength) {\n this.clearPeakCache();\n this.peakCacheLength = length;\n } // Return ranges that weren't in the cache before the call.\n\n\n var uncachedRanges = [];\n var i = 0; // Skip ranges before the current start.\n\n while (i < this.peakCacheRanges.length && this.peakCacheRanges[i] < start) {\n i++;\n } // If |i| is even, |start| falls after an existing range. Otherwise,\n // |start| falls between an existing range, and the uncached region\n // starts when we encounter the next node in |peakCacheRanges| or\n // |end|, whichever comes first.\n\n\n if (i % 2 == 0) {\n uncachedRanges.push(start);\n }\n\n while (i < this.peakCacheRanges.length && this.peakCacheRanges[i] <= end) {\n uncachedRanges.push(this.peakCacheRanges[i]);\n i++;\n } // If |i| is even, |end| is after all existing ranges.\n\n\n if (i % 2 == 0) {\n uncachedRanges.push(end);\n } // Filter out the 0-length ranges.\n\n\n uncachedRanges = uncachedRanges.filter(function (item, pos, arr) {\n if (pos == 0) {\n return item != arr[pos + 1];\n } else if (pos == arr.length - 1) {\n return item != arr[pos - 1];\n }\n\n return item != arr[pos - 1] && item != arr[pos + 1];\n }); // Merge the two ranges together, uncachedRanges will either contain\n // wholly new points, or duplicates of points in peakCacheRanges. If\n // duplicates are detected, remove both and extend the range.\n\n this.peakCacheRanges = this.peakCacheRanges.concat(uncachedRanges);\n this.peakCacheRanges = this.peakCacheRanges.sort(function (a, b) {\n return a - b;\n }).filter(function (item, pos, arr) {\n if (pos == 0) {\n return item != arr[pos + 1];\n } else if (pos == arr.length - 1) {\n return item != arr[pos - 1];\n }\n\n return item != arr[pos - 1] && item != arr[pos + 1];\n }); // Push the uncached ranges into an array of arrays for ease of\n // iteration in the functions that call this.\n\n var uncachedRangePairs = [];\n\n for (i = 0; i < uncachedRanges.length; i += 2) {\n uncachedRangePairs.push([uncachedRanges[i], uncachedRanges[i + 1]]);\n }\n\n return uncachedRangePairs;\n }\n /**\n * For testing\n *\n * @return {Number.<Array[]>} Array with arrays of numbers\n */\n\n }, {\n key: \"getCacheRanges\",\n value: function getCacheRanges() {\n var peakCacheRangePairs = [];\n var i;\n\n for (i = 0; i < this.peakCacheRanges.length; i += 2) {\n peakCacheRangePairs.push([this.peakCacheRanges[i], this.peakCacheRanges[i + 1]]);\n }\n\n return peakCacheRangePairs;\n }\n }]);\n\n return PeakCache;\n }();\n\n exports.default = PeakCache;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/ajax.js\":\n /*!**************************!*\\\n !*** ./src/util/ajax.js ***!\n \\**************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilAjaxJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = ajax;\n\n var _observer = _interopRequireDefault(__webpack_require__(\n /*! ./observer */\n \"./src/util/observer.js\"));\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n /**\n * Perform an ajax request using `XMLHttpRequest`.\n *\n * @deprecated Use `util.fetchFile` instead.\n *\n * @param {Object} options AJAX options to use. See example below for options.\n * @returns {Observer} Observer instance\n * @example\n * // default options\n * let options = {\n * method: 'GET',\n * url: undefined,\n * responseType: 'json',\n * xhr: {}\n * };\n *\n * // override default options\n * options.url = '../media/demo.wav';\n * options.responseType = 'arraybuffer';\n * options.xhr = {\n * requestHeaders: [\n * {\n * key: 'Authorization',\n * value: 'my-token'\n * }\n * ],\n * withCredentials: true\n * };\n *\n * // make ajax call\n * let ajaxCall = util.ajax(options);\n * ajaxCall.on('progress', e => {\n * console.log('progress', e);\n * });\n * ajaxCall.on('success', (data, e) => {\n * console.log('success!', data);\n * });\n * ajaxCall.on('error', e => {\n * console.warn('ajax error: ' + e.target.statusText);\n * });\n */\n\n\n function ajax(options) {\n var instance = new _observer.default();\n var xhr = new XMLHttpRequest();\n var fired100 = false;\n xhr.open(options.method || 'GET', options.url, true);\n xhr.responseType = options.responseType || 'json';\n\n if (options.xhr) {\n if (options.xhr.requestHeaders) {\n // add custom request headers\n options.xhr.requestHeaders.forEach(function (header) {\n xhr.setRequestHeader(header.key, header.value);\n });\n }\n\n if (options.xhr.withCredentials) {\n // use credentials\n xhr.withCredentials = true;\n }\n }\n\n xhr.addEventListener('progress', function (e) {\n instance.fireEvent('progress', e);\n\n if (e.lengthComputable && e.loaded == e.total) {\n fired100 = true;\n }\n });\n xhr.addEventListener('load', function (e) {\n if (!fired100) {\n instance.fireEvent('progress', e);\n }\n\n instance.fireEvent('load', e);\n\n if (200 == xhr.status || 206 == xhr.status) {\n instance.fireEvent('success', xhr.response, e);\n } else {\n instance.fireEvent('error', e);\n }\n });\n xhr.addEventListener('error', function (e) {\n return instance.fireEvent('error', e);\n });\n xhr.send();\n instance.xhr = xhr;\n return instance;\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/extend.js\":\n /*!****************************!*\\\n !*** ./src/util/extend.js ***!\n \\****************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilExtendJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = extend;\n /**\n * Extend an object shallowly with others\n *\n * @param {Object} dest The target object\n * @param {Object[]} sources The objects to use for extending\n *\n * @return {Object} Merged object\n * @deprecated since version 3.3.0\n */\n\n function extend(dest) {\n console.warn('util.extend is deprecated; use Object.assign instead');\n\n for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n sources[_key - 1] = arguments[_key];\n }\n\n sources.forEach(function (source) {\n Object.keys(source).forEach(function (key) {\n dest[key] = source[key];\n });\n });\n return dest;\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/fetch.js\":\n /*!***************************!*\\\n !*** ./src/util/fetch.js ***!\n \\***************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilFetchJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = fetchFile;\n\n var _observer = _interopRequireDefault(__webpack_require__(\n /*! ./observer */\n \"./src/util/observer.js\"));\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n var ProgressHandler = /*#__PURE__*/function () {\n /**\n * Instantiate ProgressHandler\n *\n * @param {Observer} instance The `fetchFile` observer instance.\n * @param {Number} contentLength Content length.\n * @param {Response} response Response object.\n */\n function ProgressHandler(instance, contentLength, response) {\n _classCallCheck(this, ProgressHandler);\n\n this.instance = instance;\n this.instance._reader = response.body.getReader();\n this.total = parseInt(contentLength, 10);\n this.loaded = 0;\n }\n /**\n * A method that is called once, immediately after the `ReadableStream``\n * is constructed.\n *\n * @param {ReadableStreamDefaultController} controller Controller instance\n * used to control the stream.\n */\n\n\n _createClass(ProgressHandler, [{\n key: \"start\",\n value: function start(controller) {\n var _this = this;\n\n var read = function read() {\n // instance._reader.read() returns a promise that resolves\n // when a value has been received\n _this.instance._reader.read().then(function (_ref) {\n var done = _ref.done,\n value = _ref.value; // result objects contain two properties:\n // done - true if the stream has already given you all its data.\n // value - some data. Always undefined when done is true.\n\n if (done) {\n // ensure onProgress called when content-length=0\n if (_this.total === 0) {\n _this.instance.onProgress.call(_this.instance, {\n loaded: _this.loaded,\n total: _this.total,\n lengthComputable: false\n });\n } // no more data needs to be consumed, close the stream\n\n\n controller.close();\n return;\n }\n\n _this.loaded += value.byteLength;\n\n _this.instance.onProgress.call(_this.instance, {\n loaded: _this.loaded,\n total: _this.total,\n lengthComputable: !(_this.total === 0)\n }); // enqueue the next data chunk into our target stream\n\n\n controller.enqueue(value);\n read();\n }).catch(function (error) {\n controller.error(error);\n });\n };\n\n read();\n }\n }]);\n\n return ProgressHandler;\n }();\n /**\n * Load a file using `fetch`.\n *\n * @param {object} options Request options to use. See example below.\n * @returns {Observer} Observer instance\n * @example\n * // default options\n * let options = {\n * url: undefined,\n * method: 'GET',\n * mode: 'cors',\n * credentials: 'same-origin',\n * cache: 'default',\n * responseType: 'json',\n * requestHeaders: [],\n * redirect: 'follow',\n * referrer: 'client'\n * };\n *\n * // override some options\n * options.url = '../media/demo.wav';\n \n * // available types: 'arraybuffer', 'blob', 'json' or 'text'\n * options.responseType = 'arraybuffer';\n *\n * // make fetch call\n * let request = util.fetchFile(options);\n *\n * // listen for events\n * request.on('progress', e => {\n * console.log('progress', e);\n * });\n *\n * request.on('success', data => {\n * console.log('success!', data);\n * });\n *\n * request.on('error', e => {\n * console.warn('fetchFile error: ', e);\n * });\n */\n\n\n function fetchFile(options) {\n if (!options) {\n throw new Error('fetch options missing');\n } else if (!options.url) {\n throw new Error('fetch url missing');\n }\n\n var instance = new _observer.default();\n var fetchHeaders = new Headers();\n var fetchRequest = new Request(options.url); // add ability to abort\n\n instance.controller = new AbortController(); // check if headers have to be added\n\n if (options && options.requestHeaders) {\n // add custom request headers\n options.requestHeaders.forEach(function (header) {\n fetchHeaders.append(header.key, header.value);\n });\n } // parse fetch options\n\n\n var responseType = options.responseType || 'json';\n var fetchOptions = {\n method: options.method || 'GET',\n headers: fetchHeaders,\n mode: options.mode || 'cors',\n credentials: options.credentials || 'same-origin',\n cache: options.cache || 'default',\n redirect: options.redirect || 'follow',\n referrer: options.referrer || 'client',\n signal: instance.controller.signal\n };\n fetch(fetchRequest, fetchOptions).then(function (response) {\n // store response reference\n instance.response = response;\n var progressAvailable = true;\n\n if (!response.body) {\n // ReadableStream is not yet supported in this browser\n // see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream\n progressAvailable = false;\n } // Server must send CORS header \"Access-Control-Expose-Headers: content-length\"\n\n\n var contentLength = response.headers.get('content-length');\n\n if (contentLength === null) {\n // Content-Length server response header missing.\n // Don't evaluate download progress if we can't compare against a total size\n // see https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Access-Control-Expose-Headers\n progressAvailable = false;\n }\n\n if (!progressAvailable) {\n // not able to check download progress so skip it\n return response;\n } // fire progress event when during load\n\n\n instance.onProgress = function (e) {\n instance.fireEvent('progress', e);\n };\n\n return new Response(new ReadableStream(new ProgressHandler(instance, contentLength, response)), fetchOptions);\n }).then(function (response) {\n var errMsg;\n\n if (response.ok) {\n switch (responseType) {\n case 'arraybuffer':\n return response.arrayBuffer();\n\n case 'json':\n return response.json();\n\n case 'blob':\n return response.blob();\n\n case 'text':\n return response.text();\n\n default:\n errMsg = 'Unknown responseType: ' + responseType;\n break;\n }\n }\n\n if (!errMsg) {\n errMsg = 'HTTP error status: ' + response.status;\n }\n\n throw new Error(errMsg);\n }).then(function (response) {\n instance.fireEvent('success', response);\n }).catch(function (error) {\n instance.fireEvent('error', error);\n }); // return the fetch request\n\n instance.fetchRequest = fetchRequest;\n return instance;\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/frame.js\":\n /*!***************************!*\\\n !*** ./src/util/frame.js ***!\n \\***************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilFrameJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = frame;\n\n var _requestAnimationFrame = _interopRequireDefault(__webpack_require__(\n /*! ./request-animation-frame */\n \"./src/util/request-animation-frame.js\"));\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n /**\n * Create a function which will be called at the next requestAnimationFrame\n * cycle\n *\n * @param {function} func The function to call\n *\n * @return {func} The function wrapped within a requestAnimationFrame\n */\n\n\n function frame(func) {\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return (0, _requestAnimationFrame.default)(function () {\n return func.apply(void 0, args);\n });\n };\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/get-id.js\":\n /*!****************************!*\\\n !*** ./src/util/get-id.js ***!\n \\****************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilGetIdJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = getId;\n /**\n * Get a random prefixed ID\n *\n * @param {String} prefix Prefix to use. Default is `'wavesurfer_'`.\n * @returns {String} Random prefixed ID\n * @example\n * console.log(getId()); // logs 'wavesurfer_b5pors4ru6g'\n *\n * let prefix = 'foo-';\n * console.log(getId(prefix)); // logs 'foo-b5pors4ru6g'\n */\n\n function getId(prefix) {\n if (prefix === undefined) {\n prefix = 'wavesurfer_';\n }\n\n return prefix + Math.random().toString(32).substring(2);\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/index.js\":\n /*!***************************!*\\\n !*** ./src/util/index.js ***!\n \\***************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilIndexJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n Object.defineProperty(exports, \"ajax\", {\n enumerable: true,\n get: function get() {\n return _ajax.default;\n }\n });\n Object.defineProperty(exports, \"getId\", {\n enumerable: true,\n get: function get() {\n return _getId.default;\n }\n });\n Object.defineProperty(exports, \"max\", {\n enumerable: true,\n get: function get() {\n return _max.default;\n }\n });\n Object.defineProperty(exports, \"min\", {\n enumerable: true,\n get: function get() {\n return _min.default;\n }\n });\n Object.defineProperty(exports, \"Observer\", {\n enumerable: true,\n get: function get() {\n return _observer.default;\n }\n });\n Object.defineProperty(exports, \"extend\", {\n enumerable: true,\n get: function get() {\n return _extend.default;\n }\n });\n Object.defineProperty(exports, \"style\", {\n enumerable: true,\n get: function get() {\n return _style.default;\n }\n });\n Object.defineProperty(exports, \"requestAnimationFrame\", {\n enumerable: true,\n get: function get() {\n return _requestAnimationFrame.default;\n }\n });\n Object.defineProperty(exports, \"frame\", {\n enumerable: true,\n get: function get() {\n return _frame.default;\n }\n });\n Object.defineProperty(exports, \"debounce\", {\n enumerable: true,\n get: function get() {\n return _debounce.default;\n }\n });\n Object.defineProperty(exports, \"preventClick\", {\n enumerable: true,\n get: function get() {\n return _preventClick.default;\n }\n });\n Object.defineProperty(exports, \"fetchFile\", {\n enumerable: true,\n get: function get() {\n return _fetch.default;\n }\n });\n\n var _ajax = _interopRequireDefault(__webpack_require__(\n /*! ./ajax */\n \"./src/util/ajax.js\"));\n\n var _getId = _interopRequireDefault(__webpack_require__(\n /*! ./get-id */\n \"./src/util/get-id.js\"));\n\n var _max = _interopRequireDefault(__webpack_require__(\n /*! ./max */\n \"./src/util/max.js\"));\n\n var _min = _interopRequireDefault(__webpack_require__(\n /*! ./min */\n \"./src/util/min.js\"));\n\n var _observer = _interopRequireDefault(__webpack_require__(\n /*! ./observer */\n \"./src/util/observer.js\"));\n\n var _extend = _interopRequireDefault(__webpack_require__(\n /*! ./extend */\n \"./src/util/extend.js\"));\n\n var _style = _interopRequireDefault(__webpack_require__(\n /*! ./style */\n \"./src/util/style.js\"));\n\n var _requestAnimationFrame = _interopRequireDefault(__webpack_require__(\n /*! ./request-animation-frame */\n \"./src/util/request-animation-frame.js\"));\n\n var _frame = _interopRequireDefault(__webpack_require__(\n /*! ./frame */\n \"./src/util/frame.js\"));\n\n var _debounce = _interopRequireDefault(__webpack_require__(\n /*! debounce */\n \"./node_modules/debounce/index.js\"));\n\n var _preventClick = _interopRequireDefault(__webpack_require__(\n /*! ./prevent-click */\n \"./src/util/prevent-click.js\"));\n\n var _fetch = _interopRequireDefault(__webpack_require__(\n /*! ./fetch */\n \"./src/util/fetch.js\"));\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n /***/\n\n },\n\n /***/\n \"./src/util/max.js\":\n /*!*************************!*\\\n !*** ./src/util/max.js ***!\n \\*************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilMaxJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = max;\n /**\n * Get the largest value\n *\n * @param {Array} values Array of numbers\n * @returns {Number} Largest number found\n * @example console.log(max([1, 2, 3])); // logs 3\n */\n\n function max(values) {\n var largest = -Infinity;\n Object.keys(values).forEach(function (i) {\n if (values[i] > largest) {\n largest = values[i];\n }\n });\n return largest;\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/min.js\":\n /*!*************************!*\\\n !*** ./src/util/min.js ***!\n \\*************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilMinJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = min;\n /**\n * Get the smallest value\n *\n * @param {Array} values Array of numbers\n * @returns {Number} Smallest number found\n * @example console.log(min([1, 2, 3])); // logs 1\n */\n\n function min(values) {\n var smallest = Number(Infinity);\n Object.keys(values).forEach(function (i) {\n if (values[i] < smallest) {\n smallest = values[i];\n }\n });\n return smallest;\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/observer.js\":\n /*!******************************!*\\\n !*** ./src/util/observer.js ***!\n \\******************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilObserverJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n /**\n * @typedef {Object} ListenerDescriptor\n * @property {string} name The name of the event\n * @property {function} callback The callback\n * @property {function} un The function to call to remove the listener\n */\n\n /**\n * Observer class\n */\n\n\n var Observer = /*#__PURE__*/function () {\n /**\n * Instantiate Observer\n */\n function Observer() {\n _classCallCheck(this, Observer);\n /**\n * @private\n * @todo Initialise the handlers here already and remove the conditional\n * assignment in `on()`\n */\n\n\n this.handlers = null;\n }\n /**\n * Attach a handler function for an event.\n *\n * @param {string} event Name of the event to listen to\n * @param {function} fn The callback to trigger when the event is fired\n * @return {ListenerDescriptor} The event descriptor\n */\n\n\n _createClass(Observer, [{\n key: \"on\",\n value: function on(event, fn) {\n var _this = this;\n\n if (!this.handlers) {\n this.handlers = {};\n }\n\n var handlers = this.handlers[event];\n\n if (!handlers) {\n handlers = this.handlers[event] = [];\n }\n\n handlers.push(fn); // Return an event descriptor\n\n return {\n name: event,\n callback: fn,\n un: function un(e, fn) {\n return _this.un(e, fn);\n }\n };\n }\n /**\n * Remove an event handler.\n *\n * @param {string} event Name of the event the listener that should be\n * removed listens to\n * @param {function} fn The callback that should be removed\n */\n\n }, {\n key: \"un\",\n value: function un(event, fn) {\n if (!this.handlers) {\n return;\n }\n\n var handlers = this.handlers[event];\n var i;\n\n if (handlers) {\n if (fn) {\n for (i = handlers.length - 1; i >= 0; i--) {\n if (handlers[i] == fn) {\n handlers.splice(i, 1);\n }\n }\n } else {\n handlers.length = 0;\n }\n }\n }\n /**\n * Remove all event handlers.\n */\n\n }, {\n key: \"unAll\",\n value: function unAll() {\n this.handlers = null;\n }\n /**\n * Attach a handler to an event. The handler is executed at most once per\n * event type.\n *\n * @param {string} event The event to listen to\n * @param {function} handler The callback that is only to be called once\n * @return {ListenerDescriptor} The event descriptor\n */\n\n }, {\n key: \"once\",\n value: function once(event, handler) {\n var _this2 = this;\n\n var fn = function fn() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n /* eslint-disable no-invalid-this */\n\n\n handler.apply(_this2, args);\n /* eslint-enable no-invalid-this */\n\n setTimeout(function () {\n _this2.un(event, fn);\n }, 0);\n };\n\n return this.on(event, fn);\n }\n /**\n * Manually fire an event\n *\n * @param {string} event The event to fire manually\n * @param {...any} args The arguments with which to call the listeners\n */\n\n }, {\n key: \"fireEvent\",\n value: function fireEvent(event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n if (!this.handlers) {\n return;\n }\n\n var handlers = this.handlers[event];\n handlers && handlers.forEach(function (fn) {\n fn.apply(void 0, args);\n });\n }\n }]);\n\n return Observer;\n }();\n\n exports.default = Observer;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/prevent-click.js\":\n /*!***********************************!*\\\n !*** ./src/util/prevent-click.js ***!\n \\***********************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilPreventClickJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = preventClick;\n /**\n * Stops propagation of click event and removes event listener\n *\n * @private\n * @param {object} event The click event\n */\n\n function preventClickHandler(event) {\n event.stopPropagation();\n document.body.removeEventListener('click', preventClickHandler, true);\n }\n /**\n * Starts listening for click event and prevent propagation\n *\n * @param {object} values Values\n */\n\n\n function preventClick(values) {\n document.body.addEventListener('click', preventClickHandler, true);\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/request-animation-frame.js\":\n /*!*********************************************!*\\\n !*** ./src/util/request-animation-frame.js ***!\n \\*********************************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilRequestAnimationFrameJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n /* eslint-disable valid-jsdoc */\n\n /**\n * Returns the `requestAnimationFrame` function for the browser, or a shim with\n * `setTimeout` if the function is not found\n *\n * @return {function} Available `requestAnimationFrame` function for the browser\n */\n\n var _default = (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (callback, element) {\n return setTimeout(callback, 1000 / 60);\n }).bind(window);\n\n exports.default = _default;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/util/style.js\":\n /*!***************************!*\\\n !*** ./src/util/style.js ***!\n \\***************************/\n\n /*! no static exports found */\n\n /***/\n function srcUtilStyleJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = style;\n /**\n * Apply a map of styles to an element\n *\n * @param {HTMLElement} el The element that the styles will be applied to\n * @param {Object} styles The map of propName: attribute, both are used as-is\n *\n * @return {HTMLElement} el\n */\n\n function style(el, styles) {\n Object.keys(styles).forEach(function (prop) {\n if (el.style[prop] !== styles[prop]) {\n el.style[prop] = styles[prop];\n }\n });\n return el;\n }\n\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/wavesurfer.js\":\n /*!***************************!*\\\n !*** ./src/wavesurfer.js ***!\n \\***************************/\n\n /*! no static exports found */\n\n /***/\n function srcWavesurferJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n var util = _interopRequireWildcard(__webpack_require__(\n /*! ./util */\n \"./src/util/index.js\"));\n\n var _drawer = _interopRequireDefault(__webpack_require__(\n /*! ./drawer.multicanvas */\n \"./src/drawer.multicanvas.js\"));\n\n var _webaudio = _interopRequireDefault(__webpack_require__(\n /*! ./webaudio */\n \"./src/webaudio.js\"));\n\n var _mediaelement = _interopRequireDefault(__webpack_require__(\n /*! ./mediaelement */\n \"./src/mediaelement.js\"));\n\n var _peakcache = _interopRequireDefault(__webpack_require__(\n /*! ./peakcache */\n \"./src/peakcache.js\"));\n\n var _mediaelementWebaudio = _interopRequireDefault(__webpack_require__(\n /*! ./mediaelement-webaudio */\n \"./src/mediaelement-webaudio.js\"));\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n }\n\n function _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n }\n\n function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj.default = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n }\n\n function _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 function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n /*\n * This work is licensed under a BSD-3-Clause License.\n */\n\n /** @external {HTMLElement} https://developer.mozilla.org/en/docs/Web/API/HTMLElement */\n\n /** @external {OfflineAudioContext} https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext */\n\n /** @external {File} https://developer.mozilla.org/en-US/docs/Web/API/File */\n\n /** @external {Blob} https://developer.mozilla.org/en-US/docs/Web/API/Blob */\n\n /** @external {CanvasRenderingContext2D} https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D */\n\n /** @external {MediaStreamConstraints} https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints */\n\n /** @external {AudioNode} https://developer.mozilla.org/de/docs/Web/API/AudioNode */\n\n /**\n * @typedef {Object} WavesurferParams\n * @property {AudioContext} audioContext=null Use your own previously\n * initialized AudioContext or leave blank.\n * @property {number} audioRate=1 Speed at which to play audio. Lower number is\n * slower.\n * @property {ScriptProcessorNode} audioScriptProcessor=null Use your own previously\n * initialized ScriptProcessorNode or leave blank.\n * @property {boolean} autoCenter=true If a scrollbar is present, center the\n * waveform on current progress\n * @property {number} autoCenterRate=5 If autoCenter is active, rate at which the\n * waveform is centered\n * @property {boolean} autoCenterImmediately=false If autoCenter is active, immediately\n * center waveform on current progress\n * @property {string} backend='WebAudio' `'WebAudio'|'MediaElement'|'MediaElementWebAudio'` In most cases\n * you don't have to set this manually. MediaElement is a fallback for unsupported browsers.\n * MediaElementWebAudio allows to use WebAudio API also with big audio files, loading audio like with\n * MediaElement backend (HTML5 audio tag). You have to use the same methods of MediaElement backend for loading and\n * playback, giving also peaks, so the audio data are not decoded. In this way you can use WebAudio features, like filters,\n * also with audio with big duration. For example:\n * ` wavesurfer.load(url | HTMLMediaElement, peaks, preload, duration);\n * wavesurfer.play();\n * wavesurfer.setFilter(customFilter);\n * `\n * @property {string} backgroundColor=null Change background color of the\n * waveform container.\n * @property {number} barHeight=1 The height of the wave bars.\n * @property {number} barRadius=0 The radius of the wave bars. Makes bars rounded\n * @property {number} barGap=null The optional spacing between bars of the wave,\n * if not provided will be calculated in legacy format.\n * @property {number} barWidth=null Draw the waveform using bars.\n * @property {number} barMinHeight=null If specified, draw at least a bar of this height,\n * eliminating waveform gaps\n * @property {boolean} closeAudioContext=false Close and nullify all audio\n * contexts when the destroy method is called.\n * @property {!string|HTMLElement} container CSS selector or HTML element where\n * the waveform should be drawn. This is the only required parameter.\n * @property {string} cursorColor='#333' The fill color of the cursor indicating\n * the playhead position.\n * @property {number} cursorWidth=1 Measured in pixels.\n * @property {object} drawingContextAttributes={desynchronized: true} Drawing context\n * attributes.\n * @property {number} duration=null Optional audio length so pre-rendered peaks\n * can be display immediately for example.\n * @property {boolean} fillParent=true Whether to fill the entire container or\n * draw only according to `minPxPerSec`.\n * @property {boolean} forceDecode=false Force decoding of audio using web audio\n * when zooming to get a more detailed waveform.\n * @property {number} height=128 The height of the waveform. Measured in\n * pixels.\n * @property {boolean} hideScrollbar=false Whether to hide the horizontal\n * scrollbar when one would normally be shown.\n * @property {boolean} interact=true Whether the mouse interaction will be\n * enabled at initialization. You can switch this parameter at any time later\n * on.\n * @property {boolean} loopSelection=true (Use with regions plugin) Enable\n * looping of selected regions\n * @property {number} maxCanvasWidth=4000 Maximum width of a single canvas in\n * pixels, excluding a small overlap (2 * `pixelRatio`, rounded up to the next\n * even integer). If the waveform is longer than this value, additional canvases\n * will be used to render the waveform, which is useful for very large waveforms\n * that may be too wide for browsers to draw on a single canvas.\n * @property {boolean} mediaControls=false (Use with backend `MediaElement` or `MediaElementWebAudio`)\n * this enables the native controls for the media element\n * @property {string} mediaType='audio' (Use with backend `MediaElement` or `MediaElementWebAudio`)\n * `'audio'|'video'` ('video' only for `MediaElement`)\n * @property {number} minPxPerSec=20 Minimum number of pixels per second of\n * audio.\n * @property {boolean} normalize=false If true, normalize by the maximum peak\n * instead of 1.0.\n * @property {boolean} partialRender=false Use the PeakCache to improve\n * rendering speed of large waveforms\n * @property {number} pixelRatio=window.devicePixelRatio The pixel ratio used to\n * calculate display\n * @property {PluginDefinition[]} plugins=[] An array of plugin definitions to\n * register during instantiation, they will be directly initialised unless they\n * are added with the `deferInit` property set to true.\n * @property {string} progressColor='#555' The fill color of the part of the\n * waveform behind the cursor. When `progressColor` and `waveColor` are the same\n * the progress wave is not rendered at all.\n * @property {boolean} removeMediaElementOnDestroy=true Set to false to keep the\n * media element in the DOM when the player is destroyed. This is useful when\n * reusing an existing media element via the `loadMediaElement` method.\n * @property {Object} renderer=MultiCanvas Can be used to inject a custom\n * renderer.\n * @property {boolean|number} responsive=false If set to `true` resize the\n * waveform, when the window is resized. This is debounced with a `100ms`\n * timeout by default. If this parameter is a number it represents that timeout.\n * @property {boolean} rtl=false If set to `true`, renders waveform from\n * right-to-left.\n * @property {boolean} scrollParent=false Whether to scroll the container with a\n * lengthy waveform. Otherwise the waveform is shrunk to the container width\n * (see fillParent).\n * @property {number} skipLength=2 Number of seconds to skip with the\n * skipForward() and skipBackward() methods.\n * @property {boolean} splitChannels=false Render with separate waveforms for\n * the channels of the audio\n * @property {string} waveColor='#999' The fill color of the waveform after the\n * cursor.\n * @property {object} xhr={} XHR options. For example:\n * `let xhr = {\n * cache: 'default',\n * mode: 'cors',\n * method: 'GET',\n * credentials: 'same-origin',\n * redirect: 'follow',\n * referrer: 'client',\n * headers: [\n * {\n * key: 'Authorization',\n * value: 'my-token'\n * }\n * ]\n * };`\n */\n\n /**\n * @typedef {Object} PluginDefinition\n * @desc The Object used to describe a plugin\n * @example wavesurfer.addPlugin(pluginDefinition);\n * @property {string} name The name of the plugin, the plugin instance will be\n * added as a property to the wavesurfer instance under this name\n * @property {?Object} staticProps The properties that should be added to the\n * wavesurfer instance as static properties\n * @property {?boolean} deferInit Don't initialise plugin\n * automatically\n * @property {Object} params={} The plugin parameters, they are the first parameter\n * passed to the plugin class constructor function\n * @property {PluginClass} instance The plugin instance factory, is called with\n * the dependency specified in extends. Returns the plugin class.\n */\n\n /**\n * @interface PluginClass\n *\n * @desc This is the interface which is implemented by all plugin classes. Note\n * that this only turns into an observer after being passed through\n * `wavesurfer.addPlugin`.\n *\n * @extends {Observer}\n */\n\n\n var PluginClass = /*#__PURE__*/function () {\n _createClass(PluginClass, [{\n key: \"create\",\n\n /**\n * Plugin definition factory\n *\n * This function must be used to create a plugin definition which can be\n * used by wavesurfer to correctly instantiate the plugin.\n *\n * It returns a `PluginDefinition` object representing the plugin.\n *\n * @param {Object} params={} The plugin params (specific to the plugin)\n */\n value: function create(params) {}\n /**\n * Construct the plugin\n *\n * @param {Object} params={} The plugin params (specific to the plugin)\n * @param {Object} ws The wavesurfer instance\n */\n\n }]);\n\n function PluginClass(params, ws) {\n _classCallCheck(this, PluginClass);\n }\n /**\n * Initialise the plugin\n *\n * Start doing something. This is called by\n * `wavesurfer.initPlugin(pluginName)`\n */\n\n\n _createClass(PluginClass, [{\n key: \"init\",\n value: function init() {}\n /**\n * Destroy the plugin instance\n *\n * Stop doing something. This is called by\n * `wavesurfer.destroyPlugin(pluginName)`\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {}\n }]);\n\n return PluginClass;\n }();\n /**\n * WaveSurfer core library class\n *\n * @extends {Observer}\n * @example\n * const params = {\n * container: '#waveform',\n * waveColor: 'violet',\n * progressColor: 'purple'\n * };\n *\n * // initialise like this\n * const wavesurfer = WaveSurfer.create(params);\n *\n * // or like this ...\n * const wavesurfer = new WaveSurfer(params);\n * wavesurfer.init();\n *\n * // load audio file\n * wavesurfer.load('example/media/demo.wav');\n */\n\n\n var WaveSurfer = /*#__PURE__*/function (_util$Observer) {\n _inherits(WaveSurfer, _util$Observer);\n\n _createClass(WaveSurfer, null, [{\n key: \"create\",\n\n /** @private */\n\n /** @private */\n\n /**\n * Instantiate this class, call its `init` function and returns it\n *\n * @param {WavesurferParams} params The wavesurfer parameters\n * @return {Object} WaveSurfer instance\n * @example const wavesurfer = WaveSurfer.create(params);\n */\n value: function create(params) {\n var wavesurfer = new WaveSurfer(params);\n return wavesurfer.init();\n }\n /**\n * The library version number is available as a static property of the\n * WaveSurfer class\n *\n * @type {String}\n * @example\n * console.log('Using wavesurfer.js ' + WaveSurfer.VERSION);\n */\n\n }]);\n /**\n * Initialise wavesurfer instance\n *\n * @param {WavesurferParams} params Instantiation options for wavesurfer\n * @example\n * const wavesurfer = new WaveSurfer(params);\n * @returns {this} Wavesurfer instance\n */\n\n\n function WaveSurfer(params) {\n var _this;\n\n _classCallCheck(this, WaveSurfer);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(WaveSurfer).call(this));\n /**\n * Extract relevant parameters (or defaults)\n * @private\n */\n\n _this.defaultParams = {\n audioContext: null,\n audioScriptProcessor: null,\n audioRate: 1,\n autoCenter: true,\n autoCenterRate: 5,\n autoCenterImmediately: false,\n backend: 'WebAudio',\n backgroundColor: null,\n barHeight: 1,\n barRadius: 0,\n barGap: null,\n barMinHeight: null,\n container: null,\n cursorColor: '#333',\n cursorWidth: 1,\n dragSelection: true,\n drawingContextAttributes: {\n // Boolean that hints the user agent to reduce the latency\n // by desynchronizing the canvas paint cycle from the event\n // loop\n desynchronized: true\n },\n duration: null,\n fillParent: true,\n forceDecode: false,\n height: 128,\n hideScrollbar: false,\n interact: true,\n loopSelection: true,\n maxCanvasWidth: 4000,\n mediaContainer: null,\n mediaControls: false,\n mediaType: 'audio',\n minPxPerSec: 20,\n normalize: false,\n partialRender: false,\n pixelRatio: window.devicePixelRatio || screen.deviceXDPI / screen.logicalXDPI,\n plugins: [],\n progressColor: '#555',\n removeMediaElementOnDestroy: true,\n renderer: _drawer.default,\n responsive: false,\n rtl: false,\n scrollParent: false,\n skipLength: 2,\n splitChannels: false,\n waveColor: '#999',\n xhr: {}\n };\n _this.backends = {\n MediaElement: _mediaelement.default,\n WebAudio: _webaudio.default,\n MediaElementWebAudio: _mediaelementWebaudio.default\n };\n _this.util = util;\n _this.params = Object.assign({}, _this.defaultParams, params);\n /** @private */\n\n _this.container = 'string' == typeof params.container ? document.querySelector(_this.params.container) : _this.params.container;\n\n if (!_this.container) {\n throw new Error('Container element not found');\n }\n\n if (_this.params.mediaContainer == null) {\n /** @private */\n _this.mediaContainer = _this.container;\n } else if (typeof _this.params.mediaContainer == 'string') {\n /** @private */\n _this.mediaContainer = document.querySelector(_this.params.mediaContainer);\n } else {\n /** @private */\n _this.mediaContainer = _this.params.mediaContainer;\n }\n\n if (!_this.mediaContainer) {\n throw new Error('Media Container element not found');\n }\n\n if (_this.params.maxCanvasWidth <= 1) {\n throw new Error('maxCanvasWidth must be greater than 1');\n } else if (_this.params.maxCanvasWidth % 2 == 1) {\n throw new Error('maxCanvasWidth must be an even number');\n }\n\n if (_this.params.rtl === true) {\n util.style(_this.container, {\n transform: 'rotateY(180deg)'\n });\n }\n\n if (_this.params.backgroundColor) {\n _this.setBackgroundColor(_this.params.backgroundColor);\n }\n /**\n * @private Used to save the current volume when muting so we can\n * restore once unmuted\n * @type {number}\n */\n\n\n _this.savedVolume = 0;\n /**\n * @private The current muted state\n * @type {boolean}\n */\n\n _this.isMuted = false;\n /**\n * @private Will hold a list of event descriptors that need to be\n * canceled on subsequent loads of audio\n * @type {Object[]}\n */\n\n _this.tmpEvents = [];\n /**\n * @private Holds any running audio downloads\n * @type {Observer}\n */\n\n _this.currentRequest = null;\n /** @private */\n\n _this.arraybuffer = null;\n /** @private */\n\n _this.drawer = null;\n /** @private */\n\n _this.backend = null;\n /** @private */\n\n _this.peakCache = null; // cache constructor objects\n\n if (typeof _this.params.renderer !== 'function') {\n throw new Error('Renderer parameter is invalid');\n }\n /**\n * @private The uninitialised Drawer class\n */\n\n\n _this.Drawer = _this.params.renderer;\n /**\n * @private The uninitialised Backend class\n */\n // Back compat\n\n if (_this.params.backend == 'AudioElement') {\n _this.params.backend = 'MediaElement';\n }\n\n if ((_this.params.backend == 'WebAudio' || _this.params.backend === 'MediaElementWebAudio') && !_webaudio.default.prototype.supportsWebAudio.call(null)) {\n _this.params.backend = 'MediaElement';\n }\n\n _this.Backend = _this.backends[_this.params.backend];\n /**\n * @private map of plugin names that are currently initialised\n */\n\n _this.initialisedPluginList = {};\n /** @private */\n\n _this.isDestroyed = false;\n /**\n * Get the current ready status.\n *\n * @example const isReady = wavesurfer.isReady;\n * @return {boolean}\n */\n\n _this.isReady = false; // responsive debounced event listener. If this.params.responsive is not\n // set, this is never called. Use 100ms or this.params.responsive as\n // timeout for the debounce function.\n\n var prevWidth = 0;\n _this._onResize = util.debounce(function () {\n if (prevWidth != _this.drawer.wrapper.clientWidth && !_this.params.scrollParent) {\n prevWidth = _this.drawer.wrapper.clientWidth;\n\n _this.drawer.fireEvent('redraw');\n }\n }, typeof _this.params.responsive === 'number' ? _this.params.responsive : 100);\n return _possibleConstructorReturn(_this, _assertThisInitialized(_this));\n }\n /**\n * Initialise the wave\n *\n * @example\n * var wavesurfer = new WaveSurfer(params);\n * wavesurfer.init();\n * @return {this} The wavesurfer instance\n */\n\n\n _createClass(WaveSurfer, [{\n key: \"init\",\n value: function init() {\n this.registerPlugins(this.params.plugins);\n this.createDrawer();\n this.createBackend();\n this.createPeakCache();\n return this;\n }\n /**\n * Add and initialise array of plugins (if `plugin.deferInit` is falsey),\n * this function is called in the init function of wavesurfer\n *\n * @param {PluginDefinition[]} plugins An array of plugin definitions\n * @emits {WaveSurfer#plugins-registered} Called with the array of plugin definitions\n * @return {this} The wavesurfer instance\n */\n\n }, {\n key: \"registerPlugins\",\n value: function registerPlugins(plugins) {\n var _this2 = this; // first instantiate all the plugins\n\n\n plugins.forEach(function (plugin) {\n return _this2.addPlugin(plugin);\n }); // now run the init functions\n\n plugins.forEach(function (plugin) {\n // call init function of the plugin if deferInit is falsey\n // in that case you would manually use initPlugins()\n if (!plugin.deferInit) {\n _this2.initPlugin(plugin.name);\n }\n });\n this.fireEvent('plugins-registered', plugins);\n return this;\n }\n /**\n * Get a map of plugin names that are currently initialised\n *\n * @example wavesurfer.getPlugins();\n * @return {Object} Object with plugin names\n */\n\n }, {\n key: \"getActivePlugins\",\n value: function getActivePlugins() {\n return this.initialisedPluginList;\n }\n /**\n * Add a plugin object to wavesurfer\n *\n * @param {PluginDefinition} plugin A plugin definition\n * @emits {WaveSurfer#plugin-added} Called with the name of the plugin that was added\n * @example wavesurfer.addPlugin(WaveSurfer.minimap());\n * @return {this} The wavesurfer instance\n */\n\n }, {\n key: \"addPlugin\",\n value: function addPlugin(plugin) {\n var _this3 = this;\n\n if (!plugin.name) {\n throw new Error('Plugin does not have a name!');\n }\n\n if (!plugin.instance) {\n throw new Error(\"Plugin \".concat(plugin.name, \" does not have an instance property!\"));\n } // staticProps properties are applied to wavesurfer instance\n\n\n if (plugin.staticProps) {\n Object.keys(plugin.staticProps).forEach(function (pluginStaticProp) {\n /**\n * Properties defined in a plugin definition's `staticProps` property are added as\n * staticProps properties of the WaveSurfer instance\n */\n _this3[pluginStaticProp] = plugin.staticProps[pluginStaticProp];\n });\n }\n\n var Instance = plugin.instance; // turn the plugin instance into an observer\n\n var observerPrototypeKeys = Object.getOwnPropertyNames(util.Observer.prototype);\n observerPrototypeKeys.forEach(function (key) {\n Instance.prototype[key] = util.Observer.prototype[key];\n });\n /**\n * Instantiated plugin classes are added as a property of the wavesurfer\n * instance\n * @type {Object}\n */\n\n this[plugin.name] = new Instance(plugin.params || {}, this);\n this.fireEvent('plugin-added', plugin.name);\n return this;\n }\n /**\n * Initialise a plugin\n *\n * @param {string} name A plugin name\n * @emits WaveSurfer#plugin-initialised\n * @example wavesurfer.initPlugin('minimap');\n * @return {this} The wavesurfer instance\n */\n\n }, {\n key: \"initPlugin\",\n value: function initPlugin(name) {\n if (!this[name]) {\n throw new Error(\"Plugin \".concat(name, \" has not been added yet!\"));\n }\n\n if (this.initialisedPluginList[name]) {\n // destroy any already initialised plugins\n this.destroyPlugin(name);\n }\n\n this[name].init();\n this.initialisedPluginList[name] = true;\n this.fireEvent('plugin-initialised', name);\n return this;\n }\n /**\n * Destroy a plugin\n *\n * @param {string} name A plugin name\n * @emits WaveSurfer#plugin-destroyed\n * @example wavesurfer.destroyPlugin('minimap');\n * @returns {this} The wavesurfer instance\n */\n\n }, {\n key: \"destroyPlugin\",\n value: function destroyPlugin(name) {\n if (!this[name]) {\n throw new Error(\"Plugin \".concat(name, \" has not been added yet and cannot be destroyed!\"));\n }\n\n if (!this.initialisedPluginList[name]) {\n throw new Error(\"Plugin \".concat(name, \" is not active and cannot be destroyed!\"));\n }\n\n if (typeof this[name].destroy !== 'function') {\n throw new Error(\"Plugin \".concat(name, \" does not have a destroy function!\"));\n }\n\n this[name].destroy();\n delete this.initialisedPluginList[name];\n this.fireEvent('plugin-destroyed', name);\n return this;\n }\n /**\n * Destroy all initialised plugins. Convenience function to use when\n * wavesurfer is removed\n *\n * @private\n */\n\n }, {\n key: \"destroyAllPlugins\",\n value: function destroyAllPlugins() {\n var _this4 = this;\n\n Object.keys(this.initialisedPluginList).forEach(function (name) {\n return _this4.destroyPlugin(name);\n });\n }\n /**\n * Create the drawer and draw the waveform\n *\n * @private\n * @emits WaveSurfer#drawer-created\n */\n\n }, {\n key: \"createDrawer\",\n value: function createDrawer() {\n var _this5 = this;\n\n this.drawer = new this.Drawer(this.container, this.params);\n this.drawer.init();\n this.fireEvent('drawer-created', this.drawer);\n\n if (this.params.responsive !== false) {\n window.addEventListener('resize', this._onResize, true);\n window.addEventListener('orientationchange', this._onResize, true);\n }\n\n this.drawer.on('redraw', function () {\n _this5.drawBuffer();\n\n _this5.drawer.progress(_this5.backend.getPlayedPercents());\n }); // Click-to-seek\n\n this.drawer.on('click', function (e, progress) {\n setTimeout(function () {\n return _this5.seekTo(progress);\n }, 0);\n }); // Relay the scroll event from the drawer\n\n this.drawer.on('scroll', function (e) {\n if (_this5.params.partialRender) {\n _this5.drawBuffer();\n }\n\n _this5.fireEvent('scroll', e);\n });\n }\n /**\n * Create the backend\n *\n * @private\n * @emits WaveSurfer#backend-created\n */\n\n }, {\n key: \"createBackend\",\n value: function createBackend() {\n var _this6 = this;\n\n if (this.backend) {\n this.backend.destroy();\n }\n\n this.backend = new this.Backend(this.params);\n this.backend.init();\n this.fireEvent('backend-created', this.backend);\n this.backend.on('finish', function () {\n _this6.drawer.progress(_this6.backend.getPlayedPercents());\n\n _this6.fireEvent('finish');\n });\n this.backend.on('play', function () {\n return _this6.fireEvent('play');\n });\n this.backend.on('pause', function () {\n return _this6.fireEvent('pause');\n });\n this.backend.on('audioprocess', function (time) {\n _this6.drawer.progress(_this6.backend.getPlayedPercents());\n\n _this6.fireEvent('audioprocess', time);\n }); // only needed for MediaElement and MediaElementWebAudio backend\n\n if (this.params.backend === 'MediaElement' || this.params.backend === 'MediaElementWebAudio') {\n this.backend.on('seek', function () {\n _this6.drawer.progress(_this6.backend.getPlayedPercents());\n });\n this.backend.on('volume', function () {\n var newVolume = _this6.getVolume();\n\n _this6.fireEvent('volume', newVolume);\n\n if (_this6.backend.isMuted !== _this6.isMuted) {\n _this6.isMuted = _this6.backend.isMuted;\n\n _this6.fireEvent('mute', _this6.isMuted);\n }\n });\n }\n }\n /**\n * Create the peak cache\n *\n * @private\n */\n\n }, {\n key: \"createPeakCache\",\n value: function createPeakCache() {\n if (this.params.partialRender) {\n this.peakCache = new _peakcache.default();\n }\n }\n /**\n * Get the duration of the audio clip\n *\n * @example const duration = wavesurfer.getDuration();\n * @return {number} Duration in seconds\n */\n\n }, {\n key: \"getDuration\",\n value: function getDuration() {\n return this.backend.getDuration();\n }\n /**\n * Get the current playback position\n *\n * @example const currentTime = wavesurfer.getCurrentTime();\n * @return {number} Playback position in seconds\n */\n\n }, {\n key: \"getCurrentTime\",\n value: function getCurrentTime() {\n return this.backend.getCurrentTime();\n }\n /**\n * Set the current play time in seconds.\n *\n * @param {number} seconds A positive number in seconds. E.g. 10 means 10\n * seconds, 60 means 1 minute\n */\n\n }, {\n key: \"setCurrentTime\",\n value: function setCurrentTime(seconds) {\n if (seconds >= this.getDuration()) {\n this.seekTo(1);\n } else {\n this.seekTo(seconds / this.getDuration());\n }\n }\n /**\n * Starts playback from the current position. Optional start and end\n * measured in seconds can be used to set the range of audio to play.\n *\n * @param {?number} start Position to start at\n * @param {?number} end Position to end at\n * @emits WaveSurfer#interaction\n * @return {Promise} Result of the backend play method\n * @example\n * // play from second 1 to 5\n * wavesurfer.play(1, 5);\n */\n\n }, {\n key: \"play\",\n value: function play(start, end) {\n var _this7 = this;\n\n this.fireEvent('interaction', function () {\n return _this7.play(start, end);\n });\n return this.backend.play(start, end);\n }\n /**\n * Set a point in seconds for playback to stop at.\n *\n * @param {number} position Position (in seconds) to stop at\n * @version 3.3.0\n */\n\n }, {\n key: \"setPlayEnd\",\n value: function setPlayEnd(position) {\n this.backend.setPlayEnd(position);\n }\n /**\n * Stops and pauses playback\n *\n * @example wavesurfer.pause();\n * @return {Promise} Result of the backend pause method\n */\n\n }, {\n key: \"pause\",\n value: function pause() {\n if (!this.backend.isPaused()) {\n return this.backend.pause();\n }\n }\n /**\n * Toggle playback\n *\n * @example wavesurfer.playPause();\n * @return {Promise} Result of the backend play or pause method\n */\n\n }, {\n key: \"playPause\",\n value: function playPause() {\n return this.backend.isPaused() ? this.play() : this.pause();\n }\n /**\n * Get the current playback state\n *\n * @example const isPlaying = wavesurfer.isPlaying();\n * @return {boolean} False if paused, true if playing\n */\n\n }, {\n key: \"isPlaying\",\n value: function isPlaying() {\n return !this.backend.isPaused();\n }\n /**\n * Skip backward\n *\n * @param {?number} seconds Amount to skip back, if not specified `skipLength`\n * is used\n * @example wavesurfer.skipBackward();\n */\n\n }, {\n key: \"skipBackward\",\n value: function skipBackward(seconds) {\n this.skip(-seconds || -this.params.skipLength);\n }\n /**\n * Skip forward\n *\n * @param {?number} seconds Amount to skip back, if not specified `skipLength`\n * is used\n * @example wavesurfer.skipForward();\n */\n\n }, {\n key: \"skipForward\",\n value: function skipForward(seconds) {\n this.skip(seconds || this.params.skipLength);\n }\n /**\n * Skip a number of seconds from the current position (use a negative value\n * to go backwards).\n *\n * @param {number} offset Amount to skip back or forwards\n * @example\n * // go back 2 seconds\n * wavesurfer.skip(-2);\n */\n\n }, {\n key: \"skip\",\n value: function skip(offset) {\n var duration = this.getDuration() || 1;\n var position = this.getCurrentTime() || 0;\n position = Math.max(0, Math.min(duration, position + (offset || 0)));\n this.seekAndCenter(position / duration);\n }\n /**\n * Seeks to a position and centers the view\n *\n * @param {number} progress Between 0 (=beginning) and 1 (=end)\n * @example\n * // seek and go to the middle of the audio\n * wavesurfer.seekTo(0.5);\n */\n\n }, {\n key: \"seekAndCenter\",\n value: function seekAndCenter(progress) {\n this.seekTo(progress);\n this.drawer.recenter(progress);\n }\n /**\n * Seeks to a position\n *\n * @param {number} progress Between 0 (=beginning) and 1 (=end)\n * @emits WaveSurfer#interaction\n * @emits WaveSurfer#seek\n * @example\n * // seek to the middle of the audio\n * wavesurfer.seekTo(0.5);\n */\n\n }, {\n key: \"seekTo\",\n value: function seekTo(progress) {\n var _this8 = this; // return an error if progress is not a number between 0 and 1\n\n\n if (typeof progress !== 'number' || !isFinite(progress) || progress < 0 || progress > 1) {\n throw new Error('Error calling wavesurfer.seekTo, parameter must be a number between 0 and 1!');\n }\n\n this.fireEvent('interaction', function () {\n return _this8.seekTo(progress);\n });\n var paused = this.backend.isPaused(); // avoid draw wrong position while playing backward seeking\n\n if (!paused) {\n this.backend.pause();\n } // avoid small scrolls while paused seeking\n\n\n var oldScrollParent = this.params.scrollParent;\n this.params.scrollParent = false;\n this.backend.seekTo(progress * this.getDuration());\n this.drawer.progress(progress);\n\n if (!paused) {\n this.backend.play();\n }\n\n this.params.scrollParent = oldScrollParent;\n this.fireEvent('seek', progress);\n }\n /**\n * Stops and goes to the beginning.\n *\n * @example wavesurfer.stop();\n */\n\n }, {\n key: \"stop\",\n value: function stop() {\n this.pause();\n this.seekTo(0);\n this.drawer.progress(0);\n }\n /**\n * Sets the ID of the audio device to use for output and returns a Promise.\n *\n * @param {string} deviceId String value representing underlying output\n * device\n * @returns {Promise} `Promise` that resolves to `undefined` when there are\n * no errors detected.\n */\n\n }, {\n key: \"setSinkId\",\n value: function setSinkId(deviceId) {\n return this.backend.setSinkId(deviceId);\n }\n /**\n * Set the playback volume.\n *\n * @param {number} newVolume A value between 0 and 1, 0 being no\n * volume and 1 being full volume.\n * @emits WaveSurfer#volume\n */\n\n }, {\n key: \"setVolume\",\n value: function setVolume(newVolume) {\n this.backend.setVolume(newVolume);\n this.fireEvent('volume', newVolume);\n }\n /**\n * Get the playback volume.\n *\n * @return {number} A value between 0 and 1, 0 being no\n * volume and 1 being full volume.\n */\n\n }, {\n key: \"getVolume\",\n value: function getVolume() {\n return this.backend.getVolume();\n }\n /**\n * Set the playback rate.\n *\n * @param {number} rate A positive number. E.g. 0.5 means half the normal\n * speed, 2 means double speed and so on.\n * @example wavesurfer.setPlaybackRate(2);\n */\n\n }, {\n key: \"setPlaybackRate\",\n value: function setPlaybackRate(rate) {\n this.backend.setPlaybackRate(rate);\n }\n /**\n * Get the playback rate.\n *\n * @return {number} The current playback rate.\n */\n\n }, {\n key: \"getPlaybackRate\",\n value: function getPlaybackRate() {\n return this.backend.getPlaybackRate();\n }\n /**\n * Toggle the volume on and off. If not currently muted it will save the\n * current volume value and turn the volume off. If currently muted then it\n * will restore the volume to the saved value, and then rest the saved\n * value.\n *\n * @example wavesurfer.toggleMute();\n */\n\n }, {\n key: \"toggleMute\",\n value: function toggleMute() {\n this.setMute(!this.isMuted);\n }\n /**\n * Enable or disable muted audio\n *\n * @param {boolean} mute Specify `true` to mute audio.\n * @emits WaveSurfer#volume\n * @emits WaveSurfer#mute\n * @example\n * // unmute\n * wavesurfer.setMute(false);\n * console.log(wavesurfer.getMute()) // logs false\n */\n\n }, {\n key: \"setMute\",\n value: function setMute(mute) {\n // ignore all muting requests if the audio is already in that state\n if (mute === this.isMuted) {\n this.fireEvent('mute', this.isMuted);\n return;\n }\n\n if (mute) {\n // If currently not muted then save current volume,\n // turn off the volume and update the mute properties\n this.savedVolume = this.backend.getVolume();\n this.backend.setVolume(0);\n this.isMuted = true;\n this.fireEvent('volume', 0);\n } else {\n // If currently muted then restore to the saved volume\n // and update the mute properties\n this.backend.setVolume(this.savedVolume);\n this.isMuted = false;\n this.fireEvent('volume', this.savedVolume);\n }\n\n this.fireEvent('mute', this.isMuted);\n }\n /**\n * Get the current mute status.\n *\n * @example const isMuted = wavesurfer.getMute();\n * @return {boolean} Current mute status\n */\n\n }, {\n key: \"getMute\",\n value: function getMute() {\n return this.isMuted;\n }\n /**\n * Get the list of current set filters as an array.\n *\n * Filters must be set with setFilters method first\n *\n * @return {array} List of enabled filters\n */\n\n }, {\n key: \"getFilters\",\n value: function getFilters() {\n return this.backend.filters || [];\n }\n /**\n * Toggles `scrollParent` and redraws\n *\n * @example wavesurfer.toggleScroll();\n */\n\n }, {\n key: \"toggleScroll\",\n value: function toggleScroll() {\n this.params.scrollParent = !this.params.scrollParent;\n this.drawBuffer();\n }\n /**\n * Toggle mouse interaction\n *\n * @example wavesurfer.toggleInteraction();\n */\n\n }, {\n key: \"toggleInteraction\",\n value: function toggleInteraction() {\n this.params.interact = !this.params.interact;\n }\n /**\n * Get the fill color of the waveform after the cursor.\n *\n * @return {string} A CSS color string.\n */\n\n }, {\n key: \"getWaveColor\",\n value: function getWaveColor() {\n return this.params.waveColor;\n }\n /**\n * Set the fill color of the waveform after the cursor.\n *\n * @param {string} color A CSS color string.\n * @example wavesurfer.setWaveColor('#ddd');\n */\n\n }, {\n key: \"setWaveColor\",\n value: function setWaveColor(color) {\n this.params.waveColor = color;\n this.drawBuffer();\n }\n /**\n * Get the fill color of the waveform behind the cursor.\n *\n * @return {string} A CSS color string.\n */\n\n }, {\n key: \"getProgressColor\",\n value: function getProgressColor() {\n return this.params.progressColor;\n }\n /**\n * Set the fill color of the waveform behind the cursor.\n *\n * @param {string} color A CSS color string.\n * @example wavesurfer.setProgressColor('#400');\n */\n\n }, {\n key: \"setProgressColor\",\n value: function setProgressColor(color) {\n this.params.progressColor = color;\n this.drawBuffer();\n }\n /**\n * Get the background color of the waveform container.\n *\n * @return {string} A CSS color string.\n */\n\n }, {\n key: \"getBackgroundColor\",\n value: function getBackgroundColor() {\n return this.params.backgroundColor;\n }\n /**\n * Set the background color of the waveform container.\n *\n * @param {string} color A CSS color string.\n * @example wavesurfer.setBackgroundColor('#FF00FF');\n */\n\n }, {\n key: \"setBackgroundColor\",\n value: function setBackgroundColor(color) {\n this.params.backgroundColor = color;\n util.style(this.container, {\n background: this.params.backgroundColor\n });\n }\n /**\n * Get the fill color of the cursor indicating the playhead\n * position.\n *\n * @return {string} A CSS color string.\n */\n\n }, {\n key: \"getCursorColor\",\n value: function getCursorColor() {\n return this.params.cursorColor;\n }\n /**\n * Set the fill color of the cursor indicating the playhead\n * position.\n *\n * @param {string} color A CSS color string.\n * @example wavesurfer.setCursorColor('#222');\n */\n\n }, {\n key: \"setCursorColor\",\n value: function setCursorColor(color) {\n this.params.cursorColor = color;\n this.drawer.updateCursor();\n }\n /**\n * Get the height of the waveform.\n *\n * @return {number} Height measured in pixels.\n */\n\n }, {\n key: \"getHeight\",\n value: function getHeight() {\n return this.params.height;\n }\n /**\n * Set the height of the waveform.\n *\n * @param {number} height Height measured in pixels.\n * @example wavesurfer.setHeight(200);\n */\n\n }, {\n key: \"setHeight\",\n value: function setHeight(height) {\n this.params.height = height;\n this.drawer.setHeight(height * this.params.pixelRatio);\n this.drawBuffer();\n }\n /**\n * Get the correct peaks for current wave view-port and render wave\n *\n * @private\n * @emits WaveSurfer#redraw\n */\n\n }, {\n key: \"drawBuffer\",\n value: function drawBuffer() {\n var nominalWidth = Math.round(this.getDuration() * this.params.minPxPerSec * this.params.pixelRatio);\n var parentWidth = this.drawer.getWidth();\n var width = nominalWidth; // always start at 0 after zooming for scrolling : issue redraw left part\n\n var start = 0;\n var end = Math.max(start + parentWidth, width); // Fill container\n\n if (this.params.fillParent && (!this.params.scrollParent || nominalWidth < parentWidth)) {\n width = parentWidth;\n start = 0;\n end = width;\n }\n\n var peaks;\n\n if (this.params.partialRender) {\n var newRanges = this.peakCache.addRangeToPeakCache(width, start, end);\n var i;\n\n for (i = 0; i < newRanges.length; i++) {\n peaks = this.backend.getPeaks(width, newRanges[i][0], newRanges[i][1]);\n this.drawer.drawPeaks(peaks, width, newRanges[i][0], newRanges[i][1]);\n }\n } else {\n peaks = this.backend.getPeaks(width, start, end);\n this.drawer.drawPeaks(peaks, width, start, end);\n }\n\n this.fireEvent('redraw', peaks, width);\n }\n /**\n * Horizontally zooms the waveform in and out. It also changes the parameter\n * `minPxPerSec` and enables the `scrollParent` option. Calling the function\n * with a falsey parameter will reset the zoom state.\n *\n * @param {?number} pxPerSec Number of horizontal pixels per second of\n * audio, if none is set the waveform returns to unzoomed state\n * @emits WaveSurfer#zoom\n * @example wavesurfer.zoom(20);\n */\n\n }, {\n key: \"zoom\",\n value: function zoom(pxPerSec) {\n if (!pxPerSec) {\n this.params.minPxPerSec = this.defaultParams.minPxPerSec;\n this.params.scrollParent = false;\n } else {\n this.params.minPxPerSec = pxPerSec;\n this.params.scrollParent = true;\n }\n\n this.drawBuffer();\n this.drawer.progress(this.backend.getPlayedPercents());\n this.drawer.recenter(this.getCurrentTime() / this.getDuration());\n this.fireEvent('zoom', pxPerSec);\n }\n /**\n * Decode buffer and load\n *\n * @private\n * @param {ArrayBuffer} arraybuffer Buffer to process\n */\n\n }, {\n key: \"loadArrayBuffer\",\n value: function loadArrayBuffer(arraybuffer) {\n var _this9 = this;\n\n this.decodeArrayBuffer(arraybuffer, function (data) {\n if (!_this9.isDestroyed) {\n _this9.loadDecodedBuffer(data);\n }\n });\n }\n /**\n * Directly load an externally decoded AudioBuffer\n *\n * @private\n * @param {AudioBuffer} buffer Buffer to process\n * @emits WaveSurfer#ready\n */\n\n }, {\n key: \"loadDecodedBuffer\",\n value: function loadDecodedBuffer(buffer) {\n this.backend.load(buffer);\n this.drawBuffer();\n this.isReady = true;\n this.fireEvent('ready');\n }\n /**\n * Loads audio data from a Blob or File object\n *\n * @param {Blob|File} blob Audio data\n * @example\n */\n\n }, {\n key: \"loadBlob\",\n value: function loadBlob(blob) {\n var _this10 = this; // Create file reader\n\n\n var reader = new FileReader();\n reader.addEventListener('progress', function (e) {\n return _this10.onProgress(e);\n });\n reader.addEventListener('load', function (e) {\n return _this10.loadArrayBuffer(e.target.result);\n });\n reader.addEventListener('error', function () {\n return _this10.fireEvent('error', 'Error reading file');\n });\n reader.readAsArrayBuffer(blob);\n this.empty();\n }\n /**\n * Loads audio and re-renders the waveform.\n *\n * @param {string|HTMLMediaElement} url The url of the audio file or the\n * audio element with the audio\n * @param {number[]|Number.<Array[]>} peaks Wavesurfer does not have to decode\n * the audio to render the waveform if this is specified\n * @param {?string} preload (Use with backend `MediaElement` and `MediaElementWebAudio`)\n * `'none'|'metadata'|'auto'` Preload attribute for the media element\n * @param {?number} duration The duration of the audio. This is used to\n * render the peaks data in the correct size for the audio duration (as\n * befits the current `minPxPerSec` and zoom value) without having to decode\n * the audio.\n * @returns {void}\n * @throws Will throw an error if the `url` argument is empty.\n * @example\n * // uses fetch or media element to load file (depending on backend)\n * wavesurfer.load('http://example.com/demo.wav');\n *\n * // setting preload attribute with media element backend and supplying\n * // peaks\n * wavesurfer.load(\n * 'http://example.com/demo.wav',\n * [0.0218, 0.0183, 0.0165, 0.0198, 0.2137, 0.2888],\n * true\n * );\n */\n\n }, {\n key: \"load\",\n value: function load(url, peaks, preload, duration) {\n if (!url) {\n throw new Error('url parameter cannot be empty');\n }\n\n this.empty();\n\n if (preload) {\n // check whether the preload attribute will be usable and if not log\n // a warning listing the reasons why not and nullify the variable\n var preloadIgnoreReasons = {\n \"Preload is not 'auto', 'none' or 'metadata'\": ['auto', 'metadata', 'none'].indexOf(preload) === -1,\n 'Peaks are not provided': !peaks,\n \"Backend is not of type 'MediaElement' or 'MediaElementWebAudio'\": ['MediaElement', 'MediaElementWebAudio'].indexOf(this.params.backend) === -1,\n 'Url is not of type string': typeof url !== 'string'\n };\n var activeReasons = Object.keys(preloadIgnoreReasons).filter(function (reason) {\n return preloadIgnoreReasons[reason];\n });\n\n if (activeReasons.length) {\n // eslint-disable-next-line no-console\n console.warn('Preload parameter of wavesurfer.load will be ignored because:\\n\\t- ' + activeReasons.join('\\n\\t- ')); // stop invalid values from being used\n\n preload = null;\n }\n }\n\n switch (this.params.backend) {\n case 'WebAudio':\n return this.loadBuffer(url, peaks, duration);\n\n case 'MediaElement':\n case 'MediaElementWebAudio':\n return this.loadMediaElement(url, peaks, preload, duration);\n }\n }\n /**\n * Loads audio using Web Audio buffer backend.\n *\n * @private\n * @param {string} url URL of audio file\n * @param {number[]|Number.<Array[]>} peaks Peaks data\n * @param {?number} duration Optional duration of audio file\n * @returns {void}\n */\n\n }, {\n key: \"loadBuffer\",\n value: function loadBuffer(url, peaks, duration) {\n var _this11 = this;\n\n var load = function load(action) {\n if (action) {\n _this11.tmpEvents.push(_this11.once('ready', action));\n }\n\n return _this11.getArrayBuffer(url, function (data) {\n return _this11.loadArrayBuffer(data);\n });\n };\n\n if (peaks) {\n this.backend.setPeaks(peaks, duration);\n this.drawBuffer();\n this.tmpEvents.push(this.once('interaction', load));\n } else {\n return load();\n }\n }\n /**\n * Either create a media element, or load an existing media element.\n *\n * @private\n * @param {string|HTMLMediaElement} urlOrElt Either a path to a media file, or an\n * existing HTML5 Audio/Video Element\n * @param {number[]|Number.<Array[]>} peaks Array of peaks. Required to bypass web audio\n * dependency\n * @param {?boolean} preload Set to true if the preload attribute of the\n * audio element should be enabled\n * @param {?number} duration Optional duration of audio file\n */\n\n }, {\n key: \"loadMediaElement\",\n value: function loadMediaElement(urlOrElt, peaks, preload, duration) {\n var _this12 = this;\n\n var url = urlOrElt;\n\n if (typeof urlOrElt === 'string') {\n this.backend.load(url, this.mediaContainer, peaks, preload);\n } else {\n var elt = urlOrElt;\n this.backend.loadElt(elt, peaks); // If peaks are not provided,\n // url = element.src so we can get peaks with web audio\n\n url = elt.src;\n }\n\n this.tmpEvents.push(this.backend.once('canplay', function () {\n // ignore when backend was already destroyed\n if (!_this12.backend.destroyed) {\n _this12.drawBuffer();\n\n _this12.isReady = true;\n\n _this12.fireEvent('ready');\n }\n }), this.backend.once('error', function (err) {\n return _this12.fireEvent('error', err);\n })); // If no pre-decoded peaks provided or pre-decoded peaks are\n // provided with forceDecode flag, attempt to download the\n // audio file and decode it with Web Audio.\n\n if (peaks) {\n this.backend.setPeaks(peaks, duration);\n }\n\n if ((!peaks || this.params.forceDecode) && this.backend.supportsWebAudio()) {\n this.getArrayBuffer(url, function (arraybuffer) {\n _this12.decodeArrayBuffer(arraybuffer, function (buffer) {\n _this12.backend.buffer = buffer;\n\n _this12.backend.setPeaks(null);\n\n _this12.drawBuffer();\n\n _this12.fireEvent('waveform-ready');\n });\n });\n }\n }\n /**\n * Decode an array buffer and pass data to a callback\n *\n * @private\n * @param {Object} arraybuffer The array buffer to decode\n * @param {function} callback The function to call on complete\n */\n\n }, {\n key: \"decodeArrayBuffer\",\n value: function decodeArrayBuffer(arraybuffer, callback) {\n var _this13 = this;\n\n this.arraybuffer = arraybuffer;\n this.backend.decodeArrayBuffer(arraybuffer, function (data) {\n // Only use the decoded data if we haven't been destroyed or\n // another decode started in the meantime\n if (!_this13.isDestroyed && _this13.arraybuffer == arraybuffer) {\n callback(data);\n _this13.arraybuffer = null;\n }\n }, function () {\n return _this13.fireEvent('error', 'Error decoding audiobuffer');\n });\n }\n /**\n * Load an array buffer using fetch and pass the result to a callback\n *\n * @param {string} url The URL of the file object\n * @param {function} callback The function to call on complete\n * @returns {util.fetchFile} fetch call\n * @private\n */\n\n }, {\n key: \"getArrayBuffer\",\n value: function getArrayBuffer(url, callback) {\n var _this14 = this;\n\n var options = Object.assign({\n url: url,\n responseType: 'arraybuffer'\n }, this.params.xhr);\n var request = util.fetchFile(options);\n this.currentRequest = request;\n this.tmpEvents.push(request.on('progress', function (e) {\n _this14.onProgress(e);\n }), request.on('success', function (data) {\n callback(data);\n _this14.currentRequest = null;\n }), request.on('error', function (e) {\n _this14.fireEvent('error', e);\n\n _this14.currentRequest = null;\n }));\n return request;\n }\n /**\n * Called while the audio file is loading\n *\n * @private\n * @param {Event} e Progress event\n * @emits WaveSurfer#loading\n */\n\n }, {\n key: \"onProgress\",\n value: function onProgress(e) {\n var percentComplete;\n\n if (e.lengthComputable) {\n percentComplete = e.loaded / e.total;\n } else {\n // Approximate progress with an asymptotic\n // function, and assume downloads in the 1-3 MB range.\n percentComplete = e.loaded / (e.loaded + 1000000);\n }\n\n this.fireEvent('loading', Math.round(percentComplete * 100), e.target);\n }\n /**\n * Exports PCM data into a JSON array and opens in a new window.\n *\n * @param {number} length=1024 The scale in which to export the peaks\n * @param {number} accuracy=10000\n * @param {?boolean} noWindow Set to true to disable opening a new\n * window with the JSON\n * @param {number} start Start index\n * @param {number} end End index\n * @return {Promise} Promise that resolves with array of peaks\n */\n\n }, {\n key: \"exportPCM\",\n value: function exportPCM(length, accuracy, noWindow, start, end) {\n length = length || 1024;\n start = start || 0;\n accuracy = accuracy || 10000;\n noWindow = noWindow || false;\n var peaks = this.backend.getPeaks(length, start, end);\n var arr = [].map.call(peaks, function (val) {\n return Math.round(val * accuracy) / accuracy;\n });\n return new Promise(function (resolve, reject) {\n var json = JSON.stringify(arr);\n\n if (!noWindow) {\n window.open('data:application/json;charset=utf-8,' + encodeURIComponent(json));\n }\n\n resolve(json);\n });\n }\n /**\n * Save waveform image as data URI.\n *\n * The default format is `'image/png'`. Other supported types are\n * `'image/jpeg'` and `'image/webp'`.\n *\n * @param {string} format='image/png' A string indicating the image format.\n * The default format type is `'image/png'`.\n * @param {number} quality=1 A number between 0 and 1 indicating the image\n * quality to use for image formats that use lossy compression such as\n * `'image/jpeg'`` and `'image/webp'`.\n * @param {string} type Image data type to return. Either 'dataURL' (default)\n * or 'blob'.\n * @return {string|string[]|Promise} When using `'dataURL'` type this returns\n * a single data URL or an array of data URLs, one for each canvas. When using\n * `'blob'` type this returns a `Promise` resolving with an array of `Blob`\n * instances, one for each canvas.\n */\n\n }, {\n key: \"exportImage\",\n value: function exportImage(format, quality, type) {\n if (!format) {\n format = 'image/png';\n }\n\n if (!quality) {\n quality = 1;\n }\n\n if (!type) {\n type = 'dataURL';\n }\n\n return this.drawer.getImage(format, quality, type);\n }\n /**\n * Cancel any fetch request currently in progress\n */\n\n }, {\n key: \"cancelAjax\",\n value: function cancelAjax() {\n if (this.currentRequest && this.currentRequest.controller) {\n this.currentRequest.controller.abort();\n this.currentRequest = null;\n }\n }\n /**\n * @private\n */\n\n }, {\n key: \"clearTmpEvents\",\n value: function clearTmpEvents() {\n this.tmpEvents.forEach(function (e) {\n return e.un();\n });\n }\n /**\n * Display empty waveform.\n */\n\n }, {\n key: \"empty\",\n value: function empty() {\n if (!this.backend.isPaused()) {\n this.stop();\n this.backend.disconnectSource();\n }\n\n this.isReady = false;\n this.cancelAjax();\n this.clearTmpEvents(); // empty drawer\n\n this.drawer.progress(0);\n this.drawer.setWidth(0);\n this.drawer.drawPeaks({\n length: this.drawer.getWidth()\n }, 0);\n }\n /**\n * Remove events, elements and disconnect WebAudio nodes.\n *\n * @emits WaveSurfer#destroy\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.destroyAllPlugins();\n this.fireEvent('destroy');\n this.cancelAjax();\n this.clearTmpEvents();\n this.unAll();\n\n if (this.params.responsive !== false) {\n window.removeEventListener('resize', this._onResize, true);\n window.removeEventListener('orientationchange', this._onResize, true);\n }\n\n if (this.backend) {\n this.backend.destroy();\n }\n\n if (this.drawer) {\n this.drawer.destroy();\n }\n\n this.isDestroyed = true;\n this.isReady = false;\n this.arraybuffer = null;\n }\n }]);\n\n return WaveSurfer;\n }(util.Observer);\n\n exports.default = WaveSurfer;\n WaveSurfer.VERSION = \"3.3.1\";\n WaveSurfer.util = util;\n module.exports = exports.default;\n /***/\n },\n\n /***/\n \"./src/webaudio.js\":\n /*!*************************!*\\\n !*** ./src/webaudio.js ***!\n \\*************************/\n\n /*! no static exports found */\n\n /***/\n function srcWebaudioJs(module, exports, __webpack_require__) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.default = void 0;\n\n var util = _interopRequireWildcard(__webpack_require__(\n /*! ./util */\n \"./src/util/index.js\"));\n\n function _getRequireWildcardCache() {\n if (typeof WeakMap !== \"function\") return null;\n var cache = new WeakMap();\n\n _getRequireWildcardCache = function _getRequireWildcardCache() {\n return cache;\n };\n\n return cache;\n }\n\n function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n }\n\n if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") {\n return {\n default: obj\n };\n }\n\n var cache = _getRequireWildcardCache();\n\n if (cache && cache.has(obj)) {\n return cache.get(obj);\n }\n\n var newObj = {};\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n\n if (desc && (desc.get || desc.set)) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n\n newObj.default = obj;\n\n if (cache) {\n cache.set(obj, newObj);\n }\n\n return newObj;\n }\n\n function _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 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\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n } // using constants to prevent someone writing the string wrong\n\n\n var PLAYING = 'playing';\n var PAUSED = 'paused';\n var FINISHED = 'finished';\n /**\n * WebAudio backend\n *\n * @extends {Observer}\n */\n\n var WebAudio = /*#__PURE__*/function (_util$Observer) {\n _inherits(WebAudio, _util$Observer);\n\n _createClass(WebAudio, [{\n key: \"supportsWebAudio\",\n\n /** scriptBufferSize: size of the processing buffer */\n\n /** audioContext: allows to process audio with WebAudio API */\n\n /** @private */\n\n /** @private */\n\n /**\n * Does the browser support this backend\n *\n * @return {boolean} Whether or not this browser supports this backend\n */\n value: function supportsWebAudio() {\n return !!(window.AudioContext || window.webkitAudioContext);\n }\n /**\n * Get the audio context used by this backend or create one\n *\n * @return {AudioContext} Existing audio context, or creates a new one\n */\n\n }, {\n key: \"getAudioContext\",\n value: function getAudioContext() {\n if (!window.WaveSurferAudioContext) {\n window.WaveSurferAudioContext = new (window.AudioContext || window.webkitAudioContext)();\n }\n\n return window.WaveSurferAudioContext;\n }\n /**\n * Get the offline audio context used by this backend or create one\n *\n * @param {number} sampleRate The sample rate to use\n * @return {OfflineAudioContext} Existing offline audio context, or creates\n * a new one\n */\n\n }, {\n key: \"getOfflineAudioContext\",\n value: function getOfflineAudioContext(sampleRate) {\n if (!window.WaveSurferOfflineAudioContext) {\n window.WaveSurferOfflineAudioContext = new (window.OfflineAudioContext || window.webkitOfflineAudioContext)(1, 2, sampleRate);\n }\n\n return window.WaveSurferOfflineAudioContext;\n }\n /**\n * Construct the backend\n *\n * @param {WavesurferParams} params Wavesurfer parameters\n */\n\n }]);\n\n function WebAudio(params) {\n var _this$stateBehaviors, _this$states;\n\n var _this;\n\n _classCallCheck(this, WebAudio);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(WebAudio).call(this));\n /** @private */\n\n _this.audioContext = null;\n _this.offlineAudioContext = null;\n _this.stateBehaviors = (_this$stateBehaviors = {}, _defineProperty(_this$stateBehaviors, PLAYING, {\n init: function init() {\n this.addOnAudioProcess();\n },\n getPlayedPercents: function getPlayedPercents() {\n var duration = this.getDuration();\n return this.getCurrentTime() / duration || 0;\n },\n getCurrentTime: function getCurrentTime() {\n return this.startPosition + this.getPlayedTime();\n }\n }), _defineProperty(_this$stateBehaviors, PAUSED, {\n init: function init() {\n this.removeOnAudioProcess();\n },\n getPlayedPercents: function getPlayedPercents() {\n var duration = this.getDuration();\n return this.getCurrentTime() / duration || 0;\n },\n getCurrentTime: function getCurrentTime() {\n return this.startPosition;\n }\n }), _defineProperty(_this$stateBehaviors, FINISHED, {\n init: function init() {\n this.removeOnAudioProcess();\n this.fireEvent('finish');\n },\n getPlayedPercents: function getPlayedPercents() {\n return 1;\n },\n getCurrentTime: function getCurrentTime() {\n return this.getDuration();\n }\n }), _this$stateBehaviors);\n _this.params = params;\n /** ac: Audio Context instance */\n\n _this.ac = params.audioContext || (_this.supportsWebAudio() ? _this.getAudioContext() : {});\n /**@private */\n\n _this.lastPlay = _this.ac.currentTime;\n /** @private */\n\n _this.startPosition = 0;\n /** @private */\n\n _this.scheduledPause = null;\n /** @private */\n\n _this.states = (_this$states = {}, _defineProperty(_this$states, PLAYING, Object.create(_this.stateBehaviors[PLAYING])), _defineProperty(_this$states, PAUSED, Object.create(_this.stateBehaviors[PAUSED])), _defineProperty(_this$states, FINISHED, Object.create(_this.stateBehaviors[FINISHED])), _this$states);\n /** @private */\n\n _this.buffer = null;\n /** @private */\n\n _this.filters = [];\n /** gainNode: allows to control audio volume */\n\n _this.gainNode = null;\n /** @private */\n\n _this.mergedPeaks = null;\n /** @private */\n\n _this.offlineAc = null;\n /** @private */\n\n _this.peaks = null;\n /** @private */\n\n _this.playbackRate = 1;\n /** analyser: provides audio analysis information */\n\n _this.analyser = null;\n /** scriptNode: allows processing audio */\n\n _this.scriptNode = null;\n /** @private */\n\n _this.source = null;\n /** @private */\n\n _this.splitPeaks = [];\n /** @private */\n\n _this.state = null;\n /** @private */\n\n _this.explicitDuration = params.duration;\n /**\n * Boolean indicating if the backend was destroyed.\n */\n\n _this.destroyed = false;\n return _this;\n }\n /**\n * Initialise the backend, called in `wavesurfer.createBackend()`\n */\n\n\n _createClass(WebAudio, [{\n key: \"init\",\n value: function init() {\n this.createVolumeNode();\n this.createScriptNode();\n this.createAnalyserNode();\n this.setState(PAUSED);\n this.setPlaybackRate(this.params.audioRate);\n this.setLength(0);\n }\n /** @private */\n\n }, {\n key: \"disconnectFilters\",\n value: function disconnectFilters() {\n if (this.filters) {\n this.filters.forEach(function (filter) {\n filter && filter.disconnect();\n });\n this.filters = null; // Reconnect direct path\n\n this.analyser.connect(this.gainNode);\n }\n }\n /**\n * @private\n *\n * @param {string} state The new state\n */\n\n }, {\n key: \"setState\",\n value: function setState(state) {\n if (this.state !== this.states[state]) {\n this.state = this.states[state];\n this.state.init.call(this);\n }\n }\n /**\n * Unpacked `setFilters()`\n *\n * @param {...AudioNode} filters One or more filters to set\n */\n\n }, {\n key: \"setFilter\",\n value: function setFilter() {\n for (var _len = arguments.length, filters = new Array(_len), _key = 0; _key < _len; _key++) {\n filters[_key] = arguments[_key];\n }\n\n this.setFilters(filters);\n }\n /**\n * Insert custom Web Audio nodes into the graph\n *\n * @param {AudioNode[]} filters Packed filters array\n * @example\n * const lowpass = wavesurfer.backend.ac.createBiquadFilter();\n * wavesurfer.backend.setFilter(lowpass);\n */\n\n }, {\n key: \"setFilters\",\n value: function setFilters(filters) {\n // Remove existing filters\n this.disconnectFilters(); // Insert filters if filter array not empty\n\n if (filters && filters.length) {\n this.filters = filters; // Disconnect direct path before inserting filters\n\n this.analyser.disconnect(); // Connect each filter in turn\n\n filters.reduce(function (prev, curr) {\n prev.connect(curr);\n return curr;\n }, this.analyser).connect(this.gainNode);\n }\n }\n /** Create ScriptProcessorNode to process audio */\n\n }, {\n key: \"createScriptNode\",\n value: function createScriptNode() {\n if (this.params.audioScriptProcessor) {\n this.scriptNode = this.params.audioScriptProcessor;\n } else {\n if (this.ac.createScriptProcessor) {\n this.scriptNode = this.ac.createScriptProcessor(WebAudio.scriptBufferSize);\n } else {\n this.scriptNode = this.ac.createJavaScriptNode(WebAudio.scriptBufferSize);\n }\n }\n\n this.scriptNode.connect(this.ac.destination);\n }\n /** @private */\n\n }, {\n key: \"addOnAudioProcess\",\n value: function addOnAudioProcess() {\n var _this2 = this;\n\n this.scriptNode.onaudioprocess = function () {\n var time = _this2.getCurrentTime();\n\n if (time >= _this2.getDuration()) {\n _this2.setState(FINISHED);\n\n _this2.fireEvent('pause');\n } else if (time >= _this2.scheduledPause) {\n _this2.pause();\n } else if (_this2.state === _this2.states[PLAYING]) {\n _this2.fireEvent('audioprocess', time);\n }\n };\n }\n /** @private */\n\n }, {\n key: \"removeOnAudioProcess\",\n value: function removeOnAudioProcess() {\n this.scriptNode.onaudioprocess = function () {};\n }\n /** Create analyser node to perform audio analysis */\n\n }, {\n key: \"createAnalyserNode\",\n value: function createAnalyserNode() {\n this.analyser = this.ac.createAnalyser();\n this.analyser.connect(this.gainNode);\n }\n /**\n * Create the gain node needed to control the playback volume.\n *\n */\n\n }, {\n key: \"createVolumeNode\",\n value: function createVolumeNode() {\n // Create gain node using the AudioContext\n if (this.ac.createGain) {\n this.gainNode = this.ac.createGain();\n } else {\n this.gainNode = this.ac.createGainNode();\n } // Add the gain node to the graph\n\n\n this.gainNode.connect(this.ac.destination);\n }\n /**\n * Set the sink id for the media player\n *\n * @param {string} deviceId String value representing audio device id.\n * @returns {Promise} A Promise that resolves to `undefined` when there\n * are no errors.\n */\n\n }, {\n key: \"setSinkId\",\n value: function setSinkId(deviceId) {\n if (deviceId) {\n /**\n * The webaudio API doesn't currently support setting the device\n * output. Here we create an HTMLAudioElement, connect the\n * webaudio stream to that element and setSinkId there.\n */\n var audio = new window.Audio();\n\n if (!audio.setSinkId) {\n return Promise.reject(new Error('setSinkId is not supported in your browser'));\n }\n\n audio.autoplay = true;\n var dest = this.ac.createMediaStreamDestination();\n this.gainNode.disconnect();\n this.gainNode.connect(dest);\n audio.srcObject = dest.stream;\n return audio.setSinkId(deviceId);\n } else {\n return Promise.reject(new Error('Invalid deviceId: ' + deviceId));\n }\n }\n /**\n * Set the audio volume\n *\n * @param {number} value A floating point value between 0 and 1.\n */\n\n }, {\n key: \"setVolume\",\n value: function setVolume(value) {\n this.gainNode.gain.setValueAtTime(value, this.ac.currentTime);\n }\n /**\n * Get the current volume\n *\n * @return {number} value A floating point value between 0 and 1.\n */\n\n }, {\n key: \"getVolume\",\n value: function getVolume() {\n return this.gainNode.gain.value;\n }\n /**\n * Decode an array buffer and pass data to a callback\n *\n * @private\n * @param {ArrayBuffer} arraybuffer The array buffer to decode\n * @param {function} callback The function to call on complete.\n * @param {function} errback The function to call on error.\n */\n\n }, {\n key: \"decodeArrayBuffer\",\n value: function decodeArrayBuffer(arraybuffer, callback, errback) {\n if (!this.offlineAc) {\n this.offlineAc = this.getOfflineAudioContext(this.ac && this.ac.sampleRate ? this.ac.sampleRate : 44100);\n }\n\n this.offlineAc.decodeAudioData(arraybuffer, function (data) {\n return callback(data);\n }, errback);\n }\n /**\n * Set pre-decoded peaks\n *\n * @param {number[]|Number.<Array[]>} peaks Peaks data\n * @param {?number} duration Explicit duration\n */\n\n }, {\n key: \"setPeaks\",\n value: function setPeaks(peaks, duration) {\n if (duration != null) {\n this.explicitDuration = duration;\n }\n\n this.peaks = peaks;\n }\n /**\n * Set the rendered length (different from the length of the audio)\n *\n * @param {number} length The rendered length\n */\n\n }, {\n key: \"setLength\",\n value: function setLength(length) {\n // No resize, we can preserve the cached peaks.\n if (this.mergedPeaks && length == 2 * this.mergedPeaks.length - 1 + 2) {\n return;\n }\n\n this.splitPeaks = [];\n this.mergedPeaks = []; // Set the last element of the sparse array so the peak arrays are\n // appropriately sized for other calculations.\n\n var channels = this.buffer ? this.buffer.numberOfChannels : 1;\n var c;\n\n for (c = 0; c < channels; c++) {\n this.splitPeaks[c] = [];\n this.splitPeaks[c][2 * (length - 1)] = 0;\n this.splitPeaks[c][2 * (length - 1) + 1] = 0;\n }\n\n this.mergedPeaks[2 * (length - 1)] = 0;\n this.mergedPeaks[2 * (length - 1) + 1] = 0;\n }\n /**\n * Compute the max and min value of the waveform when broken into <length> subranges.\n *\n * @param {number} length How many subranges to break the waveform into.\n * @param {number} first First sample in the required range.\n * @param {number} last Last sample in the required range.\n * @return {number[]|Number.<Array[]>} Array of 2*<length> peaks or array of arrays of\n * peaks consisting of (max, min) values for each subrange.\n */\n\n }, {\n key: \"getPeaks\",\n value: function getPeaks(length, first, last) {\n if (this.peaks) {\n return this.peaks;\n }\n\n if (!this.buffer) {\n return [];\n }\n\n first = first || 0;\n last = last || length - 1;\n this.setLength(length);\n\n if (!this.buffer) {\n return this.params.splitChannels ? this.splitPeaks : this.mergedPeaks;\n }\n /**\n * The following snippet fixes a buffering data issue on the Safari\n * browser which returned undefined It creates the missing buffer based\n * on 1 channel, 4096 samples and the sampleRate from the current\n * webaudio context 4096 samples seemed to be the best fit for rendering\n * will review this code once a stable version of Safari TP is out\n */\n\n\n if (!this.buffer.length) {\n var newBuffer = this.createBuffer(1, 4096, this.sampleRate);\n this.buffer = newBuffer.buffer;\n }\n\n var sampleSize = this.buffer.length / length;\n var sampleStep = ~~(sampleSize / 10) || 1;\n var channels = this.buffer.numberOfChannels;\n var c;\n\n for (c = 0; c < channels; c++) {\n var peaks = this.splitPeaks[c];\n var chan = this.buffer.getChannelData(c);\n var i = void 0;\n\n for (i = first; i <= last; i++) {\n var start = ~~(i * sampleSize);\n var end = ~~(start + sampleSize);\n var min = 0;\n var max = 0;\n var j = void 0;\n\n for (j = start; j < end; j += sampleStep) {\n var value = chan[j];\n\n if (value > max) {\n max = value;\n }\n\n if (value < min) {\n min = value;\n }\n }\n\n peaks[2 * i] = max;\n peaks[2 * i + 1] = min;\n\n if (c == 0 || max > this.mergedPeaks[2 * i]) {\n this.mergedPeaks[2 * i] = max;\n }\n\n if (c == 0 || min < this.mergedPeaks[2 * i + 1]) {\n this.mergedPeaks[2 * i + 1] = min;\n }\n }\n }\n\n return this.params.splitChannels ? this.splitPeaks : this.mergedPeaks;\n }\n /**\n * Get the position from 0 to 1\n *\n * @return {number} Position\n */\n\n }, {\n key: \"getPlayedPercents\",\n value: function getPlayedPercents() {\n return this.state.getPlayedPercents.call(this);\n }\n /** @private */\n\n }, {\n key: \"disconnectSource\",\n value: function disconnectSource() {\n if (this.source) {\n this.source.disconnect();\n }\n }\n /**\n * This is called when wavesurfer is destroyed\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n if (!this.isPaused()) {\n this.pause();\n }\n\n this.unAll();\n this.buffer = null;\n this.destroyed = true;\n this.disconnectFilters();\n this.disconnectSource();\n this.gainNode.disconnect();\n this.scriptNode.disconnect();\n this.analyser.disconnect(); // close the audioContext if closeAudioContext option is set to true\n\n if (this.params.closeAudioContext) {\n // check if browser supports AudioContext.close()\n if (typeof this.ac.close === 'function' && this.ac.state != 'closed') {\n this.ac.close();\n } // clear the reference to the audiocontext\n\n\n this.ac = null; // clear the actual audiocontext, either passed as param or the\n // global singleton\n\n if (!this.params.audioContext) {\n window.WaveSurferAudioContext = null;\n } else {\n this.params.audioContext = null;\n } // clear the offlineAudioContext\n\n\n window.WaveSurferOfflineAudioContext = null;\n }\n }\n /**\n * Loaded a decoded audio buffer\n *\n * @param {Object} buffer Decoded audio buffer to load\n */\n\n }, {\n key: \"load\",\n value: function load(buffer) {\n this.startPosition = 0;\n this.lastPlay = this.ac.currentTime;\n this.buffer = buffer;\n this.createSource();\n }\n /** @private */\n\n }, {\n key: \"createSource\",\n value: function createSource() {\n this.disconnectSource();\n this.source = this.ac.createBufferSource(); // adjust for old browsers\n\n this.source.start = this.source.start || this.source.noteGrainOn;\n this.source.stop = this.source.stop || this.source.noteOff;\n this.source.playbackRate.setValueAtTime(this.playbackRate, this.ac.currentTime);\n this.source.buffer = this.buffer;\n this.source.connect(this.analyser);\n }\n /**\n * Used by `wavesurfer.isPlaying()` and `wavesurfer.playPause()`\n *\n * @return {boolean} Whether or not this backend is currently paused\n */\n\n }, {\n key: \"isPaused\",\n value: function isPaused() {\n return this.state !== this.states[PLAYING];\n }\n /**\n * Used by `wavesurfer.getDuration()`\n *\n * @return {number} Duration of loaded buffer\n */\n\n }, {\n key: \"getDuration\",\n value: function getDuration() {\n if (this.explicitDuration) {\n return this.explicitDuration;\n }\n\n if (!this.buffer) {\n return 0;\n }\n\n return this.buffer.duration;\n }\n /**\n * Used by `wavesurfer.seekTo()`\n *\n * @param {number} start Position to start at in seconds\n * @param {number} end Position to end at in seconds\n * @return {{start: number, end: number}} Object containing start and end\n * positions\n */\n\n }, {\n key: \"seekTo\",\n value: function seekTo(start, end) {\n if (!this.buffer) {\n return;\n }\n\n this.scheduledPause = null;\n\n if (start == null) {\n start = this.getCurrentTime();\n\n if (start >= this.getDuration()) {\n start = 0;\n }\n }\n\n if (end == null) {\n end = this.getDuration();\n }\n\n this.startPosition = start;\n this.lastPlay = this.ac.currentTime;\n\n if (this.state === this.states[FINISHED]) {\n this.setState(PAUSED);\n }\n\n return {\n start: start,\n end: end\n };\n }\n /**\n * Get the playback position in seconds\n *\n * @return {number} The playback position in seconds\n */\n\n }, {\n key: \"getPlayedTime\",\n value: function getPlayedTime() {\n return (this.ac.currentTime - this.lastPlay) * this.playbackRate;\n }\n /**\n * Plays the loaded audio region.\n *\n * @param {number} start Start offset in seconds, relative to the beginning\n * of a clip.\n * @param {number} end When to stop relative to the beginning of a clip.\n */\n\n }, {\n key: \"play\",\n value: function play(start, end) {\n if (!this.buffer) {\n return;\n } // need to re-create source on each playback\n\n\n this.createSource();\n var adjustedTime = this.seekTo(start, end);\n start = adjustedTime.start;\n end = adjustedTime.end;\n this.scheduledPause = end;\n this.source.start(0, start);\n\n if (this.ac.state == 'suspended') {\n this.ac.resume && this.ac.resume();\n }\n\n this.setState(PLAYING);\n this.fireEvent('play');\n }\n /**\n * Pauses the loaded audio.\n */\n\n }, {\n key: \"pause\",\n value: function pause() {\n this.scheduledPause = null;\n this.startPosition += this.getPlayedTime();\n this.source && this.source.stop(0);\n this.setState(PAUSED);\n this.fireEvent('pause');\n }\n /**\n * Returns the current time in seconds relative to the audio-clip's\n * duration.\n *\n * @return {number} The current time in seconds\n */\n\n }, {\n key: \"getCurrentTime\",\n value: function getCurrentTime() {\n return this.state.getCurrentTime.call(this);\n }\n /**\n * Returns the current playback rate. (0=no playback, 1=normal playback)\n *\n * @return {number} The current playback rate\n */\n\n }, {\n key: \"getPlaybackRate\",\n value: function getPlaybackRate() {\n return this.playbackRate;\n }\n /**\n * Set the audio source playback rate.\n *\n * @param {number} value The playback rate to use\n */\n\n }, {\n key: \"setPlaybackRate\",\n value: function setPlaybackRate(value) {\n value = value || 1;\n\n if (this.isPaused()) {\n this.playbackRate = value;\n } else {\n this.pause();\n this.playbackRate = value;\n this.play();\n }\n }\n /**\n * Set a point in seconds for playback to stop at.\n *\n * @param {number} end Position to end at\n * @version 3.3.0\n */\n\n }, {\n key: \"setPlayEnd\",\n value: function setPlayEnd(end) {\n this.scheduledPause = end;\n }\n }]);\n\n return WebAudio;\n }(util.Observer);\n\n exports.default = WebAudio;\n WebAudio.scriptBufferSize = 256;\n module.exports = exports.default;\n /***/\n }\n /******/\n\n })\n );\n});","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;","// APIs for normalizing fullscreen operations. Note that Edge uses\n// the WebKit-prefixed APIs currently (as of Edge 16).\n\nexport const isFullscreen = () => document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement;\n\nexport const exitFullscreen = () => {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n }\n};\n\nexport const requestFullscreen = el => {\n if (el.requestFullscreen) {\n el.requestFullscreen();\n } else if (el.webkitRequestFullscreen) {\n el.webkitRequestFullscreen();\n } else if (el.mozRequestFullScreen) {\n el.mozRequestFullScreen();\n }\n};\n\nexport const attachFullscreenListener = (listener) => {\n if ('onfullscreenchange' in document) {\n document.addEventListener('fullscreenchange', listener);\n } else if ('onwebkitfullscreenchange' in document) {\n document.addEventListener('webkitfullscreenchange', listener);\n } else if ('onmozfullscreenchange' in document) {\n document.addEventListener('mozfullscreenchange', listener);\n }\n};\n\nexport const detachFullscreenListener = (listener) => {\n if ('onfullscreenchange' in document) {\n document.removeEventListener('fullscreenchange', listener);\n } else if ('onwebkitfullscreenchange' in document) {\n document.removeEventListener('webkitfullscreenchange', listener);\n } else if ('onmozfullscreenchange' in document) {\n document.removeEventListener('mozfullscreenchange', listener);\n }\n};\n","// APIs for normalizing fullscreen operations. Note that Edge uses\n// the WebKit-prefixed APIs currently (as of Edge 16).\n\nexport const isFullscreen = () => document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement;\n\nexport const exitFullscreen = () => {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n }\n};\n\nexport const requestFullscreen = el => {\n if (el.requestFullscreen) {\n el.requestFullscreen();\n } else if (el.webkitRequestFullscreen) {\n el.webkitRequestFullscreen();\n } else if (el.mozRequestFullScreen) {\n el.mozRequestFullScreen();\n }\n};\n\nexport const attachFullscreenListener = (listener) => {\n if ('onfullscreenchange' in document) {\n document.addEventListener('fullscreenchange', listener);\n } else if ('onwebkitfullscreenchange' in document) {\n document.addEventListener('webkitfullscreenchange', listener);\n } else if ('onmozfullscreenchange' in document) {\n document.addEventListener('mozfullscreenchange', listener);\n }\n};\n\nexport const detachFullscreenListener = (listener) => {\n if ('onfullscreenchange' in document) {\n document.removeEventListener('fullscreenchange', listener);\n } else if ('onwebkitfullscreenchange' in document) {\n document.removeEventListener('webkitfullscreenchange', listener);\n } else if ('onmozfullscreenchange' in document) {\n document.removeEventListener('mozfullscreenchange', listener);\n }\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nexport default class Icon extends React.PureComponent {\n\n static propTypes = {\n id: PropTypes.string.isRequired,\n className: PropTypes.string,\n fixedWidth: PropTypes.bool,\n };\n\n render () {\n const { id, className, fixedWidth, ...other } = this.props;\n\n return (\n <i role='img' className={classNames('fa', `fa-${id}`, className, { 'fa-fw': fixedWidth })} {...other} />\n );\n }\n\n}\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\nmodule.exports = freeGlobal;","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class GIFV extends React.PureComponent {\n\n static propTypes = {\n src: PropTypes.string.isRequired,\n alt: PropTypes.string,\n width: PropTypes.number,\n height: PropTypes.number,\n onClick: PropTypes.func,\n };\n\n state = {\n loading: true,\n };\n\n handleLoadedData = () => {\n this.setState({ loading: false });\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.src !== this.props.src) {\n this.setState({ loading: true });\n }\n }\n\n handleClick = e => {\n const { onClick } = this.props;\n\n if (onClick) {\n e.stopPropagation();\n onClick();\n }\n }\n\n render () {\n const { src, width, height, alt } = this.props;\n const { loading } = this.state;\n\n return (\n <div className='gifv' style={{ position: 'relative' }}>\n {loading && (\n <canvas\n width={width}\n height={height}\n role='button'\n tabIndex='0'\n aria-label={alt}\n title={alt}\n onClick={this.handleClick}\n />\n )}\n\n <video\n src={src}\n width={width}\n height={height}\n role='button'\n tabIndex='0'\n aria-label={alt}\n title={alt}\n muted\n loop\n autoPlay\n playsInline\n onClick={this.handleClick}\n onLoadedData={this.handleLoadedData}\n style={{ position: loading ? 'absolute' : 'static', top: 0, left: 0 }}\n />\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class GIFV extends React.PureComponent {\n\n static propTypes = {\n src: PropTypes.string.isRequired,\n alt: PropTypes.string,\n width: PropTypes.number,\n height: PropTypes.number,\n onClick: PropTypes.func,\n };\n\n state = {\n loading: true,\n };\n\n handleLoadedData = () => {\n this.setState({ loading: false });\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.src !== this.props.src) {\n this.setState({ loading: true });\n }\n }\n\n handleClick = e => {\n const { onClick } = this.props;\n\n if (onClick) {\n e.stopPropagation();\n onClick();\n }\n }\n\n render () {\n const { src, width, height, alt } = this.props;\n const { loading } = this.state;\n\n return (\n <div className='gifv' style={{ position: 'relative' }}>\n {loading && (\n <canvas\n width={width}\n height={height}\n role='button'\n tabIndex='0'\n aria-label={alt}\n title={alt}\n onClick={this.handleClick}\n />\n )}\n\n <video\n src={src}\n width={width}\n height={height}\n role='button'\n tabIndex='0'\n aria-label={alt}\n title={alt}\n muted\n loop\n autoPlay\n playsInline\n onClick={this.handleClick}\n onLoadedData={this.handleLoadedData}\n style={{ position: loading ? 'absolute' : 'static', top: 0, left: 0 }}\n />\n </div>\n );\n }\n\n}\n","// currently used to initiate the velocity style object to 0\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = mapToZero;\n\nfunction mapToZero(obj) {\n var ret = {};\n\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n ret[key] = 0;\n }\n }\n\n return ret;\n}\n\nmodule.exports = exports['default'];","// turn {x: {val: 1, stiffness: 1, damping: 2}, y: 2} generated by\n// `{x: spring(1, {stiffness: 1, damping: 2}), y: 2}` into {x: 1, y: 2}\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = stripStyle;\n\nfunction stripStyle(style) {\n var ret = {};\n\n for (var key in style) {\n if (!Object.prototype.hasOwnProperty.call(style, key)) {\n continue;\n }\n\n ret[key] = typeof style[key] === 'number' ? style[key] : style[key].val;\n }\n\n return ret;\n}\n\nmodule.exports = exports['default'];","// stepper is used a lot. Saves allocation to return the same array wrapper.\n// This is fine and danger-free against mutations because the callsite\n// immediately destructures it and gets the numbers inside without passing the\n\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = stepper;\nvar reusedTuple = [0, 0];\n\nfunction stepper(secondPerFrame, x, v, destX, k, b, precision) {\n // Spring stiffness, in kg / s^2\n // for animations, destX is really spring length (spring at rest). initial\n // position is considered as the stretched/compressed position of a spring\n var Fspring = -k * (x - destX); // Damping, in kg / s\n\n var Fdamper = -b * v; // usually we put mass here, but for animation purposes, specifying mass is a\n // bit redundant. you could simply adjust k and b accordingly\n // let a = (Fspring + Fdamper) / mass;\n\n var a = Fspring + Fdamper;\n var newV = v + a * secondPerFrame;\n var newX = x + newV * secondPerFrame;\n\n if (Math.abs(newV) < precision && Math.abs(newX - destX) < precision) {\n reusedTuple[0] = destX;\n reusedTuple[1] = 0;\n return reusedTuple;\n }\n\n reusedTuple[0] = newX;\n reusedTuple[1] = newV;\n return reusedTuple;\n}\n\nmodule.exports = exports[\"default\"]; // array reference around.","// Generated by CoffeeScript 1.7.1\n(function () {\n var getNanoSeconds, hrtime, loadTime;\n\n if (typeof performance !== \"undefined\" && performance !== null && performance.now) {\n module.exports = function () {\n return performance.now();\n };\n } else if (typeof process !== \"undefined\" && process !== null && process.hrtime) {\n module.exports = function () {\n return (getNanoSeconds() - loadTime) / 1e6;\n };\n\n hrtime = process.hrtime;\n\n getNanoSeconds = function getNanoSeconds() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n\n loadTime = getNanoSeconds();\n } else if (Date.now) {\n module.exports = function () {\n return Date.now() - loadTime;\n };\n\n loadTime = Date.now();\n } else {\n module.exports = function () {\n return new Date().getTime() - loadTime;\n };\n\n loadTime = new Date().getTime();\n }\n}).call(this);","var now = require('performance-now'),\n root = typeof window === 'undefined' ? global : window,\n vendors = ['moz', 'webkit'],\n suffix = 'AnimationFrame',\n raf = root['request' + suffix],\n caf = root['cancel' + suffix] || root['cancelRequest' + suffix];\n\nfor (var i = 0; !raf && i < vendors.length; i++) {\n raf = root[vendors[i] + 'Request' + suffix];\n caf = root[vendors[i] + 'Cancel' + suffix] || root[vendors[i] + 'CancelRequest' + suffix];\n} // Some versions of FF have rAF but not cAF\n\n\nif (!raf || !caf) {\n var last = 0,\n id = 0,\n queue = [],\n frameDuration = 1000 / 60;\n\n raf = function raf(callback) {\n if (queue.length === 0) {\n var _now = now(),\n next = Math.max(0, frameDuration - (_now - last));\n\n last = next + _now;\n setTimeout(function () {\n var cp = queue.slice(0); // Clear queue here to prevent\n // callbacks from appending listeners\n // to the current frame's queue\n\n queue.length = 0;\n\n for (var i = 0; i < cp.length; i++) {\n if (!cp[i].cancelled) {\n try {\n cp[i].callback(last);\n } catch (e) {\n setTimeout(function () {\n throw e;\n }, 0);\n }\n }\n }\n }, Math.round(next));\n }\n\n queue.push({\n handle: ++id,\n callback: callback,\n cancelled: false\n });\n return id;\n };\n\n caf = function caf(handle) {\n for (var i = 0; i < queue.length; i++) {\n if (queue[i].handle === handle) {\n queue[i].cancelled = true;\n }\n }\n };\n}\n\nmodule.exports = function (fn) {\n // Wrap in a new function to prevent\n // `cancel` potentially being assigned\n // to the native rAF function\n return raf.call(root, fn);\n};\n\nmodule.exports.cancel = function () {\n caf.apply(root, arguments);\n};\n\nmodule.exports.polyfill = function (object) {\n if (!object) {\n object = root;\n }\n\n object.requestAnimationFrame = raf;\n object.cancelAnimationFrame = caf;\n};","// usage assumption: currentStyle values have already been rendered but it says\n// nothing of whether currentStyle is stale (see unreadPropStyle)\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = shouldStopAnimation;\n\nfunction shouldStopAnimation(currentStyle, style, currentVelocity) {\n for (var key in style) {\n if (!Object.prototype.hasOwnProperty.call(style, key)) {\n continue;\n }\n\n if (currentVelocity[key] !== 0) {\n return false;\n }\n\n var styleValue = typeof style[key] === 'number' ? style[key] : style[key].val; // stepper will have already taken care of rounding precision errors, so\n // won't have such thing as 0.9999 !=== 1\n\n if (currentStyle[key] !== styleValue) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = exports['default'];","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class Permalink extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n className: PropTypes.string,\n href: PropTypes.string.isRequired,\n to: PropTypes.string.isRequired,\n children: PropTypes.node,\n onInterceptClick: PropTypes.func,\n };\n\n handleClick = e => {\n if (this.props.onInterceptClick && this.props.onInterceptClick()) {\n e.preventDefault();\n return;\n }\n\n if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n e.preventDefault();\n this.context.router.history.push(this.props.to);\n }\n }\n\n render () {\n const { href, children, className, onInterceptClick, ...other } = this.props;\n\n return (\n <a target='_blank' href={href} onClick={this.handleClick} {...other} className={`permalink${className ? ' ' + className : ''}`}>\n {children}\n </a>\n );\n }\n\n}\n","import punycode from 'punycode';\n\nconst IDNA_PREFIX = 'xn--';\n\nexport const decode = domain => {\n return domain\n .split('.')\n .map(part => part.indexOf(IDNA_PREFIX) === 0 ? punycode.decode(part.slice(IDNA_PREFIX.length)) : part)\n .join('.');\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst MIN_SCALE = 1;\nconst MAX_SCALE = 4;\n\nconst getMidpoint = (p1, p2) => ({\n x: (p1.clientX + p2.clientX) / 2,\n y: (p1.clientY + p2.clientY) / 2,\n});\n\nconst getDistance = (p1, p2) =>\n Math.sqrt(Math.pow(p1.clientX - p2.clientX, 2) + Math.pow(p1.clientY - p2.clientY, 2));\n\nconst clamp = (min, max, value) => Math.min(max, Math.max(min, value));\n\nexport default class ZoomableImage extends React.PureComponent {\n\n static propTypes = {\n alt: PropTypes.string,\n src: PropTypes.string.isRequired,\n width: PropTypes.number,\n height: PropTypes.number,\n onClick: PropTypes.func,\n }\n\n static defaultProps = {\n alt: '',\n width: null,\n height: null,\n };\n\n state = {\n scale: MIN_SCALE,\n }\n\n removers = [];\n container = null;\n image = null;\n lastTouchEndTime = 0;\n lastDistance = 0;\n\n componentDidMount () {\n let handler = this.handleTouchStart;\n this.container.addEventListener('touchstart', handler);\n this.removers.push(() => this.container.removeEventListener('touchstart', handler));\n handler = this.handleTouchMove;\n // on Chrome 56+, touch event listeners will default to passive\n // https://www.chromestatus.com/features/5093566007214080\n this.container.addEventListener('touchmove', handler, { passive: false });\n this.removers.push(() => this.container.removeEventListener('touchend', handler));\n }\n\n componentWillUnmount () {\n this.removeEventListeners();\n }\n\n removeEventListeners () {\n this.removers.forEach(listeners => listeners());\n this.removers = [];\n }\n\n handleTouchStart = e => {\n if (e.touches.length !== 2) return;\n\n this.lastDistance = getDistance(...e.touches);\n }\n\n handleTouchMove = e => {\n const { scrollTop, scrollHeight, clientHeight } = this.container;\n if (e.touches.length === 1 && scrollTop !== scrollHeight - clientHeight) {\n // prevent propagating event to MediaModal\n e.stopPropagation();\n return;\n }\n if (e.touches.length !== 2) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n const distance = getDistance(...e.touches);\n const midpoint = getMidpoint(...e.touches);\n const scale = clamp(MIN_SCALE, MAX_SCALE, this.state.scale * distance / this.lastDistance);\n\n this.zoom(scale, midpoint);\n\n this.lastMidpoint = midpoint;\n this.lastDistance = distance;\n }\n\n zoom(nextScale, midpoint) {\n const { scale } = this.state;\n const { scrollLeft, scrollTop } = this.container;\n\n // math memo:\n // x = (scrollLeft + midpoint.x) / scrollWidth\n // x' = (nextScrollLeft + midpoint.x) / nextScrollWidth\n // scrollWidth = clientWidth * scale\n // scrollWidth' = clientWidth * nextScale\n // Solve x = x' for nextScrollLeft\n const nextScrollLeft = (scrollLeft + midpoint.x) * nextScale / scale - midpoint.x;\n const nextScrollTop = (scrollTop + midpoint.y) * nextScale / scale - midpoint.y;\n\n this.setState({ scale: nextScale }, () => {\n this.container.scrollLeft = nextScrollLeft;\n this.container.scrollTop = nextScrollTop;\n });\n }\n\n handleClick = e => {\n // don't propagate event to MediaModal\n e.stopPropagation();\n const handler = this.props.onClick;\n if (handler) handler();\n }\n\n setContainerRef = c => {\n this.container = c;\n }\n\n setImageRef = c => {\n this.image = c;\n }\n\n render () {\n const { alt, src } = this.props;\n const { scale } = this.state;\n const overflow = scale === 1 ? 'hidden' : 'scroll';\n\n return (\n <div\n className='zoomable-image'\n ref={this.setContainerRef}\n style={{ overflow }}\n >\n <img\n role='presentation'\n ref={this.setImageRef}\n alt={alt}\n title={alt}\n src={src}\n style={{\n transform: `scale(${scale})`,\n transformOrigin: '0 0',\n }}\n onClick={this.handleClick}\n />\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { LoadingBar } from 'react-redux-loading-bar';\nimport ZoomableImage from './zoomable_image';\n\nexport default class ImageLoader extends React.PureComponent {\n\n static propTypes = {\n alt: PropTypes.string,\n src: PropTypes.string.isRequired,\n previewSrc: PropTypes.string,\n width: PropTypes.number,\n height: PropTypes.number,\n onClick: PropTypes.func,\n }\n\n static defaultProps = {\n alt: '',\n width: null,\n height: null,\n };\n\n state = {\n loading: true,\n error: false,\n width: null,\n }\n\n removers = [];\n canvas = null;\n\n get canvasContext() {\n if (!this.canvas) {\n return null;\n }\n this._canvasContext = this._canvasContext || this.canvas.getContext('2d');\n return this._canvasContext;\n }\n\n componentDidMount () {\n this.loadImage(this.props);\n }\n\n componentWillReceiveProps (nextProps) {\n if (this.props.src !== nextProps.src) {\n this.loadImage(nextProps);\n }\n }\n\n componentWillUnmount () {\n this.removeEventListeners();\n }\n\n loadImage (props) {\n this.removeEventListeners();\n this.setState({ loading: true, error: false });\n Promise.all([\n props.previewSrc && this.loadPreviewCanvas(props),\n this.hasSize() && this.loadOriginalImage(props),\n ].filter(Boolean))\n .then(() => {\n this.setState({ loading: false, error: false });\n this.clearPreviewCanvas();\n })\n .catch(() => this.setState({ loading: false, error: true }));\n }\n\n loadPreviewCanvas = ({ previewSrc, width, height }) => new Promise((resolve, reject) => {\n const image = new Image();\n const removeEventListeners = () => {\n image.removeEventListener('error', handleError);\n image.removeEventListener('load', handleLoad);\n };\n const handleError = () => {\n removeEventListeners();\n reject();\n };\n const handleLoad = () => {\n removeEventListeners();\n this.canvasContext.drawImage(image, 0, 0, width, height);\n resolve();\n };\n image.addEventListener('error', handleError);\n image.addEventListener('load', handleLoad);\n image.src = previewSrc;\n this.removers.push(removeEventListeners);\n })\n\n clearPreviewCanvas () {\n const { width, height } = this.canvas;\n this.canvasContext.clearRect(0, 0, width, height);\n }\n\n loadOriginalImage = ({ src }) => new Promise((resolve, reject) => {\n const image = new Image();\n const removeEventListeners = () => {\n image.removeEventListener('error', handleError);\n image.removeEventListener('load', handleLoad);\n };\n const handleError = () => {\n removeEventListeners();\n reject();\n };\n const handleLoad = () => {\n removeEventListeners();\n resolve();\n };\n image.addEventListener('error', handleError);\n image.addEventListener('load', handleLoad);\n image.src = src;\n this.removers.push(removeEventListeners);\n });\n\n removeEventListeners () {\n this.removers.forEach(listeners => listeners());\n this.removers = [];\n }\n\n hasSize () {\n const { width, height } = this.props;\n return typeof width === 'number' && typeof height === 'number';\n }\n\n setCanvasRef = c => {\n this.canvas = c;\n if (c) this.setState({ width: c.offsetWidth });\n }\n\n render () {\n const { alt, src, width, height, onClick } = this.props;\n const { loading } = this.state;\n\n const className = classNames('image-loader', {\n 'image-loader--loading': loading,\n 'image-loader--amorphous': !this.hasSize(),\n });\n\n return (\n <div className={className}>\n <LoadingBar loading={loading ? 1 : 0} className='loading-bar' style={{ width: this.state.width || width }} />\n {loading ? (\n <canvas\n className='image-loader__preview-canvas'\n ref={this.setCanvasRef}\n width={width}\n height={height}\n />\n ) : (\n <ZoomableImage\n alt={alt}\n src={src}\n onClick={onClick}\n />\n )}\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport ReactSwipeableViews from 'react-swipeable-views';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport Video from 'mastodon/features/video';\nimport classNames from 'classnames';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport IconButton from 'mastodon/components/icon_button';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImageLoader from './image_loader';\nimport Icon from 'mastodon/components/icon';\nimport GIFV from 'mastodon/components/gifv';\n\nconst messages = defineMessages({\n close: { id: 'lightbox.close', defaultMessage: 'Close' },\n previous: { id: 'lightbox.previous', defaultMessage: 'Previous' },\n next: { id: 'lightbox.next', defaultMessage: 'Next' },\n});\n\nexport const previewState = 'previewMediaModal';\n\nexport default @injectIntl\nclass MediaModal extends ImmutablePureComponent {\n\n static propTypes = {\n media: ImmutablePropTypes.list.isRequired,\n status: ImmutablePropTypes.map,\n index: PropTypes.number.isRequired,\n onClose: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n state = {\n index: null,\n navigationHidden: false,\n };\n\n handleSwipe = (index) => {\n this.setState({ index: index % this.props.media.size });\n }\n\n handleNextClick = () => {\n this.setState({ index: (this.getIndex() + 1) % this.props.media.size });\n }\n\n handlePrevClick = () => {\n this.setState({ index: (this.props.media.size + this.getIndex() - 1) % this.props.media.size });\n }\n\n handleChangeIndex = (e) => {\n const index = Number(e.currentTarget.getAttribute('data-index'));\n this.setState({ index: index % this.props.media.size });\n }\n\n handleKeyDown = (e) => {\n switch(e.key) {\n case 'ArrowLeft':\n this.handlePrevClick();\n e.preventDefault();\n e.stopPropagation();\n break;\n case 'ArrowRight':\n this.handleNextClick();\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n\n componentDidMount () {\n window.addEventListener('keydown', this.handleKeyDown, false);\n\n if (this.context.router) {\n const history = this.context.router.history;\n\n history.push(history.location.pathname, previewState);\n\n this.unlistenHistory = history.listen(() => {\n this.props.onClose();\n });\n }\n }\n\n componentWillUnmount () {\n window.removeEventListener('keydown', this.handleKeyDown);\n\n if (this.context.router) {\n this.unlistenHistory();\n\n if (this.context.router.history.location.state === previewState) {\n this.context.router.history.goBack();\n }\n }\n }\n\n getIndex () {\n return this.state.index !== null ? this.state.index : this.props.index;\n }\n\n toggleNavigation = () => {\n this.setState(prevState => ({\n navigationHidden: !prevState.navigationHidden,\n }));\n };\n\n handleStatusClick = e => {\n if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n e.preventDefault();\n this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);\n }\n }\n\n render () {\n const { media, status, intl, onClose } = this.props;\n const { navigationHidden } = this.state;\n\n const index = this.getIndex();\n let pagination = [];\n\n const leftNav = media.size > 1 && <button tabIndex='0' className='media-modal__nav media-modal__nav--left' onClick={this.handlePrevClick} aria-label={intl.formatMessage(messages.previous)}><Icon id='chevron-left' fixedWidth /></button>;\n const rightNav = media.size > 1 && <button tabIndex='0' className='media-modal__nav media-modal__nav--right' onClick={this.handleNextClick} aria-label={intl.formatMessage(messages.next)}><Icon id='chevron-right' fixedWidth /></button>;\n\n if (media.size > 1) {\n pagination = media.map((item, i) => {\n const classes = ['media-modal__button'];\n if (i === index) {\n classes.push('media-modal__button--active');\n }\n return (<li className='media-modal__page-dot' key={i}><button tabIndex='0' className={classes.join(' ')} onClick={this.handleChangeIndex} data-index={i}>{i + 1}</button></li>);\n });\n }\n\n const content = media.map((image) => {\n const width = image.getIn(['meta', 'original', 'width']) || null;\n const height = image.getIn(['meta', 'original', 'height']) || null;\n\n if (image.get('type') === 'image') {\n return (\n <ImageLoader\n previewSrc={image.get('preview_url')}\n src={image.get('url')}\n width={width}\n height={height}\n alt={image.get('description')}\n key={image.get('url')}\n onClick={this.toggleNavigation}\n />\n );\n } else if (image.get('type') === 'video') {\n const { time } = this.props;\n\n return (\n <Video\n preview={image.get('preview_url')}\n blurhash={image.get('blurhash')}\n src={image.get('url')}\n width={image.get('width')}\n height={image.get('height')}\n startTime={time || 0}\n onCloseVideo={onClose}\n detailed\n alt={image.get('description')}\n key={image.get('url')}\n />\n );\n } else if (image.get('type') === 'gifv') {\n return (\n <GIFV\n src={image.get('url')}\n width={width}\n height={height}\n key={image.get('preview_url')}\n alt={image.get('description')}\n onClick={this.toggleNavigation}\n />\n );\n }\n\n return null;\n }).toArray();\n\n // you can't use 100vh, because the viewport height is taller\n // than the visible part of the document in some mobile\n // browsers when it's address bar is visible.\n // https://developers.google.com/web/updates/2016/12/url-bar-resizing\n const swipeableViewsStyle = {\n width: '100%',\n height: '100%',\n };\n\n const containerStyle = {\n alignItems: 'center', // center vertically\n };\n\n const navigationClassName = classNames('media-modal__navigation', {\n 'media-modal__navigation--hidden': navigationHidden,\n });\n\n return (\n <div className='modal-root__modal media-modal'>\n <div\n className='media-modal__closer'\n role='presentation'\n onClick={onClose}\n >\n <ReactSwipeableViews\n style={swipeableViewsStyle}\n containerStyle={containerStyle}\n onChangeIndex={this.handleSwipe}\n index={index}\n >\n {content}\n </ReactSwipeableViews>\n </div>\n\n <div className={navigationClassName}>\n <IconButton className='media-modal__close' title={intl.formatMessage(messages.close)} icon='times' onClick={onClose} size={40} />\n\n {leftNav}\n {rightNav}\n\n {status && (\n <div className={classNames('media-modal__meta', { 'media-modal__meta--shifted': media.size > 1 })}>\n <a href={status.get('url')} onClick={this.handleStatusClick}><Icon id='comments' /> <FormattedMessage id='lightbox.view_context' defaultMessage='View context' /></a>\n </div>\n )}\n\n <ul className='media-modal__pagination'>\n {pagination}\n </ul>\n </div>\n </div>\n );\n }\n\n}\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","import _createClass from \"@babel/runtime/helpers/esm/createClass\";\n\n/**\n * This work is licensed under the W3C Software and Document License\n * (http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document).\n */\n// Convenience function for converting NodeLists.\n\n/** @type {typeof Array.prototype.slice} */\nvar slice = Array.prototype.slice;\n/**\n * IE has a non-standard name for \"matches\".\n * @type {typeof Element.prototype.matches}\n */\n\nvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector;\n/** @type {string} */\n\nvar _focusableElementsString = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'details', 'summary', 'iframe', 'object', 'embed', '[contenteditable]'].join(',');\n/**\n * `InertRoot` manages a single inert subtree, i.e. a DOM subtree whose root element has an `inert`\n * attribute.\n *\n * Its main functions are:\n *\n * - to create and maintain a set of managed `InertNode`s, including when mutations occur in the\n * subtree. The `makeSubtreeUnfocusable()` method handles collecting `InertNode`s via registering\n * each focusable node in the subtree with the singleton `InertManager` which manages all known\n * focusable nodes within inert subtrees. `InertManager` ensures that a single `InertNode`\n * instance exists for each focusable node which has at least one inert root as an ancestor.\n *\n * - to notify all managed `InertNode`s when this subtree stops being inert (i.e. when the `inert`\n * attribute is removed from the root node). This is handled in the destructor, which calls the\n * `deregister` method on `InertManager` for each managed inert node.\n */\n\n\nvar InertRoot = /*#__PURE__*/function () {\n /**\n * @param {!Element} rootElement The Element at the root of the inert subtree.\n * @param {!InertManager} inertManager The global singleton InertManager object.\n */\n function InertRoot(rootElement, inertManager) {\n /** @type {!InertManager} */\n this._inertManager = inertManager;\n /** @type {!Element} */\n\n this._rootElement = rootElement;\n /**\n * @type {!Set<!InertNode>}\n * All managed focusable nodes in this InertRoot's subtree.\n */\n\n this._managedNodes = new Set(); // Make the subtree hidden from assistive technology\n\n if (this._rootElement.hasAttribute('aria-hidden')) {\n /** @type {?string} */\n this._savedAriaHidden = this._rootElement.getAttribute('aria-hidden');\n } else {\n this._savedAriaHidden = null;\n }\n\n this._rootElement.setAttribute('aria-hidden', 'true'); // Make all focusable elements in the subtree unfocusable and add them to _managedNodes\n\n\n this._makeSubtreeUnfocusable(this._rootElement); // Watch for:\n // - any additions in the subtree: make them unfocusable too\n // - any removals from the subtree: remove them from this inert root's managed nodes\n // - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable\n // element, make that node a managed node.\n\n\n this._observer = new MutationObserver(this._onMutation.bind(this));\n\n this._observer.observe(this._rootElement, {\n attributes: true,\n childList: true,\n subtree: true\n });\n }\n /**\n * Call this whenever this object is about to become obsolete. This unwinds all of the state\n * stored in this object and updates the state of all of the managed nodes.\n */\n\n\n var _proto = InertRoot.prototype;\n\n _proto.destructor = function destructor() {\n this._observer.disconnect();\n\n if (this._rootElement) {\n if (this._savedAriaHidden !== null) {\n this._rootElement.setAttribute('aria-hidden', this._savedAriaHidden);\n } else {\n this._rootElement.removeAttribute('aria-hidden');\n }\n }\n\n this._managedNodes.forEach(function (inertNode) {\n this._unmanageNode(inertNode.node);\n }, this); // Note we cast the nulls to the ANY type here because:\n // 1) We want the class properties to be declared as non-null, or else we\n // need even more casts throughout this code. All bets are off if an\n // instance has been destroyed and a method is called.\n // 2) We don't want to cast \"this\", because we want type-aware optimizations\n // to know which properties we're setting.\n\n\n this._observer =\n /** @type {?} */\n null;\n this._rootElement =\n /** @type {?} */\n null;\n this._managedNodes =\n /** @type {?} */\n null;\n this._inertManager =\n /** @type {?} */\n null;\n }\n /**\n * @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set.\n */\n ;\n\n /**\n * @param {!Node} startNode\n */\n _proto._makeSubtreeUnfocusable = function _makeSubtreeUnfocusable(startNode) {\n var _this = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this._visitNode(node);\n });\n var activeElement = document.activeElement;\n\n if (!document.body.contains(startNode)) {\n // startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement.\n var node = startNode;\n /** @type {!ShadowRoot|undefined} */\n\n var root = undefined;\n\n while (node) {\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n root =\n /** @type {!ShadowRoot} */\n node;\n break;\n }\n\n node = node.parentNode;\n }\n\n if (root) {\n activeElement = root.activeElement;\n }\n }\n\n if (startNode.contains(activeElement)) {\n activeElement.blur(); // In IE11, if an element is already focused, and then set to tabindex=-1\n // calling blur() will not actually move the focus.\n // To work around this we call focus() on the body instead.\n\n if (activeElement === document.activeElement) {\n document.body.focus();\n }\n }\n }\n /**\n * @param {!Node} node\n */\n ;\n\n _proto._visitNode = function _visitNode(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n\n var element =\n /** @type {!Element} */\n node; // If a descendant inert root becomes un-inert, its descendants will still be inert because of\n // this inert root, so all of its managed nodes need to be adopted by this InertRoot.\n\n if (element !== this._rootElement && element.hasAttribute('inert')) {\n this._adoptInertRoot(element);\n }\n\n if (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) {\n this._manageNode(element);\n }\n }\n /**\n * Register the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n ;\n\n _proto._manageNode = function _manageNode(node) {\n var inertNode = this._inertManager.register(node, this);\n\n this._managedNodes.add(inertNode);\n }\n /**\n * Unregister the given node with this InertRoot and with InertManager.\n * @param {!Node} node\n */\n ;\n\n _proto._unmanageNode = function _unmanageNode(node) {\n var inertNode = this._inertManager.deregister(node, this);\n\n if (inertNode) {\n this._managedNodes.delete(inertNode);\n }\n }\n /**\n * Unregister the entire subtree starting at `startNode`.\n * @param {!Node} startNode\n */\n ;\n\n _proto._unmanageSubtree = function _unmanageSubtree(startNode) {\n var _this2 = this;\n\n composedTreeWalk(startNode, function (node) {\n return _this2._unmanageNode(node);\n });\n }\n /**\n * If a descendant node is found with an `inert` attribute, adopt its managed nodes.\n * @param {!Element} node\n */\n ;\n\n _proto._adoptInertRoot = function _adoptInertRoot(node) {\n var inertSubroot = this._inertManager.getInertRoot(node); // During initialisation this inert root may not have been registered yet,\n // so register it now if need be.\n\n\n if (!inertSubroot) {\n this._inertManager.setInert(node, true);\n\n inertSubroot = this._inertManager.getInertRoot(node);\n }\n\n inertSubroot.managedNodes.forEach(function (savedInertNode) {\n this._manageNode(savedInertNode.node);\n }, this);\n }\n /**\n * Callback used when mutation observer detects subtree additions, removals, or attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n ;\n\n _proto._onMutation = function _onMutation(records, self) {\n records.forEach(function (record) {\n var target =\n /** @type {!Element} */\n record.target;\n\n if (record.type === 'childList') {\n // Manage added nodes\n slice.call(record.addedNodes).forEach(function (node) {\n this._makeSubtreeUnfocusable(node);\n }, this); // Un-manage removed nodes\n\n slice.call(record.removedNodes).forEach(function (node) {\n this._unmanageSubtree(node);\n }, this);\n } else if (record.type === 'attributes') {\n if (record.attributeName === 'tabindex') {\n // Re-initialise inert node if tabindex changes\n this._manageNode(target);\n } else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) {\n // If a new inert root is added, adopt its managed nodes and make sure it knows about the\n // already managed nodes from this inert subroot.\n this._adoptInertRoot(target);\n\n var inertSubroot = this._inertManager.getInertRoot(target);\n\n this._managedNodes.forEach(function (managedNode) {\n if (target.contains(managedNode.node)) {\n inertSubroot._manageNode(managedNode.node);\n }\n });\n }\n }\n }, this);\n };\n\n _createClass(InertRoot, [{\n key: \"managedNodes\",\n get: function get() {\n return new Set(this._managedNodes);\n }\n /** @return {boolean} */\n\n }, {\n key: \"hasSavedAriaHidden\",\n get: function get() {\n return this._savedAriaHidden !== null;\n }\n /** @param {?string} ariaHidden */\n\n }, {\n key: \"savedAriaHidden\",\n set: function set(ariaHidden) {\n this._savedAriaHidden = ariaHidden;\n }\n /** @return {?string} */\n ,\n get: function get() {\n return this._savedAriaHidden;\n }\n }]);\n\n return InertRoot;\n}();\n/**\n * `InertNode` initialises and manages a single inert node.\n * A node is inert if it is a descendant of one or more inert root elements.\n *\n * On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and\n * either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element\n * is intrinsically focusable or not.\n *\n * `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an\n * `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the\n * `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s\n * remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists,\n * or removes the `tabindex` attribute if the element is intrinsically focusable.\n */\n\n\nvar InertNode = /*#__PURE__*/function () {\n /**\n * @param {!Node} node A focusable element to be made inert.\n * @param {!InertRoot} inertRoot The inert root element associated with this inert node.\n */\n function InertNode(node, inertRoot) {\n /** @type {!Node} */\n this._node = node;\n /** @type {boolean} */\n\n this._overrodeFocusMethod = false;\n /**\n * @type {!Set<!InertRoot>} The set of descendant inert roots.\n * If and only if this set becomes empty, this node is no longer inert.\n */\n\n this._inertRoots = new Set([inertRoot]);\n /** @type {?number} */\n\n this._savedTabIndex = null;\n /** @type {boolean} */\n\n this._destroyed = false; // Save any prior tabindex info and make this node untabbable\n\n this.ensureUntabbable();\n }\n /**\n * Call this whenever this object is about to become obsolete.\n * This makes the managed node focusable again and deletes all of the previously stored state.\n */\n\n\n var _proto2 = InertNode.prototype;\n\n _proto2.destructor = function destructor() {\n this._throwIfDestroyed();\n\n if (this._node && this._node.nodeType === Node.ELEMENT_NODE) {\n var element =\n /** @type {!Element} */\n this._node;\n\n if (this._savedTabIndex !== null) {\n element.setAttribute('tabindex', this._savedTabIndex);\n } else {\n element.removeAttribute('tabindex');\n } // Use `delete` to restore native focus method.\n\n\n if (this._overrodeFocusMethod) {\n delete element.focus;\n }\n } // See note in InertRoot.destructor for why we cast these nulls to ANY.\n\n\n this._node =\n /** @type {?} */\n null;\n this._inertRoots =\n /** @type {?} */\n null;\n this._destroyed = true;\n }\n /**\n * @type {boolean} Whether this object is obsolete because the managed node is no longer inert.\n * If the object has been destroyed, any attempt to access it will cause an exception.\n */\n ;\n\n /**\n * Throw if user tries to access destroyed InertNode.\n */\n _proto2._throwIfDestroyed = function _throwIfDestroyed() {\n if (this.destroyed) {\n throw new Error('Trying to access destroyed InertNode');\n }\n }\n /** @return {boolean} */\n ;\n\n /** Save the existing tabindex value and make the node untabbable and unfocusable */\n _proto2.ensureUntabbable = function ensureUntabbable() {\n if (this.node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n\n var element =\n /** @type {!Element} */\n this.node;\n\n if (matches.call(element, _focusableElementsString)) {\n if (\n /** @type {!HTMLElement} */\n element.tabIndex === -1 && this.hasSavedTabIndex) {\n return;\n }\n\n if (element.hasAttribute('tabindex')) {\n this._savedTabIndex =\n /** @type {!HTMLElement} */\n element.tabIndex;\n }\n\n element.setAttribute('tabindex', '-1');\n\n if (element.nodeType === Node.ELEMENT_NODE) {\n element.focus = function () {};\n\n this._overrodeFocusMethod = true;\n }\n } else if (element.hasAttribute('tabindex')) {\n this._savedTabIndex =\n /** @type {!HTMLElement} */\n element.tabIndex;\n element.removeAttribute('tabindex');\n }\n }\n /**\n * Add another inert root to this inert node's set of managing inert roots.\n * @param {!InertRoot} inertRoot\n */\n ;\n\n _proto2.addInertRoot = function addInertRoot(inertRoot) {\n this._throwIfDestroyed();\n\n this._inertRoots.add(inertRoot);\n }\n /**\n * Remove the given inert root from this inert node's set of managing inert roots.\n * If the set of managing inert roots becomes empty, this node is no longer inert,\n * so the object should be destroyed.\n * @param {!InertRoot} inertRoot\n */\n ;\n\n _proto2.removeInertRoot = function removeInertRoot(inertRoot) {\n this._throwIfDestroyed();\n\n this._inertRoots.delete(inertRoot);\n\n if (this._inertRoots.size === 0) {\n this.destructor();\n }\n };\n\n _createClass(InertNode, [{\n key: \"destroyed\",\n get: function get() {\n return (\n /** @type {!InertNode} */\n this._destroyed\n );\n }\n }, {\n key: \"hasSavedTabIndex\",\n get: function get() {\n return this._savedTabIndex !== null;\n }\n /** @return {!Node} */\n\n }, {\n key: \"node\",\n get: function get() {\n this._throwIfDestroyed();\n\n return this._node;\n }\n /** @param {?number} tabIndex */\n\n }, {\n key: \"savedTabIndex\",\n set: function set(tabIndex) {\n this._throwIfDestroyed();\n\n this._savedTabIndex = tabIndex;\n }\n /** @return {?number} */\n ,\n get: function get() {\n this._throwIfDestroyed();\n\n return this._savedTabIndex;\n }\n }]);\n\n return InertNode;\n}();\n/**\n * InertManager is a per-document singleton object which manages all inert roots and nodes.\n *\n * When an element becomes an inert root by having an `inert` attribute set and/or its `inert`\n * property set to `true`, the `setInert` method creates an `InertRoot` object for the element.\n * The `InertRoot` in turn registers itself as managing all of the element's focusable descendant\n * nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance\n * is created for each such node, via the `_managedNodes` map.\n */\n\n\nvar InertManager = /*#__PURE__*/function () {\n /**\n * @param {!Document} document\n */\n function InertManager(document) {\n if (!document) {\n throw new Error('Missing required argument; InertManager needs to wrap a document.');\n }\n /** @type {!Document} */\n\n\n this._document = document;\n /**\n * All managed nodes known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertNode>}\n */\n\n this._managedNodes = new Map();\n /**\n * All inert roots known to this InertManager. In a map to allow looking up by Node.\n * @type {!Map<!Node, !InertRoot>}\n */\n\n this._inertRoots = new Map();\n /**\n * Observer for mutations on `document.body`.\n * @type {!MutationObserver}\n */\n\n this._observer = new MutationObserver(this._watchForInert.bind(this)); // Add inert style.\n\n addInertStyle(document.head || document.body || document.documentElement); // Wait for document to be loaded.\n\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this));\n } else {\n this._onDocumentLoaded();\n }\n }\n /**\n * Set whether the given element should be an inert root or not.\n * @param {!Element} root\n * @param {boolean} inert\n */\n\n\n var _proto3 = InertManager.prototype;\n\n _proto3.setInert = function setInert(root, inert) {\n if (inert) {\n if (this._inertRoots.has(root)) {\n // element is already inert\n return;\n }\n\n var inertRoot = new InertRoot(root, this);\n root.setAttribute('inert', '');\n\n this._inertRoots.set(root, inertRoot); // If not contained in the document, it must be in a shadowRoot.\n // Ensure inert styles are added there.\n\n\n if (!this._document.body.contains(root)) {\n var parent = root.parentNode;\n\n while (parent) {\n if (parent.nodeType === 11) {\n addInertStyle(parent);\n }\n\n parent = parent.parentNode;\n }\n }\n } else {\n if (!this._inertRoots.has(root)) {\n // element is already non-inert\n return;\n }\n\n var _inertRoot = this._inertRoots.get(root);\n\n _inertRoot.destructor();\n\n this._inertRoots.delete(root);\n\n root.removeAttribute('inert');\n }\n }\n /**\n * Get the InertRoot object corresponding to the given inert root element, if any.\n * @param {!Node} element\n * @return {!InertRoot|undefined}\n */\n ;\n\n _proto3.getInertRoot = function getInertRoot(element) {\n return this._inertRoots.get(element);\n }\n /**\n * Register the given InertRoot as managing the given node.\n * In the case where the node has a previously existing inert root, this inert root will\n * be added to its set of inert roots.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {!InertNode} inertNode\n */\n ;\n\n _proto3.register = function register(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n\n if (inertNode !== undefined) {\n // node was already in an inert subtree\n inertNode.addInertRoot(inertRoot);\n } else {\n inertNode = new InertNode(node, inertRoot);\n }\n\n this._managedNodes.set(node, inertNode);\n\n return inertNode;\n }\n /**\n * De-register the given InertRoot as managing the given inert node.\n * Removes the inert root from the InertNode's set of managing inert roots, and remove the inert\n * node from the InertManager's set of managed nodes if it is destroyed.\n * If the node is not currently managed, this is essentially a no-op.\n * @param {!Node} node\n * @param {!InertRoot} inertRoot\n * @return {?InertNode} The potentially destroyed InertNode associated with this node, if any.\n */\n ;\n\n _proto3.deregister = function deregister(node, inertRoot) {\n var inertNode = this._managedNodes.get(node);\n\n if (!inertNode) {\n return null;\n }\n\n inertNode.removeInertRoot(inertRoot);\n\n if (inertNode.destroyed) {\n this._managedNodes.delete(node);\n }\n\n return inertNode;\n }\n /**\n * Callback used when document has finished loading.\n */\n ;\n\n _proto3._onDocumentLoaded = function _onDocumentLoaded() {\n // Find all inert roots in document and make them actually inert.\n var inertElements = slice.call(this._document.querySelectorAll('[inert]'));\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, this); // Comment this out to use programmatic API only.\n\n this._observer.observe(this._document.body || this._document.documentElement, {\n attributes: true,\n subtree: true,\n childList: true\n });\n }\n /**\n * Callback used when mutation observer detects attribute changes.\n * @param {!Array<!MutationRecord>} records\n * @param {!MutationObserver} self\n */\n ;\n\n _proto3._watchForInert = function _watchForInert(records, self) {\n var _this = this;\n\n records.forEach(function (record) {\n switch (record.type) {\n case 'childList':\n slice.call(record.addedNodes).forEach(function (node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n\n var inertElements = slice.call(node.querySelectorAll('[inert]'));\n\n if (matches.call(node, '[inert]')) {\n inertElements.unshift(node);\n }\n\n inertElements.forEach(function (inertElement) {\n this.setInert(inertElement, true);\n }, _this);\n }, _this);\n break;\n\n case 'attributes':\n if (record.attributeName !== 'inert') {\n return;\n }\n\n var target =\n /** @type {!Element} */\n record.target;\n var inert = target.hasAttribute('inert');\n\n _this.setInert(target, inert);\n\n break;\n }\n }, this);\n };\n\n return InertManager;\n}();\n/**\n * Recursively walk the composed tree from |node|.\n * @param {!Node} node\n * @param {(function (!Element))=} callback Callback to be called for each element traversed,\n * before descending into child nodes.\n * @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any.\n */\n\n\nfunction composedTreeWalk(node, callback, shadowRootAncestor) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n var element =\n /** @type {!Element} */\n node;\n\n if (callback) {\n callback(element);\n } // Descend into node:\n // If it has a ShadowRoot, ignore all child elements - these will be picked\n // up by the <content> or <shadow> elements. Descend straight into the\n // ShadowRoot.\n\n\n var shadowRoot =\n /** @type {!HTMLElement} */\n element.shadowRoot;\n\n if (shadowRoot) {\n composedTreeWalk(shadowRoot, callback, shadowRoot);\n return;\n } // If it is a <content> element, descend into distributed elements - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n\n\n if (element.localName == 'content') {\n var content =\n /** @type {!HTMLContentElement} */\n element; // Verifies if ShadowDom v0 is supported.\n\n var distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : [];\n\n for (var i = 0; i < distributedNodes.length; i++) {\n composedTreeWalk(distributedNodes[i], callback, shadowRootAncestor);\n }\n\n return;\n } // If it is a <slot> element, descend into assigned nodes - these\n // are elements from outside the shadow root which are rendered inside the\n // shadow DOM.\n\n\n if (element.localName == 'slot') {\n var slot =\n /** @type {!HTMLSlotElement} */\n element; // Verify if ShadowDom v1 is supported.\n\n var _distributedNodes = slot.assignedNodes ? slot.assignedNodes({\n flatten: true\n }) : [];\n\n for (var _i = 0; _i < _distributedNodes.length; _i++) {\n composedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor);\n }\n\n return;\n }\n } // If it is neither the parent of a ShadowRoot, a <content> element, a <slot>\n // element, nor a <shadow> element recurse normally.\n\n\n var child = node.firstChild;\n\n while (child != null) {\n composedTreeWalk(child, callback, shadowRootAncestor);\n child = child.nextSibling;\n }\n}\n/**\n * Adds a style element to the node containing the inert specific styles\n * @param {!Node} node\n */\n\n\nfunction addInertStyle(node) {\n if (node.querySelector('style#inert-style')) {\n return;\n }\n\n var style = document.createElement('style');\n style.setAttribute('id', 'inert-style');\n style.textContent = '\\n' + '[inert] {\\n' + ' pointer-events: none;\\n' + ' cursor: default;\\n' + '}\\n' + '\\n' + '[inert], [inert] * {\\n' + ' user-select: none;\\n' + ' -webkit-user-select: none;\\n' + ' -moz-user-select: none;\\n' + ' -ms-user-select: none;\\n' + '}\\n';\n node.appendChild(style);\n}\n/** @type {!InertManager} */\n\n\nvar inertManager = new InertManager(document);\n\nif (!Element.prototype.hasOwnProperty('inert')) {\n Object.defineProperty(Element.prototype, 'inert', {\n enumerable: true,\n\n /** @this {!Element} */\n get: function get() {\n return this.hasAttribute('inert');\n },\n\n /** @this {!Element} */\n set: function set(inert) {\n inertManager.setInert(this, inert);\n }\n });\n}","module.exports = function (originalModule) {\n if (!originalModule.webpackPolyfill) {\n var module = Object.create(originalModule); // module.parent = undefined by default\n\n if (!module.children) module.children = [];\n Object.defineProperty(module, \"loaded\", {\n enumerable: true,\n get: function get() {\n return module.l;\n }\n });\n Object.defineProperty(module, \"id\", {\n enumerable: true,\n get: function get() {\n return module.i;\n }\n });\n Object.defineProperty(module, \"exports\", {\n enumerable: true\n });\n module.webpackPolyfill = 1;\n }\n\n return module;\n};","// taken from:\n// https://github.com/twitter/twemoji/blob/47732c7/twemoji-generator.js#L848-L866\nexports.unicodeToFilename = (str) => {\n let result = '';\n let charCode = 0;\n let p = 0;\n let i = 0;\n while (i < str.length) {\n charCode = str.charCodeAt(i++);\n if (p) {\n if (result.length > 0) {\n result += '-';\n }\n result += (0x10000 + ((p - 0xD800) << 10) + (charCode - 0xDC00)).toString(16);\n p = 0;\n } else if (0xD800 <= charCode && charCode <= 0xDBFF) {\n p = charCode;\n } else {\n if (result.length > 0) {\n result += '-';\n }\n result += charCode.toString(16);\n }\n }\n return result;\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar bind = require('./helpers/bind');\n\nvar Axios = require('./core/Axios');\n\nvar mergeConfig = require('./core/mergeConfig');\n\nvar defaults = require('./defaults');\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\n\n\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context); // Copy axios.prototype to instance\n\n utils.extend(instance, Axios.prototype, context); // Copy context to instance\n\n utils.extend(instance, context);\n return instance;\n} // Create the default instance to be exported\n\n\nvar axios = createInstance(defaults); // Expose Axios class to allow class inheritance\n\naxios.Axios = Axios; // Factory for creating new instances\n\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n}; // Expose Cancel & CancelToken\n\n\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel'); // Expose all/spread\n\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = require('./helpers/spread');\nmodule.exports = axios; // Allow use of default import syntax in TypeScript\n\nmodule.exports.default = axios;","'use strict';\n\nvar utils = require('./../utils');\n\nvar buildURL = require('../helpers/buildURL');\n\nvar InterceptorManager = require('./InterceptorManager');\n\nvar dispatchRequest = require('./dispatchRequest');\n\nvar mergeConfig = require('./mergeConfig');\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\n\n\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\n\n\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config); // Set config.method\n\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n } // Hook up interceptors middleware\n\n\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n}; // Provide aliases for supported request methods\n\n\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\nmodule.exports = Axios;","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n\n\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\n\n\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\n\n\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;","'use strict';\n\nvar utils = require('./../utils');\n\nvar transformData = require('./transformData');\n\nvar isCancel = require('../cancel/isCancel');\n\nvar defaults = require('../defaults');\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\n\n\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\n\n\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config); // Ensure headers exist\n\n config.headers = config.headers || {}; // Transform request data\n\n config.data = transformData(config.data, config.headers, config.transformRequest); // Flatten headers\n\n config.headers = utils.merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers);\n utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) {\n delete config.headers[method];\n });\n var adapter = config.adapter || defaults.adapter;\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config); // Transform response data\n\n response.data = transformData(response.data, response.headers, config.transformResponse);\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config); // Transform response data\n\n if (reason && reason.response) {\n reason.response.data = transformData(reason.response.data, reason.response.headers, config.transformResponse);\n }\n }\n\n return Promise.reject(reason);\n });\n};","'use strict';\n\nvar utils = require('./../utils');\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\n\n\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n return data;\n};","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};","'use strict';\n\nvar createError = require('./createError');\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\n\n\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n\n if (!validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError('Request failed with status code ' + response.status, response.config, null, response.request, response));\n }\n};","'use strict';\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\n\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function () {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n\n return error;\n};","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\n\nvar combineURLs = require('../helpers/combineURLs');\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\n\n\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n\n return requestedURL;\n};","'use strict';\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\n\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};","'use strict';\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\n\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '') : baseURL;\n};","'use strict';\n\nvar utils = require('./../utils'); // Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\n\n\nvar ignoreDuplicateOf = ['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent'];\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\n\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) {\n return parsed;\n }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n return parsed;\n};","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = utils.isStandardBrowserEnv() ? // Standard browser envs have full support of the APIs needed to test\n// whether the request URL is of the same origin as current location.\nfunction standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href); // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n\n return function isURLSameOrigin(requestURL) {\n var parsed = utils.isString(requestURL) ? resolveURL(requestURL) : requestURL;\n return parsed.protocol === originURL.protocol && parsed.host === originURL.host;\n };\n}() : // Non standard browser envs (web workers, react-native) lack needed support.\nfunction nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n}();","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nexports['default'] = spring;\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n 'default': obj\n };\n}\n\nvar _presets = require('./presets');\n\nvar _presets2 = _interopRequireDefault(_presets);\n\nvar defaultConfig = _extends({}, _presets2['default'].noWobble, {\n precision: 0.01\n});\n\nfunction spring(val, config) {\n return _extends({}, defaultConfig, config, {\n val: val\n });\n}\n\nmodule.exports = exports['default'];","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = utils.isStandardBrowserEnv() ? // Standard browser envs support document.cookie\nfunction standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return match ? decodeURIComponent(match[3]) : null;\n },\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n}() : // Non standard browser env (web workers, react-native) lack needed support.\nfunction nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() {\n return null;\n },\n remove: function remove() {}\n };\n}();","'use strict';\n\nvar Cancel = require('./Cancel');\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\n\n\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\n\n\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n\n\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;","'use strict';\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\n\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};","var root = require('./_root');\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n\n\nvar now = function now() {\n return root.Date.now();\n};\n\nmodule.exports = now;","var isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n/** Used as references for various `Number` constants. */\n\n\nvar NAN = 0 / 0;\n/** Used to match leading and trailing whitespace. */\n\nvar reTrim = /^\\s+|\\s+$/g;\n/** Used to detect bad signed hexadecimal string values. */\n\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n/** Used to detect binary string values. */\n\nvar reIsBinary = /^0b[01]+$/i;\n/** Used to detect octal string values. */\n\nvar reIsOctal = /^0o[0-7]+$/i;\n/** Built-in method references without a dependency on `root`. */\n\nvar freeParseInt = parseInt;\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n\n if (isSymbol(value)) {\n return NAN;\n }\n\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? other + '' : other;\n }\n\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;\n}\n\nmodule.exports = toNumber;","var Symbol = require('./_Symbol');\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/** Used to check objects for own properties. */\n\nvar hasOwnProperty = objectProto.hasOwnProperty;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar nativeObjectToString = objectProto.toString;\n/** Built-in value references. */\n\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n\n return result;\n}\n\nmodule.exports = getRawTag;","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar nativeObjectToString = objectProto.toString;\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction componentWillMount() {\n // Call this.constructor.gDSFP to support sub-classes.\n var state = this.constructor.getDerivedStateFromProps(this.props, this.state);\n\n if (state !== null && state !== undefined) {\n this.setState(state);\n }\n}\n\nfunction componentWillReceiveProps(nextProps) {\n // Call this.constructor.gDSFP to support sub-classes.\n // Use the setState() updater to ensure state isn't stale in certain edge cases.\n function updater(prevState) {\n var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);\n return state !== null && state !== undefined ? state : null;\n } // Binding \"this\" is important for shallow renderer support.\n\n\n this.setState(updater.bind(this));\n}\n\nfunction componentWillUpdate(nextProps, nextState) {\n try {\n var prevProps = this.props;\n var prevState = this.state;\n this.props = nextProps;\n this.state = nextState;\n this.__reactInternalSnapshotFlag = true;\n this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState);\n } finally {\n this.props = prevProps;\n this.state = prevState;\n }\n} // React may warn about cWM/cWRP/cWU methods being deprecated.\n// Add a flag to suppress these warnings for this special case.\n\n\ncomponentWillMount.__suppressDeprecationWarning = true;\ncomponentWillReceiveProps.__suppressDeprecationWarning = true;\ncomponentWillUpdate.__suppressDeprecationWarning = true;\n\nfunction polyfill(Component) {\n var prototype = Component.prototype;\n\n if (!prototype || !prototype.isReactComponent) {\n throw new Error('Can only polyfill class components');\n }\n\n if (typeof Component.getDerivedStateFromProps !== 'function' && typeof prototype.getSnapshotBeforeUpdate !== 'function') {\n return Component;\n } // If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n // Error if any of these lifecycles are present,\n // Because they would work differently between older and newer (16.3+) versions of React.\n\n\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n\n if (typeof prototype.componentWillMount === 'function') {\n foundWillMountName = 'componentWillMount';\n } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n\n if (typeof prototype.componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n\n if (typeof prototype.componentWillUpdate === 'function') {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n\n if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n var componentName = Component.displayName || Component.name;\n var newApiName = typeof Component.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n throw Error('Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' + componentName + ' uses ' + newApiName + ' but also contains the following legacy lifecycles:' + (foundWillMountName !== null ? '\\n ' + foundWillMountName : '') + (foundWillReceivePropsName !== null ? '\\n ' + foundWillReceivePropsName : '') + (foundWillUpdateName !== null ? '\\n ' + foundWillUpdateName : '') + '\\n\\nThe above lifecycles should be removed. Learn more about this warning here:\\n' + 'https://fb.me/react-async-component-lifecycle-hooks');\n } // React <= 16.2 does not support static getDerivedStateFromProps.\n // As a workaround, use cWM and cWRP to invoke the new static lifecycle.\n // Newer versions of React will ignore these lifecycles if gDSFP exists.\n\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n prototype.componentWillMount = componentWillMount;\n prototype.componentWillReceiveProps = componentWillReceiveProps;\n } // React <= 16.2 does not support getSnapshotBeforeUpdate.\n // As a workaround, use cWU to invoke the new lifecycle.\n // Newer versions of React will ignore that lifecycle if gSBU exists.\n\n\n if (typeof prototype.getSnapshotBeforeUpdate === 'function') {\n if (typeof prototype.componentDidUpdate !== 'function') {\n throw new Error('Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype');\n }\n\n prototype.componentWillUpdate = componentWillUpdate;\n var componentDidUpdate = prototype.componentDidUpdate;\n\n prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) {\n // 16.3+ will not execute our will-update method;\n // It will pass a snapshot value to did-update though.\n // Older versions will require our polyfilled will-update value.\n // We need to handle both cases, but can't just check for the presence of \"maybeSnapshot\",\n // Because for <= 15.x versions this might be a \"prevContext\" object.\n // We also can't just check \"__reactInternalSnapshot\",\n // Because get-snapshot might return a falsy value.\n // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.\n var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot;\n componentDidUpdate.call(this, prevProps, prevState, snapshot);\n };\n }\n\n return Component;\n}\n\nexport { polyfill };","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n\nexports.default = loadingBarMiddleware;\n\nvar _loading_bar_ducks = require('./loading_bar_ducks');\n\nvar defaultTypeSuffixes = ['PENDING', 'FULFILLED', 'REJECTED'];\n\nfunction loadingBarMiddleware() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var promiseTypeSuffixes = config.promiseTypeSuffixes || defaultTypeSuffixes;\n var scope = config.scope || _loading_bar_ducks.DEFAULT_SCOPE;\n return function (_ref) {\n var dispatch = _ref.dispatch;\n return function (next) {\n return function (action) {\n if (action.type) {\n var _promiseTypeSuffixes = _slicedToArray(promiseTypeSuffixes, 3),\n PENDING = _promiseTypeSuffixes[0],\n FULFILLED = _promiseTypeSuffixes[1],\n REJECTED = _promiseTypeSuffixes[2];\n\n var isPending = new RegExp(PENDING + '$', 'g');\n var isFulfilled = new RegExp(FULFILLED + '$', 'g');\n var isRejected = new RegExp(REJECTED + '$', 'g');\n var actionScope = action.meta && action.meta.scope || action.scope || scope;\n\n if (action.type.match(isPending)) {\n dispatch((0, _loading_bar_ducks.showLoading)(actionScope));\n } else if (action.type.match(isFulfilled) || action.type.match(isRejected)) {\n dispatch((0, _loading_bar_ducks.hideLoading)(actionScope));\n }\n }\n\n return next(action);\n };\n };\n };\n}","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _reactRedux = require('react-redux');\n\nvar _loading_bar = require('./loading_bar');\n\nvar _loading_bar_ducks = require('./loading_bar_ducks');\n\nvar mapImmutableStateToProps = function mapImmutableStateToProps(state, ownProps) {\n return {\n loading: state.get('loadingBar')[ownProps.scope || _loading_bar_ducks.DEFAULT_SCOPE]\n };\n};\n\nexports.default = (0, _reactRedux.connect)(mapImmutableStateToProps)(_loading_bar.LoadingBar);","// Generated by CoffeeScript 1.12.2\n(function () {\n var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;\n\n if (typeof performance !== \"undefined\" && performance !== null && performance.now) {\n module.exports = function () {\n return performance.now();\n };\n } else if (typeof process !== \"undefined\" && process !== null && process.hrtime) {\n module.exports = function () {\n return (getNanoSeconds() - nodeLoadTime) / 1e6;\n };\n\n hrtime = process.hrtime;\n\n getNanoSeconds = function getNanoSeconds() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n\n moduleLoadTime = getNanoSeconds();\n upTime = process.uptime() * 1e9;\n nodeLoadTime = moduleLoadTime - upTime;\n } else if (Date.now) {\n module.exports = function () {\n return Date.now() - loadTime;\n };\n\n loadTime = Date.now();\n } else {\n module.exports = function () {\n return new Date().getTime() - loadTime;\n };\n\n loadTime = new Date().getTime();\n }\n}).call(this);","\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = {\n noWobble: {\n stiffness: 170,\n damping: 26\n },\n // the default, if nothing provided\n gentle: {\n stiffness: 120,\n damping: 14\n },\n wobbly: {\n stiffness: 180,\n damping: 12\n },\n stiff: {\n stiffness: 210,\n damping: 20\n }\n};\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar base83_1 = require(\"./base83\");\n\nvar utils_1 = require(\"./utils\");\n\nvar error_1 = require(\"./error\");\n/**\n * Returns an error message if invalid or undefined if valid\n * @param blurhash\n */\n\n\nvar validateBlurhash = function validateBlurhash(blurhash) {\n if (!blurhash || blurhash.length < 6) {\n throw new error_1.ValidationError(\"The blurhash string must be at least 6 characters\");\n }\n\n var sizeFlag = base83_1.decode83(blurhash[0]);\n var numY = Math.floor(sizeFlag / 9) + 1;\n var numX = sizeFlag % 9 + 1;\n\n if (blurhash.length !== 4 + 2 * numX * numY) {\n throw new error_1.ValidationError(\"blurhash length mismatch: length is \" + blurhash.length + \" but it should be \" + (4 + 2 * numX * numY));\n }\n};\n\nexports.isBlurhashValid = function (blurhash) {\n try {\n validateBlurhash(blurhash);\n } catch (error) {\n return {\n result: false,\n errorReason: error.message\n };\n }\n\n return {\n result: true\n };\n};\n\nvar decodeDC = function decodeDC(value) {\n var intR = value >> 16;\n var intG = value >> 8 & 255;\n var intB = value & 255;\n return [utils_1.sRGBToLinear(intR), utils_1.sRGBToLinear(intG), utils_1.sRGBToLinear(intB)];\n};\n\nvar decodeAC = function decodeAC(value, maximumValue) {\n var quantR = Math.floor(value / (19 * 19));\n var quantG = Math.floor(value / 19) % 19;\n var quantB = value % 19;\n var rgb = [utils_1.signPow((quantR - 9) / 9, 2.0) * maximumValue, utils_1.signPow((quantG - 9) / 9, 2.0) * maximumValue, utils_1.signPow((quantB - 9) / 9, 2.0) * maximumValue];\n return rgb;\n};\n\nvar decode = function decode(blurhash, width, height, punch) {\n validateBlurhash(blurhash);\n punch = punch | 1;\n var sizeFlag = base83_1.decode83(blurhash[0]);\n var numY = Math.floor(sizeFlag / 9) + 1;\n var numX = sizeFlag % 9 + 1;\n var quantisedMaximumValue = base83_1.decode83(blurhash[1]);\n var maximumValue = (quantisedMaximumValue + 1) / 166;\n var colors = new Array(numX * numY);\n\n for (var i = 0; i < colors.length; i++) {\n if (i === 0) {\n var value = base83_1.decode83(blurhash.substring(2, 6));\n colors[i] = decodeDC(value);\n } else {\n var value = base83_1.decode83(blurhash.substring(4 + i * 2, 6 + i * 2));\n colors[i] = decodeAC(value, maximumValue * punch);\n }\n }\n\n var bytesPerRow = width * 4;\n var pixels = new Uint8ClampedArray(bytesPerRow * height);\n\n for (var y = 0; y < height; y++) {\n for (var x = 0; x < width; x++) {\n var r = 0;\n var g = 0;\n var b = 0;\n\n for (var j = 0; j < numY; j++) {\n for (var i = 0; i < numX; i++) {\n var basis = Math.cos(Math.PI * x * i / width) * Math.cos(Math.PI * y * j / height);\n var color = colors[i + j * numX];\n r += color[0] * basis;\n g += color[1] * basis;\n b += color[2] * basis;\n }\n }\n\n var intR = utils_1.linearTosRGB(r);\n var intG = utils_1.linearTosRGB(g);\n var intB = utils_1.linearTosRGB(b);\n pixels[4 * x + 0 + y * bytesPerRow] = intR;\n pixels[4 * x + 1 + y * bytesPerRow] = intG;\n pixels[4 * x + 2 + y * bytesPerRow] = intB;\n pixels[4 * x + 3 + y * bytesPerRow] = 255; // alpha\n }\n }\n\n return pixels;\n};\n\nexports.default = decode;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar base83_1 = require(\"./base83\");\n\nvar utils_1 = require(\"./utils\");\n\nvar error_1 = require(\"./error\");\n\nvar bytesPerPixel = 4;\n\nvar multiplyBasisFunction = function multiplyBasisFunction(pixels, width, height, basisFunction) {\n var r = 0;\n var g = 0;\n var b = 0;\n var bytesPerRow = width * bytesPerPixel;\n\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++) {\n var basis = basisFunction(x, y);\n r += basis * utils_1.sRGBToLinear(pixels[bytesPerPixel * x + 0 + y * bytesPerRow]);\n g += basis * utils_1.sRGBToLinear(pixels[bytesPerPixel * x + 1 + y * bytesPerRow]);\n b += basis * utils_1.sRGBToLinear(pixels[bytesPerPixel * x + 2 + y * bytesPerRow]);\n }\n }\n\n var scale = 1 / (width * height);\n return [r * scale, g * scale, b * scale];\n};\n\nvar encodeDC = function encodeDC(value) {\n var roundedR = utils_1.linearTosRGB(value[0]);\n var roundedG = utils_1.linearTosRGB(value[1]);\n var roundedB = utils_1.linearTosRGB(value[2]);\n return (roundedR << 16) + (roundedG << 8) + roundedB;\n};\n\nvar encodeAC = function encodeAC(value, maximumValue) {\n var quantR = Math.floor(Math.max(0, Math.min(18, Math.floor(utils_1.signPow(value[0] / maximumValue, 0.5) * 9 + 9.5))));\n var quantG = Math.floor(Math.max(0, Math.min(18, Math.floor(utils_1.signPow(value[1] / maximumValue, 0.5) * 9 + 9.5))));\n var quantB = Math.floor(Math.max(0, Math.min(18, Math.floor(utils_1.signPow(value[2] / maximumValue, 0.5) * 9 + 9.5))));\n return quantR * 19 * 19 + quantG * 19 + quantB;\n};\n\nvar encode = function encode(pixels, width, height, componentX, componentY) {\n if (componentX < 1 || componentX > 9 || componentY < 1 || componentY > 9) {\n throw new error_1.ValidationError(\"BlurHash must have between 1 and 9 components\");\n }\n\n if (width * height * 4 !== pixels.length) {\n throw new error_1.ValidationError(\"Width and height must match the pixels array\");\n }\n\n var factors = [];\n\n var _loop_1 = function _loop_1(y) {\n var _loop_2 = function _loop_2(x) {\n var normalisation = x == 0 && y == 0 ? 1 : 2;\n var factor = multiplyBasisFunction(pixels, width, height, function (i, j) {\n return normalisation * Math.cos(Math.PI * x * i / width) * Math.cos(Math.PI * y * j / height);\n });\n factors.push(factor);\n };\n\n for (var x = 0; x < componentX; x++) {\n _loop_2(x);\n }\n };\n\n for (var y = 0; y < componentY; y++) {\n _loop_1(y);\n }\n\n var dc = factors[0];\n var ac = factors.slice(1);\n var hash = \"\";\n var sizeFlag = componentX - 1 + (componentY - 1) * 9;\n hash += base83_1.encode83(sizeFlag, 1);\n var maximumValue;\n\n if (ac.length > 0) {\n var actualMaximumValue = Math.max.apply(Math, ac.map(function (val) {\n return Math.max.apply(Math, val);\n }));\n var quantisedMaximumValue = Math.floor(Math.max(0, Math.min(82, Math.floor(actualMaximumValue * 166 - 0.5))));\n maximumValue = (quantisedMaximumValue + 1) / 166;\n hash += base83_1.encode83(quantisedMaximumValue, 1);\n } else {\n maximumValue = 1;\n hash += base83_1.encode83(0, 1);\n }\n\n hash += base83_1.encode83(encodeDC(dc), 4);\n ac.forEach(function (factor) {\n hash += base83_1.encode83(encodeAC(factor, maximumValue), 2);\n });\n return hash;\n};\n\nexports.default = encode;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getDomTreeShapes = getDomTreeShapes;\nexports.findNativeHandler = findNativeHandler;\nexports.default = void 0;\n\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\n\nvar _objectWithoutProperties2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutProperties\"));\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\nvar _possibleConstructorReturn2 = _interopRequireDefault(require(\"@babel/runtime/helpers/possibleConstructorReturn\"));\n\nvar _getPrototypeOf2 = _interopRequireDefault(require(\"@babel/runtime/helpers/getPrototypeOf\"));\n\nvar _inherits2 = _interopRequireDefault(require(\"@babel/runtime/helpers/inherits\"));\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _warning = _interopRequireDefault(require(\"warning\"));\n\nvar _reactSwipeableViewsCore = require(\"react-swipeable-views-core\");\n\nfunction addEventListener(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return {\n remove: function remove() {\n node.removeEventListener(event, handler, options);\n }\n };\n}\n\nvar styles = {\n container: {\n direction: 'ltr',\n display: 'flex',\n willChange: 'transform'\n },\n slide: {\n width: '100%',\n WebkitFlexShrink: 0,\n flexShrink: 0,\n overflow: 'auto'\n }\n};\nvar axisProperties = {\n root: {\n x: {\n overflowX: 'hidden'\n },\n 'x-reverse': {\n overflowX: 'hidden'\n },\n y: {\n overflowY: 'hidden'\n },\n 'y-reverse': {\n overflowY: 'hidden'\n }\n },\n flexDirection: {\n x: 'row',\n 'x-reverse': 'row-reverse',\n y: 'column',\n 'y-reverse': 'column-reverse'\n },\n transform: {\n x: function x(translate) {\n return \"translate(\".concat(-translate, \"%, 0)\");\n },\n 'x-reverse': function xReverse(translate) {\n return \"translate(\".concat(translate, \"%, 0)\");\n },\n y: function y(translate) {\n return \"translate(0, \".concat(-translate, \"%)\");\n },\n 'y-reverse': function yReverse(translate) {\n return \"translate(0, \".concat(translate, \"%)\");\n }\n },\n length: {\n x: 'width',\n 'x-reverse': 'width',\n y: 'height',\n 'y-reverse': 'height'\n },\n rotationMatrix: {\n x: {\n x: [1, 0],\n y: [0, 1]\n },\n 'x-reverse': {\n x: [-1, 0],\n y: [0, 1]\n },\n y: {\n x: [0, 1],\n y: [1, 0]\n },\n 'y-reverse': {\n x: [0, -1],\n y: [1, 0]\n }\n },\n scrollPosition: {\n x: 'scrollLeft',\n 'x-reverse': 'scrollLeft',\n y: 'scrollTop',\n 'y-reverse': 'scrollTop'\n },\n scrollLength: {\n x: 'scrollWidth',\n 'x-reverse': 'scrollWidth',\n y: 'scrollHeight',\n 'y-reverse': 'scrollHeight'\n },\n clientLength: {\n x: 'clientWidth',\n 'x-reverse': 'clientWidth',\n y: 'clientHeight',\n 'y-reverse': 'clientHeight'\n }\n};\n\nfunction createTransition(property, options) {\n var duration = options.duration,\n easeFunction = options.easeFunction,\n delay = options.delay;\n return \"\".concat(property, \" \").concat(duration, \" \").concat(easeFunction, \" \").concat(delay);\n} // We are using a 2x2 rotation matrix.\n\n\nfunction applyRotationMatrix(touch, axis) {\n var rotationMatrix = axisProperties.rotationMatrix[axis];\n return {\n pageX: rotationMatrix.x[0] * touch.pageX + rotationMatrix.x[1] * touch.pageY,\n pageY: rotationMatrix.y[0] * touch.pageX + rotationMatrix.y[1] * touch.pageY\n };\n}\n\nfunction adaptMouse(event) {\n event.touches = [{\n pageX: event.pageX,\n pageY: event.pageY\n }];\n return event;\n}\n\nfunction getDomTreeShapes(element, rootNode) {\n var domTreeShapes = [];\n\n while (element && element !== rootNode) {\n // We reach a Swipeable View, no need to look higher in the dom tree.\n if (element.hasAttribute('data-swipeable')) {\n break;\n }\n\n var style = window.getComputedStyle(element);\n\n if ( // Ignore the scroll children if the element is absolute positioned.\n style.getPropertyValue('position') === 'absolute' || // Ignore the scroll children if the element has an overflowX hidden\n style.getPropertyValue('overflow-x') === 'hidden') {\n domTreeShapes = [];\n } else if (element.clientWidth > 0 && element.scrollWidth > element.clientWidth || element.clientHeight > 0 && element.scrollHeight > element.clientHeight) {\n // Ignore the nodes that have no width.\n // Keep elements with a scroll\n domTreeShapes.push({\n element: element,\n scrollWidth: element.scrollWidth,\n scrollHeight: element.scrollHeight,\n clientWidth: element.clientWidth,\n clientHeight: element.clientHeight,\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n });\n }\n\n element = element.parentNode;\n }\n\n return domTreeShapes;\n} // We can only have one node at the time claiming ownership for handling the swipe.\n// Otherwise, the UX would be confusing.\n// That's why we use a singleton here.\n\n\nvar nodeWhoClaimedTheScroll = null;\n\nfunction findNativeHandler(params) {\n var domTreeShapes = params.domTreeShapes,\n pageX = params.pageX,\n startX = params.startX,\n axis = params.axis;\n return domTreeShapes.some(function (shape) {\n // Determine if we are going backward or forward.\n var goingForward = pageX >= startX;\n\n if (axis === 'x' || axis === 'y') {\n goingForward = !goingForward;\n }\n\n var scrollPosition = shape[axisProperties.scrollPosition[axis]];\n var areNotAtStart = scrollPosition > 0;\n var areNotAtEnd = scrollPosition + shape[axisProperties.clientLength[axis]] < shape[axisProperties.scrollLength[axis]];\n\n if (goingForward && areNotAtEnd || !goingForward && areNotAtStart) {\n nodeWhoClaimedTheScroll = shape.element;\n return true;\n }\n\n return false;\n });\n}\n\nvar SwipeableViews = /*#__PURE__*/function (_React$Component) {\n (0, _inherits2.default)(SwipeableViews, _React$Component);\n\n function SwipeableViews(props) {\n var _this;\n\n (0, _classCallCheck2.default)(this, SwipeableViews);\n _this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(SwipeableViews).call(this, props));\n _this.rootNode = null;\n _this.containerNode = null;\n _this.ignoreNextScrollEvents = false;\n _this.viewLength = 0;\n _this.startX = 0;\n _this.lastX = 0;\n _this.vx = 0;\n _this.startY = 0;\n _this.isSwiping = undefined;\n _this.started = false;\n _this.startIndex = 0;\n _this.transitionListener = null;\n _this.touchMoveListener = null;\n _this.activeSlide = null;\n _this.indexCurrent = null;\n _this.firstRenderTimeout = null;\n\n _this.setRootNode = function (node) {\n _this.rootNode = node;\n };\n\n _this.setContainerNode = function (node) {\n _this.containerNode = node;\n };\n\n _this.setActiveSlide = function (node) {\n _this.activeSlide = node;\n\n _this.updateHeight();\n };\n\n _this.handleSwipeStart = function (event) {\n var axis = _this.props.axis;\n var touch = applyRotationMatrix(event.touches[0], axis);\n _this.viewLength = _this.rootNode.getBoundingClientRect()[axisProperties.length[axis]];\n _this.startX = touch.pageX;\n _this.lastX = touch.pageX;\n _this.vx = 0;\n _this.startY = touch.pageY;\n _this.isSwiping = undefined;\n _this.started = true;\n var computedStyle = window.getComputedStyle(_this.containerNode);\n var transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n\n if (transform && transform !== 'none') {\n var transformValues = transform.split('(')[1].split(')')[0].split(',');\n var rootStyle = window.getComputedStyle(_this.rootNode);\n var tranformNormalized = applyRotationMatrix({\n pageX: parseInt(transformValues[4], 10),\n pageY: parseInt(transformValues[5], 10)\n }, axis);\n _this.startIndex = -tranformNormalized.pageX / (_this.viewLength - parseInt(rootStyle.paddingLeft, 10) - parseInt(rootStyle.paddingRight, 10)) || 0;\n }\n };\n\n _this.handleSwipeMove = function (event) {\n // The touch start event can be cancel.\n // Makes sure we set a starting point.\n if (!_this.started) {\n _this.handleTouchStart(event);\n\n return;\n } // We are not supposed to hanlde this touch move.\n\n\n if (nodeWhoClaimedTheScroll !== null && nodeWhoClaimedTheScroll !== _this.rootNode) {\n return;\n }\n\n var _this$props = _this.props,\n axis = _this$props.axis,\n children = _this$props.children,\n ignoreNativeScroll = _this$props.ignoreNativeScroll,\n onSwitching = _this$props.onSwitching,\n resistance = _this$props.resistance;\n var touch = applyRotationMatrix(event.touches[0], axis); // We don't know yet.\n\n if (_this.isSwiping === undefined) {\n var dx = Math.abs(touch.pageX - _this.startX);\n var dy = Math.abs(touch.pageY - _this.startY);\n var isSwiping = dx > dy && dx > _reactSwipeableViewsCore.constant.UNCERTAINTY_THRESHOLD; // We let the parent handle the scroll.\n\n if (!resistance && (axis === 'y' || axis === 'y-reverse') && (_this.indexCurrent === 0 && _this.startX < touch.pageX || _this.indexCurrent === _react.default.Children.count(_this.props.children) - 1 && _this.startX > touch.pageX)) {\n _this.isSwiping = false;\n return;\n } // We are likely to be swiping, let's prevent the scroll event.\n\n\n if (dx > dy) {\n event.preventDefault();\n }\n\n if (isSwiping === true || dy > _reactSwipeableViewsCore.constant.UNCERTAINTY_THRESHOLD) {\n _this.isSwiping = isSwiping;\n _this.startX = touch.pageX; // Shift the starting point.\n\n return; // Let's wait the next touch event to move something.\n }\n }\n\n if (_this.isSwiping !== true) {\n return;\n } // We are swiping, let's prevent the scroll event.\n\n\n event.preventDefault(); // Low Pass filter.\n\n _this.vx = _this.vx * 0.5 + (touch.pageX - _this.lastX) * 0.5;\n _this.lastX = touch.pageX;\n\n var _computeIndex = (0, _reactSwipeableViewsCore.computeIndex)({\n children: children,\n resistance: resistance,\n pageX: touch.pageX,\n startIndex: _this.startIndex,\n startX: _this.startX,\n viewLength: _this.viewLength\n }),\n index = _computeIndex.index,\n startX = _computeIndex.startX; // Add support for native scroll elements.\n\n\n if (nodeWhoClaimedTheScroll === null && !ignoreNativeScroll) {\n var domTreeShapes = getDomTreeShapes(event.target, _this.rootNode);\n var hasFoundNativeHandler = findNativeHandler({\n domTreeShapes: domTreeShapes,\n startX: _this.startX,\n pageX: touch.pageX,\n axis: axis\n }); // We abort the touch move handler.\n\n if (hasFoundNativeHandler) {\n return;\n }\n } // We are moving toward the edges.\n\n\n if (startX) {\n _this.startX = startX;\n } else if (nodeWhoClaimedTheScroll === null) {\n nodeWhoClaimedTheScroll = _this.rootNode;\n }\n\n _this.setIndexCurrent(index);\n\n var callback = function callback() {\n if (onSwitching) {\n onSwitching(index, 'move');\n }\n };\n\n if (_this.state.displaySameSlide || !_this.state.isDragging) {\n _this.setState({\n displaySameSlide: false,\n isDragging: true\n }, callback);\n }\n\n callback();\n };\n\n _this.handleSwipeEnd = function () {\n nodeWhoClaimedTheScroll = null; // The touch start event can be cancel.\n // Makes sure that a starting point is set.\n\n if (!_this.started) {\n return;\n }\n\n _this.started = false;\n\n if (_this.isSwiping !== true) {\n return;\n }\n\n var indexLatest = _this.state.indexLatest;\n var indexCurrent = _this.indexCurrent;\n var delta = indexLatest - indexCurrent;\n var indexNew; // Quick movement\n\n if (Math.abs(_this.vx) > _this.props.threshold) {\n if (_this.vx > 0) {\n indexNew = Math.floor(indexCurrent);\n } else {\n indexNew = Math.ceil(indexCurrent);\n }\n } else if (Math.abs(delta) > _this.props.hysteresis) {\n // Some hysteresis with indexLatest.\n indexNew = delta > 0 ? Math.floor(indexCurrent) : Math.ceil(indexCurrent);\n } else {\n indexNew = indexLatest;\n }\n\n var indexMax = _react.default.Children.count(_this.props.children) - 1;\n\n if (indexNew < 0) {\n indexNew = 0;\n } else if (indexNew > indexMax) {\n indexNew = indexMax;\n }\n\n _this.setIndexCurrent(indexNew);\n\n _this.setState({\n indexLatest: indexNew,\n isDragging: false\n }, function () {\n if (_this.props.onSwitching) {\n _this.props.onSwitching(indexNew, 'end');\n }\n\n if (_this.props.onChangeIndex && indexNew !== indexLatest) {\n _this.props.onChangeIndex(indexNew, indexLatest, {\n reason: 'swipe'\n });\n } // Manually calling handleTransitionEnd in that case as isn't otherwise.\n\n\n if (indexCurrent === indexLatest) {\n _this.handleTransitionEnd();\n }\n });\n };\n\n _this.handleTouchStart = function (event) {\n if (_this.props.onTouchStart) {\n _this.props.onTouchStart(event);\n }\n\n _this.handleSwipeStart(event);\n };\n\n _this.handleTouchEnd = function (event) {\n if (_this.props.onTouchEnd) {\n _this.props.onTouchEnd(event);\n }\n\n _this.handleSwipeEnd(event);\n };\n\n _this.handleMouseDown = function (event) {\n if (_this.props.onMouseDown) {\n _this.props.onMouseDown(event);\n }\n\n event.persist();\n\n _this.handleSwipeStart(adaptMouse(event));\n };\n\n _this.handleMouseUp = function (event) {\n if (_this.props.onMouseUp) {\n _this.props.onMouseUp(event);\n }\n\n _this.handleSwipeEnd(adaptMouse(event));\n };\n\n _this.handleMouseLeave = function (event) {\n if (_this.props.onMouseLeave) {\n _this.props.onMouseLeave(event);\n } // Filter out events\n\n\n if (_this.started) {\n _this.handleSwipeEnd(adaptMouse(event));\n }\n };\n\n _this.handleMouseMove = function (event) {\n if (_this.props.onMouseMove) {\n _this.props.onMouseMove(event);\n } // Filter out events\n\n\n if (_this.started) {\n _this.handleSwipeMove(adaptMouse(event));\n }\n };\n\n _this.handleScroll = function (event) {\n if (_this.props.onScroll) {\n _this.props.onScroll(event);\n } // Ignore events bubbling up.\n\n\n if (event.target !== _this.rootNode) {\n return;\n }\n\n if (_this.ignoreNextScrollEvents) {\n _this.ignoreNextScrollEvents = false;\n return;\n }\n\n var indexLatest = _this.state.indexLatest;\n var indexNew = Math.ceil(event.target.scrollLeft / event.target.clientWidth) + indexLatest;\n _this.ignoreNextScrollEvents = true; // Reset the scroll position.\n\n event.target.scrollLeft = 0;\n\n if (_this.props.onChangeIndex && indexNew !== indexLatest) {\n _this.props.onChangeIndex(indexNew, indexLatest, {\n reason: 'focus'\n });\n }\n };\n\n _this.updateHeight = function () {\n if (_this.activeSlide !== null) {\n var child = _this.activeSlide.children[0];\n\n if (child !== undefined && child.offsetHeight !== undefined && _this.state.heightLatest !== child.offsetHeight) {\n _this.setState({\n heightLatest: child.offsetHeight\n });\n }\n }\n };\n\n if (process.env.NODE_ENV !== 'production') {\n (0, _reactSwipeableViewsCore.checkIndexBounds)(props);\n }\n\n _this.state = {\n indexLatest: props.index,\n // Set to true as soon as the component is swiping.\n // It's the state counter part of this.isSwiping.\n isDragging: false,\n // Help with SSR logic and lazy loading logic.\n renderOnlyActive: !props.disableLazyLoading,\n heightLatest: 0,\n // Let the render method that we are going to display the same slide than previously.\n displaySameSlide: true\n };\n\n _this.setIndexCurrent(props.index);\n\n return _this;\n }\n\n (0, _createClass2.default)(SwipeableViews, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n var _this2 = this;\n\n return {\n swipeableViews: {\n slideUpdateHeight: function slideUpdateHeight() {\n _this2.updateHeight();\n }\n }\n };\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this3 = this; // Subscribe to transition end events.\n\n\n this.transitionListener = addEventListener(this.containerNode, 'transitionend', function (event) {\n if (event.target !== _this3.containerNode) {\n return;\n }\n\n _this3.handleTransitionEnd();\n }); // Block the thread to handle that event.\n\n this.touchMoveListener = addEventListener(this.rootNode, 'touchmove', function (event) {\n // Handling touch events is disabled.\n if (_this3.props.disabled) {\n return;\n }\n\n _this3.handleSwipeMove(event);\n }, {\n passive: false\n });\n\n if (!this.props.disableLazyLoading) {\n this.firstRenderTimeout = setTimeout(function () {\n _this3.setState({\n renderOnlyActive: false\n });\n }, 0);\n } // Send all functions in an object if action param is set.\n\n\n if (this.props.action) {\n this.props.action({\n updateHeight: this.updateHeight\n });\n }\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var index = nextProps.index;\n\n if (typeof index === 'number' && index !== this.props.index) {\n if (process.env.NODE_ENV !== 'production') {\n (0, _reactSwipeableViewsCore.checkIndexBounds)(nextProps);\n }\n\n this.setIndexCurrent(index);\n this.setState({\n // If true, we are going to change the children. We shoudn't animate it.\n displaySameSlide: (0, _reactSwipeableViewsCore.getDisplaySameSlide)(this.props, nextProps),\n indexLatest: index\n });\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.transitionListener.remove();\n this.touchMoveListener.remove();\n clearTimeout(this.firstRenderTimeout);\n }\n }, {\n key: \"setIndexCurrent\",\n value: function setIndexCurrent(indexCurrent) {\n if (!this.props.animateTransitions && this.indexCurrent !== indexCurrent) {\n this.handleTransitionEnd();\n }\n\n this.indexCurrent = indexCurrent;\n\n if (this.containerNode) {\n var axis = this.props.axis;\n var transform = axisProperties.transform[axis](indexCurrent * 100);\n this.containerNode.style.WebkitTransform = transform;\n this.containerNode.style.transform = transform;\n }\n }\n }, {\n key: \"handleTransitionEnd\",\n value: function handleTransitionEnd() {\n if (!this.props.onTransitionEnd) {\n return;\n } // Filters out when changing the children\n\n\n if (this.state.displaySameSlide) {\n return;\n } // The rest callback is triggered when swiping. It's just noise.\n // We filter it out.\n\n\n if (!this.state.isDragging) {\n this.props.onTransitionEnd();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this4 = this;\n\n var _this$props2 = this.props,\n action = _this$props2.action,\n animateHeight = _this$props2.animateHeight,\n animateTransitions = _this$props2.animateTransitions,\n axis = _this$props2.axis,\n children = _this$props2.children,\n containerStyleProp = _this$props2.containerStyle,\n disabled = _this$props2.disabled,\n disableLazyLoading = _this$props2.disableLazyLoading,\n enableMouseEvents = _this$props2.enableMouseEvents,\n hysteresis = _this$props2.hysteresis,\n ignoreNativeScroll = _this$props2.ignoreNativeScroll,\n index = _this$props2.index,\n onChangeIndex = _this$props2.onChangeIndex,\n onSwitching = _this$props2.onSwitching,\n onTransitionEnd = _this$props2.onTransitionEnd,\n resistance = _this$props2.resistance,\n slideStyleProp = _this$props2.slideStyle,\n slideClassName = _this$props2.slideClassName,\n springConfig = _this$props2.springConfig,\n style = _this$props2.style,\n threshold = _this$props2.threshold,\n other = (0, _objectWithoutProperties2.default)(_this$props2, [\"action\", \"animateHeight\", \"animateTransitions\", \"axis\", \"children\", \"containerStyle\", \"disabled\", \"disableLazyLoading\", \"enableMouseEvents\", \"hysteresis\", \"ignoreNativeScroll\", \"index\", \"onChangeIndex\", \"onSwitching\", \"onTransitionEnd\", \"resistance\", \"slideStyle\", \"slideClassName\", \"springConfig\", \"style\", \"threshold\"]);\n var _this$state = this.state,\n displaySameSlide = _this$state.displaySameSlide,\n heightLatest = _this$state.heightLatest,\n indexLatest = _this$state.indexLatest,\n isDragging = _this$state.isDragging,\n renderOnlyActive = _this$state.renderOnlyActive;\n var touchEvents = !disabled ? {\n onTouchStart: this.handleTouchStart,\n onTouchEnd: this.handleTouchEnd\n } : {};\n var mouseEvents = !disabled && enableMouseEvents ? {\n onMouseDown: this.handleMouseDown,\n onMouseUp: this.handleMouseUp,\n onMouseLeave: this.handleMouseLeave,\n onMouseMove: this.handleMouseMove\n } : {}; // There is no point to animate if we are already providing a height.\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning.default)(!animateHeight || !containerStyleProp || !containerStyleProp.height, \"react-swipeable-view: You are setting animateHeight to true but you are\\nalso providing a custom height.\\nThe custom height has a higher priority than the animateHeight property.\\nSo animateHeight is most likely having no effect at all.\") : void 0;\n var slideStyle = (0, _extends2.default)({}, styles.slide, slideStyleProp);\n var transition;\n var WebkitTransition;\n\n if (isDragging || !animateTransitions || displaySameSlide) {\n transition = 'all 0s ease 0s';\n WebkitTransition = 'all 0s ease 0s';\n } else {\n transition = createTransition('transform', springConfig);\n WebkitTransition = createTransition('-webkit-transform', springConfig);\n\n if (heightLatest !== 0) {\n var additionalTranstion = \", \".concat(createTransition('height', springConfig));\n transition += additionalTranstion;\n WebkitTransition += additionalTranstion;\n }\n }\n\n var containerStyle = {\n height: null,\n WebkitFlexDirection: axisProperties.flexDirection[axis],\n flexDirection: axisProperties.flexDirection[axis],\n WebkitTransition: WebkitTransition,\n transition: transition\n }; // Apply the styles for SSR considerations\n\n if (!renderOnlyActive) {\n var transform = axisProperties.transform[axis](this.indexCurrent * 100);\n containerStyle.WebkitTransform = transform;\n containerStyle.transform = transform;\n }\n\n if (animateHeight) {\n containerStyle.height = heightLatest;\n }\n\n return _react.default.createElement(\"div\", (0, _extends2.default)({\n ref: this.setRootNode,\n style: (0, _extends2.default)({}, axisProperties.root[axis], style)\n }, other, touchEvents, mouseEvents, {\n onScroll: this.handleScroll\n }), _react.default.createElement(\"div\", {\n ref: this.setContainerNode,\n style: (0, _extends2.default)({}, containerStyle, styles.container, containerStyleProp),\n className: \"react-swipeable-view-container\"\n }, _react.default.Children.map(children, function (child, indexChild) {\n if (renderOnlyActive && indexChild !== indexLatest) {\n return null;\n }\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning.default)(_react.default.isValidElement(child), \"react-swipeable-view: one of the children provided is invalid: \".concat(child, \".\\nWe are expecting a valid React Element\")) : void 0;\n var ref;\n var hidden = true;\n\n if (indexChild === indexLatest) {\n hidden = false;\n\n if (animateHeight) {\n ref = _this4.setActiveSlide;\n slideStyle.overflowY = 'hidden';\n }\n }\n\n return _react.default.createElement(\"div\", {\n ref: ref,\n style: slideStyle,\n className: slideClassName,\n \"aria-hidden\": hidden,\n \"data-swipeable\": \"true\"\n }, child);\n })));\n }\n }]);\n return SwipeableViews;\n}(_react.default.Component); // Added as an ads for people using the React dev tools in production.\n// So they know, the tool used to build the awesome UI they\n// are looking at/retro engineering.\n\n\nSwipeableViews.displayName = 'ReactSwipableView';\nSwipeableViews.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * This is callback property. It's called by the component on mount.\n * This is useful when you want to trigger an action programmatically.\n * It currently only supports updateHeight() action.\n *\n * @param {object} actions This object contains all posible actions\n * that can be triggered programmatically.\n */\n action: _propTypes.default.func,\n\n /**\n * If `true`, the height of the container will be animated to match the current slide height.\n * Animating another style property has a negative impact regarding performance.\n */\n animateHeight: _propTypes.default.bool,\n\n /**\n * If `false`, changes to the index prop will not cause an animated transition.\n */\n animateTransitions: _propTypes.default.bool,\n\n /**\n * The axis on which the slides will slide.\n */\n axis: _propTypes.default.oneOf(['x', 'x-reverse', 'y', 'y-reverse']),\n\n /**\n * Use this property to provide your slides.\n */\n children: _propTypes.default.node.isRequired,\n\n /**\n * This is the inlined style that will be applied\n * to each slide container.\n */\n containerStyle: _propTypes.default.object,\n\n /**\n * If `true`, it will disable touch events.\n * This is useful when you want to prohibit the user from changing slides.\n */\n disabled: _propTypes.default.bool,\n\n /**\n * This is the config used to disable lazyloding,\n * if `true` will render all the views in first rendering.\n */\n disableLazyLoading: _propTypes.default.bool,\n\n /**\n * If `true`, it will enable mouse events.\n * This will allow the user to perform the relevant swipe actions with a mouse.\n */\n enableMouseEvents: _propTypes.default.bool,\n\n /**\n * Configure hysteresis between slides. This value determines how far\n * should user swipe to switch slide.\n */\n hysteresis: _propTypes.default.number,\n\n /**\n * If `true`, it will ignore native scroll container.\n * It can be used to filter out false positive that blocks the swipe.\n */\n ignoreNativeScroll: _propTypes.default.bool,\n\n /**\n * This is the index of the slide to show.\n * This is useful when you want to change the default slide shown.\n * Or when you have tabs linked to each slide.\n */\n index: _propTypes.default.number,\n\n /**\n * This is callback prop. It's call by the\n * component when the shown slide change after a swipe made by the user.\n * This is useful when you have tabs linked to each slide.\n *\n * @param {integer} index This is the current index of the slide.\n * @param {integer} indexLatest This is the oldest index of the slide.\n * @param {object} meta Meta data containing more information about the event.\n */\n onChangeIndex: _propTypes.default.func,\n\n /**\n * @ignore\n */\n onMouseDown: _propTypes.default.func,\n\n /**\n * @ignore\n */\n onMouseLeave: _propTypes.default.func,\n\n /**\n * @ignore\n */\n onMouseMove: _propTypes.default.func,\n\n /**\n * @ignore\n */\n onMouseUp: _propTypes.default.func,\n\n /**\n * @ignore\n */\n onScroll: _propTypes.default.func,\n\n /**\n * This is callback prop. It's called by the\n * component when the slide switching.\n * This is useful when you want to implement something corresponding\n * to the current slide position.\n *\n * @param {integer} index This is the current index of the slide.\n * @param {string} type Can be either `move` or `end`.\n */\n onSwitching: _propTypes.default.func,\n\n /**\n * @ignore\n */\n onTouchEnd: _propTypes.default.func,\n\n /**\n * @ignore\n */\n onTouchMove: _propTypes.default.func,\n\n /**\n * @ignore\n */\n onTouchStart: _propTypes.default.func,\n\n /**\n * The callback that fires when the animation comes to a rest.\n * This is useful to defer CPU intensive task.\n */\n onTransitionEnd: _propTypes.default.func,\n\n /**\n * If `true`, it will add bounds effect on the edges.\n */\n resistance: _propTypes.default.bool,\n\n /**\n * This is the className that will be applied\n * on the slide component.\n */\n slideClassName: _propTypes.default.string,\n\n /**\n * This is the inlined style that will be applied\n * on the slide component.\n */\n slideStyle: _propTypes.default.object,\n\n /**\n * This is the config used to create CSS transitions.\n * This is useful to change the dynamic of the transition.\n */\n springConfig: _propTypes.default.shape({\n delay: _propTypes.default.string,\n duration: _propTypes.default.string,\n easeFunction: _propTypes.default.string\n }),\n\n /**\n * This is the inlined style that will be applied\n * on the root component.\n */\n style: _propTypes.default.object,\n\n /**\n * This is the threshold used for detecting a quick swipe.\n * If the computed speed is above this value, the index change.\n */\n threshold: _propTypes.default.number\n} : {};\nSwipeableViews.defaultProps = {\n animateHeight: false,\n animateTransitions: true,\n axis: 'x',\n disabled: false,\n disableLazyLoading: false,\n enableMouseEvents: false,\n hysteresis: 0.6,\n ignoreNativeScroll: false,\n index: 0,\n threshold: 5,\n springConfig: {\n duration: '0.35s',\n easeFunction: 'cubic-bezier(0.15, 0.3, 0.25, 1)',\n delay: '0s'\n },\n resistance: false\n};\nSwipeableViews.childContextTypes = {\n swipeableViews: _propTypes.default.shape({\n slideUpdateHeight: _propTypes.default.func\n })\n};\nvar _default = SwipeableViews;\nexports.default = _default;","function _extends() {\n module.exports = _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends;","var objectWithoutPropertiesLoose = require(\"./objectWithoutPropertiesLoose\");\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutProperties;","function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nmodule.exports = _objectWithoutPropertiesLoose;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","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;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"checkIndexBounds\", {\n enumerable: true,\n get: function get() {\n return _checkIndexBounds.default;\n }\n});\nObject.defineProperty(exports, \"computeIndex\", {\n enumerable: true,\n get: function get() {\n return _computeIndex.default;\n }\n});\nObject.defineProperty(exports, \"constant\", {\n enumerable: true,\n get: function get() {\n return _constant.default;\n }\n});\nObject.defineProperty(exports, \"getDisplaySameSlide\", {\n enumerable: true,\n get: function get() {\n return _getDisplaySameSlide.default;\n }\n});\nObject.defineProperty(exports, \"mod\", {\n enumerable: true,\n get: function get() {\n return _mod.default;\n }\n});\n\nvar _checkIndexBounds = _interopRequireDefault(require(\"./checkIndexBounds\"));\n\nvar _computeIndex = _interopRequireDefault(require(\"./computeIndex\"));\n\nvar _constant = _interopRequireDefault(require(\"./constant\"));\n\nvar _getDisplaySameSlide = _interopRequireDefault(require(\"./getDisplaySameSlide\"));\n\nvar _mod = _interopRequireDefault(require(\"./mod\"));","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _warning = _interopRequireDefault(require(\"warning\"));\n\nvar checkIndexBounds = function checkIndexBounds(props) {\n var index = props.index,\n children = props.children;\n\n var childrenCount = _react.default.Children.count(children);\n\n process.env.NODE_ENV !== \"production\" ? (0, _warning.default)(index >= 0 && index <= childrenCount, \"react-swipeable-view: the new index: \".concat(index, \" is out of bounds: [0-\").concat(childrenCount, \"].\")) : void 0;\n};\n\nvar _default = checkIndexBounds;\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = computeIndex;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _constant = _interopRequireDefault(require(\"./constant\"));\n\nfunction computeIndex(params) {\n var children = params.children,\n startIndex = params.startIndex,\n startX = params.startX,\n pageX = params.pageX,\n viewLength = params.viewLength,\n resistance = params.resistance;\n var indexMax = _react.default.Children.count(children) - 1;\n var index = startIndex + (startX - pageX) / viewLength;\n var newStartX;\n\n if (!resistance) {\n // Reset the starting point\n if (index < 0) {\n index = 0;\n newStartX = (index - startIndex) * viewLength + pageX;\n } else if (index > indexMax) {\n index = indexMax;\n newStartX = (index - startIndex) * viewLength + pageX;\n }\n } else if (index < 0) {\n index = Math.exp(index * _constant.default.RESISTANCE_COEF) - 1;\n } else if (index > indexMax) {\n index = indexMax + 1 - Math.exp((indexMax - index) * _constant.default.RESISTANCE_COEF);\n }\n\n return {\n index: index,\n startX: newStartX\n };\n}","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar getDisplaySameSlide = function getDisplaySameSlide(props, nextProps) {\n var displaySameSlide = false;\n\n var getChildrenKey = function getChildrenKey(child) {\n return child ? child.key : 'empty';\n };\n\n if (props.children.length && nextProps.children.length) {\n var oldKeys = _react.default.Children.map(props.children, getChildrenKey);\n\n var oldKey = oldKeys[props.index];\n\n if (oldKey !== null && oldKey !== undefined) {\n var newKeys = _react.default.Children.map(nextProps.children, getChildrenKey);\n\n var newKey = newKeys[nextProps.index];\n\n if (oldKey === newKey) {\n displaySameSlide = true;\n }\n }\n }\n\n return displaySameSlide;\n};\n\nvar _default = getDisplaySameSlide;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0; // Extended version of % with negative integer support.\n\nfunction mod(n, m) {\n var q = n % m;\n return q < 0 ? q + m : q;\n}\n\nvar _default = mod;\nexports.default = _default;","'use strict';\n\nvar printWarning = function printWarning() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function printWarning(format, subs) {\n var index = 0;\n var message = 'Warning: ' + (subs.length > 0 ? format.replace(/%s/g, function () {\n return subs[index++];\n }) : format);\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // --- Welcome to debugging history ---\n // This error was thrown as a convenience so that you can use the\n // stack trace to find the callsite that triggered this warning.\n throw new Error(message);\n } catch (e) {}\n };\n}\n\nexport default function (member) {\n printWarning('Please use `import { %s } from \"history\"` instead of `import %s from \"history/es/%s\"`. ' + 'Support for the latter will be removed in the next major release.', [member, member]);\n}","'use strict';\n\nimport warnAboutDeprecatedESMImport from './warnAboutDeprecatedESMImport.js';\nwarnAboutDeprecatedESMImport('createBrowserHistory');\nimport { createBrowserHistory } from '../esm/history.js';\nexport default createBrowserHistory;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.Immutable = factory();\n})(this, function () {\n 'use strict';\n\n var SLICE$0 = Array.prototype.slice;\n\n function createClass(ctor, superClass) {\n if (superClass) {\n ctor.prototype = Object.create(superClass.prototype);\n }\n\n ctor.prototype.constructor = ctor;\n }\n\n function Iterable(value) {\n return isIterable(value) ? value : Seq(value);\n }\n\n createClass(KeyedIterable, Iterable);\n\n function KeyedIterable(value) {\n return isKeyed(value) ? value : KeyedSeq(value);\n }\n\n createClass(IndexedIterable, Iterable);\n\n function IndexedIterable(value) {\n return isIndexed(value) ? value : IndexedSeq(value);\n }\n\n createClass(SetIterable, Iterable);\n\n function SetIterable(value) {\n return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);\n }\n\n function isIterable(maybeIterable) {\n return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);\n }\n\n function isKeyed(maybeKeyed) {\n return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);\n }\n\n function isIndexed(maybeIndexed) {\n return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);\n }\n\n function isAssociative(maybeAssociative) {\n return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n }\n\n function isOrdered(maybeOrdered) {\n return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);\n }\n\n Iterable.isIterable = isIterable;\n Iterable.isKeyed = isKeyed;\n Iterable.isIndexed = isIndexed;\n Iterable.isAssociative = isAssociative;\n Iterable.isOrdered = isOrdered;\n Iterable.Keyed = KeyedIterable;\n Iterable.Indexed = IndexedIterable;\n Iterable.Set = SetIterable;\n var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; // Used for setting prototype methods that IE8 chokes on.\n\n var DELETE = 'delete'; // Constants describing the size of trie nodes.\n\n var SHIFT = 5; // Resulted in best performance after ______?\n\n var SIZE = 1 << SHIFT;\n var MASK = SIZE - 1; // A consistent shared value representing \"not set\" which equals nothing other\n // than itself, and nothing that could be provided externally.\n\n var NOT_SET = {}; // Boolean references, Rough equivalent of `bool &`.\n\n var CHANGE_LENGTH = {\n value: false\n };\n var DID_ALTER = {\n value: false\n };\n\n function MakeRef(ref) {\n ref.value = false;\n return ref;\n }\n\n function SetRef(ref) {\n ref && (ref.value = true);\n } // A function which returns a value representing an \"owner\" for transient writes\n // to tries. The return value will only ever equal itself, and will not equal\n // the return of any subsequent call of this function.\n\n\n function OwnerID() {} // http://jsperf.com/copy-array-inline\n\n\n function arrCopy(arr, offset) {\n offset = offset || 0;\n var len = Math.max(0, arr.length - offset);\n var newArr = new Array(len);\n\n for (var ii = 0; ii < len; ii++) {\n newArr[ii] = arr[ii + offset];\n }\n\n return newArr;\n }\n\n function ensureSize(iter) {\n if (iter.size === undefined) {\n iter.size = iter.__iterate(returnTrue);\n }\n\n return iter.size;\n }\n\n function wrapIndex(iter, index) {\n // This implements \"is array index\" which the ECMAString spec defines as:\n //\n // A String property name P is an array index if and only if\n // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal\n // to 2^321.\n //\n // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects\n if (typeof index !== 'number') {\n var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32\n\n if ('' + uint32Index !== index || uint32Index === 4294967295) {\n return NaN;\n }\n\n index = uint32Index;\n }\n\n return index < 0 ? ensureSize(iter) + index : index;\n }\n\n function returnTrue() {\n return true;\n }\n\n function wholeSlice(begin, end, size) {\n return (begin === 0 || size !== undefined && begin <= -size) && (end === undefined || size !== undefined && end >= size);\n }\n\n function resolveBegin(begin, size) {\n return resolveIndex(begin, size, 0);\n }\n\n function resolveEnd(end, size) {\n return resolveIndex(end, size, size);\n }\n\n function resolveIndex(index, size, defaultIndex) {\n return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index);\n }\n /* global Symbol */\n\n\n var ITERATE_KEYS = 0;\n var ITERATE_VALUES = 1;\n var ITERATE_ENTRIES = 2;\n var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator';\n var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\n function Iterator(next) {\n this.next = next;\n }\n\n Iterator.prototype.toString = function () {\n return '[Iterator]';\n };\n\n Iterator.KEYS = ITERATE_KEYS;\n Iterator.VALUES = ITERATE_VALUES;\n Iterator.ENTRIES = ITERATE_ENTRIES;\n\n Iterator.prototype.inspect = Iterator.prototype.toSource = function () {\n return this.toString();\n };\n\n Iterator.prototype[ITERATOR_SYMBOL] = function () {\n return this;\n };\n\n function iteratorValue(type, k, v, iteratorResult) {\n var value = type === 0 ? k : type === 1 ? v : [k, v];\n iteratorResult ? iteratorResult.value = value : iteratorResult = {\n value: value,\n done: false\n };\n return iteratorResult;\n }\n\n function iteratorDone() {\n return {\n value: undefined,\n done: true\n };\n }\n\n function hasIterator(maybeIterable) {\n return !!getIteratorFn(maybeIterable);\n }\n\n function isIterator(maybeIterator) {\n return maybeIterator && typeof maybeIterator.next === 'function';\n }\n\n function getIterator(iterable) {\n var iteratorFn = getIteratorFn(iterable);\n return iteratorFn && iteratorFn.call(iterable);\n }\n\n function getIteratorFn(iterable) {\n var iteratorFn = iterable && (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL] || iterable[FAUX_ITERATOR_SYMBOL]);\n\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n function isArrayLike(value) {\n return value && typeof value.length === 'number';\n }\n\n createClass(Seq, Iterable);\n\n function Seq(value) {\n return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);\n }\n\n Seq.of = function ()\n /*...values*/\n {\n return Seq(arguments);\n };\n\n Seq.prototype.toSeq = function () {\n return this;\n };\n\n Seq.prototype.toString = function () {\n return this.__toString('Seq {', '}');\n };\n\n Seq.prototype.cacheResult = function () {\n if (!this._cache && this.__iterateUncached) {\n this._cache = this.entrySeq().toArray();\n this.size = this._cache.length;\n }\n\n return this;\n }; // abstract __iterateUncached(fn, reverse)\n\n\n Seq.prototype.__iterate = function (fn, reverse) {\n return seqIterate(this, fn, reverse, true);\n }; // abstract __iteratorUncached(type, reverse)\n\n\n Seq.prototype.__iterator = function (type, reverse) {\n return seqIterator(this, type, reverse, true);\n };\n\n createClass(KeyedSeq, Seq);\n\n function KeyedSeq(value) {\n return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? isKeyed(value) ? value.toSeq() : value.fromEntrySeq() : keyedSeqFromValue(value);\n }\n\n KeyedSeq.prototype.toKeyedSeq = function () {\n return this;\n };\n\n createClass(IndexedSeq, Seq);\n\n function IndexedSeq(value) {\n return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();\n }\n\n IndexedSeq.of = function ()\n /*...values*/\n {\n return IndexedSeq(arguments);\n };\n\n IndexedSeq.prototype.toIndexedSeq = function () {\n return this;\n };\n\n IndexedSeq.prototype.toString = function () {\n return this.__toString('Seq [', ']');\n };\n\n IndexedSeq.prototype.__iterate = function (fn, reverse) {\n return seqIterate(this, fn, reverse, false);\n };\n\n IndexedSeq.prototype.__iterator = function (type, reverse) {\n return seqIterator(this, type, reverse, false);\n };\n\n createClass(SetSeq, Seq);\n\n function SetSeq(value) {\n return (value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value).toSetSeq();\n }\n\n SetSeq.of = function ()\n /*...values*/\n {\n return SetSeq(arguments);\n };\n\n SetSeq.prototype.toSetSeq = function () {\n return this;\n };\n\n Seq.isSeq = isSeq;\n Seq.Keyed = KeyedSeq;\n Seq.Set = SetSeq;\n Seq.Indexed = IndexedSeq;\n var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\n Seq.prototype[IS_SEQ_SENTINEL] = true;\n createClass(ArraySeq, IndexedSeq);\n\n function ArraySeq(array) {\n this._array = array;\n this.size = array.length;\n }\n\n ArraySeq.prototype.get = function (index, notSetValue) {\n return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n };\n\n ArraySeq.prototype.__iterate = function (fn, reverse) {\n var array = this._array;\n var maxIndex = array.length - 1;\n\n for (var ii = 0; ii <= maxIndex; ii++) {\n if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n return ii + 1;\n }\n }\n\n return ii;\n };\n\n ArraySeq.prototype.__iterator = function (type, reverse) {\n var array = this._array;\n var maxIndex = array.length - 1;\n var ii = 0;\n return new Iterator(function () {\n return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);\n });\n };\n\n createClass(ObjectSeq, KeyedSeq);\n\n function ObjectSeq(object) {\n var keys = Object.keys(object);\n this._object = object;\n this._keys = keys;\n this.size = keys.length;\n }\n\n ObjectSeq.prototype.get = function (key, notSetValue) {\n if (notSetValue !== undefined && !this.has(key)) {\n return notSetValue;\n }\n\n return this._object[key];\n };\n\n ObjectSeq.prototype.has = function (key) {\n return this._object.hasOwnProperty(key);\n };\n\n ObjectSeq.prototype.__iterate = function (fn, reverse) {\n var object = this._object;\n var keys = this._keys;\n var maxIndex = keys.length - 1;\n\n for (var ii = 0; ii <= maxIndex; ii++) {\n var key = keys[reverse ? maxIndex - ii : ii];\n\n if (fn(object[key], key, this) === false) {\n return ii + 1;\n }\n }\n\n return ii;\n };\n\n ObjectSeq.prototype.__iterator = function (type, reverse) {\n var object = this._object;\n var keys = this._keys;\n var maxIndex = keys.length - 1;\n var ii = 0;\n return new Iterator(function () {\n var key = keys[reverse ? maxIndex - ii : ii];\n return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);\n });\n };\n\n ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;\n createClass(IterableSeq, IndexedSeq);\n\n function IterableSeq(iterable) {\n this._iterable = iterable;\n this.size = iterable.length || iterable.size;\n }\n\n IterableSeq.prototype.__iterateUncached = function (fn, reverse) {\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var iterable = this._iterable;\n var iterator = getIterator(iterable);\n var iterations = 0;\n\n if (isIterator(iterator)) {\n var step;\n\n while (!(step = iterator.next()).done) {\n if (fn(step.value, iterations++, this) === false) {\n break;\n }\n }\n }\n\n return iterations;\n };\n\n IterableSeq.prototype.__iteratorUncached = function (type, reverse) {\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n\n var iterable = this._iterable;\n var iterator = getIterator(iterable);\n\n if (!isIterator(iterator)) {\n return new Iterator(iteratorDone);\n }\n\n var iterations = 0;\n return new Iterator(function () {\n var step = iterator.next();\n return step.done ? step : iteratorValue(type, iterations++, step.value);\n });\n };\n\n createClass(IteratorSeq, IndexedSeq);\n\n function IteratorSeq(iterator) {\n this._iterator = iterator;\n this._iteratorCache = [];\n }\n\n IteratorSeq.prototype.__iterateUncached = function (fn, reverse) {\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var iterator = this._iterator;\n var cache = this._iteratorCache;\n var iterations = 0;\n\n while (iterations < cache.length) {\n if (fn(cache[iterations], iterations++, this) === false) {\n return iterations;\n }\n }\n\n var step;\n\n while (!(step = iterator.next()).done) {\n var val = step.value;\n cache[iterations] = val;\n\n if (fn(val, iterations++, this) === false) {\n break;\n }\n }\n\n return iterations;\n };\n\n IteratorSeq.prototype.__iteratorUncached = function (type, reverse) {\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n\n var iterator = this._iterator;\n var cache = this._iteratorCache;\n var iterations = 0;\n return new Iterator(function () {\n if (iterations >= cache.length) {\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n cache[iterations] = step.value;\n }\n\n return iteratorValue(type, iterations, cache[iterations++]);\n });\n }; // # pragma Helper functions\n\n\n function isSeq(maybeSeq) {\n return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);\n }\n\n var EMPTY_SEQ;\n\n function emptySequence() {\n return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n }\n\n function keyedSeqFromValue(value) {\n var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined;\n\n if (!seq) {\n throw new TypeError('Expected Array or iterable object of [k, v] entries, ' + 'or keyed object: ' + value);\n }\n\n return seq;\n }\n\n function indexedSeqFromValue(value) {\n var seq = maybeIndexedSeqFromValue(value);\n\n if (!seq) {\n throw new TypeError('Expected Array or iterable object of values: ' + value);\n }\n\n return seq;\n }\n\n function seqFromValue(value) {\n var seq = maybeIndexedSeqFromValue(value) || typeof value === 'object' && new ObjectSeq(value);\n\n if (!seq) {\n throw new TypeError('Expected Array or iterable object of values, or keyed object: ' + value);\n }\n\n return seq;\n }\n\n function maybeIndexedSeqFromValue(value) {\n return isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined;\n }\n\n function seqIterate(seq, fn, reverse, useKeys) {\n var cache = seq._cache;\n\n if (cache) {\n var maxIndex = cache.length - 1;\n\n for (var ii = 0; ii <= maxIndex; ii++) {\n var entry = cache[reverse ? maxIndex - ii : ii];\n\n if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {\n return ii + 1;\n }\n }\n\n return ii;\n }\n\n return seq.__iterateUncached(fn, reverse);\n }\n\n function seqIterator(seq, type, reverse, useKeys) {\n var cache = seq._cache;\n\n if (cache) {\n var maxIndex = cache.length - 1;\n var ii = 0;\n return new Iterator(function () {\n var entry = cache[reverse ? maxIndex - ii : ii];\n return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n });\n }\n\n return seq.__iteratorUncached(type, reverse);\n }\n\n function fromJS(json, converter) {\n return converter ? fromJSWith(converter, json, '', {\n '': json\n }) : fromJSDefault(json);\n }\n\n function fromJSWith(converter, json, key, parentJSON) {\n if (Array.isArray(json)) {\n return converter.call(parentJSON, key, IndexedSeq(json).map(function (v, k) {\n return fromJSWith(converter, v, k, json);\n }));\n }\n\n if (isPlainObj(json)) {\n return converter.call(parentJSON, key, KeyedSeq(json).map(function (v, k) {\n return fromJSWith(converter, v, k, json);\n }));\n }\n\n return json;\n }\n\n function fromJSDefault(json) {\n if (Array.isArray(json)) {\n return IndexedSeq(json).map(fromJSDefault).toList();\n }\n\n if (isPlainObj(json)) {\n return KeyedSeq(json).map(fromJSDefault).toMap();\n }\n\n return json;\n }\n\n function isPlainObj(value) {\n return value && (value.constructor === Object || value.constructor === undefined);\n }\n /**\n * An extension of the \"same-value\" algorithm as [described for use by ES6 Map\n * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)\n *\n * NaN is considered the same as NaN, however -0 and 0 are considered the same\n * value, which is different from the algorithm described by\n * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).\n *\n * This is extended further to allow Objects to describe the values they\n * represent, by way of `valueOf` or `equals` (and `hashCode`).\n *\n * Note: because of this extension, the key equality of Immutable.Map and the\n * value equality of Immutable.Set will differ from ES6 Map and Set.\n *\n * ### Defining custom values\n *\n * The easiest way to describe the value an object represents is by implementing\n * `valueOf`. For example, `Date` represents a value by returning a unix\n * timestamp for `valueOf`:\n *\n * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...\n * var date2 = new Date(1234567890000);\n * date1.valueOf(); // 1234567890000\n * assert( date1 !== date2 );\n * assert( Immutable.is( date1, date2 ) );\n *\n * Note: overriding `valueOf` may have other implications if you use this object\n * where JavaScript expects a primitive, such as implicit string coercion.\n *\n * For more complex types, especially collections, implementing `valueOf` may\n * not be performant. An alternative is to implement `equals` and `hashCode`.\n *\n * `equals` takes another object, presumably of similar type, and returns true\n * if the it is equal. Equality is symmetrical, so the same result should be\n * returned if this and the argument are flipped.\n *\n * assert( a.equals(b) === b.equals(a) );\n *\n * `hashCode` returns a 32bit integer number representing the object which will\n * be used to determine how to store the value object in a Map or Set. You must\n * provide both or neither methods, one must not exist without the other.\n *\n * Also, an important relationship between these methods must be upheld: if two\n * values are equal, they *must* return the same hashCode. If the values are not\n * equal, they might have the same hashCode; this is called a hash collision,\n * and while undesirable for performance reasons, it is acceptable.\n *\n * if (a.equals(b)) {\n * assert( a.hashCode() === b.hashCode() );\n * }\n *\n * All Immutable collections implement `equals` and `hashCode`.\n *\n */\n\n\n function is(valueA, valueB) {\n if (valueA === valueB || valueA !== valueA && valueB !== valueB) {\n return true;\n }\n\n if (!valueA || !valueB) {\n return false;\n }\n\n if (typeof valueA.valueOf === 'function' && typeof valueB.valueOf === 'function') {\n valueA = valueA.valueOf();\n valueB = valueB.valueOf();\n\n if (valueA === valueB || valueA !== valueA && valueB !== valueB) {\n return true;\n }\n\n if (!valueA || !valueB) {\n return false;\n }\n }\n\n if (typeof valueA.equals === 'function' && typeof valueB.equals === 'function' && valueA.equals(valueB)) {\n return true;\n }\n\n return false;\n }\n\n function deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (!isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) {\n return false;\n }\n\n if (a.size === 0 && b.size === 0) {\n return true;\n }\n\n var notAssociative = !isAssociative(a);\n\n if (isOrdered(a)) {\n var entries = a.entries();\n return b.every(function (v, k) {\n var entry = entries.next().value;\n return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));\n }) && entries.next().done;\n }\n\n var flipped = false;\n\n if (a.size === undefined) {\n if (b.size === undefined) {\n if (typeof a.cacheResult === 'function') {\n a.cacheResult();\n }\n } else {\n flipped = true;\n var _ = a;\n a = b;\n b = _;\n }\n }\n\n var allEqual = true;\n\n var bSize = b.__iterate(function (v, k) {\n if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {\n allEqual = false;\n return false;\n }\n });\n\n return allEqual && a.size === bSize;\n }\n\n createClass(Repeat, IndexedSeq);\n\n function Repeat(value, times) {\n if (!(this instanceof Repeat)) {\n return new Repeat(value, times);\n }\n\n this._value = value;\n this.size = times === undefined ? Infinity : Math.max(0, times);\n\n if (this.size === 0) {\n if (EMPTY_REPEAT) {\n return EMPTY_REPEAT;\n }\n\n EMPTY_REPEAT = this;\n }\n }\n\n Repeat.prototype.toString = function () {\n if (this.size === 0) {\n return 'Repeat []';\n }\n\n return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n };\n\n Repeat.prototype.get = function (index, notSetValue) {\n return this.has(index) ? this._value : notSetValue;\n };\n\n Repeat.prototype.includes = function (searchValue) {\n return is(this._value, searchValue);\n };\n\n Repeat.prototype.slice = function (begin, end) {\n var size = this.size;\n return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n };\n\n Repeat.prototype.reverse = function () {\n return this;\n };\n\n Repeat.prototype.indexOf = function (searchValue) {\n if (is(this._value, searchValue)) {\n return 0;\n }\n\n return -1;\n };\n\n Repeat.prototype.lastIndexOf = function (searchValue) {\n if (is(this._value, searchValue)) {\n return this.size;\n }\n\n return -1;\n };\n\n Repeat.prototype.__iterate = function (fn, reverse) {\n for (var ii = 0; ii < this.size; ii++) {\n if (fn(this._value, ii, this) === false) {\n return ii + 1;\n }\n }\n\n return ii;\n };\n\n Repeat.prototype.__iterator = function (type, reverse) {\n var this$0 = this;\n var ii = 0;\n return new Iterator(function () {\n return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone();\n });\n };\n\n Repeat.prototype.equals = function (other) {\n return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other);\n };\n\n var EMPTY_REPEAT;\n\n function invariant(condition, error) {\n if (!condition) throw new Error(error);\n }\n\n createClass(Range, IndexedSeq);\n\n function Range(start, end, step) {\n if (!(this instanceof Range)) {\n return new Range(start, end, step);\n }\n\n invariant(step !== 0, 'Cannot step a Range by 0');\n start = start || 0;\n\n if (end === undefined) {\n end = Infinity;\n }\n\n step = step === undefined ? 1 : Math.abs(step);\n\n if (end < start) {\n step = -step;\n }\n\n this._start = start;\n this._end = end;\n this._step = step;\n this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n\n if (this.size === 0) {\n if (EMPTY_RANGE) {\n return EMPTY_RANGE;\n }\n\n EMPTY_RANGE = this;\n }\n }\n\n Range.prototype.toString = function () {\n if (this.size === 0) {\n return 'Range []';\n }\n\n return 'Range [ ' + this._start + '...' + this._end + (this._step !== 1 ? ' by ' + this._step : '') + ' ]';\n };\n\n Range.prototype.get = function (index, notSetValue) {\n return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;\n };\n\n Range.prototype.includes = function (searchValue) {\n var possibleIndex = (searchValue - this._start) / this._step;\n return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);\n };\n\n Range.prototype.slice = function (begin, end) {\n if (wholeSlice(begin, end, this.size)) {\n return this;\n }\n\n begin = resolveBegin(begin, this.size);\n end = resolveEnd(end, this.size);\n\n if (end <= begin) {\n return new Range(0, 0);\n }\n\n return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n };\n\n Range.prototype.indexOf = function (searchValue) {\n var offsetValue = searchValue - this._start;\n\n if (offsetValue % this._step === 0) {\n var index = offsetValue / this._step;\n\n if (index >= 0 && index < this.size) {\n return index;\n }\n }\n\n return -1;\n };\n\n Range.prototype.lastIndexOf = function (searchValue) {\n return this.indexOf(searchValue);\n };\n\n Range.prototype.__iterate = function (fn, reverse) {\n var maxIndex = this.size - 1;\n var step = this._step;\n var value = reverse ? this._start + maxIndex * step : this._start;\n\n for (var ii = 0; ii <= maxIndex; ii++) {\n if (fn(value, ii, this) === false) {\n return ii + 1;\n }\n\n value += reverse ? -step : step;\n }\n\n return ii;\n };\n\n Range.prototype.__iterator = function (type, reverse) {\n var maxIndex = this.size - 1;\n var step = this._step;\n var value = reverse ? this._start + maxIndex * step : this._start;\n var ii = 0;\n return new Iterator(function () {\n var v = value;\n value += reverse ? -step : step;\n return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n });\n };\n\n Range.prototype.equals = function (other) {\n return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other);\n };\n\n var EMPTY_RANGE;\n createClass(Collection, Iterable);\n\n function Collection() {\n throw TypeError('Abstract');\n }\n\n createClass(KeyedCollection, Collection);\n\n function KeyedCollection() {}\n\n createClass(IndexedCollection, Collection);\n\n function IndexedCollection() {}\n\n createClass(SetCollection, Collection);\n\n function SetCollection() {}\n\n Collection.Keyed = KeyedCollection;\n Collection.Indexed = IndexedCollection;\n Collection.Set = SetCollection;\n var imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) {\n a = a | 0; // int\n\n b = b | 0; // int\n\n var c = a & 0xffff;\n var d = b & 0xffff; // Shift by 0 fixes the sign on the high part.\n\n return c * d + ((a >>> 16) * d + c * (b >>> 16) << 16 >>> 0) | 0; // int\n }; // v8 has an optimization for storing 31-bit signed numbers.\n // Values which have either 00 or 11 as the high order bits qualify.\n // This function drops the highest order bit in a signed number, maintaining\n // the sign bit.\n\n function smi(i32) {\n return i32 >>> 1 & 0x40000000 | i32 & 0xBFFFFFFF;\n }\n\n function hash(o) {\n if (o === false || o === null || o === undefined) {\n return 0;\n }\n\n if (typeof o.valueOf === 'function') {\n o = o.valueOf();\n\n if (o === false || o === null || o === undefined) {\n return 0;\n }\n }\n\n if (o === true) {\n return 1;\n }\n\n var type = typeof o;\n\n if (type === 'number') {\n if (o !== o || o === Infinity) {\n return 0;\n }\n\n var h = o | 0;\n\n if (h !== o) {\n h ^= o * 0xFFFFFFFF;\n }\n\n while (o > 0xFFFFFFFF) {\n o /= 0xFFFFFFFF;\n h ^= o;\n }\n\n return smi(h);\n }\n\n if (type === 'string') {\n return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n }\n\n if (typeof o.hashCode === 'function') {\n return o.hashCode();\n }\n\n if (type === 'object') {\n return hashJSObj(o);\n }\n\n if (typeof o.toString === 'function') {\n return hashString(o.toString());\n }\n\n throw new Error('Value type ' + type + ' cannot be hashed.');\n }\n\n function cachedHashString(string) {\n var hash = stringHashCache[string];\n\n if (hash === undefined) {\n hash = hashString(string);\n\n if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n STRING_HASH_CACHE_SIZE = 0;\n stringHashCache = {};\n }\n\n STRING_HASH_CACHE_SIZE++;\n stringHashCache[string] = hash;\n }\n\n return hash;\n } // http://jsperf.com/hashing-strings\n\n\n function hashString(string) {\n // This is the hash from JVM\n // The hash code for a string is computed as\n // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],\n // where s[i] is the ith character of the string and n is the length of\n // the string. We \"mod\" the result to make it between 0 (inclusive) and 2^31\n // (exclusive) by dropping high bits.\n var hash = 0;\n\n for (var ii = 0; ii < string.length; ii++) {\n hash = 31 * hash + string.charCodeAt(ii) | 0;\n }\n\n return smi(hash);\n }\n\n function hashJSObj(obj) {\n var hash;\n\n if (usingWeakMap) {\n hash = weakMap.get(obj);\n\n if (hash !== undefined) {\n return hash;\n }\n }\n\n hash = obj[UID_HASH_KEY];\n\n if (hash !== undefined) {\n return hash;\n }\n\n if (!canDefineProperty) {\n hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n\n if (hash !== undefined) {\n return hash;\n }\n\n hash = getIENodeHash(obj);\n\n if (hash !== undefined) {\n return hash;\n }\n }\n\n hash = ++objHashUID;\n\n if (objHashUID & 0x40000000) {\n objHashUID = 0;\n }\n\n if (usingWeakMap) {\n weakMap.set(obj, hash);\n } else if (isExtensible !== undefined && isExtensible(obj) === false) {\n throw new Error('Non-extensible objects are not allowed as keys.');\n } else if (canDefineProperty) {\n Object.defineProperty(obj, UID_HASH_KEY, {\n 'enumerable': false,\n 'configurable': false,\n 'writable': false,\n 'value': hash\n });\n } else if (obj.propertyIsEnumerable !== undefined && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n // Since we can't define a non-enumerable property on the object\n // we'll hijack one of the less-used non-enumerable properties to\n // save our hash on it. Since this is a function it will not show up in\n // `JSON.stringify` which is what we want.\n obj.propertyIsEnumerable = function () {\n return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n };\n\n obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n } else if (obj.nodeType !== undefined) {\n // At this point we couldn't get the IE `uniqueID` to use as a hash\n // and we couldn't use a non-enumerable property to exploit the\n // dontEnum bug so we simply add the `UID_HASH_KEY` on the node\n // itself.\n obj[UID_HASH_KEY] = hash;\n } else {\n throw new Error('Unable to set a non-enumerable property on object.');\n }\n\n return hash;\n } // Get references to ES5 object methods.\n\n\n var isExtensible = Object.isExtensible; // True if Object.defineProperty works as expected. IE8 fails this test.\n\n var canDefineProperty = function () {\n try {\n Object.defineProperty({}, '@', {});\n return true;\n } catch (e) {\n return false;\n }\n }(); // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it\n // and avoid memory leaks from the IE cloneNode bug.\n\n\n function getIENodeHash(node) {\n if (node && node.nodeType > 0) {\n switch (node.nodeType) {\n case 1:\n // Element\n return node.uniqueID;\n\n case 9:\n // Document\n return node.documentElement && node.documentElement.uniqueID;\n }\n }\n } // If possible, use a WeakMap.\n\n\n var usingWeakMap = typeof WeakMap === 'function';\n var weakMap;\n\n if (usingWeakMap) {\n weakMap = new WeakMap();\n }\n\n var objHashUID = 0;\n var UID_HASH_KEY = '__immutablehash__';\n\n if (typeof Symbol === 'function') {\n UID_HASH_KEY = Symbol(UID_HASH_KEY);\n }\n\n var STRING_HASH_CACHE_MIN_STRLEN = 16;\n var STRING_HASH_CACHE_MAX_SIZE = 255;\n var STRING_HASH_CACHE_SIZE = 0;\n var stringHashCache = {};\n\n function assertNotInfinite(size) {\n invariant(size !== Infinity, 'Cannot perform this action with an infinite size.');\n }\n\n createClass(Map, KeyedCollection); // @pragma Construction\n\n function Map(value) {\n return value === null || value === undefined ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function (map) {\n var iter = KeyedIterable(value);\n assertNotInfinite(iter.size);\n iter.forEach(function (v, k) {\n return map.set(k, v);\n });\n });\n }\n\n Map.of = function () {\n var keyValues = SLICE$0.call(arguments, 0);\n return emptyMap().withMutations(function (map) {\n for (var i = 0; i < keyValues.length; i += 2) {\n if (i + 1 >= keyValues.length) {\n throw new Error('Missing value for key: ' + keyValues[i]);\n }\n\n map.set(keyValues[i], keyValues[i + 1]);\n }\n });\n };\n\n Map.prototype.toString = function () {\n return this.__toString('Map {', '}');\n }; // @pragma Access\n\n\n Map.prototype.get = function (k, notSetValue) {\n return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue;\n }; // @pragma Modification\n\n\n Map.prototype.set = function (k, v) {\n return updateMap(this, k, v);\n };\n\n Map.prototype.setIn = function (keyPath, v) {\n return this.updateIn(keyPath, NOT_SET, function () {\n return v;\n });\n };\n\n Map.prototype.remove = function (k) {\n return updateMap(this, k, NOT_SET);\n };\n\n Map.prototype.deleteIn = function (keyPath) {\n return this.updateIn(keyPath, function () {\n return NOT_SET;\n });\n };\n\n Map.prototype.update = function (k, notSetValue, updater) {\n return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater);\n };\n\n Map.prototype.updateIn = function (keyPath, notSetValue, updater) {\n if (!updater) {\n updater = notSetValue;\n notSetValue = undefined;\n }\n\n var updatedValue = updateInDeepMap(this, forceIterator(keyPath), notSetValue, updater);\n return updatedValue === NOT_SET ? undefined : updatedValue;\n };\n\n Map.prototype.clear = function () {\n if (this.size === 0) {\n return this;\n }\n\n if (this.__ownerID) {\n this.size = 0;\n this._root = null;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return emptyMap();\n }; // @pragma Composition\n\n\n Map.prototype.merge = function ()\n /*...iters*/\n {\n return mergeIntoMapWith(this, undefined, arguments);\n };\n\n Map.prototype.mergeWith = function (merger) {\n var iters = SLICE$0.call(arguments, 1);\n return mergeIntoMapWith(this, merger, iters);\n };\n\n Map.prototype.mergeIn = function (keyPath) {\n var iters = SLICE$0.call(arguments, 1);\n return this.updateIn(keyPath, emptyMap(), function (m) {\n return typeof m.merge === 'function' ? m.merge.apply(m, iters) : iters[iters.length - 1];\n });\n };\n\n Map.prototype.mergeDeep = function ()\n /*...iters*/\n {\n return mergeIntoMapWith(this, deepMerger, arguments);\n };\n\n Map.prototype.mergeDeepWith = function (merger) {\n var iters = SLICE$0.call(arguments, 1);\n return mergeIntoMapWith(this, deepMergerWith(merger), iters);\n };\n\n Map.prototype.mergeDeepIn = function (keyPath) {\n var iters = SLICE$0.call(arguments, 1);\n return this.updateIn(keyPath, emptyMap(), function (m) {\n return typeof m.mergeDeep === 'function' ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1];\n });\n };\n\n Map.prototype.sort = function (comparator) {\n // Late binding\n return OrderedMap(sortFactory(this, comparator));\n };\n\n Map.prototype.sortBy = function (mapper, comparator) {\n // Late binding\n return OrderedMap(sortFactory(this, comparator, mapper));\n }; // @pragma Mutability\n\n\n Map.prototype.withMutations = function (fn) {\n var mutable = this.asMutable();\n fn(mutable);\n return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n };\n\n Map.prototype.asMutable = function () {\n return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n };\n\n Map.prototype.asImmutable = function () {\n return this.__ensureOwner();\n };\n\n Map.prototype.wasAltered = function () {\n return this.__altered;\n };\n\n Map.prototype.__iterator = function (type, reverse) {\n return new MapIterator(this, type, reverse);\n };\n\n Map.prototype.__iterate = function (fn, reverse) {\n var this$0 = this;\n var iterations = 0;\n this._root && this._root.iterate(function (entry) {\n iterations++;\n return fn(entry[1], entry[0], this$0);\n }, reverse);\n return iterations;\n };\n\n Map.prototype.__ensureOwner = function (ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n if (!ownerID) {\n this.__ownerID = ownerID;\n this.__altered = false;\n return this;\n }\n\n return makeMap(this.size, this._root, ownerID, this.__hash);\n };\n\n function isMap(maybeMap) {\n return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);\n }\n\n Map.isMap = isMap;\n var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\n var MapPrototype = Map.prototype;\n MapPrototype[IS_MAP_SENTINEL] = true;\n MapPrototype[DELETE] = MapPrototype.remove;\n MapPrototype.removeIn = MapPrototype.deleteIn; // #pragma Trie Nodes\n\n function ArrayMapNode(ownerID, entries) {\n this.ownerID = ownerID;\n this.entries = entries;\n }\n\n ArrayMapNode.prototype.get = function (shift, keyHash, key, notSetValue) {\n var entries = this.entries;\n\n for (var ii = 0, len = entries.length; ii < len; ii++) {\n if (is(key, entries[ii][0])) {\n return entries[ii][1];\n }\n }\n\n return notSetValue;\n };\n\n ArrayMapNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n var removed = value === NOT_SET;\n var entries = this.entries;\n var idx = 0;\n\n for (var len = entries.length; idx < len; idx++) {\n if (is(key, entries[idx][0])) {\n break;\n }\n }\n\n var exists = idx < len;\n\n if (exists ? entries[idx][1] === value : removed) {\n return this;\n }\n\n SetRef(didAlter);\n (removed || !exists) && SetRef(didChangeSize);\n\n if (removed && entries.length === 1) {\n return; // undefined\n }\n\n if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {\n return createNodes(ownerID, entries, key, value);\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newEntries = isEditable ? entries : arrCopy(entries);\n\n if (exists) {\n if (removed) {\n idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop();\n } else {\n newEntries[idx] = [key, value];\n }\n } else {\n newEntries.push([key, value]);\n }\n\n if (isEditable) {\n this.entries = newEntries;\n return this;\n }\n\n return new ArrayMapNode(ownerID, newEntries);\n };\n\n function BitmapIndexedNode(ownerID, bitmap, nodes) {\n this.ownerID = ownerID;\n this.bitmap = bitmap;\n this.nodes = nodes;\n }\n\n BitmapIndexedNode.prototype.get = function (shift, keyHash, key, notSetValue) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK);\n var bitmap = this.bitmap;\n return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & bit - 1)].get(shift + SHIFT, keyHash, key, notSetValue);\n };\n\n BitmapIndexedNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var bit = 1 << keyHashFrag;\n var bitmap = this.bitmap;\n var exists = (bitmap & bit) !== 0;\n\n if (!exists && value === NOT_SET) {\n return this;\n }\n\n var idx = popCount(bitmap & bit - 1);\n var nodes = this.nodes;\n var node = exists ? nodes[idx] : undefined;\n var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\n if (newNode === node) {\n return this;\n }\n\n if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {\n return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);\n }\n\n if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n return nodes[idx ^ 1];\n }\n\n if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n return newNode;\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);\n\n if (isEditable) {\n this.bitmap = newBitmap;\n this.nodes = newNodes;\n return this;\n }\n\n return new BitmapIndexedNode(ownerID, newBitmap, newNodes);\n };\n\n function HashArrayMapNode(ownerID, count, nodes) {\n this.ownerID = ownerID;\n this.count = count;\n this.nodes = nodes;\n }\n\n HashArrayMapNode.prototype.get = function (shift, keyHash, key, notSetValue) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var node = this.nodes[idx];\n return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;\n };\n\n HashArrayMapNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var removed = value === NOT_SET;\n var nodes = this.nodes;\n var node = nodes[idx];\n\n if (removed && !node) {\n return this;\n }\n\n var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\n if (newNode === node) {\n return this;\n }\n\n var newCount = this.count;\n\n if (!node) {\n newCount++;\n } else if (!newNode) {\n newCount--;\n\n if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {\n return packNodes(ownerID, nodes, newCount, idx);\n }\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newNodes = setIn(nodes, idx, newNode, isEditable);\n\n if (isEditable) {\n this.count = newCount;\n this.nodes = newNodes;\n return this;\n }\n\n return new HashArrayMapNode(ownerID, newCount, newNodes);\n };\n\n function HashCollisionNode(ownerID, keyHash, entries) {\n this.ownerID = ownerID;\n this.keyHash = keyHash;\n this.entries = entries;\n }\n\n HashCollisionNode.prototype.get = function (shift, keyHash, key, notSetValue) {\n var entries = this.entries;\n\n for (var ii = 0, len = entries.length; ii < len; ii++) {\n if (is(key, entries[ii][0])) {\n return entries[ii][1];\n }\n }\n\n return notSetValue;\n };\n\n HashCollisionNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (keyHash === undefined) {\n keyHash = hash(key);\n }\n\n var removed = value === NOT_SET;\n\n if (keyHash !== this.keyHash) {\n if (removed) {\n return this;\n }\n\n SetRef(didAlter);\n SetRef(didChangeSize);\n return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);\n }\n\n var entries = this.entries;\n var idx = 0;\n\n for (var len = entries.length; idx < len; idx++) {\n if (is(key, entries[idx][0])) {\n break;\n }\n }\n\n var exists = idx < len;\n\n if (exists ? entries[idx][1] === value : removed) {\n return this;\n }\n\n SetRef(didAlter);\n (removed || !exists) && SetRef(didChangeSize);\n\n if (removed && len === 2) {\n return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);\n }\n\n var isEditable = ownerID && ownerID === this.ownerID;\n var newEntries = isEditable ? entries : arrCopy(entries);\n\n if (exists) {\n if (removed) {\n idx === len - 1 ? newEntries.pop() : newEntries[idx] = newEntries.pop();\n } else {\n newEntries[idx] = [key, value];\n }\n } else {\n newEntries.push([key, value]);\n }\n\n if (isEditable) {\n this.entries = newEntries;\n return this;\n }\n\n return new HashCollisionNode(ownerID, this.keyHash, newEntries);\n };\n\n function ValueNode(ownerID, keyHash, entry) {\n this.ownerID = ownerID;\n this.keyHash = keyHash;\n this.entry = entry;\n }\n\n ValueNode.prototype.get = function (shift, keyHash, key, notSetValue) {\n return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n };\n\n ValueNode.prototype.update = function (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n var removed = value === NOT_SET;\n var keyMatch = is(key, this.entry[0]);\n\n if (keyMatch ? value === this.entry[1] : removed) {\n return this;\n }\n\n SetRef(didAlter);\n\n if (removed) {\n SetRef(didChangeSize);\n return; // undefined\n }\n\n if (keyMatch) {\n if (ownerID && ownerID === this.ownerID) {\n this.entry[1] = value;\n return this;\n }\n\n return new ValueNode(ownerID, this.keyHash, [key, value]);\n }\n\n SetRef(didChangeSize);\n return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);\n }; // #pragma Iterators\n\n\n ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function (fn, reverse) {\n var entries = this.entries;\n\n for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n return false;\n }\n }\n };\n\n BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function (fn, reverse) {\n var nodes = this.nodes;\n\n for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n var node = nodes[reverse ? maxIndex - ii : ii];\n\n if (node && node.iterate(fn, reverse) === false) {\n return false;\n }\n }\n };\n\n ValueNode.prototype.iterate = function (fn, reverse) {\n return fn(this.entry);\n };\n\n createClass(MapIterator, Iterator);\n\n function MapIterator(map, type, reverse) {\n this._type = type;\n this._reverse = reverse;\n this._stack = map._root && mapIteratorFrame(map._root);\n }\n\n MapIterator.prototype.next = function () {\n var type = this._type;\n var stack = this._stack;\n\n while (stack) {\n var node = stack.node;\n var index = stack.index++;\n var maxIndex;\n\n if (node.entry) {\n if (index === 0) {\n return mapIteratorValue(type, node.entry);\n }\n } else if (node.entries) {\n maxIndex = node.entries.length - 1;\n\n if (index <= maxIndex) {\n return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n }\n } else {\n maxIndex = node.nodes.length - 1;\n\n if (index <= maxIndex) {\n var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n\n if (subNode) {\n if (subNode.entry) {\n return mapIteratorValue(type, subNode.entry);\n }\n\n stack = this._stack = mapIteratorFrame(subNode, stack);\n }\n\n continue;\n }\n }\n\n stack = this._stack = this._stack.__prev;\n }\n\n return iteratorDone();\n };\n\n function mapIteratorValue(type, entry) {\n return iteratorValue(type, entry[0], entry[1]);\n }\n\n function mapIteratorFrame(node, prev) {\n return {\n node: node,\n index: 0,\n __prev: prev\n };\n }\n\n function makeMap(size, root, ownerID, hash) {\n var map = Object.create(MapPrototype);\n map.size = size;\n map._root = root;\n map.__ownerID = ownerID;\n map.__hash = hash;\n map.__altered = false;\n return map;\n }\n\n var EMPTY_MAP;\n\n function emptyMap() {\n return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n }\n\n function updateMap(map, k, v) {\n var newRoot;\n var newSize;\n\n if (!map._root) {\n if (v === NOT_SET) {\n return map;\n }\n\n newSize = 1;\n newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);\n } else {\n var didChangeSize = MakeRef(CHANGE_LENGTH);\n var didAlter = MakeRef(DID_ALTER);\n newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);\n\n if (!didAlter.value) {\n return map;\n }\n\n newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n }\n\n if (map.__ownerID) {\n map.size = newSize;\n map._root = newRoot;\n map.__hash = undefined;\n map.__altered = true;\n return map;\n }\n\n return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n }\n\n function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n if (!node) {\n if (value === NOT_SET) {\n return node;\n }\n\n SetRef(didAlter);\n SetRef(didChangeSize);\n return new ValueNode(ownerID, keyHash, [key, value]);\n }\n\n return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);\n }\n\n function isLeafNode(node) {\n return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n }\n\n function mergeIntoNode(node, ownerID, shift, keyHash, entry) {\n if (node.keyHash === keyHash) {\n return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);\n }\n\n var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;\n var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n var newNode;\n var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : (newNode = new ValueNode(ownerID, keyHash, entry), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n return new BitmapIndexedNode(ownerID, 1 << idx1 | 1 << idx2, nodes);\n }\n\n function createNodes(ownerID, entries, key, value) {\n if (!ownerID) {\n ownerID = new OwnerID();\n }\n\n var node = new ValueNode(ownerID, hash(key), [key, value]);\n\n for (var ii = 0; ii < entries.length; ii++) {\n var entry = entries[ii];\n node = node.update(ownerID, 0, undefined, entry[0], entry[1]);\n }\n\n return node;\n }\n\n function packNodes(ownerID, nodes, count, excluding) {\n var bitmap = 0;\n var packedII = 0;\n var packedNodes = new Array(count);\n\n for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {\n var node = nodes[ii];\n\n if (node !== undefined && ii !== excluding) {\n bitmap |= bit;\n packedNodes[packedII++] = node;\n }\n }\n\n return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n }\n\n function expandNodes(ownerID, nodes, bitmap, including, node) {\n var count = 0;\n var expandedNodes = new Array(SIZE);\n\n for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n }\n\n expandedNodes[including] = node;\n return new HashArrayMapNode(ownerID, count + 1, expandedNodes);\n }\n\n function mergeIntoMapWith(map, merger, iterables) {\n var iters = [];\n\n for (var ii = 0; ii < iterables.length; ii++) {\n var value = iterables[ii];\n var iter = KeyedIterable(value);\n\n if (!isIterable(value)) {\n iter = iter.map(function (v) {\n return fromJS(v);\n });\n }\n\n iters.push(iter);\n }\n\n return mergeIntoCollectionWith(map, merger, iters);\n }\n\n function deepMerger(existing, value, key) {\n return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value;\n }\n\n function deepMergerWith(merger) {\n return function (existing, value, key) {\n if (existing && existing.mergeDeepWith && isIterable(value)) {\n return existing.mergeDeepWith(merger, value);\n }\n\n var nextValue = merger(existing, value, key);\n return is(existing, nextValue) ? existing : nextValue;\n };\n }\n\n function mergeIntoCollectionWith(collection, merger, iters) {\n iters = iters.filter(function (x) {\n return x.size !== 0;\n });\n\n if (iters.length === 0) {\n return collection;\n }\n\n if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {\n return collection.constructor(iters[0]);\n }\n\n return collection.withMutations(function (collection) {\n var mergeIntoMap = merger ? function (value, key) {\n collection.update(key, NOT_SET, function (existing) {\n return existing === NOT_SET ? value : merger(existing, value, key);\n });\n } : function (value, key) {\n collection.set(key, value);\n };\n\n for (var ii = 0; ii < iters.length; ii++) {\n iters[ii].forEach(mergeIntoMap);\n }\n });\n }\n\n function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {\n var isNotSet = existing === NOT_SET;\n var step = keyPathIter.next();\n\n if (step.done) {\n var existingValue = isNotSet ? notSetValue : existing;\n var newValue = updater(existingValue);\n return newValue === existingValue ? existing : newValue;\n }\n\n invariant(isNotSet || existing && existing.set, 'invalid keyPath');\n var key = step.value;\n var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);\n var nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater);\n return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated);\n }\n\n function popCount(x) {\n x = x - (x >> 1 & 0x55555555);\n x = (x & 0x33333333) + (x >> 2 & 0x33333333);\n x = x + (x >> 4) & 0x0f0f0f0f;\n x = x + (x >> 8);\n x = x + (x >> 16);\n return x & 0x7f;\n }\n\n function setIn(array, idx, val, canEdit) {\n var newArray = canEdit ? array : arrCopy(array);\n newArray[idx] = val;\n return newArray;\n }\n\n function spliceIn(array, idx, val, canEdit) {\n var newLen = array.length + 1;\n\n if (canEdit && idx + 1 === newLen) {\n array[idx] = val;\n return array;\n }\n\n var newArray = new Array(newLen);\n var after = 0;\n\n for (var ii = 0; ii < newLen; ii++) {\n if (ii === idx) {\n newArray[ii] = val;\n after = -1;\n } else {\n newArray[ii] = array[ii + after];\n }\n }\n\n return newArray;\n }\n\n function spliceOut(array, idx, canEdit) {\n var newLen = array.length - 1;\n\n if (canEdit && idx === newLen) {\n array.pop();\n return array;\n }\n\n var newArray = new Array(newLen);\n var after = 0;\n\n for (var ii = 0; ii < newLen; ii++) {\n if (ii === idx) {\n after = 1;\n }\n\n newArray[ii] = array[ii + after];\n }\n\n return newArray;\n }\n\n var MAX_ARRAY_MAP_SIZE = SIZE / 4;\n var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;\n var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;\n createClass(List, IndexedCollection); // @pragma Construction\n\n function List(value) {\n var empty = emptyList();\n\n if (value === null || value === undefined) {\n return empty;\n }\n\n if (isList(value)) {\n return value;\n }\n\n var iter = IndexedIterable(value);\n var size = iter.size;\n\n if (size === 0) {\n return empty;\n }\n\n assertNotInfinite(size);\n\n if (size > 0 && size < SIZE) {\n return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));\n }\n\n return empty.withMutations(function (list) {\n list.setSize(size);\n iter.forEach(function (v, i) {\n return list.set(i, v);\n });\n });\n }\n\n List.of = function ()\n /*...values*/\n {\n return this(arguments);\n };\n\n List.prototype.toString = function () {\n return this.__toString('List [', ']');\n }; // @pragma Access\n\n\n List.prototype.get = function (index, notSetValue) {\n index = wrapIndex(this, index);\n\n if (index >= 0 && index < this.size) {\n index += this._origin;\n var node = listNodeFor(this, index);\n return node && node.array[index & MASK];\n }\n\n return notSetValue;\n }; // @pragma Modification\n\n\n List.prototype.set = function (index, value) {\n return updateList(this, index, value);\n };\n\n List.prototype.remove = function (index) {\n return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1);\n };\n\n List.prototype.insert = function (index, value) {\n return this.splice(index, 0, value);\n };\n\n List.prototype.clear = function () {\n if (this.size === 0) {\n return this;\n }\n\n if (this.__ownerID) {\n this.size = this._origin = this._capacity = 0;\n this._level = SHIFT;\n this._root = this._tail = null;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return emptyList();\n };\n\n List.prototype.push = function ()\n /*...values*/\n {\n var values = arguments;\n var oldSize = this.size;\n return this.withMutations(function (list) {\n setListBounds(list, 0, oldSize + values.length);\n\n for (var ii = 0; ii < values.length; ii++) {\n list.set(oldSize + ii, values[ii]);\n }\n });\n };\n\n List.prototype.pop = function () {\n return setListBounds(this, 0, -1);\n };\n\n List.prototype.unshift = function ()\n /*...values*/\n {\n var values = arguments;\n return this.withMutations(function (list) {\n setListBounds(list, -values.length);\n\n for (var ii = 0; ii < values.length; ii++) {\n list.set(ii, values[ii]);\n }\n });\n };\n\n List.prototype.shift = function () {\n return setListBounds(this, 1);\n }; // @pragma Composition\n\n\n List.prototype.merge = function ()\n /*...iters*/\n {\n return mergeIntoListWith(this, undefined, arguments);\n };\n\n List.prototype.mergeWith = function (merger) {\n var iters = SLICE$0.call(arguments, 1);\n return mergeIntoListWith(this, merger, iters);\n };\n\n List.prototype.mergeDeep = function ()\n /*...iters*/\n {\n return mergeIntoListWith(this, deepMerger, arguments);\n };\n\n List.prototype.mergeDeepWith = function (merger) {\n var iters = SLICE$0.call(arguments, 1);\n return mergeIntoListWith(this, deepMergerWith(merger), iters);\n };\n\n List.prototype.setSize = function (size) {\n return setListBounds(this, 0, size);\n }; // @pragma Iteration\n\n\n List.prototype.slice = function (begin, end) {\n var size = this.size;\n\n if (wholeSlice(begin, end, size)) {\n return this;\n }\n\n return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));\n };\n\n List.prototype.__iterator = function (type, reverse) {\n var index = 0;\n var values = iterateList(this, reverse);\n return new Iterator(function () {\n var value = values();\n return value === DONE ? iteratorDone() : iteratorValue(type, index++, value);\n });\n };\n\n List.prototype.__iterate = function (fn, reverse) {\n var index = 0;\n var values = iterateList(this, reverse);\n var value;\n\n while ((value = values()) !== DONE) {\n if (fn(value, index++, this) === false) {\n break;\n }\n }\n\n return index;\n };\n\n List.prototype.__ensureOwner = function (ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n if (!ownerID) {\n this.__ownerID = ownerID;\n return this;\n }\n\n return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n };\n\n function isList(maybeList) {\n return !!(maybeList && maybeList[IS_LIST_SENTINEL]);\n }\n\n List.isList = isList;\n var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\n var ListPrototype = List.prototype;\n ListPrototype[IS_LIST_SENTINEL] = true;\n ListPrototype[DELETE] = ListPrototype.remove;\n ListPrototype.setIn = MapPrototype.setIn;\n ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn;\n ListPrototype.update = MapPrototype.update;\n ListPrototype.updateIn = MapPrototype.updateIn;\n ListPrototype.mergeIn = MapPrototype.mergeIn;\n ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n ListPrototype.withMutations = MapPrototype.withMutations;\n ListPrototype.asMutable = MapPrototype.asMutable;\n ListPrototype.asImmutable = MapPrototype.asImmutable;\n ListPrototype.wasAltered = MapPrototype.wasAltered;\n\n function VNode(array, ownerID) {\n this.array = array;\n this.ownerID = ownerID;\n } // TODO: seems like these methods are very similar\n\n\n VNode.prototype.removeBefore = function (ownerID, level, index) {\n if (index === level ? 1 << level : 0 || this.array.length === 0) {\n return this;\n }\n\n var originIndex = index >>> level & MASK;\n\n if (originIndex >= this.array.length) {\n return new VNode([], ownerID);\n }\n\n var removingFirst = originIndex === 0;\n var newChild;\n\n if (level > 0) {\n var oldChild = this.array[originIndex];\n newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n\n if (newChild === oldChild && removingFirst) {\n return this;\n }\n }\n\n if (removingFirst && !newChild) {\n return this;\n }\n\n var editable = editableVNode(this, ownerID);\n\n if (!removingFirst) {\n for (var ii = 0; ii < originIndex; ii++) {\n editable.array[ii] = undefined;\n }\n }\n\n if (newChild) {\n editable.array[originIndex] = newChild;\n }\n\n return editable;\n };\n\n VNode.prototype.removeAfter = function (ownerID, level, index) {\n if (index === (level ? 1 << level : 0) || this.array.length === 0) {\n return this;\n }\n\n var sizeIndex = index - 1 >>> level & MASK;\n\n if (sizeIndex >= this.array.length) {\n return this;\n }\n\n var newChild;\n\n if (level > 0) {\n var oldChild = this.array[sizeIndex];\n newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n\n if (newChild === oldChild && sizeIndex === this.array.length - 1) {\n return this;\n }\n }\n\n var editable = editableVNode(this, ownerID);\n editable.array.splice(sizeIndex + 1);\n\n if (newChild) {\n editable.array[sizeIndex] = newChild;\n }\n\n return editable;\n };\n\n var DONE = {};\n\n function iterateList(list, reverse) {\n var left = list._origin;\n var right = list._capacity;\n var tailPos = getTailOffset(right);\n var tail = list._tail;\n return iterateNodeOrLeaf(list._root, list._level, 0);\n\n function iterateNodeOrLeaf(node, level, offset) {\n return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset);\n }\n\n function iterateLeaf(node, offset) {\n var array = offset === tailPos ? tail && tail.array : node && node.array;\n var from = offset > left ? 0 : left - offset;\n var to = right - offset;\n\n if (to > SIZE) {\n to = SIZE;\n }\n\n return function () {\n if (from === to) {\n return DONE;\n }\n\n var idx = reverse ? --to : from++;\n return array && array[idx];\n };\n }\n\n function iterateNode(node, level, offset) {\n var values;\n var array = node && node.array;\n var from = offset > left ? 0 : left - offset >> level;\n var to = (right - offset >> level) + 1;\n\n if (to > SIZE) {\n to = SIZE;\n }\n\n return function () {\n do {\n if (values) {\n var value = values();\n\n if (value !== DONE) {\n return value;\n }\n\n values = null;\n }\n\n if (from === to) {\n return DONE;\n }\n\n var idx = reverse ? --to : from++;\n values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level));\n } while (true);\n };\n }\n }\n\n function makeList(origin, capacity, level, root, tail, ownerID, hash) {\n var list = Object.create(ListPrototype);\n list.size = capacity - origin;\n list._origin = origin;\n list._capacity = capacity;\n list._level = level;\n list._root = root;\n list._tail = tail;\n list.__ownerID = ownerID;\n list.__hash = hash;\n list.__altered = false;\n return list;\n }\n\n var EMPTY_LIST;\n\n function emptyList() {\n return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n }\n\n function updateList(list, index, value) {\n index = wrapIndex(list, index);\n\n if (index !== index) {\n return list;\n }\n\n if (index >= list.size || index < 0) {\n return list.withMutations(function (list) {\n index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);\n });\n }\n\n index += list._origin;\n var newTail = list._tail;\n var newRoot = list._root;\n var didAlter = MakeRef(DID_ALTER);\n\n if (index >= getTailOffset(list._capacity)) {\n newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n } else {\n newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n }\n\n if (!didAlter.value) {\n return list;\n }\n\n if (list.__ownerID) {\n list._root = newRoot;\n list._tail = newTail;\n list.__hash = undefined;\n list.__altered = true;\n return list;\n }\n\n return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n }\n\n function updateVNode(node, ownerID, level, index, value, didAlter) {\n var idx = index >>> level & MASK;\n var nodeHas = node && idx < node.array.length;\n\n if (!nodeHas && value === undefined) {\n return node;\n }\n\n var newNode;\n\n if (level > 0) {\n var lowerNode = node && node.array[idx];\n var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n\n if (newLowerNode === lowerNode) {\n return node;\n }\n\n newNode = editableVNode(node, ownerID);\n newNode.array[idx] = newLowerNode;\n return newNode;\n }\n\n if (nodeHas && node.array[idx] === value) {\n return node;\n }\n\n SetRef(didAlter);\n newNode = editableVNode(node, ownerID);\n\n if (value === undefined && idx === newNode.array.length - 1) {\n newNode.array.pop();\n } else {\n newNode.array[idx] = value;\n }\n\n return newNode;\n }\n\n function editableVNode(node, ownerID) {\n if (ownerID && node && ownerID === node.ownerID) {\n return node;\n }\n\n return new VNode(node ? node.array.slice() : [], ownerID);\n }\n\n function listNodeFor(list, rawIndex) {\n if (rawIndex >= getTailOffset(list._capacity)) {\n return list._tail;\n }\n\n if (rawIndex < 1 << list._level + SHIFT) {\n var node = list._root;\n var level = list._level;\n\n while (node && level > 0) {\n node = node.array[rawIndex >>> level & MASK];\n level -= SHIFT;\n }\n\n return node;\n }\n }\n\n function setListBounds(list, begin, end) {\n // Sanitize begin & end using this shorthand for ToInt32(argument)\n // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32\n if (begin !== undefined) {\n begin = begin | 0;\n }\n\n if (end !== undefined) {\n end = end | 0;\n }\n\n var owner = list.__ownerID || new OwnerID();\n var oldOrigin = list._origin;\n var oldCapacity = list._capacity;\n var newOrigin = oldOrigin + begin;\n var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n\n if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n return list;\n } // If it's going to end after it starts, it's empty.\n\n\n if (newOrigin >= newCapacity) {\n return list.clear();\n }\n\n var newLevel = list._level;\n var newRoot = list._root; // New origin might need creating a higher root.\n\n var offsetShift = 0;\n\n while (newOrigin + offsetShift < 0) {\n newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n newLevel += SHIFT;\n offsetShift += 1 << newLevel;\n }\n\n if (offsetShift) {\n newOrigin += offsetShift;\n oldOrigin += offsetShift;\n newCapacity += offsetShift;\n oldCapacity += offsetShift;\n }\n\n var oldTailOffset = getTailOffset(oldCapacity);\n var newTailOffset = getTailOffset(newCapacity); // New size might need creating a higher root.\n\n while (newTailOffset >= 1 << newLevel + SHIFT) {\n newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n newLevel += SHIFT;\n } // Locate or create the new tail.\n\n\n var oldTail = list._tail;\n var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; // Merge Tail into tree.\n\n if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n newRoot = editableVNode(newRoot, owner);\n var node = newRoot;\n\n for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n var idx = oldTailOffset >>> level & MASK;\n node = node.array[idx] = editableVNode(node.array[idx], owner);\n }\n\n node.array[oldTailOffset >>> SHIFT & MASK] = oldTail;\n } // If the size has been reduced, there's a chance the tail needs to be trimmed.\n\n\n if (newCapacity < oldCapacity) {\n newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n } // If the new origin is within the tail, then we do not need a root.\n\n\n if (newOrigin >= newTailOffset) {\n newOrigin -= newTailOffset;\n newCapacity -= newTailOffset;\n newLevel = SHIFT;\n newRoot = null;\n newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); // Otherwise, if the root has been trimmed, garbage collect.\n } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n offsetShift = 0; // Identify the new top root node of the subtree of the old root.\n\n while (newRoot) {\n var beginIndex = newOrigin >>> newLevel & MASK;\n\n if (beginIndex !== newTailOffset >>> newLevel & MASK) {\n break;\n }\n\n if (beginIndex) {\n offsetShift += (1 << newLevel) * beginIndex;\n }\n\n newLevel -= SHIFT;\n newRoot = newRoot.array[beginIndex];\n } // Trim the new sides of the new root.\n\n\n if (newRoot && newOrigin > oldOrigin) {\n newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n }\n\n if (newRoot && newTailOffset < oldTailOffset) {\n newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n }\n\n if (offsetShift) {\n newOrigin -= offsetShift;\n newCapacity -= offsetShift;\n }\n }\n\n if (list.__ownerID) {\n list.size = newCapacity - newOrigin;\n list._origin = newOrigin;\n list._capacity = newCapacity;\n list._level = newLevel;\n list._root = newRoot;\n list._tail = newTail;\n list.__hash = undefined;\n list.__altered = true;\n return list;\n }\n\n return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n }\n\n function mergeIntoListWith(list, merger, iterables) {\n var iters = [];\n var maxSize = 0;\n\n for (var ii = 0; ii < iterables.length; ii++) {\n var value = iterables[ii];\n var iter = IndexedIterable(value);\n\n if (iter.size > maxSize) {\n maxSize = iter.size;\n }\n\n if (!isIterable(value)) {\n iter = iter.map(function (v) {\n return fromJS(v);\n });\n }\n\n iters.push(iter);\n }\n\n if (maxSize > list.size) {\n list = list.setSize(maxSize);\n }\n\n return mergeIntoCollectionWith(list, merger, iters);\n }\n\n function getTailOffset(size) {\n return size < SIZE ? 0 : size - 1 >>> SHIFT << SHIFT;\n }\n\n createClass(OrderedMap, Map); // @pragma Construction\n\n function OrderedMap(value) {\n return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function (map) {\n var iter = KeyedIterable(value);\n assertNotInfinite(iter.size);\n iter.forEach(function (v, k) {\n return map.set(k, v);\n });\n });\n }\n\n OrderedMap.of = function ()\n /*...values*/\n {\n return this(arguments);\n };\n\n OrderedMap.prototype.toString = function () {\n return this.__toString('OrderedMap {', '}');\n }; // @pragma Access\n\n\n OrderedMap.prototype.get = function (k, notSetValue) {\n var index = this._map.get(k);\n\n return index !== undefined ? this._list.get(index)[1] : notSetValue;\n }; // @pragma Modification\n\n\n OrderedMap.prototype.clear = function () {\n if (this.size === 0) {\n return this;\n }\n\n if (this.__ownerID) {\n this.size = 0;\n\n this._map.clear();\n\n this._list.clear();\n\n return this;\n }\n\n return emptyOrderedMap();\n };\n\n OrderedMap.prototype.set = function (k, v) {\n return updateOrderedMap(this, k, v);\n };\n\n OrderedMap.prototype.remove = function (k) {\n return updateOrderedMap(this, k, NOT_SET);\n };\n\n OrderedMap.prototype.wasAltered = function () {\n return this._map.wasAltered() || this._list.wasAltered();\n };\n\n OrderedMap.prototype.__iterate = function (fn, reverse) {\n var this$0 = this;\n return this._list.__iterate(function (entry) {\n return entry && fn(entry[1], entry[0], this$0);\n }, reverse);\n };\n\n OrderedMap.prototype.__iterator = function (type, reverse) {\n return this._list.fromEntrySeq().__iterator(type, reverse);\n };\n\n OrderedMap.prototype.__ensureOwner = function (ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n var newMap = this._map.__ensureOwner(ownerID);\n\n var newList = this._list.__ensureOwner(ownerID);\n\n if (!ownerID) {\n this.__ownerID = ownerID;\n this._map = newMap;\n this._list = newList;\n return this;\n }\n\n return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n };\n\n function isOrderedMap(maybeOrderedMap) {\n return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);\n }\n\n OrderedMap.isOrderedMap = isOrderedMap;\n OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;\n OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\n function makeOrderedMap(map, list, ownerID, hash) {\n var omap = Object.create(OrderedMap.prototype);\n omap.size = map ? map.size : 0;\n omap._map = map;\n omap._list = list;\n omap.__ownerID = ownerID;\n omap.__hash = hash;\n return omap;\n }\n\n var EMPTY_ORDERED_MAP;\n\n function emptyOrderedMap() {\n return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n }\n\n function updateOrderedMap(omap, k, v) {\n var map = omap._map;\n var list = omap._list;\n var i = map.get(k);\n var has = i !== undefined;\n var newMap;\n var newList;\n\n if (v === NOT_SET) {\n // removed\n if (!has) {\n return omap;\n }\n\n if (list.size >= SIZE && list.size >= map.size * 2) {\n newList = list.filter(function (entry, idx) {\n return entry !== undefined && i !== idx;\n });\n newMap = newList.toKeyedSeq().map(function (entry) {\n return entry[0];\n }).flip().toMap();\n\n if (omap.__ownerID) {\n newMap.__ownerID = newList.__ownerID = omap.__ownerID;\n }\n } else {\n newMap = map.remove(k);\n newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);\n }\n } else {\n if (has) {\n if (v === list.get(i)[1]) {\n return omap;\n }\n\n newMap = map;\n newList = list.set(i, [k, v]);\n } else {\n newMap = map.set(k, list.size);\n newList = list.set(list.size, [k, v]);\n }\n }\n\n if (omap.__ownerID) {\n omap.size = newMap.size;\n omap._map = newMap;\n omap._list = newList;\n omap.__hash = undefined;\n return omap;\n }\n\n return makeOrderedMap(newMap, newList);\n }\n\n createClass(ToKeyedSequence, KeyedSeq);\n\n function ToKeyedSequence(indexed, useKeys) {\n this._iter = indexed;\n this._useKeys = useKeys;\n this.size = indexed.size;\n }\n\n ToKeyedSequence.prototype.get = function (key, notSetValue) {\n return this._iter.get(key, notSetValue);\n };\n\n ToKeyedSequence.prototype.has = function (key) {\n return this._iter.has(key);\n };\n\n ToKeyedSequence.prototype.valueSeq = function () {\n return this._iter.valueSeq();\n };\n\n ToKeyedSequence.prototype.reverse = function () {\n var this$0 = this;\n var reversedSequence = reverseFactory(this, true);\n\n if (!this._useKeys) {\n reversedSequence.valueSeq = function () {\n return this$0._iter.toSeq().reverse();\n };\n }\n\n return reversedSequence;\n };\n\n ToKeyedSequence.prototype.map = function (mapper, context) {\n var this$0 = this;\n var mappedSequence = mapFactory(this, mapper, context);\n\n if (!this._useKeys) {\n mappedSequence.valueSeq = function () {\n return this$0._iter.toSeq().map(mapper, context);\n };\n }\n\n return mappedSequence;\n };\n\n ToKeyedSequence.prototype.__iterate = function (fn, reverse) {\n var this$0 = this;\n var ii;\n return this._iter.__iterate(this._useKeys ? function (v, k) {\n return fn(v, k, this$0);\n } : (ii = reverse ? resolveSize(this) : 0, function (v) {\n return fn(v, reverse ? --ii : ii++, this$0);\n }), reverse);\n };\n\n ToKeyedSequence.prototype.__iterator = function (type, reverse) {\n if (this._useKeys) {\n return this._iter.__iterator(type, reverse);\n }\n\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\n var ii = reverse ? resolveSize(this) : 0;\n return new Iterator(function () {\n var step = iterator.next();\n return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n });\n };\n\n ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;\n createClass(ToIndexedSequence, IndexedSeq);\n\n function ToIndexedSequence(iter) {\n this._iter = iter;\n this.size = iter.size;\n }\n\n ToIndexedSequence.prototype.includes = function (value) {\n return this._iter.includes(value);\n };\n\n ToIndexedSequence.prototype.__iterate = function (fn, reverse) {\n var this$0 = this;\n var iterations = 0;\n return this._iter.__iterate(function (v) {\n return fn(v, iterations++, this$0);\n }, reverse);\n };\n\n ToIndexedSequence.prototype.__iterator = function (type, reverse) {\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\n var iterations = 0;\n return new Iterator(function () {\n var step = iterator.next();\n return step.done ? step : iteratorValue(type, iterations++, step.value, step);\n });\n };\n\n createClass(ToSetSequence, SetSeq);\n\n function ToSetSequence(iter) {\n this._iter = iter;\n this.size = iter.size;\n }\n\n ToSetSequence.prototype.has = function (key) {\n return this._iter.includes(key);\n };\n\n ToSetSequence.prototype.__iterate = function (fn, reverse) {\n var this$0 = this;\n return this._iter.__iterate(function (v) {\n return fn(v, v, this$0);\n }, reverse);\n };\n\n ToSetSequence.prototype.__iterator = function (type, reverse) {\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\n return new Iterator(function () {\n var step = iterator.next();\n return step.done ? step : iteratorValue(type, step.value, step.value, step);\n });\n };\n\n createClass(FromEntriesSequence, KeyedSeq);\n\n function FromEntriesSequence(entries) {\n this._iter = entries;\n this.size = entries.size;\n }\n\n FromEntriesSequence.prototype.entrySeq = function () {\n return this._iter.toSeq();\n };\n\n FromEntriesSequence.prototype.__iterate = function (fn, reverse) {\n var this$0 = this;\n return this._iter.__iterate(function (entry) {\n // Check if entry exists first so array access doesn't throw for holes\n // in the parent iteration.\n if (entry) {\n validateEntry(entry);\n var indexedIterable = isIterable(entry);\n return fn(indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0);\n }\n }, reverse);\n };\n\n FromEntriesSequence.prototype.__iterator = function (type, reverse) {\n var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\n return new Iterator(function () {\n while (true) {\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value; // Check if entry exists first so array access doesn't throw for holes\n // in the parent iteration.\n\n if (entry) {\n validateEntry(entry);\n var indexedIterable = isIterable(entry);\n return iteratorValue(type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step);\n }\n }\n });\n };\n\n ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;\n\n function flipFactory(iterable) {\n var flipSequence = makeSequence(iterable);\n flipSequence._iter = iterable;\n flipSequence.size = iterable.size;\n\n flipSequence.flip = function () {\n return iterable;\n };\n\n flipSequence.reverse = function () {\n var reversedSequence = iterable.reverse.apply(this); // super.reverse()\n\n reversedSequence.flip = function () {\n return iterable.reverse();\n };\n\n return reversedSequence;\n };\n\n flipSequence.has = function (key) {\n return iterable.includes(key);\n };\n\n flipSequence.includes = function (key) {\n return iterable.has(key);\n };\n\n flipSequence.cacheResult = cacheResultThrough;\n\n flipSequence.__iterateUncached = function (fn, reverse) {\n var this$0 = this;\n return iterable.__iterate(function (v, k) {\n return fn(k, v, this$0) !== false;\n }, reverse);\n };\n\n flipSequence.__iteratorUncached = function (type, reverse) {\n if (type === ITERATE_ENTRIES) {\n var iterator = iterable.__iterator(type, reverse);\n\n return new Iterator(function () {\n var step = iterator.next();\n\n if (!step.done) {\n var k = step.value[0];\n step.value[0] = step.value[1];\n step.value[1] = k;\n }\n\n return step;\n });\n }\n\n return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);\n };\n\n return flipSequence;\n }\n\n function mapFactory(iterable, mapper, context) {\n var mappedSequence = makeSequence(iterable);\n mappedSequence.size = iterable.size;\n\n mappedSequence.has = function (key) {\n return iterable.has(key);\n };\n\n mappedSequence.get = function (key, notSetValue) {\n var v = iterable.get(key, NOT_SET);\n return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);\n };\n\n mappedSequence.__iterateUncached = function (fn, reverse) {\n var this$0 = this;\n return iterable.__iterate(function (v, k, c) {\n return fn(mapper.call(context, v, k, c), k, this$0) !== false;\n }, reverse);\n };\n\n mappedSequence.__iteratorUncached = function (type, reverse) {\n var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\n return new Iterator(function () {\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value;\n var key = entry[0];\n return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);\n });\n };\n\n return mappedSequence;\n }\n\n function reverseFactory(iterable, useKeys) {\n var reversedSequence = makeSequence(iterable);\n reversedSequence._iter = iterable;\n reversedSequence.size = iterable.size;\n\n reversedSequence.reverse = function () {\n return iterable;\n };\n\n if (iterable.flip) {\n reversedSequence.flip = function () {\n var flipSequence = flipFactory(iterable);\n\n flipSequence.reverse = function () {\n return iterable.flip();\n };\n\n return flipSequence;\n };\n }\n\n reversedSequence.get = function (key, notSetValue) {\n return iterable.get(useKeys ? key : -1 - key, notSetValue);\n };\n\n reversedSequence.has = function (key) {\n return iterable.has(useKeys ? key : -1 - key);\n };\n\n reversedSequence.includes = function (value) {\n return iterable.includes(value);\n };\n\n reversedSequence.cacheResult = cacheResultThrough;\n\n reversedSequence.__iterate = function (fn, reverse) {\n var this$0 = this;\n return iterable.__iterate(function (v, k) {\n return fn(v, k, this$0);\n }, !reverse);\n };\n\n reversedSequence.__iterator = function (type, reverse) {\n return iterable.__iterator(type, !reverse);\n };\n\n return reversedSequence;\n }\n\n function filterFactory(iterable, predicate, context, useKeys) {\n var filterSequence = makeSequence(iterable);\n\n if (useKeys) {\n filterSequence.has = function (key) {\n var v = iterable.get(key, NOT_SET);\n return v !== NOT_SET && !!predicate.call(context, v, key, iterable);\n };\n\n filterSequence.get = function (key, notSetValue) {\n var v = iterable.get(key, NOT_SET);\n return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;\n };\n }\n\n filterSequence.__iterateUncached = function (fn, reverse) {\n var this$0 = this;\n var iterations = 0;\n\n iterable.__iterate(function (v, k, c) {\n if (predicate.call(context, v, k, c)) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$0);\n }\n }, reverse);\n\n return iterations;\n };\n\n filterSequence.__iteratorUncached = function (type, reverse) {\n var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\n var iterations = 0;\n return new Iterator(function () {\n while (true) {\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value;\n var key = entry[0];\n var value = entry[1];\n\n if (predicate.call(context, value, key, iterable)) {\n return iteratorValue(type, useKeys ? key : iterations++, value, step);\n }\n }\n });\n };\n\n return filterSequence;\n }\n\n function countByFactory(iterable, grouper, context) {\n var groups = Map().asMutable();\n\n iterable.__iterate(function (v, k) {\n groups.update(grouper.call(context, v, k, iterable), 0, function (a) {\n return a + 1;\n });\n });\n\n return groups.asImmutable();\n }\n\n function groupByFactory(iterable, grouper, context) {\n var isKeyedIter = isKeyed(iterable);\n var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();\n\n iterable.__iterate(function (v, k) {\n groups.update(grouper.call(context, v, k, iterable), function (a) {\n return a = a || [], a.push(isKeyedIter ? [k, v] : v), a;\n });\n });\n\n var coerce = iterableClass(iterable);\n return groups.map(function (arr) {\n return reify(iterable, coerce(arr));\n });\n }\n\n function sliceFactory(iterable, begin, end, useKeys) {\n var originalSize = iterable.size; // Sanitize begin & end using this shorthand for ToInt32(argument)\n // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32\n\n if (begin !== undefined) {\n begin = begin | 0;\n }\n\n if (end !== undefined) {\n if (end === Infinity) {\n end = originalSize;\n } else {\n end = end | 0;\n }\n }\n\n if (wholeSlice(begin, end, originalSize)) {\n return iterable;\n }\n\n var resolvedBegin = resolveBegin(begin, originalSize);\n var resolvedEnd = resolveEnd(end, originalSize); // begin or end will be NaN if they were provided as negative numbers and\n // this iterable's size is unknown. In that case, cache first so there is\n // a known size and these do not resolve to NaN.\n\n if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);\n } // Note: resolvedEnd is undefined when the original sequence's length is\n // unknown and this slice did not supply an end and should contain all\n // elements after resolvedBegin.\n // In that case, resolvedSize will be NaN and sliceSize will remain undefined.\n\n\n var resolvedSize = resolvedEnd - resolvedBegin;\n var sliceSize;\n\n if (resolvedSize === resolvedSize) {\n sliceSize = resolvedSize < 0 ? 0 : resolvedSize;\n }\n\n var sliceSeq = makeSequence(iterable); // If iterable.size is undefined, the size of the realized sliceSeq is\n // unknown at this point unless the number of items to slice is 0\n\n sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;\n\n if (!useKeys && isSeq(iterable) && sliceSize >= 0) {\n sliceSeq.get = function (index, notSetValue) {\n index = wrapIndex(this, index);\n return index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue;\n };\n }\n\n sliceSeq.__iterateUncached = function (fn, reverse) {\n var this$0 = this;\n\n if (sliceSize === 0) {\n return 0;\n }\n\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var skipped = 0;\n var isSkipping = true;\n var iterations = 0;\n\n iterable.__iterate(function (v, k) {\n if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$0) !== false && iterations !== sliceSize;\n }\n });\n\n return iterations;\n };\n\n sliceSeq.__iteratorUncached = function (type, reverse) {\n if (sliceSize !== 0 && reverse) {\n return this.cacheResult().__iterator(type, reverse);\n } // Don't bother instantiating parent iterator if taking 0.\n\n\n var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);\n\n var skipped = 0;\n var iterations = 0;\n return new Iterator(function () {\n while (skipped++ < resolvedBegin) {\n iterator.next();\n }\n\n if (++iterations > sliceSize) {\n return iteratorDone();\n }\n\n var step = iterator.next();\n\n if (useKeys || type === ITERATE_VALUES) {\n return step;\n } else if (type === ITERATE_KEYS) {\n return iteratorValue(type, iterations - 1, undefined, step);\n } else {\n return iteratorValue(type, iterations - 1, step.value[1], step);\n }\n });\n };\n\n return sliceSeq;\n }\n\n function takeWhileFactory(iterable, predicate, context) {\n var takeSequence = makeSequence(iterable);\n\n takeSequence.__iterateUncached = function (fn, reverse) {\n var this$0 = this;\n\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var iterations = 0;\n\n iterable.__iterate(function (v, k, c) {\n return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0);\n });\n\n return iterations;\n };\n\n takeSequence.__iteratorUncached = function (type, reverse) {\n var this$0 = this;\n\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n\n var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\n var iterating = true;\n return new Iterator(function () {\n if (!iterating) {\n return iteratorDone();\n }\n\n var step = iterator.next();\n\n if (step.done) {\n return step;\n }\n\n var entry = step.value;\n var k = entry[0];\n var v = entry[1];\n\n if (!predicate.call(context, v, k, this$0)) {\n iterating = false;\n return iteratorDone();\n }\n\n return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n });\n };\n\n return takeSequence;\n }\n\n function skipWhileFactory(iterable, predicate, context, useKeys) {\n var skipSequence = makeSequence(iterable);\n\n skipSequence.__iterateUncached = function (fn, reverse) {\n var this$0 = this;\n\n if (reverse) {\n return this.cacheResult().__iterate(fn, reverse);\n }\n\n var isSkipping = true;\n var iterations = 0;\n\n iterable.__iterate(function (v, k, c) {\n if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n iterations++;\n return fn(v, useKeys ? k : iterations - 1, this$0);\n }\n });\n\n return iterations;\n };\n\n skipSequence.__iteratorUncached = function (type, reverse) {\n var this$0 = this;\n\n if (reverse) {\n return this.cacheResult().__iterator(type, reverse);\n }\n\n var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\n var skipping = true;\n var iterations = 0;\n return new Iterator(function () {\n var step, k, v;\n\n do {\n step = iterator.next();\n\n if (step.done) {\n if (useKeys || type === ITERATE_VALUES) {\n return step;\n } else if (type === ITERATE_KEYS) {\n return iteratorValue(type, iterations++, undefined, step);\n } else {\n return iteratorValue(type, iterations++, step.value[1], step);\n }\n }\n\n var entry = step.value;\n k = entry[0];\n v = entry[1];\n skipping && (skipping = predicate.call(context, v, k, this$0));\n } while (skipping);\n\n return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n });\n };\n\n return skipSequence;\n }\n\n function concatFactory(iterable, values) {\n var isKeyedIterable = isKeyed(iterable);\n var iters = [iterable].concat(values).map(function (v) {\n if (!isIterable(v)) {\n v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n } else if (isKeyedIterable) {\n v = KeyedIterable(v);\n }\n\n return v;\n }).filter(function (v) {\n return v.size !== 0;\n });\n\n if (iters.length === 0) {\n return iterable;\n }\n\n if (iters.length === 1) {\n var singleton = iters[0];\n\n if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) {\n return singleton;\n }\n }\n\n var concatSeq = new ArraySeq(iters);\n\n if (isKeyedIterable) {\n concatSeq = concatSeq.toKeyedSeq();\n } else if (!isIndexed(iterable)) {\n concatSeq = concatSeq.toSetSeq();\n }\n\n concatSeq = concatSeq.flatten(true);\n concatSeq.size = iters.reduce(function (sum, seq) {\n if (sum !== undefined) {\n var size = seq.size;\n\n if (size !== undefined) {\n return sum + size;\n }\n }\n }, 0);\n return concatSeq;\n }\n\n function flattenFactory(iterable, depth, useKeys) {\n var flatSequence = makeSequence(iterable);\n\n flatSequence.__iterateUncached = function (fn, reverse) {\n var iterations = 0;\n var stopped = false;\n\n function flatDeep(iter, currentDepth) {\n var this$0 = this;\n\n iter.__iterate(function (v, k) {\n if ((!depth || currentDepth < depth) && isIterable(v)) {\n flatDeep(v, currentDepth + 1);\n } else if (fn(v, useKeys ? k : iterations++, this$0) === false) {\n stopped = true;\n }\n\n return !stopped;\n }, reverse);\n }\n\n flatDeep(iterable, 0);\n return iterations;\n };\n\n flatSequence.__iteratorUncached = function (type, reverse) {\n var iterator = iterable.__iterator(type, reverse);\n\n var stack = [];\n var iterations = 0;\n return new Iterator(function () {\n while (iterator) {\n var step = iterator.next();\n\n if (step.done !== false) {\n iterator = stack.pop();\n continue;\n }\n\n var v = step.value;\n\n if (type === ITERATE_ENTRIES) {\n v = v[1];\n }\n\n if ((!depth || stack.length < depth) && isIterable(v)) {\n stack.push(iterator);\n iterator = v.__iterator(type, reverse);\n } else {\n return useKeys ? step : iteratorValue(type, iterations++, v, step);\n }\n }\n\n return iteratorDone();\n });\n };\n\n return flatSequence;\n }\n\n function flatMapFactory(iterable, mapper, context) {\n var coerce = iterableClass(iterable);\n return iterable.toSeq().map(function (v, k) {\n return coerce(mapper.call(context, v, k, iterable));\n }).flatten(true);\n }\n\n function interposeFactory(iterable, separator) {\n var interposedSequence = makeSequence(iterable);\n interposedSequence.size = iterable.size && iterable.size * 2 - 1;\n\n interposedSequence.__iterateUncached = function (fn, reverse) {\n var this$0 = this;\n var iterations = 0;\n\n iterable.__iterate(function (v, k) {\n return (!iterations || fn(separator, iterations++, this$0) !== false) && fn(v, iterations++, this$0) !== false;\n }, reverse);\n\n return iterations;\n };\n\n interposedSequence.__iteratorUncached = function (type, reverse) {\n var iterator = iterable.__iterator(ITERATE_VALUES, reverse);\n\n var iterations = 0;\n var step;\n return new Iterator(function () {\n if (!step || iterations % 2) {\n step = iterator.next();\n\n if (step.done) {\n return step;\n }\n }\n\n return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);\n });\n };\n\n return interposedSequence;\n }\n\n function sortFactory(iterable, comparator, mapper) {\n if (!comparator) {\n comparator = defaultComparator;\n }\n\n var isKeyedIterable = isKeyed(iterable);\n var index = 0;\n var entries = iterable.toSeq().map(function (v, k) {\n return [k, v, index++, mapper ? mapper(v, k, iterable) : v];\n }).toArray();\n entries.sort(function (a, b) {\n return comparator(a[3], b[3]) || a[2] - b[2];\n }).forEach(isKeyedIterable ? function (v, i) {\n entries[i].length = 2;\n } : function (v, i) {\n entries[i] = v[1];\n });\n return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries);\n }\n\n function maxFactory(iterable, comparator, mapper) {\n if (!comparator) {\n comparator = defaultComparator;\n }\n\n if (mapper) {\n var entry = iterable.toSeq().map(function (v, k) {\n return [v, mapper(v, k, iterable)];\n }).reduce(function (a, b) {\n return maxCompare(comparator, a[1], b[1]) ? b : a;\n });\n return entry && entry[0];\n } else {\n return iterable.reduce(function (a, b) {\n return maxCompare(comparator, a, b) ? b : a;\n });\n }\n }\n\n function maxCompare(comparator, a, b) {\n var comp = comparator(b, a); // b is considered the new max if the comparator declares them equal, but\n // they are not equal and b is in fact a nullish value.\n\n return comp === 0 && b !== a && (b === undefined || b === null || b !== b) || comp > 0;\n }\n\n function zipWithFactory(keyIter, zipper, iters) {\n var zipSequence = makeSequence(keyIter);\n zipSequence.size = new ArraySeq(iters).map(function (i) {\n return i.size;\n }).min(); // Note: this a generic base implementation of __iterate in terms of\n // __iterator which may be more generically useful in the future.\n\n zipSequence.__iterate = function (fn, reverse) {\n /* generic:\n var iterator = this.__iterator(ITERATE_ENTRIES, reverse);\n var step;\n var iterations = 0;\n while (!(step = iterator.next()).done) {\n iterations++;\n if (fn(step.value[1], step.value[0], this) === false) {\n break;\n }\n }\n return iterations;\n */\n // indexed:\n var iterator = this.__iterator(ITERATE_VALUES, reverse);\n\n var step;\n var iterations = 0;\n\n while (!(step = iterator.next()).done) {\n if (fn(step.value, iterations++, this) === false) {\n break;\n }\n }\n\n return iterations;\n };\n\n zipSequence.__iteratorUncached = function (type, reverse) {\n var iterators = iters.map(function (i) {\n return i = Iterable(i), getIterator(reverse ? i.reverse() : i);\n });\n var iterations = 0;\n var isDone = false;\n return new Iterator(function () {\n var steps;\n\n if (!isDone) {\n steps = iterators.map(function (i) {\n return i.next();\n });\n isDone = steps.some(function (s) {\n return s.done;\n });\n }\n\n if (isDone) {\n return iteratorDone();\n }\n\n return iteratorValue(type, iterations++, zipper.apply(null, steps.map(function (s) {\n return s.value;\n })));\n });\n };\n\n return zipSequence;\n } // #pragma Helper Functions\n\n\n function reify(iter, seq) {\n return isSeq(iter) ? seq : iter.constructor(seq);\n }\n\n function validateEntry(entry) {\n if (entry !== Object(entry)) {\n throw new TypeError('Expected [K, V] tuple: ' + entry);\n }\n }\n\n function resolveSize(iter) {\n assertNotInfinite(iter.size);\n return ensureSize(iter);\n }\n\n function iterableClass(iterable) {\n return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;\n }\n\n function makeSequence(iterable) {\n return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);\n }\n\n function cacheResultThrough() {\n if (this._iter.cacheResult) {\n this._iter.cacheResult();\n\n this.size = this._iter.size;\n return this;\n } else {\n return Seq.prototype.cacheResult.call(this);\n }\n }\n\n function defaultComparator(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n }\n\n function forceIterator(keyPath) {\n var iter = getIterator(keyPath);\n\n if (!iter) {\n // Array might not be iterable in this environment, so we need a fallback\n // to our wrapped type.\n if (!isArrayLike(keyPath)) {\n throw new TypeError('Expected iterable or array-like: ' + keyPath);\n }\n\n iter = getIterator(Iterable(keyPath));\n }\n\n return iter;\n }\n\n createClass(Record, KeyedCollection);\n\n function Record(defaultValues, name) {\n var hasInitialized;\n\n var RecordType = function Record(values) {\n if (values instanceof RecordType) {\n return values;\n }\n\n if (!(this instanceof RecordType)) {\n return new RecordType(values);\n }\n\n if (!hasInitialized) {\n hasInitialized = true;\n var keys = Object.keys(defaultValues);\n setProps(RecordTypePrototype, keys);\n RecordTypePrototype.size = keys.length;\n RecordTypePrototype._name = name;\n RecordTypePrototype._keys = keys;\n RecordTypePrototype._defaultValues = defaultValues;\n }\n\n this._map = Map(values);\n };\n\n var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n RecordTypePrototype.constructor = RecordType;\n return RecordType;\n }\n\n Record.prototype.toString = function () {\n return this.__toString(recordName(this) + ' {', '}');\n }; // @pragma Access\n\n\n Record.prototype.has = function (k) {\n return this._defaultValues.hasOwnProperty(k);\n };\n\n Record.prototype.get = function (k, notSetValue) {\n if (!this.has(k)) {\n return notSetValue;\n }\n\n var defaultVal = this._defaultValues[k];\n return this._map ? this._map.get(k, defaultVal) : defaultVal;\n }; // @pragma Modification\n\n\n Record.prototype.clear = function () {\n if (this.__ownerID) {\n this._map && this._map.clear();\n return this;\n }\n\n var RecordType = this.constructor;\n return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));\n };\n\n Record.prototype.set = function (k, v) {\n if (!this.has(k)) {\n throw new Error('Cannot set unknown key \"' + k + '\" on ' + recordName(this));\n }\n\n if (this._map && !this._map.has(k)) {\n var defaultVal = this._defaultValues[k];\n\n if (v === defaultVal) {\n return this;\n }\n }\n\n var newMap = this._map && this._map.set(k, v);\n\n if (this.__ownerID || newMap === this._map) {\n return this;\n }\n\n return makeRecord(this, newMap);\n };\n\n Record.prototype.remove = function (k) {\n if (!this.has(k)) {\n return this;\n }\n\n var newMap = this._map && this._map.remove(k);\n\n if (this.__ownerID || newMap === this._map) {\n return this;\n }\n\n return makeRecord(this, newMap);\n };\n\n Record.prototype.wasAltered = function () {\n return this._map.wasAltered();\n };\n\n Record.prototype.__iterator = function (type, reverse) {\n var this$0 = this;\n return KeyedIterable(this._defaultValues).map(function (_, k) {\n return this$0.get(k);\n }).__iterator(type, reverse);\n };\n\n Record.prototype.__iterate = function (fn, reverse) {\n var this$0 = this;\n return KeyedIterable(this._defaultValues).map(function (_, k) {\n return this$0.get(k);\n }).__iterate(fn, reverse);\n };\n\n Record.prototype.__ensureOwner = function (ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n var newMap = this._map && this._map.__ensureOwner(ownerID);\n\n if (!ownerID) {\n this.__ownerID = ownerID;\n this._map = newMap;\n return this;\n }\n\n return makeRecord(this, newMap, ownerID);\n };\n\n var RecordPrototype = Record.prototype;\n RecordPrototype[DELETE] = RecordPrototype.remove;\n RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn;\n RecordPrototype.merge = MapPrototype.merge;\n RecordPrototype.mergeWith = MapPrototype.mergeWith;\n RecordPrototype.mergeIn = MapPrototype.mergeIn;\n RecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n RecordPrototype.setIn = MapPrototype.setIn;\n RecordPrototype.update = MapPrototype.update;\n RecordPrototype.updateIn = MapPrototype.updateIn;\n RecordPrototype.withMutations = MapPrototype.withMutations;\n RecordPrototype.asMutable = MapPrototype.asMutable;\n RecordPrototype.asImmutable = MapPrototype.asImmutable;\n\n function makeRecord(likeRecord, map, ownerID) {\n var record = Object.create(Object.getPrototypeOf(likeRecord));\n record._map = map;\n record.__ownerID = ownerID;\n return record;\n }\n\n function recordName(record) {\n return record._name || record.constructor.name || 'Record';\n }\n\n function setProps(prototype, names) {\n try {\n names.forEach(setProp.bind(undefined, prototype));\n } catch (error) {// Object.defineProperty failed. Probably IE8.\n }\n }\n\n function setProp(prototype, name) {\n Object.defineProperty(prototype, name, {\n get: function get() {\n return this.get(name);\n },\n set: function set(value) {\n invariant(this.__ownerID, 'Cannot set on an immutable record.');\n this.set(name, value);\n }\n });\n }\n\n createClass(Set, SetCollection); // @pragma Construction\n\n function Set(value) {\n return value === null || value === undefined ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function (set) {\n var iter = SetIterable(value);\n assertNotInfinite(iter.size);\n iter.forEach(function (v) {\n return set.add(v);\n });\n });\n }\n\n Set.of = function ()\n /*...values*/\n {\n return this(arguments);\n };\n\n Set.fromKeys = function (value) {\n return this(KeyedIterable(value).keySeq());\n };\n\n Set.prototype.toString = function () {\n return this.__toString('Set {', '}');\n }; // @pragma Access\n\n\n Set.prototype.has = function (value) {\n return this._map.has(value);\n }; // @pragma Modification\n\n\n Set.prototype.add = function (value) {\n return updateSet(this, this._map.set(value, true));\n };\n\n Set.prototype.remove = function (value) {\n return updateSet(this, this._map.remove(value));\n };\n\n Set.prototype.clear = function () {\n return updateSet(this, this._map.clear());\n }; // @pragma Composition\n\n\n Set.prototype.union = function () {\n var iters = SLICE$0.call(arguments, 0);\n iters = iters.filter(function (x) {\n return x.size !== 0;\n });\n\n if (iters.length === 0) {\n return this;\n }\n\n if (this.size === 0 && !this.__ownerID && iters.length === 1) {\n return this.constructor(iters[0]);\n }\n\n return this.withMutations(function (set) {\n for (var ii = 0; ii < iters.length; ii++) {\n SetIterable(iters[ii]).forEach(function (value) {\n return set.add(value);\n });\n }\n });\n };\n\n Set.prototype.intersect = function () {\n var iters = SLICE$0.call(arguments, 0);\n\n if (iters.length === 0) {\n return this;\n }\n\n iters = iters.map(function (iter) {\n return SetIterable(iter);\n });\n var originalSet = this;\n return this.withMutations(function (set) {\n originalSet.forEach(function (value) {\n if (!iters.every(function (iter) {\n return iter.includes(value);\n })) {\n set.remove(value);\n }\n });\n });\n };\n\n Set.prototype.subtract = function () {\n var iters = SLICE$0.call(arguments, 0);\n\n if (iters.length === 0) {\n return this;\n }\n\n iters = iters.map(function (iter) {\n return SetIterable(iter);\n });\n var originalSet = this;\n return this.withMutations(function (set) {\n originalSet.forEach(function (value) {\n if (iters.some(function (iter) {\n return iter.includes(value);\n })) {\n set.remove(value);\n }\n });\n });\n };\n\n Set.prototype.merge = function () {\n return this.union.apply(this, arguments);\n };\n\n Set.prototype.mergeWith = function (merger) {\n var iters = SLICE$0.call(arguments, 1);\n return this.union.apply(this, iters);\n };\n\n Set.prototype.sort = function (comparator) {\n // Late binding\n return OrderedSet(sortFactory(this, comparator));\n };\n\n Set.prototype.sortBy = function (mapper, comparator) {\n // Late binding\n return OrderedSet(sortFactory(this, comparator, mapper));\n };\n\n Set.prototype.wasAltered = function () {\n return this._map.wasAltered();\n };\n\n Set.prototype.__iterate = function (fn, reverse) {\n var this$0 = this;\n return this._map.__iterate(function (_, k) {\n return fn(k, k, this$0);\n }, reverse);\n };\n\n Set.prototype.__iterator = function (type, reverse) {\n return this._map.map(function (_, k) {\n return k;\n }).__iterator(type, reverse);\n };\n\n Set.prototype.__ensureOwner = function (ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n var newMap = this._map.__ensureOwner(ownerID);\n\n if (!ownerID) {\n this.__ownerID = ownerID;\n this._map = newMap;\n return this;\n }\n\n return this.__make(newMap, ownerID);\n };\n\n function isSet(maybeSet) {\n return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);\n }\n\n Set.isSet = isSet;\n var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\n var SetPrototype = Set.prototype;\n SetPrototype[IS_SET_SENTINEL] = true;\n SetPrototype[DELETE] = SetPrototype.remove;\n SetPrototype.mergeDeep = SetPrototype.merge;\n SetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n SetPrototype.withMutations = MapPrototype.withMutations;\n SetPrototype.asMutable = MapPrototype.asMutable;\n SetPrototype.asImmutable = MapPrototype.asImmutable;\n SetPrototype.__empty = emptySet;\n SetPrototype.__make = makeSet;\n\n function updateSet(set, newMap) {\n if (set.__ownerID) {\n set.size = newMap.size;\n set._map = newMap;\n return set;\n }\n\n return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap);\n }\n\n function makeSet(map, ownerID) {\n var set = Object.create(SetPrototype);\n set.size = map ? map.size : 0;\n set._map = map;\n set.__ownerID = ownerID;\n return set;\n }\n\n var EMPTY_SET;\n\n function emptySet() {\n return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n }\n\n createClass(OrderedSet, Set); // @pragma Construction\n\n function OrderedSet(value) {\n return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function (set) {\n var iter = SetIterable(value);\n assertNotInfinite(iter.size);\n iter.forEach(function (v) {\n return set.add(v);\n });\n });\n }\n\n OrderedSet.of = function ()\n /*...values*/\n {\n return this(arguments);\n };\n\n OrderedSet.fromKeys = function (value) {\n return this(KeyedIterable(value).keySeq());\n };\n\n OrderedSet.prototype.toString = function () {\n return this.__toString('OrderedSet {', '}');\n };\n\n function isOrderedSet(maybeOrderedSet) {\n return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);\n }\n\n OrderedSet.isOrderedSet = isOrderedSet;\n var OrderedSetPrototype = OrderedSet.prototype;\n OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;\n OrderedSetPrototype.__empty = emptyOrderedSet;\n OrderedSetPrototype.__make = makeOrderedSet;\n\n function makeOrderedSet(map, ownerID) {\n var set = Object.create(OrderedSetPrototype);\n set.size = map ? map.size : 0;\n set._map = map;\n set.__ownerID = ownerID;\n return set;\n }\n\n var EMPTY_ORDERED_SET;\n\n function emptyOrderedSet() {\n return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));\n }\n\n createClass(Stack, IndexedCollection); // @pragma Construction\n\n function Stack(value) {\n return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);\n }\n\n Stack.of = function ()\n /*...values*/\n {\n return this(arguments);\n };\n\n Stack.prototype.toString = function () {\n return this.__toString('Stack [', ']');\n }; // @pragma Access\n\n\n Stack.prototype.get = function (index, notSetValue) {\n var head = this._head;\n index = wrapIndex(this, index);\n\n while (head && index--) {\n head = head.next;\n }\n\n return head ? head.value : notSetValue;\n };\n\n Stack.prototype.peek = function () {\n return this._head && this._head.value;\n }; // @pragma Modification\n\n\n Stack.prototype.push = function ()\n /*...values*/\n {\n if (arguments.length === 0) {\n return this;\n }\n\n var newSize = this.size + arguments.length;\n var head = this._head;\n\n for (var ii = arguments.length - 1; ii >= 0; ii--) {\n head = {\n value: arguments[ii],\n next: head\n };\n }\n\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return makeStack(newSize, head);\n };\n\n Stack.prototype.pushAll = function (iter) {\n iter = IndexedIterable(iter);\n\n if (iter.size === 0) {\n return this;\n }\n\n assertNotInfinite(iter.size);\n var newSize = this.size;\n var head = this._head;\n iter.reverse().forEach(function (value) {\n newSize++;\n head = {\n value: value,\n next: head\n };\n });\n\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return makeStack(newSize, head);\n };\n\n Stack.prototype.pop = function () {\n return this.slice(1);\n };\n\n Stack.prototype.unshift = function ()\n /*...values*/\n {\n return this.push.apply(this, arguments);\n };\n\n Stack.prototype.unshiftAll = function (iter) {\n return this.pushAll(iter);\n };\n\n Stack.prototype.shift = function () {\n return this.pop.apply(this, arguments);\n };\n\n Stack.prototype.clear = function () {\n if (this.size === 0) {\n return this;\n }\n\n if (this.__ownerID) {\n this.size = 0;\n this._head = undefined;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return emptyStack();\n };\n\n Stack.prototype.slice = function (begin, end) {\n if (wholeSlice(begin, end, this.size)) {\n return this;\n }\n\n var resolvedBegin = resolveBegin(begin, this.size);\n var resolvedEnd = resolveEnd(end, this.size);\n\n if (resolvedEnd !== this.size) {\n // super.slice(begin, end);\n return IndexedCollection.prototype.slice.call(this, begin, end);\n }\n\n var newSize = this.size - resolvedBegin;\n var head = this._head;\n\n while (resolvedBegin--) {\n head = head.next;\n }\n\n if (this.__ownerID) {\n this.size = newSize;\n this._head = head;\n this.__hash = undefined;\n this.__altered = true;\n return this;\n }\n\n return makeStack(newSize, head);\n }; // @pragma Mutability\n\n\n Stack.prototype.__ensureOwner = function (ownerID) {\n if (ownerID === this.__ownerID) {\n return this;\n }\n\n if (!ownerID) {\n this.__ownerID = ownerID;\n this.__altered = false;\n return this;\n }\n\n return makeStack(this.size, this._head, ownerID, this.__hash);\n }; // @pragma Iteration\n\n\n Stack.prototype.__iterate = function (fn, reverse) {\n if (reverse) {\n return this.reverse().__iterate(fn);\n }\n\n var iterations = 0;\n var node = this._head;\n\n while (node) {\n if (fn(node.value, iterations++, this) === false) {\n break;\n }\n\n node = node.next;\n }\n\n return iterations;\n };\n\n Stack.prototype.__iterator = function (type, reverse) {\n if (reverse) {\n return this.reverse().__iterator(type);\n }\n\n var iterations = 0;\n var node = this._head;\n return new Iterator(function () {\n if (node) {\n var value = node.value;\n node = node.next;\n return iteratorValue(type, iterations++, value);\n }\n\n return iteratorDone();\n });\n };\n\n function isStack(maybeStack) {\n return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);\n }\n\n Stack.isStack = isStack;\n var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n var StackPrototype = Stack.prototype;\n StackPrototype[IS_STACK_SENTINEL] = true;\n StackPrototype.withMutations = MapPrototype.withMutations;\n StackPrototype.asMutable = MapPrototype.asMutable;\n StackPrototype.asImmutable = MapPrototype.asImmutable;\n StackPrototype.wasAltered = MapPrototype.wasAltered;\n\n function makeStack(size, head, ownerID, hash) {\n var map = Object.create(StackPrototype);\n map.size = size;\n map._head = head;\n map.__ownerID = ownerID;\n map.__hash = hash;\n map.__altered = false;\n return map;\n }\n\n var EMPTY_STACK;\n\n function emptyStack() {\n return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n }\n /**\n * Contributes additional methods to a constructor\n */\n\n\n function mixin(ctor, methods) {\n var keyCopier = function keyCopier(key) {\n ctor.prototype[key] = methods[key];\n };\n\n Object.keys(methods).forEach(keyCopier);\n Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n return ctor;\n }\n\n Iterable.Iterator = Iterator;\n mixin(Iterable, {\n // ### Conversion to other types\n toArray: function toArray() {\n assertNotInfinite(this.size);\n var array = new Array(this.size || 0);\n\n this.valueSeq().__iterate(function (v, i) {\n array[i] = v;\n });\n\n return array;\n },\n toIndexedSeq: function toIndexedSeq() {\n return new ToIndexedSequence(this);\n },\n toJS: function toJS() {\n return this.toSeq().map(function (value) {\n return value && typeof value.toJS === 'function' ? value.toJS() : value;\n }).__toJS();\n },\n toJSON: function toJSON() {\n return this.toSeq().map(function (value) {\n return value && typeof value.toJSON === 'function' ? value.toJSON() : value;\n }).__toJS();\n },\n toKeyedSeq: function toKeyedSeq() {\n return new ToKeyedSequence(this, true);\n },\n toMap: function toMap() {\n // Use Late Binding here to solve the circular dependency.\n return Map(this.toKeyedSeq());\n },\n toObject: function toObject() {\n assertNotInfinite(this.size);\n var object = {};\n\n this.__iterate(function (v, k) {\n object[k] = v;\n });\n\n return object;\n },\n toOrderedMap: function toOrderedMap() {\n // Use Late Binding here to solve the circular dependency.\n return OrderedMap(this.toKeyedSeq());\n },\n toOrderedSet: function toOrderedSet() {\n // Use Late Binding here to solve the circular dependency.\n return OrderedSet(isKeyed(this) ? this.valueSeq() : this);\n },\n toSet: function toSet() {\n // Use Late Binding here to solve the circular dependency.\n return Set(isKeyed(this) ? this.valueSeq() : this);\n },\n toSetSeq: function toSetSeq() {\n return new ToSetSequence(this);\n },\n toSeq: function toSeq() {\n return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();\n },\n toStack: function toStack() {\n // Use Late Binding here to solve the circular dependency.\n return Stack(isKeyed(this) ? this.valueSeq() : this);\n },\n toList: function toList() {\n // Use Late Binding here to solve the circular dependency.\n return List(isKeyed(this) ? this.valueSeq() : this);\n },\n // ### Common JavaScript methods and properties\n toString: function toString() {\n return '[Iterable]';\n },\n __toString: function __toString(head, tail) {\n if (this.size === 0) {\n return head + tail;\n }\n\n return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n },\n // ### ES6 Collection methods (ES6 Array and Map)\n concat: function concat() {\n var values = SLICE$0.call(arguments, 0);\n return reify(this, concatFactory(this, values));\n },\n includes: function includes(searchValue) {\n return this.some(function (value) {\n return is(value, searchValue);\n });\n },\n entries: function entries() {\n return this.__iterator(ITERATE_ENTRIES);\n },\n every: function every(predicate, context) {\n assertNotInfinite(this.size);\n var returnValue = true;\n\n this.__iterate(function (v, k, c) {\n if (!predicate.call(context, v, k, c)) {\n returnValue = false;\n return false;\n }\n });\n\n return returnValue;\n },\n filter: function filter(predicate, context) {\n return reify(this, filterFactory(this, predicate, context, true));\n },\n find: function find(predicate, context, notSetValue) {\n var entry = this.findEntry(predicate, context);\n return entry ? entry[1] : notSetValue;\n },\n forEach: function forEach(sideEffect, context) {\n assertNotInfinite(this.size);\n return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n },\n join: function join(separator) {\n assertNotInfinite(this.size);\n separator = separator !== undefined ? '' + separator : ',';\n var joined = '';\n var isFirst = true;\n\n this.__iterate(function (v) {\n isFirst ? isFirst = false : joined += separator;\n joined += v !== null && v !== undefined ? v.toString() : '';\n });\n\n return joined;\n },\n keys: function keys() {\n return this.__iterator(ITERATE_KEYS);\n },\n map: function map(mapper, context) {\n return reify(this, mapFactory(this, mapper, context));\n },\n reduce: function reduce(reducer, initialReduction, context) {\n assertNotInfinite(this.size);\n var reduction;\n var useFirst;\n\n if (arguments.length < 2) {\n useFirst = true;\n } else {\n reduction = initialReduction;\n }\n\n this.__iterate(function (v, k, c) {\n if (useFirst) {\n useFirst = false;\n reduction = v;\n } else {\n reduction = reducer.call(context, reduction, v, k, c);\n }\n });\n\n return reduction;\n },\n reduceRight: function reduceRight(reducer, initialReduction, context) {\n var reversed = this.toKeyedSeq().reverse();\n return reversed.reduce.apply(reversed, arguments);\n },\n reverse: function reverse() {\n return reify(this, reverseFactory(this, true));\n },\n slice: function slice(begin, end) {\n return reify(this, sliceFactory(this, begin, end, true));\n },\n some: function some(predicate, context) {\n return !this.every(not(predicate), context);\n },\n sort: function sort(comparator) {\n return reify(this, sortFactory(this, comparator));\n },\n values: function values() {\n return this.__iterator(ITERATE_VALUES);\n },\n // ### More sequential methods\n butLast: function butLast() {\n return this.slice(0, -1);\n },\n isEmpty: function isEmpty() {\n return this.size !== undefined ? this.size === 0 : !this.some(function () {\n return true;\n });\n },\n count: function count(predicate, context) {\n return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);\n },\n countBy: function countBy(grouper, context) {\n return countByFactory(this, grouper, context);\n },\n equals: function equals(other) {\n return deepEqual(this, other);\n },\n entrySeq: function entrySeq() {\n var iterable = this;\n\n if (iterable._cache) {\n // We cache as an entries array, so we can just return the cache!\n return new ArraySeq(iterable._cache);\n }\n\n var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();\n\n entriesSequence.fromEntrySeq = function () {\n return iterable.toSeq();\n };\n\n return entriesSequence;\n },\n filterNot: function filterNot(predicate, context) {\n return this.filter(not(predicate), context);\n },\n findEntry: function findEntry(predicate, context, notSetValue) {\n var found = notSetValue;\n\n this.__iterate(function (v, k, c) {\n if (predicate.call(context, v, k, c)) {\n found = [k, v];\n return false;\n }\n });\n\n return found;\n },\n findKey: function findKey(predicate, context) {\n var entry = this.findEntry(predicate, context);\n return entry && entry[0];\n },\n findLast: function findLast(predicate, context, notSetValue) {\n return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n },\n findLastEntry: function findLastEntry(predicate, context, notSetValue) {\n return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue);\n },\n findLastKey: function findLastKey(predicate, context) {\n return this.toKeyedSeq().reverse().findKey(predicate, context);\n },\n first: function first() {\n return this.find(returnTrue);\n },\n flatMap: function flatMap(mapper, context) {\n return reify(this, flatMapFactory(this, mapper, context));\n },\n flatten: function flatten(depth) {\n return reify(this, flattenFactory(this, depth, true));\n },\n fromEntrySeq: function fromEntrySeq() {\n return new FromEntriesSequence(this);\n },\n get: function get(searchKey, notSetValue) {\n return this.find(function (_, key) {\n return is(key, searchKey);\n }, undefined, notSetValue);\n },\n getIn: function getIn(searchKeyPath, notSetValue) {\n var nested = this; // Note: in an ES6 environment, we would prefer:\n // for (var key of searchKeyPath) {\n\n var iter = forceIterator(searchKeyPath);\n var step;\n\n while (!(step = iter.next()).done) {\n var key = step.value;\n nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;\n\n if (nested === NOT_SET) {\n return notSetValue;\n }\n }\n\n return nested;\n },\n groupBy: function groupBy(grouper, context) {\n return groupByFactory(this, grouper, context);\n },\n has: function has(searchKey) {\n return this.get(searchKey, NOT_SET) !== NOT_SET;\n },\n hasIn: function hasIn(searchKeyPath) {\n return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;\n },\n isSubset: function isSubset(iter) {\n iter = typeof iter.includes === 'function' ? iter : Iterable(iter);\n return this.every(function (value) {\n return iter.includes(value);\n });\n },\n isSuperset: function isSuperset(iter) {\n iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter);\n return iter.isSubset(this);\n },\n keyOf: function keyOf(searchValue) {\n return this.findKey(function (value) {\n return is(value, searchValue);\n });\n },\n keySeq: function keySeq() {\n return this.toSeq().map(keyMapper).toIndexedSeq();\n },\n last: function last() {\n return this.toSeq().reverse().first();\n },\n lastKeyOf: function lastKeyOf(searchValue) {\n return this.toKeyedSeq().reverse().keyOf(searchValue);\n },\n max: function max(comparator) {\n return maxFactory(this, comparator);\n },\n maxBy: function maxBy(mapper, comparator) {\n return maxFactory(this, comparator, mapper);\n },\n min: function min(comparator) {\n return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);\n },\n minBy: function minBy(mapper, comparator) {\n return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);\n },\n rest: function rest() {\n return this.slice(1);\n },\n skip: function skip(amount) {\n return this.slice(Math.max(0, amount));\n },\n skipLast: function skipLast(amount) {\n return reify(this, this.toSeq().reverse().skip(amount).reverse());\n },\n skipWhile: function skipWhile(predicate, context) {\n return reify(this, skipWhileFactory(this, predicate, context, true));\n },\n skipUntil: function skipUntil(predicate, context) {\n return this.skipWhile(not(predicate), context);\n },\n sortBy: function sortBy(mapper, comparator) {\n return reify(this, sortFactory(this, comparator, mapper));\n },\n take: function take(amount) {\n return this.slice(0, Math.max(0, amount));\n },\n takeLast: function takeLast(amount) {\n return reify(this, this.toSeq().reverse().take(amount).reverse());\n },\n takeWhile: function takeWhile(predicate, context) {\n return reify(this, takeWhileFactory(this, predicate, context));\n },\n takeUntil: function takeUntil(predicate, context) {\n return this.takeWhile(not(predicate), context);\n },\n valueSeq: function valueSeq() {\n return this.toIndexedSeq();\n },\n // ### Hashable Object\n hashCode: function hashCode() {\n return this.__hash || (this.__hash = hashIterable(this));\n } // ### Internal\n // abstract __iterate(fn, reverse)\n // abstract __iterator(type, reverse)\n\n }); // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\n\n var IterablePrototype = Iterable.prototype;\n IterablePrototype[IS_ITERABLE_SENTINEL] = true;\n IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;\n IterablePrototype.__toJS = IterablePrototype.toArray;\n IterablePrototype.__toStringMapper = quoteString;\n\n IterablePrototype.inspect = IterablePrototype.toSource = function () {\n return this.toString();\n };\n\n IterablePrototype.chain = IterablePrototype.flatMap;\n IterablePrototype.contains = IterablePrototype.includes;\n mixin(KeyedIterable, {\n // ### More sequential methods\n flip: function flip() {\n return reify(this, flipFactory(this));\n },\n mapEntries: function mapEntries(mapper, context) {\n var this$0 = this;\n var iterations = 0;\n return reify(this, this.toSeq().map(function (v, k) {\n return mapper.call(context, [k, v], iterations++, this$0);\n }).fromEntrySeq());\n },\n mapKeys: function mapKeys(mapper, context) {\n var this$0 = this;\n return reify(this, this.toSeq().flip().map(function (k, v) {\n return mapper.call(context, k, v, this$0);\n }).flip());\n }\n });\n var KeyedIterablePrototype = KeyedIterable.prototype;\n KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;\n KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;\n KeyedIterablePrototype.__toJS = IterablePrototype.toObject;\n\n KeyedIterablePrototype.__toStringMapper = function (v, k) {\n return JSON.stringify(k) + ': ' + quoteString(v);\n };\n\n mixin(IndexedIterable, {\n // ### Conversion to other types\n toKeyedSeq: function toKeyedSeq() {\n return new ToKeyedSequence(this, false);\n },\n // ### ES6 Collection methods (ES6 Array and Map)\n filter: function filter(predicate, context) {\n return reify(this, filterFactory(this, predicate, context, false));\n },\n findIndex: function findIndex(predicate, context) {\n var entry = this.findEntry(predicate, context);\n return entry ? entry[0] : -1;\n },\n indexOf: function indexOf(searchValue) {\n var key = this.keyOf(searchValue);\n return key === undefined ? -1 : key;\n },\n lastIndexOf: function lastIndexOf(searchValue) {\n var key = this.lastKeyOf(searchValue);\n return key === undefined ? -1 : key;\n },\n reverse: function reverse() {\n return reify(this, reverseFactory(this, false));\n },\n slice: function slice(begin, end) {\n return reify(this, sliceFactory(this, begin, end, false));\n },\n splice: function splice(index, removeNum\n /*, ...values*/\n ) {\n var numArgs = arguments.length;\n removeNum = Math.max(removeNum | 0, 0);\n\n if (numArgs === 0 || numArgs === 2 && !removeNum) {\n return this;\n } // If index is negative, it should resolve relative to the size of the\n // collection. However size may be expensive to compute if not cached, so\n // only call count() if the number is in fact negative.\n\n\n index = resolveBegin(index, index < 0 ? this.count() : this.size);\n var spliced = this.slice(0, index);\n return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));\n },\n // ### More collection methods\n findLastIndex: function findLastIndex(predicate, context) {\n var entry = this.findLastEntry(predicate, context);\n return entry ? entry[0] : -1;\n },\n first: function first() {\n return this.get(0);\n },\n flatten: function flatten(depth) {\n return reify(this, flattenFactory(this, depth, false));\n },\n get: function get(index, notSetValue) {\n index = wrapIndex(this, index);\n return index < 0 || this.size === Infinity || this.size !== undefined && index > this.size ? notSetValue : this.find(function (_, key) {\n return key === index;\n }, undefined, notSetValue);\n },\n has: function has(index) {\n index = wrapIndex(this, index);\n return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1);\n },\n interpose: function interpose(separator) {\n return reify(this, interposeFactory(this, separator));\n },\n interleave: function interleave()\n /*...iterables*/\n {\n var iterables = [this].concat(arrCopy(arguments));\n var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);\n var interleaved = zipped.flatten(true);\n\n if (zipped.size) {\n interleaved.size = zipped.size * iterables.length;\n }\n\n return reify(this, interleaved);\n },\n keySeq: function keySeq() {\n return Range(0, this.size);\n },\n last: function last() {\n return this.get(-1);\n },\n skipWhile: function skipWhile(predicate, context) {\n return reify(this, skipWhileFactory(this, predicate, context, false));\n },\n zip: function zip()\n /*, ...iterables */\n {\n var iterables = [this].concat(arrCopy(arguments));\n return reify(this, zipWithFactory(this, defaultZipper, iterables));\n },\n zipWith: function zipWith(zipper\n /*, ...iterables */\n ) {\n var iterables = arrCopy(arguments);\n iterables[0] = this;\n return reify(this, zipWithFactory(this, zipper, iterables));\n }\n });\n IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;\n IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;\n mixin(SetIterable, {\n // ### ES6 Collection methods (ES6 Array and Map)\n get: function get(value, notSetValue) {\n return this.has(value) ? value : notSetValue;\n },\n includes: function includes(value) {\n return this.has(value);\n },\n // ### More sequential methods\n keySeq: function keySeq() {\n return this.valueSeq();\n }\n });\n SetIterable.prototype.has = IterablePrototype.includes;\n SetIterable.prototype.contains = SetIterable.prototype.includes; // Mixin subclasses\n\n mixin(KeyedSeq, KeyedIterable.prototype);\n mixin(IndexedSeq, IndexedIterable.prototype);\n mixin(SetSeq, SetIterable.prototype);\n mixin(KeyedCollection, KeyedIterable.prototype);\n mixin(IndexedCollection, IndexedIterable.prototype);\n mixin(SetCollection, SetIterable.prototype); // #pragma Helper functions\n\n function keyMapper(v, k) {\n return k;\n }\n\n function entryMapper(v, k) {\n return [k, v];\n }\n\n function not(predicate) {\n return function () {\n return !predicate.apply(this, arguments);\n };\n }\n\n function neg(predicate) {\n return function () {\n return -predicate.apply(this, arguments);\n };\n }\n\n function quoteString(value) {\n return typeof value === 'string' ? JSON.stringify(value) : String(value);\n }\n\n function defaultZipper() {\n return arrCopy(arguments);\n }\n\n function defaultNegComparator(a, b) {\n return a < b ? 1 : a > b ? -1 : 0;\n }\n\n function hashIterable(iterable) {\n if (iterable.size === Infinity) {\n return 0;\n }\n\n var ordered = isOrdered(iterable);\n var keyed = isKeyed(iterable);\n var h = ordered ? 1 : 0;\n\n var size = iterable.__iterate(keyed ? ordered ? function (v, k) {\n h = 31 * h + hashMerge(hash(v), hash(k)) | 0;\n } : function (v, k) {\n h = h + hashMerge(hash(v), hash(k)) | 0;\n } : ordered ? function (v) {\n h = 31 * h + hash(v) | 0;\n } : function (v) {\n h = h + hash(v) | 0;\n });\n\n return murmurHashOfSize(size, h);\n }\n\n function murmurHashOfSize(size, h) {\n h = imul(h, 0xCC9E2D51);\n h = imul(h << 15 | h >>> -15, 0x1B873593);\n h = imul(h << 13 | h >>> -13, 5);\n h = (h + 0xE6546B64 | 0) ^ size;\n h = imul(h ^ h >>> 16, 0x85EBCA6B);\n h = imul(h ^ h >>> 13, 0xC2B2AE35);\n h = smi(h ^ h >>> 16);\n return h;\n }\n\n function hashMerge(a, b) {\n return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int\n }\n\n var Immutable = {\n Iterable: Iterable,\n Seq: Seq,\n Collection: Collection,\n Map: Map,\n OrderedMap: OrderedMap,\n List: List,\n Stack: Stack,\n Set: Set,\n OrderedSet: OrderedSet,\n Record: Record,\n Range: Range,\n Repeat: Repeat,\n is: is,\n fromJS: fromJS\n };\n return Immutable;\n});","'use strict';\n\nvar bind = require('./helpers/bind');\n/*global toString:true*/\n// utils is a library of generic helper functions non-specific to axios\n\n\nvar toString = Object.prototype.toString;\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\n\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\n\n\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\n\n\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\n\n\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\n\n\nfunction isFormData(val) {\n return typeof FormData !== 'undefined' && val instanceof FormData;\n}\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\n\n\nfunction isArrayBufferView(val) {\n var result;\n\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && val.buffer instanceof ArrayBuffer;\n }\n\n return result;\n}\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\n\n\nfunction isString(val) {\n return typeof val === 'string';\n}\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\n\n\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\n\n\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\n\n\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\n\n\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\n\n\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\n\n\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\n\n\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\n\n\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\n\n\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\n\n\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n\n return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\n\n\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n } // Force an array if not already something iterable\n\n\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\n\n\nfunction merge()\n/* obj1, obj2, obj3, ... */\n{\n var result = {};\n\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n\n return result;\n}\n/**\n * Function equal to merge with the difference being that no reference\n * to original objects is kept.\n *\n * @see merge\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\n\n\nfunction deepMerge()\n/* obj1, obj2, obj3, ... */\n{\n var result = {};\n\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = deepMerge(result[key], val);\n } else if (typeof val === 'object') {\n result[key] = deepMerge({}, val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n\n return result;\n}\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\n\n\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n deepMerge: deepMerge,\n extend: extend,\n trim: trim\n};","import React from 'react';\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from 'flavours/glitch/components/icon';\n\nexport default class IconButton extends React.PureComponent {\n\n static propTypes = {\n className: PropTypes.string,\n title: PropTypes.string.isRequired,\n icon: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n onMouseDown: PropTypes.func,\n onKeyDown: PropTypes.func,\n onKeyPress: PropTypes.func,\n size: PropTypes.number,\n active: PropTypes.bool,\n pressed: PropTypes.bool,\n expanded: PropTypes.bool,\n style: PropTypes.object,\n activeStyle: PropTypes.object,\n disabled: PropTypes.bool,\n inverted: PropTypes.bool,\n animate: PropTypes.bool,\n overlay: PropTypes.bool,\n tabIndex: PropTypes.string,\n label: PropTypes.string,\n };\n\n static defaultProps = {\n size: 18,\n active: false,\n disabled: false,\n animate: false,\n overlay: false,\n tabIndex: '0',\n };\n\n state = {\n activate: false,\n deactivate: false,\n }\n\n componentWillReceiveProps (nextProps) {\n if (!nextProps.animate) return;\n\n if (this.props.active && !nextProps.active) {\n this.setState({ activate: false, deactivate: true });\n } else if (!this.props.active && nextProps.active) {\n this.setState({ activate: true, deactivate: false });\n }\n }\n\n handleClick = (e) => {\n e.preventDefault();\n\n if (!this.props.disabled) {\n this.props.onClick(e);\n }\n }\n\n handleKeyPress = (e) => {\n if (this.props.onKeyPress && !this.props.disabled) {\n this.props.onKeyPress(e);\n }\n }\n\n handleMouseDown = (e) => {\n if (!this.props.disabled && this.props.onMouseDown) {\n this.props.onMouseDown(e);\n }\n }\n\n handleKeyDown = (e) => {\n if (!this.props.disabled && this.props.onKeyDown) {\n this.props.onKeyDown(e);\n }\n }\n\n render () {\n let style = {\n fontSize: `${this.props.size}px`,\n height: `${this.props.size * 1.28571429}px`,\n lineHeight: `${this.props.size}px`,\n ...this.props.style,\n ...(this.props.active ? this.props.activeStyle : {}),\n };\n if (!this.props.label) {\n style.width = `${this.props.size * 1.28571429}px`;\n } else {\n style.textAlign = 'left';\n }\n\n const {\n active,\n className,\n disabled,\n expanded,\n icon,\n inverted,\n overlay,\n pressed,\n tabIndex,\n title,\n } = this.props;\n\n const {\n activate,\n deactivate,\n } = this.state;\n\n const classes = classNames(className, 'icon-button', {\n active,\n disabled,\n inverted,\n activate,\n deactivate,\n overlayed: overlay,\n });\n\n return (\n <button\n aria-label={title}\n aria-pressed={pressed}\n aria-expanded={expanded}\n title={title}\n className={classes}\n onClick={this.handleClick}\n onMouseDown={this.handleMouseDown}\n onKeyDown={this.handleKeyDown}\n onKeyPress={this.handleKeyPress}\n style={style}\n tabIndex={tabIndex}\n disabled={disabled}\n >\n <Icon id={icon} fixedWidth aria-hidden='true' />\n {this.props.label}\n </button>\n );\n }\n\n}\n","/** @type {number | null} */\nlet cachedScrollbarWidth = null;\n\n/**\n * @return {number}\n */\nconst getActualScrollbarWidth = () => {\n const outer = document.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n document.body.appendChild(outer);\n\n const inner = document.createElement('div');\n outer.appendChild(inner);\n\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.parentNode.removeChild(outer);\n\n return scrollbarWidth;\n};\n\n/**\n * @return {number}\n */\nexport const getScrollbarWidth = () => {\n if (cachedScrollbarWidth !== null) {\n return cachedScrollbarWidth;\n }\n\n const scrollbarWidth = getActualScrollbarWidth();\n cachedScrollbarWidth = scrollbarWidth;\n\n return scrollbarWidth;\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport 'wicg-inert';\nimport createHistory from 'history/createBrowserHistory';\n\nexport default class ModalRoot extends React.PureComponent {\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n children: PropTypes.node,\n onClose: PropTypes.func.isRequired,\n noEsc: PropTypes.bool,\n };\n\n state = {\n revealed: !!this.props.children,\n };\n\n activeElement = this.state.revealed ? document.activeElement : null;\n\n handleKeyUp = (e) => {\n if ((e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27)\n && !!this.props.children && !this.props.noEsc) {\n this.props.onClose();\n }\n }\n\n handleKeyDown = (e) => {\n if (e.key === 'Tab') {\n const focusable = Array.from(this.node.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])')).filter((x) => window.getComputedStyle(x).display !== 'none');\n const index = focusable.indexOf(e.target);\n\n let element;\n\n if (e.shiftKey) {\n element = focusable[index - 1] || focusable[focusable.length - 1];\n } else {\n element = focusable[index + 1] || focusable[0];\n }\n\n if (element) {\n element.focus();\n e.stopPropagation();\n e.preventDefault();\n }\n }\n }\n\n componentDidMount () {\n window.addEventListener('keyup', this.handleKeyUp, false);\n window.addEventListener('keydown', this.handleKeyDown, false);\n this.history = this.context.router ? this.context.router.history : createHistory();\n }\n\n componentWillReceiveProps (nextProps) {\n if (!!nextProps.children && !this.props.children) {\n this.activeElement = document.activeElement;\n\n this.getSiblings().forEach(sibling => sibling.setAttribute('inert', true));\n } else if (!nextProps.children) {\n this.setState({ revealed: false });\n }\n }\n\n componentDidUpdate (prevProps) {\n if (!this.props.children && !!prevProps.children) {\n this.getSiblings().forEach(sibling => sibling.removeAttribute('inert'));\n\n // Because of the wicg-inert polyfill, the activeElement may not be\n // immediately selectable, we have to wait for observers to run, as\n // described in https://github.com/WICG/inert#performance-and-gotchas\n Promise.resolve().then(() => {\n this.activeElement.focus({ preventScroll: true });\n this.activeElement = null;\n }).catch((error) => {\n console.error(error);\n });\n\n this.handleModalClose();\n }\n if (this.props.children) {\n requestAnimationFrame(() => {\n this.setState({ revealed: true });\n });\n if (!prevProps.children) this.handleModalOpen();\n }\n }\n\n componentWillUnmount () {\n window.removeEventListener('keyup', this.handleKeyUp);\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n\n handleModalClose () {\n this.unlistenHistory();\n\n const state = this.history.location.state;\n if (state && state.mastodonModalOpen) {\n this.history.goBack();\n }\n }\n\n handleModalOpen () {\n const history = this.history;\n const state = {...history.location.state, mastodonModalOpen: true};\n history.push(history.location.pathname, state);\n this.unlistenHistory = history.listen(() => {\n this.props.onClose();\n });\n }\n\n getSiblings = () => {\n return Array(...this.node.parentElement.childNodes).filter(node => node !== this.node);\n }\n\n setRef = ref => {\n this.node = ref;\n }\n\n render () {\n const { children, onClose } = this.props;\n const { revealed } = this.state;\n const visible = !!children;\n\n if (!visible) {\n return (\n <div className='modal-root' ref={this.setRef} style={{ opacity: 0 }} />\n );\n }\n\n return (\n <div className='modal-root' ref={this.setRef} style={{ opacity: revealed ? 1 : 0 }}>\n <div style={{ pointerEvents: visible ? 'auto' : 'none' }}>\n <div role='presentation' className='modal-root__overlay' onClick={onClose} />\n <div role='dialog' className='modal-root__container'>{children}</div>\n </div>\n </div>\n );\n }\n\n}\n","import { isMobile } from '../is_mobile';\n\n/** @type {number | null} */\nlet cachedScrollbarWidth = null;\n\n/**\n * @return {number}\n */\nconst getActualScrollbarWidth = () => {\n const outer = document.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n document.body.appendChild(outer);\n\n const inner = document.createElement('div');\n outer.appendChild(inner);\n\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.parentNode.removeChild(outer);\n\n return scrollbarWidth;\n};\n\n/**\n * @return {number}\n */\nexport const getScrollbarWidth = () => {\n if (cachedScrollbarWidth !== null) {\n return cachedScrollbarWidth;\n }\n\n const scrollbarWidth = isMobile(window.innerWidth) ? 0 : getActualScrollbarWidth();\n cachedScrollbarWidth = scrollbarWidth;\n\n return scrollbarWidth;\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport 'wicg-inert';\n\nexport default class ModalRoot extends React.PureComponent {\n\n static propTypes = {\n children: PropTypes.node,\n onClose: PropTypes.func.isRequired,\n };\n\n state = {\n revealed: !!this.props.children,\n };\n\n activeElement = this.state.revealed ? document.activeElement : null;\n\n handleKeyUp = (e) => {\n if ((e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27)\n && !!this.props.children) {\n this.props.onClose();\n }\n }\n\n handleKeyDown = (e) => {\n if (e.key === 'Tab') {\n const focusable = Array.from(this.node.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])')).filter((x) => window.getComputedStyle(x).display !== 'none');\n const index = focusable.indexOf(e.target);\n\n let element;\n\n if (e.shiftKey) {\n element = focusable[index - 1] || focusable[focusable.length - 1];\n } else {\n element = focusable[index + 1] || focusable[0];\n }\n\n if (element) {\n element.focus();\n e.stopPropagation();\n e.preventDefault();\n }\n }\n }\n\n componentDidMount () {\n window.addEventListener('keyup', this.handleKeyUp, false);\n window.addEventListener('keydown', this.handleKeyDown, false);\n }\n\n componentWillReceiveProps (nextProps) {\n if (!!nextProps.children && !this.props.children) {\n this.activeElement = document.activeElement;\n\n this.getSiblings().forEach(sibling => sibling.setAttribute('inert', true));\n } else if (!nextProps.children) {\n this.setState({ revealed: false });\n }\n }\n\n componentDidUpdate (prevProps) {\n if (!this.props.children && !!prevProps.children) {\n this.getSiblings().forEach(sibling => sibling.removeAttribute('inert'));\n\n // Because of the wicg-inert polyfill, the activeElement may not be\n // immediately selectable, we have to wait for observers to run, as\n // described in https://github.com/WICG/inert#performance-and-gotchas\n Promise.resolve().then(() => {\n this.activeElement.focus();\n this.activeElement = null;\n }).catch((error) => {\n console.error(error);\n });\n }\n if (this.props.children) {\n requestAnimationFrame(() => {\n this.setState({ revealed: true });\n });\n }\n }\n\n componentWillUnmount () {\n window.removeEventListener('keyup', this.handleKeyUp);\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n\n getSiblings = () => {\n return Array(...this.node.parentElement.childNodes).filter(node => node !== this.node);\n }\n\n setRef = ref => {\n this.node = ref;\n }\n\n render () {\n const { children, onClose } = this.props;\n const { revealed } = this.state;\n const visible = !!children;\n\n if (!visible) {\n return (\n <div className='modal-root' ref={this.setRef} style={{ opacity: 0 }} />\n );\n }\n\n return (\n <div className='modal-root' ref={this.setRef} style={{ opacity: revealed ? 1 : 0 }}>\n <div style={{ pointerEvents: visible ? 'auto' : 'none' }}>\n <div role='presentation' className='modal-root__overlay' onClick={onClose} />\n <div role='dialog' className='modal-root__container'>{children}</div>\n </div>\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst MIN_SCALE = 1;\nconst MAX_SCALE = 4;\n\nconst getMidpoint = (p1, p2) => ({\n x: (p1.clientX + p2.clientX) / 2,\n y: (p1.clientY + p2.clientY) / 2,\n});\n\nconst getDistance = (p1, p2) =>\n Math.sqrt(Math.pow(p1.clientX - p2.clientX, 2) + Math.pow(p1.clientY - p2.clientY, 2));\n\nconst clamp = (min, max, value) => Math.min(max, Math.max(min, value));\n\nexport default class ZoomableImage extends React.PureComponent {\n\n static propTypes = {\n alt: PropTypes.string,\n src: PropTypes.string.isRequired,\n width: PropTypes.number,\n height: PropTypes.number,\n onClick: PropTypes.func,\n }\n\n static defaultProps = {\n alt: '',\n width: null,\n height: null,\n };\n\n state = {\n scale: MIN_SCALE,\n }\n\n removers = [];\n container = null;\n image = null;\n lastTouchEndTime = 0;\n lastDistance = 0;\n\n componentDidMount () {\n let handler = this.handleTouchStart;\n this.container.addEventListener('touchstart', handler);\n this.removers.push(() => this.container.removeEventListener('touchstart', handler));\n handler = this.handleTouchMove;\n // on Chrome 56+, touch event listeners will default to passive\n // https://www.chromestatus.com/features/5093566007214080\n this.container.addEventListener('touchmove', handler, { passive: false });\n this.removers.push(() => this.container.removeEventListener('touchend', handler));\n }\n\n componentWillUnmount () {\n this.removeEventListeners();\n }\n\n removeEventListeners () {\n this.removers.forEach(listeners => listeners());\n this.removers = [];\n }\n\n handleTouchStart = e => {\n if (e.touches.length !== 2) return;\n\n this.lastDistance = getDistance(...e.touches);\n }\n\n handleTouchMove = e => {\n const { scrollTop, scrollHeight, clientHeight } = this.container;\n if (e.touches.length === 1 && scrollTop !== scrollHeight - clientHeight) {\n // prevent propagating event to MediaModal\n e.stopPropagation();\n return;\n }\n if (e.touches.length !== 2) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n const distance = getDistance(...e.touches);\n const midpoint = getMidpoint(...e.touches);\n const scale = clamp(MIN_SCALE, MAX_SCALE, this.state.scale * distance / this.lastDistance);\n\n this.zoom(scale, midpoint);\n\n this.lastMidpoint = midpoint;\n this.lastDistance = distance;\n }\n\n zoom(nextScale, midpoint) {\n const { scale } = this.state;\n const { scrollLeft, scrollTop } = this.container;\n\n // math memo:\n // x = (scrollLeft + midpoint.x) / scrollWidth\n // x' = (nextScrollLeft + midpoint.x) / nextScrollWidth\n // scrollWidth = clientWidth * scale\n // scrollWidth' = clientWidth * nextScale\n // Solve x = x' for nextScrollLeft\n const nextScrollLeft = (scrollLeft + midpoint.x) * nextScale / scale - midpoint.x;\n const nextScrollTop = (scrollTop + midpoint.y) * nextScale / scale - midpoint.y;\n\n this.setState({ scale: nextScale }, () => {\n this.container.scrollLeft = nextScrollLeft;\n this.container.scrollTop = nextScrollTop;\n });\n }\n\n handleClick = e => {\n // don't propagate event to MediaModal\n e.stopPropagation();\n const handler = this.props.onClick;\n if (handler) handler();\n }\n\n setContainerRef = c => {\n this.container = c;\n }\n\n setImageRef = c => {\n this.image = c;\n }\n\n render () {\n const { alt, src } = this.props;\n const { scale } = this.state;\n const overflow = scale === 1 ? 'hidden' : 'scroll';\n\n return (\n <div\n className='zoomable-image'\n ref={this.setContainerRef}\n style={{ overflow }}\n >\n <img\n role='presentation'\n ref={this.setImageRef}\n alt={alt}\n title={alt}\n src={src}\n style={{\n transform: `scale(${scale})`,\n transformOrigin: '0 0',\n }}\n onClick={this.handleClick}\n />\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { LoadingBar } from 'react-redux-loading-bar';\nimport ZoomableImage from './zoomable_image';\n\nexport default class ImageLoader extends React.PureComponent {\n\n static propTypes = {\n alt: PropTypes.string,\n src: PropTypes.string.isRequired,\n previewSrc: PropTypes.string,\n width: PropTypes.number,\n height: PropTypes.number,\n onClick: PropTypes.func,\n }\n\n static defaultProps = {\n alt: '',\n width: null,\n height: null,\n };\n\n state = {\n loading: true,\n error: false,\n width: null,\n }\n\n removers = [];\n canvas = null;\n\n get canvasContext() {\n if (!this.canvas) {\n return null;\n }\n this._canvasContext = this._canvasContext || this.canvas.getContext('2d');\n return this._canvasContext;\n }\n\n componentDidMount () {\n this.loadImage(this.props);\n }\n\n componentWillReceiveProps (nextProps) {\n if (this.props.src !== nextProps.src) {\n this.loadImage(nextProps);\n }\n }\n\n componentWillUnmount () {\n this.removeEventListeners();\n }\n\n loadImage (props) {\n this.removeEventListeners();\n this.setState({ loading: true, error: false });\n Promise.all([\n props.previewSrc && this.loadPreviewCanvas(props),\n this.hasSize() && this.loadOriginalImage(props),\n ].filter(Boolean))\n .then(() => {\n this.setState({ loading: false, error: false });\n this.clearPreviewCanvas();\n })\n .catch(() => this.setState({ loading: false, error: true }));\n }\n\n loadPreviewCanvas = ({ previewSrc, width, height }) => new Promise((resolve, reject) => {\n const image = new Image();\n const removeEventListeners = () => {\n image.removeEventListener('error', handleError);\n image.removeEventListener('load', handleLoad);\n };\n const handleError = () => {\n removeEventListeners();\n reject();\n };\n const handleLoad = () => {\n removeEventListeners();\n this.canvasContext.drawImage(image, 0, 0, width, height);\n resolve();\n };\n image.addEventListener('error', handleError);\n image.addEventListener('load', handleLoad);\n image.src = previewSrc;\n this.removers.push(removeEventListeners);\n })\n\n clearPreviewCanvas () {\n const { width, height } = this.canvas;\n this.canvasContext.clearRect(0, 0, width, height);\n }\n\n loadOriginalImage = ({ src }) => new Promise((resolve, reject) => {\n const image = new Image();\n const removeEventListeners = () => {\n image.removeEventListener('error', handleError);\n image.removeEventListener('load', handleLoad);\n };\n const handleError = () => {\n removeEventListeners();\n reject();\n };\n const handleLoad = () => {\n removeEventListeners();\n resolve();\n };\n image.addEventListener('error', handleError);\n image.addEventListener('load', handleLoad);\n image.src = src;\n this.removers.push(removeEventListeners);\n });\n\n removeEventListeners () {\n this.removers.forEach(listeners => listeners());\n this.removers = [];\n }\n\n hasSize () {\n const { width, height } = this.props;\n return typeof width === 'number' && typeof height === 'number';\n }\n\n setCanvasRef = c => {\n this.canvas = c;\n if (c) this.setState({ width: c.offsetWidth });\n }\n\n render () {\n const { alt, src, width, height, onClick } = this.props;\n const { loading } = this.state;\n\n const className = classNames('image-loader', {\n 'image-loader--loading': loading,\n 'image-loader--amorphous': !this.hasSize(),\n });\n\n return (\n <div className={className}>\n <LoadingBar loading={loading ? 1 : 0} className='loading-bar' style={{ width: this.state.width || width }} />\n {loading ? (\n <canvas\n className='image-loader__preview-canvas'\n ref={this.setCanvasRef}\n width={width}\n height={height}\n />\n ) : (\n <ZoomableImage\n alt={alt}\n src={src}\n onClick={onClick}\n />\n )}\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport ReactSwipeableViews from 'react-swipeable-views';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport Video from 'flavours/glitch/features/video';\nimport classNames from 'classnames';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImageLoader from './image_loader';\nimport Icon from 'flavours/glitch/components/icon';\nimport GIFV from 'flavours/glitch/components/gifv';\n\nconst messages = defineMessages({\n close: { id: 'lightbox.close', defaultMessage: 'Close' },\n previous: { id: 'lightbox.previous', defaultMessage: 'Previous' },\n next: { id: 'lightbox.next', defaultMessage: 'Next' },\n});\n\nexport default @injectIntl\nclass MediaModal extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n media: ImmutablePropTypes.list.isRequired,\n status: ImmutablePropTypes.map,\n index: PropTypes.number.isRequired,\n onClose: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n index: null,\n navigationHidden: false,\n };\n\n handleSwipe = (index) => {\n this.setState({ index: index % this.props.media.size });\n }\n\n handleNextClick = () => {\n this.setState({ index: (this.getIndex() + 1) % this.props.media.size });\n }\n\n handlePrevClick = () => {\n this.setState({ index: (this.props.media.size + this.getIndex() - 1) % this.props.media.size });\n }\n\n handleChangeIndex = (e) => {\n const index = Number(e.currentTarget.getAttribute('data-index'));\n this.setState({ index: index % this.props.media.size });\n }\n\n handleKeyDown = (e) => {\n switch(e.key) {\n case 'ArrowLeft':\n this.handlePrevClick();\n e.preventDefault();\n e.stopPropagation();\n break;\n case 'ArrowRight':\n this.handleNextClick();\n e.preventDefault();\n e.stopPropagation();\n break;\n }\n }\n\n componentDidMount () {\n window.addEventListener('keydown', this.handleKeyDown, false);\n }\n\n componentWillUnmount () {\n window.removeEventListener('keydown', this.handleKeyDown);\n }\n\n getIndex () {\n return this.state.index !== null ? this.state.index : this.props.index;\n }\n\n toggleNavigation = () => {\n this.setState(prevState => ({\n navigationHidden: !prevState.navigationHidden,\n }));\n };\n\n handleStatusClick = e => {\n if (e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n e.preventDefault();\n this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);\n }\n }\n\n render () {\n const { media, status, intl, onClose } = this.props;\n const { navigationHidden } = this.state;\n\n const index = this.getIndex();\n let pagination = [];\n\n const leftNav = media.size > 1 && <button tabIndex='0' className='media-modal__nav media-modal__nav--left' onClick={this.handlePrevClick} aria-label={intl.formatMessage(messages.previous)}><Icon id='chevron-left' fixedWidth /></button>;\n const rightNav = media.size > 1 && <button tabIndex='0' className='media-modal__nav media-modal__nav--right' onClick={this.handleNextClick} aria-label={intl.formatMessage(messages.next)}><Icon id='chevron-right' fixedWidth /></button>;\n\n if (media.size > 1) {\n pagination = media.map((item, i) => {\n const classes = ['media-modal__button'];\n if (i === index) {\n classes.push('media-modal__button--active');\n }\n return (<li className='media-modal__page-dot' key={i}><button tabIndex='0' className={classes.join(' ')} onClick={this.handleChangeIndex} data-index={i}>{i + 1}</button></li>);\n });\n }\n\n const content = media.map((image) => {\n const width = image.getIn(['meta', 'original', 'width']) || null;\n const height = image.getIn(['meta', 'original', 'height']) || null;\n\n if (image.get('type') === 'image') {\n return (\n <ImageLoader\n previewSrc={image.get('preview_url')}\n src={image.get('url')}\n width={width}\n height={height}\n alt={image.get('description')}\n key={image.get('url')}\n onClick={this.toggleNavigation}\n />\n );\n } else if (image.get('type') === 'video') {\n const { time } = this.props;\n\n return (\n <Video\n preview={image.get('preview_url')}\n blurhash={image.get('blurhash')}\n src={image.get('url')}\n width={image.get('width')}\n height={image.get('height')}\n startTime={time || 0}\n onCloseVideo={onClose}\n detailed\n alt={image.get('description')}\n key={image.get('url')}\n />\n );\n } else if (image.get('type') === 'gifv') {\n return (\n <GIFV\n src={image.get('url')}\n width={width}\n height={height}\n key={image.get('preview_url')}\n alt={image.get('description')}\n onClick={this.toggleNavigation}\n />\n );\n }\n\n return null;\n }).toArray();\n\n // you can't use 100vh, because the viewport height is taller\n // than the visible part of the document in some mobile\n // browsers when it's address bar is visible.\n // https://developers.google.com/web/updates/2016/12/url-bar-resizing\n const swipeableViewsStyle = {\n width: '100%',\n height: '100%',\n };\n\n const containerStyle = {\n alignItems: 'center', // center vertically\n };\n\n const navigationClassName = classNames('media-modal__navigation', {\n 'media-modal__navigation--hidden': navigationHidden,\n });\n\n return (\n <div className='modal-root__modal media-modal'>\n <div\n className='media-modal__closer'\n role='presentation'\n onClick={onClose}\n >\n <ReactSwipeableViews\n style={swipeableViewsStyle}\n containerStyle={containerStyle}\n onChangeIndex={this.handleSwipe}\n index={index}\n >\n {content}\n </ReactSwipeableViews>\n </div>\n\n <div className={navigationClassName}>\n <IconButton className='media-modal__close' title={intl.formatMessage(messages.close)} icon='times' onClick={onClose} size={40} />\n\n {leftNav}\n {rightNav}\n\n {status && (\n <div className={classNames('media-modal__meta', { 'media-modal__meta--shifted': media.size > 1 })}>\n <a href={status.get('url')} onClick={this.handleStatusClick}><Icon id='comments' /> <FormattedMessage id='lightbox.view_context' defaultMessage='View context' /></a>\n </div>\n )}\n\n <ul className='media-modal__pagination'>\n {pagination}\n </ul>\n </div>\n </div>\n );\n }\n\n}\n","import api from '../api';\nimport { importFetchedPoll } from './importer';\n\nexport const POLL_VOTE_REQUEST = 'POLL_VOTE_REQUEST';\nexport const POLL_VOTE_SUCCESS = 'POLL_VOTE_SUCCESS';\nexport const POLL_VOTE_FAIL = 'POLL_VOTE_FAIL';\n\nexport const POLL_FETCH_REQUEST = 'POLL_FETCH_REQUEST';\nexport const POLL_FETCH_SUCCESS = 'POLL_FETCH_SUCCESS';\nexport const POLL_FETCH_FAIL = 'POLL_FETCH_FAIL';\n\nexport const vote = (pollId, choices) => (dispatch, getState) => {\n dispatch(voteRequest());\n\n api(getState).post(`/api/v1/polls/${pollId}/votes`, { choices })\n .then(({ data }) => {\n dispatch(importFetchedPoll(data));\n dispatch(voteSuccess(data));\n })\n .catch(err => dispatch(voteFail(err)));\n};\n\nexport const fetchPoll = pollId => (dispatch, getState) => {\n dispatch(fetchPollRequest());\n\n api(getState).get(`/api/v1/polls/${pollId}`)\n .then(({ data }) => {\n dispatch(importFetchedPoll(data));\n dispatch(fetchPollSuccess(data));\n })\n .catch(err => dispatch(fetchPollFail(err)));\n};\n\nexport const voteRequest = () => ({\n type: POLL_VOTE_REQUEST,\n});\n\nexport const voteSuccess = poll => ({\n type: POLL_VOTE_SUCCESS,\n poll,\n});\n\nexport const voteFail = error => ({\n type: POLL_VOTE_FAIL,\n error,\n});\n\nexport const fetchPollRequest = () => ({\n type: POLL_FETCH_REQUEST,\n});\n\nexport const fetchPollSuccess = poll => ({\n type: POLL_FETCH_SUCCESS,\n poll,\n});\n\nexport const fetchPollFail = error => ({\n type: POLL_FETCH_FAIL,\n error,\n});\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport classNames from 'classnames';\nimport { vote, fetchPoll } from 'mastodon/actions/polls';\nimport Motion from 'mastodon/features/ui/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport escapeTextContentForBrowser from 'escape-html';\nimport emojify from 'mastodon/features/emoji/emoji';\nimport RelativeTimestamp from './relative_timestamp';\nimport Icon from 'mastodon/components/icon';\n\nconst messages = defineMessages({\n closed: { id: 'poll.closed', defaultMessage: 'Closed' },\n voted: { id: 'poll.voted', defaultMessage: 'You voted for this answer', description: 'Tooltip of the \"voted\" checkmark in polls' },\n});\n\nconst makeEmojiMap = record => record.get('emojis').reduce((obj, emoji) => {\n obj[`:${emoji.get('shortcode')}:`] = emoji.toJS();\n return obj;\n}, {});\n\nexport default @injectIntl\nclass Poll extends ImmutablePureComponent {\n\n static propTypes = {\n poll: ImmutablePropTypes.map,\n intl: PropTypes.object.isRequired,\n dispatch: PropTypes.func,\n disabled: PropTypes.bool,\n };\n\n state = {\n selected: {},\n expired: null,\n };\n\n static getDerivedStateFromProps (props, state) {\n const { poll, intl } = props;\n const expires_at = poll.get('expires_at');\n const expired = poll.get('expired') || expires_at !== null && (new Date(expires_at)).getTime() < intl.now();\n return (expired === state.expired) ? null : { expired };\n }\n\n componentDidMount () {\n this._setupTimer();\n }\n\n componentDidUpdate () {\n this._setupTimer();\n }\n\n componentWillUnmount () {\n clearTimeout(this._timer);\n }\n\n _setupTimer () {\n const { poll, intl } = this.props;\n clearTimeout(this._timer);\n if (!this.state.expired) {\n const delay = (new Date(poll.get('expires_at'))).getTime() - intl.now();\n this._timer = setTimeout(() => {\n this.setState({ expired: true });\n }, delay);\n }\n }\n\n _toggleOption = value => {\n if (this.props.poll.get('multiple')) {\n const tmp = { ...this.state.selected };\n if (tmp[value]) {\n delete tmp[value];\n } else {\n tmp[value] = true;\n }\n this.setState({ selected: tmp });\n } else {\n const tmp = {};\n tmp[value] = true;\n this.setState({ selected: tmp });\n }\n }\n\n handleOptionChange = ({ target: { value } }) => {\n this._toggleOption(value);\n };\n\n handleOptionKeyPress = (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n this._toggleOption(e.target.getAttribute('data-index'));\n e.stopPropagation();\n e.preventDefault();\n }\n }\n\n handleVote = () => {\n if (this.props.disabled) {\n return;\n }\n\n this.props.dispatch(vote(this.props.poll.get('id'), Object.keys(this.state.selected)));\n };\n\n handleRefresh = () => {\n if (this.props.disabled) {\n return;\n }\n\n this.props.dispatch(fetchPoll(this.props.poll.get('id')));\n };\n\n renderOption (option, optionIndex, showResults) {\n const { poll, disabled, intl } = this.props;\n const pollVotesCount = poll.get('voters_count') || poll.get('votes_count');\n const percent = pollVotesCount === 0 ? 0 : (option.get('votes_count') / pollVotesCount) * 100;\n const leading = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') >= other.get('votes_count'));\n const active = !!this.state.selected[`${optionIndex}`];\n const voted = option.get('voted') || (poll.get('own_votes') && poll.get('own_votes').includes(optionIndex));\n\n let titleEmojified = option.get('title_emojified');\n if (!titleEmojified) {\n const emojiMap = makeEmojiMap(poll);\n titleEmojified = emojify(escapeTextContentForBrowser(option.get('title')), emojiMap);\n }\n\n return (\n <li key={option.get('title')}>\n <label className={classNames('poll__option', { selectable: !showResults })}>\n <input\n name='vote-options'\n type={poll.get('multiple') ? 'checkbox' : 'radio'}\n value={optionIndex}\n checked={active}\n onChange={this.handleOptionChange}\n disabled={disabled}\n />\n\n {!showResults && (\n <span\n className={classNames('poll__input', { checkbox: poll.get('multiple'), active })}\n tabIndex='0'\n role={poll.get('multiple') ? 'checkbox' : 'radio'}\n onKeyPress={this.handleOptionKeyPress}\n aria-checked={active}\n aria-label={option.get('title')}\n data-index={optionIndex}\n />\n )}\n {showResults && <span className='poll__number'>\n {Math.round(percent)}%\n </span>}\n\n <span\n className='poll__option__text'\n dangerouslySetInnerHTML={{ __html: titleEmojified }}\n />\n\n {!!voted && <span className='poll__voted'>\n <Icon id='check' className='poll__voted__mark' title={intl.formatMessage(messages.voted)} />\n </span>}\n </label>\n\n {showResults && (\n <Motion defaultStyle={{ width: 0 }} style={{ width: spring(percent, { stiffness: 180, damping: 12 }) }}>\n {({ width }) =>\n <span className={classNames('poll__chart', { leading })} style={{ width: `${width}%` }} />\n }\n </Motion>\n )}\n </li>\n );\n }\n\n render () {\n const { poll, intl } = this.props;\n const { expired } = this.state;\n\n if (!poll) {\n return null;\n }\n\n const timeRemaining = expired ? intl.formatMessage(messages.closed) : <RelativeTimestamp timestamp={poll.get('expires_at')} futureDate />;\n const showResults = poll.get('voted') || expired;\n const disabled = this.props.disabled || Object.entries(this.state.selected).every(item => !item);\n\n let votesCount = null;\n\n if (poll.get('voters_count') !== null && poll.get('voters_count') !== undefined) {\n votesCount = <FormattedMessage id='poll.total_people' defaultMessage='{count, plural, one {# person} other {# people}}' values={{ count: poll.get('voters_count') }} />;\n } else {\n votesCount = <FormattedMessage id='poll.total_votes' defaultMessage='{count, plural, one {# vote} other {# votes}}' values={{ count: poll.get('votes_count') }} />;\n }\n\n return (\n <div className='poll'>\n <ul>\n {poll.get('options').map((option, i) => this.renderOption(option, i, showResults))}\n </ul>\n\n <div className='poll__footer'>\n {!showResults && <button className='button button-secondary' disabled={disabled} onClick={this.handleVote}><FormattedMessage id='poll.vote' defaultMessage='Vote' /></button>}\n {showResults && !this.props.disabled && <span><button className='poll__link' onClick={this.handleRefresh}><FormattedMessage id='poll.refresh' defaultMessage='Refresh' /></button> · </span>}\n {votesCount}\n {poll.get('expires_at') && <span> · {timeRemaining}</span>}\n </div>\n </div>\n );\n }\n\n}\n","import { autoPlayGif } from '../../initial_state';\nimport unicodeMapping from './emoji_unicode_mapping_light';\nimport Trie from 'substring-trie';\n\nconst trie = new Trie(Object.keys(unicodeMapping));\n\nconst assetHost = process.env.CDN_HOST || '';\n\nconst emojify = (str, customEmojis = {}) => {\n const tagCharsWithoutEmojis = '<&';\n const tagCharsWithEmojis = Object.keys(customEmojis).length ? '<&:' : '<&';\n let rtn = '', tagChars = tagCharsWithEmojis, invisible = 0;\n for (;;) {\n let match, i = 0, tag;\n while (i < str.length && (tag = tagChars.indexOf(str[i])) === -1 && (invisible || !(match = trie.search(str.slice(i))))) {\n i += str.codePointAt(i) < 65536 ? 1 : 2;\n }\n let rend, replacement = '';\n if (i === str.length) {\n break;\n } else if (str[i] === ':') {\n if (!(() => {\n rend = str.indexOf(':', i + 1) + 1;\n if (!rend) return false; // no pair of ':'\n const lt = str.indexOf('<', i + 1);\n if (!(lt === -1 || lt >= rend)) return false; // tag appeared before closing ':'\n const shortname = str.slice(i, rend);\n // now got a replacee as ':shortname:'\n // if you want additional emoji handler, add statements below which set replacement and return true.\n if (shortname in customEmojis) {\n const filename = autoPlayGif ? customEmojis[shortname].url : customEmojis[shortname].static_url;\n replacement = `<img draggable=\"false\" class=\"emojione custom-emoji\" alt=\"${shortname}\" title=\"${shortname}\" src=\"${filename}\" data-original=\"${customEmojis[shortname].url}\" data-static=\"${customEmojis[shortname].static_url}\" />`;\n return true;\n }\n return false;\n })()) rend = ++i;\n } else if (tag >= 0) { // <, &\n rend = str.indexOf('>;'[tag], i + 1) + 1;\n if (!rend) {\n break;\n }\n if (tag === 0) {\n if (invisible) {\n if (str[i + 1] === '/') { // closing tag\n if (!--invisible) {\n tagChars = tagCharsWithEmojis;\n }\n } else if (str[rend - 2] !== '/') { // opening tag\n invisible++;\n }\n } else {\n if (str.startsWith('<span class=\"invisible\">', i)) {\n // avoid emojifying on invisible text\n invisible = 1;\n tagChars = tagCharsWithoutEmojis;\n }\n }\n }\n i = rend;\n } else { // matched to unicode emoji\n const { filename, shortCode } = unicodeMapping[match];\n const title = shortCode ? `:${shortCode}:` : '';\n replacement = `<img draggable=\"false\" class=\"emojione\" alt=\"${match}\" title=\"${title}\" src=\"${assetHost}/emoji/${filename}.svg\" />`;\n rend = i + match.length;\n // If the matched character was followed by VS15 (for selecting text presentation), skip it.\n if (str.codePointAt(rend) === 65038) {\n rend += 1;\n }\n }\n rtn += str.slice(0, i) + replacement;\n str = str.slice(rend);\n }\n return rtn + str;\n};\n\nexport default emojify;\n\nexport const buildCustomEmojis = (customEmojis) => {\n const emojis = [];\n\n customEmojis.forEach(emoji => {\n const shortcode = emoji.get('shortcode');\n const url = autoPlayGif ? emoji.get('url') : emoji.get('static_url');\n const name = shortcode.replace(':', '');\n\n emojis.push({\n id: name,\n name,\n short_names: [name],\n text: '',\n emoticons: [],\n keywords: [name],\n imageUrl: url,\n custom: true,\n customCategory: emoji.get('category'),\n });\n });\n\n return emojis;\n};\n\nexport const categoriesFromEmojis = customEmojis => customEmojis.reduce((set, emoji) => set.add(emoji.get('category') ? `custom-${emoji.get('category')}` : 'custom'), new Set(['custom']));\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n'use strict';\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n // \"\n escape = '&quot;';\n break;\n\n case 38:\n // &\n escape = '&amp;';\n break;\n\n case 39:\n // '\n escape = '&#39;';\n break;\n\n case 60:\n // <\n escape = '&lt;';\n break;\n\n case 62:\n // >\n escape = '&gt;';\n break;\n\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\n}","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from 'mastodon/components/icon';\n\nexport default class IconButton extends React.PureComponent {\n\n static propTypes = {\n className: PropTypes.string,\n title: PropTypes.string.isRequired,\n icon: PropTypes.string.isRequired,\n onClick: PropTypes.func,\n onMouseDown: PropTypes.func,\n onKeyDown: PropTypes.func,\n onKeyPress: PropTypes.func,\n size: PropTypes.number,\n active: PropTypes.bool,\n pressed: PropTypes.bool,\n expanded: PropTypes.bool,\n style: PropTypes.object,\n activeStyle: PropTypes.object,\n disabled: PropTypes.bool,\n inverted: PropTypes.bool,\n animate: PropTypes.bool,\n overlay: PropTypes.bool,\n tabIndex: PropTypes.string,\n };\n\n static defaultProps = {\n size: 18,\n active: false,\n disabled: false,\n animate: false,\n overlay: false,\n tabIndex: '0',\n };\n\n state = {\n activate: false,\n deactivate: false,\n }\n\n componentWillReceiveProps (nextProps) {\n if (!nextProps.animate) return;\n\n if (this.props.active && !nextProps.active) {\n this.setState({ activate: false, deactivate: true });\n } else if (!this.props.active && nextProps.active) {\n this.setState({ activate: true, deactivate: false });\n }\n }\n\n handleClick = (e) => {\n e.preventDefault();\n\n if (!this.props.disabled) {\n this.props.onClick(e);\n }\n }\n\n handleKeyPress = (e) => {\n if (this.props.onKeyPress && !this.props.disabled) {\n this.props.onKeyPress(e);\n }\n }\n\n handleMouseDown = (e) => {\n if (!this.props.disabled && this.props.onMouseDown) {\n this.props.onMouseDown(e);\n }\n }\n\n handleKeyDown = (e) => {\n if (!this.props.disabled && this.props.onKeyDown) {\n this.props.onKeyDown(e);\n }\n }\n\n render () {\n const style = {\n fontSize: `${this.props.size}px`,\n width: `${this.props.size * 1.28571429}px`,\n height: `${this.props.size * 1.28571429}px`,\n lineHeight: `${this.props.size}px`,\n ...this.props.style,\n ...(this.props.active ? this.props.activeStyle : {}),\n };\n\n const {\n active,\n className,\n disabled,\n expanded,\n icon,\n inverted,\n overlay,\n pressed,\n tabIndex,\n title,\n } = this.props;\n\n const {\n activate,\n deactivate,\n } = this.state;\n\n const classes = classNames(className, 'icon-button', {\n active,\n disabled,\n inverted,\n activate,\n deactivate,\n overlayed: overlay,\n });\n\n return (\n <button\n aria-label={title}\n aria-pressed={pressed}\n aria-expanded={expanded}\n title={title}\n className={classes}\n onClick={this.handleClick}\n onMouseDown={this.handleMouseDown}\n onKeyDown={this.handleKeyDown}\n onKeyPress={this.handleKeyPress}\n style={style}\n tabIndex={tabIndex}\n disabled={disabled}\n >\n <Icon id={icon} fixedWidth aria-hidden='true' />\n </button>\n );\n }\n\n}\n","var debounce = require('./debounce'),\n isObject = require('./isObject');\n/** Error message constants. */\n\n\nvar FUNC_ERROR_TEXT = 'Expected a function';\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nmodule.exports = throttle;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.showLoading = exports.resetLoading = exports.loadingBarReducer = exports.loadingBarMiddleware = exports.LoadingBar = exports.ImmutableLoadingBar = exports.hideLoading = undefined;\n\nvar _loading_bar = require('./loading_bar');\n\nvar _loading_bar2 = _interopRequireDefault(_loading_bar);\n\nvar _loading_bar_middleware = require('./loading_bar_middleware');\n\nvar _loading_bar_middleware2 = _interopRequireDefault(_loading_bar_middleware);\n\nvar _loading_bar_ducks = require('./loading_bar_ducks');\n\nvar _immutable = require('./immutable');\n\nvar _immutable2 = _interopRequireDefault(_immutable);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nexports.hideLoading = _loading_bar_ducks.hideLoading;\nexports.ImmutableLoadingBar = _immutable2.default;\nexports.LoadingBar = _loading_bar.LoadingBar;\nexports.loadingBarMiddleware = _loading_bar_middleware2.default;\nexports.loadingBarReducer = _loading_bar_ducks.loadingBarReducer;\nexports.resetLoading = _loading_bar_ducks.resetLoading;\nexports.showLoading = _loading_bar_ducks.showLoading;\nexports.default = _loading_bar2.default;","module.exports = require('./lib/axios');","import { autoPlayGif, useSystemEmojiFont } from 'flavours/glitch/util/initial_state';\nimport unicodeMapping from './emoji_unicode_mapping_light';\nimport Trie from 'substring-trie';\n\nconst trie = new Trie(Object.keys(unicodeMapping));\n\nconst assetHost = process.env.CDN_HOST || '';\n\nconst emojify = (str, customEmojis = {}) => {\n const tagCharsWithoutEmojis = '<&';\n const tagCharsWithEmojis = Object.keys(customEmojis).length ? '<&:' : '<&';\n let rtn = '', tagChars = tagCharsWithEmojis, invisible = 0;\n for (;;) {\n let match, i = 0, tag;\n while (i < str.length && (tag = tagChars.indexOf(str[i])) === -1 && (invisible || useSystemEmojiFont || !(match = trie.search(str.slice(i))))) {\n i += str.codePointAt(i) < 65536 ? 1 : 2;\n }\n let rend, replacement = '';\n if (i === str.length) {\n break;\n } else if (str[i] === ':') {\n if (!(() => {\n rend = str.indexOf(':', i + 1) + 1;\n if (!rend) return false; // no pair of ':'\n const lt = str.indexOf('<', i + 1);\n if (!(lt === -1 || lt >= rend)) return false; // tag appeared before closing ':'\n const shortname = str.slice(i, rend);\n // now got a replacee as ':shortname:'\n // if you want additional emoji handler, add statements below which set replacement and return true.\n if (shortname in customEmojis) {\n const filename = autoPlayGif ? customEmojis[shortname].url : customEmojis[shortname].static_url;\n replacement = `<img draggable=\"false\" class=\"emojione custom-emoji\" alt=\"${shortname}\" title=\"${shortname}\" src=\"${filename}\" data-original=\"${customEmojis[shortname].url}\" data-static=\"${customEmojis[shortname].static_url}\" />`;\n return true;\n }\n return false;\n })()) rend = ++i;\n } else if (tag >= 0) { // <, &\n rend = str.indexOf('>;'[tag], i + 1) + 1;\n if (!rend) {\n break;\n }\n if (tag === 0) {\n if (invisible) {\n if (str[i + 1] === '/') { // closing tag\n if (!--invisible) {\n tagChars = tagCharsWithEmojis;\n }\n } else if (str[rend - 2] !== '/') { // opening tag\n invisible++;\n }\n } else {\n if (str.startsWith('<span class=\"invisible\">', i)) {\n // avoid emojifying on invisible text\n invisible = 1;\n tagChars = tagCharsWithoutEmojis;\n }\n }\n }\n i = rend;\n } else if (!useSystemEmojiFont) { // matched to unicode emoji\n const { filename, shortCode } = unicodeMapping[match];\n const title = shortCode ? `:${shortCode}:` : '';\n replacement = `<img draggable=\"false\" class=\"emojione\" alt=\"${match}\" title=\"${title}\" src=\"${assetHost}/emoji/${filename}.svg\" />`;\n rend = i + match.length;\n // If the matched character was followed by VS15 (for selecting text presentation), skip it.\n if (str.codePointAt(rend) === 65038) {\n rend += 1;\n }\n }\n rtn += str.slice(0, i) + replacement;\n str = str.slice(rend);\n }\n return rtn + str;\n};\n\nexport default emojify;\nexport { unicodeMapping };\n\nexport const buildCustomEmojis = (customEmojis) => {\n const emojis = [];\n\n customEmojis.forEach(emoji => {\n const shortcode = emoji.get('shortcode');\n const url = autoPlayGif ? emoji.get('url') : emoji.get('static_url');\n const name = shortcode.replace(':', '');\n\n emojis.push({\n id: name,\n name,\n short_names: [name],\n text: '',\n emoticons: [],\n keywords: [name],\n imageUrl: url,\n custom: true,\n customCategory: emoji.get('category'),\n });\n });\n\n return emojis;\n};\n\nexport const categoriesFromEmojis = customEmojis => customEmojis.reduce((set, emoji) => set.add(emoji.get('category') ? `custom-${emoji.get('category')}` : 'custom'), new Set(['custom']));\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n/** Error message constants. */\n\n\nvar FUNC_ERROR_TEXT = 'Expected a function';\n/* Built-in method references for those with the same name as other `lodash` methods. */\n\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n\n wait = toNumber(wait) || 0;\n\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time; // Start the timer for the trailing edge.\n\n timerId = setTimeout(timerExpired, wait); // Invoke the leading edge.\n\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n\n return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;\n }\n\n function timerExpired() {\n var time = now();\n\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n } // Restart the timer.\n\n\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n\n return result;\n }\n\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n}); // adapted from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n\nvar detectPassiveEvents = {\n update: function update() {\n if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {\n var passive = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive = true;\n }\n }); // note: have to set and remove a no-op listener instead of null\n // (which was used previously), becasue Edge v15 throws an error\n // when providing a null callback.\n // https://github.com/rafrex/detect-passive-events/pull/3\n\n var noop = function noop() {};\n\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n detectPassiveEvents.hasSupport = passive;\n }\n }\n};\ndetectPassiveEvents.update();\nexports.default = detectPassiveEvents;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function warning() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;","var freeGlobal = require('./_freeGlobal');\n/** Detect free variable `self`. */\n\n\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n/** Used as a reference to the global object. */\n\nvar root = freeGlobal || freeSelf || Function('return this')();\nmodule.exports = root;","import React, { PureComponent, Fragment } from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { IntlProvider, addLocaleData } from 'react-intl';\nimport { List as ImmutableList, fromJS } from 'immutable';\nimport { getLocale } from 'mastodon/locales';\nimport { getScrollbarWidth } from 'flavours/glitch/util/scrollbar';\nimport MediaGallery from 'flavours/glitch/components/media_gallery';\nimport Poll from 'flavours/glitch/components/poll';\nimport Hashtag from 'flavours/glitch/components/hashtag';\nimport ModalRoot from 'flavours/glitch/components/modal_root';\nimport MediaModal from 'flavours/glitch/features/ui/components/media_modal';\nimport Video from 'flavours/glitch/features/video';\nimport Card from 'flavours/glitch/features/status/components/card';\nimport Audio from 'flavours/glitch/features/audio';\n\nconst { localeData, messages } = getLocale();\naddLocaleData(localeData);\n\nconst MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll, Hashtag, Audio };\n\nexport default class MediaContainer extends PureComponent {\n\n static propTypes = {\n locale: PropTypes.string.isRequired,\n components: PropTypes.object.isRequired,\n };\n\n state = {\n media: null,\n index: null,\n time: null,\n };\n\n handleOpenMedia = (media, index) => {\n document.body.classList.add('with-modals--active');\n document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;\n\n this.setState({ media, index });\n }\n\n handleOpenVideo = (video, time) => {\n const media = ImmutableList([video]);\n\n document.body.classList.add('with-modals--active');\n document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;\n\n this.setState({ media, time });\n }\n\n handleCloseMedia = () => {\n document.body.classList.remove('with-modals--active');\n document.documentElement.style.marginRight = 0;\n\n this.setState({ media: null, index: null, time: null });\n }\n\n render () {\n const { locale, components } = this.props;\n\n return (\n <IntlProvider locale={locale} messages={messages}>\n <Fragment>\n {[].map.call(components, (component, i) => {\n const componentName = component.getAttribute('data-component');\n const Component = MEDIA_COMPONENTS[componentName];\n const { media, card, poll, hashtag, ...props } = JSON.parse(component.getAttribute('data-props'));\n\n Object.assign(props, {\n ...(media ? { media: fromJS(media) } : {}),\n ...(card ? { card: fromJS(card) } : {}),\n ...(poll ? { poll: fromJS(poll) } : {}),\n ...(hashtag ? { hashtag: fromJS(hashtag) } : {}),\n\n ...(componentName === 'Video' ? {\n onOpenVideo: this.handleOpenVideo,\n } : {\n onOpenMedia: this.handleOpenMedia,\n }),\n });\n\n return ReactDOM.createPortal(\n <Component {...props} key={`media-${i}`} />,\n component,\n );\n })}\n\n <ModalRoot onClose={this.handleCloseMedia}>\n {this.state.media && (\n <MediaModal\n media={this.state.media}\n index={this.state.index || 0}\n time={this.state.time}\n onClose={this.handleCloseMedia}\n />\n )}\n </ModalRoot>\n </Fragment>\n </IntlProvider>\n );\n }\n\n}\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","// A mapping of unicode strings to an object containing the filename\n// (i.e. the svg filename) and a shortCode intended to be shown\n// as a \"title\" attribute in an HTML element (aka tooltip).\n\nconst [\n shortCodesToEmojiData,\n skins, // eslint-disable-line no-unused-vars\n categories, // eslint-disable-line no-unused-vars\n short_names, // eslint-disable-line no-unused-vars\n emojisWithoutShortCodes,\n] = require('./emoji_compressed');\nconst { unicodeToFilename } = require('./unicode_to_filename');\n\n// decompress\nconst unicodeMapping = {};\n\nfunction processEmojiMapData(emojiMapData, shortCode) {\n let [ native, filename ] = emojiMapData;\n if (!filename) {\n // filename name can be derived from unicodeToFilename\n filename = unicodeToFilename(native);\n }\n unicodeMapping[native] = {\n shortCode: shortCode,\n filename: filename,\n };\n}\n\nObject.keys(shortCodesToEmojiData).forEach((shortCode) => {\n let [ filenameData ] = shortCodesToEmojiData[shortCode];\n filenameData.forEach(emojiMapData => processEmojiMapData(emojiMapData, shortCode));\n});\nemojisWithoutShortCodes.forEach(emojiMapData => processEmojiMapData(emojiMapData));\n\nmodule.exports = unicodeMapping;\n","import $$observable from 'symbol-observable';\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\n\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\n\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n/**\n * Creates a Redux store that holds the state tree.\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error('Expected the enhancer to be a function.');\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error('Expected the reducer to be a function.');\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error('Expected the listener to be a function.');\n }\n\n if (isDispatching) {\n throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error('Actions may not have an undefined \"type\" property. ' + 'Have you misspelled a constant?');\n }\n\n if (isDispatching) {\n throw new Error('Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error('Expected the nextReducer to be a function.');\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new TypeError('Expected the observer to be an object.');\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\n\n\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUndefinedStateErrorMessage(key, action) {\n var actionType = action && action.type;\n var actionDescription = actionType && \"action \\\"\" + String(actionType) + \"\\\"\" || 'an action';\n return \"Given \" + actionDescription + \", reducer \\\"\" + key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\";\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + {}.toString.call(inputState).match(/\\s([a-z|A-Z]+)/)[1] + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(\"Reducer \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle \" + ActionTypes.INIT + \" or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var errorMessage = getUndefinedStateErrorMessage(_key, action);\n throw new Error(errorMessage);\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(\"bindActionCreators expected an object or a function, instead received \" + (actionCreators === null ? 'null' : typeof actionCreators) + \". \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\nfunction _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\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n keys.push.apply(keys, Object.getOwnPropertySymbols(object));\n }\n\n if (enumerableOnly) keys = keys.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\n\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread2({}, store, {\n dispatch: _dispatch\n });\n };\n };\n}\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore };","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { fromJS, is } from 'immutable';\nimport { throttle } from 'lodash';\nimport classNames from 'classnames';\nimport { isFullscreen, requestFullscreen, exitFullscreen } from 'flavours/glitch/util/fullscreen';\nimport { displayMedia, useBlurhash } from 'flavours/glitch/util/initial_state';\nimport Icon from 'flavours/glitch/components/icon';\nimport { decode } from 'blurhash';\n\nconst messages = defineMessages({\n play: { id: 'video.play', defaultMessage: 'Play' },\n pause: { id: 'video.pause', defaultMessage: 'Pause' },\n mute: { id: 'video.mute', defaultMessage: 'Mute sound' },\n unmute: { id: 'video.unmute', defaultMessage: 'Unmute sound' },\n hide: { id: 'video.hide', defaultMessage: 'Hide video' },\n expand: { id: 'video.expand', defaultMessage: 'Expand video' },\n close: { id: 'video.close', defaultMessage: 'Close video' },\n fullscreen: { id: 'video.fullscreen', defaultMessage: 'Full screen' },\n exit_fullscreen: { id: 'video.exit_fullscreen', defaultMessage: 'Exit full screen' },\n download: { id: 'video.download', defaultMessage: 'Download file' },\n});\n\nexport const formatTime = secondsNum => {\n let hours = Math.floor(secondsNum / 3600);\n let minutes = Math.floor((secondsNum - (hours * 3600)) / 60);\n let seconds = secondsNum - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) hours = '0' + hours;\n if (minutes < 10) minutes = '0' + minutes;\n if (seconds < 10) seconds = '0' + seconds;\n return (hours === '00' ? '' : `${hours}:`) + `${minutes}:${seconds}`;\n};\n\nexport const findElementPosition = el => {\n let box;\n\n if (el.getBoundingClientRect && el.parentNode) {\n box = el.getBoundingClientRect();\n }\n\n if (!box) {\n return {\n left: 0,\n top: 0,\n };\n }\n\n const docEl = document.documentElement;\n const body = document.body;\n\n const clientLeft = docEl.clientLeft || body.clientLeft || 0;\n const scrollLeft = window.pageXOffset || body.scrollLeft;\n const left = (box.left + scrollLeft) - clientLeft;\n\n const clientTop = docEl.clientTop || body.clientTop || 0;\n const scrollTop = window.pageYOffset || body.scrollTop;\n const top = (box.top + scrollTop) - clientTop;\n\n return {\n left: Math.round(left),\n top: Math.round(top),\n };\n};\n\nexport const getPointerPosition = (el, event) => {\n const position = {};\n const box = findElementPosition(el);\n const boxW = el.offsetWidth;\n const boxH = el.offsetHeight;\n const boxY = box.top;\n const boxX = box.left;\n\n let pageY = event.pageY;\n let pageX = event.pageX;\n\n if (event.changedTouches) {\n pageX = event.changedTouches[0].pageX;\n pageY = event.changedTouches[0].pageY;\n }\n\n position.y = Math.max(0, Math.min(1, (pageY - boxY) / boxH));\n position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW));\n\n return position;\n};\n\nexport default @injectIntl\nclass Video extends React.PureComponent {\n\n static propTypes = {\n preview: PropTypes.string,\n src: PropTypes.string.isRequired,\n alt: PropTypes.string,\n width: PropTypes.number,\n height: PropTypes.number,\n sensitive: PropTypes.bool,\n startTime: PropTypes.number,\n onOpenVideo: PropTypes.func,\n onCloseVideo: PropTypes.func,\n letterbox: PropTypes.bool,\n fullwidth: PropTypes.bool,\n detailed: PropTypes.bool,\n inline: PropTypes.bool,\n editable: PropTypes.bool,\n cacheWidth: PropTypes.func,\n intl: PropTypes.object.isRequired,\n visible: PropTypes.bool,\n onToggleVisibility: PropTypes.func,\n preventPlayback: PropTypes.bool,\n blurhash: PropTypes.string,\n link: PropTypes.node,\n };\n\n state = {\n currentTime: 0,\n duration: 0,\n volume: 0.5,\n paused: true,\n dragging: false,\n containerWidth: this.props.width,\n fullscreen: false,\n hovered: false,\n muted: false,\n revealed: this.props.visible !== undefined ? this.props.visible : (displayMedia !== 'hide_all' && !this.props.sensitive || displayMedia === 'show_all'),\n };\n\n componentWillReceiveProps (nextProps) {\n if (!is(nextProps.visible, this.props.visible) && nextProps.visible !== undefined) {\n this.setState({ revealed: nextProps.visible });\n }\n }\n\n // hard coded in components.scss\n // any way to get ::before values programatically?\n volWidth = 50;\n volOffset = 70;\n volHandleOffset = v => {\n const offset = v * this.volWidth + this.volOffset;\n return (offset > 110) ? 110 : offset;\n }\n\n setPlayerRef = c => {\n this.player = c;\n\n if (c && c.offsetWidth && c.offsetWidth != this.state.containerWidth) {\n if (this.props.cacheWidth) this.props.cacheWidth(this.player.offsetWidth);\n this.setState({\n containerWidth: c.offsetWidth,\n });\n }\n }\n\n setVideoRef = c => {\n this.video = c;\n\n if (this.video) {\n this.setState({ volume: this.video.volume, muted: this.video.muted });\n }\n }\n\n setSeekRef = c => {\n this.seek = c;\n }\n\n setVolumeRef = c => {\n this.volume = c;\n }\n\n setCanvasRef = c => {\n this.canvas = c;\n\n if (c && this.props.blurhash) {\n this._decode();\n }\n }\n\n handleMouseDownRoot = e => {\n e.preventDefault();\n e.stopPropagation();\n }\n\n handlePlay = () => {\n this.setState({ paused: false });\n }\n\n handlePause = () => {\n this.setState({ paused: true });\n }\n\n handleTimeUpdate = () => {\n this.setState({\n currentTime: Math.floor(this.video.currentTime),\n duration: Math.floor(this.video.duration),\n });\n }\n\n handleVolumeMouseDown = e => {\n document.addEventListener('mousemove', this.handleMouseVolSlide, true);\n document.addEventListener('mouseup', this.handleVolumeMouseUp, true);\n document.addEventListener('touchmove', this.handleMouseVolSlide, true);\n document.addEventListener('touchend', this.handleVolumeMouseUp, true);\n\n this.handleMouseVolSlide(e);\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleVolumeMouseUp = () => {\n document.removeEventListener('mousemove', this.handleMouseVolSlide, true);\n document.removeEventListener('mouseup', this.handleVolumeMouseUp, true);\n document.removeEventListener('touchmove', this.handleMouseVolSlide, true);\n document.removeEventListener('touchend', this.handleVolumeMouseUp, true);\n }\n\n handleMouseVolSlide = throttle(e => {\n const rect = this.volume.getBoundingClientRect();\n const x = (e.clientX - rect.left) / this.volWidth; //x position within the element.\n\n if(!isNaN(x)) {\n var slideamt = x;\n if(x > 1) {\n slideamt = 1;\n } else if(x < 0) {\n slideamt = 0;\n }\n this.video.volume = slideamt;\n this.setState({ volume: slideamt });\n }\n }, 60);\n\n handleMouseDown = e => {\n document.addEventListener('mousemove', this.handleMouseMove, true);\n document.addEventListener('mouseup', this.handleMouseUp, true);\n document.addEventListener('touchmove', this.handleMouseMove, true);\n document.addEventListener('touchend', this.handleMouseUp, true);\n\n this.setState({ dragging: true });\n this.video.pause();\n this.handleMouseMove(e);\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleMouseUp = () => {\n document.removeEventListener('mousemove', this.handleMouseMove, true);\n document.removeEventListener('mouseup', this.handleMouseUp, true);\n document.removeEventListener('touchmove', this.handleMouseMove, true);\n document.removeEventListener('touchend', this.handleMouseUp, true);\n\n this.setState({ dragging: false });\n this.video.play();\n }\n\n handleMouseMove = throttle(e => {\n const { x } = getPointerPosition(this.seek, e);\n const currentTime = Math.floor(this.video.duration * x);\n\n if (!isNaN(currentTime)) {\n this.video.currentTime = currentTime;\n this.setState({ currentTime });\n }\n }, 60);\n\n togglePlay = () => {\n if (this.state.paused) {\n this.video.play();\n } else {\n this.video.pause();\n }\n }\n\n toggleFullscreen = () => {\n if (isFullscreen()) {\n exitFullscreen();\n } else {\n requestFullscreen(this.player);\n }\n }\n\n componentDidMount () {\n document.addEventListener('fullscreenchange', this.handleFullscreenChange, true);\n document.addEventListener('webkitfullscreenchange', this.handleFullscreenChange, true);\n document.addEventListener('mozfullscreenchange', this.handleFullscreenChange, true);\n document.addEventListener('MSFullscreenChange', this.handleFullscreenChange, true);\n\n if (this.props.blurhash) {\n this._decode();\n }\n }\n\n componentWillUnmount () {\n document.removeEventListener('fullscreenchange', this.handleFullscreenChange, true);\n document.removeEventListener('webkitfullscreenchange', this.handleFullscreenChange, true);\n document.removeEventListener('mozfullscreenchange', this.handleFullscreenChange, true);\n document.removeEventListener('MSFullscreenChange', this.handleFullscreenChange, true);\n }\n\n componentDidUpdate (prevProps) {\n if (this.player && this.player.offsetWidth && this.player.offsetWidth != this.state.containerWidth && !this.state.fullscreen) {\n if (this.props.cacheWidth) this.props.cacheWidth(this.player.offsetWidth);\n this.setState({\n containerWidth: this.player.offsetWidth,\n });\n }\n if (this.video && this.state.revealed && this.props.preventPlayback && !prevProps.preventPlayback) {\n this.video.pause();\n }\n if (prevProps.blurhash !== this.props.blurhash && this.props.blurhash) {\n this._decode();\n }\n }\n\n _decode () {\n if (!this.canvas || !useBlurhash) return;\n\n const hash = this.props.blurhash;\n const pixels = decode(hash, 32, 32);\n\n if (pixels) {\n const ctx = this.canvas.getContext('2d');\n const imageData = new ImageData(pixels, 32, 32);\n\n ctx.putImageData(imageData, 0, 0);\n }\n }\n\n handleFullscreenChange = () => {\n this.setState({ fullscreen: isFullscreen() });\n }\n\n handleMouseEnter = () => {\n this.setState({ hovered: true });\n }\n\n handleMouseLeave = () => {\n this.setState({ hovered: false });\n }\n\n toggleMute = () => {\n this.video.muted = !this.video.muted;\n this.setState({ muted: this.video.muted });\n }\n\n toggleReveal = () => {\n if (this.state.revealed) {\n this.video.pause();\n }\n\n if (this.props.onToggleVisibility) {\n this.props.onToggleVisibility();\n } else {\n this.setState({ revealed: !this.state.revealed });\n }\n }\n\n handleLoadedData = () => {\n if (this.props.startTime) {\n this.video.currentTime = this.props.startTime;\n this.video.play();\n }\n }\n\n handleProgress = () => {\n if (this.video.buffered.length > 0) {\n this.setState({ buffer: this.video.buffered.end(0) / this.video.duration * 100 });\n }\n }\n\n handleVolumeChange = () => {\n this.setState({ volume: this.video.volume, muted: this.video.muted });\n }\n\n handleOpenVideo = () => {\n const { src, preview, width, height, alt } = this.props;\n\n const media = fromJS({\n type: 'video',\n url: src,\n preview_url: preview,\n description: alt,\n width,\n height,\n });\n\n this.video.pause();\n this.props.onOpenVideo(media, this.video.currentTime);\n }\n\n handleCloseVideo = () => {\n this.video.pause();\n this.props.onCloseVideo();\n }\n\n render () {\n const { preview, src, inline, startTime, onOpenVideo, onCloseVideo, intl, alt, letterbox, fullwidth, detailed, sensitive, link, editable } = this.props;\n const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state;\n const progress = (currentTime / duration) * 100;\n const playerStyle = {};\n\n const volumeWidth = (muted) ? 0 : volume * this.volWidth;\n const volumeHandleLoc = (muted) ? this.volHandleOffset(0) : this.volHandleOffset(volume);\n\n const computedClass = classNames('video-player', { inactive: !revealed, detailed, inline: inline && !fullscreen, fullscreen, editable, letterbox, 'full-width': fullwidth });\n\n let { width, height } = this.props;\n\n if (inline && containerWidth) {\n width = containerWidth;\n height = containerWidth / (16/9);\n\n playerStyle.height = height;\n } else if (inline) {\n return (<div className={computedClass} ref={this.setPlayerRef} tabindex={0}></div>);\n }\n\n let warning;\n if (sensitive) {\n warning = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />;\n } else {\n warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />;\n }\n\n let preload;\n\n if (startTime || fullscreen || dragging) {\n preload = 'auto';\n } else if (detailed) {\n preload = 'metadata';\n } else {\n preload = 'none';\n }\n\n return (\n <div\n className={computedClass}\n style={playerStyle}\n ref={this.setPlayerRef}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onMouseDown={this.handleMouseDownRoot}\n tabIndex={0}\n >\n <canvas width={32} height={32} ref={this.setCanvasRef} className={classNames('media-gallery__preview', { 'media-gallery__preview--hidden': revealed })} />\n\n {(revealed || editable) && <video\n ref={this.setVideoRef}\n src={src}\n poster={preview}\n preload={preload}\n loop\n role='button'\n tabIndex='0'\n aria-label={alt}\n title={alt}\n width={width}\n height={height}\n volume={volume}\n onClick={this.togglePlay}\n onPlay={this.handlePlay}\n onPause={this.handlePause}\n onTimeUpdate={this.handleTimeUpdate}\n onLoadedData={this.handleLoadedData}\n onProgress={this.handleProgress}\n onVolumeChange={this.handleVolumeChange}\n />}\n\n <div className={classNames('spoiler-button', { 'spoiler-button--hidden': revealed || editable })}>\n <button type='button' className='spoiler-button__overlay' onClick={this.toggleReveal}>\n <span className='spoiler-button__overlay__label'>{warning}</span>\n </button>\n </div>\n\n <div className={classNames('video-player__controls', { active: paused || hovered })}>\n <div className='video-player__seek' onMouseDown={this.handleMouseDown} ref={this.setSeekRef}>\n <div className='video-player__seek__buffer' style={{ width: `${buffer}%` }} />\n <div className='video-player__seek__progress' style={{ width: `${progress}%` }} />\n\n <span\n className={classNames('video-player__seek__handle', { active: dragging })}\n tabIndex='0'\n style={{ left: `${progress}%` }}\n />\n </div>\n\n <div className='video-player__buttons-bar'>\n <div className='video-player__buttons left'>\n <button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} onClick={this.togglePlay} autoFocus={detailed}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button>\n <button type='button' title={intl.formatMessage(muted ? messages.unmute : messages.mute)} aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} onClick={this.toggleMute}><Icon id={muted ? 'volume-off' : 'volume-up'} fixedWidth /></button>\n\n <div className='video-player__volume' onMouseDown={this.handleVolumeMouseDown} ref={this.setVolumeRef}>\n &nbsp;\n <div className='video-player__volume__current' style={{ width: `${volumeWidth}px` }} />\n <span\n className={classNames('video-player__volume__handle')}\n tabIndex='0'\n style={{ left: `${volumeHandleLoc}px` }}\n />\n </div>\n\n {(detailed || fullscreen) && (\n <span>\n <span className='video-player__time-current'>{formatTime(currentTime)}</span>\n <span className='video-player__time-sep'>/</span>\n <span className='video-player__time-total'>{formatTime(duration)}</span>\n </span>\n )}\n\n {link && <span className='video-player__link'>{link}</span>}\n </div>\n\n <div className='video-player__buttons right'>\n {(!onCloseVideo && !editable && !fullscreen) && <button type='button' title={intl.formatMessage(messages.hide)} aria-label={intl.formatMessage(messages.hide)} onClick={this.toggleReveal}><Icon id='eye-slash' fixedWidth /></button>}\n {(!fullscreen && onOpenVideo) && <button type='button' title={intl.formatMessage(messages.expand)} aria-label={intl.formatMessage(messages.expand)} onClick={this.handleOpenVideo}><Icon id='expand' fixedWidth /></button>}\n {onCloseVideo && <button type='button' title={intl.formatMessage(messages.close)} aria-label={intl.formatMessage(messages.close)} onClick={this.handleCloseVideo}><Icon id='compress' fixedWidth /></button>}\n <button type='button' title={intl.formatMessage(messages.download)} aria-label={intl.formatMessage(messages.download)}><a className='video-player__download__icon' href={this.props.src} download><Icon id={'download'} fixedWidth /></a></button>\n <button type='button' title={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} aria-label={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} onClick={this.toggleFullscreen}><Icon id={fullscreen ? 'compress' : 'arrows-alt'} fixedWidth /></button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { fromJS, is } from 'immutable';\nimport { throttle } from 'lodash';\nimport classNames from 'classnames';\nimport { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen';\nimport { displayMedia, useBlurhash } from '../../initial_state';\nimport Icon from 'mastodon/components/icon';\nimport { decode } from 'blurhash';\n\nconst messages = defineMessages({\n play: { id: 'video.play', defaultMessage: 'Play' },\n pause: { id: 'video.pause', defaultMessage: 'Pause' },\n mute: { id: 'video.mute', defaultMessage: 'Mute sound' },\n unmute: { id: 'video.unmute', defaultMessage: 'Unmute sound' },\n hide: { id: 'video.hide', defaultMessage: 'Hide video' },\n expand: { id: 'video.expand', defaultMessage: 'Expand video' },\n close: { id: 'video.close', defaultMessage: 'Close video' },\n fullscreen: { id: 'video.fullscreen', defaultMessage: 'Full screen' },\n exit_fullscreen: { id: 'video.exit_fullscreen', defaultMessage: 'Exit full screen' },\n download: { id: 'video.download', defaultMessage: 'Download file' },\n});\n\nexport const formatTime = secondsNum => {\n let hours = Math.floor(secondsNum / 3600);\n let minutes = Math.floor((secondsNum - (hours * 3600)) / 60);\n let seconds = secondsNum - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) hours = '0' + hours;\n if (minutes < 10) minutes = '0' + minutes;\n if (seconds < 10) seconds = '0' + seconds;\n\n return (hours === '00' ? '' : `${hours}:`) + `${minutes}:${seconds}`;\n};\n\nexport const findElementPosition = el => {\n let box;\n\n if (el.getBoundingClientRect && el.parentNode) {\n box = el.getBoundingClientRect();\n }\n\n if (!box) {\n return {\n left: 0,\n top: 0,\n };\n }\n\n const docEl = document.documentElement;\n const body = document.body;\n\n const clientLeft = docEl.clientLeft || body.clientLeft || 0;\n const scrollLeft = window.pageXOffset || body.scrollLeft;\n const left = (box.left + scrollLeft) - clientLeft;\n\n const clientTop = docEl.clientTop || body.clientTop || 0;\n const scrollTop = window.pageYOffset || body.scrollTop;\n const top = (box.top + scrollTop) - clientTop;\n\n return {\n left: Math.round(left),\n top: Math.round(top),\n };\n};\n\nexport const getPointerPosition = (el, event) => {\n const position = {};\n const box = findElementPosition(el);\n const boxW = el.offsetWidth;\n const boxH = el.offsetHeight;\n const boxY = box.top;\n const boxX = box.left;\n\n let pageY = event.pageY;\n let pageX = event.pageX;\n\n if (event.changedTouches) {\n pageX = event.changedTouches[0].pageX;\n pageY = event.changedTouches[0].pageY;\n }\n\n position.y = Math.max(0, Math.min(1, (pageY - boxY) / boxH));\n position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW));\n\n return position;\n};\n\nexport default @injectIntl\nclass Video extends React.PureComponent {\n\n static propTypes = {\n preview: PropTypes.string,\n src: PropTypes.string.isRequired,\n alt: PropTypes.string,\n width: PropTypes.number,\n height: PropTypes.number,\n sensitive: PropTypes.bool,\n startTime: PropTypes.number,\n onOpenVideo: PropTypes.func,\n onCloseVideo: PropTypes.func,\n detailed: PropTypes.bool,\n inline: PropTypes.bool,\n editable: PropTypes.bool,\n cacheWidth: PropTypes.func,\n visible: PropTypes.bool,\n onToggleVisibility: PropTypes.func,\n intl: PropTypes.object.isRequired,\n blurhash: PropTypes.string,\n link: PropTypes.node,\n };\n\n state = {\n currentTime: 0,\n duration: 0,\n volume: 0.5,\n paused: true,\n dragging: false,\n containerWidth: this.props.width,\n fullscreen: false,\n hovered: false,\n muted: false,\n revealed: this.props.visible !== undefined ? this.props.visible : (displayMedia !== 'hide_all' && !this.props.sensitive || displayMedia === 'show_all'),\n };\n\n // Hard-coded in components.scss\n // Any way to get ::before values programatically?\n volWidth = 50;\n volOffset = 70;\n\n volHandleOffset = v => {\n const offset = v * this.volWidth + this.volOffset;\n\n return (offset > 110) ? 110 : offset;\n }\n\n setPlayerRef = c => {\n this.player = c;\n\n if (c) {\n if (this.props.cacheWidth) this.props.cacheWidth(this.player.offsetWidth);\n\n this.setState({\n containerWidth: c.offsetWidth,\n });\n }\n }\n\n setVideoRef = c => {\n this.video = c;\n\n if (this.video) {\n this.setState({ volume: this.video.volume, muted: this.video.muted });\n }\n }\n\n setSeekRef = c => {\n this.seek = c;\n }\n\n setVolumeRef = c => {\n this.volume = c;\n }\n\n setCanvasRef = c => {\n this.canvas = c;\n }\n\n handleClickRoot = e => e.stopPropagation();\n\n handlePlay = () => {\n this.setState({ paused: false });\n }\n\n handlePause = () => {\n this.setState({ paused: true });\n }\n\n handleTimeUpdate = () => {\n this.setState({\n currentTime: Math.floor(this.video.currentTime),\n duration: Math.floor(this.video.duration),\n });\n }\n\n handleVolumeMouseDown = e => {\n document.addEventListener('mousemove', this.handleMouseVolSlide, true);\n document.addEventListener('mouseup', this.handleVolumeMouseUp, true);\n document.addEventListener('touchmove', this.handleMouseVolSlide, true);\n document.addEventListener('touchend', this.handleVolumeMouseUp, true);\n\n this.handleMouseVolSlide(e);\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleVolumeMouseUp = () => {\n document.removeEventListener('mousemove', this.handleMouseVolSlide, true);\n document.removeEventListener('mouseup', this.handleVolumeMouseUp, true);\n document.removeEventListener('touchmove', this.handleMouseVolSlide, true);\n document.removeEventListener('touchend', this.handleVolumeMouseUp, true);\n }\n\n handleMouseVolSlide = throttle(e => {\n const rect = this.volume.getBoundingClientRect();\n const x = (e.clientX - rect.left) / this.volWidth; //x position within the element.\n\n if(!isNaN(x)) {\n let slideamt = x;\n\n if(x > 1) {\n slideamt = 1;\n } else if(x < 0) {\n slideamt = 0;\n }\n\n this.video.volume = slideamt;\n this.setState({ volume: slideamt });\n }\n }, 60);\n\n handleMouseDown = e => {\n document.addEventListener('mousemove', this.handleMouseMove, true);\n document.addEventListener('mouseup', this.handleMouseUp, true);\n document.addEventListener('touchmove', this.handleMouseMove, true);\n document.addEventListener('touchend', this.handleMouseUp, true);\n\n this.setState({ dragging: true });\n this.video.pause();\n this.handleMouseMove(e);\n\n e.preventDefault();\n e.stopPropagation();\n }\n\n handleMouseUp = () => {\n document.removeEventListener('mousemove', this.handleMouseMove, true);\n document.removeEventListener('mouseup', this.handleMouseUp, true);\n document.removeEventListener('touchmove', this.handleMouseMove, true);\n document.removeEventListener('touchend', this.handleMouseUp, true);\n\n this.setState({ dragging: false });\n this.video.play();\n }\n\n handleMouseMove = throttle(e => {\n const { x } = getPointerPosition(this.seek, e);\n const currentTime = Math.floor(this.video.duration * x);\n\n if (!isNaN(currentTime)) {\n this.video.currentTime = currentTime;\n this.setState({ currentTime });\n }\n }, 60);\n\n togglePlay = () => {\n if (this.state.paused) {\n this.setState({ paused: false }, () => this.video.play());\n } else {\n this.setState({ paused: true }, () => this.video.pause());\n }\n }\n\n toggleFullscreen = () => {\n if (isFullscreen()) {\n exitFullscreen();\n } else {\n requestFullscreen(this.player);\n }\n }\n\n componentDidMount () {\n document.addEventListener('fullscreenchange', this.handleFullscreenChange, true);\n document.addEventListener('webkitfullscreenchange', this.handleFullscreenChange, true);\n document.addEventListener('mozfullscreenchange', this.handleFullscreenChange, true);\n document.addEventListener('MSFullscreenChange', this.handleFullscreenChange, true);\n\n window.addEventListener('scroll', this.handleScroll);\n\n if (this.props.blurhash) {\n this._decode();\n }\n }\n\n componentWillUnmount () {\n window.removeEventListener('scroll', this.handleScroll);\n\n document.removeEventListener('fullscreenchange', this.handleFullscreenChange, true);\n document.removeEventListener('webkitfullscreenchange', this.handleFullscreenChange, true);\n document.removeEventListener('mozfullscreenchange', this.handleFullscreenChange, true);\n document.removeEventListener('MSFullscreenChange', this.handleFullscreenChange, true);\n }\n\n componentWillReceiveProps (nextProps) {\n if (!is(nextProps.visible, this.props.visible) && nextProps.visible !== undefined) {\n this.setState({ revealed: nextProps.visible });\n }\n }\n\n componentDidUpdate (prevProps, prevState) {\n if (prevState.revealed && !this.state.revealed && this.video) {\n this.video.pause();\n }\n\n if (prevProps.blurhash !== this.props.blurhash && this.props.blurhash) {\n this._decode();\n }\n }\n\n _decode () {\n if (!useBlurhash) return;\n\n const hash = this.props.blurhash;\n const pixels = decode(hash, 32, 32);\n\n if (pixels) {\n const ctx = this.canvas.getContext('2d');\n const imageData = new ImageData(pixels, 32, 32);\n\n ctx.putImageData(imageData, 0, 0);\n }\n }\n\n handleScroll = throttle(() => {\n if (!this.video) {\n return;\n }\n\n const { top, height } = this.video.getBoundingClientRect();\n const inView = (top <= (window.innerHeight || document.documentElement.clientHeight)) && (top + height >= 0);\n\n if (!this.state.paused && !inView) {\n this.setState({ paused: true }, () => this.video.pause());\n }\n }, 150, { trailing: true })\n\n handleFullscreenChange = () => {\n this.setState({ fullscreen: isFullscreen() });\n }\n\n handleMouseEnter = () => {\n this.setState({ hovered: true });\n }\n\n handleMouseLeave = () => {\n this.setState({ hovered: false });\n }\n\n toggleMute = () => {\n const muted = !this.video.muted;\n\n this.setState({ muted }, () => {\n this.video.muted = muted;\n });\n }\n\n toggleReveal = () => {\n if (this.props.onToggleVisibility) {\n this.props.onToggleVisibility();\n } else {\n this.setState({ revealed: !this.state.revealed });\n }\n }\n\n handleLoadedData = () => {\n if (this.props.startTime) {\n this.video.currentTime = this.props.startTime;\n this.video.play();\n }\n }\n\n handleProgress = () => {\n if (this.video.buffered.length > 0) {\n this.setState({ buffer: this.video.buffered.end(0) / this.video.duration * 100 });\n }\n }\n\n handleVolumeChange = () => {\n this.setState({ volume: this.video.volume, muted: this.video.muted });\n }\n\n handleOpenVideo = () => {\n const { src, preview, width, height, alt } = this.props;\n\n const media = fromJS({\n type: 'video',\n url: src,\n preview_url: preview,\n description: alt,\n width,\n height,\n });\n\n this.video.pause();\n this.props.onOpenVideo(media, this.video.currentTime);\n }\n\n handleCloseVideo = () => {\n this.video.pause();\n this.props.onCloseVideo();\n }\n\n render () {\n const { preview, src, inline, startTime, onOpenVideo, onCloseVideo, intl, alt, detailed, sensitive, link, editable } = this.props;\n const { containerWidth, currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, muted, revealed } = this.state;\n const progress = (currentTime / duration) * 100;\n\n const volumeWidth = (muted) ? 0 : volume * this.volWidth;\n const volumeHandleLoc = (muted) ? this.volHandleOffset(0) : this.volHandleOffset(volume);\n const playerStyle = {};\n\n let { width, height } = this.props;\n\n if (inline && containerWidth) {\n width = containerWidth;\n height = containerWidth / (16/9);\n\n playerStyle.height = height;\n }\n\n let preload;\n\n if (startTime || fullscreen || dragging) {\n preload = 'auto';\n } else if (detailed) {\n preload = 'metadata';\n } else {\n preload = 'none';\n }\n\n let warning;\n\n if (sensitive) {\n warning = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />;\n } else {\n warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />;\n }\n\n return (\n <div\n role='menuitem'\n className={classNames('video-player', { inactive: !revealed, detailed, inline: inline && !fullscreen, fullscreen, editable })}\n style={playerStyle}\n ref={this.setPlayerRef}\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n onClick={this.handleClickRoot}\n tabIndex={0}\n >\n <canvas width={32} height={32} ref={this.setCanvasRef} className={classNames('media-gallery__preview', { 'media-gallery__preview--hidden': revealed })} />\n\n {(revealed || editable) && <video\n ref={this.setVideoRef}\n src={src}\n poster={preview}\n preload={preload}\n role='button'\n tabIndex='0'\n aria-label={alt}\n title={alt}\n width={width}\n height={height}\n volume={volume}\n onClick={this.togglePlay}\n onPlay={this.handlePlay}\n onPause={this.handlePause}\n onTimeUpdate={this.handleTimeUpdate}\n onLoadedData={this.handleLoadedData}\n onProgress={this.handleProgress}\n onVolumeChange={this.handleVolumeChange}\n />}\n\n <div className={classNames('spoiler-button', { 'spoiler-button--hidden': revealed || editable })}>\n <button type='button' className='spoiler-button__overlay' onClick={this.toggleReveal}>\n <span className='spoiler-button__overlay__label'>{warning}</span>\n </button>\n </div>\n\n <div className={classNames('video-player__controls', { active: paused || hovered })}>\n <div className='video-player__seek' onMouseDown={this.handleMouseDown} ref={this.setSeekRef}>\n <div className='video-player__seek__buffer' style={{ width: `${buffer}%` }} />\n <div className='video-player__seek__progress' style={{ width: `${progress}%` }} />\n\n <span\n className={classNames('video-player__seek__handle', { active: dragging })}\n tabIndex='0'\n style={{ left: `${progress}%` }}\n />\n </div>\n\n <div className='video-player__buttons-bar'>\n <div className='video-player__buttons left'>\n <button type='button' title={intl.formatMessage(paused ? messages.play : messages.pause)} aria-label={intl.formatMessage(paused ? messages.play : messages.pause)} onClick={this.togglePlay} autoFocus={detailed}><Icon id={paused ? 'play' : 'pause'} fixedWidth /></button>\n <button type='button' title={intl.formatMessage(muted ? messages.unmute : messages.mute)} aria-label={intl.formatMessage(muted ? messages.unmute : messages.mute)} onClick={this.toggleMute}><Icon id={muted ? 'volume-off' : 'volume-up'} fixedWidth /></button>\n\n <div className='video-player__volume' onMouseDown={this.handleVolumeMouseDown} ref={this.setVolumeRef}>\n &nbsp;\n <div className='video-player__volume__current' style={{ width: `${volumeWidth}px` }} />\n <span\n className={classNames('video-player__volume__handle')}\n tabIndex='0'\n style={{ left: `${volumeHandleLoc}px` }}\n />\n </div>\n\n {(detailed || fullscreen) && (\n <span>\n <span className='video-player__time-current'>{formatTime(currentTime)}</span>\n <span className='video-player__time-sep'>/</span>\n <span className='video-player__time-total'>{formatTime(duration)}</span>\n </span>\n )}\n\n {link && <span className='video-player__link'>{link}</span>}\n </div>\n\n <div className='video-player__buttons right'>\n {(!onCloseVideo && !editable && !fullscreen) && <button type='button' title={intl.formatMessage(messages.hide)} aria-label={intl.formatMessage(messages.hide)} onClick={this.toggleReveal}><Icon id='eye-slash' fixedWidth /></button>}\n {(!fullscreen && onOpenVideo) && <button type='button' title={intl.formatMessage(messages.expand)} aria-label={intl.formatMessage(messages.expand)} onClick={this.handleOpenVideo}><Icon id='expand' fixedWidth /></button>}\n {onCloseVideo && <button type='button' title={intl.formatMessage(messages.close)} aria-label={intl.formatMessage(messages.close)} onClick={this.handleCloseVideo}><Icon id='compress' fixedWidth /></button>}\n <button type='button' title={intl.formatMessage(messages.download)} aria-label={intl.formatMessage(messages.download)}><a className='video-player__download__icon' href={this.props.src} download><Icon id={'download'} fixedWidth /></a></button>\n <button type='button' title={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} aria-label={intl.formatMessage(fullscreen ? messages.exit_fullscreen : messages.fullscreen)} onClick={this.toggleFullscreen}><Icon id={fullscreen ? 'compress' : 'arrows-alt'} fixedWidth /></button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n}\n","import escapeTextContentForBrowser from 'escape-html';\nimport emojify from 'flavours/glitch/util/emoji';\nimport { unescapeHTML } from 'flavours/glitch/util/html';\nimport { expandSpoilers } from 'flavours/glitch/util/initial_state';\n\nconst domParser = new DOMParser();\n\nconst makeEmojiMap = record => record.emojis.reduce((obj, emoji) => {\n obj[`:${emoji.shortcode}:`] = emoji;\n return obj;\n}, {});\n\nexport function searchTextFromRawStatus (status) {\n const spoilerText = status.spoiler_text || '';\n const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).join('\\n\\n').replace(/<br\\s*\\/?>/g, '\\n').replace(/<\\/p><p>/g, '\\n\\n');\n return domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;\n}\n\nexport function normalizeAccount(account) {\n account = { ...account };\n\n const emojiMap = makeEmojiMap(account);\n const displayName = account.display_name.trim().length === 0 ? account.username : account.display_name;\n\n account.display_name_html = emojify(escapeTextContentForBrowser(displayName), emojiMap);\n account.note_emojified = emojify(account.note, emojiMap);\n\n if (account.fields) {\n account.fields = account.fields.map(pair => ({\n ...pair,\n name_emojified: emojify(escapeTextContentForBrowser(pair.name), emojiMap),\n value_emojified: emojify(pair.value, emojiMap),\n value_plain: unescapeHTML(pair.value),\n }));\n }\n\n if (account.moved) {\n account.moved = account.moved.id;\n }\n\n return account;\n}\n\nexport function normalizeStatus(status, normalOldStatus) {\n const normalStatus = { ...status };\n normalStatus.account = status.account.id;\n\n if (status.reblog && status.reblog.id) {\n normalStatus.reblog = status.reblog.id;\n }\n\n if (status.poll && status.poll.id) {\n normalStatus.poll = status.poll.id;\n }\n\n // Only calculate these values when status first encountered\n // Otherwise keep the ones already in the reducer\n if (normalOldStatus) {\n normalStatus.search_index = normalOldStatus.get('search_index');\n normalStatus.contentHtml = normalOldStatus.get('contentHtml');\n normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml');\n } else {\n const spoilerText = normalStatus.spoiler_text || '';\n const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).join('\\n\\n').replace(/<br\\s*\\/?>/g, '\\n').replace(/<\\/p><p>/g, '\\n\\n');\n const emojiMap = makeEmojiMap(normalStatus);\n\n normalStatus.search_index = domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;\n normalStatus.contentHtml = emojify(normalStatus.content, emojiMap);\n normalStatus.spoilerHtml = emojify(escapeTextContentForBrowser(spoilerText), emojiMap);\n }\n\n return normalStatus;\n}\n\nexport function normalizePoll(poll) {\n const normalPoll = { ...poll };\n const emojiMap = makeEmojiMap(normalPoll);\n\n normalPoll.options = poll.options.map((option, index) => ({\n ...option,\n voted: poll.own_votes && poll.own_votes.includes(index),\n title_emojified: emojify(escapeTextContentForBrowser(option.title), emojiMap),\n }));\n\n return normalPoll;\n}\n\nexport function normalizeAnnouncement(announcement) {\n const normalAnnouncement = { ...announcement };\n const emojiMap = makeEmojiMap(normalAnnouncement);\n\n normalAnnouncement.contentHtml = emojify(normalAnnouncement.content, emojiMap);\n\n return normalAnnouncement;\n}\n","// Like react-motion's Motion, but reduces all animations to cross-fades\n// for the benefit of users with motion sickness.\nimport React from 'react';\nimport Motion from 'react-motion/lib/Motion';\nimport PropTypes from 'prop-types';\n\nconst stylesToKeep = ['opacity', 'backgroundOpacity'];\n\nconst extractValue = (value) => {\n // This is either an object with a \"val\" property or it's a number\n return (typeof value === 'object' && value && 'val' in value) ? value.val : value;\n};\n\nclass ReducedMotion extends React.Component {\n\n static propTypes = {\n defaultStyle: PropTypes.object,\n style: PropTypes.object,\n children: PropTypes.func,\n }\n\n render() {\n\n const { style, defaultStyle, children } = this.props;\n\n Object.keys(style).forEach(key => {\n if (stylesToKeep.includes(key)) {\n return;\n }\n // If it's setting an x or height or scale or some other value, we need\n // to preserve the end-state value without actually animating it\n style[key] = defaultStyle[key] = extractValue(style[key]);\n });\n\n return (\n <Motion style={style} defaultStyle={defaultStyle}>\n {children}\n </Motion>\n );\n }\n\n}\n\nexport default ReducedMotion;\n","import { reduceMotion } from 'flavours/glitch/util/initial_state';\nimport ReducedMotion from './reduced_motion';\nimport Motion from 'react-motion/lib/Motion';\n\nexport default reduceMotion ? ReducedMotion : Motion;\n","// A mapping of unicode strings to an object containing the filename\n// (i.e. the svg filename) and a shortCode intended to be shown\n// as a \"title\" attribute in an HTML element (aka tooltip).\n\nconst [\n shortCodesToEmojiData,\n skins, // eslint-disable-line no-unused-vars\n categories, // eslint-disable-line no-unused-vars\n short_names, // eslint-disable-line no-unused-vars\n emojisWithoutShortCodes,\n] = require('./emoji_compressed');\nconst { unicodeToFilename } = require('./unicode_to_filename');\n\n// decompress\nconst unicodeMapping = {};\n\nfunction processEmojiMapData(emojiMapData, shortCode) {\n let [ native, filename ] = emojiMapData;\n if (!filename) {\n // filename name can be derived from unicodeToFilename\n filename = unicodeToFilename(native);\n }\n unicodeMapping[native] = {\n shortCode: shortCode,\n filename: filename,\n };\n}\n\nObject.keys(shortCodesToEmojiData).forEach((shortCode) => {\n let [ filenameData ] = shortCodesToEmojiData[shortCode];\n filenameData.forEach(emojiMapData => processEmojiMapData(emojiMapData, shortCode));\n});\nemojisWithoutShortCodes.forEach(emojiMapData => processEmojiMapData(emojiMapData));\n\nmodule.exports = unicodeMapping;\n"],"sourceRoot":""}