{"version":3,"sources":["webpack:///./src/pages/404.js"],"names":["PageNotFound","props","state","fetchCms","fetch","apiUrl","method","headers","apiKey","fetchWebsite","cms","channels","web","websitesArray","filter","item","templateName","websites","forEach","subItems","children","subItem","concat","fetchNavigation","website","content","navigation","websiteNavigation","headerNavigation","footerNavigation","contactNavigation","headerNavigationChildren","footerNavigationChildren","contactNavigationChildren","navigationItem","this","findChildNode","itemId","items","node","child","recursive","fetchData","a","setState","cmsResponse","json","environment","builds","build","name","length","componentDidMount","render","theme","key","isTiny","showQsm","isTinted","className","href","title","React","Component","connect","app"],"mappings":"yhDAQMA,E,oBACJ,WAAYC,GAAQ,IAAD,SACjB,cAAMA,IAAN,MACKC,MAAQ,GAFI,E,2GAOnBC,SAAA,WACE,OAAOC,MAAMC,SAAQ,CACnBC,OAAQ,MACRC,QAAS,CACP,UAAWC,a,EAKjBC,aAAA,SAAaC,GAEX,KAAKA,GAAQA,EAAIC,UAAaD,EAAIC,SAASC,KAAQF,EAAIC,SAASC,IAAI,UAClE,MAAO,GAGT,IAAMC,EAAgBH,EAAIC,SAASC,IAAI,SAASE,QAAO,SAAAC,GAAI,MAA0B,aAAtBA,EAAKC,gBAEhEC,EAAW,GAKf,OAJAJ,EAAcK,SAAQ,SAAAH,GACpB,IAAMI,EAAWJ,EAAKK,SAASN,QAAO,SAAAO,GAAO,MAA6B,YAAzBA,EAAQL,gBACzDC,EAAWA,EAASK,OAAOH,MAEtBF,G,EAGTM,gBAAA,SAAgBb,EAAKc,GACnB,KACGd,GACAA,EAAIC,UACJD,EAAIC,SAASC,KACbF,EAAIC,SAASC,IAAI,UACjBY,GACAA,EAAQC,SACRD,EAAQC,QAAQC,YAEjB,MAAO,GAGT,IACMT,EADgBP,EAAIC,SAASC,IAAI,SAASE,QAAO,SAAAC,GAAI,MAA0B,aAAtBA,EAAKC,gBACrC,GAGzBU,EAAa,CAAC,IAAKT,EAASG,SAAU,CAAEJ,aAAc,eAGtDW,EAAoBH,EAAQC,QAAQC,WA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BzB,EAAaS,KAAKZ,gBAAgBb,EAAKc,IAI3CW,KAAKS,SAAS,CACZlB,WAAYA,IAtBlB,kDAyBIS,KAAKS,SAAS,IAzBlB,0D,uDA6BMQ,kB,6BAAN,sBAAAT,EAAA,sEACQR,KAAKO,YADb,gD,uDAIAW,OAAA,WAAU,IACA3B,EAAeS,KAAKjC,MAApBwB,WACF4B,EAAQP,cAAYC,OAAO,GAAGO,IAEpC,OACE,kBAAC,IAAD,CAAQC,QAAQ,EAAMC,SAAS,EAAOH,MAAOA,EAAOI,UAAU,EAAMhC,WAAYA,GAC9E,yBAAKiC,UAAU,YACb,yBAAKA,UAAU,mBACb,kDAGF,yBAAKA,UAAU,qBACb,yBAAKA,UAAU,kBACb,gHACqF,IACnF,uBACEC,KAAK,6DACLC,MAAM,+BACNF,UAAU,QAHZ,gCAMK,IARP,wBAWA,uBAAGC,KAAK,IAAID,UAAU,SAASE,MAAM,0BAArC,+B,GArLaC,IAAMC,WAwMlBC,uBARf,SAAyB9D,GAKvB,MAAO,CAAEwB,WAFLxB,EADF+D,IAAOvC,cAMIsC,CAAyBhE","file":"component---src-pages-404-js-900346bcf3c7fb4aee84.js","sourcesContent":["import { apiKey, apiUrl } from \"../settings\";\n\nimport Layout from \"../templates/layout\";\nimport React from \"react\";\nimport { connect } from \"react-redux\";\nimport { environment } from \"../environments/environment\";\nimport { find } from \"lodash\";\n\nclass PageNotFound extends React.Component {\n constructor(props) {\n super(props);\n this.state = {};\n }\n\n //actions\n\n fetchCms() {\n return fetch(apiUrl, {\n method: \"GET\",\n headers: {\n \"Api-Key\": apiKey,\n },\n });\n }\n\n fetchWebsite(cms) {\n // Fast escape\n if (!cms || !cms.channels || !cms.channels.web || !cms.channels.web[\"nl-BE\"]) {\n return [];\n }\n\n const websitesArray = cms.channels.web[\"nl-BE\"].filter(item => item.templateName === \"Websites\");\n\n let websites = [];\n websitesArray.forEach(item => {\n const subItems = item.children.filter(subItem => subItem.templateName === \"Website\");\n websites = websites.concat(subItems);\n });\n return websites;\n }\n\n fetchNavigation(cms, website) {\n if (\n !cms ||\n !cms.channels ||\n !cms.channels.web ||\n !cms.channels.web[\"nl-BE\"] ||\n !website ||\n !website.content ||\n !website.content.navigation\n ) {\n return [];\n }\n\n const websitesArray = cms.channels.web[\"nl-BE\"].filter(item => item.templateName === \"Websites\");\n const websites = websitesArray[0];\n\n // Get websites navigation\n const navigation = [find(websites.children, { templateName: \"Navigatie\" })];\n\n // Get website navigation\n const websiteNavigation = website.content.navigation;\n if (!websiteNavigation || !navigation) {\n return undefined;\n }\n\n // Get header, footer and contact navigation\n const headerNavigation = websiteNavigation.headerNavigation;\n const footerNavigation = websiteNavigation.footerNavigation;\n const contactNavigation = websiteNavigation.contactNavigation;\n\n if (!headerNavigation || !footerNavigation || !contactNavigation) {\n return undefined;\n }\n\n // Get navigation children\n let headerNavigationChildren;\n let footerNavigationChildren;\n let contactNavigationChildren;\n\n for (var navigationItem of navigation) {\n if (!headerNavigationChildren) {\n headerNavigationChildren = this.findChildNode(navigationItem, headerNavigation.itemId);\n }\n if (!footerNavigationChildren) {\n footerNavigationChildren = this.findChildNode(navigationItem, footerNavigation.itemId);\n }\n if (!contactNavigationChildren) {\n contactNavigationChildren = this.findChildNode(navigationItem, contactNavigation.itemId);\n }\n\n if (headerNavigationChildren && footerNavigationChildren && contactNavigationChildren) {\n break;\n }\n }\n\n if (!headerNavigationChildren || !footerNavigationChildren || !contactNavigationChildren) {\n return undefined;\n }\n\n return {\n headerNavigation: {\n content: headerNavigation.content,\n items: headerNavigationChildren.children,\n },\n footerNavigation: {\n content: footerNavigation.content,\n items: footerNavigationChildren.children,\n },\n contactNavigation: {\n content: contactNavigation.content,\n items: contactNavigationChildren.children,\n },\n };\n }\n\n findChildNode(node, itemId) {\n if (node && node.children) {\n for (const child of node.children) {\n if (child.itemId === itemId) {\n return child;\n }\n\n const recursive = this.findChildNode(child, itemId);\n if (recursive) {\n return recursive;\n }\n }\n }\n return undefined;\n }\n\n async fetchData() {\n let { navigation } = this.state;\n\n try {\n this.setState({});\n\n const cmsResponse = await this.fetchCms();\n const cms = await cmsResponse.json();\n\n //website\n\n const websites = this.fetchWebsite(cms);\n for (const build of environment.builds) {\n const website = find(websites, { name: build.name });\n\n // Navigation\n if (!navigation || !navigation.length) {\n navigation = this.fetchNavigation(cms, website);\n }\n }\n\n this.setState({\n navigation: navigation,\n });\n } catch (e) {\n this.setState({});\n }\n }\n\n async componentDidMount() {\n await this.fetchData();\n }\n\n render() {\n const { navigation } = this.state;\n const theme = environment.builds[0].key;\n\n return (\n \n
\n
\n

De boot gemist...

\n
\n\n
\n
\n

\n Helaas, deze pagina bestaat (nog) niet. Is dit een fout? Blijft dit zich voordoen?{\" \"}\n \n Contacteer onze reisexperten\n {\" \"}\n en we kijken het na.\n

\n \n Terug naar de homepage\n \n
\n
\n
\n
\n );\n }\n}\n\nfunction mapStateToProps(state) {\n const {\n app: { navigation },\n } = state;\n\n return { navigation };\n}\n\nexport default connect(mapStateToProps)(PageNotFound);\n"],"sourceRoot":""}