{"version":3,"sources":["webpack:///./src/components/IconButton/IconButton.js","webpack:///./src/icons/FullScreenIcon.js","webpack:///./src/icons/PauseIcon.js","webpack:///./src/components/Vimeo/Playback.js","webpack:///./src/icons/VolumeIcon.js","webpack:///./src/components/Vimeo/Vimeo.js","webpack:///./src/utils/videoPlayerUtil.js"],"names":["ButtonStyle","styled","div","withConfig","displayName","componentId","Inner","span","durations","fast","IconButton","_ref","children","rest","_objectWithoutProperties","_excluded","React","Object","assign","role","aria-label","defaultProps","FullScreenIcon","style","viewBox","width","height","_objectSpread","cursor","fill","d","PauseIcon","id","cx","cy","r","PlaybackContainer","Timer","p","color","white","getFontSize","rem","StyledSlider","Slider","Playback","_React$PureComponent","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","Array","_key","call","apply","concat","state","progress","handleSliderChange","value","setState","props","onProgressChange","buildPlaybackTimeString","timeInSeconds","time","Date","setSeconds","toISOString","substr","key","prevProps","percent","this","_this$props","seconds","duration","onChange","Math","ceil","Number","VolumeIcon","_ref$muted","muted","Wrapper","Foreground","StyledVideo","FullScreenPlaceholder","PlaybackWrapper","mediaQuery","sm","_templateObject","_taggedTemplateLiteral","slow","lg","_templateObject2","PlaybackControlsContainer","md","_templateObject3","ClickableOverlay","StyledIconButton","StyledPlayButton","button","_templateObject4","PosterImage","Image","Vimeo","player","undefined","fullscreenPlayer","container","videoRef","videoFullsizeRef","getInternalPlayer","playVideo","play","pauseVideo","pause","mute","setVolume","unMute","setCurrentTime","isMuted","Promise","resolve","reject","getVolume","then","volume","triggerFullscreen","handleFullscreenClick","handlePlay","started","autoPlay","onPlay","paused","handlePause","onPause","handleTimeUpdate","playbackState","handlePlayClick","getPaused","fullscreenPlayerId","iframe","element","requestFullScreen","mozRequestFullScreen","webkitRequestFullScreen","bind","showInFullscreen","console","log","handleMuteClick","playerInstance","handleInViewStateChange","inView","windowHeight","window","innerHeight","playerHeight","current","getBoundingClientRect","handleProgressChange","newTime","title","playerId","src","_this2","onMountVideo","onReady","_this$state","embedVideo","on","getDuration","setDuration","withControls","callback","_this$props2","loop","options","url","background","playsinline","Player","require","ready","catch","err","_this$state2","_this$props3","controls","poster","useControlsRibbon","caption","InView","tag","threshold","ref","onClick","PlayIcon","fillContainer","Ribbon","marginBottom","padding","fontSize"],"mappings":"miBASA,IAAMA,EAAcC,IAAOC,IAAGC,WAAA,CAAAC,YAAA,0BAAAC,YAAA,gBAAVJ,CAAU,mEAOxBK,EAAQL,IAAOM,KAAIJ,WAAA,CAAAC,YAAA,oBAAAC,YAAA,gBAAXJ,CAAW,6GAKHO,IAAUC,MAMhC,SAASC,EAAUC,GAA+B,IAA5BC,EAAQD,EAARC,SAAaC,EAAIC,EAAAH,EAAAI,GACrC,OACEC,gBAAChB,EAAWiB,OAAAC,OAAA,CAACC,KAAK,SAASC,aAAY,eAAmBP,GACxDG,gBAACV,EAAK,KAAEM,IAKdF,EAAWN,YAAc,aACzBM,EAAWW,aAAe,GAEXX,Q,g5CCnCf,IAceY,EAdQ,SAAHX,GAAA,IAAMY,EAAKZ,EAALY,MAAUV,EAAIC,EAAAH,EAAAI,GAAA,OACtCC,gBAAA,MAAAC,OAAAC,OAAA,CACEM,QAAQ,aACJX,EAAI,CACRY,MAAM,MACNC,OAAO,MACPH,MAAKI,EAAA,CAAIC,OAAQ,UAAWC,KAAM,SAAYN,KAE9CP,gBAAA,SACEA,gBAAA,QAAMc,EAAE,qH,u4CCTd,IAwBeC,EAxBG,SAAHpB,GAAA,IAAMY,EAAKZ,EAALY,MAAUV,EAAIC,EAAAH,EAAAI,GAAA,OACjCC,gBAAA,MAAAC,OAAAC,OAAA,CACEM,QAAQ,aACJX,EAAI,CACRY,MAAM,MACNC,OAAO,MACPH,MAAKI,EAAA,CAAIC,OAAQ,UAAWC,KAAM,SAAYN,KAE9CP,gBAAA,SACEA,gBAAA,UAAQgB,GAAG,iBAAiBH,KAAK,UAAUI,GAAG,KAAKC,GAAG,KAAKC,EAAE,OAC7DnB,gBAAA,QACEc,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GAAgB,CAACkG,QAAS7H,KAAK+E,iBAC9B7I,gBAACsE,EAAU,CAACE,MAAOuC,KAErB/G,gBAACyF,GAAgB,CAACkG,QAAS7H,KAAKyD,uBAC9BvH,gBAACM,EAAc,SAKrBN,gBAACqF,GAAyB,KACxBrF,gBAACyF,GAAgB,CAACkG,QAAS7H,KAAKmE,iBAC7BR,IAAYG,EACX5H,gBAACe,EAAS,CAACR,MAAO,CAAE0L,SAAU,UAE9BjM,gBAAC4L,IAAQ,CAACrL,MAAO,CAAE0L,SAAU,WAIjCjM,gBAAC6B,EAAQ,CACPgC,QAAmB,IAAVA,EACTG,QAASA,EACTC,SAAUA,EACVd,iBAAkBW,KAAKyF,uBAGzBvJ,gBAACyF,GAAgB,CAACkG,QAAS7H,KAAK+E,iBAC9B7I,gBAACsE,EAAU,CAACE,MAAOuC,KAErB/G,gBAACyF,GAAgB,CAACkG,QAAS7H,KAAKyD,uBAC9BvH,gBAACM,EAAc,WA5Ed,U,gFAqFlByF,EAvVQ,CAAS/F,iBAAd+F,GACG3G,YAAc,QADjB2G,GAEG1F,aAAe,CACpBqH,UAAU,EACV6C,MAAM,EACNY,UAAU,EACV3G,OAAO,EACP6G,mBAAmB,GAmVRtF","file":"static/scripts/9-94638c805e62083f6aa1.js","sourcesContent":["// @flow\nimport * as React from 'react'\nimport styled from 'styled-components'\nimport { durations } from '../../styles/animations'\n\ntype Props = {\n children?: React.Node,\n}\n\nconst ButtonStyle = styled.div`\n background: none;\n padding: 10px;\n outline-offset: 0;\n cursor: pointer;\n`\n\nconst Inner = styled.span`\n display: flex;\n justify-content: center;\n align-items: center;\n color: currentColor;\n transition: color ${durations.fast} ease-out;\n`\n\n/**\n * Wrapper that creates a button that centers an icon (or similar item)\n **/\nfunction IconButton({ children, ...rest }: Props) {\n return (\n \n {children}\n \n )\n}\n\nIconButton.displayName = 'IconButton'\nIconButton.defaultProps = {}\n\nexport default IconButton\n","// @flow\nimport * as React from 'react'\n\nconst FullScreenIcon = ({ style, ...rest }: Object) => (\n \n)\n\nexport default FullScreenIcon\n","// @flow\nimport * as React from 'react'\n\nconst PauseIcon = ({ style, ...rest }: Object) => (\n \n)\n\nexport default PauseIcon\n","// @flow\nimport * as React from 'react'\nimport styled from 'styled-components'\nimport { rem } from 'polished'\nimport { color } from '../../styles/theme'\nimport { getFontSize } from '../../styles/style-helpers'\n\nimport Slider from 'rc-slider'\n\ntype Props = {\n duration?: number,\n seconds?: number,\n percent?: number,\n onProgressChange?: Function,\n}\n\ntype State = {\n progress: number,\n}\n\nconst PlaybackContainer = styled.div`\n flex: 1;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n`\n\nconst Timer = styled.p`\n flex: 1 1 10%;\n color: ${color.white};\n font-size: ${getFontSize('tiny')};\n text-align: center;\n font-weight: bold;\n margin: 0 ${rem(10)};\n height: 1em;\n`\n\nconst StyledSlider = styled(Slider)`\n position: relative;\n transition: all 0.1s ease;\n flex: 1 1 80%;\n height: 100%;\n display: flex;\n align-items: center;\n`\n\nclass Playback extends React.PureComponent {\n state = {\n progress: 0,\n }\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.percent !== this.props.percent) {\n this.setState({ progress: this.props.percent }) // eslint-disable-line\n }\n }\n\n handleSliderChange = (value: number) => {\n this.setState({\n progress: value,\n })\n\n if (this.props.onProgressChange) {\n this.props.onProgressChange(value)\n }\n }\n\n buildPlaybackTimeString = (timeInSeconds?: number) => {\n if (!timeInSeconds) return '00:00'\n\n // solution from https://stackoverflow.com/a/25279340\n const time = new Date(0)\n time.setSeconds(timeInSeconds)\n return time.toISOString().substr(14, 5)\n }\n\n render() {\n const { seconds, duration } = this.props\n\n return (\n \n {this.buildPlaybackTimeString(seconds)}\n \n \n {this.buildPlaybackTimeString(Math.ceil(Number(duration)))}\n \n \n )\n }\n}\n\nexport default Playback\n","// @flow\nimport * as React from 'react'\n\nconst VolumeIcon = ({ style, muted = false, ...rest }: Object) => (\n \n)\n\nexport default VolumeIcon\n","// @flow\nimport * as React from 'react'\nimport styled from 'styled-components'\nimport { rem } from 'polished'\n\nimport { mediaQuery } from '../../styles/media'\nimport { durations } from '../../styles/animations'\nimport { showInFullscreen } from '../../utils/videoPlayerUtil'\nimport { InView } from 'react-intersection-observer'\n\nimport type { ImageViewModel } from '../../types/ImageViewModel'\n\nimport Image from '../../components/Image/Image'\nimport IconButton from '../../components/IconButton/IconButton'\nimport PlayIcon from '../../icons/PlayIcon'\nimport FullScreenIcon from '../../icons/FullScreenIcon'\nimport PauseIcon from '../../icons/PauseIcon'\nimport Playback from './Playback'\nimport VolumeIcon from '../../icons/VolumeIcon'\nimport Ribbon from '../Ribbon/Ribbon'\n\ntype Props = {\n src: string,\n poster?: ImageViewModel,\n autoPlay?: boolean,\n controls?: boolean,\n muted?: boolean,\n onReady?: Function,\n onPlay?: Function,\n onPause?: Function,\n onEnd?: Function,\n onMountVideo?: Function,\n loop?: boolean,\n caption?: string,\n // decides if Playback Controls should be placed in Ribbon\n useControlsRibbon?: boolean,\n}\n\ntype State = {\n started: boolean,\n paused: boolean,\n title: string,\n isMuted: boolean,\n playerId: string,\n fullscreenPlayerId: string,\n seconds: number,\n percent: number,\n duration: number,\n}\n\ntype PlaybackState = {\n seconds: number,\n percent: number,\n duration: number,\n}\n\nconst Wrapper = styled.div`\n height: 0;\n width: 100%;\n position: relative;\n padding-bottom: 56.25%;\n overflow-y: hidden;\n`\n\nconst Foreground = styled.div`\n position: absolute;\n top: -100%;\n left: 0;\n width: 100%;\n height: 300%;\n`\n\nconst StyledVideo = styled.div`\n iframe {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n border: none;\n }\n`\n\nconst FullScreenPlaceholder = styled.div`\n position: absolute;\n\n /* should be rendered out of the viewport */\n top: -10000px;\n`\n\nconst PlaybackWrapper = styled.div`\n position: absolute;\n bottom: ${rem(15)};\n width: 100%;\n\n transform: translateY(${rem(80)});\n\n ${mediaQuery.sm`\n transition: transform ${durations.slow} ease-out;\n \n ${Wrapper}:hover & {\n transform: translateY(0%);\n }\n `};\n\n ${mediaQuery.lg`\n bottom: ${rem(30)};\n `}\n`\n\nconst PlaybackControlsContainer = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n\n padding: 0 ${rem(48)};\n\n ${mediaQuery.md`\n padding: 0 ${rem(92)};\n `}\n`\n\nconst ClickableOverlay = styled.div`\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n`\n\nconst StyledIconButton = styled(IconButton)`\n opacity: 0.6;\n\n &:hover {\n opacity: 1;\n }\n`\n\nconst StyledPlayButton = styled.button`\n opacity: 1;\n z-index: 2;\n border: none;\n width: auto;\n height: auto;\n padding: 10px;\n line-height: 0;\n cursor: pointer;\n\n /* sets svg size */\n font-size: 64px;\n\n &:focus-visible {\n border: 1px dashed #fff;\n outline: none;\n }\n\n ${mediaQuery.sm`\n opacity: 0.6;\n `}\n\n ${ClickableOverlay}:hover & {\n opacity: 1;\n }\n`\n\nconst PosterImage = styled(Image)`\n z-index: 1;\n`\n\nclass Vimeo extends React.PureComponent {\n static displayName = 'Vimeo'\n static defaultProps = {\n autoPlay: false,\n loop: false,\n controls: false,\n muted: false,\n useControlsRibbon: false,\n }\n\n player = undefined\n fullscreenPlayer = undefined\n\n container: { current: null | HTMLDivElement } = React.createRef()\n videoRef: { current: null | HTMLDivElement } = React.createRef()\n videoFullsizeRef: { current: null | HTMLDivElement } = React.createRef()\n\n constructor(props: Props) {\n super(props)\n\n this.state = {\n started: !!props.autoPlay,\n paused: !props.autoPlay,\n title: '',\n isMuted: !!props.muted,\n playerId: `vimeo-${props.src}`,\n fullscreenPlayerId: `fullscreen-vimeo-${props.src}`,\n seconds: 0,\n percent: 0,\n duration: 0,\n }\n }\n\n componentDidMount() {\n const { onMountVideo, onReady } = this.props\n const { playerId, fullscreenPlayerId } = this.state\n\n const setDuration = duration => {\n this.setState({ duration })\n }\n\n this.embedVideo(playerId, false, player => {\n if (!!player) {\n // setup initial mounted video\n this.player = player\n // $FlowFixMe\n this.player.on('play', this.handlePlay)\n // $FlowFixMe\n this.player.on('pause', this.handlePause)\n // $FlowFixMe\n this.player.on('timeupdate', this.handleTimeUpdate)\n\n // $FlowFixMe\n this.player.getDuration().then(function(duration) {\n setDuration(duration)\n })\n\n if (typeof onReady === 'function') {\n onReady()\n }\n\n if (typeof onMountVideo === 'function') {\n // send the internal player back to the caller\n onMountVideo(this.getInternalPlayer())\n }\n }\n })\n\n // we need to embed a new video, because the 'original' video\n // may not have controls active, and we have no way to change that\n // config once the video is embedded\n this.embedVideo(fullscreenPlayerId, true, player => {\n if (!!player) {\n this.fullscreenPlayer = player\n }\n })\n }\n\n embedVideo(\n playerId: string,\n withControls: boolean = false,\n callback: Function,\n ) {\n const { src, loop, muted } = this.props\n\n if (!playerId || !src) {\n return\n }\n\n // vimeo options\n // docs: https://github.com/vimeo/player.js#embed-options\n const options = {\n url: src,\n background: !withControls,\n loop,\n muted,\n playsinline: false,\n }\n\n // mount the vimeo player\n const Player = require('@vimeo/player/dist/player') // prevent failling tests on SSR https://github.com/vimeo/player.js/issues/32#issuecomment-255742059\n const player = new Player(playerId, options)\n\n // return the player to the callback\n player\n .ready()\n .then(() => {\n if (typeof callback === 'function') {\n callback(player)\n }\n })\n .catch(err => {})\n }\n\n // simple api for the player\n // mocks the methods for the same names as youtube\n getInternalPlayer = () => {\n if (this.player) {\n return {\n playVideo: () => this.player && this.player.play(),\n pauseVideo: () => this.player && this.player.pause(),\n mute: () => this.player && this.player.setVolume(0),\n unMute: () => this.player && this.player.setVolume(0.5), // maybe it should remember the mute setting?\n setCurrentTime: (value: number) =>\n this.player && this.player.setCurrentTime(value),\n isMuted: () =>\n new Promise((resolve, reject) => {\n if (!this.player) {\n return resolve(true)\n }\n\n this.player.getVolume().then(function(volume) {\n resolve(volume === 0)\n })\n }),\n triggerFullscreen: this.handleFullscreenClick,\n }\n }\n\n return undefined\n }\n\n handlePlay = () => {\n if (!this.state.started && !this.props.autoPlay && this.player) {\n this.player.pause() // pause first render right away\n this.setState({ started: true, paused: true })\n } else {\n if (!this.state.isMuted && this.player && this.player.setVolume) {\n this.player.setVolume(0.5)\n }\n if (this.props.onPlay) this.props.onPlay()\n this.setState({ started: true, paused: false })\n }\n }\n\n handlePause = () => {\n if (this.props.onPause) this.props.onPause()\n this.setState({ paused: true })\n }\n\n handleTimeUpdate = (playbackState: PlaybackState) => {\n this.setState({\n seconds: playbackState.seconds,\n percent: playbackState.percent,\n duration: playbackState.duration,\n })\n }\n\n handlePlayClick = () => {\n if (this.player) {\n this.player.getPaused().then(paused =>\n paused\n ? // $FlowFixMe\n this.player.play()\n : // $FlowFixMe\n this.player.pause(),\n )\n }\n }\n\n handleFullscreenClick = () => {\n const { fullscreenPlayerId } = this.state\n if (this.fullscreenPlayer && this.player) {\n this.player.pause()\n\n // $FlowFixMe\n const iframe = this.fullscreenPlayer.element\n // $FlowFixMe\n this.fullscreenPlayer.setVolume(0.8)\n if (iframe) {\n showInFullscreen(iframe)\n return\n }\n\n // didn't find any iframe\n // lets log it for debugging\n console.log(`unable to find iframe for ${fullscreenPlayerId}`) // eslint-disable-line no-console\n }\n }\n\n handleMuteClick = () => {\n const playerInstance = this.getInternalPlayer()\n if (playerInstance) {\n // todo: check if promise\n const isMutedPromise = playerInstance.isMuted()\n isMutedPromise.then(muted => {\n this.setState({ isMuted: !muted })\n return muted ? playerInstance.unMute() : playerInstance.mute()\n })\n }\n }\n\n handleInViewStateChange = (inView: boolean) => {\n const windowHeight = window.innerHeight\n const playerHeight = this.container.current\n ? this.container.current.getBoundingClientRect().height\n : windowHeight\n const playerInstance = this.getInternalPlayer()\n\n if (playerInstance && this.props.autoPlay) {\n // prevent not playing video in a short window\n if (playerHeight >= windowHeight) {\n return playerInstance.playVideo()\n }\n\n inView ? playerInstance.playVideo() : playerInstance.pauseVideo()\n }\n }\n\n handleProgressChange = (value: number) => {\n const playerInstance = this.getInternalPlayer()\n if (playerInstance) {\n // convert percentage to seconds\n const newTime = this.state.duration * (value / 100)\n playerInstance.setCurrentTime(newTime)\n }\n }\n\n render() {\n const {\n started,\n playerId,\n fullscreenPlayerId,\n paused,\n duration,\n percent,\n seconds,\n isMuted,\n } = this.state\n\n const {\n src,\n controls,\n poster,\n useControlsRibbon,\n caption,\n ...rest\n } = this.props\n if (!src) return null\n\n return (\n \n \n \n \n \n \n \n {(!started || paused) && this.player && (\n \n \n \n )}\n {(!started || paused) && poster && (\n \n )}\n \n\n {controls && (\n \n {useControlsRibbon ? (\n \n \n \n {started && !paused ? (\n \n ) : (\n \n )}\n \n\n \n\n \n \n \n \n \n \n \n \n ) : (\n \n \n {started && !paused ? (\n \n ) : (\n \n )}\n \n\n \n\n \n \n \n \n \n \n \n )}\n \n )}\n \n \n )\n }\n}\n\nexport default Vimeo\n","// @flow\n\nexport function showInFullscreen(iframe: HTMLElement) {\n const requestFullScreen =\n // $FlowFixMe\n iframe.requestFullScreen ||\n // $FlowFixMe\n iframe.mozRequestFullScreen ||\n // $FlowFixMe\n iframe.webkitRequestFullScreen\n\n if (requestFullScreen) {\n // todo: test on diff browsers\n // $FlowFixMe\n requestFullScreen.bind(iframe)()\n }\n}\n"],"sourceRoot":""}