` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n function TransitionGroup(props, context) {\n var _this;\n _this = _React$Component.call(this, props, context) || this;\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n var _proto = TransitionGroup.prototype;\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n return TransitionGroup;\n}(React.Component);\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import React from 'react';\n\ninterface DelayTransitionRenderProps {\n\tdelay: number;\n\ttimeout: object;\n}\ninterface DelayTransitionRenderState {\n\tshouldRender: boolean;\n}\nexport const delayTransitionRender = (Component: React.ComponentType
) =>\n\tclass DelayedTransitionWrapper extends React.Component
{\n\t\tprivate timeout: NodeJS.Timer;\n\n\t\tconstructor(props) {\n\t\t\tsuper(props);\n\t\t\tthis.state = {\n\t\t\t\tshouldRender: props.delay === 0\n\t\t\t};\n\t\t}\n\n\t\tcomponentDidMount() {\n\t\t\tif (this.props.delay !== 0) {\n\t\t\t\tthis.timeout = setTimeout(() => this.setState({ shouldRender: true }), this.props.delay);\n\t\t\t}\n\t\t}\n\t\tcomponentWillUnmount() {\n\t\t\tclearTimeout(this.timeout);\n\t\t}\n\n\t\trender() {\n\t\t\t// console.log('should render', this.state.shouldRender);\n\t\t\treturn this.state.shouldRender || typeof window === `undefined` ? : null;\n\t\t}\n\t};\n","//Import necessary dependencies\nimport React from 'react';\nimport { TransitionGroup, Transition } from 'react-transition-group';\nimport { Globals } from '../utils/Globals';\nimport { delayTransitionRender } from './delayTransitionRender';\n\n//This variable will be responsible for our animation duration\nconst timeout = 400;\nexport const pageTransitionEvent = 'PageTransition::exit';\n\nexport interface IPageTransitionProps {\n children?: any;\n\tlocation: any;\n}\n\n//This object contains basic styles for animation, but you can extend them to whatever you like. Be creative!\nconst getTransitionStyles = {\n\tentering: {\n\t\t// position: 'absolute',\n\t\topacity: 0\n\t},\n\tentered: {\n\t\ttransition: `opacity ${timeout}ms ease-in-out`,\n\t\topacity: 1\n\t},\n\texiting: {\n\t\t// position: 'absolute',\n\t\ttransition: `opacity ${timeout}ms ease-in-out`,\n\t\topacity: 0\n\t}\n};\n// @ts-ignore\nconst DelayedTransition = delayTransitionRender(Transition);\n\nclass PageTransition extends React.PureComponent {\n\trender() {\n\t\t//Destructuring props to avoid garbage this.props... in return statement\n\t\tconst { children, location } = this.props;\n\t\tlet opacity = 0;\n\n\t\tconst firstLoad = Globals.SITE_FIRST_LOAD;\n\t\tif (Globals.SITE_FIRST_LOAD) {\n\t\t\topacity = 1;\n\t\t\tGlobals.SITE_FIRST_LOAD = false;\n\t\t}\n\t\tlet currTimeout = timeout;\n\t\tif (typeof window === 'undefined') {\n\t\t\topacity = 1;\n\t\t}\n\n\t\tvar defaultStyle = {\n\t\t\ttransition: 'opacity ' + `${currTimeout}ms ease-in-out`,\n\t\t\topacity: opacity\n\t\t};\n\n\t\treturn (\n\t\t\t//Using TransitionGroup and ReactTransition which are both\n\t\t\t//coming from 'react-transition-group' and are required for transitions to work\n\t\t\t\n\t\t\t\t node.offsetHeight}\n\t\t\t\t\tmountOnEnter={true}\n\t\t\t\t\tunmountOnExit={true}\n\t\t\t\t>\n\t\t\t\t\t{//Application of the styles depending on the status of page(entering, exiting, entered) in the DOM\n\t\t\t\t\tstatus => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t\n\t\t);\n\t}\n}\n\nexport default PageTransition;\n","import * as React from 'react';\n\nif (typeof window !== 'undefined') {\n\trequire('intersection-observer'); // optional polyfill\n}\nimport Observer from '@researchgate/react-intersection-observer';\nimport * as styles from './ViewableMonitor.module.scss';\nimport { ScrollMonitor } from '../../utils/ScrollMonitor';\nimport { ReactElement } from 'react';\n\nexport default class ViewableMonitor extends React.Component<{ children?: any; disabled?: boolean; delay?: number | boolean; fadeOnly?: boolean }> {\n\t// private handleNode:any;\n\n\tprivate static SCROLL_MONITOR = new ScrollMonitor();\n\n\thandleChange = (event, unobserve) => {\n\t\tif (event.isIntersecting) {\n\t\t\tunobserve();\n\t\t\tconst target = event.target;\n\t\t\tif (this.props.fadeOnly) {\n\t\t\t\ttarget.classList.add(styles.fadeIn);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet inClass = ViewableMonitor.SCROLL_MONITOR.scrollingDown ? styles.fadeInUp: styles.fadeInDown;\n\t\t\tlet inClassGlobal = ViewableMonitor.SCROLL_MONITOR.scrollingDown ? 'moduleAnimateInUp' :'moduleAnimateInDown';\n\t\t\tif (this.props.delay) {\n\t\t\t\tif (typeof this.props.delay === 'number') {\n\t\t\t\t\ttarget.classList.add(styles['visibleDelay-' + this.props.delay]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttarget.classList.add(inClass);\n\t\t\ttarget.classList.add(inClassGlobal);\n\t\t\ttarget.classList.add('moduleAnimateIn');\n\t\t}\n\t};\n\n\trender() {\n\t\tif (this.props.disabled) {\n\t\t\treturn this.props.children;\n\t\t} else {\n\t\t\tconst element = React.Children.only(this.props.children) as ReactElement;\n\n\t\t\tconst childClone = React.cloneElement(element, {\n\t\t\t\t// ref: (ref) => this.handleNode = ref,\n\t\t\t\tclassName: element.props.className ? `${element.props.className} ${styles.hidden}` : styles.hidden\n\t\t\t});\n\n\t\t\treturn (\n\t\t\t\t\n\t\t\t\t\t{childClone}\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t}\n}\n","import { pageTransitionEvent } from '../ui/PageTransition';\n\nexport class ScrollMonitor {\n\tpublic lastScrollPosition = typeof window !== 'undefined' ? window.scrollY : 0;\n\tprivate scrollY = 0;\n\tpublic scrollingDown = true;\n\tprivate ticking = false;\n\n\tconstructor() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.addEventListener('scroll', this.scrollHandler, { passive: true });\n\t\t\t(global as any).window.addEventListener(pageTransitionEvent, this.pageChangeHandler);\n\t\t\t// window.addEventListener('popstate', this.pageChangeHandler);\n\t\t}\n\t}\n\n\tprivate pageChangeHandler = () => {\n\t\tif (window.location.hash.indexOf('#map') !== 0) {\n\t\t\tthis.lastScrollPosition = -9999999999;\n\t\t\tthis.scrollingDown = true;\n\t\t}\n\t};\n\n\tprivate scrollHandler = () => {\n\t\tif (!this.ticking) {\n\t\t\twindow.requestAnimationFrame(() => {\n\t\t\t\tthis.scrollY = window.scrollY;\n\t\t\t\tthis.scrollingDown = this.lastScrollPosition < this.scrollY;\n\t\t\t\tthis.lastScrollPosition = this.scrollY;\n\t\t\t\tthis.ticking = false;\n\t\t\t});\n\t\t\tthis.ticking = true;\n\t\t}\n\t};\n}\n","import { useEffect, useRef, useState } from \"react\";\n\nconst useSticky = () => {\n const stickyRef = useRef(null);\n const [sticky, setSticky] = useState(false);\n const [offset, setOffset] = useState(0);\n\n useEffect(() => {\n if (!stickyRef.current) {\n return;\n }\n setOffset(stickyRef.current.offsetTop);\n }, [stickyRef, setOffset]);\n\n useEffect(() => {\n const handleScroll = () => {\n if (!stickyRef.current) {\n return;\n }\n\n setSticky(window.scrollY > 0);\n };\n window.addEventListener(\"scroll\", handleScroll);\n return () => window.removeEventListener(\"scroll\", handleScroll);\n }, [setSticky, stickyRef, offset]);\n return { stickyRef, sticky };\n};\n\nexport default useSticky;","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __rest } from \"tslib\";\nimport * as React from 'react';\nimport { shallowEqual } from '../utils';\nimport useIntl from './useIntl';\nfunction areEqual(prevProps, nextProps) {\n var values = prevProps.values,\n otherProps = __rest(prevProps, [\"values\"]);\n var nextValues = nextProps.values,\n nextOtherProps = __rest(nextProps, [\"values\"]);\n return shallowEqual(nextValues, values) && shallowEqual(otherProps, nextOtherProps);\n}\nfunction FormattedMessage(props) {\n var intl = useIntl();\n var formatMessage = intl.formatMessage,\n _a = intl.textComponent,\n Text = _a === void 0 ? React.Fragment : _a;\n var id = props.id,\n description = props.description,\n defaultMessage = props.defaultMessage,\n values = props.values,\n children = props.children,\n _b = props.tagName,\n Component = _b === void 0 ? Text : _b,\n ignoreTag = props.ignoreTag;\n var descriptor = {\n id: id,\n description: description,\n defaultMessage: defaultMessage\n };\n var nodes = formatMessage(descriptor, values, {\n ignoreTag: ignoreTag\n });\n if (typeof children === 'function') {\n return children(Array.isArray(nodes) ? nodes : [nodes]);\n }\n if (Component) {\n return React.createElement(Component, null, React.Children.toArray(nodes));\n }\n return React.createElement(React.Fragment, null, nodes);\n}\nFormattedMessage.displayName = 'FormattedMessage';\nvar MemoizedFormattedMessage = React.memo(FormattedMessage, areEqual);\nMemoizedFormattedMessage.displayName = 'MemoizedFormattedMessage';\nexport default MemoizedFormattedMessage;","import React from 'react';\nimport { WrappedComponentProps } from 'react-intl';\nimport * as styles from './Hamburger.module.scss';\nimport useSticky from \"./useSticky\";\nimport { FormattedMessage } from 'react-intl';\n\nconst Hamburger = (props: { toggleHandler: (event) => void, intl?: WrappedComponentProps }) => {\n\n const { sticky, stickyRef } = useSticky();\n \n function shiftfocus() {\n window.setTimeout(function () {\n document.getElementById('firstMenuItem').focus();\n }, 0);\n };\n\n\treturn (\n \n\t)\n}\n\nexport default Hamburger;","import { injectIntl } from 'react-intl';\n\nconst GetMessage = ({ id, params, intl }) => intl.formatMessage({ id, params });\n\nexport default injectIntl(GetMessage);","import GetMessage from '../../utils/GetMessage';\n\nexport function getActiveMenu(data: any[], currLanguage: any) {\n\tlet result = data.filter(menuFragment => menuFragment.node_locale === currLanguage.langKey)[0];\n\tif (currLanguage.link === '/ar') {\n\t\tresult.menuItems.forEach(menuItem => {\n\t\t\tmenuItem.path = joinPath(currLanguage.link, menuItem.path);\n\t\t\t// menuItem.path = currLanguage.link + '/' + menuItem.path;\n\n\t\t\tmenuItem.subpages?.forEach(menuItem => {\n\t\t\t\tmenuItem.slug = joinPath(currLanguage.link, menuItem.slug);\n\t\t\t});\n\t\t});\n\t\tresult.secondaryMenuItems.forEach(menuItem => {\n\t\t\tmenuItem.path = joinPath(currLanguage.link, menuItem.path);\n\t\t});\n\t}\n\treturn result;\n}\n\nfunction joinPath(firstPath: string, secondPath: string) {\n\tif (secondPath?.indexOf('#') === 0 || secondPath?.indexOf(firstPath) === 0) {\n\t\treturn secondPath;\n\t}\n\tif (secondPath?.indexOf('/') === 0) {\n\t\treturn firstPath + secondPath;\n\t} else {\n\t\treturn firstPath + '/' + secondPath;\n\t}\n}\n\nexport type SecondaryMenusParsed = { title: string; id: string; items: any[] }[][];\n\nexport function parseSecondaryMenus(\n\tsecondaryMenusData: SecondaryMenusParsed,\n\tcurrLanguage: any,\n\t//@ts-ignore:\n\tprograms: globalsQueryAndLayout_programs,\n\tplaces: any,\n\tentities: any,\n\tmapCategories: any[],\n\tintl: any = GetMessage\n) {\n\tfunction languageFilter(item: any) {\n\t\tif (currLanguage.langKey === 'ar-QA') {\n\t\t\treturn item.node.path.indexOf('/ar/') === 0;\n\t\t} else {\n\t\t\treturn item.node.path.indexOf('/ar/') !== 0;\n\t\t}\n\t}\n\n\tconst allEntities = [...entities.edges].filter(languageFilter);\n\tconst allPlaces = [...places.edges].filter(languageFilter);\n\n\tconst educationEntities = allEntities.filter(edge => edge.node.pageContext.vertical === 'education');\n\tconst researchEntities = allEntities.filter(edge => edge.node.pageContext.vertical === 'research');\n\tconst communityEntities = allEntities.filter(edge => edge.node.pageContext.vertical === 'community');\n\n\tconst educationPlaces = allPlaces.filter(edge => edge.node.pageContext.vertical === 'education');\n\tconst researchPlaces = allPlaces.filter(edge => edge.node.pageContext.vertical === 'research');\n\tconst communityPlaces = allPlaces.filter(edge => edge.node.pageContext.vertical === 'community');\n\n\tvar lang_prefix = currLanguage.link === '/ar' ? '/ar' : ''\n\n //@ts-ignore:\n\tconst idkt_subpages = [\n\t\t{\n\t\t\tnode: {\n\t\t\t\tpageContext: {\n\t\t\t\t\tid: \"1VlF92QaRlvKliniStRZSS\",\n\t\t\t\t\ttitle: intl.formatMessage({ id: 'overview' }),\n\t\t\t\t\tvertical: \"research\"\n\t\t\t\t},\n\t\t\t\tlink: true,\n\t\t\t\tpath: `${lang_prefix}/idkt`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tnode: {\n\t\t\t\tpageContext: {\n\t\t\t\t\tid: \"5Ck3lib1IDEZFYqVgrjr8Y\",\n\t\t\t\t\ttitle: intl.formatMessage({ id: 'for_industry' }),\n\t\t\t\t\tvertical: \"research\"\n\t\t\t\t},\n\t\t\t\tlink: true,\n\t\t\t\tpath: `${lang_prefix}/idkt/for-industry`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tnode: {\n\t\t\t\tpageContext: {\n\t\t\t\t\tid: \"5wt4oraHzqabJI4J9fVfHK\",\n\t\t\t\t\ttitle: intl.formatMessage({ id: 'for_researchers' }),\n\t\t\t\t\tvertical: \"research\"\n\t\t\t\t},\n\t\t\t\tlink: true,\n\t\t\t\tpath: `${lang_prefix}/idkt/for-researchers`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tnode: {\n\t\t\t\tpageContext: {\n\t\t\t\t\tid: \"2aTm0IMJ1LzYrx6baqWR4B\",\n\t\t\t\t\ttitle: intl.formatMessage({ id: 'for_entrepreneurs' }),\n\t\t\t\t\tvertical: \"research\"\n\t\t\t\t},\n\t\t\t\tlink: true,\n\t\t\t\tpath: `${lang_prefix}/idkt/for-entrepreneurs`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tnode: {\n\t\t\t\tpageContext: {\n\t\t\t\t\tid: \"4KGxqPWwJz3ynaLnH9G6On\",\n\t\t\t\t\ttitle: intl.formatMessage({ id: 'technologies' }),\n\t\t\t\t\tvertical: \"research\"\n\t\t\t\t},\n\t\t\t\tlink: true,\n\t\t\t\tpath: `${lang_prefix}/idkt/technologies`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tnode: {\n\t\t\t\tpageContext: {\n\t\t\t\t\tid: \"1SicPn2WFgbtqTpzVOey7m\",\n\t\t\t\t\ttitle: intl.formatMessage({ id: 'about' }),\n\t\t\t\t\tvertical: \"research\"\n\t\t\t\t},\n\t\t\t\tlink: true,\n\t\t\t\tpath: `${lang_prefix}/idkt/about`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tnode: {\n\t\t\t\tpageContext: {\n\t\t\t\t\tid: \"1MbCJsGyeoZ6MDFVP70Izy\",\n\t\t\t\t\ttitle: intl.formatMessage({ id: 'infobank' }),\n\t\t\t\t\tvertical: \"research\"\n\t\t\t\t},\n\t\t\t\tlink: true,\n\t\t\t\tpath: `${lang_prefix}/idkt/info-bank`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tnode: {\n\t\t\t\tpageContext: {\n\t\t\t\t\tid: \"3I9TVsipoXaqLEx5tc4rDH\",\n\t\t\t\t\ttitle: intl.formatMessage({ id: 'road_to_technology_transfer' }),\n\t\t\t\t\tvertical: \"research\"\n\t\t\t\t},\n\t\t\t\tlink: true,\n\t\t\t\tpath: `${lang_prefix}/idkt/road-to-technology-transfer`\n\t\t\t}\n\t\t}\n\t]\n\n\t//Education\n\tsecondaryMenusData[0][0] = {\n\t\ttitle: intl.formatMessage({ id: 'Schools' }),\n\t\tid: 'school',\n\t\titems: educationEntities.filter(edge => edge.node.pageContext.type === 'school').sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title))\n\t};\n\tsecondaryMenusData[0][1] = {\n\t\ttitle: intl.formatMessage({ id: 'Universities' }),\n\t\tid: 'university',\n\t\titems: educationEntities.filter(edge => edge.node.pageContext.type === 'university').sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title))\n\t};\n\t/*\tsecondaryMenusData[0][2] = {\n\t\ttitle: intl.formatMessage({ id: 'Programs' }),\n\t\tid: 'programs',\n\t\titems: programs.edges.filter(languageFilter).sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title))\n\t};*/\n\t/*\n\tsecondaryMenusData[0][4] = { title: intl.formatMessage({ id: 'Places' }), id: 'places', items: educationPlaces.sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title)) };*/\n\n\t//Research\n /*\n\tsecondaryMenusData[1][0] = { title: intl.formatMessage({ id: 'idkt_long' }), id: 'idkt', items: idkt_subpages };\n */\n\tsecondaryMenusData[1][0] = { title: intl.formatMessage({ id: 'Entities' }), id: 'entities', items: researchEntities.sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title)) };\n\n\t//Community\n\tsecondaryMenusData[2][0] = { title: intl.formatMessage({ id: 'Entities' }), id: 'entities', items: communityEntities.sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title)) };\n\tsecondaryMenusData[2][1] = { title: intl.formatMessage({ id: 'Places' }), id: 'places', items: communityPlaces.sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title)) };\n\n\t//Map menu:\n\tsecondaryMenusData[3][0] = { title: intl.formatMessage({ id: 'All' }), id: 'all', items: [...allEntities, ...allPlaces].sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title)) };\n\tsecondaryMenusData[3][1] = {\n\t\ttitle: intl.formatMessage({ id: 'Education' }),\n\t\tid: 'education',\n\t\titems: [...educationEntities, ...educationPlaces].sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title))\n\t};\n\tsecondaryMenusData[3][2] = {\n\t\ttitle: intl.formatMessage({ id: 'Research' }),\n\t\tid: 'research',\n\t\titems: [...researchEntities, ...researchPlaces].sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title))\n\t};\n\tsecondaryMenusData[3][3] = {\n\t\ttitle: intl.formatMessage({ id: 'Community' }),\n\t\tid: 'community',\n\t\titems: [...communityEntities, ...communityPlaces].sort((a, b) => a.node.pageContext.title.localeCompare(b.node.pageContext.title))\n\t};\n}\n","import * as React from 'react';\n\nimport * as styles from '../MobileMenu/MobileMenuSubMenu.module.scss';\nimport * as stylesPreview from './MainMenuPreviewItem.module.scss';\nimport { TimelineMax } from 'gsap/dist/gsap.min';\nimport { FormattedMessage } from 'react-intl';\nimport { ResultItem } from './MainMenu';\nimport { GatsbyImageWrapper } from '../ui/GatsbyImageWrapper';\nimport { Globals } from '../../utils/Globals';\n\nexport class MainMenuPreviewItem extends React.Component<{ currentID: string; url: string; currentLanguage: string; menuData: { [key: string]: ResultItem }; closeCallback: (event) => void; isDesktop?: boolean; }> {\n\tprivate refWrapper: HTMLDivElement;\n\n\tprivate timeline: TimelineMax;\n\n\tprivate visible = false;\n\n\tprivate currData: ResultItem = undefined;\n\n\tpublic show = instant => {\n\t\tif (!this.visible) {\n\t\t\tthis.visible = true;\n\n\t\t\tif (this.timeline) {\n\t\t\t\tthis.timeline.kill();\n\t\t\t\tthis.timeline = null;\n\t\t\t}\n\n\t\t\tthis.timeline = new TimelineMax();\n\t\t\tthis.timeline.set(this.refWrapper, { display: 'block' });\n\t\t\tthis.timeline.to(this.refWrapper, 0.4, { opacity: 1, pointerEvents: 'all', force3D: true });\n\t\t\tif (instant) {\n\t\t\t\tthis.timeline.progress(1);\n\t\t\t}\n\t\t}\n\t};\n\n\tpublic hide = instant => {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\n\t\t\tif (this.timeline) {\n\t\t\t\tthis.timeline.kill();\n\t\t\t\tthis.timeline = null;\n\t\t\t}\n\n\t\t\tthis.timeline = new TimelineMax();\n\t\t\tthis.timeline.set(this.refWrapper, { pointerEvents: 'none' });\n\t\t\tthis.timeline.to(this.refWrapper, 0.3, { opacity: 0, force3D: true }, 0);\n\t\t\tthis.timeline.set(this.refWrapper, { display: 'none' });\n\t\t\tif (instant) {\n\t\t\t\tthis.timeline.progress(1);\n\t\t\t}\n\t\t}\n\t};\n\n\tpublic getWidth = () => {\n\t\tthis.refWrapper.style.display = 'block';\n\t\treturn this.refWrapper.clientWidth;\n\t};\n\n\tpublic render() {\n\t\tif (this.props.menuData && this.props.currentID !== '') {\n\t\t\tif (Globals.CURRENT_LANGUAGE_PREFIX === 'ar/') {\n\t\t\t\tif (!this.props.currentID.includes('___ar-QA')) {\n\t\t\t\t\tthis.currData = this.props.menuData[this.props.currentID + '___ar-QA'];\n\t\t\t\t} else {\n\t\t\t\t\tthis.currData = this.props.menuData[this.props.currentID];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.props.currentID.includes('___ar-QA')) {\n\t\t\t\t\tthis.currData = this.props.menuData[this.props.currentID.replace(/___ar-QA/g, '')];\n\t\t\t\t} else {\n\t\t\t\t\tthis.currData = this.props.menuData[this.props.currentID];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst type = this.currData && this.currData.type && this.currData.type.length > 0 ? this.currData.type[0] : undefined;\n const description =\n\t\t\tthis.currData &&\n\t\t\t(this.currData.ct === 'entity'\n\t\t\t\t? this.currData.entityDescription\n\t\t\t\t\t? this.currData.entityDescription.entityDescription\n\t\t\t\t\t: undefined\n\t\t\t\t: this.currData.subtitle\n\t\t\t\t? this.currData.subtitle.subtitle\n\t\t\t\t: undefined);\n\n\t\treturn (\n\t\t\t (this.refWrapper = ref)} className={`${styles.wrapper} ${this.props.isDesktop ? stylesPreview.mainMenuPreviewDesktopWrapper : '' } ${styles.mainMenuPreviewWrapper}`}>\n\t\t\t\t
\n\t\t\t\t\t{this.currData && (\n <>\n
\n
\n
\n {this.currData.heroImage && (\n
\n )}\n {type && (\n
\n \n \n \n \n {this.currData.filterVerticalCategory && }\n \n {this.currData.filterVerticalCategory && {this.currData.filterVerticalCategory.title}}\n
\n )}\n
\n {this.currData.title}\n
\n {description && (\n
\n {description}\n
\n )}\n
\n
\n {\n // @ts-ignore\n this.currData.entityLogo && (\n \n )}\n
\n
\n
\n >\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n}\n","import * as React from 'react';\nimport * as styles from './UIThemeControls.module.scss';\n\nimport { injectIntl, WrappedComponentProps } from 'react-intl';\n\nclass UIThemeControls extends React.Component<{ type; } & WrappedComponentProps> {\n\trender() {\n\t\tif (this.props.type === 'moon') {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t} else {\n\t\t\treturn (\n\t\t\t\t\n\t\t\t);\n\t\t}\n\t}\n}\n\nexport default injectIntl(UIThemeControls);\n","import React from 'react';\nimport Icon from './UIThemeControls';\nimport { useTheme } from \"react-hook-theme\";\n\nimport * as styles from './DarkModeToggle.module.scss';\n\nconst darkProgressIndicator = () => {\n\tvar indicator = typeof document !== 'undefined' && document.getElementById('gatsby-plugin-page-progress');\n\tif (indicator) indicator.style.backgroundColor = '#6BCDB2';\n};\n\nconst lightProgressIndicator = () => {\n\tvar indicator = typeof document !== 'undefined' && document.getElementById('gatsby-plugin-page-progress');\n\tif (indicator) indicator.style.backgroundColor = '#e14524';\n};\n\nconst DarkModeToggle = () => {\n\tconst { theme, setTheme } = useTheme();\n\n\tconst toggleTheme = (event, theme) => {\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n if (event.type == 'keydown') {\n if (event.keyCode == 13) {\n setTheme(theme)\n var target = event.currentTarget.childNodes[0]\n if ( target.className.indexOf('sun_animated') > -1 ) {\n target.className = 'moon_animated';\n } else {\n target.className = 'sun_animated';\n }\n var embedClasses = [\".twitter-tweet\", \".twitter-timeline\", \".twitter-follow-button\", \".twitter-share-button\"].join(\",\");\n if (document.querySelector(embedClasses) !== null) {\n window.location.reload();\n }\n } else if(event.shiftKey && event.keyCode == 9) {\n document.getElementById('accessibilityWidgetHeader').focus();\n } else {\n document.getElementById('selectLangTop').focus();\n }\n } else {\n setTheme(theme)\n var target = event.currentTarget.childNodes[0]\n if ( target.className.indexOf('sun_animated') > -1 ) {\n target.className = 'moon_animated';\n } else {\n target.className = 'sun_animated';\n }\n var embedClasses = [\".twitter-tweet\", \".twitter-timeline\", \".twitter-follow-button\", \".twitter-share-button\"].join(\",\");\n if (document.querySelector(embedClasses) !== null) {\n window.location.reload();\n }\n }\n\t\t\n\t};\n\n\tif (theme === 'dark') {\n\t\ttypeof window !== 'undefined' && localStorage.setItem('progressBarColor', '#6BCDB2');\n\t\tdarkProgressIndicator();\n\t} else {\n\t\tlightProgressIndicator();\n\t\ttypeof document !== 'undefined' && localStorage.setItem('progressBarColor', '#e14524');\n\t}\n\n\treturn (\n\t\t toggleTheme(e, theme === 'light' ? 'dark' : 'light')} onKeyDown={e => toggleTheme(e, theme === 'light' ? 'dark' : 'light')}>\n\t\t\t\n\t\t\n\t);\n};\n\nexport default DarkModeToggle;","import * as React from 'react';\nimport * as Qs from 'qs';\nimport { getRelativeURL } from '../utils/URLHelper';\n\nimport * as styles from './SelectLanguage.module.scss';\n\ninterface Props {\n\tlangs: Array<{ link: string; langKey: string; selected: boolean }>;\n\talternateURL: string;\n\tinMenu: boolean;\n\tisSearch?: boolean;\n pageContext?: any;\n list?: boolean;\n}\n\nfunction setJSON(key, value) {\n typeof window !== 'undefined' && window.localStorage.setItem(key, value);\n}\n\nconst setPreferances = (lang: any) => {\n const isMobile = typeof window !== 'undefined' && window.innerWidth <= 768;\n if(isMobile)\n document.getElementById('NavigationBg') && document.getElementById('NavigationBg').classList.remove(\"menu-open\")\n\tsetJSON('nf_lang', lang === 'en-US' ? 'en' : 'ar')\n\tsetJSON('nf_country', lang === 'en-US' ? 'us' : 'qa');\n typeof window !== 'undefined' && window.getSelection()?.removeAllRanges();\n};\n\nconst SelectLanguage = (props: Props) => {\n\tlet url = props.alternateURL\n\tif(props.isSearch) {\n\t\turl = props.pageContext?.alternateLanguage + '/#' + Qs.stringify(Qs.parse(typeof window !== 'undefined' && window.location.hash.slice(1)), { encode: false })\n\t}\n\n if(props.list) {\n return (\n \n {props.langs?.map(lang => {\n if (!lang.selected && !props.pageContext?.arabicOnlyStory) {\n return (\n { setPreferances(lang.langKey)} } href={getRelativeURL(url).replace(/\\/#/, '')} key={lang.langKey}>\n {lang.langKey === 'en-US' ? 'English' : 'العربية'}\n \n );\n }\n })}\n \n );\n } else {\n return (\n \n );\n }\n};\n\nexport default SelectLanguage;","import * as React from 'react';\n\nimport * as styles from './Search.module.scss';\nimport { TweenMax } from 'gsap/dist/gsap.min';\nimport { navigate } from 'gatsby';\nimport { FormattedMessage, injectIntl, WrappedComponentProps } from 'react-intl';\nimport { EASE_CUSTOM_IN_OUT } from '../../utils/Constants';\nimport { Globals } from '../../utils/Globals';\n\nconst initialState = { showAllResultsLink: false };\ntype State = Readonly;\n\nclass Search extends React.Component<\n\t{\n\t\tcurrLanguage: any;\n\t\tid?: string;\n inMenu?: boolean;\n\t} & WrappedComponentProps\n> {\n readonly state: State = initialState;\n\tprivate refBg: HTMLDivElement;\n\tprivate visible = false;\n\tprivate refSearchWrapper: HTMLDivElement;\n\tprivate refSearchInnerWrapper: HTMLDivElement;\n\tprivate searchInput: HTMLInputElement;\n\n private showAllResultsLink = (event) => {\n var checkEmpty = event.target;\n // @ts-ignore\n if (checkEmpty.value && checkEmpty.value.length > 0 && checkEmpty.value.trim().length > 0) { \n this.setState({\n showAllResultsLink: true\n })\n }\n else {\n this.setState({\n showAllResultsLink: false\n })\n }\n }\n\n\tprivate allResultsClickHandler = event => {\n\t\tevent.preventDefault();\n // @ts-ignore\n\t\tnavigate('/' + Globals.CURRENT_LANGUAGE_PREFIX + 'search#all=1&allType=1&s=' + encodeURIComponent(this.searchInput.value));\n\t\tif (this.visible) {\n\t\t\tthis.toggleSearch(this);\n\t\t}\n\t\treturn false;\n\t};\n\n\tprivate toggleSearch = e => {\n\t\tif (!this.visible) {\n\t\t\tdocument.body.classList.add('search-open');\n\t\t\tif (e.currentTarget !== undefined) e.currentTarget.attributes['aria-pressed'] = true;\n\t\t\tdocument.addEventListener('keydown', this.keyHandler);\n\t\t\tthis.visible = true;\n\t\t\tTweenMax.set(this.refBg, { visibility: 'visible', pointerEvents: 'all', force3D: true });\n\t\t\tTweenMax.to(this.refBg, 0.45, { opacity: 0.18, force3D: true });\n\t\t\tTweenMax.set(this.refSearchWrapper, { visibility: 'visible', pointerEvents: 'all', force3D: true });\n\t\t\tTweenMax.to(this.refSearchWrapper, 0.45, { opacity: 1, yPercent: 0, ease: EASE_CUSTOM_IN_OUT, force3D: true });\n\t\t\tTweenMax.to(this.refSearchInnerWrapper, 0.5, { opacity: 1, force3D: true });\n\t\t\tTweenMax.to(this.refSearchInnerWrapper, 0.6, {\n\t\t\t\ty: 0,\n\t\t\t\tease: EASE_CUSTOM_IN_OUT,\n\t\t\t\tforce3D: true,\n\t\t\t\tonComplete: () => {\n\t\t\t\t\tthis.searchInput.focus();\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\tdocument.removeEventListener('keydown', this.keyHandler);\n\t\t\tdocument.body.classList.remove('search-open');\n\t\t\tif (e.currentTarget !== undefined) e.currentTarget.attributes['aria-pressed'] = false;\n\t\t\tthis.visible = false;\n\t\t\tTweenMax.to(this.refBg, 0.45, { autoAlpha: 0, force3D: true });\n\t\t\tTweenMax.set(this.refBg, { pointerEvents: 'none' });\n\t\t\tTweenMax.to(this.refSearchWrapper, 0.45, { autoAlpha: 0, yPercent: -50, ease: EASE_CUSTOM_IN_OUT, force3D: true });\n\t\t\tTweenMax.to(this.refSearchInnerWrapper, 0.25, { opacity: 0, force3D: true });\n\t\t\tTweenMax.to(this.refSearchInnerWrapper, 0.45, { y: -100, ease: EASE_CUSTOM_IN_OUT, force3D: true });\n\t\t\tTweenMax.set(this.refSearchWrapper, { pointerEvents: 'none' });\n\t\t}\n\t};\n\n\tprivate hideSearch = () => {\n\t\tif (this.visible) {\n\t\t\tthis.toggleSearch(this);\n\t\t}\n\t};\n\n\tprivate shiftthefocus = event => {\n\t\tif (event.key == 'Enter') {\n // @ts-ignore\n\t\t\tvar searchquery = event.target.value;\n\t\t\twindow.location.href = '/' + Globals.CURRENT_LANGUAGE_PREFIX + 'search#all=1&allType=1&s=' + searchquery;\n\t\t}\n\t};\n\n\tprivate shiftthetabindexofsearch = event => {\n\t\tif (event.key == 'Enter') {\n\t\t\tdocument.getElementById('searchCloseiconbtn').setAttribute('tabindex', '0');\n\t\t}\n\t};\n\n\tprivate shiftthetabindexofsearchtab = event => {\n\t\tif (event.key == 'Enter') {\n\t\t\tdocument.getElementById('searchCloseiconbtn').setAttribute('tabindex', '-1');\n\t\t}\n\t};\n\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t\t\t (this.refBg = ref)} className={styles.searchBg} />\n\t\t\t\t
\n\t\t\t\t
(this.refSearchWrapper = ref)} className={styles.searchWrapper} id=\"searchWrapper\">\n\t\t\t\t\t
(this.refSearchInnerWrapper = ref)} className={styles.innerWrapper + ' container-padding'}>\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
{\n\t\t\t\t\t\t\t\tthis.searchInput = ref;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tplaceholder={this.props.intl.formatMessage({ id: 'Search' })}\n\t\t\t\t\t\t\tid=\"st-search-input\"\n\t\t\t\t\t\t\tclassName=\"st-search-input\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonKeyDown={this.shiftthefocus}\n onChange={this.showAllResultsLink}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t
\n \n\t\t\t\t\t\t\t \n \n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\n\t\t);\n\t}\n\n\tprivate keyHandler = evt => {\n\t\tevt = evt || window.event;\n\t\tvar isEscape = false;\n\t\tif ('key' in evt) {\n\t\t\tisEscape = evt.key === 'Escape' || evt.key === 'Esc';\n\t\t} else {\n\t\t\tisEscape = evt.keyCode === 27;\n\t\t}\n\t\tif (isEscape) {\n\t\t\tthis.hideSearch();\n\t\t}\n\t};\n}\n\nexport default injectIntl(Search);\n","import * as React from 'react';\n\nimport * as styles from './MainMenu.module.scss';\nimport { getActiveMenu, parseSecondaryMenus, SecondaryMenusParsed } from '../MobileMenu/MobileMenuHelpers';\nimport { MainMenuPreviewItem } from './MainMenuPreviewItem';\nimport { FormattedMessage, WrappedComponentProps } from 'react-intl';\nimport DarkModeToggle from '../../ui/DarkModeToggle';\nimport SelectLanguage from '../SelectLanguage';\nimport Search from '../Search/Search';\nimport { Link } from 'gatsby';\nimport { graphql, PageProps } from 'gatsby';\n\nconst initialState = { activeMenuIndexes: new Array(5), selectedID: '', currentPreviewURL: '', menuData: null, mapListMode: true, hidePreviewWrapper: false, activeItem: null, isOptionsOpen: false, setInitOverflow: null, animate: 0 };\ntype State = Readonly
& { menuData: { [key: string]: ResultItem } };\n\nexport type ResultItem = {\n\tcontentful_id: string;\n\ttitle: string;\n\tphone: string;\n\tfax: string;\n\temail: string;\n\tnode_locale: string;\n\ttype: string[] | null;\n\tct: string;\n\tentityDescription?: {\n\t\tentityDescription?: string;\n\t};\n\tsubtitle?: {\n\t\tsubtitle?: string;\n\t};\n\tfilterEntity?: {\n\t\tslug: string;\n\t\ttitle: string;\n\t};\n\tfilterVerticalCategory?: any;\n\tfilterProgramType?: {\n\t\ttitle: string;\n\t};\n\topeningHours?: any;\n\tlocation: {\n\t\tcontentful_id: string;\n\t\tplaceName: string;\n\t\tplaceAddress: string;\n\t\tplaceLocation?: {\n\t\t\tlon: number;\n\t\t\tlat: number;\n\t\t};\n\t};\n\theroImage?: any;\n};\n\nexport class MainMenu extends React.Component<\n\t{\n children?: any;\n\t\tprograms: any;\n\t\tplaces: any;\n\t\tentities: any;\n\t\tdata: PageProps[];\n\t\tcurrLanguage: any;\n\t\topen: boolean;\n\t\tfooterCopyrightMessage: string;\n\t\tcloseHandler: (event) => void;\n\t\tid?: any;\n location?: any;\n langs?: any;\n currPageTitle?: any;\n alternateURL?: any;\n pageContext?: any;\n handleMap?: (event) => void;\n\t} & WrappedComponentProps,\n\tState\n> {\n\treadonly state: State = initialState;\n\t//@ts-ignore:\n\tprivate refLogo: Link;\n\t//@ts-ignore:\n\tprivate refMenuItemPreviewWrapper: HTMLDivElement;\n\n\t//@ts-ignore:\n\tprivate mobileMode = false;\n\n\tprivate activeMenu: PageProps;\n //@ts-ignore:\n private refMenuItemPreview: MainMenuPreviewItem;\n \n\t//For holding parsed sub menu data sets (see componentDidUpdate):\n\tprivate secondaryMenusData: SecondaryMenusParsed = [[], [], [], [], []]; //Needs to match the 3 verticals + map = 4\n\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tif (typeof window !== 'undefined') {\n\t\t\tfetch('/menupreviews.json')\n .then((resp) => resp.json())\n .then((response) => {\n\t\t\t\tthis.setState({ menuData: response });\n\t\t\t});\n\t\t}\n\n\t\tthis.activeMenu = getActiveMenu(this.props.data, this.props.currLanguage);\n parseSecondaryMenus(this.secondaryMenusData, this.props.currLanguage, this.props.programs, this.props.places, this.props.entities, this.activeMenu['mapCategories'], this.props.intl);\n\t}\n\n componentDidMount(): void {\n const subMenuWrapper = typeof document !== 'undefined' && document.getElementById(\"subMenuWrapper\");\n\n if(subMenuWrapper) {\n subMenuWrapper.setAttribute('data-wobble', '1')\n setTimeout(() => {\n subMenuWrapper.setAttribute('data-wobble', '0')\n }, 700);\n }\n\n this.setState({\n setInitOverflow: this.props.currLanguage.link === '/ar' ? 'left' : 'right'\n })\n }\n\n componentDidUpdate(prevProps): void {\n if(this.props.location.pathname !== prevProps.location.pathname) {\n // @ts-ignore\n typeof document !== 'undefined' && document.querySelectorAll('.toggleOptions').forEach( x=> x.setAttribute(\"aria-expanded\", \"false\"));\n\n this.activeMenu = getActiveMenu(this.props.data, this.props.currLanguage);\n parseSecondaryMenus(this.secondaryMenusData, this.props.currLanguage, this.props.programs, this.props.places, this.props.entities, this.activeMenu['mapCategories'], this.props.intl);\n\n if(typeof document !== 'undefined' && document.querySelector('.overlay_dark')) {\n document.querySelector('.overlay_dark').remove();\n document.getElementsByTagName(\"html\")[0].style.overflowY = 'auto';\n }\n }\n typeof document !== 'undefined' && document.getElementById(\"close-megamenu\") && document.getElementById(\"close-megamenu\").addEventListener(\"click\", this.handleClick);\n }\n\n private isTapStory = () => {\n\t\tconst splitLocation = this.props.location.pathname.split(\"/\").filter(split => split != \"\")\n if(this.props.langs[1].selected)\n splitLocation.pop()\n\t\treturn splitLocation.includes(\"tap\") && splitLocation.length >= 3\n\t}\n\n private handleAccessibilityWidget = (event) => {\n if (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n if (event.type == 'keydown') {\n if (event.keyCode == 13) {\n // @ts-ignore\n typeof UserWay !== 'undefined' && UserWay.widgetOpen()\n } else if(event.shiftKey && event.keyCode == 9) {\n document.getElementById('moreMenu').focus();\n } else {\n document.getElementById('toggleTheme').focus();\n }\n } else {\n // @ts-ignore\n typeof UserWay !== 'undefined' && UserWay.widgetOpen()\n }\n }\n\n private setActiveClass = (e) => {\n const parentItems = e.target.parentNode.parentNode.children\n e.target.parentNode.parentNode.parentNode.parentNode.setAttribute('data-activesubmenu', e.target.dataset.id)\n \n for (var i = 0; i < parentItems.length; i++) {\n parentItems[i].removeAttribute('id')\n if(parentItems[i].querySelector('a'))\n parentItems[i].querySelector('a').className = ''\n }\n if(e.target.nodeName === 'A') {\n e.target.className = styles.activeMenu\n } else {\n return true\n }\n\n e.target.parentNode.setAttribute(\"id\", \"active\")\n }\n\n private tertiaryMenuItemClicked = (event) => {\n this.setActiveClass(event)\n\t\tconst dataLink = event.target.getAttribute('data-link')\n\t\tif (!dataLink && event) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\t// const menuItemIndex = parseInt(event.target.dataset.index);\n\t\tconst menuItemID = event.target.dataset.id + (this.props.currLanguage.link === '/ar' ? '___ar-QA' : '');\n\t\tif (menuItemID) {\n\t\t\tthis.setState({ selectedID: menuItemID, currentPreviewURL: event.target.getAttribute('href') });\n\t\t}\n\t\t\n\t\tif (dataLink) {\n\t\t\tdocument.getElementById(\"close-menu\").click();\n\t\t\tthis.setState({ hidePreviewWrapper: true });\n\t\t} else {\n\t\t}\n\t};\n \n private toggleOptions = (e, megaMenu) => {\n var elem = e.target.tagName === 'path' ? e.target.parentElement.parentElement : e.target.tagName === 'svg' ? e.target.parentElement : e.target\n var x = elem.getAttribute(\"aria-expanded\");\n if(x !== null) {\n var overlay = typeof document !== 'undefined' && document.createElement('div');\n var theSpan = typeof document !== 'undefined' && document.createElement(\"span\"); \n theSpan.id = 'close-megamenu'\n theSpan.className = 'closeMegamenu'\n \n if (x == \"true\") {\n x = \"false\"\n if(document.querySelector('.overlay_dark')) {\n document.querySelector('.overlay_dark').remove();\n document.getElementsByTagName(\"html\")[0].style.overflowY = 'auto';\n }\n document.documentElement.classList.remove('megamenuOpen');\n } else {\n x = \"true\"\n if(megaMenu) {\n overlay.className = 'overlay_dark';\n if(!document.querySelector('.overlay_dark')) {\n overlay.appendChild(theSpan); \n document.querySelector('body').prepend(overlay);\n document.getElementsByTagName(\"html\")[0].style.overflowY = 'hidden';\n }\n document.documentElement.classList.add('megamenuOpen');\n }\n }\n // @ts-ignore\n document.querySelectorAll('.toggleOptions').forEach( x=> x.setAttribute(\"aria-expanded\", \"false\"));\n elem.setAttribute(\"aria-expanded\", x);\n \n if(megaMenu) {\n var activeItem = elem.nextElementSibling?.querySelectorAll('ul > div#secondaryMenuList > li#active > a')[0];\n if(activeItem) {\n elem.nextElementSibling?.querySelectorAll('ul > div#secondaryMenuList > li#active > a')[0]?.click()\n } else {\n elem.nextElementSibling?.querySelectorAll('ul > div#secondaryMenuListGrid > li:nth-child(2) > a')[0]?.click()\n }\n }\n }\n };\n\n private handleClick = () => {\n document.querySelectorAll('.secondaryMenuClass').forEach( x=> x.animate([\n { height: `80%` },\n { height: `0%` }\n \n ], {\n duration: 300 //Dunno if can be Infinite\n }\n )\n );\n\n setTimeout(() => {\n // @ts-ignore\n document.querySelectorAll('.toggleOptions').forEach( x=> x.setAttribute(\"aria-expanded\", \"false\"));\n if(document.querySelector('.overlay_dark')) {\n document.querySelector('.overlay_dark').remove();\n document.getElementsByTagName(\"html\")[0].style.overflowY = 'auto';\n document.documentElement.classList.remove('megamenuOpen');\n }\n }, 300);\n }\n\n\tpublic render() {\n var pathArray = this.props.location.pathname.split('/');\n var subMenuPath = [\n { path: 'education/', index: 0, style: 'purple' }, \n { path: '/education', index: 0, style: 'purple' },\n { path: 'ar/education/', index: 0, style: 'purple' }, \n { path: '/ar/education', index: 0, style: 'purple' },\n { path: 'research/', index: 1, style: 'blue' }, \n { path: '/research', index: 1, style: 'blue' },\n { path: 'ar/research/', index: 1, style: 'blue' }, \n { path: '/ar/research', index: 1, style: 'blue' },\n { path: 'community/', index: 2, style: 'red' }, \n { path: '/community', index: 2, style: 'red' },\n { path: 'ar/community/', index: 2, style: 'red' }, \n { path: '/ar/community', index: 2, style: 'red' }\n ]\n\n let arrayIndex = this.props.currLanguage.link === '/ar' ? 2 : 1\n let arrayPos = this.props.currLanguage.link === '/ar' ? 3 : 2\n\n\t\treturn (\n <>\n \n >\n\t\t);\n\t}\n}\n\nexport const query = graphql`\n\tfragment MainMenu on ContentfulMenu {\n\t\tnode_locale\n\t\ttwitterLink\n\t\tinstagramLink\n\t\tmenuItems {\n\t\t\tid\n\t\t\tlabel\n\t\t\tpath\n\t\t\tsubpages {\n\t\t\t\t... on ContentfulPageEducationCitySpeakerSeries {\n id\n slug\n title\n }\n ... on ContentfulPageVertical {\n id\n title\n slug\n }\n ... on ContentfulMenuItem {\n id\n label\n path\n subpages {\n ... on ContentfulPageVertical {\n id\n title\n slug\n }\n }\n }\n\t\t\t}\n introText\n\t\t}\n\t\tsecondaryMenuItems {\n\t\t\tid\n\t\t\ttitle\n\t\t\tpath\n\t\t}\n\t\tmapCategories {\n\t\t\ttitle\n\t\t\tid\n\t\t\treferences {\n\t\t\t\tcontentful_id\n\t\t\t\ttitle\n\t\t\t\tslug\n\t\t\t\tfilterVerticalCategory {\n\t\t\t\t\ttitle\n\t\t\t\t\tslug\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n`;\n","import * as React from 'react';\nimport { WrappedComponentProps, injectIntl } from 'react-intl';\nimport * as styles from './MobileMenuSocialCopyright.module.scss';\ninterface Props {\n pageContext?: any;\n\tchildren?: any; \n\trefSocialLinks?: HTMLAnchorElement[]; \n\tfooterCopyrightMessage?: string; \n\ttwitterLink?: string; \n\tinstagramLink?: string;\n\tconnectModule?: boolean;\n alternateURL?: string;\n langs?: any;\n}\n\nclass MobileMenuSocialCopyright extends React.Component {\n\trender() {\n\t\treturn (\n\t\t\t\n\t\t);\n\t}\n}\n\nexport default injectIntl(MobileMenuSocialCopyright);","import * as React from 'react';\nimport { Link } from 'gatsby';\n\n// Since DOM elements cannot receive activeClassName,\n// destructure the prop here and pass it only to Link\nconst GatsbyLinkExternalSupport = ({ children, to, ...other }: any) => {\n\t// Tailor the following test to your environment.\n\t// This example assumes that any internal link (intended for Gatsby)\n\t// will start with exactly one slash, and that anything else is external.\n\tconst internal = /^\\/(?!\\/)/.test(to as string);\n\n\t// Use Gatsby Link for internal links, and for others\n\tif (internal && !other.openinnewtab) {\n\t\treturn (\n\t\t\t\n\t\t\t\t{children}\n\t\t\t\n\t\t);\n\t}\n\treturn (\n\t\t\n\t\t\t{children}\n\t\t\n\t);\n};\n\nexport default GatsbyLinkExternalSupport;\n","import * as React from 'react';\n\nimport * as styles from './MobileMenuSubMenu.module.scss';\nimport { TimelineMax } from 'gsap/dist/gsap.min';\nimport { EASE_CUSTOM_IN_OUT } from '../../utils/Constants';\nimport { Link } from 'gatsby';\nimport { FormattedMessage } from 'react-intl';\nimport GatsbyLinkExternalSupport from '../../ui/GatsbyLinkExternalSupport';\n\nexport type SubMenuItem = { node?: any; title?: string; contentful_id?: string; id: string; label?: string; slug?: string; path?: string };\nconst initialState = { vertical: null };\ntype State = Readonly;\n\nexport class MobileMenuSubMenu extends React.Component<{\n children?: any;\n\tisMainMenu: boolean;\n\tmapActive?: boolean;\n\tfirstMenuItems?: SubMenuItem[];\n\tsecondaryMenuItems?: SubMenuItem[];\n\tfirstMenuItemsClickHandler?: (event) => void;\n\tsecondaryMenuItemsClickHandler?: (event) => void;\n\tmapClickHandler?: (event) => void;\n\trefListItemsArray: HTMLLIElement[];\n\tshowLengthOnSecondaryItems?: boolean;\n\twrapperClass?: string;\n\tactiveIndex: number;\n\tcloseCallback: (event) => void;\n\tanimationDirection: 1 | -1;\n isMap?: boolean;\n currLang?: string;\n selectedVertical?: string;\n selectedItem?: string;\n total?: number;\n verticalClass?: string;\n isThirdLevelMenu?: boolean;\n intl?: any;\n}, State> {\n readonly state: State = initialState;\n\t// Animation variables:\n\tprivate xItemsOut = -150;\n\n\tprivate refListItems: HTMLLIElement[] = [];\n private refAdditionalListItems: HTMLLIElement[] = [];\n\tprivate refWrapper: HTMLDivElement;\n\t//@ts-ignore:\n\tprivate refList: HTMLUListElement;\n\n\tprivate timeline: TimelineMax;\n\n\tprivate visible = false;\n\n\tpublic show = (instant = false) => {\n\t\tif (!this.visible) {\n\t\t\tthis.visible = true;\n\n\t\t\tif (this.timeline) {\n\t\t\t\tthis.timeline.kill();\n\t\t\t\tthis.timeline = null;\n\t\t\t}\n\n\t\t\tthis.timeline = new TimelineMax();\n\t\t\tthis.timeline.set(this.refWrapper, { display: 'block' });\n\t\t\tthis.timeline.to(this.refWrapper, 0.4, { opacity: 1, pointerEvents: 'all', force3D: true });\n\t\t\tthis.timeline.staggerTo(this.refListItems, 0.85, { x: 0, ease: EASE_CUSTOM_IN_OUT, force3D: true }, 0.05, 0);\n\t\t\tthis.timeline.staggerTo(this.refListItems, 0.85, { opacity: 1, force3D: true }, 0.05, 0.35);\n\n this.timeline.staggerTo(this.refAdditionalListItems, 0.85, { x: 0, ease: EASE_CUSTOM_IN_OUT, force3D: true }, 0.05, 0);\n\t\t\tthis.timeline.staggerTo(this.refAdditionalListItems, 0.85, { opacity: 1, force3D: true }, 0.05, 0.35);\n\n\t\t\tif (instant) {\n\t\t\t\tthis.timeline.progress(1);\n\t\t\t}\n\t\t}\n\t};\n\n\tpublic hide = (instant = false) => {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\n\t\t\tif (this.timeline) {\n\t\t\t\tthis.timeline.kill();\n\t\t\t\tthis.timeline = null;\n\t\t\t}\n\n\t\t\tthis.timeline = new TimelineMax();\n\t\t\tthis.timeline.set(this.refWrapper, { pointerEvents: 'none' });\n\t\t\t// this.timeline.to(this.refListItems, 0.4, {opacity: 0, force3D: true);\n\t\t\tthis.timeline.to(this.refWrapper, 0.3, { opacity: 0, force3D: true }, 0);\n\t\t\tthis.timeline.set(this.refListItems, { opacity: 0, x: this.xItemsOut * this.props.animationDirection, force3D: true });\n this.timeline.set(this.refAdditionalListItems, { opacity: 0, x: this.xItemsOut * this.props.animationDirection, force3D: true });\n\t\t\tthis.timeline.set(this.refWrapper, { display: 'none' });\n\t\t\tif (instant) {\n\t\t\t\tthis.timeline.progress(1);\n\t\t\t}\n\t\t}\n\t};\n\n\tpublic getWidth = () => {\n\t\tthis.refWrapper.style.display = 'block';\n\t\treturn this.refWrapper.clientWidth;\n\t};\n\n\tprivate shiftthemenufocus = event => {\n\t\tif (event.key == 'Enter') {\n\t\t\tthis.props.firstMenuItemsClickHandler;\n\t\t}\n\t};\n\n\tpublic shiftthemenufocus1 = event => {\n\t\tvar parent = event.target.parentElement.firstChild.getAttribute(\"href\")\n\n\t\tif (event.key == 'Enter') {\n\t\t\tif (parent == '#map') {\n\t\t\t\tthis.props.mapClickHandler;\n window.setTimeout(() => {\n document.getElementById('mapMenu').getElementsByTagName('ul')[0].focus();\n }, 0);\n\t\t\t} else {\n\t\t\t\tthis.props.secondaryMenuItemsClickHandler(event);\n\t\t\t}\n\t\t}\n\t};\n\n componentDidUpdate(): void {\n if(this.props.selectedVertical) {\n let elems = document.querySelectorAll(\".selectedVertical\");\n for (let i = 0; i < elems.length; i++) {\n // @ts-ignore\n elems[i].textContent = this.props.intl.formatMessage({ id: this.props.selectedVertical })\n elems[i].setAttribute(\"data-color\", this.props.verticalClass)\n\n var newSpan = document.createElement('span');\n if(this.props.selectedItem) {\n newSpan.className = 'selectedMenuVerticalItem'\n newSpan.id = 'selectedMenuVerticalItem'\n elems[i].appendChild(newSpan);\n newSpan.textContent = \" / \" + this.props.intl.formatMessage({ id: this.props.selectedItem }) + \" (\" + this.props.total + \")\";\n }\n }\n\n let ulelems = document.querySelectorAll(\"#ullistmenu\");\n for (let i = 0; i < ulelems.length; i++) ulelems[i].className = styles[this.props.verticalClass];\n\n let intro_index = 0;\n if(this.props.verticalClass === 'purple') {\n intro_index = 1\n } else if(this.props.verticalClass === 'red') {\n intro_index = 2\n } else if(this.props.verticalClass === 'orange') {\n intro_index = 3\n }\n\n let intro = document.querySelectorAll(\"#intro\");\n // @ts-ignore\n for (let i = 0; i < intro.length; i++) intro[i].innerHTML = document.getElementById('vertical-' + intro_index).innerText;\n }\n }\n\n private toggleOptions = (e) => {\n e.preventDefault();\n var elem = e.target.tagName === 'path' ? e.target.parentElement.parentElement : e.target.tagName === 'svg' ? e.target.parentElement : e.target\n var x = elem.getAttribute(\"aria-expanded\")\n if(x !== null) {\n var theSpan = typeof document !== 'undefined' && document.createElement(\"span\"); \n theSpan.id = 'close-megamenu'\n theSpan.className = 'closeMegamenu'\n \n if (x == \"true\") {\n x = \"false\"\n document.documentElement.classList.remove('megamenuOpen');\n } else {\n x = \"true\"\n }\n // @ts-ignore\n document.querySelectorAll('.toggleOptions').forEach( x=> x.setAttribute(\"aria-expanded\", \"false\"));\n elem.setAttribute(\"aria-expanded\", x);\n }\n };\n\n\tpublic render() {\n\t\tconst secondaryStartIndex = this.props.firstMenuItems ? this.props.firstMenuItems.length : 0;\n\t\treturn (\n\t\t\t (this.refWrapper = ref)}\n\t\t\t\tclassName={`${styles.wrapper} ${this.props.wrapperClass ? this.props.wrapperClass : ''} ${this.props.activeIndex > -1 ? styles.hasSelection : ''}`}\n\t\t\t>\n\t\t\t\t\n\t\t\t
\n\t\t);\n\t}\n}","import * as React from 'react';\n\nimport * as styles from './MobileMenuSubMenu.module.scss';\nimport * as stylesPreview from './MobileMenuPreviewItem.module.scss';\nimport { TimelineMax } from 'gsap/dist/gsap.min';\nimport { FormattedMessage } from 'react-intl';\nimport { ResultItem } from './MobileMenu';\nimport { GatsbyImageWrapper } from '../ui/GatsbyImageWrapper';\nimport { Globals } from '../../utils/Globals';\n\nexport class MobileMenuPreviewItem extends React.Component<{ currentID: string; url: string; currentLanguage: string; menuData: { [key: string]: ResultItem }; closeCallback: (event) => void; isDesktop?: boolean; }> {\n\tprivate refWrapper: HTMLDivElement;\n\n\tprivate timeline: TimelineMax;\n\n\tprivate visible = false;\n\n\tprivate currData: ResultItem = undefined;\n\n\tpublic show = instant => {\n\t\tif (!this.visible) {\n\t\t\tthis.visible = true;\n\n\t\t\tif (this.timeline) {\n\t\t\t\tthis.timeline.kill();\n\t\t\t\tthis.timeline = null;\n\t\t\t}\n\n\t\t\tthis.timeline = new TimelineMax();\n\t\t\tthis.timeline.set(this.refWrapper, { display: 'block' });\n\t\t\tthis.timeline.to(this.refWrapper, 0.4, { opacity: 1, pointerEvents: 'all', force3D: true });\n\t\t\tif (instant) {\n\t\t\t\tthis.timeline.progress(1);\n\t\t\t}\n\t\t}\n\t};\n\n\tpublic hide = instant => {\n\t\tif (this.visible) {\n\t\t\tthis.visible = false;\n\n\t\t\tif (this.timeline) {\n\t\t\t\tthis.timeline.kill();\n\t\t\t\tthis.timeline = null;\n\t\t\t}\n\n\t\t\tthis.timeline = new TimelineMax();\n\t\t\tthis.timeline.set(this.refWrapper, { pointerEvents: 'none' });\n\t\t\tthis.timeline.to(this.refWrapper, 0.3, { opacity: 0, force3D: true }, 0);\n\t\t\tthis.timeline.set(this.refWrapper, { display: 'none' });\n\t\t\tif (instant) {\n\t\t\t\tthis.timeline.progress(1);\n\t\t\t}\n\t\t}\n\t};\n\n\tpublic getWidth = () => {\n\t\tthis.refWrapper.style.display = 'block';\n\t\treturn this.refWrapper.clientWidth;\n\t};\n\n\tpublic render() {\n\t\tif (this.props.menuData && this.props.currentID !== '') {\n\t\t\tif (Globals.CURRENT_LANGUAGE_PREFIX === 'ar/') {\n\t\t\t\tif (!this.props.currentID.includes('___ar-QA')) {\n\t\t\t\t\tthis.currData = this.props.menuData[this.props.currentID + '___ar-QA'];\n\t\t\t\t} else {\n\t\t\t\t\tthis.currData = this.props.menuData[this.props.currentID];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this.props.currentID.includes('___ar-QA')) {\n\t\t\t\t\tthis.currData = this.props.menuData[this.props.currentID.replace(/___ar-QA/g, '')];\n\t\t\t\t} else {\n\t\t\t\t\tthis.currData = this.props.menuData[this.props.currentID];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst type = this.currData && this.currData.type && this.currData.type.length > 0 ? this.currData.type[0] : undefined;\n\t\tconst description =\n\t\t\tthis.currData &&\n\t\t\t(this.currData.ct === 'entity'\n\t\t\t\t? this.currData.entityDescription\n\t\t\t\t\t? this.currData.entityDescription.entityDescription\n\t\t\t\t\t: undefined\n\t\t\t\t: this.currData.subtitle\n\t\t\t\t? this.currData.subtitle.subtitle\n\t\t\t\t: undefined);\n\n\t\treturn (\n\t\t\t (this.refWrapper = ref)} className={`${styles.wrapper} ${this.props.isDesktop ? stylesPreview.mainMenuPreviewDesktopWrapper : '' } ${styles.mainMenuPreviewWrapper}`}>\n\t\t\t\t
\n\t\t\t\t\t{this.currData && (\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t{this.currData.heroImage && (\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{type && (\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t{this.currData.filterVerticalCategory && }\n\t\t\t\t\t\t\t\t\t\t{this.currData.filterVerticalCategory && {this.currData.filterVerticalCategory.title}}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t{this.currData.title}\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t{description && (\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t)}\n\t\t\t\t
\n\t\t\t
\n\t\t);\n\t}\n}\n","// @ts-nocheck\nconst API_KEY = 'AIzaSyDcaRAmXxf0YNrhHPuf56dzjHiBvysQB_M';\n\nexport default class MapLoader {\n\tprivate static promise;\n\tmap: google.maps.Map;\n\n\tpublic static load() {\n\t\tif (!MapLoader.promise) {\n\t\t\t// load once\n\t\t\tMapLoader.promise = new Promise(resolve => {\n\t\t\t\twindow['__onGapiLoaded'] = () => {\n\t\t\t\t\t//console.log('gapi loaded');\n\t\t\t\t\t//@ts-ignore:\n\t\t\t\t\tresolve(window.gapi);\n\t\t\t\t};\n\t\t\t\t// console.log('loading..');\n\t\t\t\tconst node = document.createElement('script');\n\t\t\t\tnode.src = 'https://maps.googleapis.com/maps/api/js?key=' + API_KEY + '&callback=__onGapiLoaded';\n\t\t\t\tnode.type = 'text/javascript';\n\t\t\t\tdocument.getElementsByTagName('body')[0].appendChild(node);\n\t\t\t});\n\t\t}\n\n\t\treturn MapLoader.promise;\n\t}\n\n\tpublic initMap = () => {\n\t\treturn MapLoader.load().then(() => {\n\t\t\t//@ts-ignore:\n\t\t\twindow.GOOGLE_MAPS_LOADED = true;\n\t\t\t//@ts-ignore:\n\t\t\tif (window.GOOGLE_MAPS_LOADED_CACALLBACK) {\n\t\t\t\t//@ts-ignore:\n\t\t\t\twindow.GOOGLE_MAPS_LOADED_CACALLBACK();\n\t\t\t}\n\t\t});\n\t};\n}\n","// @ts-nocheck\nimport * as React from 'react';\nimport * as styles from './Map.module.scss';\nimport { ResultItem } from './MobileMenu';\nimport { WrappedComponentProps, injectIntl } from 'react-intl';\n\nclass Map extends React.Component<\n\t{ className: string; menuData: { [key: string]: ResultItem }; currentLanguage: string; open: boolean; activeMarkerID: string; activeMarker: object } & WrappedComponentProps\n> {\n\tprivate map: any;\n\tprivate wrapper: HTMLDivElement;\n\tprivate markersAdded = false;\n\tprivate currentMarkers: google.maps.Marker[] = [];\n\n\tprivate currentActiveMarker = null;\n\tprivate windowWidth: number;\n\tprivate panBy: number = 0;\n\n\tprivate infoWindow = null;\n\n\tprivate setDarkTheme = async () => {\n\t\tlet mapThemeData = [\n\t\t\t{\n\t\t\t\telementType: 'geometry',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#212121'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\telementType: 'labels.icon',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#757575'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\telementType: 'labels.text.stroke',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#212121'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'administrative',\n\t\t\t\telementType: 'geometry',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#757575'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'administrative.country',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#9e9e9e'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'administrative.land_parcel',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'administrative.locality',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#bdbdbd'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'poi',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#757575'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'poi.park',\n\t\t\t\telementType: 'geometry',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#181818'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'poi.park',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#616161'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'poi.park',\n\t\t\t\telementType: 'labels.text.stroke',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#1b1b1b'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road',\n\t\t\t\telementType: 'geometry.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#2c2c2c'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#8a8a8a'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.arterial',\n\t\t\t\telementType: 'geometry',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#373737'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.highway',\n\t\t\t\telementType: 'geometry',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#3c3c3c'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.highway.controlled_access',\n\t\t\t\telementType: 'geometry',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#4e4e4e'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.local',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#616161'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'transit',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#757575'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'water',\n\t\t\t\telementType: 'geometry',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#000000'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'water',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcolor: '#3d3d3d'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t];\n\t\tthis.map.setOptions({ styles: mapThemeData });\n\t};\n\n\tprivate setLightTheme = async () => {\n\t\tlet mapThemeData = [\n\t\t\t{\n\t\t\t\tfeatureType: 'administrative',\n\t\t\t\telementType: 'labels',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'on'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgamma: '1.82'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'administrative',\n\t\t\t\telementType: 'labels.text.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'on'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgamma: '1.96'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlightness: '-9'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'administrative',\n\t\t\t\telementType: 'labels.text.stroke',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'landscape',\n\t\t\t\telementType: 'all',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'on'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlightness: '25'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgamma: '1.00'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tsaturation: '-100'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'poi.business',\n\t\t\t\telementType: 'all',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'poi.park',\n\t\t\t\telementType: 'all',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road',\n\t\t\t\telementType: 'geometry.stroke',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road',\n\t\t\t\telementType: 'labels.icon',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.highway',\n\t\t\t\telementType: 'geometry',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\thue: '#ffaa00'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tsaturation: '-43'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'on'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.highway',\n\t\t\t\telementType: 'geometry.stroke',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.highway',\n\t\t\t\telementType: 'labels',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'simplified'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\thue: '#ffaa00'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tsaturation: '-70'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.highway.controlled_access',\n\t\t\t\telementType: 'labels',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'on'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.arterial',\n\t\t\t\telementType: 'all',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'on'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tsaturation: '-100'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlightness: '30'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'road.local',\n\t\t\t\telementType: 'all',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tsaturation: '-100'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlightness: '40'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'transit.station.airport',\n\t\t\t\telementType: 'geometry.fill',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'on'\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgamma: '0.80'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tfeatureType: 'water',\n\t\t\t\telementType: 'all',\n\t\t\t\tstylers: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvisibility: 'off'\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t];\n\t\tthis.map.setOptions({ styles: mapThemeData });\n\t};\n\n\tprivate mapsAPILoadedCallback = async () => {\n\t\tthis.map = new google.maps.Map(this.wrapper, {\n\t\t\tcenter: { lat: 25.313964, lng: 51.4394043 },\n\t\t\tzoom: 15,\n\t\t\tdisableDefaultUI: true\n\t\t});\n\t\tthis.map.panBy(this.panBy, 0);\n\t\tlet darkMode = document.body.classList.contains('dark-mode');\n\t\tif (darkMode) {\n\t\t\twindow.google && this.setDarkTheme();\n\t\t} else {\n\t\t\twindow.google && this.setLightTheme();\n\t\t}\n\t\tthis.setupMarkers();\n\t};\n\n\tprivate setPanBy = () => {\n\t\tlet desktop = this.props.currentLanguage === 'ar-QA' ? 730 : -730;\n\t\tlet mobile = this.props.currentLanguage === 'ar-QA' ? 431 : -431;\n\t\tthis.windowWidth = window.innerWidth;\n\t\tthis.panBy = desktop * 0.5;\n\t\tif (this.windowWidth < 768) {\n\t\t\tthis.panBy = desktop * 0.5;\n\t\t} else if (this.windowWidth < 1380) {\n\t\t\tthis.panBy = mobile * 0.5;\n\t\t}\n\t};\n\n\tprivate setupMarkers = () => {\n\t\tif (this.map && this.props.menuData && this.markersAdded === false) {\n\t\t\tif (this.currentMarkers.length >= 0) {\n\t\t\t\tObject.values(this.currentMarkers).forEach(marker => marker.setMap(null));\n\t\t\t\tthis.currentMarkers = [];\n\t\t\t}\n\n\t\t\tconst values = Object.values(this.props.menuData);\n\t\t\tvalues.forEach(node => {\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (node.node_locale === this.props.currentLanguage && node.location && node.location.placeLocation) {\n\t\t\t\t\tlet marker = new google.maps.Marker({\n\t\t\t\t\t\t// @ts-ignore\n\t\t\t\t\t\tposition: { lat: node.location.placeLocation.lat, lng: node.location.placeLocation.lon },\n\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\tpath: google.maps.SymbolPath.CIRCLE,\n\t\t\t\t\t\t\tscale: 6,\n\t\t\t\t\t\t\tstrokeWeight: 10,\n\t\t\t\t\t\t\tfillOpacity: 1,\n\t\t\t\t\t\t\tstrokeColor: '#ff2080',\n\t\t\t\t\t\t\tstrokeOpacity: 0,\n\t\t\t\t\t\t\tfillColor: '#E95C2F'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmap: this.map\n\t\t\t\t\t});\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tmarker.setTitle(node.location.placeName);\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tmarker.set('address', node.location.placeAddress);\n\t\t\t\t\tmarker.addListener('click', () => this.markerClickHandler(node));\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tthis.currentMarkers[node.contentful_id] = marker;\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.markersAdded = true;\n\t\t\tif (this.currentMarkers[this.props.activeMarkerID]) this.highlightActiveMarker();\n\t\t}\n\t};\n\n\tprivate highlightActiveMarker = () => {\n\t\tlet newMarker = null;\n\t\tlet curLang = this.props.currentLanguage === 'ar-QA' ? 'rtl' : 'ltr';\n\t\tif (this.props.activeMarkerID.includes('___ar-QA')) {\n\t\t\tnewMarker = this.currentMarkers[this.props.activeMarkerID.replace(/___ar-QA/g, '')];\n\t\t} else {\n\t\t\tnewMarker = this.currentMarkers[this.props.activeMarkerID];\n\t\t}\n\t\tif (this.currentActiveMarker && newMarker !== this.currentActiveMarker) {\n\t\t\tif (this.currentActiveMarker.getAnimation()) {\n\t\t\t\tthis.currentActiveMarker.setAnimation(null);\n\t\t\t\t// @ts-ignore\n\t\t\t\tif (!this.props.activeMarker.visible) {\n\t\t\t\t\tthis.infoWindow.close(this.map);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.currentActiveMarker = null;\n\t\t}\n\t\tif (newMarker) {\n\t\t\tthis.map.setZoom(16);\n\t\t\t// @ts-ignore\n\t\t\tthis.map.panTo(newMarker.position);\n\t\t\tthis.map.panBy(this.panBy, 0);\n\t\t\tthis.currentActiveMarker = newMarker;\n\t\t\tif (!this.currentActiveMarker.getAnimation()) {\n\t\t\t\tthis.currentActiveMarker.setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t}\n\n\t\t\tif (this.infoWindow) {\n\t\t\t\tthis.infoWindow.close();\n\t\t\t}\n\t\t\tthis.infoWindow = window.google && new google.maps.InfoWindow({ maxWidth: 300 });\n\t\t\tthis.infoWindow &&\n\t\t\t\tthis.infoWindow.setOptions({\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tcontent:\n\t\t\t\t\t\t\"\" +\n\t\t\t\t\t\t\"
\" +\n\t\t\t\t\t\tnewMarker.getTitle() +\n\t\t\t\t\t\t\"
',\n\t\t\t\t\t// @ts-ignore\n\t\t\t\t\tposition: newMarker.position,\n\t\t\t\t\tpixelOffset: new google.maps.Size(0, -25)\n\t\t\t\t});\n\t\t\tthis.infoWindow && this.infoWindow.open(this.map);\n\t\t}\n\t};\n\n\tprivate markerClickHandler = node => {\n\t\t//@ts-ignore:\n\t\twindow.location.hash = '#map-' + node.contentful_id;\n\t};\n\n\tcomponentDidUpdate(prevProps: Readonly<{ menuData: { [p: string]: ResultItem }; currentLanguage: string; activeMarkerID: string }>): void {\n\t\tlet darkMode = typeof document !== 'undefined' && document.body.classList.contains('dark-mode');\n\t\tif (prevProps.currentLanguage !== this.props.currentLanguage) {\n\t\t\tthis.markersAdded = false;\n\t\t}\n\t\tif (darkMode) {\n\t\t\twindow.google && this.setDarkTheme();\n\t\t} else {\n\t\t\twindow.google && this.setLightTheme();\n\t\t}\n\t\tthis.setPanBy();\n\t\tthis.setupMarkers();\n\t\tthis.highlightActiveMarker();\n\t}\n\n\tcomponentDidMount(): void {\n\t\tif ((window as any).GOOGLE_MAPS_LOADED !== true) {\n\t\t\t(window as any).GOOGLE_MAPS_LOADED_CACALLBACK = this.mapsAPILoadedCallback;\n\t\t} else {\n\t\t\tthis.mapsAPILoadedCallback();\n\t\t}\n\n\t\twindow.addEventListener('resize', this.resizeHandler);\n\t\tthis.resizeHandler();\n\t}\n\n\tcomponentWillUnmount() {\n\t\twindow.removeEventListener('resize', this.resizeHandler);\n\t}\n\n\tprivate resizeHandler = () => {\n\t\tthis.setPanBy();\n\t};\n\n\tpublic render() {\n\t\treturn (this.wrapper = ref)} className={`${styles.wrapper} ${this.props.open ? styles.open : ''} ${this.props.className}`} />;\n\t}\n}\n\n// @ts-ignore\nexport default injectIntl(Map);\n","import * as React from 'react';\n\nimport * as styles from './MobileMenu.module.scss';\nimport { TimelineMax, TweenMax } from 'gsap/dist/gsap.min';\nimport { EASE_CUSTOM_IN_OUT } from '../../utils/Constants';\nimport MobileMenuSocialCopyright from './MobileMenuSocialCopyright';\nimport { getActiveMenu, parseSecondaryMenus, SecondaryMenusParsed } from './MobileMenuHelpers';\nimport { MobileMenuSubMenu } from './MobileMenuSubMenu';\nimport { MobileMenuPreviewItem } from './MobileMenuPreviewItem';\nimport MapLoader from '../../utils/MapLoader';\nimport Map from './Map';\nimport { FormattedMessage, WrappedComponentProps } from 'react-intl';\nimport DarkModeToggle from '../../ui/DarkModeToggle';\nimport SelectLanguage from '../SelectLanguage';\nimport { Link } from 'gatsby';\nimport { graphql, PageProps } from 'gatsby';\n\nconst initialState = { activeMenuIndexes: new Array(5), selectedID: '', currentPreviewURL: '', menuData: null, mapActive: false, mapListMode: true, hidePreviewWrapper: false, selectedVertical: null, verticalClass: null, selectedItem: null, total: 0 };\ntype State = Readonly
& { menuData: { [key: string]: ResultItem } };\n\nexport type ResultItem = {\n\tcontentful_id: string;\n\ttitle: string;\n\tphone: string;\n\tfax: string;\n\temail: string;\n\tnode_locale: string;\n\ttype: string[] | null;\n\tct: string;\n\tentityDescription?: {\n\t\tentityDescription?: string;\n\t};\n\tsubtitle?: {\n\t\tsubtitle?: string;\n\t};\n\tfilterEntity?: {\n\t\tslug: string;\n\t\ttitle: string;\n\t};\n\tfilterVerticalCategory?: any;\n\tfilterProgramType?: {\n\t\ttitle: string;\n\t};\n\topeningHours?: any;\n\tlocation: {\n\t\tcontentful_id: string;\n\t\tplaceName: string;\n\t\tplaceAddress: string;\n\t\tplaceLocation?: {\n\t\t\tlon: number;\n\t\t\tlat: number;\n\t\t};\n\t};\n\theroImage?: any;\n};\n\nexport class MobileMenu extends React.Component<\n\t{\n pageContext?: any;\n\t\tchildren?: any;\n\t\tprograms: any;\n\t\tplaces: any;\n\t\tentities: any;\n\t\tdata: PageProps[];\n\t\tcurrLanguage: any;\n\t\topen: boolean;\n\t\tfooterCopyrightMessage: string;\n\t\tcloseHandler: (event) => void;\n\t\tid?: any;\n alternateURL?: string;\n langs?: any;\n location?: any;\n\t} & WrappedComponentProps,\n\tState\n> {\n\treadonly state: State = initialState;\n\n\t//Refs:\n\tprivate refNav: HTMLElement;\n\tprivate refBg: HTMLDivElement;\n\t//@ts-ignore:\n\tprivate refLogo: Link;\n\t//@ts-ignore:\n\tprivate refMobileNavigationButton: HTMLDivElement;\n\tprivate refInnerWrapper: HTMLDivElement;\n\tprivate refLayoutWrapper: HTMLDivElement;\n\tprivate refSocialLinks: HTMLAnchorElement[] = [];\n\n\t// Menus nested by index refs:\n\tprivate refsMenuListItems: Array[] = [[], [], [], [], []];\n\tprivate refsMenuWrapperOuterWrappers: HTMLDivElement[] = [];\n\tprivate refSubmenus: Array[] = [[], [], [], [], []];\n\n\t//Active menu state:\n\tprivate currMenuLevelIndex = 0;\n\tprivate activeSubmenuIndexes = new Array(4);\n\n\t//Sizing variables:\n\tprivate windowWidth: number;\n\t//@ts-ignore:\n\tprivate mobileMode = false;\n\tprivate fullMenuMode: boolean = false;\n\tprivate fullMenuBreak = 1380;\n\n\t//For holding parsed sub menu data sets (see componentDidUpdate):\n\tprivate secondaryMenusData: SecondaryMenusParsed = [[], [], [], []]; //Needs to match the 3 verticals + map = 4\n\n\t// Animation state:\n\tprivate activeTimeline: TimelineMax = null;\n\tprivate activeMenu: PageProps;\n\tprivate refMenuItemPreview: MobileMenuPreviewItem;\n\n\tprivate animationDirection: 1 | -1 = 1;\n\n\tpublic instantOpen = false;\n\n\tconstructor(props) {\n\t\tsuper(props);\n\t\tif (typeof window !== 'undefined') {\n\t\t\tfetch('/menupreviews.json')\n .then((resp) => resp.json())\n .then((response) => {\n\t\t\t\tthis.setState({ menuData: response });\n\t\t\t});\n\t\t}\n\n\t\tthis.activeMenu = getActiveMenu(this.props.data, this.props.currLanguage);\n\n\t\tthis.checkAnimationDirection();\n\t\tparseSecondaryMenus(this.secondaryMenusData, this.props.currLanguage, this.props.programs, this.props.places, this.props.entities, this.activeMenu['mapCategories'], this.props.intl);\n\t}\n\n //@ts-ignore:\n\tasync openMap() {\n\t\tif (this.state.mapActive === false) {\n\t\t\tthis.mapMenuPointClicked();\n\t\t}\n\n\t\tconst locationID = window.location.hash.substr(5);\n\n\t\tif (locationID.length > 0) {\n\t\t\tif (this.currMenuLevelIndex !== 2 && 0 !== this.activeSubmenuIndexes[2]) {\n\t\t\t\tthis.gotoMenu(2, 0, true);\n\t\t\t}\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst activeMenus = this.getActiveSubMenusArray(2);\n\n\t\t\t\tif (activeMenus[2]) {\n\t\t\t\t\tconst locationIDLookup = locationID + (this.props.currLanguage.link === '/ar' ? '___ar-QA' : '');\n\t\t\t\t\tconst activeItemIndex = activeMenus[2].props.firstMenuItems.findIndex(edge => edge.node.pageContext.id === locationID);\n\t\t\t\t\tif (activeItemIndex >= 0) {\n\t\t\t\t\t\tthis.setState({ selectedID: locationIDLookup, currentPreviewURL: activeMenus[2].props.firstMenuItems[activeItemIndex].node.path });\n\t\t\t\t\t\tthis.gotoMenu(3, activeItemIndex, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\t}\n\n\tprivate checkAnimationDirection = () => {\n\t\tif (this.props.currLanguage.link === '/ar') {\n\t\t\tthis.animationDirection = -1;\n\t\t} else {\n\t\t\tthis.animationDirection = 1;\n\t\t}\n\t};\n\n\tcomponentDidUpdate(prevProps) {\n\t\tif (prevProps.currLanguage.langKey !== this.props.currLanguage.langKey) {\n\t\t\tthis.activeMenu = getActiveMenu(this.props.data, this.props.currLanguage);\n\t\t\tthis.checkAnimationDirection();\n\t\t\tparseSecondaryMenus(this.secondaryMenusData, this.props.currLanguage, this.props.programs, this.props.places, this.props.entities, this.activeMenu['mapCategories'], this.props.intl);\n\t\t\tthis.resizeHandler();\n\t\t}\n\n\t\tif (prevProps.open !== this.props.open) {\n\t\t\tif (this.activeTimeline) {\n\t\t\t\tthis.activeTimeline.kill();\n\t\t\t}\n\t\t\tif (this.props.open) {\n\t\t\t\tthis.activeTimeline = new TimelineMax();\n\t\t\t\tthis.activeTimeline.set(this.refNav, { visibility: 'visible', force3D: true });\n\t\t\t\tthis.activeTimeline.set(this.refNav, { pointerEvents: 'all' });\n\t\t\t\tthis.activeTimeline.to(this.refBg, 0.65, { opacity: 0.18, force3D: true }, 0);\n\n\t\t\t\tthis.activeTimeline.to(this.refSocialLinks, 0.85, { opacity: 1, force3D: true }, 0);\n\t\t\t\tthis.activeTimeline.to(this.refSocialLinks, 0.85, { y: 0, ease: EASE_CUSTOM_IN_OUT, force3D: true }, 0);\n\n\t\t\t\tif (this.currMenuLevelIndex === 0) {\n\t\t\t\t\t(this.refSubmenus[0][0] as MobileMenuSubMenu).show(this.instantOpen);\n\t\t\t\t}\n\n\t\t\t\tthis.activeTimeline.to(this.refInnerWrapper, 0.65, { xPercent: 0, ease: EASE_CUSTOM_IN_OUT, force3D: true }, 0);\n\n\t\t\t\tthis.instantOpen = false;\n\t\t\t} else {\n\t\t\t\tthis.removeMapFromWindowLocation();\n\t\t\t\tthis.activeTimeline = new TimelineMax();\n\t\t\t\tthis.activeTimeline.set(this.refNav, { pointerEvents: 'none', force3D: true });\n\t\t\t\tthis.activeTimeline.to(this.refBg, 0.35, { opacity: 0, force3D: true }, 0);\n\n\t\t\t\tif (this.currMenuLevelIndex === 0) {\n\t\t\t\t\t(this.refSubmenus[0][0] as MobileMenuSubMenu).hide();\n\t\t\t\t}\n\n\t\t\t\tthis.activeTimeline.to(this.refSocialLinks, 0.15, { opacity: 0, force3D: true }, 0);\n\t\t\t\tthis.activeTimeline.to(this.refInnerWrapper, 0.3, { xPercent: this.animationDirection === 1 ? -100 : 100, ease: EASE_CUSTOM_IN_OUT, force3D: true }, 0);\n\n\t\t\t\tthis.activeTimeline.set(this.refNav, { visibility: 'hidden', pointerEvents: 'none' });\n\t\t\t\tthis.activeTimeline.set(this.refSocialLinks, { opacity: 0, y: 25, force3D: true });\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate setMapMapToggleActive = event => {\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tif (this.state.mapListMode === true) {\n\t\t\tthis.setState({ mapListMode: false });\n\t\t}\n\t};\n\n\tprivate setMapListToggleActive = event => {\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tif (this.state.mapListMode === false) {\n\t\t\tthis.setState({ mapListMode: true });\n\t\t}\n\t};\n\n\tprivate topBackButtonClicked = event => {\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tthis.gotoMenu(this.currMenuLevelIndex - 1, this.activeSubmenuIndexes[this.currMenuLevelIndex - 1]);\n\t};\n\n\tprivate topBackButtontabbed = event => {\n\t\tif (event.key == 'Enter') {\n\t\t\tthis.topBackButtonClicked(event);\n const mapBackButtonVisible = this.state.mapActive && this.state.activeMenuIndexes[2] > -1;\n\t\t\twindow.setTimeout(() => {\n if(mapBackButtonVisible) {\n document.getElementById('mapnavtopbackbtn').focus();\n } else {\n document.getElementById('mapMenu').getElementsByTagName('ul')[0].focus();\n }\n\t\t\t}, 0);\n\t\t} else if (event.key == 'Tab') {\n\t\t\t\n function isInViewport(el) {\n return (window.getComputedStyle(el).getPropertyValue('display') !== 'none')\n }\n \n window.setTimeout(() => {\n var visibleSubmenu = document.getElementById('mapnavtopbackbtn').nextElementSibling.nextElementSibling.children[2]\n visibleSubmenu.getElementsByTagName('ul')[0].focus()\n var children = visibleSubmenu.children;\n for(var i=0; i< children.length; i++) {\n var child = children[i];\n if(isInViewport(child)) {\n child.getElementsByTagName('ul')[0].focus();\n }\n }\n }, 0);\n\t\t}\n\t};\n\n\tprivate topshortmenuBackButtontabbed = event => {\n\t\tif (event.key == 'Enter') {\n\t\t\tthis.mobileBackNavigationItemClicked(event);\n\t\t}\n\t};\n\n\tprivate mobileBackNavigationItemClicked = event => {\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tthis.gotoMenu((this.currMenuLevelIndex === 3 && this.state.hidePreviewWrapper) ? this.currMenuLevelIndex - 2 : this.currMenuLevelIndex - 1, this.state.hidePreviewWrapper ? this.activeSubmenuIndexes[this.currMenuLevelIndex - 2] : this.activeSubmenuIndexes[this.currMenuLevelIndex - 1]);\n\t\tif (this.currMenuLevelIndex < 1 && this.state.mapActive === true) {\n\t\t\tthis.setState({ mapActive: false });\n\t\t}\n\t\tif (this.state.mapListMode === false) {\n\t\t\tthis.setState({ mapListMode: true });\n\t\t}\n if(this.currMenuLevelIndex !== 2)\n this.setState({ selectedItem: '' });\n\t};\n\n\tprivate verticalMenuItemClicked = event => {\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tconst menuItemIndex = parseInt(event.target.dataset.index);\n\t\tif (menuItemIndex !== this.activeMenu['menuItems'].length && this.state.mapActive === true) {\n\t\t\tthis.setState({ mapActive: false });\n\t\t}\n\n let val;\n let verticalClass;\n\n if(menuItemIndex === 0) {\n val = 'Education'\n verticalClass = 'purple'\n } else if(menuItemIndex === 1) {\n val = 'Research'\n verticalClass = 'blue'\n } else if(menuItemIndex === 2) {\n val = 'Community'\n verticalClass = 'red'\n } else if(menuItemIndex === 3) {\n val = 'World Cup'\n verticalClass = 'orange'\n }\n\n this.setState({ selectedVertical: val, verticalClass: verticalClass });\n\t\tthis.gotoMenu(1, menuItemIndex);\n document.documentElement.style.overflowY = 'scroll';\n\t};\n\n\tprivate secondaryMenuItemClicked = (event) => {\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n this.setState({ selectedItem: event.target.dataset.id, total: event.target.dataset.items });\n\t\tconst menuItemIndex = parseInt(event.target.dataset.index);\n\t\tthis.gotoMenu(2, menuItemIndex);\n document.documentElement.style.overflowY = 'scroll';\n\t};\n\n\tprivate tertiaryMenuItemClicked = event => {\n\t\tconst dataLink = event.target.getAttribute('data-link')\n\t\tevent.preventDefault();\n\t\tconst menuItemIndex = parseInt(event.target.dataset.index);\n\t\tconst menuItemID = event.target.dataset.id + (this.props.currLanguage.link === '/ar' ? '___ar-QA' : '');\n\t\tif (menuItemID) {\n\t\t\tthis.setState({ selectedID: menuItemID, currentPreviewURL: event.target.getAttribute('href') });\n\t\t}\n\t\t\n\t\tif (dataLink && dataLink === false) {\n\t\t\tthis.gotoMenu(3, menuItemIndex, true, dataLink);\n\t\t\tdocument.getElementById(\"close-menu\").click();\n\t\t\tthis.setState({ hidePreviewWrapper: true });\n\t\t} else {\n\t\t\tthis.gotoMenu(3, menuItemIndex);\n\t\t}\n document.documentElement.style.overflowY = 'scroll';\n\t};\n\n\tprivate mapMenuItemClicked = event => {\n\t\tif (event) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tconst menuItemIndex = parseInt(event.target.dataset.index);\n\t\tthis.gotoMenu(2, menuItemIndex);\n document.documentElement.style.overflowY = 'scroll';\n\t};\n\n\tprivate mapMenuPointClicked = (event?) => {\n\t\tnew MapLoader().initMap();\n\t\tthis.gotoMenu(1, this.activeMenu['menuItems'].length, !event);\n\t\tif (this.activeSubmenuIndexes[1] === this.activeMenu['menuItems'].length) {\n\t\t\tthis.setState({ mapActive: true });\n\t\t} else {\n\t\t\tthis.setState({ mapActive: false });\n\t\t\tthis.removeMapFromWindowLocation(event);\n\t\t}\n\t};\n\n\tprivate removeMapFromWindowLocation(event?) {\n\t\tif (window.location.hash && window.location.hash.indexOf('#map') === 0) {\n\t\t\twindow.location.hash = '';\n\t\t\tif (event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getActiveSubMenusArray(menuLevelIndex: number) {\n\t\tlet activeMenus = [this.refSubmenus[0][0] as MobileMenuSubMenu];\n\t\tif (menuLevelIndex > 0) {\n\t\t\tactiveMenus.push(this.refSubmenus[1][this.activeSubmenuIndexes[1]] as MobileMenuSubMenu);\n\t\t}\n\t\tif (menuLevelIndex > 1) {\n\t\t\tactiveMenus.push(this.refSubmenus[2][this.activeSubmenuIndexes[1]][this.activeSubmenuIndexes[2]]);\n\t\t}\n\t\tif (menuLevelIndex > 2) {\n\t\t\tactiveMenus.push(this.refMenuItemPreview as any);\n\t\t}\n\t\treturn activeMenus;\n\t}\n\n\tprivate getMenuToWidth = (activeSubmenusArray: MobileMenuSubMenu[], link) => {\n\t\tlet joinedWidths = 0;\n\t\tif (this.fullMenuMode && this.state.mapActive && activeSubmenusArray.length > 2) {\n\t\t\tjoinedWidths = activeSubmenusArray[0].getWidth() + activeSubmenusArray[activeSubmenusArray.length - 1].getWidth() + 250;\n\t\t} else if (activeSubmenusArray.length === 1) {\n\t\t\tjoinedWidths = this.fullMenuMode ? 350 : 215;\n\t\t} else if (this.fullMenuMode) {\n\t\t\tlink ? joinedWidths = 900 : activeSubmenusArray.forEach(menu => (joinedWidths += menu && menu.getWidth()));\n\t\t} else {\n\t\t\tjoinedWidths = 350;\n\t\t}\n\t\treturn joinedWidths;\n\t};\n\n\tprivate gotoMenu(menuLevelIndex: number, menuItemIndex: number, instant = false, link = false) {\n\t\tlet duration = instant ? 0 : 0.4;\n\t\tif (this.currMenuLevelIndex < menuLevelIndex) {\n\t\t\t// New higher menu clicked:\n\n\t\t\tthis.activeSubmenuIndexes[menuLevelIndex] = menuItemIndex;\n\t\t\tlet activeMenus = this.getActiveSubMenusArray(menuLevelIndex);\n\t\t\tconst toWidth = this.getMenuToWidth(activeMenus, link);\n\t\t\t!link && activeMenus[menuLevelIndex].show(instant);\n\t\t\tTweenMax.to(this.refLayoutWrapper, duration, { width: link ? toWidth : toWidth, ease: EASE_CUSTOM_IN_OUT });\n\t\t\tthis.currMenuLevelIndex = menuLevelIndex;\n\n\t\t\tif (menuLevelIndex === 1) {\n\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\tactiveMenus[menuLevelIndex]['refListItems'][0].querySelector('a').focus();\n\t\t\t\t}, 300);\n\t\t\t} else if (menuLevelIndex === 2) {\n\t\t\t\twindow.setTimeout(function() {\n\t\t\t\t\tactiveMenus[menuLevelIndex]['refListItems'][0].querySelector('a').focus();\n\t\t\t\t}, 300);\n\t\t\t} else if (menuLevelIndex === 3) {\n\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\tvar seletor = !link && activeMenus[menuLevelIndex]['refWrapper']['offsetParent'];\n\t\t\t\t\tvar elem = seletor && seletor.getElementsByTagName('h3')[0];\n\t\t\t\t\telem && elem.focus();\n\t\t\t\t}, 0);\n\t\t\t}\n\t\t} else if (this.currMenuLevelIndex === menuLevelIndex) {\n\t\t\t// Same menu clicked (toggle it away):\n\t\t\tlet activeMenus = this.getActiveSubMenusArray(menuLevelIndex);\n\n\t\t\t//Hide current active one:\n\t\t\t!link && activeMenus[menuLevelIndex].hide(instant);\n\t\t\tif (menuItemIndex !== this.activeSubmenuIndexes[menuLevelIndex]) {\n\t\t\t\t//Set new active index:\n\t\t\t\tthis.activeSubmenuIndexes[menuLevelIndex] = menuItemIndex;\n\t\t\t\tactiveMenus = this.getActiveSubMenusArray(menuLevelIndex);\n\t\t\t\t!link && activeMenus[menuLevelIndex].show(instant);\n\n\t\t\t\t// Accesibility fix on key tabbing\n\t\t\t\tif (menuLevelIndex == 1 || menuLevelIndex == 2) {\n\t\t\t\t\tvar selector = activeMenus[menuLevelIndex]['refListItems'][0];\n\t\t\t\t\tvar elem = selector.getElementsByTagName('a');\n\t\t\t\t\tvar activemenuelement = elem[0];\n\t\t\t\t\tactivemenuelement.focus();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.activeSubmenuIndexes[this.currMenuLevelIndex] = -1;\n\t\t\t\tthis.currMenuLevelIndex = this.currMenuLevelIndex - 1;\n\t\t\t\t// this.activeSubmenuIndexes[this.currMenuLevelIndex] = -1;\n\t\t\t\tactiveMenus = this.getActiveSubMenusArray(this.currMenuLevelIndex);\n\n\t\t\t\tconst toWidth = this.getMenuToWidth(activeMenus, link);\n\t\t\t\tTweenMax.to(this.refLayoutWrapper, duration, { width: toWidth, ease: EASE_CUSTOM_IN_OUT });\n\t\t\t}\n\t\t} else {\n\t\t\t//Lower menu selected:\n\t\t\tlet activeMenus = this.getActiveSubMenusArray(this.currMenuLevelIndex);\n\t\t\twhile (this.currMenuLevelIndex >= menuLevelIndex) {\n\t\t\t\t!link && activeMenus[this.currMenuLevelIndex] && activeMenus[this.currMenuLevelIndex].hide(instant);\n\t\t\t\tthis.activeSubmenuIndexes[this.currMenuLevelIndex] = -1;\n\t\t\t\tthis.currMenuLevelIndex--;\n\t\t\t}\n\t\t\tthis.currMenuLevelIndex = menuLevelIndex;\n\n\t\t\t//Set new active index:\n\t\t\tthis.activeSubmenuIndexes[menuLevelIndex] = menuItemIndex;\n\t\t\tactiveMenus = this.getActiveSubMenusArray(menuLevelIndex);\n\t\t\tactiveMenus[menuLevelIndex].show(instant);\n\n\t\t\t// Accesibility fix on key tabbing\n\t\t\t//var theanswer = activeMenus[menuLevelIndex]['refListItems'][0];\n\t\t\t//var fajr = $(theanswer).find(\"a\");\n\t\t\t//var activemenuelement = fajr[0];\n\t\t\t//activemenuelement.focus();\n\n\t\t\tconst toWidth = this.getMenuToWidth(activeMenus, link);\n\t\t\tTweenMax.to(this.refLayoutWrapper, duration, { width: toWidth, ease: EASE_CUSTOM_IN_OUT });\n\t\t}\n\t\tif (this.currMenuLevelIndex < 3) {\n\t\t\tthis.setState({ selectedID: '', currentPreviewURL: '' });\n\t\t}\n\t\tthis.setState({ activeMenuIndexes: this.activeSubmenuIndexes });\n\t}\n\n\tcomponentDidMount() {\n\t\twindow.addEventListener('resize', this.resizeHandler);\n\t\tthis.resizeHandler();\n\n\t\tTweenMax.set(this.refBg, { opacity: 0, force3D: true });\n\t\tTweenMax.set(this.refSocialLinks, { opacity: 0, y: 25, force3D: true });\n\t\tTweenMax.set(this.refInnerWrapper, { xPercent: this.animationDirection === 1 ? -100 : 100, force3D: true });\n\t\tTweenMax.set(this.refNav, { visibility: 'hidden', pointerEvents: 'none', force3D: true });\n\t}\n\n\tcomponentWillUnmount() {\n\t\twindow.removeEventListener('resize', this.resizeHandler);\n\t}\n\n\tprivate resizeHandler = () => {\n\t\tthis.windowWidth = window.innerWidth;\n\t\tthis.fullMenuMode = this.windowWidth >= this.fullMenuBreak;\n\t\tif (this.windowWidth < 768) {\n\t\t\tthis.mobileMode = true;\n\t\t} else {\n\t\t\tlet activeMenus = this.getActiveSubMenusArray(this.currMenuLevelIndex);\n\t\t\tconst toWidth = this.getMenuToWidth(activeMenus, null);\n\t\t\tTweenMax.set(this.refLayoutWrapper, { width: toWidth });\n\t\t}\n\t\tif (!this.props.open) {\n\t\t\tTweenMax.set(this.refInnerWrapper, { xPercent: this.animationDirection === 1 ? -100 : 100, force3D: true });\n\t\t}\n\t};\n\n\tpublic render() {\n\t\tconst mapMenuItemIndex = this.activeMenu['menuItems'].length;\n\t\tconst mapBackButtonVisible = this.state.mapActive && this.state.activeMenuIndexes[2] > -1;\n\t\tconst mobileBackButtonVisible = this.state.activeMenuIndexes[1] > -1;\n\t\tthis.refsMenuListItems[1][mapMenuItemIndex] = [];\n var pathArray = this.props.location.pathname.split('/');\n var subMenuPath = [\n { path: 'education/', index: 0, style: 'purple' }, \n { path: '/education', index: 0, style: 'purple' },\n { path: 'ar/education/', index: 0, style: 'purple' }, \n { path: '/ar/education', index: 0, style: 'purple' },\n { path: 'research/', index: 1, style: 'blue' }, \n { path: '/research', index: 1, style: 'blue' },\n { path: 'ar/research/', index: 1, style: 'blue' }, \n { path: '/ar/research', index: 1, style: 'blue' },\n { path: 'community/', index: 2, style: 'red' }, \n { path: '/community', index: 2, style: 'red' },\n { path: 'ar/community/', index: 2, style: 'red' }, \n { path: '/ar/community', index: 2, style: 'red' }\n ]\n let arrayIndex = this.props.currLanguage.link === '/ar' ? 2 : 1\n let arrayPos = this.props.currLanguage.link === '/ar' ? 3 : 2\n const isMobile = typeof window !== 'undefined' && window.innerWidth <= 768;\n\n\t\treturn (\n\t\t\t