@anywayseo/tools 4.2.2 → 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.
- package/dist/components/base/index.d.ts +1 -0
- package/dist/components/base/link/index.d.ts +2 -0
- package/dist/components/base/link/utils.d.ts +1 -0
- package/dist/components/game-info/utils.d.ts +2 -2
- package/dist/components/index.cjs +3 -1
- package/dist/components/index.mjs +3 -1
- package/dist/components/layout/header/locale-switcher/icons/earth/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/france/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/germany/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/globe/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/index.d.ts +6 -0
- package/dist/components/layout/header/locale-switcher/icons/italy/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/icons/russia/index.d.ts +2 -0
- package/dist/components/layout/header/locale-switcher/index.d.ts +8 -0
- package/dist/components/layout/header/locale-switcher/utils.d.ts +2 -0
- package/dist/components/layout/header/navigation/desktop/index.d.ts +1 -1
- package/dist/components/layout/header/navigation/index.d.ts +1 -1
- package/dist/components/layout/header/navigation/mobile/index.d.ts +1 -1
- package/dist/components/seo/index.d.ts +2 -3
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.mjs +4 -2
- package/dist/hooks/use-localization/index.d.ts +6 -0
- package/dist/i18n/index.cjs +11 -5
- package/dist/i18n/index.d.ts +3 -2
- package/dist/i18n/index.mjs +11 -5
- package/dist/i18n/resources/fr/index.d.ts +112 -0
- package/dist/{index-N8nXj4-i.js → index-3nQCWHPU.js} +219 -86
- package/dist/index-At00w6EN.js +9 -0
- package/dist/{index-BPLxhZG_.js → index-BHfpWNqh.js} +183 -73
- package/dist/{index-MpNfBHkQ.mjs → index-BJRvnR8Q.mjs} +1 -5
- package/dist/index-BRVKhbs6.mjs +6 -0
- package/dist/index-BmaWfWLV.mjs +10 -0
- package/dist/{index-BV0hDmYP.js → index-BnmGE5_x.js} +3 -2
- package/dist/{index-DPO0aIC3.mjs → index-Bu4S7kG8.mjs} +7 -10
- package/dist/{index-DVcQxWMZ.js → index-C6MG_f24.js} +0 -4
- package/dist/{index-BE9gNdXx.mjs → index-CACDltm3.mjs} +183 -73
- package/dist/index-CYr1ct1t.js +93 -0
- package/dist/index-CbuiYkSg.js +5 -0
- package/dist/index-Cc85xj4h.mjs +27 -0
- package/dist/index-D1bJmcpz.js +49 -0
- package/dist/{index-DuQjQMNN.js → index-D34TfBTR.js} +7 -10
- package/dist/{index-CcsbqDXL.mjs → index-DVAydNYV.mjs} +7 -3
- package/dist/index-DnvTeCy9.mjs +50 -0
- package/dist/index-DqGO34ef.js +26 -0
- package/dist/{index-DF_u_tzx.js → index-Dur8aLpm.js} +7 -3
- package/dist/{index-CkTgVjZS.mjs → index-QazOxABc.mjs} +3 -2
- package/dist/{index-DAbZBo7_.mjs → index-X2ihbchG.mjs} +200 -67
- package/dist/index-cQqALZIW.mjs +94 -0
- package/dist/index.cjs +41 -31
- package/dist/index.mjs +30 -20
- package/dist/providers/index.cjs +2 -2
- package/dist/providers/index.mjs +2 -2
- package/dist/providers/site-provider/index.d.ts +11 -5
- package/dist/types/api/index.d.ts +2 -2
- package/dist/types/components/icon/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/locale-switcher/index.d.ts +5 -0
- package/dist/types/components/navigation/index.d.ts +9 -10
- package/dist/types/i18n/index.d.ts +7 -1
- package/dist/types/site/index.d.ts +15 -13
- package/dist/utils/api/index.d.ts +5 -0
- package/dist/utils/date/index.d.ts +4 -3
- package/dist/utils/index.cjs +23 -16
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.mjs +16 -9
- package/dist/utils/navigation/index.d.ts +2 -2
- package/dist/utils/numbers/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/components/layout/header/navigation/types.d.ts +0 -4
- package/dist/index-BClxYYix.js +0 -40
- package/dist/index-BNb-P8a6.mjs +0 -17
- package/dist/index-BhsXlbd8.js +0 -16
- 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
|
|
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$
|
|
13
|
-
const index$
|
|
14
|
-
const
|
|
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 {
|
|
84
|
+
const { config } = index.useSiteContext();
|
|
85
85
|
const { color, invertedColor } = index$1.usePrimaryColors();
|
|
86
|
-
const isInvertedColor = (_a =
|
|
87
|
-
const isInternalLink = linkType === "redirect" || (href
|
|
88
|
-
const LinkComponent = isInternalLink ?
|
|
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$
|
|
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$
|
|
359
|
+
sortedItems = [...items].sort(randomSeed ? index$4.getSeededRandomComparator(randomSeed) : index$4.randomComparator);
|
|
360
360
|
}
|
|
361
361
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
362
362
|
Grid,
|
|
@@ -505,10 +505,10 @@ const GameInfoItem = ({ title, value }) => {
|
|
|
505
505
|
};
|
|
506
506
|
const VISIBLE_LANGUAGE_NUMBER = 5;
|
|
507
507
|
function stringifyHasFeature(value) {
|
|
508
|
-
return
|
|
508
|
+
return i18next.t(`gameInfo:value.boolean.${value}`);
|
|
509
509
|
}
|
|
510
510
|
function stringifyVolatility(value) {
|
|
511
|
-
return
|
|
511
|
+
return i18next.t(`gameInfo:value.volatility.${value}`);
|
|
512
512
|
}
|
|
513
513
|
function stringifyArray(array) {
|
|
514
514
|
return array.join(", ");
|
|
@@ -516,35 +516,35 @@ function stringifyArray(array) {
|
|
|
516
516
|
function stringifyLanguageArray(languages) {
|
|
517
517
|
return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
|
|
518
518
|
}
|
|
519
|
-
function getGameInfoItemValue(key, value, currency) {
|
|
519
|
+
function getGameInfoItemValue(key, value, locale, currency) {
|
|
520
520
|
let formattedValue = "";
|
|
521
521
|
if (typeof value !== "string") {
|
|
522
|
-
if (key ===
|
|
523
|
-
formattedValue = index$
|
|
522
|
+
if (key === index$5.GameCharacteristic.Rtp) {
|
|
523
|
+
formattedValue = index$4.formatNumber(value, { percent: "real", precision: 3 });
|
|
524
524
|
}
|
|
525
|
-
if (key ===
|
|
525
|
+
if (key === index$5.GameCharacteristic.MinBet || key === index$5.GameCharacteristic.MaxBet || key === index$5.GameCharacteristic.MaxWin) {
|
|
526
526
|
if (Array.isArray(currency)) {
|
|
527
527
|
const [primary, ...secondaries] = currency || ["USD"];
|
|
528
|
-
const primaryValue = index$
|
|
529
|
-
formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => index$
|
|
528
|
+
const primaryValue = index$4.formatNumber(value, { currency: primary });
|
|
529
|
+
formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => index$4.getCurrencySymbol(currency2, locale)).join(", ")})` : primaryValue;
|
|
530
530
|
} else {
|
|
531
|
-
formattedValue = index$
|
|
531
|
+
formattedValue = index$4.formatNumber(value, { currency });
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
|
-
if (key ===
|
|
534
|
+
if (key === index$5.GameCharacteristic.Compatibility || key === index$5.GameCharacteristic.BonusFeatures) {
|
|
535
535
|
formattedValue = stringifyArray(value);
|
|
536
536
|
}
|
|
537
|
-
if (key ===
|
|
537
|
+
if (key === index$5.GameCharacteristic.Languages) {
|
|
538
538
|
formattedValue = stringifyLanguageArray(value);
|
|
539
539
|
}
|
|
540
540
|
if (typeof value === "boolean") {
|
|
541
541
|
formattedValue = stringifyHasFeature(value);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
if (key ===
|
|
545
|
-
formattedValue = index$
|
|
544
|
+
if (key === index$5.GameCharacteristic.ReleaseDate) {
|
|
545
|
+
formattedValue = index$4.formatDate({ value, locale, options: { year: "numeric", month: "long" } });
|
|
546
546
|
}
|
|
547
|
-
if (key ===
|
|
547
|
+
if (key === index$5.GameCharacteristic.Volatility) {
|
|
548
548
|
formattedValue = stringifyVolatility(value);
|
|
549
549
|
}
|
|
550
550
|
if (!formattedValue) {
|
|
@@ -553,9 +553,10 @@ function getGameInfoItemValue(key, value, currency) {
|
|
|
553
553
|
return formattedValue;
|
|
554
554
|
}
|
|
555
555
|
const GameInfo = ({ info }) => {
|
|
556
|
-
const { metadata } = index.useSiteContext();
|
|
557
|
-
const { currency } = metadata;
|
|
558
556
|
const { t } = reactI18next.useTranslation("gameInfo");
|
|
557
|
+
const { localization } = index.useSiteContext();
|
|
558
|
+
const locale = localization.currentLocale.code;
|
|
559
|
+
const currency = localization.currency;
|
|
559
560
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
560
561
|
react$1.Box,
|
|
561
562
|
{
|
|
@@ -574,7 +575,7 @@ const GameInfo = ({ info }) => {
|
|
|
574
575
|
return null;
|
|
575
576
|
}
|
|
576
577
|
const feature = itemKey;
|
|
577
|
-
const value = getGameInfoItemValue(feature, itemValue, currency);
|
|
578
|
+
const value = getGameInfoItemValue(feature, itemValue, locale, currency);
|
|
578
579
|
return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`), value }, itemKey);
|
|
579
580
|
})
|
|
580
581
|
] }, group)) })
|
|
@@ -607,19 +608,20 @@ const Logo = () => {
|
|
|
607
608
|
const Brand$1 = ({ brand }) => {
|
|
608
609
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { position: "relative", my: 2, py: 8, children: [
|
|
609
610
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Divider, {}),
|
|
610
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { display: "flex", bgColor: react$1.useColorModeValue("gray.50", "gray.900"), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
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 }) })
|
|
611
612
|
] });
|
|
612
613
|
};
|
|
613
614
|
const Copyright = () => {
|
|
614
615
|
const { metadata } = index.useSiteContext();
|
|
615
|
-
const { name: siteName } = metadata;
|
|
616
616
|
const { t } = reactI18next.useTranslation("footer");
|
|
617
|
-
|
|
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 }) });
|
|
618
620
|
};
|
|
619
621
|
const Disclaimer = () => {
|
|
620
622
|
const { metadata } = index.useSiteContext();
|
|
621
|
-
const { name: siteName } = metadata;
|
|
622
623
|
const { t } = reactI18next.useTranslation("footer");
|
|
624
|
+
const siteName = metadata.name;
|
|
623
625
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { as: "small", colorScheme: "gray", fontSize: "sm", children: [
|
|
624
626
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", fontWeight: "bold", color: "red.600", children: t("disclaimer.title") }),
|
|
625
627
|
t("disclaimer.description", { siteName })
|
|
@@ -640,29 +642,29 @@ const Navigation$1 = ({ menu }) => {
|
|
|
640
642
|
spacing: 4,
|
|
641
643
|
justifyItems: { base: "flex-start", md: "center" },
|
|
642
644
|
justifyContent: "space-between",
|
|
643
|
-
children: menu.map(({
|
|
645
|
+
children: menu.map(({ slug, label }, index$12) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
644
646
|
react$1.Text,
|
|
645
647
|
{
|
|
646
|
-
as:
|
|
647
|
-
to:
|
|
648
|
+
as: index.Link,
|
|
649
|
+
to: slug,
|
|
648
650
|
fontSize: "md",
|
|
649
651
|
fontWeight: "semibold",
|
|
650
652
|
colorScheme: "gray",
|
|
651
653
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
652
654
|
children: label
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
) }, index2))
|
|
655
|
+
}
|
|
656
|
+
) }, index$12))
|
|
656
657
|
}
|
|
657
658
|
);
|
|
658
659
|
};
|
|
659
660
|
const Footer = () => {
|
|
660
|
-
var _a, _b
|
|
661
|
-
const {
|
|
662
|
-
const
|
|
663
|
-
const
|
|
664
|
-
const
|
|
665
|
-
const
|
|
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;
|
|
666
668
|
const hasExtra = !!extra;
|
|
667
669
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
668
670
|
react$1.Box,
|
|
@@ -672,7 +674,7 @@ const Footer = () => {
|
|
|
672
674
|
color: react$1.useColorModeValue("gray.700", "gray.200"),
|
|
673
675
|
py: 4,
|
|
674
676
|
children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
|
|
675
|
-
hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(Navigation$1, { menu
|
|
677
|
+
hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(Navigation$1, { menu }),
|
|
676
678
|
hasExtra && /* @__PURE__ */ jsxRuntime.jsx(Extra, { children: extra }),
|
|
677
679
|
showDisclaimer && /* @__PURE__ */ jsxRuntime.jsx(Disclaimer, {}),
|
|
678
680
|
/* @__PURE__ */ jsxRuntime.jsx(Brand$1, { brand: /* @__PURE__ */ jsxRuntime.jsx(Logo, {}) }),
|
|
@@ -682,15 +684,111 @@ const Footer = () => {
|
|
|
682
684
|
);
|
|
683
685
|
};
|
|
684
686
|
const Brand = ({ brand }) => {
|
|
685
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
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
|
+
] });
|
|
686
784
|
};
|
|
687
|
-
const NavLink = react.forwardRef(({
|
|
785
|
+
const NavLink = react.forwardRef(({ slug, label }, ref) => {
|
|
688
786
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
689
787
|
react$1.Text,
|
|
690
788
|
{
|
|
691
789
|
ref,
|
|
692
|
-
as:
|
|
693
|
-
to:
|
|
790
|
+
as: index.Link,
|
|
791
|
+
to: slug,
|
|
694
792
|
p: 2,
|
|
695
793
|
fontWeight: "semibold",
|
|
696
794
|
_hover: { textDecoration: "none", color: "brand.400" },
|
|
@@ -699,7 +797,7 @@ const NavLink = react.forwardRef(({ path, label }, ref) => {
|
|
|
699
797
|
);
|
|
700
798
|
});
|
|
701
799
|
NavLink.displayName = "NavLink";
|
|
702
|
-
const NavList$1 = ({
|
|
800
|
+
const NavList$1 = ({ slug, label, children }) => {
|
|
703
801
|
const background = react$1.useColorModeValue("white", "gray.800");
|
|
704
802
|
const backgroundHover = react$1.useColorModeValue("brand.50", "gray.900");
|
|
705
803
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Popover, { trigger: "hover", placement: "bottom-start", children: [
|
|
@@ -714,22 +812,37 @@ const NavList$1 = ({ path, label, children }) => {
|
|
|
714
812
|
children: label
|
|
715
813
|
}
|
|
716
814
|
) }),
|
|
717
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
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
|
+
)
|
|
733
846
|
] });
|
|
734
847
|
};
|
|
735
848
|
const DesktopNavigation = ({ menu }) => {
|
|
@@ -739,7 +852,7 @@ const DesktopNavigation = ({ menu }) => {
|
|
|
739
852
|
}) });
|
|
740
853
|
};
|
|
741
854
|
const CHEVRON_DOWN_ICON_SIZE = "1.5rem";
|
|
742
|
-
const NavList = ({
|
|
855
|
+
const NavList = ({ slug, label, children, isExpanded, onExpand }) => {
|
|
743
856
|
return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { flex: 1, children: [
|
|
744
857
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
745
858
|
react$1.Flex,
|
|
@@ -765,7 +878,19 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
|
|
|
765
878
|
]
|
|
766
879
|
}
|
|
767
880
|
),
|
|
768
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
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
|
+
) })
|
|
769
894
|
] });
|
|
770
895
|
};
|
|
771
896
|
const CLOSE_ICON_SIZE = "0.75rem";
|
|
@@ -820,12 +945,15 @@ const Navigation = ({ menu }) => {
|
|
|
820
945
|
] });
|
|
821
946
|
};
|
|
822
947
|
const Header = () => {
|
|
823
|
-
var _a
|
|
824
|
-
const {
|
|
825
|
-
const
|
|
826
|
-
const
|
|
827
|
-
const
|
|
828
|
-
const
|
|
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;
|
|
829
957
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
830
958
|
react$1.Box,
|
|
831
959
|
{
|
|
@@ -848,8 +976,11 @@ const Header = () => {
|
|
|
848
976
|
align: "center",
|
|
849
977
|
gap: 2,
|
|
850
978
|
children: [
|
|
851
|
-
hasNavigation && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(Navigation, { menu
|
|
852
|
-
hasToolbar && /* @__PURE__ */ jsxRuntime.
|
|
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
|
+
] })
|
|
853
984
|
]
|
|
854
985
|
}
|
|
855
986
|
)
|
|
@@ -951,7 +1082,7 @@ const NotFound = () => {
|
|
|
951
1082
|
/* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { fontSize: "xl", children: [
|
|
952
1083
|
t("description"),
|
|
953
1084
|
" ",
|
|
954
|
-
/* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { as:
|
|
1085
|
+
/* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { as: index.Link, to: "/", variant: "link", colorScheme: "brand", fontSize: "xl", children: t("action") })
|
|
955
1086
|
] })
|
|
956
1087
|
] });
|
|
957
1088
|
};
|
|
@@ -1028,19 +1159,21 @@ function replacePlaceholders(text, placeholders) {
|
|
|
1028
1159
|
});
|
|
1029
1160
|
return text;
|
|
1030
1161
|
}
|
|
1031
|
-
const Seo = ({ children,
|
|
1032
|
-
const {
|
|
1162
|
+
const Seo = ({ children, title, description, lang }) => {
|
|
1163
|
+
const { metadata } = index.useSiteContext();
|
|
1164
|
+
const { name: siteName, lang: defaultLang, seo } = metadata;
|
|
1033
1165
|
const { title: defaultTitle, description: defaultDescription } = seo;
|
|
1166
|
+
const siteLang = lang || defaultLang;
|
|
1034
1167
|
const placeholders = react.useMemo(
|
|
1035
1168
|
() => ({
|
|
1036
1169
|
siteName,
|
|
1037
|
-
currentYear: index$
|
|
1038
|
-
currentMonth: index$
|
|
1170
|
+
currentYear: index$4.getCurrentYear(siteLang),
|
|
1171
|
+
currentMonth: index$4.getCurrentMonth(siteLang)
|
|
1039
1172
|
}),
|
|
1040
|
-
[siteName]
|
|
1173
|
+
[siteName, siteLang]
|
|
1041
1174
|
);
|
|
1042
1175
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1043
|
-
/* @__PURE__ */ jsxRuntime.jsx("html", { lang:
|
|
1176
|
+
/* @__PURE__ */ jsxRuntime.jsx("html", { lang: siteLang }),
|
|
1044
1177
|
/* @__PURE__ */ jsxRuntime.jsx("title", { children: title ? typeof title === "string" ? replacePlaceholders(title, placeholders) : title(placeholders) : defaultTitle }),
|
|
1045
1178
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1046
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;
|