@anywayseo/tools 4.2.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/components/base/index.d.ts +1 -0
  2. package/dist/components/base/link/index.d.ts +2 -0
  3. package/dist/components/base/link/utils.d.ts +1 -0
  4. package/dist/components/game-info/utils.d.ts +2 -2
  5. package/dist/components/index.cjs +3 -1
  6. package/dist/components/index.mjs +3 -1
  7. package/dist/components/layout/header/locale-switcher/icons/earth/index.d.ts +2 -0
  8. package/dist/components/layout/header/locale-switcher/icons/france/index.d.ts +2 -0
  9. package/dist/components/layout/header/locale-switcher/icons/germany/index.d.ts +2 -0
  10. package/dist/components/layout/header/locale-switcher/icons/globe/index.d.ts +2 -0
  11. package/dist/components/layout/header/locale-switcher/icons/index.d.ts +6 -0
  12. package/dist/components/layout/header/locale-switcher/icons/italy/index.d.ts +2 -0
  13. package/dist/components/layout/header/locale-switcher/icons/russia/index.d.ts +2 -0
  14. package/dist/components/layout/header/locale-switcher/index.d.ts +8 -0
  15. package/dist/components/layout/header/locale-switcher/utils.d.ts +2 -0
  16. package/dist/components/layout/header/navigation/desktop/index.d.ts +1 -1
  17. package/dist/components/layout/header/navigation/index.d.ts +1 -1
  18. package/dist/components/layout/header/navigation/mobile/index.d.ts +1 -1
  19. package/dist/components/seo/index.d.ts +2 -3
  20. package/dist/hooks/index.cjs +4 -2
  21. package/dist/hooks/index.d.ts +1 -0
  22. package/dist/hooks/index.mjs +4 -2
  23. package/dist/hooks/use-localization/index.d.ts +6 -0
  24. package/dist/i18n/index.cjs +11 -5
  25. package/dist/i18n/index.d.ts +3 -2
  26. package/dist/i18n/index.mjs +11 -5
  27. package/dist/i18n/resources/fr/index.d.ts +112 -0
  28. package/dist/{index-BrOQF5EQ.js → index-3nQCWHPU.js} +220 -86
  29. package/dist/index-At00w6EN.js +9 -0
  30. package/dist/{index-BPLxhZG_.js → index-BHfpWNqh.js} +183 -73
  31. package/dist/{index-MpNfBHkQ.mjs → index-BJRvnR8Q.mjs} +1 -5
  32. package/dist/index-BRVKhbs6.mjs +6 -0
  33. package/dist/index-BmaWfWLV.mjs +10 -0
  34. package/dist/{index-BV0hDmYP.js → index-BnmGE5_x.js} +3 -2
  35. package/dist/{index-DPO0aIC3.mjs → index-Bu4S7kG8.mjs} +7 -10
  36. package/dist/{index-DVcQxWMZ.js → index-C6MG_f24.js} +0 -4
  37. package/dist/{index-BE9gNdXx.mjs → index-CACDltm3.mjs} +183 -73
  38. package/dist/index-CYr1ct1t.js +93 -0
  39. package/dist/index-CbuiYkSg.js +5 -0
  40. package/dist/index-Cc85xj4h.mjs +27 -0
  41. package/dist/index-D1bJmcpz.js +49 -0
  42. package/dist/{index-DuQjQMNN.js → index-D34TfBTR.js} +7 -10
  43. package/dist/{index-CcsbqDXL.mjs → index-DVAydNYV.mjs} +7 -3
  44. package/dist/index-DnvTeCy9.mjs +50 -0
  45. package/dist/index-DqGO34ef.js +26 -0
  46. package/dist/{index-DF_u_tzx.js → index-Dur8aLpm.js} +7 -3
  47. package/dist/{index-CkTgVjZS.mjs → index-QazOxABc.mjs} +3 -2
  48. package/dist/{index-CaIyg0au.mjs → index-X2ihbchG.mjs} +201 -67
  49. package/dist/index-cQqALZIW.mjs +94 -0
  50. package/dist/index.cjs +41 -31
  51. package/dist/index.mjs +30 -20
  52. package/dist/providers/index.cjs +2 -2
  53. package/dist/providers/index.mjs +2 -2
  54. package/dist/providers/site-provider/index.d.ts +11 -5
  55. package/dist/types/api/index.d.ts +2 -2
  56. package/dist/types/components/icon/index.d.ts +2 -0
  57. package/dist/types/components/index.d.ts +2 -0
  58. package/dist/types/components/locale-switcher/index.d.ts +5 -0
  59. package/dist/types/components/navigation/index.d.ts +9 -10
  60. package/dist/types/i18n/index.d.ts +7 -1
  61. package/dist/types/site/index.d.ts +15 -13
  62. package/dist/utils/api/index.d.ts +5 -0
  63. package/dist/utils/date/index.d.ts +4 -3
  64. package/dist/utils/index.cjs +23 -16
  65. package/dist/utils/index.d.ts +1 -0
  66. package/dist/utils/index.mjs +16 -9
  67. package/dist/utils/navigation/index.d.ts +2 -2
  68. package/dist/utils/numbers/index.d.ts +3 -3
  69. package/package.json +1 -1
  70. package/dist/components/layout/header/navigation/types.d.ts +0 -4
  71. package/dist/index-BClxYYix.js +0 -40
  72. package/dist/index-BNb-P8a6.mjs +0 -17
  73. package/dist/index-BhsXlbd8.js +0 -16
  74. package/dist/index-Ca_M-II5.mjs +0 -41
@@ -2,16 +2,16 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const react$1 = require("@chakra-ui/react");
4
4
  const reactI18next = require("react-i18next");
5
- const gatsby = require("gatsby");
6
- const index$2 = require("./index-DVcQxWMZ.js");
7
- const i18n = require("./index-BPLxhZG_.js");
8
- const react$2 = require("@mdx-js/react");
9
- const index = require("./index-BhsXlbd8.js");
5
+ const index = require("./index-D1bJmcpz.js");
10
6
  const react = require("react");
7
+ const index$3 = require("./index-C6MG_f24.js");
8
+ const index$5 = require("./index-BHfpWNqh.js");
9
+ const react$2 = require("@mdx-js/react");
11
10
  const icons = require("@chakra-ui/icons");
12
- const index$3 = require("./index-DuQjQMNN.js");
13
- const index$1 = require("./index-BV0hDmYP.js");
14
- const i18n$1 = require("i18next");
11
+ const index$4 = require("./index-D34TfBTR.js");
12
+ const index$2 = require("./index-At00w6EN.js");
13
+ const index$1 = require("./index-BnmGE5_x.js");
14
+ const i18next = require("i18next");
15
15
  const Markdown = require("react-markdown");
16
16
  const ONE_LINE_HEIGHT = 24;
17
17
  const Bio = ({ content, maxLines = 1 }) => {
@@ -81,11 +81,11 @@ const LinkButton = ({
81
81
  ...boxProps
82
82
  }) => {
83
83
  var _a;
84
- const { configs } = index.useSiteContext();
84
+ const { config } = index.useSiteContext();
85
85
  const { color, invertedColor } = index$1.usePrimaryColors();
86
- const isInvertedColor = (_a = configs == null ? void 0 : configs.theme) == null ? void 0 : _a.isInvertedColor;
87
- const isInternalLink = linkType === "redirect" || (href == null ? void 0 : href.startsWith("/"));
88
- const LinkComponent = isInternalLink ? gatsby.Link : react$1.Link;
86
+ const isInvertedColor = (_a = config == null ? void 0 : config.theme) == null ? void 0 : _a.isInvertedColor;
87
+ const isInternalLink = linkType === "redirect" || index$2.isRelativePath(href);
88
+ const LinkComponent = isInternalLink ? index.Link : react$1.Link;
89
89
  const hrefKey = isInternalLink ? "to" : "href";
90
90
  const hrefValue = linkType === "redirect" ? `/follow?to=${href}` : href;
91
91
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -95,7 +95,7 @@ const LinkButton = ({
95
95
  size: size === "auto" ? { base: "sm", md: "lg" } : size,
96
96
  bg: "brand.500",
97
97
  color: isInvertedColor ? invertedColor : color,
98
- animation: animation ? index$2.Animation[animation.type](animation.params) : void 0,
98
+ animation: animation ? index$3.Animation[animation.type](animation.params) : void 0,
99
99
  textTransform,
100
100
  _hover: { textDecoration, bg: "brand.200" },
101
101
  _active: { transform: "scale(0.95)" },
@@ -356,7 +356,7 @@ const GameCardGrid = ({
356
356
  }) => {
357
357
  let sortedItems = items;
358
358
  if (order === "random") {
359
- sortedItems = [...items].sort(randomSeed ? index$3.getSeededRandomComparator(randomSeed) : index$3.randomComparator);
359
+ sortedItems = [...items].sort(randomSeed ? index$4.getSeededRandomComparator(randomSeed) : index$4.randomComparator);
360
360
  }
361
361
  return /* @__PURE__ */ jsxRuntime.jsx(
362
362
  Grid,
@@ -451,6 +451,7 @@ const GameDemo = ({ name, src, href, previewImage, previewImageFit, ...boxProps
451
451
  setIsLoaded(true);
452
452
  }
453
453
  function handleExit() {
454
+ document.body.style.overflowY = "auto";
454
455
  onClose();
455
456
  setIsRunning(false);
456
457
  }
@@ -504,10 +505,10 @@ const GameInfoItem = ({ title, value }) => {
504
505
  };
505
506
  const VISIBLE_LANGUAGE_NUMBER = 5;
506
507
  function stringifyHasFeature(value) {
507
- return i18n$1.t(`gameInfo:value.boolean.${value}`);
508
+ return i18next.t(`gameInfo:value.boolean.${value}`);
508
509
  }
509
510
  function stringifyVolatility(value) {
510
- return i18n$1.t(`gameInfo:value.volatility.${value}`);
511
+ return i18next.t(`gameInfo:value.volatility.${value}`);
511
512
  }
512
513
  function stringifyArray(array) {
513
514
  return array.join(", ");
@@ -515,35 +516,35 @@ function stringifyArray(array) {
515
516
  function stringifyLanguageArray(languages) {
516
517
  return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
517
518
  }
518
- function getGameInfoItemValue(key, value, currency) {
519
+ function getGameInfoItemValue(key, value, locale, currency) {
519
520
  let formattedValue = "";
520
521
  if (typeof value !== "string") {
521
- if (key === i18n.GameCharacteristic.Rtp) {
522
- formattedValue = index$3.formatNumber(value, { percent: "real", precision: 3 });
522
+ if (key === index$5.GameCharacteristic.Rtp) {
523
+ formattedValue = index$4.formatNumber(value, { percent: "real", precision: 3 });
523
524
  }
524
- if (key === i18n.GameCharacteristic.MinBet || key === i18n.GameCharacteristic.MaxBet || key === i18n.GameCharacteristic.MaxWin) {
525
+ if (key === index$5.GameCharacteristic.MinBet || key === index$5.GameCharacteristic.MaxBet || key === index$5.GameCharacteristic.MaxWin) {
525
526
  if (Array.isArray(currency)) {
526
527
  const [primary, ...secondaries] = currency || ["USD"];
527
- const primaryValue = index$3.formatNumber(value, { currency: primary });
528
- formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => index$3.getCurrencySymbol(currency2)).join(", ")})` : primaryValue;
528
+ const primaryValue = index$4.formatNumber(value, { currency: primary });
529
+ formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => index$4.getCurrencySymbol(currency2, locale)).join(", ")})` : primaryValue;
529
530
  } else {
530
- formattedValue = index$3.formatNumber(value, { currency });
531
+ formattedValue = index$4.formatNumber(value, { currency });
531
532
  }
532
533
  }
533
- if (key === i18n.GameCharacteristic.Compatibility || key === i18n.GameCharacteristic.BonusFeatures) {
534
+ if (key === index$5.GameCharacteristic.Compatibility || key === index$5.GameCharacteristic.BonusFeatures) {
534
535
  formattedValue = stringifyArray(value);
535
536
  }
536
- if (key === i18n.GameCharacteristic.Languages) {
537
+ if (key === index$5.GameCharacteristic.Languages) {
537
538
  formattedValue = stringifyLanguageArray(value);
538
539
  }
539
540
  if (typeof value === "boolean") {
540
541
  formattedValue = stringifyHasFeature(value);
541
542
  }
542
543
  }
543
- if (key === i18n.GameCharacteristic.ReleaseDate) {
544
- formattedValue = index$3.formatDate({ value, options: { year: "numeric", month: "long" } });
544
+ if (key === index$5.GameCharacteristic.ReleaseDate) {
545
+ formattedValue = index$4.formatDate({ value, locale, options: { year: "numeric", month: "long" } });
545
546
  }
546
- if (key === i18n.GameCharacteristic.Volatility) {
547
+ if (key === index$5.GameCharacteristic.Volatility) {
547
548
  formattedValue = stringifyVolatility(value);
548
549
  }
549
550
  if (!formattedValue) {
@@ -552,9 +553,10 @@ function getGameInfoItemValue(key, value, currency) {
552
553
  return formattedValue;
553
554
  }
554
555
  const GameInfo = ({ info }) => {
555
- const { metadata } = index.useSiteContext();
556
- const { currency } = metadata;
557
556
  const { t } = reactI18next.useTranslation("gameInfo");
557
+ const { localization } = index.useSiteContext();
558
+ const locale = localization.currentLocale.code;
559
+ const currency = localization.currency;
558
560
  return /* @__PURE__ */ jsxRuntime.jsx(
559
561
  react$1.Box,
560
562
  {
@@ -573,7 +575,7 @@ const GameInfo = ({ info }) => {
573
575
  return null;
574
576
  }
575
577
  const feature = itemKey;
576
- const value = getGameInfoItemValue(feature, itemValue, currency);
578
+ const value = getGameInfoItemValue(feature, itemValue, locale, currency);
577
579
  return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`), value }, itemKey);
578
580
  })
579
581
  ] }, group)) })
@@ -606,19 +608,20 @@ const Logo = () => {
606
608
  const Brand$1 = ({ brand }) => {
607
609
  return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { position: "relative", my: 2, py: 8, children: [
608
610
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Divider, {}),
609
- /* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { display: "flex", bgColor: react$1.useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsxRuntime.jsx(gatsby.Link, { to: "/", children: brand }) })
611
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { display: "flex", bgColor: react$1.useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsxRuntime.jsx(index.Link, { to: "/", children: brand }) })
610
612
  ] });
611
613
  };
612
614
  const Copyright = () => {
613
615
  const { metadata } = index.useSiteContext();
614
- const { name: siteName } = metadata;
615
616
  const { t } = reactI18next.useTranslation("footer");
616
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "small", colorScheme: "gray", display: "flex", align: "center", justifyContent: "center", children: t("copyright", { year: index$3.getCurrentYear(), siteName }) });
617
+ const siteName = metadata.name;
618
+ const lang = metadata.lang;
619
+ return /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "small", colorScheme: "gray", display: "flex", align: "center", justifyContent: "center", children: t("copyright", { year: index$4.getCurrentYear(lang), siteName }) });
617
620
  };
618
621
  const Disclaimer = () => {
619
622
  const { metadata } = index.useSiteContext();
620
- const { name: siteName } = metadata;
621
623
  const { t } = reactI18next.useTranslation("footer");
624
+ const siteName = metadata.name;
622
625
  return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { as: "small", colorScheme: "gray", fontSize: "sm", children: [
623
626
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", fontWeight: "bold", color: "red.600", children: t("disclaimer.title") }),
624
627
  t("disclaimer.description", { siteName })
@@ -639,29 +642,29 @@ const Navigation$1 = ({ menu }) => {
639
642
  spacing: 4,
640
643
  justifyItems: { base: "flex-start", md: "center" },
641
644
  justifyContent: "space-between",
642
- children: menu.map(({ path, label }, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
645
+ children: menu.map(({ slug, label }, index$12) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
643
646
  react$1.Text,
644
647
  {
645
- as: gatsby.Link,
646
- to: path,
648
+ as: index.Link,
649
+ to: slug,
647
650
  fontSize: "md",
648
651
  fontWeight: "semibold",
649
652
  colorScheme: "gray",
650
653
  _hover: { textDecoration: "none", color: "brand.400" },
651
654
  children: label
652
- },
653
- path
654
- ) }, index2))
655
+ }
656
+ ) }, index$12))
655
657
  }
656
658
  );
657
659
  };
658
660
  const Footer = () => {
659
- var _a, _b, _c;
660
- const { configs } = index.useSiteContext();
661
- const navigation = ((_a = configs == null ? void 0 : configs.footer) == null ? void 0 : _a.navigation) ?? [];
662
- const extra = (_b = configs == null ? void 0 : configs.footer) == null ? void 0 : _b.extra;
663
- const showDisclaimer = ((_c = configs == null ? void 0 : configs.footer) == null ? void 0 : _c.showDisclaimer) ?? true;
664
- const hasNavigation = !!navigation.length;
661
+ var _a, _b;
662
+ const { navigation, localization, config } = index.useSiteContext();
663
+ const currentLocale = localization.currentLocale;
664
+ const menu = navigation.footer[currentLocale.code] ?? [];
665
+ const extra = (_a = config == null ? void 0 : config.footer) == null ? void 0 : _a.extra;
666
+ const showDisclaimer = ((_b = config == null ? void 0 : config.footer) == null ? void 0 : _b.showDisclaimer) ?? true;
667
+ const hasNavigation = !!menu.length;
665
668
  const hasExtra = !!extra;
666
669
  return /* @__PURE__ */ jsxRuntime.jsx(
667
670
  react$1.Box,
@@ -671,7 +674,7 @@ const Footer = () => {
671
674
  color: react$1.useColorModeValue("gray.700", "gray.200"),
672
675
  py: 4,
673
676
  children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
674
- hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(Navigation$1, { menu: navigation }),
677
+ hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(Navigation$1, { menu }),
675
678
  hasExtra && /* @__PURE__ */ jsxRuntime.jsx(Extra, { children: extra }),
676
679
  showDisclaimer && /* @__PURE__ */ jsxRuntime.jsx(Disclaimer, {}),
677
680
  /* @__PURE__ */ jsxRuntime.jsx(Brand$1, { brand: /* @__PURE__ */ jsxRuntime.jsx(Logo, {}) }),
@@ -681,15 +684,111 @@ const Footer = () => {
681
684
  );
682
685
  };
683
686
  const Brand = ({ brand }) => {
684
- return /* @__PURE__ */ jsxRuntime.jsx(gatsby.Link, { to: "/", children: brand });
687
+ return /* @__PURE__ */ jsxRuntime.jsx(index.Link, { to: "/", children: brand });
688
+ };
689
+ const FranceIcon = (props) => {
690
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
691
+ /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "circleFlagsFr0", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
692
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { mask: "url(#circleFlagsFr0)", children: [
693
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#eee", d: "M167 0h178l25.9 252.3L345 512H167l-29.8-253.4z" }),
694
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#0052b4", d: "M0 0h167v512H0z" }),
695
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#d80027", d: "M345 0h167v512H345z" })
696
+ ] })
697
+ ] });
698
+ };
699
+ const GermanyIcon = (props) => {
700
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
701
+ /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "circleFlagsDe0", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
702
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { mask: "url(#circleFlagsDe0)", children: [
703
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#ffda44", d: "m0 345l256.7-25.5L512 345v167H0z" }),
704
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#d80027", d: "m0 167l255-23l257 23v178H0z" }),
705
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#333", d: "M0 0h512v167H0z" })
706
+ ] })
707
+ ] });
708
+ };
709
+ const GlobeIcon = (props) => {
710
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 496", width: "1em", height: "1em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
711
+ "path",
712
+ {
713
+ fill: "currentColor",
714
+ d: "M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64m324.7-96c-28.6-67.9-86.5-120.4-158-141.6c24.4 33.8 41.2 84.7 50 141.6zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6M487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64M120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64m39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6M19.3 352c28.6 67.9 86.5 120.4 158 141.6c-24.4-33.8-41.2-84.7-50-141.6z"
715
+ }
716
+ ) });
717
+ };
718
+ const ItalyIcon = (props) => {
719
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
720
+ /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "circleFlagsIt0", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
721
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { mask: "url(#circleFlagsIt0)", children: [
722
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#eee", d: "M167 0h178l25.9 252.3L345 512H167l-29.8-253.4z" }),
723
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#6da544", d: "M0 0h167v512H0z" }),
724
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#d80027", d: "M345 0h167v512H345z" })
725
+ ] })
726
+ ] });
727
+ };
728
+ const RussiaIcon = (props) => {
729
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
730
+ /* @__PURE__ */ jsxRuntime.jsx("mask", { id: "circleFlagsRu0", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
731
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { mask: "url(#circleFlagsRu0)", children: [
732
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#0052b4", d: "M512 170v172l-256 32L0 342V170l256-32z" }),
733
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#eee", d: "M512 0v170H0V0Z" }),
734
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#d80027", d: "M512 342v170H0V342Z" })
735
+ ] })
736
+ ] });
737
+ };
738
+ function getMappedIcon(code) {
739
+ let icon = GlobeIcon;
740
+ switch (code) {
741
+ case "de":
742
+ icon = GermanyIcon;
743
+ break;
744
+ case "it":
745
+ icon = ItalyIcon;
746
+ break;
747
+ case "ru":
748
+ icon = RussiaIcon;
749
+ break;
750
+ case "fr":
751
+ icon = FranceIcon;
752
+ break;
753
+ case "en":
754
+ default:
755
+ icon = GlobeIcon;
756
+ break;
757
+ }
758
+ return icon;
759
+ }
760
+ const LocaleSwitcher = ({ currentLocale, locales }) => {
761
+ const localeCode = currentLocale.code;
762
+ const localeIcon = getMappedIcon(localeCode);
763
+ const localeMenuItems = react.useMemo(
764
+ () => locales.map((locale) => ({ ...locale, icon: getMappedIcon(locale.code) })),
765
+ [locales]
766
+ );
767
+ return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Menu, { placement: "bottom-end", children: [
768
+ /* @__PURE__ */ jsxRuntime.jsx(
769
+ react$1.MenuButton,
770
+ {
771
+ as: react$1.Button,
772
+ rightIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {}),
773
+ w: { base: 20, md: "28" },
774
+ px: { base: 1, md: 4 },
775
+ size: { base: "sm", md: "lg" },
776
+ children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.HStack, { children: [
777
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { as: localeIcon }),
778
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: localeCode.toUpperCase() })
779
+ ] })
780
+ }
781
+ ),
782
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.MenuList, { minW: "fit-content", children: localeMenuItems.map(({ code, name, icon }) => /* @__PURE__ */ jsxRuntime.jsx(react$1.MenuItem, { as: index.Link, to: `/${code}`, icon: /* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { as: icon, w: 4, h: 4 }), children: name }, code)) })
783
+ ] });
685
784
  };
686
- const NavLink = react.forwardRef(({ path, label }, ref) => {
785
+ const NavLink = react.forwardRef(({ slug, label }, ref) => {
687
786
  return /* @__PURE__ */ jsxRuntime.jsx(
688
787
  react$1.Text,
689
788
  {
690
789
  ref,
691
- as: gatsby.Link,
692
- to: path,
790
+ as: index.Link,
791
+ to: slug,
693
792
  p: 2,
694
793
  fontWeight: "semibold",
695
794
  _hover: { textDecoration: "none", color: "brand.400" },
@@ -698,7 +797,7 @@ const NavLink = react.forwardRef(({ path, label }, ref) => {
698
797
  );
699
798
  });
700
799
  NavLink.displayName = "NavLink";
701
- const NavList$1 = ({ path, label, children }) => {
800
+ const NavList$1 = ({ slug, label, children }) => {
702
801
  const background = react$1.useColorModeValue("white", "gray.800");
703
802
  const backgroundHover = react$1.useColorModeValue("brand.50", "gray.900");
704
803
  return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Popover, { trigger: "hover", placement: "bottom-start", children: [
@@ -713,22 +812,37 @@ const NavList$1 = ({ path, label, children }) => {
713
812
  children: label
714
813
  }
715
814
  ) }),
716
- /* @__PURE__ */ jsxRuntime.jsx(react$1.PopoverContent, { p: 2, border: 0, minW: "sm", rounded: "xl", boxShadow: "xl", bg: background, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: gatsby.Link, to: `${path}${child.path}`, p: 2, role: "group", children: [
717
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
718
- /* @__PURE__ */ jsxRuntime.jsx(
719
- react$1.Flex,
720
- {
721
- flex: 1,
722
- justify: "flex-end",
723
- align: "center",
724
- opacity: 0,
725
- transition: "all .3s ease",
726
- transform: "translateX(-10px)",
727
- _groupHover: { opacity: 1, transform: "translateX(0)" },
728
- children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { as: icons.ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
729
- }
730
- )
731
- ] }) }, index2)) }) })
815
+ /* @__PURE__ */ jsxRuntime.jsx(
816
+ react$1.PopoverContent,
817
+ {
818
+ p: 2,
819
+ border: 0,
820
+ minW: "sm",
821
+ maxH: 300,
822
+ overflowY: "auto",
823
+ rounded: "xl",
824
+ boxShadow: "xl",
825
+ bg: background,
826
+ children: /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child, index$12) => {
827
+ return /* @__PURE__ */ jsxRuntime.jsx(react$1.ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: index.Link, to: index$2.buildPath(child.slug, slug), p: 2, role: "group", children: [
828
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
829
+ /* @__PURE__ */ jsxRuntime.jsx(
830
+ react$1.Flex,
831
+ {
832
+ flex: 1,
833
+ justify: "flex-end",
834
+ align: "center",
835
+ opacity: 0,
836
+ transition: "all .3s ease",
837
+ transform: "translateX(-10px)",
838
+ _groupHover: { opacity: 1, transform: "translateX(0)" },
839
+ children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { as: icons.ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
840
+ }
841
+ )
842
+ ] }) }, index$12);
843
+ }) })
844
+ }
845
+ )
732
846
  ] });
733
847
  };
734
848
  const DesktopNavigation = ({ menu }) => {
@@ -738,7 +852,7 @@ const DesktopNavigation = ({ menu }) => {
738
852
  }) });
739
853
  };
740
854
  const CHEVRON_DOWN_ICON_SIZE = "1.5rem";
741
- const NavList = ({ path, label, children, isExpanded, onExpand }) => {
855
+ const NavList = ({ slug, label, children, isExpanded, onExpand }) => {
742
856
  return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { flex: 1, children: [
743
857
  /* @__PURE__ */ jsxRuntime.jsxs(
744
858
  react$1.Flex,
@@ -764,7 +878,19 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
764
878
  ]
765
879
  }
766
880
  ),
767
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { ml: 2, pl: 0, borderLeft: 1, borderStyle: "solid", borderColor: react$1.useColorModeValue("gray.200", "gray.700"), children: children == null ? void 0 : children.map((child, index2) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: gatsby.Link, to: `${path}${child.path}`, p: 2, fontSize: "sm", children: child.label }) }, index2)) }) })
881
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsxRuntime.jsx(
882
+ react$1.List,
883
+ {
884
+ ml: 2,
885
+ pl: 0,
886
+ maxH: 300,
887
+ overflowY: "auto",
888
+ borderLeft: 1,
889
+ borderStyle: "solid",
890
+ borderColor: react$1.useColorModeValue("gray.200", "gray.700"),
891
+ children: children == null ? void 0 : children.map((child, index$12) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: index.Link, to: index$2.buildPath(child.slug, slug), p: 2, fontSize: "sm", children: child.label }) }, index$12))
892
+ }
893
+ ) })
768
894
  ] });
769
895
  };
770
896
  const CLOSE_ICON_SIZE = "0.75rem";
@@ -819,12 +945,15 @@ const Navigation = ({ menu }) => {
819
945
  ] });
820
946
  };
821
947
  const Header = () => {
822
- var _a, _b;
823
- const { configs } = index.useSiteContext();
824
- const navigation = ((_a = configs == null ? void 0 : configs.header) == null ? void 0 : _a.navigation) ?? [];
825
- const toolbar = (_b = configs == null ? void 0 : configs.header) == null ? void 0 : _b.toolbar;
826
- const hasToolbar = !!toolbar;
827
- const hasNavigation = !!navigation.length;
948
+ var _a;
949
+ const { navigation, localization, config } = index.useSiteContext();
950
+ const locales = localization.locales;
951
+ const currentLocale = localization.currentLocale;
952
+ const menu = navigation.header[currentLocale.code] ?? [];
953
+ const toolbar = (_a = config == null ? void 0 : config.header) == null ? void 0 : _a.toolbar;
954
+ const isMultiLanguage = locales.length > 1;
955
+ const hasNavigation = !!menu.length;
956
+ const hasToolbar = !!toolbar || isMultiLanguage;
828
957
  return /* @__PURE__ */ jsxRuntime.jsx(
829
958
  react$1.Box,
830
959
  {
@@ -847,8 +976,11 @@ const Header = () => {
847
976
  align: "center",
848
977
  gap: 2,
849
978
  children: [
850
- hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Navigation, { menu: navigation }) }),
851
- hasToolbar && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { gap: 2, flex: { base: 1, md: 0 }, justifyContent: "flex-end", children: toolbar })
979
+ hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Navigation, { menu }) }),
980
+ hasToolbar && /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { gap: 2, flex: { base: 1, md: 0 }, justifyContent: "flex-end", children: [
981
+ !!toolbar && toolbar,
982
+ isMultiLanguage && /* @__PURE__ */ jsxRuntime.jsx(LocaleSwitcher, { currentLocale, locales })
983
+ ] })
852
984
  ]
853
985
  }
854
986
  )
@@ -950,7 +1082,7 @@ const NotFound = () => {
950
1082
  /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { fontSize: "xl", children: [
951
1083
  t("description"),
952
1084
  " ",
953
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { as: gatsby.Link, to: "/", variant: "link", colorScheme: "brand", fontSize: "xl", children: t("action") })
1085
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { as: index.Link, to: "/", variant: "link", colorScheme: "brand", fontSize: "xl", children: t("action") })
954
1086
  ] })
955
1087
  ] });
956
1088
  };
@@ -1027,19 +1159,21 @@ function replacePlaceholders(text, placeholders) {
1027
1159
  });
1028
1160
  return text;
1029
1161
  }
1030
- const Seo = ({ children, siteMetadata, title, description, lang }) => {
1031
- const { name: siteName, lang: defaultLang, seo } = siteMetadata;
1162
+ const Seo = ({ children, title, description, lang }) => {
1163
+ const { metadata } = index.useSiteContext();
1164
+ const { name: siteName, lang: defaultLang, seo } = metadata;
1032
1165
  const { title: defaultTitle, description: defaultDescription } = seo;
1166
+ const siteLang = lang || defaultLang;
1033
1167
  const placeholders = react.useMemo(
1034
1168
  () => ({
1035
1169
  siteName,
1036
- currentYear: index$3.getCurrentYear(),
1037
- currentMonth: index$3.getCurrentMonth()
1170
+ currentYear: index$4.getCurrentYear(siteLang),
1171
+ currentMonth: index$4.getCurrentMonth(siteLang)
1038
1172
  }),
1039
- [siteName]
1173
+ [siteName, siteLang]
1040
1174
  );
1041
1175
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1042
- /* @__PURE__ */ jsxRuntime.jsx("html", { lang: lang ?? defaultLang }),
1176
+ /* @__PURE__ */ jsxRuntime.jsx("html", { lang: siteLang }),
1043
1177
  /* @__PURE__ */ jsxRuntime.jsx("title", { children: title ? typeof title === "string" ? replacePlaceholders(title, placeholders) : title(placeholders) : defaultTitle }),
1044
1178
  /* @__PURE__ */ jsxRuntime.jsx(
1045
1179
  "meta",
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ function buildPath(slug, parentSlug) {
3
+ return parentSlug === "" ? slug : `${parentSlug}/${slug}`;
4
+ }
5
+ function isRelativePath(path = "") {
6
+ return path.startsWith("/");
7
+ }
8
+ exports.buildPath = buildPath;
9
+ exports.isRelativePath = isRelativePath;