next-seo.modern.js 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084
  1. import React from 'react';
  2. import Head from 'next/head';
  3. function _extends() {
  4. _extends = Object.assign ? Object.assign.bind() : function (target) {
  5. for (var i = 1; i < arguments.length; i++) {
  6. var source = arguments[i];
  7. for (var key in source) {
  8. if (Object.prototype.hasOwnProperty.call(source, key)) {
  9. target[key] = source[key];
  10. }
  11. }
  12. }
  13. return target;
  14. };
  15. return _extends.apply(this, arguments);
  16. }
  17. function _objectWithoutPropertiesLoose(source, excluded) {
  18. if (source == null) return {};
  19. var target = {};
  20. var sourceKeys = Object.keys(source);
  21. var key, i;
  22. for (i = 0; i < sourceKeys.length; i++) {
  23. key = sourceKeys[i];
  24. if (excluded.indexOf(key) >= 0) continue;
  25. target[key] = source[key];
  26. }
  27. return target;
  28. }
  29. const _excluded$x = ["keyOverride"];
  30. const defaults = {
  31. templateTitle: '',
  32. noindex: false,
  33. nofollow: false,
  34. defaultOpenGraphImageWidth: 0,
  35. defaultOpenGraphImageHeight: 0,
  36. defaultOpenGraphVideoWidth: 0,
  37. defaultOpenGraphVideoHeight: 0
  38. };
  39. const buildOpenGraphMediaTags = (mediaType, media = [], {
  40. defaultWidth,
  41. defaultHeight
  42. } = {}) => {
  43. return media.reduce((tags, medium, index) => {
  44. tags.push( /*#__PURE__*/React.createElement("meta", {
  45. key: `og:${mediaType}:0${index}`,
  46. property: `og:${mediaType}`,
  47. content: medium.url
  48. }));
  49. if (medium.alt) {
  50. tags.push( /*#__PURE__*/React.createElement("meta", {
  51. key: `og:${mediaType}:alt0${index}`,
  52. property: `og:${mediaType}:alt`,
  53. content: medium.alt
  54. }));
  55. }
  56. if (medium.secureUrl) {
  57. tags.push( /*#__PURE__*/React.createElement("meta", {
  58. key: `og:${mediaType}:secure_url0${index}`,
  59. property: `og:${mediaType}:secure_url`,
  60. content: medium.secureUrl.toString()
  61. }));
  62. }
  63. if (medium.type) {
  64. tags.push( /*#__PURE__*/React.createElement("meta", {
  65. key: `og:${mediaType}:type0${index}`,
  66. property: `og:${mediaType}:type`,
  67. content: medium.type.toString()
  68. }));
  69. }
  70. if (medium.width) {
  71. tags.push( /*#__PURE__*/React.createElement("meta", {
  72. key: `og:${mediaType}:width0${index}`,
  73. property: `og:${mediaType}:width`,
  74. content: medium.width.toString()
  75. }));
  76. } else if (defaultWidth) {
  77. tags.push( /*#__PURE__*/React.createElement("meta", {
  78. key: `og:${mediaType}:width0${index}`,
  79. property: `og:${mediaType}:width`,
  80. content: defaultWidth.toString()
  81. }));
  82. }
  83. if (medium.height) {
  84. tags.push( /*#__PURE__*/React.createElement("meta", {
  85. key: `og:${mediaType}:height${index}`,
  86. property: `og:${mediaType}:height`,
  87. content: medium.height.toString()
  88. }));
  89. } else if (defaultHeight) {
  90. tags.push( /*#__PURE__*/React.createElement("meta", {
  91. key: `og:${mediaType}:height${index}`,
  92. property: `og:${mediaType}:height`,
  93. content: defaultHeight.toString()
  94. }));
  95. }
  96. return tags;
  97. }, []);
  98. };
  99. const buildTags = config => {
  100. var _config$openGraph, _config$openGraph3, _config$additionalLin;
  101. const tagsToRender = [];
  102. if (config.titleTemplate) {
  103. defaults.templateTitle = config.titleTemplate;
  104. }
  105. let updatedTitle = '';
  106. if (config.title) {
  107. updatedTitle = config.title;
  108. if (defaults.templateTitle) {
  109. updatedTitle = defaults.templateTitle.replace(/%s/g, () => updatedTitle);
  110. }
  111. } else if (config.defaultTitle) {
  112. updatedTitle = config.defaultTitle;
  113. }
  114. if (updatedTitle) {
  115. tagsToRender.push( /*#__PURE__*/React.createElement("title", {
  116. key: "title"
  117. }, updatedTitle));
  118. }
  119. const noindex = config.noindex || defaults.noindex || config.dangerouslySetAllPagesToNoIndex;
  120. const nofollow = config.nofollow || defaults.nofollow || config.dangerouslySetAllPagesToNoFollow;
  121. let robotsParams = '';
  122. if (config.robotsProps) {
  123. const {
  124. nosnippet,
  125. maxSnippet,
  126. maxImagePreview,
  127. maxVideoPreview,
  128. noarchive,
  129. noimageindex,
  130. notranslate,
  131. unavailableAfter
  132. } = config.robotsProps;
  133. robotsParams = `${nosnippet ? ',nosnippet' : ''}${maxSnippet ? `,max-snippet:${maxSnippet}` : ''}${maxImagePreview ? `,max-image-preview:${maxImagePreview}` : ''}${noarchive ? ',noarchive' : ''}${unavailableAfter ? `,unavailable_after:${unavailableAfter}` : ''}${noimageindex ? ',noimageindex' : ''}${maxVideoPreview ? `,max-video-preview:${maxVideoPreview}` : ''}${notranslate ? ',notranslate' : ''}`;
  134. }
  135. if (noindex || nofollow) {
  136. if (config.dangerouslySetAllPagesToNoIndex) {
  137. defaults.noindex = true;
  138. }
  139. if (config.dangerouslySetAllPagesToNoFollow) {
  140. defaults.nofollow = true;
  141. }
  142. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  143. key: "robots",
  144. name: "robots",
  145. content: `${noindex ? 'noindex' : 'index'},${nofollow ? 'nofollow' : 'follow'}${robotsParams}`
  146. }));
  147. } else {
  148. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  149. key: "robots",
  150. name: "robots",
  151. content: `index,follow${robotsParams}`
  152. }));
  153. }
  154. if (config.description) {
  155. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  156. key: "description",
  157. name: "description",
  158. content: config.description
  159. }));
  160. }
  161. if (config.themeColor) {
  162. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  163. key: "theme-color",
  164. name: "theme-color",
  165. content: config.themeColor
  166. }));
  167. }
  168. if (config.mobileAlternate) {
  169. tagsToRender.push( /*#__PURE__*/React.createElement("link", {
  170. rel: "alternate",
  171. key: "mobileAlternate",
  172. media: config.mobileAlternate.media,
  173. href: config.mobileAlternate.href
  174. }));
  175. }
  176. if (config.languageAlternates && config.languageAlternates.length > 0) {
  177. config.languageAlternates.forEach(languageAlternate => {
  178. tagsToRender.push( /*#__PURE__*/React.createElement("link", {
  179. rel: "alternate",
  180. key: `languageAlternate-${languageAlternate.hrefLang}`,
  181. hrefLang: languageAlternate.hrefLang,
  182. href: languageAlternate.href
  183. }));
  184. });
  185. }
  186. if (config.twitter) {
  187. if (config.twitter.cardType) {
  188. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  189. key: "twitter:card",
  190. name: "twitter:card",
  191. content: config.twitter.cardType
  192. }));
  193. }
  194. if (config.twitter.site) {
  195. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  196. key: "twitter:site",
  197. name: "twitter:site",
  198. content: config.twitter.site
  199. }));
  200. }
  201. if (config.twitter.handle) {
  202. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  203. key: "twitter:creator",
  204. name: "twitter:creator",
  205. content: config.twitter.handle
  206. }));
  207. }
  208. }
  209. if (config.facebook) {
  210. if (config.facebook.appId) {
  211. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  212. key: "fb:app_id",
  213. property: "fb:app_id",
  214. content: config.facebook.appId
  215. }));
  216. }
  217. }
  218. if ((_config$openGraph = config.openGraph) != null && _config$openGraph.title || updatedTitle) {
  219. var _config$openGraph2;
  220. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  221. key: "og:title",
  222. property: "og:title",
  223. content: ((_config$openGraph2 = config.openGraph) == null ? void 0 : _config$openGraph2.title) || updatedTitle
  224. }));
  225. }
  226. if ((_config$openGraph3 = config.openGraph) != null && _config$openGraph3.description || config.description) {
  227. var _config$openGraph4;
  228. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  229. key: "og:description",
  230. property: "og:description",
  231. content: ((_config$openGraph4 = config.openGraph) == null ? void 0 : _config$openGraph4.description) || config.description
  232. }));
  233. }
  234. if (config.openGraph) {
  235. if (config.openGraph.url || config.canonical) {
  236. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  237. key: "og:url",
  238. property: "og:url",
  239. content: config.openGraph.url || config.canonical
  240. }));
  241. }
  242. if (config.openGraph.type) {
  243. const type = config.openGraph.type.toLowerCase();
  244. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  245. key: "og:type",
  246. property: "og:type",
  247. content: type
  248. }));
  249. if (type === 'profile' && config.openGraph.profile) {
  250. if (config.openGraph.profile.firstName) {
  251. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  252. key: "profile:first_name",
  253. property: "profile:first_name",
  254. content: config.openGraph.profile.firstName
  255. }));
  256. }
  257. if (config.openGraph.profile.lastName) {
  258. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  259. key: "profile:last_name",
  260. property: "profile:last_name",
  261. content: config.openGraph.profile.lastName
  262. }));
  263. }
  264. if (config.openGraph.profile.username) {
  265. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  266. key: "profile:username",
  267. property: "profile:username",
  268. content: config.openGraph.profile.username
  269. }));
  270. }
  271. if (config.openGraph.profile.gender) {
  272. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  273. key: "profile:gender",
  274. property: "profile:gender",
  275. content: config.openGraph.profile.gender
  276. }));
  277. }
  278. } else if (type === 'book' && config.openGraph.book) {
  279. if (config.openGraph.book.authors && config.openGraph.book.authors.length) {
  280. config.openGraph.book.authors.forEach((author, index) => {
  281. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  282. key: `book:author:0${index}`,
  283. property: "book:author",
  284. content: author
  285. }));
  286. });
  287. }
  288. if (config.openGraph.book.isbn) {
  289. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  290. key: "book:isbn",
  291. property: "book:isbn",
  292. content: config.openGraph.book.isbn
  293. }));
  294. }
  295. if (config.openGraph.book.releaseDate) {
  296. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  297. key: "book:release_date",
  298. property: "book:release_date",
  299. content: config.openGraph.book.releaseDate
  300. }));
  301. }
  302. if (config.openGraph.book.tags && config.openGraph.book.tags.length) {
  303. config.openGraph.book.tags.forEach((tag, index) => {
  304. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  305. key: `book:tag:0${index}`,
  306. property: "book:tag",
  307. content: tag
  308. }));
  309. });
  310. }
  311. } else if (type === 'article' && config.openGraph.article) {
  312. if (config.openGraph.article.publishedTime) {
  313. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  314. key: "article:published_time",
  315. property: "article:published_time",
  316. content: config.openGraph.article.publishedTime
  317. }));
  318. }
  319. if (config.openGraph.article.modifiedTime) {
  320. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  321. key: "article:modified_time",
  322. property: "article:modified_time",
  323. content: config.openGraph.article.modifiedTime
  324. }));
  325. }
  326. if (config.openGraph.article.expirationTime) {
  327. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  328. key: "article:expiration_time",
  329. property: "article:expiration_time",
  330. content: config.openGraph.article.expirationTime
  331. }));
  332. }
  333. if (config.openGraph.article.authors && config.openGraph.article.authors.length) {
  334. config.openGraph.article.authors.forEach((author, index) => {
  335. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  336. key: `article:author:0${index}`,
  337. property: "article:author",
  338. content: author
  339. }));
  340. });
  341. }
  342. if (config.openGraph.article.section) {
  343. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  344. key: "article:section",
  345. property: "article:section",
  346. content: config.openGraph.article.section
  347. }));
  348. }
  349. if (config.openGraph.article.tags && config.openGraph.article.tags.length) {
  350. config.openGraph.article.tags.forEach((tag, index) => {
  351. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  352. key: `article:tag:0${index}`,
  353. property: "article:tag",
  354. content: tag
  355. }));
  356. });
  357. }
  358. } else if ((type === 'video.movie' || type === 'video.episode' || type === 'video.tv_show' || type === 'video.other') && config.openGraph.video) {
  359. if (config.openGraph.video.actors && config.openGraph.video.actors.length) {
  360. config.openGraph.video.actors.forEach((actor, index) => {
  361. if (actor.profile) {
  362. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  363. key: `video:actor:0${index}`,
  364. property: "video:actor",
  365. content: actor.profile
  366. }));
  367. }
  368. if (actor.role) {
  369. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  370. key: `video:actor:role:0${index}`,
  371. property: "video:actor:role",
  372. content: actor.role
  373. }));
  374. }
  375. });
  376. }
  377. if (config.openGraph.video.directors && config.openGraph.video.directors.length) {
  378. config.openGraph.video.directors.forEach((director, index) => {
  379. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  380. key: `video:director:0${index}`,
  381. property: "video:director",
  382. content: director
  383. }));
  384. });
  385. }
  386. if (config.openGraph.video.writers && config.openGraph.video.writers.length) {
  387. config.openGraph.video.writers.forEach((writer, index) => {
  388. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  389. key: `video:writer:0${index}`,
  390. property: "video:writer",
  391. content: writer
  392. }));
  393. });
  394. }
  395. if (config.openGraph.video.duration) {
  396. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  397. key: "video:duration",
  398. property: "video:duration",
  399. content: config.openGraph.video.duration.toString()
  400. }));
  401. }
  402. if (config.openGraph.video.releaseDate) {
  403. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  404. key: "video:release_date",
  405. property: "video:release_date",
  406. content: config.openGraph.video.releaseDate
  407. }));
  408. }
  409. if (config.openGraph.video.tags && config.openGraph.video.tags.length) {
  410. config.openGraph.video.tags.forEach((tag, index) => {
  411. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  412. key: `video:tag:0${index}`,
  413. property: "video:tag",
  414. content: tag
  415. }));
  416. });
  417. }
  418. if (config.openGraph.video.series) {
  419. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  420. key: "video:series",
  421. property: "video:series",
  422. content: config.openGraph.video.series
  423. }));
  424. }
  425. }
  426. }
  427. // images
  428. if (config.defaultOpenGraphImageWidth) {
  429. defaults.defaultOpenGraphImageWidth = config.defaultOpenGraphImageWidth;
  430. }
  431. if (config.defaultOpenGraphImageHeight) {
  432. defaults.defaultOpenGraphImageHeight = config.defaultOpenGraphImageHeight;
  433. }
  434. if (config.openGraph.images && config.openGraph.images.length) {
  435. tagsToRender.push(...buildOpenGraphMediaTags('image', config.openGraph.images, {
  436. defaultWidth: defaults.defaultOpenGraphImageWidth,
  437. defaultHeight: defaults.defaultOpenGraphImageHeight
  438. }));
  439. }
  440. // videos
  441. if (config.defaultOpenGraphVideoWidth) {
  442. defaults.defaultOpenGraphVideoWidth = config.defaultOpenGraphVideoWidth;
  443. }
  444. if (config.defaultOpenGraphVideoHeight) {
  445. defaults.defaultOpenGraphVideoHeight = config.defaultOpenGraphVideoHeight;
  446. }
  447. if (config.openGraph.videos && config.openGraph.videos.length) {
  448. tagsToRender.push(...buildOpenGraphMediaTags('video', config.openGraph.videos, {
  449. defaultWidth: defaults.defaultOpenGraphVideoWidth,
  450. defaultHeight: defaults.defaultOpenGraphVideoHeight
  451. }));
  452. }
  453. // audio
  454. if (config.openGraph.audio) {
  455. tagsToRender.push(...buildOpenGraphMediaTags('audio', config.openGraph.audio));
  456. }
  457. if (config.openGraph.locale) {
  458. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  459. key: "og:locale",
  460. property: "og:locale",
  461. content: config.openGraph.locale
  462. }));
  463. }
  464. if (config.openGraph.siteName || config.openGraph.site_name) {
  465. tagsToRender.push( /*#__PURE__*/React.createElement("meta", {
  466. key: "og:site_name",
  467. property: "og:site_name",
  468. content: config.openGraph.siteName || config.openGraph.site_name
  469. }));
  470. }
  471. }
  472. if (config.canonical) {
  473. tagsToRender.push( /*#__PURE__*/React.createElement("link", {
  474. rel: "canonical",
  475. href: config.canonical,
  476. key: "canonical"
  477. }));
  478. }
  479. if (config.additionalMetaTags && config.additionalMetaTags.length > 0) {
  480. config.additionalMetaTags.forEach(_ref => {
  481. var _ref2, _ref3;
  482. let {
  483. keyOverride
  484. } = _ref,
  485. tag = _objectWithoutPropertiesLoose(_ref, _excluded$x);
  486. tagsToRender.push( /*#__PURE__*/React.createElement("meta", _extends({
  487. key: `meta:${(_ref2 = (_ref3 = keyOverride != null ? keyOverride : tag.name) != null ? _ref3 : tag.property) != null ? _ref2 : tag.httpEquiv}`
  488. }, tag)));
  489. });
  490. }
  491. if ((_config$additionalLin = config.additionalLinkTags) != null && _config$additionalLin.length) {
  492. config.additionalLinkTags.forEach(tag => {
  493. var _tag$keyOverride;
  494. tagsToRender.push( /*#__PURE__*/React.createElement("link", _extends({
  495. key: `link${(_tag$keyOverride = tag.keyOverride) != null ? _tag$keyOverride : tag.href}${tag.rel}`
  496. }, tag)));
  497. });
  498. }
  499. return tagsToRender;
  500. };
  501. const WithHead = props => {
  502. return /*#__PURE__*/React.createElement(Head, null, buildTags(props));
  503. };
  504. const DefaultSeo = ({
  505. title,
  506. titleTemplate,
  507. defaultTitle,
  508. themeColor,
  509. dangerouslySetAllPagesToNoIndex: _dangerouslySetAllPagesToNoIndex = false,
  510. dangerouslySetAllPagesToNoFollow: _dangerouslySetAllPagesToNoFollow = false,
  511. description,
  512. canonical,
  513. facebook,
  514. openGraph,
  515. additionalMetaTags,
  516. twitter,
  517. defaultOpenGraphImageWidth,
  518. defaultOpenGraphImageHeight,
  519. defaultOpenGraphVideoWidth,
  520. defaultOpenGraphVideoHeight,
  521. mobileAlternate,
  522. languageAlternates,
  523. additionalLinkTags,
  524. robotsProps
  525. }) => {
  526. return /*#__PURE__*/React.createElement(WithHead, {
  527. title: title,
  528. titleTemplate: titleTemplate,
  529. defaultTitle: defaultTitle,
  530. themeColor: themeColor,
  531. dangerouslySetAllPagesToNoIndex: _dangerouslySetAllPagesToNoIndex,
  532. dangerouslySetAllPagesToNoFollow: _dangerouslySetAllPagesToNoFollow,
  533. description: description,
  534. canonical: canonical,
  535. facebook: facebook,
  536. openGraph: openGraph,
  537. additionalMetaTags: additionalMetaTags,
  538. twitter: twitter,
  539. defaultOpenGraphImageWidth: defaultOpenGraphImageWidth,
  540. defaultOpenGraphImageHeight: defaultOpenGraphImageHeight,
  541. defaultOpenGraphVideoWidth: defaultOpenGraphVideoWidth,
  542. defaultOpenGraphVideoHeight: defaultOpenGraphVideoHeight,
  543. mobileAlternate: mobileAlternate,
  544. languageAlternates: languageAlternates,
  545. additionalLinkTags: additionalLinkTags,
  546. robotsProps: robotsProps
  547. });
  548. };
  549. const NextSeo = ({
  550. title,
  551. themeColor,
  552. noindex: _noindex = false,
  553. nofollow,
  554. robotsProps,
  555. description,
  556. canonical,
  557. openGraph,
  558. facebook,
  559. twitter,
  560. additionalMetaTags,
  561. titleTemplate,
  562. defaultTitle,
  563. mobileAlternate,
  564. languageAlternates,
  565. additionalLinkTags,
  566. useAppDir: _useAppDir = false
  567. }) => {
  568. return /*#__PURE__*/React.createElement(React.Fragment, null, _useAppDir ? buildTags({
  569. title,
  570. themeColor,
  571. noindex: _noindex,
  572. nofollow,
  573. robotsProps,
  574. description,
  575. canonical,
  576. facebook,
  577. openGraph,
  578. additionalMetaTags,
  579. twitter,
  580. titleTemplate,
  581. defaultTitle,
  582. mobileAlternate,
  583. languageAlternates,
  584. additionalLinkTags
  585. }) : /*#__PURE__*/React.createElement(WithHead, {
  586. title: title,
  587. themeColor: themeColor,
  588. noindex: _noindex,
  589. nofollow: nofollow,
  590. robotsProps: robotsProps,
  591. description: description,
  592. canonical: canonical,
  593. facebook: facebook,
  594. openGraph: openGraph,
  595. additionalMetaTags: additionalMetaTags,
  596. twitter: twitter,
  597. titleTemplate: titleTemplate,
  598. defaultTitle: defaultTitle,
  599. mobileAlternate: mobileAlternate,
  600. languageAlternates: languageAlternates,
  601. additionalLinkTags: additionalLinkTags
  602. }));
  603. };
  604. const toJson = (type, jsonld) => {
  605. let data = jsonld;
  606. if (Array.isArray(data) && data.length === 1) {
  607. data = _extends({}, jsonld[0]);
  608. }
  609. const jsonLdObject = Array.isArray(data) ? data.map(item => formatObjectForSchema(type, item)) : formatObjectForSchema(type, data);
  610. return {
  611. __html: JSON.stringify(jsonLdObject, safeJsonLdReplacer)
  612. };
  613. };
  614. const formatObjectForSchema = (type, jsonld) => {
  615. const {
  616. id = undefined
  617. } = jsonld;
  618. const updated = _extends({}, id ? {
  619. '@id': jsonld.id
  620. } : {}, jsonld);
  621. delete updated.id;
  622. return _extends({
  623. '@context': 'https://schema.org',
  624. '@type': type
  625. }, updated);
  626. };
  627. const ESCAPE_ENTITIES = Object.freeze({
  628. '&': '&amp;',
  629. '<': '&lt;',
  630. '>': '&gt;',
  631. '"': '&quot;',
  632. "'": '&apos;'
  633. });
  634. const ESCAPE_REGEX = new RegExp(`[${Object.keys(ESCAPE_ENTITIES).join('')}]`, 'g');
  635. const ESCAPE_REPLACER = t => ESCAPE_ENTITIES[t];
  636. /**
  637. * A replacer for JSON.stringify to strip JSON-LD of illegal HTML entities
  638. * per https://www.w3.org/TR/json-ld11/#restrictions-for-contents-of-json-ld-script-elements
  639. */
  640. const safeJsonLdReplacer = (() => {
  641. // Replace per https://www.w3.org/TR/json-ld11/#restrictions-for-contents-of-json-ld-script-elements
  642. // Solution from https://stackoverflow.com/a/5499821/864313
  643. return (_, value) => {
  644. switch (typeof value) {
  645. case 'object':
  646. // Omit null values.
  647. if (value === null) {
  648. return undefined;
  649. }
  650. return value;
  651. // JSON.stringify will recursively call replacer.
  652. case 'number':
  653. case 'boolean':
  654. case 'bigint':
  655. return value;
  656. // These values are not risky.
  657. case 'string':
  658. return value.replace(ESCAPE_REGEX, ESCAPE_REPLACER);
  659. default:
  660. {
  661. // JSON.stringify will remove this element.
  662. return undefined;
  663. }
  664. }
  665. };
  666. })();
  667. const _excluded$w = ["type", "keyOverride", "scriptKey", "scriptId", "dataArray", "useAppDir"];
  668. function JsonLd(_ref) {
  669. let {
  670. type = 'Thing',
  671. keyOverride,
  672. scriptKey,
  673. scriptId = undefined,
  674. dataArray,
  675. useAppDir = false
  676. } = _ref,
  677. rest = _objectWithoutPropertiesLoose(_ref, _excluded$w);
  678. const JsonLdScript = () => /*#__PURE__*/React.createElement("script", {
  679. type: "application/ld+json",
  680. id: scriptId,
  681. "data-testid": scriptId,
  682. dangerouslySetInnerHTML: toJson(type, dataArray === undefined ? _extends({}, rest) : dataArray),
  683. key: `jsonld-${scriptKey}${keyOverride ? `-${keyOverride}` : ''}`
  684. });
  685. if (useAppDir) {
  686. return /*#__PURE__*/React.createElement(JsonLdScript, null);
  687. }
  688. return /*#__PURE__*/React.createElement(Head, null, JsonLdScript());
  689. }
  690. /**
  691. * Generate author information
  692. * @param author
  693. * @returns
  694. */
  695. function generateAuthorInfo(author) {
  696. if (typeof author === 'string') {
  697. return {
  698. '@type': 'Person',
  699. name: author
  700. };
  701. } else if (!!author.name) {
  702. var _author$type;
  703. return {
  704. '@type': (_author$type = author == null ? void 0 : author.type) != null ? _author$type : 'Person',
  705. name: author.name,
  706. url: author == null ? void 0 : author.url
  707. };
  708. }
  709. return;
  710. }
  711. function setAuthor(author) {
  712. if (Array.isArray(author)) {
  713. return author.map(item => generateAuthorInfo(item)).filter(item => !!item);
  714. } else if (author) {
  715. return generateAuthorInfo(author);
  716. }
  717. return;
  718. }
  719. function setImage(image) {
  720. if (image) {
  721. return {
  722. '@type': 'ImageObject',
  723. url: image
  724. };
  725. }
  726. return undefined;
  727. }
  728. function setPublisher(publisherName, publisherLogo) {
  729. if (!publisherName) {
  730. return undefined;
  731. }
  732. return {
  733. '@type': 'Organization',
  734. name: publisherName,
  735. logo: setImage(publisherLogo)
  736. };
  737. }
  738. function setReviewRating(rating) {
  739. if (rating) {
  740. return _extends({}, rating, {
  741. '@type': 'Rating'
  742. });
  743. }
  744. return undefined;
  745. }
  746. const _excluded$v = ["reviewRating", "author", "publisher"];
  747. function setReviews(reviews) {
  748. function mapReview(_ref) {
  749. let {
  750. reviewRating,
  751. author,
  752. publisher
  753. } = _ref,
  754. rest = _objectWithoutPropertiesLoose(_ref, _excluded$v);
  755. return _extends({}, rest, {
  756. '@type': 'Review'
  757. }, author && {
  758. author: setAuthor(author)
  759. }, reviewRating && {
  760. reviewRating: setReviewRating(reviewRating)
  761. }, publisher && {
  762. publisher: setPublisher(publisher.name)
  763. });
  764. }
  765. if (Array.isArray(reviews)) {
  766. return reviews.map(mapReview);
  767. } else if (reviews) {
  768. return mapReview(reviews);
  769. }
  770. return undefined;
  771. }
  772. function setNutrition(calories) {
  773. if (calories) {
  774. return {
  775. '@type': 'NutritionInformation',
  776. calories: `${calories} calories`
  777. };
  778. }
  779. return undefined;
  780. }
  781. function setAggregateRating(aggregateRating) {
  782. if (aggregateRating) {
  783. return {
  784. '@type': 'AggregateRating',
  785. ratingCount: aggregateRating.ratingCount,
  786. reviewCount: aggregateRating.reviewCount,
  787. bestRating: aggregateRating.bestRating,
  788. ratingValue: aggregateRating.ratingValue
  789. };
  790. }
  791. return undefined;
  792. }
  793. function setClip(clips) {
  794. function mapClip(clip) {
  795. return _extends({}, clip, {
  796. '@type': 'Clip'
  797. });
  798. }
  799. if (Array.isArray(clips)) {
  800. return clips.map(mapClip);
  801. } else if (clips) {
  802. return mapClip(clips);
  803. }
  804. return undefined;
  805. }
  806. function setInteractionStatistic(watchCount) {
  807. if (watchCount) {
  808. return {
  809. '@type': 'InteractionCounter',
  810. interactionType: 'https://schema.org/WatchAction',
  811. userInteractionCount: watchCount
  812. };
  813. }
  814. return undefined;
  815. }
  816. function setBroadcastEvent(publication) {
  817. function mapBroadcastEvent(publication) {
  818. return _extends({}, publication, {
  819. '@type': 'BroadcastEvent'
  820. });
  821. }
  822. if (publication) {
  823. if (Array.isArray(publication)) {
  824. return publication.map(mapBroadcastEvent);
  825. }
  826. return mapBroadcastEvent(publication);
  827. }
  828. return undefined;
  829. }
  830. const _excluded$u = ["thumbnailUrls", "hasPart", "watchCount", "publication"];
  831. function setVideo(video, setContext = false) {
  832. function mapVideo(_ref, context) {
  833. let {
  834. thumbnailUrls,
  835. hasPart,
  836. watchCount,
  837. publication
  838. } = _ref,
  839. rest = _objectWithoutPropertiesLoose(_ref, _excluded$u);
  840. return _extends({}, rest, {
  841. '@type': 'VideoObject'
  842. }, context && {
  843. '@context': 'https://schema.org'
  844. }, {
  845. thumbnailUrl: thumbnailUrls,
  846. hasPart: setClip(hasPart),
  847. interactionStatistic: setInteractionStatistic(watchCount),
  848. publication: setBroadcastEvent(publication)
  849. });
  850. }
  851. if (video) {
  852. return mapVideo(video, setContext);
  853. }
  854. return undefined;
  855. }
  856. function setInstruction(instruction) {
  857. if (instruction) {
  858. return _extends({}, instruction, {
  859. '@type': 'HowToStep'
  860. });
  861. }
  862. return undefined;
  863. }
  864. const _excluded$t = ["type", "keyOverride", "ofType", "data"],
  865. _excluded2$1 = ["authorName", "images", "yields", "category", "calories", "aggregateRating", "video", "ingredients", "instructions", "cuisine"];
  866. function CarouselJsonLd(_ref) {
  867. let {
  868. type = 'Carousel',
  869. keyOverride,
  870. ofType,
  871. data
  872. } = _ref,
  873. rest = _objectWithoutPropertiesLoose(_ref, _excluded$t);
  874. function generateList(data, ofType) {
  875. switch (ofType) {
  876. case 'default':
  877. return data.map((item, index) => ({
  878. '@type': 'ListItem',
  879. position: `${index + 1}`,
  880. url: item.url
  881. }));
  882. case 'course':
  883. return data.map((item, index) => ({
  884. '@type': 'ListItem',
  885. position: `${index + 1}`,
  886. item: {
  887. '@context': 'https://schema.org',
  888. '@type': 'Course',
  889. url: item.url,
  890. name: item.courseName,
  891. description: item.description,
  892. provider: {
  893. '@type': 'Organization',
  894. name: item.providerName,
  895. sameAs: item.providerUrl
  896. }
  897. }
  898. }));
  899. case 'movie':
  900. return data.map((item, index) => ({
  901. '@type': 'ListItem',
  902. position: `${index + 1}`,
  903. item: {
  904. '@context': 'https://schema.org',
  905. '@type': 'Movie',
  906. name: item.name,
  907. url: item.url,
  908. image: item.image,
  909. dateCreated: item.dateCreated,
  910. director: item.director ? Array.isArray(item.director) ? item.director.map(director => ({
  911. '@type': 'Person',
  912. name: director.name
  913. })) : {
  914. '@type': 'Person',
  915. name: item.director.name
  916. } : undefined,
  917. review: setReviews(item.review)
  918. }
  919. }));
  920. case 'recipe':
  921. return data.map((_ref2, index) => {
  922. let {
  923. authorName,
  924. images,
  925. yields,
  926. category,
  927. calories,
  928. aggregateRating,
  929. video,
  930. ingredients,
  931. instructions,
  932. cuisine
  933. } = _ref2,
  934. rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);
  935. return {
  936. '@type': 'ListItem',
  937. position: `${index + 1}`,
  938. item: _extends({
  939. '@context': 'https://schema.org',
  940. '@type': 'Recipe'
  941. }, rest, {
  942. author: setAuthor(authorName),
  943. image: images,
  944. recipeYield: yields,
  945. recipeCategory: category,
  946. recipeCuisine: cuisine,
  947. nutrition: setNutrition(calories),
  948. aggregateRating: setAggregateRating(aggregateRating),
  949. video: setVideo(video),
  950. recipeIngredient: ingredients,
  951. recipeInstructions: instructions.map(setInstruction)
  952. })
  953. };
  954. });
  955. }
  956. }
  957. const jsonLdData = _extends({
  958. '@type': 'ItemList',
  959. itemListElement: generateList(data, ofType)
  960. }, rest);
  961. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  962. type: type,
  963. keyOverride: keyOverride
  964. }, jsonLdData, {
  965. scriptKey: "Carousel"
  966. }));
  967. }
  968. const _excluded$s = ["type", "keyOverride", "url", "title", "images", "section", "dateCreated", "datePublished", "dateModified", "authorName", "authorType", "publisherName", "publisherLogo", "body", "isAccessibleForFree"];
  969. function NewsArticleJsonLd(_ref) {
  970. let {
  971. type = 'NewsArticle',
  972. keyOverride,
  973. url,
  974. title,
  975. images,
  976. section,
  977. dateCreated,
  978. datePublished,
  979. dateModified,
  980. authorName,
  981. publisherName,
  982. publisherLogo,
  983. body,
  984. isAccessibleForFree
  985. } = _ref,
  986. rest = _objectWithoutPropertiesLoose(_ref, _excluded$s);
  987. const data = _extends({}, rest, {
  988. mainEntityOfPage: {
  989. '@type': 'WebPage',
  990. '@id': url
  991. },
  992. headline: title,
  993. image: images,
  994. articleSection: section,
  995. dateCreated: dateCreated || datePublished,
  996. datePublished: datePublished,
  997. dateModified: dateModified || datePublished,
  998. author: setAuthor(authorName),
  999. publisher: setPublisher(publisherName, publisherLogo),
  1000. articleBody: body,
  1001. isAccessibleForFree: isAccessibleForFree
  1002. });
  1003. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1004. type: type,
  1005. keyOverride: keyOverride
  1006. }, data, {
  1007. scriptKey: "NewsArticle"
  1008. }));
  1009. }
  1010. const _excluded$r = ["type", "keyOverride", "baseSalary", "hiringOrganization", "applicantLocationRequirements", "experienceRequirements", "jobLocation"];
  1011. function JobPostingJsonLd(_ref) {
  1012. let {
  1013. type = 'JobPosting',
  1014. keyOverride,
  1015. baseSalary,
  1016. hiringOrganization,
  1017. applicantLocationRequirements,
  1018. experienceRequirements,
  1019. jobLocation
  1020. } = _ref,
  1021. rest = _objectWithoutPropertiesLoose(_ref, _excluded$r);
  1022. function setBaseSalary(baseSalary) {
  1023. if (baseSalary) {
  1024. return {
  1025. '@type': 'MonetaryAmount',
  1026. currency: baseSalary.currency,
  1027. value: _extends({
  1028. '@type': 'QuantitativeValue',
  1029. unitText: baseSalary.unitText
  1030. }, Array.isArray(baseSalary.value) ? {
  1031. minValue: baseSalary.value[0],
  1032. maxValue: baseSalary.value[1]
  1033. } : {
  1034. value: baseSalary.value
  1035. })
  1036. };
  1037. }
  1038. return undefined;
  1039. }
  1040. function setHiringOrganization(org) {
  1041. return {
  1042. '@type': 'Organization',
  1043. name: org.name,
  1044. sameAs: org.sameAs,
  1045. logo: org.logo
  1046. };
  1047. }
  1048. function setJobLocation(location) {
  1049. if (location) {
  1050. return {
  1051. '@type': 'Place',
  1052. address: {
  1053. '@type': 'PostalAddress',
  1054. addressCountry: location.addressCountry,
  1055. addressLocality: location.addressLocality,
  1056. addressRegion: location.addressRegion,
  1057. postalCode: location.postalCode,
  1058. streetAddress: location.streetAddress
  1059. }
  1060. };
  1061. }
  1062. return undefined;
  1063. }
  1064. function setApplicantLocationRequirements(requirements) {
  1065. if (requirements) {
  1066. return {
  1067. '@type': 'Country',
  1068. name: requirements
  1069. };
  1070. }
  1071. return undefined;
  1072. }
  1073. function setOccupationalExperienceRequirements(requirements) {
  1074. if (requirements) {
  1075. return {
  1076. '@type': requirements['@type'] ? requirements['@type'] : 'OccupationalExperienceRequirements',
  1077. monthsOfExperience: requirements.minimumMonthsOfExperience
  1078. };
  1079. }
  1080. return undefined;
  1081. }
  1082. function setEducationalOccupationalCredential(requirements) {
  1083. if (requirements) {
  1084. return {
  1085. '@type': requirements['@type'] ? requirements['@type'] : 'EducationalOccupationalCredential',
  1086. credentialCategory: requirements.credentialCategory
  1087. };
  1088. }
  1089. return undefined;
  1090. }
  1091. const data = _extends({}, rest, {
  1092. baseSalary: setBaseSalary(baseSalary),
  1093. hiringOrganization: setHiringOrganization(hiringOrganization),
  1094. jobLocation: setJobLocation(jobLocation),
  1095. applicantLocationRequirements: setApplicantLocationRequirements(applicantLocationRequirements),
  1096. experienceRequirements: setOccupationalExperienceRequirements(experienceRequirements == null ? void 0 : experienceRequirements.occupational),
  1097. educationRequirements: setEducationalOccupationalCredential(experienceRequirements == null ? void 0 : experienceRequirements.educational),
  1098. experienceInPlaceOfEducation: experienceRequirements == null ? void 0 : experienceRequirements.experienceInPlaceOfEducation
  1099. });
  1100. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1101. type: type,
  1102. keyOverride: keyOverride
  1103. }, data, {
  1104. scriptKey: "JobPosting"
  1105. }));
  1106. }
  1107. function setAddress(address) {
  1108. if (!address) return undefined;
  1109. if (!Array.isArray(address)) return toPostalAddress(address);
  1110. // If array of one address, replace with single address
  1111. if (address.length === 1) return toPostalAddress(address[0]);
  1112. // If array, return mapped array of PostalAddresses
  1113. return address.map(toPostalAddress);
  1114. }
  1115. function toPostalAddress(address) {
  1116. if (typeof address === 'string') return address;
  1117. return _extends({
  1118. '@type': 'PostalAddress'
  1119. }, address);
  1120. }
  1121. function setGeo(geo) {
  1122. if (geo) {
  1123. return _extends({}, geo, {
  1124. '@type': 'GeoCoordinates'
  1125. });
  1126. }
  1127. return undefined;
  1128. }
  1129. function setAction(action) {
  1130. if (action) {
  1131. return {
  1132. '@type': action.actionType,
  1133. name: action.actionName,
  1134. target: action.target
  1135. };
  1136. }
  1137. return undefined;
  1138. }
  1139. function setGeoCircle(geoCircle) {
  1140. if (geoCircle) {
  1141. return {
  1142. '@type': 'GeoCircle',
  1143. geoMidpoint: {
  1144. '@type': 'GeoCoordinates',
  1145. latitude: geoCircle.geoMidpoint.latitude,
  1146. longitude: geoCircle.geoMidpoint.longitude
  1147. },
  1148. geoRadius: geoCircle.geoRadius
  1149. };
  1150. }
  1151. return undefined;
  1152. }
  1153. function setOffer(offer) {
  1154. function setPriceSpecification(priceSpecification) {
  1155. if (priceSpecification) {
  1156. return {
  1157. '@type': priceSpecification.type,
  1158. priceCurrency: priceSpecification.priceCurrency,
  1159. price: priceSpecification.price
  1160. };
  1161. }
  1162. return undefined;
  1163. }
  1164. function setItemOffered(itemOffered) {
  1165. if (itemOffered) {
  1166. return _extends({}, itemOffered, {
  1167. '@type': 'Service'
  1168. });
  1169. }
  1170. return undefined;
  1171. }
  1172. if (offer) {
  1173. return _extends({}, offer, {
  1174. '@type': 'Offer',
  1175. priceSpecification: setPriceSpecification(offer.priceSpecification),
  1176. itemOffered: setItemOffered(offer.itemOffered)
  1177. });
  1178. }
  1179. return undefined;
  1180. }
  1181. function setOpeningHours(openingHours) {
  1182. if (openingHours) {
  1183. return _extends({}, openingHours, {
  1184. '@type': 'OpeningHoursSpecification'
  1185. });
  1186. }
  1187. return undefined;
  1188. }
  1189. const _excluded$q = ["type", "keyOverride", "address", "geo", "rating", "review", "action", "areaServed", "makesOffer", "openingHours", "images"];
  1190. function LocalBusinessJsonLd(_ref) {
  1191. let {
  1192. type = 'LocalBusiness',
  1193. keyOverride,
  1194. address,
  1195. geo,
  1196. rating,
  1197. review,
  1198. action,
  1199. areaServed,
  1200. makesOffer,
  1201. openingHours,
  1202. images
  1203. } = _ref,
  1204. rest = _objectWithoutPropertiesLoose(_ref, _excluded$q);
  1205. const data = _extends({}, rest, {
  1206. image: images,
  1207. address: setAddress(address),
  1208. geo: setGeo(geo),
  1209. aggregateRating: setAggregateRating(rating),
  1210. review: setReviews(review),
  1211. potentialAction: setAction(action),
  1212. areaServed: areaServed && areaServed.map(setGeoCircle),
  1213. makesOffer: makesOffer == null ? void 0 : makesOffer.map(setOffer),
  1214. openingHoursSpecification: Array.isArray(openingHours) ? openingHours.map(setOpeningHours) : setOpeningHours(openingHours)
  1215. });
  1216. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1217. type: type,
  1218. keyOverride: keyOverride
  1219. }, data, {
  1220. scriptKey: "LocalBusiness"
  1221. }));
  1222. }
  1223. const _excluded$p = ["type", "keyOverride", "mainEntity"],
  1224. _excluded2 = ["upvoteCount"];
  1225. function QAPageJsonLd(_ref) {
  1226. var _mainEntity$author, _mainEntity$acceptedA, _mainEntity$acceptedA2;
  1227. let {
  1228. type = 'QAPage',
  1229. keyOverride,
  1230. mainEntity
  1231. } = _ref,
  1232. rest = _objectWithoutPropertiesLoose(_ref, _excluded$p);
  1233. const data = _extends({}, rest, {
  1234. mainEntity: _extends({}, mainEntity, {
  1235. '@type': 'Question',
  1236. author: setAuthor((_mainEntity$author = mainEntity.author) == null ? void 0 : _mainEntity$author.name)
  1237. }, mainEntity.acceptedAnswer && {
  1238. acceptedAnswer: _extends({}, mainEntity.acceptedAnswer, {
  1239. '@type': 'Answer',
  1240. author: setAuthor((_mainEntity$acceptedA = mainEntity.acceptedAnswer) == null ? void 0 : (_mainEntity$acceptedA2 = _mainEntity$acceptedA.author) == null ? void 0 : _mainEntity$acceptedA2.name)
  1241. })
  1242. }, mainEntity.suggestedAnswer && {
  1243. suggestedAnswer: mainEntity.suggestedAnswer.map(_ref2 => {
  1244. var _rest$author;
  1245. let {
  1246. upvoteCount
  1247. } = _ref2,
  1248. rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
  1249. return _extends({}, rest, {
  1250. '@type': 'Answer',
  1251. upvoteCount: upvoteCount || 0,
  1252. author: setAuthor((_rest$author = rest.author) == null ? void 0 : _rest$author.name)
  1253. });
  1254. })
  1255. })
  1256. });
  1257. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1258. type: type,
  1259. keyOverride: keyOverride
  1260. }, data, {
  1261. scriptKey: "QAPage"
  1262. }));
  1263. }
  1264. function setItemListElements(items) {
  1265. if (items && items.length) {
  1266. return items.map(item => ({
  1267. '@type': 'ListItem',
  1268. position: item.position,
  1269. item: {
  1270. '@id': item.item,
  1271. name: item.name
  1272. }
  1273. }));
  1274. }
  1275. return undefined;
  1276. }
  1277. const _excluded$o = ["type", "keyOverride", "breadcrumb"];
  1278. function ProfilePageJsonLd(_ref) {
  1279. let {
  1280. type = 'ProfilePage',
  1281. keyOverride,
  1282. breadcrumb
  1283. } = _ref,
  1284. rest = _objectWithoutPropertiesLoose(_ref, _excluded$o);
  1285. const data = _extends({}, rest, {
  1286. breadcrumb: Array.isArray(breadcrumb) ? {
  1287. '@type': 'BreadcrumbList',
  1288. itemListElement: setItemListElements(breadcrumb)
  1289. } : breadcrumb
  1290. });
  1291. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1292. type: type,
  1293. keyOverride: keyOverride
  1294. }, data, {
  1295. scriptKey: "ProfilePage"
  1296. }));
  1297. }
  1298. const _excluded$n = ["type", "keyOverride", "potentialActions"];
  1299. function SiteLinksSearchBoxJsonLd(_ref) {
  1300. let {
  1301. type = 'WebSite',
  1302. keyOverride,
  1303. potentialActions
  1304. } = _ref,
  1305. rest = _objectWithoutPropertiesLoose(_ref, _excluded$n);
  1306. function setPotentialAction(action) {
  1307. if (action) {
  1308. const {
  1309. target,
  1310. queryInput
  1311. } = action;
  1312. return {
  1313. '@type': 'SearchAction',
  1314. target: `${target}={${queryInput}}`,
  1315. 'query-input': `required name=${queryInput}`
  1316. };
  1317. }
  1318. return undefined;
  1319. }
  1320. const data = _extends({}, rest, {
  1321. potentialAction: potentialActions.map(setPotentialAction)
  1322. });
  1323. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1324. type: type,
  1325. keyOverride: keyOverride
  1326. }, data, {
  1327. scriptKey: "jsonld-siteLinksSearchBox"
  1328. }));
  1329. }
  1330. const _excluded$m = ["type", "keyOverride", "authorName", "images", "yields", "category", "cuisine", "calories", "aggregateRating", "video", "ingredients", "instructions"];
  1331. function RecipeJsonLd(_ref) {
  1332. let {
  1333. type = 'Recipe',
  1334. keyOverride,
  1335. authorName,
  1336. images,
  1337. yields,
  1338. category,
  1339. cuisine,
  1340. calories,
  1341. aggregateRating,
  1342. video,
  1343. ingredients,
  1344. instructions
  1345. } = _ref,
  1346. rest = _objectWithoutPropertiesLoose(_ref, _excluded$m);
  1347. const data = _extends({}, rest, {
  1348. author: setAuthor(authorName),
  1349. image: images,
  1350. recipeYield: yields,
  1351. recipeCategory: category,
  1352. recipeCuisine: cuisine,
  1353. nutrition: setNutrition(calories),
  1354. aggregateRating: setAggregateRating(aggregateRating),
  1355. video: setVideo(video),
  1356. recipeIngredient: ingredients,
  1357. recipeInstructions: instructions ? instructions.map(setInstruction) : undefined
  1358. });
  1359. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1360. type: type,
  1361. keyOverride: keyOverride
  1362. }, data, {
  1363. scriptKey: "recipe"
  1364. }));
  1365. }
  1366. function setLocation(location) {
  1367. if (!location) {
  1368. return undefined;
  1369. }
  1370. if (typeof location === 'string') {
  1371. return location;
  1372. }
  1373. if ('url' in location) {
  1374. return setVirtualLocation(location);
  1375. } else {
  1376. return setPlace(location);
  1377. }
  1378. }
  1379. function setVirtualLocation(location) {
  1380. return _extends({}, location, {
  1381. '@type': 'VirtualLocation'
  1382. });
  1383. }
  1384. function setPlace(location) {
  1385. return _extends({}, location, {
  1386. address: setAddress(location.address),
  1387. '@type': 'Place'
  1388. });
  1389. }
  1390. const _excluded$l = ["type"];
  1391. function setPerformer(performer) {
  1392. if (performer) {
  1393. const {
  1394. type
  1395. } = performer,
  1396. restPerformer = _objectWithoutPropertiesLoose(performer, _excluded$l);
  1397. return _extends({}, restPerformer, {
  1398. '@type': type || 'PerformingGroup'
  1399. });
  1400. }
  1401. return undefined;
  1402. }
  1403. const _excluded$k = ["seller"];
  1404. function setOffers(offers) {
  1405. function mapOffer(_ref) {
  1406. let {
  1407. seller
  1408. } = _ref,
  1409. rest = _objectWithoutPropertiesLoose(_ref, _excluded$k);
  1410. return _extends({}, rest, {
  1411. '@type': 'Offer'
  1412. }, seller && {
  1413. seller: {
  1414. '@type': 'Organization',
  1415. name: seller.name
  1416. }
  1417. });
  1418. }
  1419. if (Array.isArray(offers)) {
  1420. return offers.map(mapOffer);
  1421. } else if (offers) {
  1422. return mapOffer(offers);
  1423. }
  1424. return undefined;
  1425. }
  1426. function setAggregateOffer(aggregateOffer) {
  1427. if (aggregateOffer) {
  1428. return {
  1429. '@type': 'AggregateOffer',
  1430. priceCurrency: aggregateOffer.priceCurrency,
  1431. highPrice: aggregateOffer.highPrice,
  1432. lowPrice: aggregateOffer.lowPrice,
  1433. offerCount: aggregateOffer.offerCount,
  1434. offers: setOffers(aggregateOffer.offers)
  1435. };
  1436. }
  1437. return undefined;
  1438. }
  1439. const _excluded$j = ["type"];
  1440. function setOrganizer(organizer) {
  1441. if (organizer) {
  1442. const {
  1443. type
  1444. } = organizer,
  1445. restOrganizer = _objectWithoutPropertiesLoose(organizer, _excluded$j);
  1446. return _extends({}, restOrganizer, {
  1447. '@type': type || 'Person'
  1448. });
  1449. }
  1450. return undefined;
  1451. }
  1452. const _excluded$i = ["type", "keyOverride", "location", "images", "offers", "aggregateOffer", "performers", "organizer", "eventStatus", "eventAttendanceMode"];
  1453. function EventJsonLd(_ref) {
  1454. let {
  1455. type = 'Event',
  1456. keyOverride,
  1457. location,
  1458. images,
  1459. offers,
  1460. aggregateOffer,
  1461. performers,
  1462. organizer,
  1463. eventStatus,
  1464. eventAttendanceMode
  1465. } = _ref,
  1466. rest = _objectWithoutPropertiesLoose(_ref, _excluded$i);
  1467. const data = _extends({}, rest, {
  1468. location: setLocation(location),
  1469. image: images,
  1470. offers: offers ? setOffers(offers) : setAggregateOffer(aggregateOffer),
  1471. performer: Array.isArray(performers) ? performers.map(setPerformer) : setPerformer(performers),
  1472. organizer: Array.isArray(organizer) ? organizer.map(setOrganizer) : setOrganizer(organizer),
  1473. eventStatus: eventStatus ? `https://schema.org/${eventStatus}` : undefined,
  1474. eventAttendanceMode: eventAttendanceMode ? `https://schema.org/${eventAttendanceMode}` : undefined
  1475. });
  1476. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1477. type: type,
  1478. keyOverride: keyOverride
  1479. }, data, {
  1480. scriptKey: "Event"
  1481. }));
  1482. }
  1483. function setContactPoint(contactPoint) {
  1484. if (contactPoint) {
  1485. return _extends({}, contactPoint, {
  1486. '@type': 'ContactPoint'
  1487. });
  1488. }
  1489. return undefined;
  1490. }
  1491. const _excluded$h = ["type", "keyOverride", "contactPoint"];
  1492. function CorporateContactJsonLd(_ref) {
  1493. let {
  1494. type = 'Organization',
  1495. keyOverride,
  1496. contactPoint
  1497. } = _ref,
  1498. rest = _objectWithoutPropertiesLoose(_ref, _excluded$h);
  1499. const data = _extends({}, rest, {
  1500. contactPoint: contactPoint.map(setContactPoint)
  1501. });
  1502. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1503. type: type,
  1504. keyOverride: keyOverride
  1505. }, data, {
  1506. scriptKey: "CorporateContact"
  1507. }));
  1508. }
  1509. function setCreativeWork(creativeWork) {
  1510. if (creativeWork) {
  1511. return _extends({}, creativeWork, {
  1512. '@type': 'CreativeWork'
  1513. });
  1514. }
  1515. return undefined;
  1516. }
  1517. const _excluded$g = ["type", "keyOverride", "hasPart"];
  1518. function CollectionPageJsonLd(_ref) {
  1519. let {
  1520. type = 'CollectionPage',
  1521. keyOverride,
  1522. hasPart
  1523. } = _ref,
  1524. rest = _objectWithoutPropertiesLoose(_ref, _excluded$g);
  1525. const data = _extends({}, rest, {
  1526. hasPart: hasPart.map(setCreativeWork)
  1527. });
  1528. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1529. type: type,
  1530. keyOverride: keyOverride
  1531. }, data, {
  1532. scriptKey: "CollectionPage"
  1533. }));
  1534. }
  1535. function setManufacturer(manufacturer) {
  1536. if (manufacturer && (manufacturer.manufacturerName || manufacturer.manufacturerLogo)) {
  1537. return {
  1538. '@type': 'Organization',
  1539. name: manufacturer.manufacturerName,
  1540. logo: setImage(manufacturer.manufacturerLogo)
  1541. };
  1542. }
  1543. return undefined;
  1544. }
  1545. function setBrand(brand) {
  1546. if (brand) {
  1547. return {
  1548. '@type': 'Brand',
  1549. name: brand
  1550. };
  1551. }
  1552. return undefined;
  1553. }
  1554. const _excluded$f = ["type", "keyOverride", "images", "brand", "reviews", "aggregateRating", "manufacturerLogo", "manufacturerName", "offers", "aggregateOffer", "productName"];
  1555. function ProductJsonLd(_ref) {
  1556. let {
  1557. type = 'Product',
  1558. keyOverride,
  1559. images,
  1560. brand,
  1561. reviews,
  1562. aggregateRating,
  1563. manufacturerLogo,
  1564. manufacturerName,
  1565. offers,
  1566. aggregateOffer,
  1567. productName
  1568. } = _ref,
  1569. rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
  1570. const data = _extends({}, rest, {
  1571. image: images,
  1572. brand: setBrand(brand),
  1573. review: setReviews(reviews),
  1574. aggregateRating: setAggregateRating(aggregateRating),
  1575. manufacturer: setManufacturer({
  1576. manufacturerLogo,
  1577. manufacturerName
  1578. }),
  1579. offers: offers ? setOffers(offers) : setAggregateOffer(aggregateOffer),
  1580. name: productName
  1581. });
  1582. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1583. type: type,
  1584. keyOverride: keyOverride
  1585. }, data, {
  1586. scriptKey: "Product"
  1587. }));
  1588. }
  1589. const _excluded$e = ["type", "keyOverride", "priceCurrency", "price", "aggregateRating", "review"];
  1590. function SoftwareAppJsonLd(_ref) {
  1591. let {
  1592. type = 'SoftwareApplication',
  1593. keyOverride,
  1594. priceCurrency,
  1595. price,
  1596. aggregateRating,
  1597. review
  1598. } = _ref,
  1599. rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
  1600. const data = _extends({}, rest, {
  1601. offers: {
  1602. '@type': 'Offer',
  1603. price,
  1604. priceCurrency: priceCurrency
  1605. },
  1606. aggregateRating: setAggregateRating(aggregateRating),
  1607. review: setReviews(review)
  1608. });
  1609. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1610. type: type,
  1611. keyOverride: keyOverride
  1612. }, data, {
  1613. scriptKey: "SoftwareApp"
  1614. }));
  1615. }
  1616. const _excluded$d = ["type", "keyOverride"];
  1617. function VideoJsonLd(_ref) {
  1618. let {
  1619. type = 'Video',
  1620. keyOverride
  1621. } = _ref,
  1622. rest = _objectWithoutPropertiesLoose(_ref, _excluded$d);
  1623. const data = setVideo(rest, true);
  1624. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1625. type: type,
  1626. keyOverride: keyOverride
  1627. }, data, {
  1628. scriptKey: "Video"
  1629. }));
  1630. }
  1631. function setProducer(producer) {
  1632. if (producer) {
  1633. return {
  1634. '@type': 'Organization',
  1635. sameAs: producer.url,
  1636. name: producer.name
  1637. };
  1638. }
  1639. return undefined;
  1640. }
  1641. function setProvider(provider) {
  1642. if (provider) {
  1643. return {
  1644. '@type': provider.type || 'Organization',
  1645. name: provider.name,
  1646. sameAs: provider.url
  1647. };
  1648. }
  1649. return undefined;
  1650. }
  1651. const _excluded$c = ["type", "keyOverride", "aggregateRating", "trailer", "reviews", "image", "authorName", "provider", "producerName", "producerUrl", "offers", "operatingSystemName", "platformName", "translatorName", "languageName", "genreName", "publisherName"];
  1652. function VideoGameJsonLd(_ref) {
  1653. let {
  1654. type = 'VideoGame',
  1655. keyOverride,
  1656. aggregateRating,
  1657. trailer,
  1658. reviews,
  1659. image,
  1660. authorName,
  1661. provider,
  1662. producerName,
  1663. producerUrl,
  1664. offers,
  1665. operatingSystemName,
  1666. platformName,
  1667. translatorName,
  1668. languageName,
  1669. genreName,
  1670. publisherName
  1671. } = _ref,
  1672. rest = _objectWithoutPropertiesLoose(_ref, _excluded$c);
  1673. const data = _extends({}, rest, {
  1674. aggregateRating: setAggregateRating(aggregateRating),
  1675. trailer: setVideo(trailer),
  1676. review: setReviews(reviews),
  1677. image: setImage(image),
  1678. author: setAuthor(authorName),
  1679. provider: setProvider(provider),
  1680. producer: setProducer({
  1681. name: producerName,
  1682. url: producerUrl
  1683. }),
  1684. offers: setOffers(offers),
  1685. operatingSystem: operatingSystemName,
  1686. gamePlatform: platformName,
  1687. translator: translatorName,
  1688. inLanguage: languageName,
  1689. genre: genreName,
  1690. publisher: publisherName
  1691. });
  1692. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1693. type: type,
  1694. keyOverride: keyOverride
  1695. }, data, {
  1696. scriptKey: "VideoGame"
  1697. }));
  1698. }
  1699. function setContactPoints(contactPoint) {
  1700. if (contactPoint && contactPoint.length) {
  1701. return contactPoint.map(contactPoint => _extends({
  1702. '@type': 'ContactPoint'
  1703. }, contactPoint));
  1704. }
  1705. return undefined;
  1706. }
  1707. const _excluded$b = ["type", "keyOverride", "address", "contactPoints", "contactPoint"];
  1708. function OrganizationJsonLd(_ref) {
  1709. let {
  1710. type = 'Organization',
  1711. keyOverride,
  1712. address,
  1713. contactPoints,
  1714. contactPoint
  1715. } = _ref,
  1716. rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
  1717. const data = _extends({}, rest, {
  1718. address: setAddress(address),
  1719. contactPoint: setContactPoints(contactPoint || contactPoints)
  1720. });
  1721. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1722. type: type,
  1723. keyOverride: keyOverride
  1724. }, data, {
  1725. scriptKey: "organization"
  1726. }));
  1727. }
  1728. function setQuestions(questions) {
  1729. if (questions && questions.length) {
  1730. return questions.map(question => ({
  1731. '@type': 'Question',
  1732. name: question.questionName,
  1733. acceptedAnswer: {
  1734. '@type': 'Answer',
  1735. text: question.acceptedAnswerText
  1736. }
  1737. }));
  1738. }
  1739. return undefined;
  1740. }
  1741. const _excluded$a = ["type", "keyOverride", "mainEntity"];
  1742. function FAQPageJsonLd(_ref) {
  1743. let {
  1744. type = 'FAQPage',
  1745. keyOverride,
  1746. mainEntity
  1747. } = _ref,
  1748. rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
  1749. const data = _extends({}, rest, {
  1750. mainEntity: setQuestions(mainEntity)
  1751. });
  1752. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1753. type: type,
  1754. keyOverride: keyOverride
  1755. }, data, {
  1756. scriptKey: "faq-page"
  1757. }));
  1758. }
  1759. const _excluded$9 = ["type", "keyOverride"];
  1760. function LogoJsonLd(_ref) {
  1761. let {
  1762. type = 'Organization',
  1763. keyOverride
  1764. } = _ref,
  1765. rest = _objectWithoutPropertiesLoose(_ref, _excluded$9);
  1766. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1767. type: type,
  1768. keyOverride: keyOverride
  1769. }, rest, {
  1770. scriptKey: "Logo"
  1771. }));
  1772. }
  1773. const _excluded$8 = ["type", "keyOverride"];
  1774. function DatasetJsonLd(_ref) {
  1775. let {
  1776. type = 'Dataset',
  1777. keyOverride
  1778. } = _ref,
  1779. rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
  1780. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1781. type: type,
  1782. keyOverride: keyOverride
  1783. }, rest, {
  1784. scriptKey: "dataset"
  1785. }));
  1786. }
  1787. const _excluded$7 = ["type", "keyOverride", "courseName", "provider"];
  1788. function CourseJsonLd(_ref) {
  1789. let {
  1790. type = 'Course',
  1791. keyOverride,
  1792. courseName,
  1793. provider
  1794. } = _ref,
  1795. rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
  1796. const data = _extends({
  1797. name: courseName
  1798. }, rest, {
  1799. provider: setProvider(provider)
  1800. });
  1801. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1802. type: type,
  1803. keyOverride: keyOverride
  1804. }, data, {
  1805. scriptKey: "course"
  1806. }));
  1807. }
  1808. const _excluded$6 = ["type", "keyOverride", "itemListElements"];
  1809. function BreadCrumbJsonLd(_ref) {
  1810. let {
  1811. type = 'BreadcrumbList',
  1812. keyOverride,
  1813. itemListElements
  1814. } = _ref,
  1815. rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
  1816. const data = _extends({}, rest, {
  1817. itemListElement: setItemListElements(itemListElements)
  1818. });
  1819. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1820. type: type,
  1821. keyOverride: keyOverride
  1822. }, data, {
  1823. scriptKey: "breadcrumb"
  1824. }));
  1825. }
  1826. const _excluded$5 = ["type", "id", "keyOverride", "aggregateRating"];
  1827. function BrandJsonLd(_ref) {
  1828. let {
  1829. type = 'Brand',
  1830. id,
  1831. keyOverride,
  1832. aggregateRating
  1833. } = _ref,
  1834. rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
  1835. const data = _extends({
  1836. aggregateRating: setAggregateRating(aggregateRating),
  1837. '@id': id
  1838. }, rest);
  1839. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1840. type: type,
  1841. keyOverride: keyOverride
  1842. }, data, {
  1843. scriptKey: "brand"
  1844. }));
  1845. }
  1846. const _excluded$4 = ["type", "keyOverride", "url", "title", "images", "datePublished", "dateModified", "authorName", "publisherName", "publisherLogo", "description", "isAccessibleForFree"];
  1847. function ArticleJsonLd(_ref) {
  1848. let {
  1849. type = 'Article',
  1850. keyOverride,
  1851. url,
  1852. title,
  1853. images,
  1854. datePublished,
  1855. dateModified,
  1856. authorName,
  1857. publisherName = undefined,
  1858. publisherLogo = undefined,
  1859. description,
  1860. isAccessibleForFree
  1861. } = _ref,
  1862. rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
  1863. const data = _extends({
  1864. datePublished,
  1865. description,
  1866. mainEntityOfPage: {
  1867. '@type': 'WebPage',
  1868. '@id': url
  1869. },
  1870. headline: title,
  1871. image: images,
  1872. dateModified: dateModified || datePublished,
  1873. author: setAuthor(authorName),
  1874. publisher: setPublisher(publisherName, publisherLogo),
  1875. isAccessibleForFree: isAccessibleForFree
  1876. }, rest);
  1877. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1878. type: type,
  1879. keyOverride: keyOverride
  1880. }, data, {
  1881. scriptKey: "article"
  1882. }));
  1883. }
  1884. function setReviewedBy(reviewedBy) {
  1885. if (reviewedBy) {
  1886. return _extends({
  1887. '@type': (reviewedBy == null ? void 0 : reviewedBy.type) || 'Organization'
  1888. }, reviewedBy);
  1889. }
  1890. return undefined;
  1891. }
  1892. const _excluded$3 = ["keyOverride", "reviewedBy"];
  1893. function WebPageJsonLd(_ref) {
  1894. let {
  1895. keyOverride,
  1896. reviewedBy
  1897. } = _ref,
  1898. rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
  1899. const data = _extends({}, rest, {
  1900. reviewedBy: setReviewedBy(reviewedBy)
  1901. });
  1902. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1903. keyOverride: keyOverride
  1904. }, data, {
  1905. type: "WebPage",
  1906. scriptKey: "WebPage"
  1907. }));
  1908. }
  1909. const _excluded$2 = ["type", "keyOverride"];
  1910. function SocialProfileJsonLd(_ref) {
  1911. let {
  1912. type,
  1913. keyOverride
  1914. } = _ref,
  1915. rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
  1916. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1917. type: type,
  1918. keyOverride: keyOverride
  1919. }, rest, {
  1920. scriptKey: "social"
  1921. }));
  1922. }
  1923. function setCost(cost) {
  1924. if (cost) {
  1925. return _extends({}, cost, {
  1926. '@type': 'MonetaryAmount'
  1927. });
  1928. }
  1929. return undefined;
  1930. }
  1931. function setSupply(supply) {
  1932. if (supply) {
  1933. return supply.map(supplyItem => ({
  1934. '@type': 'HowToSupply',
  1935. name: supplyItem
  1936. }));
  1937. }
  1938. return undefined;
  1939. }
  1940. function setTool(tool) {
  1941. if (tool) {
  1942. return tool.map(toolItem => ({
  1943. '@type': 'HowToTool',
  1944. name: toolItem
  1945. }));
  1946. }
  1947. return undefined;
  1948. }
  1949. function setStep(step) {
  1950. if (step) {
  1951. return step.map(stepElement => {
  1952. const {
  1953. itemListElement,
  1954. image
  1955. } = stepElement;
  1956. const currentListElements = itemListElement == null ? void 0 : itemListElement.map(({
  1957. type,
  1958. text
  1959. }) => ({
  1960. '@type': type,
  1961. text: text
  1962. }));
  1963. return _extends({}, stepElement, {
  1964. '@type': 'HowToStep',
  1965. itemListElement: currentListElements,
  1966. image: setImage(image)
  1967. });
  1968. });
  1969. }
  1970. return undefined;
  1971. }
  1972. const _excluded$1 = ["type", "keyOverride", "image", "estimatedCost", "supply", "tool", "step"];
  1973. function howToJsonLd(_ref) {
  1974. let {
  1975. type = 'HowTo',
  1976. keyOverride,
  1977. image,
  1978. estimatedCost,
  1979. supply,
  1980. tool,
  1981. step
  1982. } = _ref,
  1983. rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
  1984. const data = _extends({}, rest, {
  1985. image: setImage(image),
  1986. estimatedCost: setCost(estimatedCost),
  1987. supply: setSupply(supply),
  1988. tool: setTool(tool),
  1989. step: setStep(step)
  1990. });
  1991. return /*#__PURE__*/React.createElement(JsonLd, _extends({
  1992. type: type,
  1993. keyOverride: keyOverride
  1994. }, data, {
  1995. scriptKey: "howTo"
  1996. }));
  1997. }
  1998. const _excluded = ["keyOverride", "images"];
  1999. function ImageJsonLd(_ref) {
  2000. let {
  2001. keyOverride,
  2002. images
  2003. } = _ref,
  2004. rest = _objectWithoutPropertiesLoose(_ref, _excluded);
  2005. return /*#__PURE__*/React.createElement(JsonLd, _extends({}, rest, {
  2006. type: "ImageObject",
  2007. keyOverride: keyOverride,
  2008. dataArray: images,
  2009. scriptKey: "image"
  2010. }));
  2011. }
  2012. export { ArticleJsonLd, BrandJsonLd, BreadCrumbJsonLd as BreadcrumbJsonLd, CarouselJsonLd, CollectionPageJsonLd, CorporateContactJsonLd, CourseJsonLd, DatasetJsonLd, DefaultSeo, EventJsonLd, FAQPageJsonLd, howToJsonLd as HowToJsonLd, ImageJsonLd, JobPostingJsonLd, LocalBusinessJsonLd, LogoJsonLd, NewsArticleJsonLd, NextSeo, OrganizationJsonLd, ProductJsonLd, ProfilePageJsonLd, QAPageJsonLd, RecipeJsonLd, SiteLinksSearchBoxJsonLd, SocialProfileJsonLd, SoftwareAppJsonLd, VideoGameJsonLd, VideoJsonLd, WebPageJsonLd };