"use strict";define("video",["zepto","lodash","core","react","utils","reactDOM","santaProps"],function(e,i,o,t,a,r,n){function s(e,i,o){if("100%"===o)return"100%";var t=l(),a=e?t[e].hMinSize:0;return"YOUTUBE"===e&&"always_show"===i&&(a+=20),Math.max(o,a)}function p(e,i){if("100%"===i)return"100%";var o=l(),t=e?o[e].wMinSize:0;return Math.max(i,t)}function l(){return{YOUTUBE:{url:i.template("//www.youtube.com/embed/${videoId}?"),getParams:h,hMinSize:200,wMinSize:200,title:"External YouTube"},VIMEO:{url:i.template("//player.vimeo.com/video/${videoId}?"),getParams:u,hMinSize:100,wMinSize:100,title:"External Vimeo"},DAILYMOTION:{url:i.template("//www.dailymotion.com/embed/video/${videoId}?"),getParams:m,hMinSize:100,wMinSize:100,title:"External Daily Motion"},FACEBOOK:{url:i.template("//www.facebook.com/plugins/video.php?href=https://www.facebook.com/${videoId}&"),getParams:d,hMinSize:100,wMinSize:100,title:"External Facebook"}}}function h(e,i,o){var t=e.showControls,a=e.autoplay&&!0,r=e.enablejsapi||0,n=e.lightTheme,s=e.loop,p=e.showinfo,l=i.videoId||"";return{wmode:"transparent",autoplay:a&&o?"1":"0",theme:n?"light":"dark",controls:"always_hide"!==t?"1":"0",autohide:"temp_show"===t?"1":"0",loop:s?"1":"0",showinfo:p?"1":"0",rel:"0",playlist:!!s&&l,enablejsapi:r}}function d(e,i,o,t){return{autoplay:e.autoplay&&o,width:t.width,height:t.height}}function u(e,i,o){return{autoplay:e.autoplay&&o,loop:e.loop,byline:e.showinfo,portrait:e.showinfo,title:e.showinfo}}function m(e,i,o){return{autoplay:e.autoplay&&o,"ui-start-screen-info":e.showinfo?"1":"0",controls:"temp_show"===e.showControls?"1":"0","sharing-enable":"0","ui-logo":"0"}}function c(e,o,t,a){var r=e.videoId,n=e.videoType;if(!n||!r)return"";var s=l()[n],p=s.getParams(o,e,t,a);return s.url({videoId:r})+i.map(p,function(e,i){return i+"="+e}).join("&")}function w(e,i,o){return{width:p(e,o.width),height:s(e,i,o.height)}}function y(e){return e?l()[e].title:""}return{displayName:"Video",mixins:[o.compMixins.skinBasedComp],statics:{useSantaTypes:!0},propTypes:{isPlayingAllowed:n.Types.RenderFlags.isPlayingAllowed.isRequired,compData:n.Types.Component.compData.isRequired,compProp:n.Types.Component.compProp.isRequired,style:n.Types.Component.style.isRequired},componentWillMount:function(){this.canPlayVideo=this.props.isPlayingAllowed},componentDidUpdate:function(){if(this.canPlayVideo!==this.props.isPlayingAllowed){this.canPlayVideo=this.props.isPlayingAllowed;var i=e(r.findDOMNode(this.refs.videoFrame)).find("iframe")[0],o=w(this.props.compData.videoType,this.props.compProp.showControls,this.props.style);i.src="",i.src=c(this.props.compData,this.props.compProp,this.props.isPlayingAllowed,o)}},getSkinProperties:function(){var e=w(this.props.compData.videoType,this.props.compProp.showControls,this.props.style),i=c(this.props.compData,this.props.compProp,this.props.isPlayingAllowed,e),o=y(this.props.compData.videoType),r={height:"100%",width:"100%",allowFullScreen:!0,frameBorder:"0",title:o,"aria-label":o};return a.validationUtils.isValidUrl(i)&&(r["data-src"]=i),this.props.addItemProp&&(r.itemProp="image"),{"":{style:{height:e.height,width:e.width}},videoFrame:{children:t.DOM.iframe(r)},preview:{style:{display:"none"}}}}}}); //# sourceMappingURL=video.min.js.map