/*!CK:766492401!*//*1459382584,*/

if (self.CavalryLogger) { CavalryLogger.start_js(["kOwHZ"]); }

__d("VideoEditEvent",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={JS_LOADED:"js_loaded",PAGE_LOAD_STARTED:"page_loaded_started",EDIT_VIDEO_ASSET:"edit_video_asset",PAGE_LOADED:"page_loaded",SAVE_ERROR:"save_error",SAVE_START:"save_start",PREFERRED_THUMBNAIL_CHANGE:"preferred_thumbnail_change",THUMBNAIL_CREATE_STARTED:"thumbnail_create_started",THUMBNAIL_CREATED:"thumbnail_created",SAVE_SUCCESS:"save_success",CTA_UNEXPECTED:"cta_unexpected",CTA_CHANGE_REQUEST:"cta_change_request",VIDEO_DELETE:"video_delete",CAPTIONS_UPLOADED:"captions_uploaded",CAPTIONS_REMOVED:"captions_removed",CAPTIONS_UPDATED_DEFAULT_LOCALE:"captions_updated_default_locale",NO_EDIT_PERMISSION:"no_edit_permission",CANCEL:"cancel_flow",SAVE_CLICKED:"save_clicked",REQUEST_NEW_STORY:"new_story_requested",RECEIVED_NEW_STORY:"new_story_received",REPLACED_OLD_STORY:"old_story_replaced",ERROR_NO_NEW_STORY:"error_no_new_story",ROTATION_CHANGED:"rotation_changed"};},null);
__d("VideoEditFlow",[],function a(b,c,d,e,f,g){c.__markCompiled&&c.__markCompiled();f.exports={DIALOG:"dialog",FORM:"form"};},null);
__d('AdsTypeahead.react',['cx','AdsHelpLink.react','AdsValidationIcon.react','AdsValidationIconType','BackgroundImage.react','React','ReactChildren','SearchableEntry','XUICloseButton.react','XUITypeahead.react','joinClasses'],function a(b,c,d,e,f,g,h){'use strict';if(c.__markCompiled)c.__markCompiled();var i=c('React').PropTypes,j=c('React').createClass({displayName:'AdsTypeahead',propTypes:{autoHighlight:i.bool,disabled:i.bool,disableTooltip:i.bool,errors:i.array,focusedOnInit:i.bool,onQueryStringChange:i.func,onSelectAttempt:i.func,placeholder:i.string,presenter:i.object,searchSource:i.object.isRequired,selectedEntry:i.instanceOf(c('SearchableEntry'))},getDefaultProps:function(){return {autoHighlight:true,disableTooltip:false};},getInitialState:function(){var k=this.props.selectedEntry;return {queryString:this.props.selectedEntry?k.getTitle():'',focused:!!this.props.focusedOnInit};},componentWillReceiveProps:function(k){if('selectedEntry' in k)this.setState({queryString:k.selectedEntry?k.selectedEntry.getTitle():this.state.queryString});},focusInput:function(){this.setState({focused:true});this.refs.typeahead.focusInput();},render:function(){var k=null,l=null;if(this.props.selectedEntry){k=this.props.selectedEntry;l=this.props.selectedEntry.getPhoto();}var m=Array.isArray(this.props.errors)&&this.props.errors.length?c('React').createElement('span',{className:"_1fys"},c('React').createElement(c('AdsValidationIcon.react'),{messages:this.props.errors,type:c('AdsValidationIconType').ERROR_WHITE})):null,n=c('joinClasses')("_1fyt"+(' '+"_1fyu")+(this.state.focused?' '+"_1fyv":'')+(!!m?' '+"_1fyw":''),this.props.className),o=this.props.placeholder||'',p=!this.props.selectedEntry||!this.state.queryString,q=!!this.state.queryString&&!this.props.selectedEntry,r=null;if(this.props.tooltipHelpText)r=c('React').createElement('span',{className:"_1fyx"},c('React').createElement(c('AdsHelpLink.react'),null,this._getTooltipHelpText()));return (c('React').createElement('div',{className:n,role:'presentation',title:this.props.disableTooltip?null:o},c('React').createElement('div',{className:"_1fyy"+(!!m?' '+"_1fyz":'')},m,c('React').createElement('div',{className:(this.props.disabled?"_1fy-":'')+(' '+"_1fy_")+(!!k?' '+"_1fz0":'')+(!!r?' '+"_1fz1":'')+(!!l?' '+"_1fz2":'')},l&&this._renderPhoto(l),k&&this._renderClearEntry(),!k&&r,c('React').createElement(c('XUITypeahead.react'),{autoHighlight:this.props.autoHighlight,disabled:this.props.disabled,focusedOnInit:this.props.focusedOnInit,placeholder:o,presenter:this.props.presenter,queryString:this.state.queryString,ref:'typeahead',searchSource:this.props.searchSource,selectOnBlur:q,showEntriesOnFocus:p,viewStyle:'rich',onBlur:this._onBlur,onChange:this._onChange,onFocus:this._onFocus,onSelectAttempt:this._onSelectAttempt}))),c('React').createElement('div',null,this.props.children)));},_renderPhoto:function(k){return (c('React').createElement(c('BackgroundImage.react'),{backgroundSize:'cover',className:"_1fz3",height:24,src:k,width:24}));},_renderClearEntry:function(){if(this.props.disabled)return null;return (c('React').createElement('div',{className:"_1fz4"},c('React').createElement(c('XUICloseButton.react'),{onClick:this._onClearEntry})));},_getTooltipHelpText:function(){return c('ReactChildren').map(this.props.tooltipHelpText,function(k,l){return (c('React').createElement('p',{className:"_1fz5",key:l},k));});},_onChange:function(event){this.setState({queryString:event.target.value},this._didChange);},_didChange:function(){this.props.selectedEntry&&this.props.onSelectAttempt&&this.props.onSelectAttempt(null);if(this.props.onQueryStringChange)this.props.onQueryStringChange(this.state.queryString);},_onSelectAttempt:function(k){this.props.onSelectAttempt&&this.props.onSelectAttempt(k);},_onClearEntry:function(){this.setState({queryString:''},this._onClear);},_onClear:function(){this.refs.typeahead.focusInput();this.props.onSelectAttempt&&this.props.onSelectAttempt(null);},_onFocus:function(){this.setState({focused:true});},_onBlur:function(){this.setState({focused:false});}});f.exports=j;},null);
__d('AdsPEVideoThumbnailPicker.react',['cx','fbt','ix','Image.react','LeftRight.react','React','ReactChildren','XUIButton.react','XUIPagerButtons.react','XUIText.react','clamp','onlyChild'],function a(b,c,d,e,f,g,h,i,j){'use strict';if(c.__markCompiled)c.__markCompiled();var k=c('React').PropTypes,l=c('React').createClass({displayName:'AdsPEVideoThumbnailPicker',propTypes:{thumbnails:k.arrayOf(k.shape({id:k.string,uri:k.string.isRequired})).isRequired,onChange:k.func.isRequired,index:k.number.isRequired,title:k.string},_prevImage:function(){this._setImageIndex(this.props.index-1);},_nextImage:function(){this._setImageIndex(this.props.index+1);},_setImageIndex:function(m){m=c('clamp')(m,0,this.props.thumbnails.length-1);if(m!==this.props.index)this.props.onChange(m,this.props.thumbnails[m]);},render:function(){if(this.props.thumbnails.length===0)return null;var m=this.props.index,n=this.props.thumbnails[m].uri,o=null;if(c('ReactChildren').count(this.props.children)>0)o=c('React').createElement('div',{className:"_w3"},c('onlyChild')(this.props.children));return (c('React').createElement(c('LeftRight.react'),{className:this.props.className,direction:c('LeftRight.react').DIRECTION.left},c('React').createElement(c('Image.react'),{alt:this.props.title,className:"_w9",src:n}),c('React').createElement('div',{className:"_wf"},c('React').createElement('div',{className:"_3-95"},c('React').createElement(c('XUIPagerButtons.react'),null,c('React').createElement(c('XUIButton.react'),{image:c('React').createElement(c('Image.react'),{src:j('/images/ui/x/pager/left.png')}),type:'button',onClick:this._prevImage}),c('React').createElement(c('XUIButton.react'),{image:c('React').createElement(c('Image.react'),{src:j('/images/ui/x/pager/right.png')}),type:'button',onClick:this._nextImage})),c('React').createElement(c('XUIText.react'),{className:"_3-9a",weight:'bold'},i._("Thumbnail {selected thumbnail index} of {total number of thumbnails}",[i.param('selected thumbnail index',m+1),i.param('total number of thumbnails',this.props.thumbnails.length)]))),o)));}});f.exports=l;},null);
__d('VideoEditTypedLogger',['Banzai','GeneratedLoggerUtils','nullthrows'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();function h(){this.clear();}h.prototype.log=function(){c('GeneratedLoggerUtils').log('logger:VideoEditLoggerConfig',this.$VideoEditTypedLogger1,c('Banzai').BASIC);};h.prototype.logVital=function(){c('GeneratedLoggerUtils').log('logger:VideoEditLoggerConfig',this.$VideoEditTypedLogger1,c('Banzai').VITAL);};h.prototype.clear=function(){this.$VideoEditTypedLogger1={};return this;};h.prototype.updateData=function(j){this.$VideoEditTypedLogger1=babelHelpers['extends']({},this.$VideoEditTypedLogger1,j);return this;};h.prototype.setCaptionsCount=function(j){this.$VideoEditTypedLogger1.captions_count=j;return this;};h.prototype.setChangedTitle=function(j){this.$VideoEditTypedLogger1.changed_title=j;return this;};h.prototype.setEmbeddable=function(j){this.$VideoEditTypedLogger1.embeddable=j;return this;};h.prototype.setEvent=function(j){this.$VideoEditTypedLogger1.event=j;return this;};h.prototype.setExpirationTime=function(j){this.$VideoEditTypedLogger1.expiration_time=j;return this;};h.prototype.setExpirationType=function(j){this.$VideoEditTypedLogger1.expiration_type=j;return this;};h.prototype.setExpiredNow=function(j){this.$VideoEditTypedLogger1.expired_now=j;return this;};h.prototype.setFlow=function(j){this.$VideoEditTypedLogger1.flow=j;return this;};h.prototype.setHasContentCategoryChanged=function(j){this.$VideoEditTypedLogger1.has_content_category_changed=j;return this;};h.prototype.setHasContentTagsChanged=function(j){this.$VideoEditTypedLogger1.has_content_tags_changed=j;return this;};h.prototype.setPublishNow=function(j){this.$VideoEditTypedLogger1.publish_now=j;return this;};h.prototype.setSource=function(j){this.$VideoEditTypedLogger1.source=j;return this;};h.prototype.setVC=function(j){this.$VideoEditTypedLogger1.vc=j;return this;};h.prototype.setVideoID=function(j){this.$VideoEditTypedLogger1.video_id=j;return this;};h.prototype.updateExtraData=function(j){j=c('nullthrows')(c('GeneratedLoggerUtils').serializeMap(j));c('GeneratedLoggerUtils').checkExtraDataFieldNames(j,i);this.$VideoEditTypedLogger1=babelHelpers['extends']({},this.$VideoEditTypedLogger1,j);return this;};h.prototype.addToExtraData=function(j,k){var l={};l[j]=k;return this.updateExtraData(l);};var i={captions_count:true,changed_title:true,embeddable:true,event:true,expiration_time:true,expiration_type:true,expired_now:true,flow:true,has_content_category_changed:true,has_content_tags_changed:true,publish_now:true,source:true,vc:true,video_id:true};f.exports=h;},null);
__d('VideoContentCategorySelector.react',['React','VideoContentCategoryType','XUISelector.react'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('XUISelector.react').Option,i=c('React').PropTypes,j=c('React').createClass({displayName:'VideoContentCategorySelector',propTypes:{onChange:i.func,value:i.number},render:function(){var k=Object.keys(c('VideoContentCategoryType')),l=k.map(function(m){var n=c('VideoContentCategoryType')[m];return (c('React').createElement(h,{key:n.value,value:n.value},n.label));});return (c('React').createElement(c('XUISelector.react'),{onChange:this.props.onChange,value:this.props.value,defaultValue:c('VideoContentCategoryType').OTHER.value},l));}});f.exports=j;},null);
__d('ProgressiveDateAndTimePicker.react',['cx','fbt','InlineBlock.react','React','XUIProgressiveDatepicker.react','XUISelector.react','formatDate'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('XUISelector.react').Option,k=c('React').PropTypes,l=c('React').createClass({displayName:'ProgressiveDateAndTimePicker',propTypes:babelHelpers['extends']({},c('XUIProgressiveDatepicker.react').propTypes,{initialHour:k.number,initialMinute:k.number}),getDefaultProps:function(){return {initialHour:-1,initialMinute:-1,maxTime:Date.now()/1000,minTime:new Date(1906,0,0,0,0).getTime()/1000};},getInitialState:function(){return {datePickerResult:{year:this.props.initialYear,month:this.props.initialMonth,day:this.props.initialDay},hour:this.props.initialHour,minute:this.props.initialMinute};},onDateChange:function(m){this.setState({datePickerResult:m},this.onDateAndTimeChange);},onDateAndTimeChange:function(){if(!this.props.onDateAndTimeChange)return;var m=this.state.datePickerResult,n=babelHelpers['extends']({},m,{hour:this.state.hour,minute:this.state.minute});this.props.onDateAndTimeChange(n);},onHourChange:function(event){this.onSelectorChange(event,'hour');},onMinuteChange:function(event){this.onSelectorChange(event,'minute');},onSelectorChange:function(event,m){var n=event.target?event.target.value:event.value,o={};o[m]=n;this.setState(o,this.onDateAndTimeChange);},render:function(){var m,n;if(this.state.datePickerResult.day){var o=[c('React').createElement(j,{key:-1,value:-1},i._("Hour:"))];for(var p=0;p<24;p++){var q=new Date();q.setHours(p);var r=c('formatDate')(q,'g A');o.push(c('React').createElement(j,{key:p,value:p},r));}m=c('React').createElement(c('XUISelector.react'),{className:"_5vu1",disabled:!this.state.datePickerResult.day,maxheight:this.props.menuMaxHeight,name:this.props.inputPrefix+'_hour',onChange:this.onHourChange,value:this.state.hour},o);}if(this.state.hour!=-1){var s=[c('React').createElement(j,{key:-1,value:-1},i._("Minute:"))];for(p=0;p<60;p+=10){var t='00';if(p>0)t=p;s.push(c('React').createElement(j,{key:p,value:p},t));}n=c('React').createElement(c('XUISelector.react'),{className:"_5vu1",disabled:this.state.hour==-1,maxheight:this.props.menuMaxHeight,name:this.props.inputPrefix+'_minute',onChange:this.onMinuteChange,value:this.state.minute},s);}return (c('React').createElement(c('InlineBlock.react'),{className:this.props.className},c('React').createElement(c('XUIProgressiveDatepicker.react'),babelHelpers['extends']({},this.props,{onDateChange:this.onDateChange})),m,n));}});f.exports=l;},null);
__d('VideoEditCallToActionFields.react',['cx','fbt','AdsTextInput.react','HelpLink.react','React'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k=c('React').createClass({displayName:'VideoEditCallToActionFields',propTypes:{ctaLink:j.string,ctaCaption:j.string,onCtaLinkFieldChange:j.func,onCtaCaptionFieldChange:j.func},render:function(){var l=[c('React').createElement(c('AdsTextInput.react'),{label:i._("URL (Required)"),placeholder:i._("Enter the Page or URL you want people to visit"),className:"_3-8x",onChange:this.props.onCtaLinkFieldChange,value:this.props.ctaLink}),c('React').createElement(c('AdsTextInput.react'),{label:c('React').createElement('div',null,i._("Link Description"),c('React').createElement(c('HelpLink.react'),{tooltip:i._("If you're using a long website address, your display link will show a shorter, friendlier URL.")})),placeholder:i._("Enter a description of the Page or URL"),multiline:false,className:"_3-8x",onChange:this.props.onCtaCaptionFieldChange,value:this.props.ctaCaption}),c('React').createElement('input',{type:'hidden',name:'cta_link',value:this.props.ctaLink}),c('React').createElement('input',{type:'hidden',name:'cta_caption',value:this.props.ctaCaption})];return (c('React').createElement('div',null,l));}});f.exports=k;},null);
__d('VideoMultiCaptionDefaultSelector.react',['cx','fbt','HelpLink.react','React','Selector.react'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('Selector.react').Option,k=c('React').PropTypes,l='video_multi_captions_default_selector_';function m(o){return l+o;}var n=c('React').createClass({displayName:'VideoMultiCaptionDefaultSelector',propTypes:{defaultLocale:k.string,locales:k.array.isRequired,localesMap:k.object.isRequired},render:function(){var o=this.props.defaultLocale?this.props.defaultLocale:'none',p=c('React').createElement(j,{value:'none'},i._("None")),q=this.props.locales.map(function(s){return (c('React').createElement(j,{value:s,key:m(s)},this.props.localesMap[s],': ',s));},this),r=i._("The language will only appear on videos that don't have your preferred caption language available.");return (c('React').createElement('div',{className:"_3-8n _3eab"},i._("Backup Language"),c('React').createElement(c('HelpLink.react'),{tooltip:r,alignv:'bottom'}),c('React').createElement('div',null,c('React').createElement(c('Selector.react'),{name:'default_captions_locale',defaultValue:o},p,q))));}});f.exports=n;},null);
__d('VideoRemovableUploadedCaption.react',['cx','fbt','CloseButton.react','React'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes;function k(m){return 'remove_caption['+m+']';}var l=c('React').createClass({displayName:'VideoRemovableUploadedCaption',propTypes:{deletekey:j.number.isRequired,locale:j.string.isRequired,localeName:j.string.isRequired},getInitialState:function(){return {removed:false};},render:function(){return (c('React').createElement('div',{className:"_2phz _4dez"},this.renderRemovableCaption()));},renderRemovableCaption:function(){var m=this.props.locale,n=this.props.localeName;if(this.state.removed)return (c('React').createElement('div',null,i._("Delete {locale}.",[i.param('locale',m)]),' ',c('React').createElement('a',{href:'#',onClick:this._handleUndoRemove},i._("Undo")),c('React').createElement('input',{name:k(this.props.deletekey),type:'hidden',value:m})));return (c('React').createElement('div',null,c('React').createElement('span',{className:"_4de-"},n,': ',m),c('React').createElement(c('CloseButton.react'),{'aria-labelledby':'metadata_caption_remove',className:"_3-99 _4de-",onClick:this._handleRemove,size:'small'})));},_handleRemove:function(){this.setState({removed:true});},_handleUndoRemove:function(){this.setState({removed:false});}});f.exports=l;},null);
__d('VideoMultiCaptionList.react',['cx','fbt','React','VideoRemovableUploadedCaption.react'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('React').PropTypes,k='video_multi_captions_locale_field_';function l(n){return k+n;}var m=c('React').createClass({displayName:'VideoMultiCaptionList',propTypes:{initialLocales:j.array.isRequired,localesMap:j.object.isRequired},render:function(){if(this.props.initialLocales.length>0)return (c('React').createElement('div',{className:"_3-8m"},c('React').createElement('div',{className:"_439x _3-93 _3-8m"},this.renderList())));return (c('React').createElement('div',{className:"_3-8w"},i._("No captions exist yet")));},renderList:function(){var n=this.props.initialLocales.map(function(o){return (c('React').createElement(c('VideoRemovableUploadedCaption.react'),{deletekey:this.props.initialLocales.indexOf(o),key:l(o),locale:o,localeName:this.props.localesMap[o]}));},this);return n;}});f.exports=m;},null);
__d('VideoMultiCaptionUploaderList.react',['cx','fbt','HelpLink.react','React'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j='captions_file',k=c('React').createClass({displayName:'VideoMultiCaptionUploaderList',render:function(){var l=c('React').createElement('div',{className:"_2c1z"},i._("Valid SRT files must be used for captions. To replace an SRT file that is already being used for a locale, you must delete the old one first before uploading a new one."));return (c('React').createElement('div',{className:"_3-8n _15z_"},i._("Upload SRT files"),c('React').createElement(c('HelpLink.react'),{tooltip:l,alignv:'bottom'}),c('React').createElement('input',{'aria-labelledby':'metadata_caption',type:'file',name:j})));}});f.exports=k;},null);
__d('VideoMultiCaptionFileInput.react',['React','VideoMultiCaptionDefaultSelector.react','VideoMultiCaptionList.react','VideoMultiCaptionUploaderList.react'],function a(b,c,d,e,f,g){'use strict';if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'VideoMultiCaptionFileInput',propTypes:{defaultLocale:h.string,initialLocales:h.array.isRequired,localesMap:h.object.isRequired},render:function(){var j=null;if(this.props.initialLocales.length)j=c('React').createElement(c('VideoMultiCaptionDefaultSelector.react'),{defaultLocale:this.props.defaultLocale,locales:this.props.initialLocales,localesMap:this.props.localesMap});return (c('React').createElement('div',null,c('React').createElement(c('VideoMultiCaptionList.react'),{initialLocales:this.props.initialLocales,localesMap:this.props.localesMap}),j,c('React').createElement(c('VideoMultiCaptionUploaderList.react'),null)));}});f.exports=i;},null);
__d('VideoEditCaptions.react',['React','VideoMultiCaptionFileInput.react'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'VideoEditCaptions',propTypes:{captions:h.object},getDefaultProps:function(){return {captions:[]};},render:function(){var j=this.props.captions,k,l=[],m={};for(var n in j){var o=j[n];if(o.is_default)k=o.locale;l.push(o.locale);m[o.locale]=o.locale_name;}return (c('React').createElement('div',{className:this.props.className},c('React').createElement(c('VideoMultiCaptionFileInput.react'),{defaultLocale:k,initialLocales:l,localesMap:m})));}});f.exports=i;},null);
__d('VideoEditTokenizer.react',['React','XUITokenizer.react'],function a(b,c,d,e,f,g){if(c.__markCompiled)c.__markCompiled();var h=c('React').PropTypes,i=c('React').createClass({displayName:'VideoEditTokenizer',propTypes:{disabled:h.bool,onTagsChange:h.func.isRequired},getDefaultProps:function(){return {disabled:false};},getInitialState:function(){return {queryString:''};},onAddTagAttempt:function(j){var k=this.props.entries||[],l=k.indexOf(j);if(l>=0)return;k.push(j);this.props.onTagsChange(k);this.setState({queryString:''});},onRemoveTagAttempt:function(j){var k=this.props.entries||[],l=k.indexOf(j);if(l>=0)k.splice(l,1);this.props.onTagsChange(k);},onQueryStringChange:function(event){if(this.props.disabled){return;}else this.setState({queryString:event.target.value});},render:function(){return (c('React').createElement(c('XUITokenizer.react'),babelHelpers['extends']({},this.props,{onQueryStringChange:this.onQueryStringChange,queryString:this.state.queryString,onAddEntryAttempt:this.onAddTagAttempt,onRemoveEntryAttempt:this.onRemoveTagAttempt})));}});f.exports=i;},null);
__d('VideoThumbnailPicker.react',['cx','fbt','AdsPEVideoThumbnailPicker.react','BUIFormButton.react','FileInput.react','Grid.react','React'],function a(b,c,d,e,f,g,h,i){'use strict';if(c.__markCompiled)c.__markCompiled();var j=c('Grid.react').GridItem,k=c('React').PropTypes,l=c('React').createClass({displayName:'VideoThumbnailPicker',propTypes:{thumbnails:k.arrayOf(k.shape({id:k.string,uri:k.string.isRequired})).isRequired,onPickerChange:k.func.isRequired,index:k.number.isRequired,allowCustomThumbnails:k.bool.isRequired,onFileInputChange:k.func},render:function(){var m=c('React').createElement(c('AdsPEVideoThumbnailPicker.react'),{thumbnails:this.props.thumbnails,onChange:this.props.onPickerChange,index:this.props.index,title:i._("Choose a Thumbnail")}),n;if(this.props.allowCustomThumbnails){n=c('React').createElement(c('FileInput.react'),{accept:'image/*',name:'custom_thumbnail',onChange:this.props.onFileInputChange},c('React').createElement(c('BUIFormButton.react'),{href:{url:'#'},label:i._("Add Custom Thumbnail")}));}else n=c('React').createElement('div',null);return (c('React').createElement(c('Grid.react'),{cols:2,spacing:'prl'},c('React').createElement(j,null,m),c('React').createElement(j,null,c('React').createElement('div',{className:"_5nd2"},n))));}});f.exports=l;},null);
__d('VideoEditForm.react',['cx','fbt','AdsAPIObjectives','AdsCreativeCallToActionField.react','AdsTypeahead.react','BUIForm.react','BUIFormButton.react','BUIFormTextInput.react','DOMContainer.react','FBNumberInput.react','InlineBlock.react','InputLabel.react','ProgressiveDateAndTimePicker.react','React','SearchableEntry','VideoEditCallToActionFields.react','VideoContentCategorySelector.react','VideoEditCaptions.react','VideoEditEvent','VideoEditFlow','VideoEditSource','VideoEditMentionsTextArea.react','VideoEditTokenizer.react','VideoEditTypedLogger','VideoThumbnailPicker.react','XUICheckboxInput.react','XUINotice.react','XUIText.react','getMentionsTextForContentState'],function a(b,c,d,e,f,g,h,i){if(c.__markCompiled)c.__markCompiled();var j=c('BUIForm.react').Element,k=c('BUIForm.react').Section,l=c('React').PropTypes,m=b.URL||b.webkitURL||{},n=c('React').createClass({displayName:'VideoEditForm',propTypes:{allowCustomThumbnails:l.bool,canBackdate:l.bool,canFeature:l.bool,canPreview:l.bool,canTag:l.bool,captions:l.object,deleteDialogURI:l.object,description:l.string,embeddable:l.bool,error:l.object,fov:l.number,initialHeading:l.number,initialPitch:l.number,isEncoding:l.bool,isSpherical:l.bool,locationEntry:l.object,mentionsSearchSource:l.object,notifyWhenProcessed:l.bool,placesSearchSource:l.object,preferredThumbnailIndex:l.number,previewMarkup:l.object,privacySelector:l.object,privacyDescription:l.string,source:l.oneOf(Object.keys(c('VideoEditSource'))),tags:l.array,tagsSearchSource:l.object,thumbnails:l.array,title:l.string,videoID:l.string,videoPermalink:l.string},componentDidMount:function(){new (c('VideoEditTypedLogger'))().setEvent(c('VideoEditEvent').JS_LOADED).setSource(this.props.source).setFlow(c('VideoEditFlow').FORM).setVideoID(this.props.videoID).log();},getInitialState:function(){return {contentCategory:this.props.contentCategory,ctaType:this.props.ctaType,ctaLink:this.props.ctaLink,ctaCaption:this.props.ctaCaption,editorStateContent:this.props.description,fov:this.props.fov,initialHeading:this.props.initialHeading,initialPitch:this.props.initialPitch,locationEntry:this.props.locationEntry?new (c('SearchableEntry'))(this.props.locationEntry):null,tags:this.props.tags||[],title:this.props.title,embeddable:this.props.embeddable,thumbnails:this.props.thumbnails,thumbnailIndex:this.props.preferredThumbnailIndex-1};},onTitleChange:function(event){this.setState({title:event.target.value});},onDescriptionChange:function(o){this.setState({editorState:o,editorStateContent:c('getMentionsTextForContentState')(o.getCurrentContent())});},onLocationSelectAtempt:function(o){this.setState({locationEntry:o});},getDateTimeKey:function(o){return 'initial'+o.charAt(0).toUpperCase()+o.slice(1);},onTagsChange:function(o){this.setState({tags:o});},onThumbnailPickerChange:function(o){this.setState({thumbnailIndex:o});},onThumbnailImageChange:function(event){if(typeof m.createObjectURL!=='function')return;var o,p;if(event.target.files.length===0){o=this.props.thumbnails;p=this.state.thumbnailIndex>=o.length?o.length-1:this.state.thumbnailIndex;}else{o=this.props.thumbnails.concat([{uri:m.createObjectURL(event.target.files[0])}]);p=o.length-1;}this.setState({thumbnails:o,thumbnailIndex:p});},renderTaggerSection:function(){var o=this.state.tags.map(function(q){return q.getUniqueID();}),p=o.join(',');return (c('React').createElement(k,{key:'taggerSection'},c('React').createElement(j,{label:i._("In this video"),infoText:i._("Tag people who appear in this video.")},c('React').createElement(c('VideoEditTokenizer.react'),{className:"_2dlh",entries:this.state.tags,onTagsChange:this.onTagsChange,searchSource:this.props.tagsSearchSource}),c('React').createElement('input',{type:'hidden',name:'tags',value:p}))));},getPlaceInputKeyAndValue:function(){var o=this.state.locationEntry,p='place_id',q=o?o.getUniqueID():null;if(o&&!q){p='place_name';q=o.getTitle();}return {key:p,value:q};},renderDetailsSection:function(){var o=this.getPlaceInputKeyAndValue();return (c('React').createElement(k,{key:'detailsSection'},c('React').createElement(j,{label:i._("Title")},c('React').createElement(c('BUIFormTextInput.react'),{className:"_2dli",onChange:this.onTitleChange,value:this.state.title,name:'title'})),this.renderThumbnailsFormElement(),c('React').createElement(j,{label:i._("Where")},c('React').createElement(c('AdsTypeahead.react'),{className:"_32bi",autoHighlight:false,placeholder:i._("Where was this video taken?"),selectedEntry:this.state.locationEntry,onSelectAttempt:this.onLocationSelectAtempt,searchSource:this.props.placesSearchSource}),c('React').createElement('input',{type:'hidden',name:o.key,value:o.value})),this.renderBackdateFormElement(),c('React').createElement(j,{label:i._("Description")},c('React').createElement(c('VideoEditMentionsTextArea.react'),{searchSource:this.props.mentionsSearchSource,className:"_3smg",editorState:this.state.editorState,textWithMentions:this.props.description,onChange:this.onDescriptionChange}),c('React').createElement('input',{type:'hidden',name:'description',value:this.state.editorStateContent})),this.renderCaptionsFormElement(),this.renderCallToActionFormElement(),this.renderEmbeddableFormElement(),this.renderSphericalVideoSection(),this.renderContentCategoryFormElement(),c('React').createElement(j,{label:i._("Privacy"),infoText:this.props.privacyDescription},c('React').createElement(c('InlineBlock.react'),{className:"_32bj"},c('React').createElement(c('DOMContainer.react'),null,this.props.privacySelector)))));},renderBackdateFormElement:function(){if(!this.props.canBackdate)return c('React').createElement('div',null);var o={};for(var p in this.props.backdatedTime){var q=this.getDateTimeKey(p);o[q]=parseInt(this.props.backdatedTime[p],10);}return (c('React').createElement(j,{label:i._("When")},c('React').createElement(c('ProgressiveDateAndTimePicker.react'),babelHelpers['extends']({className:"_32bj"},o,{inputPrefix:'backtime',descendingYears:true}))));},renderCaptionsFormElement:function(){return (c('React').createElement(j,{label:i._("Captions"),infoText:i._("Upload your .SRT caption file using this format: filename.en_US.srt")},c('React').createElement(c('VideoEditCaptions.react'),{className:"_2dlj",captions:this.props.captions})));},renderThumbnailsFormElement:function(){if(this.props.isEncoding||this.state.thumbnails.length===0)return c('React').createElement('div',null);var o=c('React').createElement(c('VideoThumbnailPicker.react'),{thumbnails:this.state.thumbnails,onPickerChange:this.onThumbnailPickerChange,index:this.state.thumbnailIndex,allowCustomThumbnails:this.props.allowCustomThumbnails,onFileInputChange:this.onThumbnailImageChange});return (c('React').createElement(j,{className:"_1q0n",label:i._("Thumbnail")},o,c('React').createElement('input',{type:'hidden',name:'preferred_thumbnail_index',value:this.state.thumbnailIndex+1})));},onProhibitEmbeddableChange:function(event){this.setState({embeddable:!event.target.checked});},renderEmbeddableFormElement:function(){if(this.props.embeddable==null)return c('React').createElement('span',null);return (c('React').createElement(j,{label:i._("Embedding"),infoText:i._("When checked, people cannot embed your video on third-party websites.")},c('React').createElement(c('InlineBlock.react'),{className:"_32bj"},c('React').createElement('input',{type:'hidden',name:'has_embeddable',value:'true'}),c('React').createElement('input',{type:'hidden',name:'embeddable',value:this.state.embeddable}),c('React').createElement(c('InputLabel.react'),{className:"_46oj"},c('React').createElement(c('XUICheckboxInput.react'),{checked:!this.state.embeddable,onChange:this.onProhibitEmbeddableChange}),c('React').createElement('label',null,i._("Prohibit embedding"))))));},renderActionsSection:function(){return (c('React').createElement(k,{key:'actionsSection'},c('React').createElement('div',{className:"_59__ mvl"},c('React').createElement(c('BUIFormButton.react'),{href:this.props.videoPermalink,label:i._("Cancel")}),c('React').createElement(c('BUIFormButton.react'),{href:this.props.deleteDialogURI,label:i._("Delete"),rel:'dialog'}),c('React').createElement(c('BUIFormButton.react'),{label:i._("Save"),use:'confirm'}))));},renderCallToActionFormElement:function(){if(!this.props.isOwnerPage||this.props.hideCTA)return c('React').createElement('span',null);var o=null;if(this.state.ctaType)o=c('React').createElement(c('VideoEditCallToActionFields.react'),{ctaLink:this.state.ctaLink,ctaCaption:this.state.ctaCaption,onCtaLinkFieldChange:this._onCtaLinkFieldChange,onCtaCaptionFieldChange:this._onCtaCaptionFieldChange});return (c('React').createElement(j,{label:i._("Call To Action")},c('React').createElement('div',{className:"_3-95"},i._("Call-to-action buttons will appear after your video starts and will not appear in your preview.")),c('React').createElement(c('AdsCreativeCallToActionField.react'),{apiObjective:c('AdsAPIObjectives').VIDEO_VIEWS,onChange:this._onCtaTypeChange,selectedType:this.state.ctaType,noButtonLabel:i._("No Button")}),c('React').createElement('input',{type:'hidden',name:'cta_type',value:this.state.ctaType}),o));},_onCtaTypeChange:function(o){this.setState({ctaType:o.value});},_onCtaLinkFieldChange:function(o){this.setState({ctaLink:o});},_onCtaCaptionFieldChange:function(o){this.setState({ctaCaption:o});},renderContentCategoryFormElement:function(){return (c('React').createElement(j,{label:i._("Category"),infoText:i._("Select a category that matches the content of your video")},c('React').createElement('input',{type:'hidden',name:'content_category',value:this.state.contentCategory}),c('React').createElement(c('VideoContentCategorySelector.react'),{onChange:this._onContentCategoryChange,value:this.state.contentCategory})));},_onContentCategoryChange:function(event){this.setState({contentCategory:event.value});},_onInitialHeadingChange:function(o){this.setState({initialHeading:o});},_onInitialPitchChange:function(o){this.setState({initialPitch:o});},_onFOVChange:function(o){this.setState({fov:o});},renderSphericalVideoSection:function(){if(!this.props.isSpherical)return c('React').createElement('span',null);return (c('React').createElement(j,{label:i._("360 Video")},c('React').createElement(c('InlineBlock.react'),{className:"_32bj"},c('React').createElement(c('InputLabel.react'),null,c('React').createElement('label',{className:"_55r1 _58ak _4-nx"},c('React').createElement(c('FBNumberInput.react'),{name:'initial_heading',value:this.state.initialHeading,defaultValue:0,minValue:-180,maxValue:180,onlyIntegers:true,onValueChange:this._onInitialHeadingChange,className:"_58al"})),c('React').createElement('label',null,c('React').createElement(c('XUIText.react'),{weight:'normal'},i._("Initial heading (-180\u00b0 to 180\u00b0)")))),c('React').createElement(c('InputLabel.react'),null,c('React').createElement('label',{className:"_55r1 _58ak _4-nx"},c('React').createElement(c('FBNumberInput.react'),{name:'initial_pitch',value:this.state.initialPitch,defaultValue:0,minValue:-90,maxValue:90,onlyIntegers:true,onValueChange:this._onInitialPitchChange,className:"_58al"})),c('React').createElement('label',null,c('React').createElement(c('XUIText.react'),{weight:'normal'},i._("Initial pitch (-90\u00b0 to 90\u00b0)")))),c('React').createElement(c('InputLabel.react'),null,c('React').createElement('label',{className:"_55r1 _58ak _4-nx"},c('React').createElement(c('FBNumberInput.react'),{name:'fov',value:this.state.fov,defaultValue:60,minValue:40,maxValue:120,onlyIntegers:true,onValueChange:this._onFOVChange,className:"_58al"})),c('React').createElement('label',null,c('React').createElement(c('XUIText.react'),{weight:'normal'},i._("Vertical field of view (40\u00b0 to 120\u00b0)")))))));},renderError:function(){if(!this.props.error)return null;return (c('React').createElement(c('XUINotice.react'),{use:'warn'},c('React').createElement(c('DOMContainer.react'),null,this.props.error)));},renderEncodingNotice:function(){if(!this.props.isEncoding)return null;return (c('React').createElement(c('XUINotice.react'),{use:'notify'},c('React').createElement('h1',null,i._("This video is currently processing")),i._("You can edit its details here, but you won't be able to choose a thumbnail until processing is complete."),c('React').createElement(c('InputLabel.react'),null,c('React').createElement(c('XUICheckboxInput.react'),{name:'alert_when_done',defaultChecked:this.props.notifyWhenProcessed}),c('React').createElement('label',null,i._("Notify me when my video is done processing")))));},renderPreviewSection:function(){var o=this.props.canFeature?i._("Feature"):i._("Trailer"),p=this.props.canFeature?null:i._("Mark this video as a trailer to have it show up as a preview for your page in various places on Facebook. You can only have one video marked as a trailer at a time.");return (c('React').createElement(k,{key:'previewSection'},c('React').createElement(j,{label:o,infoText:p},c('React').createElement(c('DOMContainer.react'),null,this.props.previewMarkup))));},render:function(){var o=[];if(this.props.canTag)o.push(this.renderTaggerSection());o.push(this.renderDetailsSection());if(this.props.canFeature||this.props.canPreview)o.push(this.renderPreviewSection());o.push(this.renderActionsSection());return (c('React').createElement('div',null,this.renderError(),this.renderEncodingNotice(),c('React').createElement(c('BUIForm.react'),{className:"_3slc"},o)));}});f.exports=n;},null);