@anywayseo/tools 5.1.0 → 5.3.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 (39) hide show
  1. package/dist/components/base/image/index.d.ts +10 -0
  2. package/dist/components/base/index.d.ts +1 -0
  3. package/dist/components/game-demo/preview/index.d.ts +2 -2
  4. package/dist/components/game-info/index.d.ts +2 -1
  5. package/dist/components/game-info/utils.d.ts +3 -1
  6. package/dist/components/index.cjs +3 -2
  7. package/dist/components/index.mjs +3 -2
  8. package/dist/components/strapi-component/utils.d.ts +9 -0
  9. package/dist/hooks/index.cjs +1 -1
  10. package/dist/hooks/index.mjs +1 -1
  11. package/dist/i18n/index.cjs +1 -1
  12. package/dist/i18n/index.mjs +1 -1
  13. package/dist/{index-Bu4S7kG8.mjs → index-BCK4kr6V.mjs} +13 -21
  14. package/dist/{index-D0yXUsJz.js → index-BGMR4f6W.js} +73 -63
  15. package/dist/{index-D34TfBTR.js → index-BICcOaT7.js} +9 -17
  16. package/dist/{index-BIdYBT1G.js → index-BbxOP7UY.js} +9 -5
  17. package/dist/{index-B9GEoC68.js → index-BltrZp3R.js} +33 -10
  18. package/dist/{index-CACDltm3.mjs → index-Bts2DBYS.mjs} +12 -12
  19. package/dist/{index-tJcccH0B.mjs → index-Bwlxdh5F.mjs} +25 -2
  20. package/dist/{index-CrmmG8yy.mjs → index-C4sJXfkN.mjs} +7 -3
  21. package/dist/{index-BnmGE5_x.js → index-CAfBnNV6.js} +1 -1
  22. package/dist/{index-BHfpWNqh.js → index-CJVr79Z2.js} +12 -12
  23. package/dist/{index-BCuXOiT9.mjs → index-CjaAcLJf.mjs} +71 -61
  24. package/dist/{index-QazOxABc.mjs → index-tj12BA6U.mjs} +1 -1
  25. package/dist/index.cjs +7 -7
  26. package/dist/index.mjs +11 -11
  27. package/dist/providers/index.cjs +2 -2
  28. package/dist/providers/index.mjs +2 -2
  29. package/dist/types/components/how-to/index.d.ts +2 -2
  30. package/dist/types/components/image/index.d.ts +4 -2
  31. package/dist/types/content/author/index.d.ts +2 -2
  32. package/dist/types/site/index.d.ts +3 -3
  33. package/dist/utils/currency/index.d.ts +2 -0
  34. package/dist/utils/index.cjs +1 -2
  35. package/dist/utils/index.d.ts +1 -0
  36. package/dist/utils/index.mjs +5 -6
  37. package/dist/utils/numbers/index.d.ts +1 -17
  38. package/dist/utils/numbers/types.d.ts +15 -1
  39. package/package.json +3 -2
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { ImageType } from '../../../types';
3
+ import { ImageProps as ChakraImageProps } from '@chakra-ui/react';
4
+ type ImageProps = Omit<ChakraImageProps, 'src'> & {
5
+ src?: ImageType;
6
+ mode?: 'thumbnail' | 'default';
7
+ hasZoom?: boolean;
8
+ };
9
+ declare const Image: FC<ImageProps>;
10
+ export default Image;
@@ -1,5 +1,6 @@
1
1
  export { default as Author } from './author';
2
2
  export { default as Center } from './center';
3
3
  export { default as Grid } from './grid';
4
+ export { default as Image } from './image';
4
5
  export { default as Link } from './link';
5
6
  export { default as LinkButton } from './link-button';
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
- import { Image as TImage, ImageFit } from '../../../types';
2
+ import { ImageType, ImageFit } from '../../../types';
3
3
  type GameDemoPreviewProps = {
4
- image: TImage;
4
+ image: ImageType;
5
5
  alt: string;
6
6
  href?: string;
7
7
  imageFit?: ImageFit;
@@ -1,7 +1,8 @@
1
1
  import { FC } from 'react';
2
- import { IGameInfo } from '../../types';
2
+ import { Currency, IGameInfo } from '../../types';
3
3
  type GameInfoProps = {
4
4
  info: IGameInfo;
5
+ currencies?: Currency[];
5
6
  };
6
7
  declare const GameInfo: FC<GameInfoProps>;
7
8
  export default GameInfo;
@@ -1,2 +1,4 @@
1
1
  import { Currency, ILocale, GameCharacteristic } from '../../types';
2
- export declare function getGameInfoItemValue(key: GameCharacteristic, value: unknown, locale: ILocale['code'], currency: Currency | Currency[]): string;
2
+ export declare function getGameInfoItemValue(key: GameCharacteristic, value: unknown, locale: ILocale['code']): string;
3
+ export declare const DEFAULT_CURRENCY = "$, \u20AC, \u00A3";
4
+ export declare function getGameInfoCurrency(currency: Currency | Currency[], locale: ILocale['code']): string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-D0yXUsJz.js");
4
- const index$1 = require("../index-B9GEoC68.js");
3
+ const index = require("../index-BGMR4f6W.js");
4
+ const index$1 = require("../index-BltrZp3R.js");
5
5
  exports.Author = index.Author;
6
6
  exports.AuthorCard = index.AuthorCard;
7
7
  exports.BonusCard = index.BonusCard;
@@ -27,4 +27,5 @@ exports.StrapiContentRenderer = index.StrapiContentRenderer;
27
27
  exports.Table = index.Table;
28
28
  exports.Tabs = index.Tabs;
29
29
  exports.Tip = index.Tip;
30
+ exports.Image = index$1.Image;
30
31
  exports.Link = index$1.Link;
@@ -1,5 +1,5 @@
1
- import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, S, h, T, i, j } from "../index-BCuXOiT9.mjs";
2
- import { L as L2 } from "../index-tJcccH0B.mjs";
1
+ import { k, A, B, a, l, C, F, b, c, G, d, e, f, m, H, L, n, g, N, P, S, h, T, i, j } from "../index-CjaAcLJf.mjs";
2
+ import { I, L as L2 } from "../index-Bwlxdh5F.mjs";
3
3
  export {
4
4
  k as Author,
5
5
  A as AuthorCard,
@@ -16,6 +16,7 @@ export {
16
16
  f as GameInfo,
17
17
  m as Grid,
18
18
  H as HowTo,
19
+ I as Image,
19
20
  L as Layout,
20
21
  L2 as Link,
21
22
  n as LinkButton,
@@ -1,3 +1,12 @@
1
+ import { Currency } from '../../types';
1
2
  export declare function extractItemsFromJson(content: {
2
3
  ['strapi_json_value']: string[];
3
4
  }): string[];
5
+ interface ICurrencyListItem {
6
+ code: Currency;
7
+ }
8
+ interface ICurrencyList {
9
+ items: ICurrencyListItem[];
10
+ }
11
+ export declare function extractCurrencies(currencyList?: ICurrencyList): Currency[];
12
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index = require("../index-WFgDSB1A.js");
4
- const index$1 = require("../index-BnmGE5_x.js");
4
+ const index$1 = require("../index-CAfBnNV6.js");
5
5
  exports.useLocalization = index.useLocalization;
6
6
  exports.usePrimaryColors = index$1.usePrimaryColors;
@@ -1,5 +1,5 @@
1
1
  import { u } from "../index-BzbpMLDD.mjs";
2
- import { u as u2 } from "../index-QazOxABc.mjs";
2
+ import { u as u2 } from "../index-tj12BA6U.mjs";
3
3
  export {
4
4
  u as useLocalization,
5
5
  u2 as usePrimaryColors
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../index-BHfpWNqh.js");
3
+ const index = require("../index-CJVr79Z2.js");
4
4
  const resources = {
5
5
  en: index.dictionary$4,
6
6
  it: index.dictionary$3,
@@ -1,4 +1,4 @@
1
- import { d as dictionary, b as dictionary$1, c as dictionary$2, e as dictionary$3, f as dictionary$4 } from "../index-CACDltm3.mjs";
1
+ import { d as dictionary, b as dictionary$1, c as dictionary$2, e as dictionary$3, f as dictionary$4 } from "../index-Bts2DBYS.mjs";
2
2
  const resources = {
3
3
  en: dictionary$4,
4
4
  it: dictionary$3,
@@ -1,4 +1,13 @@
1
1
  import { DEFAULT_LANGUAGE } from "./i18n/index.mjs";
2
+ function getCurrencySymbol(currencyCode, locale = DEFAULT_LANGUAGE) {
3
+ const symbol = 0 .toLocaleString(locale, {
4
+ style: "currency",
5
+ currency: currencyCode,
6
+ minimumFractionDigits: 0,
7
+ maximumFractionDigits: 0
8
+ }).replace(/\d/g, "").trim();
9
+ return symbol;
10
+ }
2
11
  function getCurrentYear(locale = DEFAULT_LANGUAGE) {
3
12
  const currentDate = /* @__PURE__ */ new Date();
4
13
  const currentYear = new Intl.DateTimeFormat(locale, { year: "numeric" }).format(currentDate);
@@ -54,22 +63,6 @@ function formatNumber(number, options) {
54
63
  const formatter = new Intl.NumberFormat(locale, formatOptions);
55
64
  return `${formatter.format(round(number, precision))}${postfix}`;
56
65
  }
57
- function parseNumber(value) {
58
- const parsedNumber = parseFloat(value);
59
- if (isNaN(parsedNumber)) {
60
- return null;
61
- }
62
- return parsedNumber;
63
- }
64
- function getCurrencySymbol(currencyCode, locale = DEFAULT_LANGUAGE) {
65
- const symbol = 0 .toLocaleString(locale, {
66
- style: "currency",
67
- currency: currencyCode,
68
- minimumFractionDigits: 0,
69
- maximumFractionDigits: 0
70
- }).replace(/\d/g, "").trim();
71
- return symbol;
72
- }
73
66
  function randomComparator() {
74
67
  return Math.random() - 0.5;
75
68
  }
@@ -82,14 +75,13 @@ function getSeededRandomComparator(seed) {
82
75
  return () => seededRandom(safeSeed + index++) - 0.5;
83
76
  }
84
77
  export {
85
- getCurrentMonth as a,
86
- formatNumber as b,
87
- getCurrencySymbol as c,
78
+ getCurrentYear as a,
79
+ getCurrentMonth as b,
80
+ formatNumber as c,
88
81
  randomComparator as d,
89
82
  getSeededRandomComparator as e,
90
83
  formatDate as f,
91
- getCurrentYear as g,
92
- parseNumber as p,
84
+ getCurrencySymbol as g,
93
85
  round as r,
94
86
  toFixedTwo as t
95
87
  };
@@ -2,15 +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 index = require("./index-B9GEoC68.js");
5
+ require("react-medium-image-zoom");
6
+ const index = require("./index-BltrZp3R.js");
6
7
  const react = require("react");
7
8
  const index$3 = require("./index-C6MG_f24.js");
8
- const index$5 = require("./index-BHfpWNqh.js");
9
+ const index$5 = require("./index-CJVr79Z2.js");
9
10
  const react$2 = require("@mdx-js/react");
10
11
  const icons = require("@chakra-ui/icons");
11
- const index$4 = require("./index-D34TfBTR.js");
12
+ const index$4 = require("./index-BICcOaT7.js");
12
13
  const index$2 = require("./index-At00w6EN.js");
13
- const index$1 = require("./index-BnmGE5_x.js");
14
+ const index$1 = require("./index-CAfBnNV6.js");
14
15
  const i18next = require("i18next");
15
16
  const Markdown = require("react-markdown");
16
17
  const ONE_LINE_HEIGHT = 24;
@@ -39,22 +40,20 @@ const Bio = ({ content, maxLines = 1 }) => {
39
40
  };
40
41
  const Author = ({ author, variant }) => {
41
42
  const { name, role, bio, avatar } = author;
42
- const imageComponent = typeof avatar === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Image, { src: avatar, alt: name, rounded: "full" }) : avatar;
43
43
  if (variant === "short") {
44
- return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: "article", align: "center", gap: 4, children: [
45
- !!imageComponent && /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { w: 12, h: 12, children: imageComponent }),
44
+ return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { align: "center", gap: 4, children: [
45
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { w: 12, h: 12, children: /* @__PURE__ */ jsxRuntime.jsx(index.Image, { src: avatar, alt: name, rounded: "full" }) }),
46
46
  /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { fontWeight: "semibold", children: [
47
47
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { children: name }),
48
48
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { color: "gray.500", children: role })
49
49
  ] })
50
50
  ] });
51
51
  }
52
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
53
- !!imageComponent && /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { grow: 1, maxW: { base: 48, sm: 32 }, children: imageComponent }),
54
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { w: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { children: [
52
+ return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { direction: { base: "column", sm: "row" }, align: { base: "center", sm: "flex-start" }, gap: 4, children: [
53
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { flex: 1, maxW: { base: 48, sm: 32 }, children: /* @__PURE__ */ jsxRuntime.jsx(index.Image, { src: avatar, alt: name, rounded: "full" }) }),
54
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Flex, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { children: [
55
55
  /* @__PURE__ */ jsxRuntime.jsxs(react$1.Text, { fontSize: "lg", fontWeight: 600, children: [
56
- name,
57
- ", ",
56
+ `${name}, `,
58
57
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", color: "gray.500", children: role })
59
58
  ] }),
60
59
  /* @__PURE__ */ jsxRuntime.jsx(Bio, { content: bio })
@@ -84,10 +83,11 @@ const LinkButton = ({
84
83
  const { config } = index.useSiteContext();
85
84
  const { color, invertedColor } = index$1.usePrimaryColors();
86
85
  const isInvertedColor = (_a = config == null ? void 0 : config.theme) == null ? void 0 : _a.isInvertedColor;
87
- const isInternalLink = linkType === "redirect" || index$2.isRelativePath(href);
86
+ const isRedirectLink = linkType === "redirect";
87
+ const isInternalLink = index$2.isRelativePath(href);
88
88
  const LinkComponent = isInternalLink ? index.Link : react$1.Link;
89
89
  const hrefKey = isInternalLink ? "to" : "href";
90
- const hrefValue = linkType === "redirect" ? `/follow?to=${href}` : href;
90
+ const hrefValue = isRedirectLink ? `/follow?to=${href}` : href;
91
91
  return /* @__PURE__ */ jsxRuntime.jsx(
92
92
  react$1.Button,
93
93
  {
@@ -104,7 +104,8 @@ const LinkButton = ({
104
104
  ...href ? {
105
105
  as: LinkComponent,
106
106
  [hrefKey]: hrefValue,
107
- rel: "nofollow"
107
+ target: isRedirectLink ? "_blank" : "_self",
108
+ rel: isInternalLink ? "" : "noopener noreferrer nofollow"
108
109
  } : {},
109
110
  children: label
110
111
  }
@@ -114,16 +115,7 @@ const AuthorCard = ({ author, ...boxProps }) => {
114
115
  const { t } = reactI18next.useTranslation("author");
115
116
  return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Card, { as: "article", variant: "filled", ...boxProps, children: [
116
117
  /* @__PURE__ */ jsxRuntime.jsx(react$1.CardHeader, { pb: 0, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.Heading, { size: "md", children: t("title") }) }),
117
- /* @__PURE__ */ jsxRuntime.jsx(
118
- react$1.CardBody,
119
- {
120
- display: "flex",
121
- flexDirection: { base: "column", sm: "row" },
122
- alignItems: { base: "center", sm: "flex-start" },
123
- gap: 4,
124
- children: /* @__PURE__ */ jsxRuntime.jsx(Author, { author, variant: "full" })
125
- }
126
- )
118
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.CardBody, { children: /* @__PURE__ */ jsxRuntime.jsx(Author, { author, variant: "full" }) })
127
119
  ] });
128
120
  };
129
121
  const BonusCardContent = ({ content, buttonColor }) => {
@@ -336,7 +328,7 @@ const GameCard = ({ name, description, image, href, height = "auto" }) => {
336
328
  height,
337
329
  _hover: { transform: "scale(1.05)" },
338
330
  children: [
339
- typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Image, { src: image, alt: name, w: "100%", aspectRatio: "16/9", objectFit: "cover", objectPosition: "center" }) : !!image && /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { w: "100%", aspectRatio: "16/9", children: image }),
331
+ /* @__PURE__ */ jsxRuntime.jsx(index.Image, { src: image, alt: name, mode: "thumbnail" }),
340
332
  /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { as: "section", rounded: "md", p: 4, children: [
341
333
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { as: "span", children: href ? /* @__PURE__ */ jsxRuntime.jsx(react$1.LinkOverlay, { href, children: name }) : name }),
342
334
  !!description && /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontSize: "sm", color: "gray.600", children: description })
@@ -428,9 +420,8 @@ const GameDemoContent = ({
428
420
  };
429
421
  const GameDemoPreview = ({ image, alt, href, imageFit = "contain", onPlayDemo }) => {
430
422
  const { t } = reactI18next.useTranslation("gameDemo");
431
- const imageComponent = typeof image === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Image, { src: image, alt, objectFit: imageFit, w: "100%", h: "100%" }) : image;
432
423
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
433
- imageComponent,
424
+ /* @__PURE__ */ jsxRuntime.jsx(index.Image, { src: image, alt, objectFit: imageFit, w: "100%", h: "100%" }),
434
425
  /* @__PURE__ */ jsxRuntime.jsx(react$1.AbsoluteCenter, { children: /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { spacing: 4, children: [
435
426
  /* @__PURE__ */ jsxRuntime.jsx(
436
427
  LinkButton,
@@ -439,7 +430,17 @@ const GameDemoPreview = ({ image, alt, href, imageFit = "contain", onPlayDemo })
439
430
  ...href ? { label: t("action.playForReal"), href } : { label: t("action.playForFree"), onClick: onPlayDemo }
440
431
  }
441
432
  ),
442
- !!href && /* @__PURE__ */ jsxRuntime.jsx(react$1.Button, { variant: "outline", colorScheme: "brand", size: { base: "sm", md: "md" }, onClick: onPlayDemo, children: t("action.playForFree") })
433
+ !!href && /* @__PURE__ */ jsxRuntime.jsx(
434
+ react$1.Button,
435
+ {
436
+ variant: "solid",
437
+ colorScheme: "brand",
438
+ size: { base: "sm", md: "lg" },
439
+ _active: { transform: "scale(0.95)" },
440
+ onClick: onPlayDemo,
441
+ children: t("action.playForFree")
442
+ }
443
+ )
443
444
  ] }) })
444
445
  ] });
445
446
  };
@@ -503,39 +504,34 @@ const GameInfoItem = ({ title, value }) => {
503
504
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { w: "50%", textTransform: "capitalize", children: value })
504
505
  ] });
505
506
  };
506
- const VISIBLE_LANGUAGE_NUMBER = 5;
507
+ const MAX_VISIBLE_LANGUAGE = 5;
507
508
  function stringifyHasFeature(value) {
508
509
  return i18next.t(`gameInfo:value.boolean.${value}`);
509
510
  }
510
511
  function stringifyVolatility(value) {
511
512
  return i18next.t(`gameInfo:value.volatility.${value}`);
512
513
  }
513
- function stringifyArray(array) {
514
+ function stringifyArray(array, max) {
515
+ const safeMax = typeof max === "number" ? Math.max(max, 0) : null;
516
+ if (safeMax && array.length > safeMax) {
517
+ return `${array.slice(0, safeMax).join(", ")}, +${array.length - safeMax}`;
518
+ }
514
519
  return array.join(", ");
515
520
  }
516
- function stringifyLanguageArray(languages) {
517
- return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
518
- }
519
- function getGameInfoItemValue(key, value, locale, currency) {
521
+ function getGameInfoItemValue(key, value, locale) {
520
522
  let formattedValue = "";
521
523
  if (typeof value !== "string") {
522
524
  if (key === index$5.GameCharacteristic.Rtp) {
523
525
  formattedValue = index$4.formatNumber(value, { percent: "real", precision: 3 });
524
526
  }
525
527
  if (key === index$5.GameCharacteristic.MinBet || key === index$5.GameCharacteristic.MaxBet || key === index$5.GameCharacteristic.MaxWin) {
526
- if (Array.isArray(currency)) {
527
- const [primary, ...secondaries] = currency || ["USD"];
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
- } else {
531
- formattedValue = index$4.formatNumber(value, { currency });
532
- }
528
+ formattedValue = index$4.formatNumber(value, { locale });
533
529
  }
534
530
  if (key === index$5.GameCharacteristic.Compatibility || key === index$5.GameCharacteristic.BonusFeatures) {
535
531
  formattedValue = stringifyArray(value);
536
532
  }
537
533
  if (key === index$5.GameCharacteristic.Languages) {
538
- formattedValue = stringifyLanguageArray(value);
534
+ formattedValue = stringifyArray(value, MAX_VISIBLE_LANGUAGE);
539
535
  }
540
536
  if (typeof value === "boolean") {
541
537
  formattedValue = stringifyHasFeature(value);
@@ -552,12 +548,15 @@ function getGameInfoItemValue(key, value, locale, currency) {
552
548
  }
553
549
  return formattedValue;
554
550
  }
555
- const GameInfo = ({ info }) => {
551
+ const DEFAULT_CURRENCY = "$, €, £";
552
+ function getGameInfoCurrency(currency, locale) {
553
+ const currencies = Array.isArray(currency) ? currency.map((code) => index$4.getCurrencySymbol(code, locale)) : [index$4.getCurrencySymbol(currency, locale)];
554
+ return stringifyArray(currencies);
555
+ }
556
+ const GameInfo = ({ info, currencies }) => {
556
557
  const { t } = reactI18next.useTranslation("gameInfo");
557
- const { localization } = index.useSiteContext();
558
558
  const { currentLocale } = index.usePageContext();
559
- const locale = currentLocale.code;
560
- const currency = localization.currency;
559
+ const currency = (currencies == null ? void 0 : currencies.length) ? getGameInfoCurrency(currencies, currentLocale.code) : DEFAULT_CURRENCY;
561
560
  return /* @__PURE__ */ jsxRuntime.jsx(
562
561
  react$1.Box,
563
562
  {
@@ -576,8 +575,8 @@ const GameInfo = ({ info }) => {
576
575
  return null;
577
576
  }
578
577
  const feature = itemKey;
579
- const value = getGameInfoItemValue(feature, itemValue, locale, currency);
580
- return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`), value }, itemKey);
578
+ const value = getGameInfoItemValue(feature, itemValue, currentLocale.code);
579
+ return /* @__PURE__ */ jsxRuntime.jsx(GameInfoItem, { title: t(`feature.${feature}`, { currency }), value }, itemKey);
581
580
  })
582
581
  ] }, group)) })
583
582
  ] })
@@ -586,14 +585,14 @@ const GameInfo = ({ info }) => {
586
585
  };
587
586
  const HowTo = ({ steps, ...boxProps }) => {
588
587
  const { bgColor, invertedColor } = index$1.usePrimaryColors();
589
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description, thumbnail }, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
590
- /* @__PURE__ */ jsxRuntime.jsx(react$1.Circle, { size: 12, bgColor, color: invertedColor, fontSize: "lg", fontWeight: "bold", children: String(index2 + 1) }),
588
+ return /* @__PURE__ */ jsxRuntime.jsx(react$1.SimpleGrid, { as: "ol", columns: { base: 1, md: 2, lg: 3 }, gap: 4, p: 0, ...boxProps, children: steps.map(({ title, description, thumbnail }, index$12) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.Flex, { as: "li", alignItems: "flex-start", gap: 4, children: [
589
+ /* @__PURE__ */ jsxRuntime.jsx(react$1.Circle, { size: 12, bgColor, color: invertedColor, fontSize: "lg", fontWeight: "bold", children: String(index$12 + 1) }),
591
590
  /* @__PURE__ */ jsxRuntime.jsxs(react$1.Stack, { flex: 1, children: [
592
591
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { fontSize: "lg", fontWeight: "bold", children: title }),
593
- typeof thumbnail === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Image, { src: thumbnail, alt: title, aspectRatio: "16/9", objectFit: "cover" }) : thumbnail,
592
+ /* @__PURE__ */ jsxRuntime.jsx(index.Image, { src: thumbnail, alt: title, mode: "thumbnail", hasZoom: true }),
594
593
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { children: description })
595
594
  ] })
596
- ] }, index2)) });
595
+ ] }, index$12)) });
597
596
  };
598
597
  const Container = ({ children }) => {
599
598
  return /* @__PURE__ */ jsxRuntime.jsx(react$1.Container, { maxW: "container.xl", children });
@@ -604,7 +603,7 @@ const Content = ({ children }) => {
604
603
  const Logo = () => {
605
604
  const { metadata } = index.useSiteContext();
606
605
  const { logo } = metadata;
607
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { display: "flex", h: { base: 10, md: 14 }, overflow: "hidden", children: typeof logo === "string" ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Image, { src: logo, alt: "Logo", objectFit: "contain" }) : logo });
606
+ return /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { display: "flex", h: { base: 10, md: 14 }, overflow: "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(index.Image, { src: logo, alt: "Logo", objectFit: "contain" }) });
608
607
  };
609
608
  const Brand$1 = ({ brand }) => {
610
609
  return /* @__PURE__ */ jsxRuntime.jsxs(react$1.Box, { position: "relative", my: 2, py: 8, children: [
@@ -1071,7 +1070,7 @@ const Layout = ({ children }) => {
1071
1070
  ] });
1072
1071
  };
1073
1072
  const List = ({ items, bullet = "—", render, ...boxProps }) => {
1074
- return /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { pl: 0, ml: 2, mb: 4, ...boxProps, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.ListItem, { display: "flex", gap: 1, children: [
1073
+ return /* @__PURE__ */ jsxRuntime.jsx(react$1.List, { pl: 0, ml: 2, ...boxProps, children: items.map((item, index2) => /* @__PURE__ */ jsxRuntime.jsxs(react$1.ListItem, { display: "flex", gap: 1, children: [
1075
1074
  /* @__PURE__ */ jsxRuntime.jsx(react$1.Box, { children: bullet }),
1076
1075
  render ? render(item) : item
1077
1076
  ] }, index2)) });
@@ -1239,7 +1238,7 @@ const Tip = ({ tip, author = null, ...boxProps }) => {
1239
1238
  const ExternalImage = ({ image, component: ImageComponent, alt = "", ...imageProps }) => {
1240
1239
  var _a, _b;
1241
1240
  const imageData = (_b = (_a = image == null ? void 0 : image.localFile) == null ? void 0 : _a.childImageSharp) == null ? void 0 : _b.gatsbyImageData;
1242
- return imageData ? /* @__PURE__ */ jsxRuntime.jsx(ImageComponent, { image: imageData, alt, ...imageProps }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
1241
+ return imageData ? /* @__PURE__ */ jsxRuntime.jsx(ImageComponent, { image: imageData, alt, ...imageProps }) : null;
1243
1242
  };
1244
1243
  const RichText = ({ content }) => {
1245
1244
  const components = react$2.useMDXComponents();
@@ -1248,6 +1247,12 @@ const RichText = ({ content }) => {
1248
1247
  function extractItemsFromJson(content) {
1249
1248
  return content.strapi_json_value;
1250
1249
  }
1250
+ function extractCurrencies(currencyList) {
1251
+ if (!currencyList) {
1252
+ return [];
1253
+ }
1254
+ return [...new Set(currencyList.items.map(({ code }) => code))];
1255
+ }
1251
1256
  const StrapiComponent = ({ type, props, imageComponent }) => {
1252
1257
  switch (type) {
1253
1258
  case "STRAPI__COMPONENT_CONTENT_FAQ":
@@ -1266,7 +1271,13 @@ const StrapiComponent = ({ type, props, imageComponent }) => {
1266
1271
  }
1267
1272
  );
1268
1273
  case "STRAPI__COMPONENT_CONTENT_GAME_INFO":
1269
- return /* @__PURE__ */ jsxRuntime.jsx(GameInfo, { info: { ...props } });
1274
+ return /* @__PURE__ */ jsxRuntime.jsx(
1275
+ GameInfo,
1276
+ {
1277
+ info: { general: props.general, features: props.features },
1278
+ currencies: extractCurrencies(props.currency)
1279
+ }
1280
+ );
1270
1281
  case "STRAPI__COMPONENT_CONTENT_HOW_TO":
1271
1282
  return /* @__PURE__ */ jsxRuntime.jsx(
1272
1283
  HowTo,
@@ -1281,15 +1292,14 @@ const StrapiComponent = ({ type, props, imageComponent }) => {
1281
1292
  }
1282
1293
  );
1283
1294
  case "STRAPI__COMPONENT_CONTENT_LIST":
1284
- return /* @__PURE__ */ jsxRuntime.jsx(List, { bullet: props.bullet, items: extractItemsFromJson(props.content) });
1295
+ return /* @__PURE__ */ jsxRuntime.jsx(List, { bullet: props.bullet, items: extractItemsFromJson(props.content), mb: 4 });
1285
1296
  case "STRAPI__COMPONENT_CONTENT_MEDIA":
1286
1297
  return /* @__PURE__ */ jsxRuntime.jsx(
1287
- ExternalImage,
1298
+ index.Image,
1288
1299
  {
1289
- component: imageComponent,
1290
- image: props.file,
1291
- alt: props.alternativeText,
1292
- style: { display: "inline-block", marginBottom: 16 }
1300
+ src: /* @__PURE__ */ jsxRuntime.jsx(ExternalImage, { component: imageComponent, image: props.file, alt: props.alternativeText }),
1301
+ mb: 4,
1302
+ hasZoom: true
1293
1303
  }
1294
1304
  );
1295
1305
  case "STRAPI__COMPONENT_CONTENT_PROS_CONS":
@@ -1,5 +1,14 @@
1
1
  "use strict";
2
2
  const i18n = require("./i18n/index.cjs");
3
+ function getCurrencySymbol(currencyCode, locale = i18n.DEFAULT_LANGUAGE) {
4
+ const symbol = 0 .toLocaleString(locale, {
5
+ style: "currency",
6
+ currency: currencyCode,
7
+ minimumFractionDigits: 0,
8
+ maximumFractionDigits: 0
9
+ }).replace(/\d/g, "").trim();
10
+ return symbol;
11
+ }
3
12
  function getCurrentYear(locale = i18n.DEFAULT_LANGUAGE) {
4
13
  const currentDate = /* @__PURE__ */ new Date();
5
14
  const currentYear = new Intl.DateTimeFormat(locale, { year: "numeric" }).format(currentDate);
@@ -55,22 +64,6 @@ function formatNumber(number, options) {
55
64
  const formatter = new Intl.NumberFormat(locale, formatOptions);
56
65
  return `${formatter.format(round(number, precision))}${postfix}`;
57
66
  }
58
- function parseNumber(value) {
59
- const parsedNumber = parseFloat(value);
60
- if (isNaN(parsedNumber)) {
61
- return null;
62
- }
63
- return parsedNumber;
64
- }
65
- function getCurrencySymbol(currencyCode, locale = i18n.DEFAULT_LANGUAGE) {
66
- const symbol = 0 .toLocaleString(locale, {
67
- style: "currency",
68
- currency: currencyCode,
69
- minimumFractionDigits: 0,
70
- maximumFractionDigits: 0
71
- }).replace(/\d/g, "").trim();
72
- return symbol;
73
- }
74
67
  function randomComparator() {
75
68
  return Math.random() - 0.5;
76
69
  }
@@ -88,7 +81,6 @@ exports.getCurrencySymbol = getCurrencySymbol;
88
81
  exports.getCurrentMonth = getCurrentMonth;
89
82
  exports.getCurrentYear = getCurrentYear;
90
83
  exports.getSeededRandomComparator = getSeededRandomComparator;
91
- exports.parseNumber = parseNumber;
92
84
  exports.randomComparator = randomComparator;
93
85
  exports.round = round;
94
86
  exports.toFixedTwo = toFixedTwo;
@@ -2,12 +2,12 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const react$1 = require("@chakra-ui/react");
4
4
  const react = require("@mdx-js/react");
5
+ const index = require("./index-BltrZp3R.js");
5
6
  require("react");
6
7
  require("react-i18next");
7
- const index$1 = require("./index-B9GEoC68.js");
8
8
  require("./index-C6MG_f24.js");
9
- require("./index-BHfpWNqh.js");
10
- const index = require("./index-At00w6EN.js");
9
+ require("./index-CJVr79Z2.js");
10
+ const index$1 = require("./index-At00w6EN.js");
11
11
  function omitProps(props, omittedKeys) {
12
12
  const result = { ...props };
13
13
  omittedKeys.forEach((key) => {
@@ -25,7 +25,7 @@ function renderLink({
25
25
  href,
26
26
  ...props
27
27
  }) {
28
- return index.isRelativePath(href) ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Link, { as: index$1.Link, to: href, color: "brand.400", ...props }) : /* @__PURE__ */ jsxRuntime.jsx(
28
+ return index$1.isRelativePath(href) ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Link, { as: index.Link, to: href, color: "brand.400", ...props }) : /* @__PURE__ */ jsxRuntime.jsx(
29
29
  react$1.Link,
30
30
  {
31
31
  href,
@@ -37,6 +37,9 @@ function renderLink({
37
37
  }
38
38
  );
39
39
  }
40
+ function renderImage(props) {
41
+ return /* @__PURE__ */ jsxRuntime.jsx(index.Image, { ...props, mt: 4, mb: 4, hasZoom: true });
42
+ }
40
43
  const components = {
41
44
  h1: preprocessProps((props) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Heading, { as: "h1", size: "xl", mb: 4, ...props })),
42
45
  h2: preprocessProps((props) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Heading, { as: "h2", size: "lg", mt: 6, mb: 4, ...props })),
@@ -44,7 +47,8 @@ const components = {
44
47
  ol: preprocessProps((props) => /* @__PURE__ */ jsxRuntime.jsx(react$1.OrderedList, { mb: 4, ...props })),
45
48
  ul: preprocessProps((props) => /* @__PURE__ */ jsxRuntime.jsx(react$1.UnorderedList, { mb: 4, ...props })),
46
49
  p: preprocessProps((props) => /* @__PURE__ */ jsxRuntime.jsx(react$1.Text, { mb: 4, ...props })),
47
- a: preprocessProps((props) => renderLink(props))
50
+ a: preprocessProps((props) => renderLink(props)),
51
+ img: preprocessProps((props) => renderImage(props))
48
52
  };
49
53
  const MdxProvider = ({ children }) => {
50
54
  return /* @__PURE__ */ jsxRuntime.jsx(react.MDXProvider, { components, children });