var _jsxFileName='website/core/nav/HeaderNav.js';var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var React=require('React');

var siteConfig=require(process.cwd()+'/siteConfig.js');var

LanguageDropDown=function(_React$Component){_inherits(LanguageDropDown,_React$Component);function LanguageDropDown(){_classCallCheck(this,LanguageDropDown);return _possibleConstructorReturn(this,(LanguageDropDown.__proto__||Object.getPrototypeOf(LanguageDropDown)).apply(this,arguments));}_createClass(LanguageDropDown,[{key:'render',value:function render()
{var _this2=this;
var enabledLanguages=[];
var currentLanguage='English';

siteConfig['languages'].map(function(lang){
if(lang.tag==_this2.props.language){
currentLanguage=lang.name;
}
if(lang.tag==_this2.props.language){
return;
}
enabledLanguages.push(
React.createElement('li',{key:lang.tag,__source:{fileName:_jsxFileName,lineNumber:18}},
React.createElement('a',{href:siteConfig.baseUrl+lang.tag,__source:{fileName:_jsxFileName,lineNumber:19}},
lang.name)));



});

enabledLanguages.push(
React.createElement('li',{key:'recruiting',__source:{fileName:_jsxFileName,lineNumber:27}},
React.createElement('a',{href:siteConfig.recruitingLink,target:'_blank',__source:{fileName:_jsxFileName,lineNumber:28}},'Help Translate')));





return(
React.createElement('span',{__source:{fileName:_jsxFileName,lineNumber:35}},
React.createElement('li',{__source:{fileName:_jsxFileName,lineNumber:36}},
React.createElement('a',{id:'languages-menu',href:'#',__source:{fileName:_jsxFileName,lineNumber:37}},
React.createElement('img',{
className:'languages-icon',
src:this.props.baseUrl+'img/language.svg',__source:{fileName:_jsxFileName,lineNumber:38}}),

currentLanguage),

React.createElement('div',{id:'languages-dropdown',className:'hide',__source:{fileName:_jsxFileName,lineNumber:44}},
React.createElement('ul',{id:'languages-dropdown-items',__source:{fileName:_jsxFileName,lineNumber:45}},
enabledLanguages))),



React.createElement('script',{
dangerouslySetInnerHTML:{
__html:'\n        const languagesMenuItem = document.getElementById("languages-menu");\n        const languagesDropDown = document.getElementById("languages-dropdown");\n        languagesMenuItem.addEventListener("click", function(){\n          if(languagesDropDown.className == "hide") {\n            languagesDropDown.className = "visible";\n          } else {\n            languagesDropDown.className = "hide";\n          }\n        });\n      '},__source:{fileName:_jsxFileName,lineNumber:50}})));














}}]);return LanguageDropDown;}(React.Component);var


HeaderNav=function(_React$Component2){_inherits(HeaderNav,_React$Component2);
function HeaderNav(){_classCallCheck(this,HeaderNav);var _this3=_possibleConstructorReturn(this,(HeaderNav.__proto__||Object.getPrototypeOf(HeaderNav)).call(this));

_this3.state={
slideoutActive:false};return _this3;

}_createClass(HeaderNav,[{key:'makeLinks',value:function makeLinks(

link){
link.href=link.href.replace(
/\/LANGUAGE\//,
'\/'+this.props.language+'\/');

return(
React.createElement('li',{key:link.section,__source:{fileName:_jsxFileName,lineNumber:84}},
React.createElement('a',{
href:link.href,
className:link.section===this.props.section?'active':'',__source:{fileName:_jsxFileName,lineNumber:85}},
siteConfig[this.props.language]['localized-strings'][link.text])));



}},{key:'render',value:function render()

{
return(
React.createElement('div',{className:'fixedHeaderContainer',__source:{fileName:_jsxFileName,lineNumber:96}},
React.createElement('div',{className:'headerWrapper wrapper',__source:{fileName:_jsxFileName,lineNumber:97}},
React.createElement('header',{__source:{fileName:_jsxFileName,lineNumber:98}},
React.createElement('a',{href:this.props.baseUrl,__source:{fileName:_jsxFileName,lineNumber:99}},
React.createElement('img',{src:this.props.baseUrl+siteConfig.headerIcon,__source:{fileName:_jsxFileName,lineNumber:100}}),
React.createElement('h2',{__source:{fileName:_jsxFileName,lineNumber:101}},this.props.title)),

this.renderResponsiveNav()))));




}},{key:'renderResponsiveNav',value:function renderResponsiveNav()

{
return(
React.createElement('div',{className:'navigationWrapper navigationSlider',__source:{fileName:_jsxFileName,lineNumber:112}},
React.createElement('nav',{className:'slidingNav',__source:{fileName:_jsxFileName,lineNumber:113}},
React.createElement('ul',{className:'nav-site nav-site-internal',__source:{fileName:_jsxFileName,lineNumber:114}},
this.props.config.headerLinksInternal.map(this.makeLinks,this),
React.createElement(LanguageDropDown,{
baseUrl:this.props.baseUrl,
language:this.props.language,__source:{fileName:_jsxFileName,lineNumber:116}}),

React.createElement('li',{className:'navSearchWrapper reactNavSearchWrapper',__source:{fileName:_jsxFileName,lineNumber:120}},
React.createElement('input',{id:'search_input_react',type:'text',placeholder:'Search',__source:{fileName:_jsxFileName,lineNumber:121}})),

this.props.config.headerLinksExternal.map(this.makeLinks,this)))));




}}]);return HeaderNav;}(React.Component);


module.exports=HeaderNav;