@meduza/ui-kit-2 0.8.5 → 0.8.6

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 (131) hide show
  1. package/dist/AnnouncementInText/AnnouncementInText.types.d.ts +4 -0
  2. package/dist/AnnouncementInText/index.d.ts +3 -0
  3. package/dist/BookmarkButton/BookmarkButton.types.d.ts +6 -0
  4. package/dist/BookmarkButton/index.d.ts +3 -0
  5. package/dist/Button/Button.types.d.ts +16 -0
  6. package/dist/Button/ButtonLoader.d.ts +2 -0
  7. package/dist/Button/index.d.ts +2 -0
  8. package/dist/CardTitle/CardTitle.types.d.ts +11 -0
  9. package/dist/CardTitle/index.d.ts +3 -0
  10. package/dist/ChapterBlock/ChapterBlock.types.d.ts +8 -0
  11. package/dist/ChapterBlock/index.d.ts +3 -0
  12. package/dist/Cover/Cover.types.d.ts +24 -0
  13. package/dist/Cover/index.d.ts +3 -0
  14. package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +6 -0
  15. package/dist/DocumentItemsCount/index.d.ts +3 -0
  16. package/dist/DonatesTeaser/DonatesTeaser.types.d.ts +4 -0
  17. package/dist/DonatesTeaser/index.d.ts +3 -0
  18. package/dist/DotsOnImage/DotsOnImage.types.d.ts +46 -0
  19. package/dist/DotsOnImage/index.d.ts +3 -0
  20. package/dist/Dropdown/Dropdown.types.d.ts +5 -0
  21. package/dist/Dropdown/index.d.ts +4 -0
  22. package/dist/EmbedBlock/EmbedBlock.d.ts +3 -0
  23. package/dist/EmbedBlock/EmbedBlock.types.d.ts +12 -0
  24. package/dist/EmbedBlock/EmbedGif.d.ts +3 -0
  25. package/dist/EmbedBlock/IframeBlock.d.ts +3 -0
  26. package/dist/EmbedBlock/index.d.ts +3 -0
  27. package/dist/Footnote/Footnote.types.d.ts +5 -0
  28. package/dist/Footnote/index.d.ts +3 -0
  29. package/dist/GroupedBlock/GroupedBlock.types.d.ts +4 -0
  30. package/dist/GroupedBlock/index.d.ts +3 -0
  31. package/dist/HalfBlock/HalfBlock.types.d.ts +4 -0
  32. package/dist/HalfBlock/index.d.ts +3 -0
  33. package/dist/Image/Image.types.d.ts +35 -0
  34. package/dist/Image/RenderPicture.d.ts +4 -0
  35. package/dist/ImportantLead/ImportantLead.types.d.ts +4 -0
  36. package/dist/ImportantLead/index.d.ts +3 -0
  37. package/dist/Lazy/Lazy.types.d.ts +4 -0
  38. package/dist/ListBlock/ListBlock.types.d.ts +9 -0
  39. package/dist/ListBlock/index.d.ts +3 -0
  40. package/dist/MaterialNote/MaterialNote.types.d.ts +13 -0
  41. package/dist/MaterialNote/index.d.ts +3 -0
  42. package/dist/MaterialTitle/MaterialTitle.types.d.ts +4 -0
  43. package/dist/MaterialTitle/index.d.ts +5 -0
  44. package/dist/MediaCaption/MediaCaption.types.d.ts +5 -0
  45. package/dist/MediaCaption/index.d.ts +3 -0
  46. package/dist/Meta/Meta.mock.d.ts +12 -0
  47. package/dist/Meta/Meta.types.d.ts +19 -0
  48. package/dist/Meta/MetaContainer.d.ts +3 -0
  49. package/dist/Meta/index.d.ts +3 -0
  50. package/dist/MetaItem/MetaItem.types.d.ts +7 -0
  51. package/dist/MetaItem/index.d.ts +3 -0
  52. package/dist/MetaItemLive/MetaItemLive.types.d.ts +3 -0
  53. package/dist/MetaItemLive/index.d.ts +3 -0
  54. package/dist/Popover/Popover.types.d.ts +5 -0
  55. package/dist/Popover/index.d.ts +3 -0
  56. package/dist/QuoteBlock/QuoteBlock.types.d.ts +6 -0
  57. package/dist/QuoteBlock/index.d.ts +3 -0
  58. package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +17 -0
  59. package/dist/RawHtmlBlock/index.d.ts +3 -0
  60. package/dist/RelatedBlock/RelatedBlock.types.d.ts +17 -0
  61. package/dist/RelatedBlock/index.d.ts +3 -0
  62. package/dist/RelatedBook/RelatedBook.mock.d.ts +65 -0
  63. package/dist/RelatedBook/RelatedBook.types.d.ts +4 -0
  64. package/dist/RelatedBook/index.d.ts +3 -0
  65. package/dist/RelatedRichBlock/RelatedRichBlock.types.d.ts +4 -0
  66. package/dist/RelatedRichBlock/index.d.ts +3 -0
  67. package/dist/RenderBlocks/RenderBlocks.types.d.ts +11 -0
  68. package/dist/RenderBlocks/index.d.ts +3 -0
  69. package/dist/RichTitle/RichTitle.types.d.ts +12 -0
  70. package/dist/RichTitle/index.d.ts +3 -0
  71. package/dist/SensitiveBlock/SensitiveBlock.types.d.ts +15 -0
  72. package/dist/SensitiveBlock/index.d.ts +3 -0
  73. package/dist/ShopRelatedBlock/ShopRelatedBlock.types.d.ts +4 -0
  74. package/dist/ShopRelatedBlock/index.d.ts +3 -0
  75. package/dist/SimpleBlock/SimpleBlock.types.d.ts +5 -0
  76. package/dist/SimpleBlock/index.d.ts +3 -0
  77. package/dist/SimpleTitle/SimpleTitle.types.d.ts +9 -0
  78. package/dist/SimpleTitle/index.d.ts +3 -0
  79. package/dist/SourceBlock/SourceBlock.types.d.ts +15 -0
  80. package/dist/SourceBlock/index.d.ts +3 -0
  81. package/dist/Spoiler/Spoiler.types.d.ts +4 -0
  82. package/dist/Spoiler/index.d.ts +3 -0
  83. package/dist/SvgSymbol/SvgSymbol.types.d.ts +8 -0
  84. package/dist/SvgSymbol/icons.d.ts +172 -0
  85. package/dist/Switcher/Switcher.types.d.ts +12 -0
  86. package/dist/Table/Table.types.d.ts +25 -0
  87. package/dist/Table/index.d.ts +3 -0
  88. package/dist/Tag/Tag.types.d.ts +12 -0
  89. package/dist/Tag/index.d.ts +3 -0
  90. package/dist/Timestamp/Timestamp.types.d.ts +5 -0
  91. package/dist/Timestamp/index.d.ts +4 -0
  92. package/dist/Toolbar/Toolbar.d.ts +3 -0
  93. package/dist/Toolbar/Toolbar.types.d.ts +7 -0
  94. package/dist/Toolbar/ToolbarItem.d.ts +3 -0
  95. package/dist/Toolbar/index.d.ts +2 -0
  96. package/dist/ToolbarButton/ToolbarButton.types.d.ts +10 -0
  97. package/dist/ToolbarButton/index.d.ts +3 -0
  98. package/dist/Tooltip/Tooltip.d.ts +3 -0
  99. package/dist/Tooltip/Tooltip.types.d.ts +8 -0
  100. package/dist/Tooltip/TooltipFooter.d.ts +3 -0
  101. package/dist/Tooltip/index.d.ts +2 -0
  102. package/dist/VersesBlock/VersesBlock.types.d.ts +9 -0
  103. package/dist/VersesBlock/index.d.ts +3 -0
  104. package/dist/constants.d.ts +41 -0
  105. package/dist/index.d.ts +45 -0
  106. package/dist/types.d.ts +20 -0
  107. package/dist/ui-kit-2.cjs.development.js +2815 -0
  108. package/dist/ui-kit-2.cjs.development.js.map +1 -0
  109. package/dist/ui-kit-2.cjs.production.min.js +2 -0
  110. package/dist/ui-kit-2.cjs.production.min.js.map +1 -0
  111. package/dist/ui-kit-2.esm.js +2761 -0
  112. package/dist/ui-kit-2.esm.js.map +1 -0
  113. package/dist/ui-kit-game.css +7070 -0
  114. package/dist/ui-kit.css +7070 -0
  115. package/dist/utils/BlockContext.d.ts +8 -0
  116. package/dist/utils/DangerousHtml.d.ts +8 -0
  117. package/dist/utils/capitalizeFirstLetter.d.ts +1 -0
  118. package/dist/utils/converCase.d.ts +2 -0
  119. package/dist/utils/generateGradient.d.ts +2 -0
  120. package/dist/utils/getElementPositionRelativeToViewport.d.ts +2 -0
  121. package/dist/utils/makeStyleContext.d.ts +3 -0
  122. package/dist/utils/pluralize.d.ts +2 -0
  123. package/dist/utils/postMessage.d.ts +2 -0
  124. package/dist/utils/viewportSize.d.ts +6 -0
  125. package/package.json +1 -1
  126. package/src/Image/index.tsx +4 -1
  127. package/src/Spoiler/Spoiler.module.css +9 -10
  128. package/src/SvgSymbol/SvgSymbol.types.ts +1 -0
  129. package/src/SvgSymbol/icons.ts +7 -0
  130. package/src/Tag/Tag.module.css +4 -0
  131. package/src/.DS_Store +0 -0
@@ -0,0 +1,2815 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var reactIntersectionObserver = require('react-intersection-observer');
7
+ var dayjs = require('dayjs');
8
+ require('dayjs/locale/ru');
9
+ var relativeTime = require('dayjs/plugin/relativeTime');
10
+ var reactRouterDom = require('react-router-dom');
11
+
12
+ const makeClassName = list => {
13
+ return list.filter(([, active]) => active).map(([className]) => className).join(' ');
14
+ };
15
+
16
+ const ButtonLoader = () => ( /*#__PURE__*/React.createElement("svg", {
17
+ width: "30px",
18
+ height: "30px",
19
+ viewBox: "0 0 30 30",
20
+ xmlns: "http://www.w3.org/2000/svg"
21
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
22
+ d: "M15 0C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15zm0 2c7.18 0 13 5.82 13 13s-5.82 13-13 13S2 22.18 2 15 7.82 2 15 2z",
23
+ opacity: "0.3"
24
+ })), /*#__PURE__*/React.createElement("g", {
25
+ fillRule: "evenodd"
26
+ }, /*#__PURE__*/React.createElement("animateTransform", {
27
+ attributeName: "transform",
28
+ type: "rotate",
29
+ from: "0 15 15",
30
+ to: "360 15 15",
31
+ dur: "1000ms",
32
+ repeatCount: "indefinite"
33
+ }), /*#__PURE__*/React.createElement("path", {
34
+ d: "M15 0c8.18 0 14.83 6.547 14.997 14.686L30 15h-2c0-7.077-5.655-12.833-12.693-12.996L15 2V0z"
35
+ }))));
36
+
37
+ var styles$I = {"root":"Button-module_root__9OQ5b","gold":"Button-module_gold__q-XBP","isLoading":"Button-module_isLoading__Z53G4","gray":"Button-module_gray__fypDq","sand":"Button-module_sand__e5v-k","dark":"Button-module_dark__qv4NQ","light":"Button-module_light__TLYLT","black":"Button-module_black__GIsbk","red":"Button-module_red__kybni","default":"Button-module_default__utLb-","isInSpoiler":"Button-module_isInSpoiler__pGp-w","ghost":"Button-module_ghost__1s5-r","isInDropdown":"Button-module_isInDropdown__gN7TI","loader":"Button-module_loader__r0Mjs","isFancy":"Button-module_isFancy__gTRmu"};
38
+
39
+ const Button = ({
40
+ theme = 'gold',
41
+ size = 'default',
42
+ state = 'isDefault',
43
+ styleContext = 'isInToolbar',
44
+ appearance,
45
+ disabled = false,
46
+ onClick,
47
+ children
48
+ }) => {
49
+ const handleClick = () => {
50
+ if (disabled || !onClick) {
51
+ return;
52
+ }
53
+ onClick();
54
+ };
55
+ return /*#__PURE__*/React.createElement("button", {
56
+ "data-testid": "button",
57
+ className: makeClassName([[styles$I.root, true], [styles$I[size], !!size], [styles$I[theme], !!theme], [styles$I[appearance], !!appearance], [styles$I[state], !!state && !!styles$I[state]], [styles$I[styleContext], !!styleContext]]),
58
+ disabled: disabled,
59
+ onClick: handleClick,
60
+ type: "button"
61
+ }, state === 'isLoading' ? ( /*#__PURE__*/React.createElement("span", {
62
+ className: styles$I.loader
63
+ }, /*#__PURE__*/React.createElement(ButtonLoader, null))) : children);
64
+ };
65
+
66
+ const icons = {
67
+ meduzaLogo: {
68
+ width: 544,
69
+ height: 115,
70
+ content: '<path d="M59.1008614,49.65632 L59.1008614,106.01472 L84.9480411,114.24 L84.9480411,49.65632 L101.574882,49.65632 L101.574882,106.01472 L127.270909,114.24 L144.048902,91.392 L127.422062,91.392 L127.422062,35.7952 L101.726035,26.80832 L84.9480411,46.60992 L84.9480411,35.7952 L59.2520145,26.80832 L42.4740206,46.60992 L42.4740206,35.7952 L16.7779939,26.80832 L0,49.65632 L16.6268408,49.65632 L16.6268408,106.01472 L42.4740206,114.24 L42.4740206,49.65632 L59.1008614,49.65632 L59.1008614,49.65632 Z M336.61795,91.392 L336.61795,35.0336 L310.770769,26.80832 L310.770769,105.25312 L336.466796,114.24 L353.24479,94.4384 L353.24479,105.25312 L378.940817,114.24 L395.71881,91.392 L379.091969,91.392 L379.091969,35.0336 L353.24479,26.80832 L353.24479,91.392 L336.61795,91.392 L336.61795,91.392 Z M527.373159,38.08 L502.130592,26.80832 L472.202278,41.1264 L502.130592,52.39808 L461.016949,72.352 L461.016949,104.94848 L486.86413,114.24 L502.130592,94.28608 L502.130592,105.25312 L527.977771,114.24 L544,91.23968 L527.373159,91.23968 L527.373159,38.08 L527.373159,38.08 Z M177.453737,114.24 L207.079744,102.35904 L177.453737,91.23968 L177.453737,75.24608 L216.300083,56.3584 L194.231731,26.80832 L151.606557,47.37152 L151.606557,103.12064 L177.453737,114.24 L177.453737,114.24 Z M455.424284,89.56416 L423.984441,79.968 L453.459295,42.19264 L416.577937,26.80832 L397.230341,51.48416 L428.821339,61.23264 L398.741873,98.85568 L436.076687,114.24 L455.424284,89.56416 L455.424284,89.56416 Z M486.86413,91.392 L486.86413,68.84864 L502.130592,61.53728 L502.130592,91.392 L486.86413,91.392 L486.86413,91.392 Z M177.453737,41.58336 L190.452904,59.55712 L177.453737,65.80224 L177.453737,41.58336 L177.453737,41.58336 Z M222.95082,103.12064 L248.797999,114.24 L291.27202,97.18016 L291.27202,29.7024 L222.95082,0 L222.95082,26.30784 L265.424841,43.21536 L265.424841,97.33248 L248.797999,91.23968 L248.797999,43.71584 L222.95082,51.94112 L222.95082,103.12064 L222.95082,103.12064 Z" />'
71
+ },
72
+ menu: {
73
+ width: 24,
74
+ height: 24,
75
+ content: '<path d="M2 21h20M2 12h20M2 3h20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />'
76
+ },
77
+ fb: {
78
+ width: 16,
79
+ height: 18,
80
+ content: '<path d="M15.117 1H.883A.883.883 0 0 0 0 1.883v14.234A.883.883 0 0 0 .883 17h7.663v-6.196H6.461V8.389h2.085V6.61a2.91 2.91 0 0 1 3.106-3.192c.622-.003 1.244.03 1.863.095v2.16h-1.279c-1.002 0-1.196.476-1.196 1.176v1.541h2.39l-.31 2.415h-2.08V17h4.077a.883.883 0 0 0 .883-.883V1.883A.883.883 0 0 0 15.117 1" />'
81
+ },
82
+ tw: {
83
+ width: 20,
84
+ height: 18,
85
+ content: '<path d="M20 3.1c-.7.3-1.5.6-2.4.7.8-.5 1.5-1.4 1.8-2.4-.8.5-1.7.8-2.6 1-.7-.8-1.8-1.4-3-1.4-2.3 0-4.1 1.9-4.1 4.3 0 .3 0 .7.1 1-3.3-.1-6.4-1.8-8.4-4.4-.3.6-.5 1.4-.5 2.2 0 1.5.7 2.8 1.8 3.6-.7 0-1.3-.2-1.9-.5v.1c0 2.1 1.4 3.8 3.3 4.2-.3.1-.7.2-1.1.2-.3 0-.5 0-.8-.1.5 1.7 2 2.9 3.8 3-1.3 1-3.1 1.6-5 1.6-.3 0-.7 0-1-.1C1.8 17.3 4 18 6.3 18 13.8 18 18 11.5 18 5.8v-.6c.8-.5 1.5-1.2 2-2.1" fill-rule="nonzero"/>'
86
+ },
87
+ vk: {
88
+ width: 20,
89
+ height: 18,
90
+ content: '<path d="M16.517 9.851s2.587-3.768 2.886-5.058c.1-.396-.1-.694-.498-.694h-2.288c-.498 0-.697.199-.896.595 0 0-1.194 2.678-2.686 4.364-.498.496-.697.694-.995.694-.2 0-.299-.198-.299-.694V4.793c0-.595-.1-.793-.597-.793H7.463c-.2 0-.398.198-.398.397 0 .595.796.694.796 2.28v3.174c0 .595 0 .893-.299.893-.796 0-2.686-2.777-3.681-5.851-.2-.595-.398-.794-.995-.794H.597C.299 4.1 0 4.298 0 4.694c0 .595.697 3.471 3.483 7.34C5.373 14.611 7.86 16 10.05 16c1.393 0 1.691-.198 1.691-.793v-1.984c0-.496.2-.694.498-.694s.895.1 2.189 1.388C15.92 15.405 16.02 16 16.915 16h2.587c.299 0 .498-.1.498-.595 0-.595-.796-1.587-1.89-2.876-.498-.595-1.195-1.29-1.493-1.686-.398-.397-.299-.595-.1-.992" fill-rule="nonzero"/>'
91
+ },
92
+ ok: {
93
+ width: 9,
94
+ height: 18,
95
+ content: '<path d="M4.5 2c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4m0 5.7c-.9 0-1.6-.8-1.6-1.7 0-.9.7-1.6 1.6-1.6.9 0 1.7.7 1.7 1.7 0 .8-.8 1.6-1.7 1.6" fill-rule="nonzero"/> <path d="M6.127 12.982a9.194 9.194 0 0 0 2.307-.904c.602-.301.703-1.004.402-1.507-.301-.502-1.104-.703-1.605-.401-1.605 1.004-3.812 1.004-5.417 0-.502-.302-1.304-.201-1.605.3-.401.604-.2 1.206.401 1.608a9.194 9.194 0 0 0 2.307.904L.61 15.092c-.502.401-.502 1.104 0 1.607a1.357 1.357 0 0 0 1.705 0l2.207-2.11L6.73 16.7a1.357 1.357 0 0 0 1.705 0c.502-.402.502-1.105 0-1.608l-2.307-2.109" fill-rule="nonzero"/>'
96
+ },
97
+ tg: {
98
+ width: 18,
99
+ height: 18,
100
+ content: '<path d="M9 18c-5 0-9-4-9-9s4-9 9-9 9 4 9 9-4 9-9 9zm-1.5-7.4c1.1 1 2 3.3 2 3.3.4.2.7.1.8-.4l2.1-7.4c.1-.6-.2-.8-.6-.7L4 8.3c-.6.2-.6.5-.1.7 0 .1 2.4.6 3.6 1.6z" fill-rule="nonzero"/>'
101
+ },
102
+ meduzaSymbol: {
103
+ width: 24,
104
+ height: 18,
105
+ content: '<path d="M10.026233,17.0968697 L13.9737671,18.3530831 L13.9737671,10.9855851 L13.9737671,8.48948164 L16.5131165,8.48948164 L16.5131165,17.0968697 L20.4375656,18.3530831 L23,14.8636014 L20.4606507,14.8636014 L20.4606507,6.37252945 L16.5362015,5 L13.9737671,8.02421743 L13.9737671,6.37252945 L10.049318,5 L7.48688354,8.02421743 L7.48688354,6.37252945 L3.56243443,5 L1,8.48948164 L3.53934943,8.48948164 L3.53934943,17.0968697 L7.48688354,18.3530831 L7.48688354,8.48948164 L10.026233,8.48948164 L10.026233,17.0968697 Z" />'
106
+ },
107
+ backward: {
108
+ width: 25,
109
+ height: 27,
110
+ content: '<path d="M13 0v2.01c6.672.263 12 5.754 12 12.49C25 21.404 19.404 27 12.5 27S0 21.404 0 14.5c0-3.493 1.441-6.758 3.936-9.105a.75.75 0 111.028 1.092A10.965 10.965 0 001.5 14.5c0 6.075 4.925 11 11 11s11-4.925 11-11c0-5.907-4.656-10.727-10.499-10.989L13 6 8 3l5-3zm3.295 11.33v1.25h-3.16v1.63c.32-.32.86-.56 1.47-.56 1.13 0 2.14.81 2.14 2.16 0 1.42-1.06 2.31-2.67 2.31-1.16 0-2-.38-2.57-1l.79-.99c.45.47 1.07.73 1.77.73.79 0 1.24-.45 1.24-.99 0-.59-.44-.99-1.2-.99-.55 0-1 .16-1.4.54l-.99-.26v-3.83h4.58zm-5.94 0V18h-1.42v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24z" fill-rule="nonzero"/>'
111
+ },
112
+ forward: {
113
+ width: 25,
114
+ height: 27,
115
+ content: '<path d="M12 0l5 3-5 3V3.511C6.157 3.773 1.5 8.592 1.5 14.5c0 6.075 4.925 11 11 11s11-4.925 11-11c0-3.075-1.267-5.946-3.464-8.013a.75.75 0 011.028-1.092A12.465 12.465 0 0125 14.5C25 21.404 19.404 27 12.5 27S0 21.404 0 14.5C0 7.764 5.328 2.272 12 2.01V0zm4.295 11.33v1.25h-3.16v1.63c.32-.32.86-.56 1.47-.56 1.13 0 2.14.81 2.14 2.16 0 1.42-1.06 2.31-2.67 2.31-1.16 0-2-.38-2.57-1l.79-.99c.45.47 1.07.73 1.77.73.79 0 1.24-.45 1.24-.99 0-.59-.44-.99-1.2-.99-.55 0-1 .16-1.4.54l-.99-.26v-3.83h4.58zm-5.94 0V18h-1.42v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24z" fill-rule="nonzero"/>'
116
+ },
117
+ download: {
118
+ width: 25,
119
+ height: 27,
120
+ content: '<path d="M12.5 2C19.404 2 25 7.596 25 14.5S19.404 27 12.5 27 0 21.404 0 14.5 5.596 2 12.5 2zm0 1.5c-6.075 0-11 4.925-11 11s4.925 11 11 11 11-4.925 11-11-4.925-11-11-11zm6 15.75a.75.75 0 01.102 1.493l-.102.007h-12a.75.75 0 01-.102-1.493l.102-.007h12zm-6-12a.75.75 0 01.743.648L13.25 8v7.598l1.834-1.222a.75.75 0 11.832 1.248l-3 2a.75.75 0 01-.832 0l-3-2a.75.75 0 11.832-1.248l1.834 1.223V8a.75.75 0 01.648-.743l.102-.007z" fill-rule="nonzero" fill="currentColor" />'
121
+ },
122
+ episodeDownload: {
123
+ width: 24,
124
+ height: 24,
125
+ content: '<><circle xmlns="http://www.w3.org/2000/svg" cx="12" cy="12" r="10.5" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path xmlns="http://www.w3.org/2000/svg" d="M12 16.5L12 7.5M12 16.5L15.5 14.2257M12 16.5L8.5 14.2257" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></>'
126
+ },
127
+ play: {
128
+ width: 62,
129
+ height: 62,
130
+ content: '<path d="M24.35 41.772a.5.5 0 0 1-.739-.439V20.667a.5.5 0 0 1 .74-.44l18.944 10.334a.5.5 0 0 1 0 .878L24.351 41.772z" fill-rule="nonzero"/>'
131
+ },
132
+ pause: {
133
+ width: 22,
134
+ height: 22,
135
+ content: '<path d="M12.832 4h2.8c.276 0 .5.224.5.5v12.394c0 .277-.224.5-.5.5h-2.8c-.276 0-.5-.223-.5-.5V4.5c0-.276.224-.5.5-.5zM6.5 4h2.8c.277 0 .5.224.5.5v12.394c0 .277-.223.5-.5.5H6.5c-.276 0-.5-.223-.5-.5V4.5c0-.276.224-.5.5-.5z" />'
136
+ },
137
+ speedHalf: {
138
+ width: 25,
139
+ height: 27,
140
+ content: '<path d="M7.212 15.198V12.29l-.676.724L6 12.406 7.35 11h.825v4.198h-.963zM8.056 18H7.3l4.23-7h.765l-4.24 7zm2.99 0v-.735c1.717-1.27 2.134-1.679 2.134-2.14 0-.389-.288-.578-.665-.578-.467 0-.884.263-1.083.525l-.496-.64c.417-.493 1.053-.693 1.599-.693.913 0 1.599.462 1.599 1.312 0 .682-.556 1.28-1.708 2.14h1.737V18h-3.118zm5.998-2.918l-1.39 1.48-.567-.577 1.4-1.49-1.4-1.48.566-.588 1.39 1.49 1.4-1.49.557.588-1.4 1.48 1.4 1.49-.556.577-1.4-1.48z" /><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" />'
141
+ },
142
+ speedOne: {
143
+ width: 25,
144
+ height: 27,
145
+ content: '<path d="M9.955 18v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24V18h-1.42zm4.6-2.78l-1.4 1.41-.57-.55 1.41-1.42-1.41-1.41.57-.56 1.4 1.42 1.41-1.42.56.56-1.41 1.41 1.41 1.42-.56.55-1.41-1.41z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
146
+ },
147
+ speedOneHalf: {
148
+ width: 25,
149
+ height: 27,
150
+ content: '<path d="M5.62 18v-4.84l-1.11 1.13-.81-.85 2.1-2.11h1.24V18H5.62zm3.37-2.67v-2.77l-.68.69-.54-.58 1.36-1.34h.83v4h-.97zM9.84 18h-.76l4.26-6.67h.77L9.84 18zm3.01 0v-.7c1.73-1.21 2.15-1.6 2.15-2.04 0-.37-.29-.55-.67-.55-.47 0-.89.25-1.09.5l-.5-.61c.42-.47 1.06-.66 1.61-.66.92 0 1.61.44 1.61 1.25 0 .65-.56 1.22-1.72 2.04h1.75V18h-3.14zm6.04-2.78l-1.4 1.41-.57-.55 1.41-1.42-1.41-1.41.57-.56 1.4 1.42 1.41-1.42.56.56-1.41 1.41 1.41 1.42-.56.55-1.41-1.41z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
151
+ },
152
+ speedTwo: {
153
+ width: 25,
154
+ height: 27,
155
+ content: '<path d="M7.147 18v-1.158c2.685-2.078 3.471-2.792 3.471-3.64 0-.6-.52-.9-1.061-.9-.748 0-1.318.311-1.76.797L7 12.127C7.64 11.352 8.613 11 9.527 11c1.396 0 2.507.827 2.507 2.202 0 1.18-.924 2.203-2.625 3.506h2.675V18H7.147zm7.916-2.874l-1.377 1.457-.56-.568 1.386-1.468-1.386-1.458.56-.58 1.377 1.469 1.386-1.468.551.579-1.386 1.458L17 16.015l-.55.568-1.387-1.457z" fill-rule="nonzero"/><path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" fill-rule="nonzero"/>'
156
+ },
157
+ podcastBookmark: {
158
+ width: 25,
159
+ height: 27,
160
+ content: '<path d="M12.5 27C19.404 27 25 21.404 25 14.5S19.404 2 12.5 2 0 7.596 0 14.5 5.596 27 12.5 27zm0-1.5c-6.075 0-11-4.925-11-11s4.925-11 11-11 11 4.925 11 11-4.925 11-11 11z" /> <path d="M17.071 8.25H8a.75.75 0 00-.75.75v11.545l.007.104a.75.75 0 001.228.468l4.05-3.437 4.051 3.437a.75.75 0 001.235-.572V9a.75.75 0 00-.75-.75zm-.75 1.499v9.176l-3.3-2.8-.098-.07a.75.75 0 00-.873.07l-3.3 2.799V9.749h7.571z" data-stroke="true" /> <path d="M17.071 8.25H8a.75.75 0 00-.75.75v11.545l.007.104a.75.75 0 001.228.468l4.05-3.437 4.051 3.437a.75.75 0 001.235-.572V9a.75.75 0 00-.75-.75z" data-fill="true" />'
161
+ },
162
+ reaction: {
163
+ width: 16,
164
+ height: 16,
165
+ content: '<path data-theme="light" fill="#D09959" d="M1 2h14v12H1z"/> <path d="M0 1.778C0 .8.8 0 1.778 0h12.444C15.2 0 16 .8 16 1.778v12.444C16 15.2 15.2 16 14.222 16H1.778C.8 16 0 15.2 0 14.222V1.778zM6.8 11.7l2.5.8V6.2h1.6v5.5l2.5.8 1.6-2.3h-1.6V4.8L10.9 4 9.3 5.9V4.8L6.8 4 5.1 5.9V4.8L2.6 4 1 6.2h1.6v5.5l2.5.8V6.2h1.7v5.5z" />'
166
+ },
167
+ cross: {
168
+ width: 18,
169
+ height: 18,
170
+ content: '<path fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" vector-effect="non-scaling-stroke" d="M2 2l14 14M16 2L2 16" />'
171
+ },
172
+ link: {
173
+ width: 24,
174
+ height: 24,
175
+ content: '<path d="M9.158 18.928c-1.065 0-2.13-.405-2.94-1.215-1.624-1.623-1.624-4.262 0-5.884l.643-.645c.327-.326.854-.326 1.18 0 .325.326.325.853 0 1.178l-.645.645c-.972.972-.972 2.554 0 3.526.973.972 2.554.973 3.526 0l2.842-2.84c.97-.972.97-2.555 0-3.527-.325-.325-.325-.854 0-1.18.325-.324.853-.324 1.178 0 1.623 1.625 1.623 4.264 0 5.885l-2.84 2.84c-.81.81-1.877 1.216-2.942 1.216" /> <path d="M10.578 14.184c-.213 0-.426-.082-.59-.244-.784-.785-1.217-1.83-1.217-2.94 0-1.113.433-2.158 1.22-2.944l2.84-2.84c1.622-1.62 4.26-1.62 5.883 0 1.622 1.623 1.622 4.262 0 5.883l-.645.643c-.325.326-.852.326-1.178 0-.325-.325-.325-.852 0-1.178l.645-.644c.972-.97.972-2.554 0-3.526s-2.556-.972-3.527 0l-2.84 2.842c-.47.47-.73 1.096-.73 1.762 0 .667.26 1.293.73 1.763.325.327.325.854 0 1.18-.163.162-.376.244-.59.244" />'
176
+ },
177
+ search: {
178
+ width: 16,
179
+ height: 16,
180
+ content: '<g transform="translate(2 1)" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" vector-effect="non-scaling-stroke"><circle cx="5.5" cy="5.5" r="5.5"/><path d="M11.37 13.442l-.995-1.272"/></g>'
181
+ },
182
+ card: {
183
+ width: 15,
184
+ height: 15,
185
+ content: '<path d="M9 5.5a.5.5 0 0 1 .5.5v5a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5zm-.5 1h-4v4h4v-4zm2.5-3a.5.5 0 0 1 .5.5v5a.5.5 0 1 1-1 0V4.5H6a.5.5 0 0 1 0-1h5z" fill-rule="nonzero"/>'
186
+ },
187
+ podcast: {
188
+ width: 15,
189
+ height: 15,
190
+ content: '<path d="M5.252 11.432A.5.5 0 0 1 4.5 11V4a.5.5 0 0 1 .752-.432l6 3.5a.5.5 0 0 1 0 .864l-6 3.5zm.248-1.303L10.008 7.5 5.5 4.87v5.26z" fill-rule="nonzero" />'
191
+ },
192
+ arrow: {
193
+ width: 12,
194
+ height: 12,
195
+ content: '<path d="M3 7l3 3.5L9 7M6 10V1" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.2" vector-effect="non-scaling-stroke" />'
196
+ },
197
+ brent: {
198
+ width: 9,
199
+ height: 12,
200
+ content: '<g fill="#999" fill-rule="nonzero"><path d="M4.332 0l.528.606c2.528 2.902 3.804 5.07 3.804 6.634A4.332 4.332 0 110 7.24C0 5.676 1.276 3.508 3.804.606L4.332 0zm0 2.143l-.176.212C2.313 4.589 1.4 6.248 1.4 7.24a2.932 2.932 0 105.864 0c0-.992-.914-2.651-2.756-4.885l-.176-.212z"/><path d="M2.973 7.475c0 .415.417.863.835.924l.097.008v.7c-.79 0-1.548-.716-1.626-1.5l-.006-.132h.7z"/></g> '
201
+ },
202
+ user: {
203
+ width: 16,
204
+ height: 16,
205
+ content: '<path fill="currentColor" fill-rule="nonzero" d="M8 1a4.25 4.25 0 012.676 7.552 6.751 6.751 0 014.074 6.198.75.75 0 11-1.5 0 5.25 5.25 0 00-10.5 0 .75.75 0 11-1.5 0 6.752 6.752 0 014.074-6.199A4.25 4.25 0 018 1zm0 1.5A2.75 2.75 0 108 8a2.75 2.75 0 000-5.5z" />'
206
+ },
207
+ bookmark: {
208
+ width: 17,
209
+ height: 21,
210
+ content: '<path d="M16 20l-7.5-6.333L1 20V1h15z" stroke="currentColor" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"/>'
211
+ },
212
+ shareBookmark: {
213
+ width: 11,
214
+ height: 15,
215
+ content: '<path clip-rule="evenodd" d="M10 14 5.5 9.667 1 14V1h9v13Z" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>'
216
+ },
217
+ receipt: {
218
+ width: 10,
219
+ height: 13,
220
+ content: '<g fill="currentColor" fill-rule="nonzero"><path d="M10 0H0v13l2-1.74 1.5 1.305L5 11.26l1.5 1.305L8 11.26 10 13V0zM9 .997v9.81l-1-.87-1.5 1.304L5 9.937 3.5 11.24 2 9.937l-1 .87V.996h8z"/><path d="M7 3v1H3V3zM7 6v1H3V6z"/></g>'
221
+ },
222
+ read: {
223
+ width: 15,
224
+ height: 15,
225
+ content: '<g fill="none" fill-rule="evenodd"><path opacity=".98" d="M0 0h15v15H0z"/><path d="M13.085 1.694a.513.513 0 01.855.56l-.051.077-3.163 3.975a.514.514 0 01-.73.075l-.068-.069-1.812-2.208a.512.512 0 01.729-.716l.065.066 1.409 1.718 2.766-3.478z" fill="#6EAC65" fill-rule="nonzero"/><path d="M6.454 12.997l-.06-.01-.078-.023a.49.49 0 01-.266-.24l.011.015a2.349 2.349 0 00-.535-.607c-.89-.745-2.117-.917-3.813-.12a.5.5 0 01-.706-.37L1 11.558V4.568a.5.5 0 01.287-.453c2.053-.963 3.695-.733 4.88.26.327.272.556.548.698.77l.084.144.018.04.022.076.01.071L7 11.233l.126-.09c.95-.656 2.16-.857 3.608-.417l.266.087v-2.81a.5.5 0 01.41-.491l.09-.008a.5.5 0 01.492.41l.008.09v3.555a.5.5 0 01-.713.452c-1.696-.796-2.922-.624-3.813.12a2.533 2.533 0 00-.497.544l-.038.064a.486.486 0 01-.485.258zm-4.29-8.17L2 4.892v5.92c1.637-.572 2.977-.348 4 .42l.002-5.58a2.605 2.605 0 00-.476-.513c-.81-.677-1.897-.88-3.362-.314z" fill="currentColor" fill-rule="nonzero"/></g>'
226
+ },
227
+ listened: {
228
+ width: 15,
229
+ height: 15,
230
+ content: '<g fill-rule="nonzero"><path d="M4.978 4.354a.5.5 0 01-.332.624c-1.197.367-2.064 1.527-2.14 2.897l-.005.167a.749.749 0 01.999.708v3a.75.75 0 01-1.458.248L2 12a1 1 0 01-1-1v-1a1 1 0 01.5-.866V8.072c0-1.886 1.172-3.535 2.854-4.05a.5.5 0 01.624.332zM10 7a.5.5 0 01.492.41l.008.09.001 1.634a1 1 0 01.492.745L11 10v1a1 1 0 01-.883.993L10 12l-.042-.002a.75.75 0 01-1.451-.146L8.5 11.75v-3a.75.75 0 011.001-.707L9.5 7.5l.008-.09A.5.5 0 0110 7z" fill="currentColor" /><path d="M11.585 1.194a.513.513 0 01.855.56l-.051.077-3.163 3.975a.514.514 0 01-.73.075l-.068-.069-1.812-2.208a.512.512 0 01.729-.716l.065.066 1.409 1.718 2.766-3.478z" fill="#6EAC65" /></g>'
231
+ },
232
+ magic: {
233
+ width: 15,
234
+ height: 15,
235
+ content: '<g fill-rule="evenodd" clip-rule="evenodd"> <path d="M7.804.4a.6.6 0 0 1 .6.6v2.035a.6.6 0 0 1-1.2 0V1a.6.6 0 0 1 .6-.6ZM7.804 10.577a.6.6 0 0 1 .6.6v2.035a.6.6 0 1 1-1.2 0v-2.035a.6.6 0 0 1 .6-.6ZM14.636 7.106a.6.6 0 0 1-.6.6h-2.078a.6.6 0 1 1 0-1.2h2.078a.6.6 0 0 1 .6.6ZM4.25 7.106a.6.6 0 0 1-.6.6H1.573a.6.6 0 0 1 0-1.2H3.65a.6.6 0 0 1 .6.6ZM12.639 2.37a.585.585 0 0 1 0 .84l-1.442 1.412a.615.615 0 0 1-.857 0 .585.585 0 0 1 0-.84l1.442-1.412a.615.615 0 0 1 .857 0ZM12.639 11.843a.615.615 0 0 1-.857 0L10.34 10.43a.585.585 0 0 1 0-.84.615.615 0 0 1 .857 0l1.442 1.413a.585.585 0 0 1 0 .84ZM5.269 4.621a.615.615 0 0 1-.858 0L2.97 3.208a.585.585 0 0 1 0-.84.615.615 0 0 1 .858 0l1.442 1.413a.585.585 0 0 1 0 .84ZM8.926 6.074a.6.6 0 0 1 0 .849l-.863.863-.849-.849.863-.863a.6.6 0 0 1 .849 0ZM7.348 8.5l-5.924 5.924a.6.6 0 1 1-.848-.848L6.5 7.652l.848.848Z"/> </g>'
236
+ }
237
+ };
238
+
239
+ var styles$H = {"root":"SvgSymbol-module_root__WctNR","small":"SvgSymbol-module_small__h9V-w","normal":"SvgSymbol-module_normal__gFAVe","medium":"SvgSymbol-module_medium__QaYjY","large":"SvgSymbol-module_large__o6A4o","adaptive":"SvgSymbol-module_adaptive__gL9qn","fb":"SvgSymbol-module_fb__HZqcB","vk":"SvgSymbol-module_vk__XctB2","ok":"SvgSymbol-module_ok__IM6Z9","tw":"SvgSymbol-module_tw__fio-Q","tg":"SvgSymbol-module_tg__GRhd-","magic":"SvgSymbol-module_magic__N-jKk","reaction":"SvgSymbol-module_reaction__xSbgo","card":"SvgSymbol-module_card__2nVFu","podcast":"SvgSymbol-module_podcast__Yp05r","read":"SvgSymbol-module_read__Bu653","listened":"SvgSymbol-module_listened__AOn7j","menu":"SvgSymbol-module_menu__z-dLm","cross":"SvgSymbol-module_cross__3Xej1","isInFeature":"SvgSymbol-module_isInFeature__BmyI-","isInCard":"SvgSymbol-module_isInCard__USxBS","isInTopicBlockItem":"SvgSymbol-module_isInTopicBlockItem__cnCgw","isInPageStatic":"SvgSymbol-module_isInPageStatic__7kMP-","isInMaterialMeta":"SvgSymbol-module_isInMaterialMeta__lIKJO","isInAudioPlayer":"SvgSymbol-module_isInAudioPlayer__mamWa","isInEpisodeBlock":"SvgSymbol-module_isInEpisodeBlock__oZ6JG","isInButtonPlaybackRate":"SvgSymbol-module_isInButtonPlaybackRate__NnADm","isInButtonBackward":"SvgSymbol-module_isInButtonBackward__x8L9a","isInButtonForward":"SvgSymbol-module_isInButtonForward__TtixK","isInToolbar":"SvgSymbol-module_isInToolbar__RzbaX","play":"SvgSymbol-module_play__dAES0","meduzaLogo":"SvgSymbol-module_meduzaLogo__aVKzZ","arrow":"SvgSymbol-module_arrow__lWTSJ","oil":"SvgSymbol-module_oil__VFGTp","search":"SvgSymbol-module_search__h06cc","user":"SvgSymbol-module_user__ORMm-","bookmark":"SvgSymbol-module_bookmark__JPKyG","shareBookmark":"SvgSymbol-module_shareBookmark__7w9X9","receipt":"SvgSymbol-module_receipt__o3V8u","isInHeader":"SvgSymbol-module_isInHeader__M5Tzw"};
240
+
241
+ const SvgSymbol = ({
242
+ icon,
243
+ size,
244
+ styleContext
245
+ }) => {
246
+ const data = icons[icon];
247
+ return /*#__PURE__*/React.createElement("svg", {
248
+ "data-testid": "svg-symbol",
249
+ xmlns: "http://www.w3.org/2000/svg",
250
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
251
+ className: makeClassName([[styles$H.root, true], [styles$H[size], !!styles$H[size]], [styles$H[icon], !!styles$H[icon]], [styles$H[styleContext], !!styles$H[styleContext]]]),
252
+ width: data.width,
253
+ height: data.height,
254
+ viewBox: `0 0 ${data.width} ${data.height}`,
255
+ dangerouslySetInnerHTML: {
256
+ __html: data.content
257
+ }
258
+ });
259
+ };
260
+
261
+ var styles$G = {"root":"Switcher-module_root__cBsJB","dark":"Switcher-module_dark__1QQsH","control":"Switcher-module_control__60WMX","input":"Switcher-module_input__5UDnv","knob":"Switcher-module_knob__PwA1A","children":"Switcher-module_children__uLapU","left":"Switcher-module_left__5-HNa","right":"Switcher-module_right__82Edk","isInPanel":"Switcher-module_isInPanel__-nBSf","isInMenu":"Switcher-module_isInMenu__RQVhp","isInLive":"Switcher-module_isInLive__ZyMCT"};
262
+
263
+ const Switcher = ({
264
+ enabled,
265
+ children,
266
+ childrenPosition = 'left',
267
+ onChange,
268
+ styleContext,
269
+ theme = 'light'
270
+ }) => ( /*#__PURE__*/React.createElement("label", {
271
+ "data-testid": "switcher",
272
+ className: makeClassName([[styles$G.root, true], [styles$G[theme], !!styles$G[theme]], [styles$G[styleContext], !!styles$G[styleContext]]])
273
+ }, children && childrenPosition === 'left' && ( /*#__PURE__*/React.createElement("div", {
274
+ className: makeClassName([[styles$G.children, true], [styles$G.left, true]])
275
+ }, children)), /*#__PURE__*/React.createElement("input", {
276
+ className: styles$G.input,
277
+ type: "checkbox",
278
+ checked: enabled,
279
+ onChange: onChange
280
+ }), /*#__PURE__*/React.createElement("span", {
281
+ className: styles$G.control
282
+ }, /*#__PURE__*/React.createElement("span", {
283
+ className: styles$G.knob
284
+ })), children && childrenPosition === 'right' && ( /*#__PURE__*/React.createElement("div", {
285
+ className: makeClassName([[styles$G.children, true], [styles$G.right, true]])
286
+ }, children))));
287
+
288
+ const makeStyleContext = (classNames, styleContext, styles) => {
289
+ const context = Array.isArray(styleContext) ? styleContext.filter(ctx => styles[ctx]).map(ctx => [[styles[ctx]], true]) : [[styles[styleContext], !!styleContext && !!styles[styleContext]]];
290
+ return classNames.concat(context);
291
+ };
292
+
293
+ const BlockContext = /*#__PURE__*/React.createContext({
294
+ lightBox: null
295
+ });
296
+ const BlockProvider = BlockContext.Provider;
297
+
298
+ const POST_MESSAGE_PREFIX = 'mdzKitMsg';
299
+ const postMessage = (category, element, action) => {
300
+ const target = window.top;
301
+ const msg = `${POST_MESSAGE_PREFIX}=${JSON.stringify({
302
+ category,
303
+ element,
304
+ action
305
+ })}`;
306
+ if (typeof target !== 'undefined') {
307
+ target.postMessage(msg, '*');
308
+ }
309
+ };
310
+
311
+ var styles$F = {"root":"Lazy-module_root__DWw8D"};
312
+
313
+ const Lazy = ({
314
+ children,
315
+ threshold
316
+ }) => {
317
+ const [ref, inView, entry] = reactIntersectionObserver.useInView({
318
+ threshold: threshold || 0
319
+ });
320
+ const [visible, setVisible] = React.useState(false);
321
+ React.useEffect(() => {
322
+ if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
323
+ setVisible(true);
324
+ }
325
+ }, [entry]);
326
+ React.useEffect(() => {
327
+ if (inView) {
328
+ setVisible(true);
329
+ }
330
+ }, [inView]);
331
+ return /*#__PURE__*/React.createElement("div", {
332
+ className: makeClassName([[styles$F.root, true], [styles$F.visible, visible]]),
333
+ ref: ref,
334
+ "data-testid": "lazy"
335
+ }, visible && children);
336
+ };
337
+
338
+ const MediaQuerySizes = {
339
+ MOBILE: 512,
340
+ PORTRAIT_TABLET: 768,
341
+ LANDSCAPE_TABLET: 1024,
342
+ DESKTOP: 1010,
343
+ WIDE_DESKTOP: 1200
344
+ };
345
+ const imageBreakpoints = {
346
+ 325: '(min-width: 0)',
347
+ 520: '(min-width: 325px)',
348
+ 600: '(min-width: 600px)',
349
+ 650: '(min-width: 650px)',
350
+ 980: '(min-width: 1000px)',
351
+ 1335: '(min-width: 1000px)'
352
+ };
353
+ const imageConditionalKeys = {
354
+ xs: [325],
355
+ superFull: [1335, 650, 520, 325],
356
+ full: [980, 650, 520, 325],
357
+ default: [650, 520, 325],
358
+ narrow: [600, 325]
359
+ };
360
+ const SocialLabels = {
361
+ ru: {
362
+ tg: 'Телеграм',
363
+ fb: 'Фейсбук',
364
+ tw: 'Твиттер',
365
+ pdf: 'PDF',
366
+ unblock: 'Magic link',
367
+ bookmark: 'В закладки',
368
+ reaction: 'Напишите нам'
369
+ },
370
+ en: {
371
+ tg: 'Telegram',
372
+ fb: 'Fb',
373
+ tw: 'Twitter',
374
+ pdf: 'PDF',
375
+ unblock: 'Magic link',
376
+ bookmark: 'Add to bookmarks'
377
+ }
378
+ };
379
+
380
+ const toCamel = s => s.replace(/([_][a-z])/gi, str => str.toUpperCase().replace('_', ''));
381
+ const toCapitalize = s => s[0].toUpperCase() + s.slice(1);
382
+
383
+ const RenderPicture = ({
384
+ source,
385
+ fallbackSource,
386
+ optimized,
387
+ alt,
388
+ display,
389
+ onLoad
390
+ }) => {
391
+ const [fallback, setFallback] = React.useState(false);
392
+ React.useEffect(() => {
393
+ setFallback(!window.HTMLPictureElement);
394
+ }, []);
395
+ const keys = imageConditionalKeys[toCamel(display)] || imageConditionalKeys.default;
396
+ return /*#__PURE__*/React.createElement("picture", null, source && ( /*#__PURE__*/React.createElement("source", {
397
+ media: "(min-width: 325px)",
398
+ srcSet: `${source[1]} 2x`
399
+ })), optimized && !optimized.w325 && ( /*#__PURE__*/React.createElement("source", {
400
+ media: "(min-width: 0)",
401
+ srcSet: `${optimized.original}`
402
+ })), optimized && keys.map(key => {
403
+ const breakpoint = optimized[`w${key}`];
404
+ if (!breakpoint) {
405
+ return null;
406
+ }
407
+ return /*#__PURE__*/React.createElement(React.Fragment, {
408
+ key: key
409
+ }, /*#__PURE__*/React.createElement("source", {
410
+ type: "image/webp",
411
+ media: imageBreakpoints[key],
412
+ srcSet: `${breakpoint['2x_webp']} 2x, ${breakpoint['1x_webp']} 1x `
413
+ }), /*#__PURE__*/React.createElement("source", {
414
+ type: "image/png",
415
+ media: imageBreakpoints[key],
416
+ srcSet: `${breakpoint['2x']} 2x, ${breakpoint['1x']} 1x `
417
+ }));
418
+ }), /*#__PURE__*/React.createElement("img", {
419
+ src: fallback ? fallbackSource : 'data:image/gif;base64,R0lGODlhAQABAPAAAPLy8gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==',
420
+ alt: alt,
421
+ onLoad: () => onLoad(true)
422
+ }));
423
+ };
424
+
425
+ var styles$E = {"root":"Image-module_root__H5wAh","isStatic":"Image-module_isStatic__TmQ1V","isLoaded":"Image-module_isLoaded__keFnD","wrapper":"Image-module_wrapper__gJtbB","fullscreen":"Image-module_fullscreen__4PU9c","dark":"Image-module_dark__qjo5O"};
426
+
427
+ const Image = ({
428
+ alt,
429
+ display,
430
+ optimized,
431
+ width,
432
+ height,
433
+ source,
434
+ lazy,
435
+ ratio,
436
+ styleContext,
437
+ fullscreen = true
438
+ }) => {
439
+ const {
440
+ lightBox
441
+ } = React.useContext(BlockContext);
442
+ const [isLoaded, setIsLoaded] = React.useState(lazy ? false : true);
443
+ const handleClick = () => {
444
+ if (!lightBox || !fullscreen || optimized && !optimized.original) {
445
+ return;
446
+ }
447
+ postMessage('', 'fullscreen_click', 'click');
448
+ lightBox.show(optimized, width, height, alt);
449
+ };
450
+ const blockStyles = {
451
+ maxWidth: width <= 649 ? width : '100%'
452
+ };
453
+ const pictureStyles = {
454
+ paddingBottom: styleContext !== 'isInDynamicBlock' ? '100%' : `${100 / (ratio || width / height)}%`
455
+ };
456
+ /* fallback w325 url until w6 was released */
457
+ const fallbackSource = source && source[0] || optimized.w325 && optimized.w325['1x'] || optimized.original;
458
+ let classNames = [[styles$E.root, true], [styles$E.isLoaded, isLoaded], [styles$E.fullscreen, lightBox && optimized && optimized.original && fullscreen]];
459
+ if (styleContext) {
460
+ classNames = makeStyleContext(classNames, styleContext, styles$E);
461
+ }
462
+ return /*#__PURE__*/React.createElement("div", {
463
+ className: makeClassName(classNames),
464
+ style: blockStyles,
465
+ "data-testid": "image"
466
+ }, /*#__PURE__*/React.createElement("div", {
467
+ className: styles$E.wrapper,
468
+ style: pictureStyles,
469
+ onClick: () => handleClick(),
470
+ onKeyPress: () => handleClick(),
471
+ role: "button",
472
+ tabIndex: 0
473
+ }, lazy ? ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Lazy, {
474
+ threshold: 0.25
475
+ }, /*#__PURE__*/React.createElement(RenderPicture, {
476
+ fallbackSource: fallbackSource,
477
+ source: source,
478
+ optimized: optimized,
479
+ alt: alt,
480
+ display: display,
481
+ onLoad: setIsLoaded
482
+ })), /*#__PURE__*/React.createElement("noscript", null, /*#__PURE__*/React.createElement("img", {
483
+ src: fallbackSource,
484
+ alt: alt
485
+ })))) : ( /*#__PURE__*/React.createElement(RenderPicture, {
486
+ fallbackSource: fallbackSource,
487
+ source: source,
488
+ optimized: optimized,
489
+ alt: alt,
490
+ display: display,
491
+ onLoad: setIsLoaded
492
+ }))));
493
+ };
494
+
495
+ var styles$D = {"root":"Popover-module_root__nBiV4","fadeOut":"Popover-module_fadeOut__Y88V7","visible":"Popover-module_visible__XVQLW","fadeIn":"Popover-module_fadeIn__FK1gd","overlay":"Popover-module_overlay__NAPar","container":"Popover-module_container__y4SB1","disappear":"Popover-module_disappear__uUn2b","dismiss":"Popover-module_dismiss__W8KFF","background":"Popover-module_background__apiio","appear":"Popover-module_appear__b-CZ2","body":"Popover-module_body__UJEZf"};
496
+
497
+ const Popover = ({
498
+ children,
499
+ onClose
500
+ }) => {
501
+ const [visible, setVisible] = React.useState(true);
502
+ const handleClose = () => {
503
+ setVisible(false);
504
+ setTimeout(onClose, 350);
505
+ };
506
+ const handleScroll = () => {
507
+ handleClose();
508
+ };
509
+ const escFunction = event => {
510
+ if (event.key === 'Escape') {
511
+ handleClose();
512
+ }
513
+ };
514
+ React.useEffect(() => {
515
+ document.body.dataset.popover = 'true';
516
+ window.addEventListener('keydown', escFunction, false);
517
+ window.addEventListener('scroll', handleScroll, false);
518
+ return () => {
519
+ document.body.removeAttribute('data-popover');
520
+ window.removeEventListener('keydown', escFunction, false);
521
+ window.removeEventListener('scroll', handleScroll, false);
522
+ };
523
+ }, [visible]);
524
+ /* eslint-disable jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
525
+ return /*#__PURE__*/React.createElement("div", {
526
+ "data-testid": "popover",
527
+ className: makeClassName([[styles$D.root, true], [styles$D.visible, visible]])
528
+ }, /*#__PURE__*/React.createElement("div", {
529
+ className: styles$D.overlay,
530
+ onClick: () => handleClose()
531
+ }), /*#__PURE__*/React.createElement("div", {
532
+ className: styles$D.container
533
+ }, /*#__PURE__*/React.createElement("button", {
534
+ type: "button",
535
+ className: styles$D.dismiss,
536
+ onClick: () => handleClose(),
537
+ "aria-label": "dismiss"
538
+ }), /*#__PURE__*/React.createElement("svg", {
539
+ width: "100%",
540
+ className: styles$D.background
541
+ }, /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("mask", {
542
+ id: "myMask",
543
+ x: "0",
544
+ y: "0",
545
+ width: "100%",
546
+ height: "100%"
547
+ }, /*#__PURE__*/React.createElement("rect", {
548
+ fill: "white",
549
+ y: "0",
550
+ width: "100%",
551
+ height: "100%",
552
+ x: "0"
553
+ }), /*#__PURE__*/React.createElement("svg", {
554
+ x: "50%",
555
+ overflow: "visible"
556
+ }, /*#__PURE__*/React.createElement("g", {
557
+ transform: "translate(-12 0)"
558
+ }, /*#__PURE__*/React.createElement("path", {
559
+ d: "M4.61852778e-14,9.76996262e-15 L9.84597532,5.80270273 C11.0992017,6.54128882 12.6546044,6.54128882 13.9078308,5.80270273 L23.7538061,9.76996262e-15 L4.61852778e-14,9.76996262e-15 Z"
560
+ }))))), /*#__PURE__*/React.createElement("rect", {
561
+ fill: "#F7F7F7",
562
+ id: "base-mask",
563
+ mask: "url(#myMask)",
564
+ x: "0",
565
+ y: "0",
566
+ width: "100%",
567
+ height: "100%"
568
+ })), /*#__PURE__*/React.createElement("div", {
569
+ className: styles$D.body
570
+ }, children)));
571
+ };
572
+
573
+ var styles$C = {"root":"Footnote-module_root__W5D8G","body":"Footnote-module_body__C-ZC-","dismiss":"Footnote-module_dismiss__Q2hAX"};
574
+
575
+ const Footnote = ({
576
+ children,
577
+ onClose
578
+ }) => {
579
+ return /*#__PURE__*/React.createElement("div", {
580
+ "data-testid": "footnote",
581
+ className: makeClassName([[styles$C.root, true]])
582
+ }, /*#__PURE__*/React.createElement("button", {
583
+ className: styles$C.dismiss,
584
+ type: "button",
585
+ onClick: () => onClose()
586
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
587
+ icon: "cross",
588
+ size: "unset"
589
+ })), /*#__PURE__*/React.createElement("div", {
590
+ className: styles$C.body
591
+ }, children));
592
+ };
593
+
594
+ var viewportSize = () => ({
595
+ width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
596
+ height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
597
+ });
598
+
599
+ var styles$B = {"root":"DotsOnImage-module_root__8UQf2","isVisible":"DotsOnImage-module_isVisible__rA5x9","marker":"DotsOnImage-module_marker__pLdQT","show":"DotsOnImage-module_show__Ec0lG","dot":"DotsOnImage-module_dot__e2MWx","isActive":"DotsOnImage-module_isActive__Bhb58","popover":"DotsOnImage-module_popover__zHSbU","isRight":"DotsOnImage-module_isRight__IaUbc","isTop":"DotsOnImage-module_isTop__RMK49","isLeft":"DotsOnImage-module_isLeft__Q6JZ-","isBottom":"DotsOnImage-module_isBottom__c-aLe"};
600
+
601
+ const DotsOnImage = ({
602
+ block: {
603
+ optimized,
604
+ width,
605
+ height,
606
+ credit,
607
+ display,
608
+ dots
609
+ }
610
+ }) => {
611
+ const [ratio, setRatio] = React.useState(1);
612
+ const [ref, inView, entry] = reactIntersectionObserver.useInView();
613
+ const container = React.useRef(null);
614
+ const [popover, setPopover] = React.useState({
615
+ title: null,
616
+ body: null,
617
+ show: false,
618
+ id: null
619
+ });
620
+ const [visible, setVisible] = React.useState(false);
621
+ const defaultWidth = 375;
622
+ React.useEffect(() => {
623
+ if (entry && entry.boundingClientRect && entry.boundingClientRect.y < 0) {
624
+ setVisible(true);
625
+ }
626
+ }, [entry]);
627
+ React.useEffect(() => {
628
+ if (inView) {
629
+ setVisible(true);
630
+ }
631
+ }, [inView]);
632
+ React.useEffect(() => {
633
+ if (popover.id) {
634
+ document.addEventListener('click', handleClickOutside);
635
+ } else {
636
+ document.removeEventListener('click', handleClickOutside);
637
+ }
638
+ return () => document.removeEventListener('click', handleClickOutside);
639
+ }, [popover]);
640
+ React.useEffect(() => {
641
+ setDotSize();
642
+ window.addEventListener('resize', setDotSize);
643
+ return () => document.removeEventListener('resize', setDotSize);
644
+ }, [visible]);
645
+ const setDotSize = () => {
646
+ const width = window.innerWidth;
647
+ if (width < defaultWidth) {
648
+ const ratio = width / defaultWidth;
649
+ setRatio(ratio);
650
+ } else {
651
+ setRatio(1);
652
+ }
653
+ };
654
+ const handleClickOutside = event => {
655
+ const path = event.composedPath();
656
+ if (path.indexOf(container.current) === -1) {
657
+ setPopover({
658
+ show: false
659
+ });
660
+ }
661
+ };
662
+ const handleDotClick = dot => {
663
+ const shouldShow = dot.id !== popover.id;
664
+ const side = dot.position.x > 50 ? 'isLeft' : 'isRight';
665
+ const align = dot.position.y > 50 ? 'isBottom' : 'isTop';
666
+ const style = {
667
+ top: `${dot.position.y}%`,
668
+ left: `${dot.position.x}%`
669
+ };
670
+ setPopover({
671
+ title: dot.title,
672
+ body: dot.body,
673
+ show: shouldShow,
674
+ id: shouldShow ? dot.id : null,
675
+ style,
676
+ side,
677
+ align
678
+ });
679
+ };
680
+ return /*#__PURE__*/React.createElement("div", {
681
+ className: makeClassName([[styles$B.root, true], [styles$B.isVisible, visible]]),
682
+ "data-testid": "dots-on-image",
683
+ ref: ref
684
+ }, /*#__PURE__*/React.createElement(Image, {
685
+ fullscreen: false,
686
+ optimized: optimized,
687
+ width: width,
688
+ height: height,
689
+ alt: credit,
690
+ display: display
691
+ }), /*#__PURE__*/React.createElement("div", {
692
+ ref: container
693
+ }, dots.map(dot => ( /*#__PURE__*/React.createElement("div", {
694
+ className: styles$B.dot,
695
+ key: dot.id,
696
+ style: {
697
+ top: `${dot.position.y}%`,
698
+ left: `${dot.position.x}%`,
699
+ transform: `scale(${ratio}) translate(-${50 / ratio}%, -${50 / ratio}%)`
700
+ }
701
+ }, /*#__PURE__*/React.createElement("button", {
702
+ className: makeClassName([[styles$B.marker, true], [styles$B.isActive, dot.id === popover.id]]),
703
+ type: "button",
704
+ style: {
705
+ backgroundColor: dot.icon.color
706
+ },
707
+ onClick: () => handleDotClick(dot)
708
+ }, dot.icon.type === 'svg' && ( /*#__PURE__*/React.createElement("div", {
709
+ dangerouslySetInnerHTML: {
710
+ __html: dot.icon.svg_string
711
+ }
712
+ })), dot.icon.type === 'number' && dot.icon.number)))), popover.show && ( /*#__PURE__*/React.createElement(React.Fragment, null, viewportSize().width >= MediaQuerySizes.LANDSCAPE_TABLET ? ( /*#__PURE__*/React.createElement("div", {
713
+ className: makeClassName([[styles$B.popover, true], [styles$B[popover.side], !!popover.side], [styles$B[popover.align], !!popover.align]]),
714
+ style: popover.style
715
+ }, /*#__PURE__*/React.createElement(Footnote, {
716
+ onClose: () => {
717
+ setPopover({
718
+ show: false
719
+ });
720
+ }
721
+ }, popover.title && /*#__PURE__*/React.createElement("h3", null, popover.title), /*#__PURE__*/React.createElement("div", {
722
+ dangerouslySetInnerHTML: {
723
+ __html: popover.body
724
+ }
725
+ })))) : ( /*#__PURE__*/React.createElement(Popover, {
726
+ onClose: () => {
727
+ setPopover({
728
+ show: false
729
+ });
730
+ }
731
+ }, popover.title && /*#__PURE__*/React.createElement("h3", null, popover.title), /*#__PURE__*/React.createElement("div", {
732
+ dangerouslySetInnerHTML: {
733
+ __html: popover.body
734
+ }
735
+ })))))));
736
+ };
737
+
738
+ var styles$A = {"root":"Tag-module_root__sGbnM","small":"Tag-module_small__hcPrf","large":"Tag-module_large__EKMu6","dark":"Tag-module_dark__9SHCb","light":"Tag-module_light__qlfy3","gold":"Tag-module_gold__u0bzS","gray":"Tag-module_gray__eazPk","inherit":"Tag-module_inherit__z21c-","is1to1":"Tag-module_is1to1__V-fH5","is1to2":"Tag-module_is1to2__b9Obh","isInSuperBlock":"Tag-module_isInSuperBlock__wrFUY","is1to3":"Tag-module_is1to3__vZT-R","is1to4":"Tag-module_is1to4__MBh5V","slide":"Tag-module_slide__gzptP","game":"Tag-module_game__NmKec","podcastMaterial":"Tag-module_podcastMaterial__O-LBI","richRelated":"Tag-module_richRelated__Qs6Ei","isInBookRelated":"Tag-module_isInBookRelated__ikTaj","card":"Tag-module_card__TX87-","live":"Tag-module_live__ykyR7","episode":"Tag-module_episode__3OHmN","podcast":"Tag-module_podcast__K6dHn","rich":"Tag-module_rich__vPnWd","isInDynamicBlock":"Tag-module_isInDynamicBlock__WNleF","mobile":"Tag-module_mobile__19oMH","desktop":"Tag-module_desktop__cNyQs"};
739
+
740
+ const Tag = ({
741
+ children,
742
+ size = 'small',
743
+ theme = 'gold',
744
+ styleContext,
745
+ correlation,
746
+ onlyOn
747
+ }) => {
748
+ let classNames = [[styles$A.root, true], [styles$A[size], !!size && !!styles$A[size]], [styles$A[theme], !!theme && !!styles$A[theme]], [styles$A[onlyOn], !!onlyOn && !!styles$A[onlyOn]], [styles$A[correlation], !!correlation && !!styles$A[correlation]]];
749
+ if (styleContext) {
750
+ classNames = makeStyleContext(classNames, styleContext, styles$A);
751
+ }
752
+ return /*#__PURE__*/React.createElement("div", {
753
+ "data-testid": "tag",
754
+ className: makeClassName(classNames)
755
+ }, children);
756
+ };
757
+
758
+ var styles$z = {"root":"MediaCaption-module_root__1r0wu","caption":"MediaCaption-module_caption__ewfcc","credit":"MediaCaption-module_credit__7y4v8","dark":"MediaCaption-module_dark__7a9Cm","video":"MediaCaption-module_video__RDTUa","picture":"MediaCaption-module_picture__abCvw","desktop":"MediaCaption-module_desktop__e0lCY","isDark":"MediaCaption-module_isDark__IFb9X"};
759
+
760
+ const MediaCaption = ({
761
+ credit,
762
+ caption,
763
+ styleContext
764
+ }) => {
765
+ let classNames = [[styles$z.root, true]];
766
+ if (styleContext) {
767
+ classNames = makeStyleContext(classNames, styleContext, styles$z);
768
+ }
769
+ return /*#__PURE__*/React.createElement("div", {
770
+ "data-testid": "media-caption",
771
+ className: makeClassName(classNames)
772
+ }, caption && ( /*#__PURE__*/React.createElement("div", {
773
+ className: styles$z.caption,
774
+ dangerouslySetInnerHTML: {
775
+ __html: caption
776
+ }
777
+ })), credit && ( /*#__PURE__*/React.createElement("div", {
778
+ className: styles$z.credit,
779
+ dangerouslySetInnerHTML: {
780
+ __html: credit
781
+ }
782
+ })));
783
+ };
784
+
785
+ var styles$y = {"root":"Table-module_root__fRuZq","card":"Table-module_card__8r-EA","table":"Table-module_table__7Pagp","slide":"Table-module_slide__dgMPV","wrapper":"Table-module_wrapper__AP4Pz","tracks":"Table-module_tracks__mRNG0","default":"Table-module_default__nwBEg","full":"Table-module_full__YZPDz","row":"Table-module_row__9OHT3","cell":"Table-module_cell__yFdqc","fixedColumn":"Table-module_fixedColumn__O2528","white":"Table-module_white__Laj3-","gray":"Table-module_gray__FPFh0","pink":"Table-module_pink__CGkAA","blue":"Table-module_blue__b8BHs","yellow":"Table-module_yellow__YOJgu","orange":"Table-module_orange__B-i8L","green":"Table-module_green__Bt6iC","violet":"Table-module_violet__yTZd7","header":"Table-module_header__YPDzO","s":"Table-module_s__I-CeX","m":"Table-module_m__vxhDf","l":"Table-module_l__GYHhk","xs":"Table-module_xs__imR8t"};
786
+
787
+ const Table = ({
788
+ styleContext,
789
+ block: {
790
+ rows,
791
+ options,
792
+ display,
793
+ columns_widths: columnsWidth,
794
+ table_credit: tableCredit
795
+ }
796
+ }) => {
797
+ const colors = {
798
+ '#ffffff': 'white',
799
+ '#f5f5f5': 'gray',
800
+ '#feeeee': 'pink',
801
+ '#e6f3ff': 'blue',
802
+ '#fffde6': 'yellow',
803
+ '#fff9f2': 'orange',
804
+ '#e7f2ef': 'green',
805
+ '#f4f0f8': 'violet'
806
+ };
807
+ let classNames = [[styles$y.root, true], [styles$y[display], !!display && !!styles$y[display]]];
808
+ if (styleContext) {
809
+ classNames = makeStyleContext(classNames, styleContext, styles$y);
810
+ }
811
+ return /*#__PURE__*/React.createElement("div", {
812
+ "data-testid": "table",
813
+ className: makeClassName(classNames)
814
+ }, /*#__PURE__*/React.createElement("div", {
815
+ className: styles$y.wrapper
816
+ }, /*#__PURE__*/React.createElement("div", {
817
+ className: styles$y.table
818
+ }, /*#__PURE__*/React.createElement("div", {
819
+ className: styles$y.tracks
820
+ }, rows.map((row, i) => {
821
+ return /*#__PURE__*/React.createElement("div", {
822
+ key: row.key,
823
+ className: styles$y.row
824
+ }, row.cells.map((cell, j) => ( /*#__PURE__*/React.createElement("div", {
825
+ key: cell.key,
826
+ className: makeClassName([[styles$y.cell, true], [styles$y.header, options.header && i === 0], [styles$y[colors[cell.color]], true], [styles$y[columnsWidth[j]], true], [styles$y.fixedColumn, options.fixed_first_column && j === 0]]),
827
+ dangerouslySetInnerHTML: {
828
+ __html: cell.val
829
+ }
830
+ }))));
831
+ })))), tableCredit && ( /*#__PURE__*/React.createElement(MediaCaption, {
832
+ credit: tableCredit,
833
+ styleContext: styleContext
834
+ })));
835
+ };
836
+
837
+ var styles$x = {"root":"MaterialNote-module_root__99HSA","dark":"MaterialNote-module_dark__etjym","note_credit":"MaterialNote-module_note_credit__J1skG","note_caption":"MaterialNote-module_note_caption__G2Ad0","center":"MaterialNote-module_center__mDLEO","default":"MaterialNote-module_default__ozgd7","card":"MaterialNote-module_card__EVuZe","slide":"MaterialNote-module_slide__mg8XV","game":"MaterialNote-module_game__c-r0n","gameSurvey":"MaterialNote-module_gameSurvey__azhu6"};
838
+
839
+ const MaterialNote = ({
840
+ block: {
841
+ data
842
+ },
843
+ styleContext
844
+ }) => {
845
+ let classNames = [[styles$x.root, true]];
846
+ if (styleContext) {
847
+ classNames = makeStyleContext(classNames, styleContext, styles$x);
848
+ }
849
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
850
+ "data-testid": "material-note",
851
+ className: makeClassName(classNames)
852
+ }, data && data.map(item => ( /*#__PURE__*/React.createElement("p", {
853
+ className: styles$x[item.type],
854
+ key: item.id,
855
+ dangerouslySetInnerHTML: {
856
+ __html: item.data
857
+ }
858
+ })))));
859
+ };
860
+
861
+ var styles$w = {"root":"BookmarkButton-module_root__A-75w","control":"BookmarkButton-module_control__-xy5O","dark":"BookmarkButton-module_dark__GkMEC","light":"BookmarkButton-module_light__1W6tx","isInBookmarks":"BookmarkButton-module_isInBookmarks__YSjjj","isInGrid":"BookmarkButton-module_isInGrid__Desh-"};
862
+
863
+ const BookmarkButton = ({
864
+ styleContext,
865
+ theme,
866
+ isInBookmarks,
867
+ onClick
868
+ }) => {
869
+ let classNames = [[styles$w.root, true], [styles$w.isInBookmarks, isInBookmarks], [styles$w[theme], !!theme && !!styles$w[theme]]];
870
+ if (styleContext) {
871
+ classNames = makeStyleContext(classNames, styleContext, styles$w);
872
+ }
873
+ return /*#__PURE__*/React.createElement("div", {
874
+ "data-testid": "bookmark-button",
875
+ className: makeClassName(classNames)
876
+ }, /*#__PURE__*/React.createElement("button", {
877
+ className: styles$w.control,
878
+ onClick: () => onClick(),
879
+ type: "button"
880
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
881
+ icon: "bookmark",
882
+ size: "unset"
883
+ })));
884
+ };
885
+
886
+ var styles$v = {"root":"MaterialTitle-module_root__VSphO","primary":"MaterialTitle-module_primary__XGnpb","secondary":"MaterialTitle-module_secondary__7IDEp"};
887
+
888
+ const Primary = ({
889
+ children
890
+ }) => {
891
+ return /*#__PURE__*/React.createElement("span", {
892
+ className: styles$v.primary
893
+ }, children);
894
+ };
895
+ const Secondary = ({
896
+ children
897
+ }) => {
898
+ return /*#__PURE__*/React.createElement("span", {
899
+ className: styles$v.secondary
900
+ }, children);
901
+ };
902
+ const MaterialTitle = ({
903
+ children
904
+ }) => {
905
+ return /*#__PURE__*/React.createElement("h1", {
906
+ className: styles$v.root,
907
+ "data-testid": "material-title"
908
+ }, children);
909
+ };
910
+
911
+ var styles$u = {"root":"Dropdown-module_root__Wv7S-","menu":"Dropdown-module_menu__11IQL","inactive":"Dropdown-module_inactive__E5CP6","isInAudioPanel":"Dropdown-module_isInAudioPanel__UniSV"};
912
+
913
+ const Menu = ({
914
+ children
915
+ }) => {
916
+ return /*#__PURE__*/React.createElement("div", {
917
+ "data-testid": "dropdown",
918
+ className: styles$u.menu
919
+ }, children);
920
+ };
921
+ const Dropdown = ({
922
+ children,
923
+ active,
924
+ styleContext
925
+ }) => {
926
+ let classNames = [[styles$u.root, true], [styles$u.inactive, !active && styleContext === 'isPodcastSeason' && !!styles$u.inactive]];
927
+ if (styleContext) {
928
+ classNames = makeStyleContext(classNames, styleContext, styles$u);
929
+ }
930
+ return /*#__PURE__*/React.createElement("div", {
931
+ "data-testid": "dropdown",
932
+ className: makeClassName(classNames)
933
+ }, children);
934
+ };
935
+
936
+ var styles$t = {"root":"Toolbar-module_root__RnmlI","list":"Toolbar-module_list__-IhdP","item":"Toolbar-module_item__CWmGM","isInTopbar":"Toolbar-module_isInTopbar__WEDi8","center":"Toolbar-module_center__pvdiJ","game":"Toolbar-module_game__etwIA","gameSurvey":"Toolbar-module_gameSurvey__v4D31","slide":"Toolbar-module_slide__PtB3l","card":"Toolbar-module_card__Lutyq","isDark":"Toolbar-module_isDark__MG6Ar","dark":"Toolbar-module_dark__a9sgz"};
937
+
938
+ const ToolbarItem = ({
939
+ children
940
+ }) => {
941
+ return /*#__PURE__*/React.createElement("li", {
942
+ className: styles$t.item
943
+ }, children);
944
+ };
945
+
946
+ const Toolbar = ({
947
+ children,
948
+ styleContext
949
+ }) => {
950
+ let classNames = [[styles$t.root, true]];
951
+ if (styleContext) {
952
+ classNames = makeStyleContext(classNames, styleContext, styles$t);
953
+ }
954
+ return /*#__PURE__*/React.createElement("div", {
955
+ "data-testid": "toolbar",
956
+ className: makeClassName(classNames)
957
+ }, /*#__PURE__*/React.createElement("ul", {
958
+ className: styles$t.list
959
+ }, children));
960
+ };
961
+
962
+ var styles$s = {"root":"Meta-module_root__H-Q4d","rich":"Meta-module_rich__dCkJK","podcast":"Meta-module_podcast__MI8gD","episode":"Meta-module_episode__0n9CF","simple":"Meta-module_simple__tztcr","slide":"Meta-module_slide__3OyIN","card":"Meta-module_card__2vqfN","game":"Meta-module_game__HNcgr","isInMaterial":"Meta-module_isInMaterial__vKcTK","isInSearchItem":"Meta-module_isInSearchItem__ENqHo","isInMediaBlock":"Meta-module_isInMediaBlock__TENZG","center":"Meta-module_center__seHro","half":"Meta-module_half__aoa9h","podcastMaterial":"Meta-module_podcastMaterial__GTPyD","light":"Meta-module_light__oW3kc","dark":"Meta-module_dark__tLQNJ","isDark":"Meta-module_isDark__xSl1J","hasSource":"Meta-module_hasSource__OZJ0y","bookmark":"Meta-module_bookmark__jcFWn","isInBookRelated":"Meta-module_isInBookRelated__Ohidg","mobile":"Meta-module_mobile__PbG8N","desktop":"Meta-module_desktop__W5AB7"};
963
+
964
+ const Meta = ({
965
+ hasSource,
966
+ theme,
967
+ children,
968
+ onlyOn,
969
+ styleContext
970
+ }) => {
971
+ let classNames = [[styles$s.root, true], [styles$s[theme], !!theme && !!styles$s[theme]], [styles$s[onlyOn], !!onlyOn], [styles$s.hasSource, hasSource]];
972
+ if (styleContext) {
973
+ classNames = makeStyleContext(classNames, styleContext, styles$s);
974
+ }
975
+ return /*#__PURE__*/React.createElement("div", {
976
+ "data-testid": "meta",
977
+ className: makeClassName(classNames)
978
+ }, children);
979
+ };
980
+
981
+ var styles$r = {"root":"Timestamp-module_root__jPJ6w"};
982
+
983
+ const Timestamp = ({
984
+ publishedAt,
985
+ locale = 'ru',
986
+ type
987
+ }) => {
988
+ let published;
989
+ const timeFormat = locale === 'ru' ? 'HH:mm, D MMMM YYYY' : 'h:mm a, MMMM D, YYYY';
990
+ const preparedPublishedAt = publishedAt * 1000;
991
+ dayjs.locale(locale);
992
+ dayjs.extend(relativeTime);
993
+ if (type === 'fromNow') {
994
+ published = dayjs(preparedPublishedAt).fromNow();
995
+ } else if (type === 'format') {
996
+ published = dayjs(preparedPublishedAt).format('HH:mm');
997
+ } else if (type === 'date') {
998
+ published = dayjs(preparedPublishedAt).format(timeFormat);
999
+ } else {
1000
+ throw new Error('Unknown time type');
1001
+ }
1002
+ return /*#__PURE__*/React.createElement("time", {
1003
+ suppressHydrationWarning: true,
1004
+ "data-testid": "timestamp",
1005
+ className: styles$r.root
1006
+ }, published);
1007
+ };
1008
+
1009
+ const DangerousHTML = ({
1010
+ className = '',
1011
+ tagName: TagName = 'div',
1012
+ html
1013
+ }) => {
1014
+ const element = React.useRef(null);
1015
+ const [canRenderHtml, setCanRenderHtml] = React.useState(false);
1016
+ React.useEffect(() => {
1017
+ setCanRenderHtml(true);
1018
+ }, []);
1019
+ const replaceScriptElementsRecursive = React.useCallback(node => {
1020
+ if (node.tagName === 'SCRIPT' && (!node.id || node.id.indexOf('script-') !== 0)) {
1021
+ const script = document.createElement('script');
1022
+ script.id = `script-${Math.random().toString(16).slice(2)}`;
1023
+ script.innerHTML = node.innerHTML;
1024
+ const attrs = node.attributes;
1025
+ for (let i = 0; i < attrs.length; i += 1) {
1026
+ const {
1027
+ name,
1028
+ value
1029
+ } = attrs[i];
1030
+ script.setAttribute(name, value);
1031
+ }
1032
+ node.parentElement.replaceChild(script, node);
1033
+ } else {
1034
+ let i = 0;
1035
+ const children = node.childNodes;
1036
+ while (i < children.length) {
1037
+ replaceScriptElementsRecursive(children[i]);
1038
+ i += 1;
1039
+ }
1040
+ }
1041
+ }, []);
1042
+ const prepareAnchors = React.useCallback(() => {
1043
+ const anchors = Array.from(element.current.querySelectorAll('a'));
1044
+ anchors.forEach(a => {
1045
+ a.setAttribute('target', '_blank');
1046
+ });
1047
+ }, []);
1048
+ React.useEffect(() => {
1049
+ if (canRenderHtml && html.indexOf('script') > -1 && element.current.firstElementChild) {
1050
+ element.current.firstElementChild.innerHTML = html;
1051
+ replaceScriptElementsRecursive(element.current.firstElementChild);
1052
+ prepareAnchors();
1053
+ }
1054
+ }, [canRenderHtml, element, html, replaceScriptElementsRecursive, prepareAnchors]);
1055
+ return /*#__PURE__*/React.createElement("div", {
1056
+ ref: element
1057
+ }, /*#__PURE__*/React.createElement(TagName, {
1058
+ className: className,
1059
+ dangerouslySetInnerHTML: {
1060
+ __html: html
1061
+ }
1062
+ }));
1063
+ };
1064
+
1065
+ var styles$q = {"root":"EmbedBlock-module_root__wNZlD","object":"EmbedBlock-module_object__DONQ0","objectWrap":"EmbedBlock-module_objectWrap__qpbni","gameEmbed":"EmbedBlock-module_gameEmbed__tO5Ha","proportional":"EmbedBlock-module_proportional__zDPfm","default":"EmbedBlock-module_default__np8MO","xs":"EmbedBlock-module_xs__PNHGz","full":"EmbedBlock-module_full__Gmz7o","super_full":"EmbedBlock-module_super_full__-h382","figure":"EmbedBlock-module_figure__fNZB-","dark":"EmbedBlock-module_dark__S2R9f","isInGroupedBlock":"EmbedBlock-module_isInGroupedBlock__Wjj7k","control":"EmbedBlock-module_control__9bJUa","raw_html":"EmbedBlock-module_raw_html__EfYVy","mobileFullwidth":"EmbedBlock-module_mobileFullwidth__1MDT5","isInCard":"EmbedBlock-module_isInCard__WnLHG","isInSlide":"EmbedBlock-module_isInSlide__BtdnY","cc":"EmbedBlock-module_cc__Gyw44","isInSensitiveBlock":"EmbedBlock-module_isInSensitiveBlock__nYajZ","isInAnswer":"EmbedBlock-module_isInAnswer__WuZ0H","picture":"EmbedBlock-module_picture__Weamy","wrapper":"EmbedBlock-module_wrapper__ynT7R","mobile":"EmbedBlock-module_mobile__lEuww","desktop":"EmbedBlock-module_desktop__599S7"};
1066
+
1067
+ const EmbedGif = ({
1068
+ gif,
1069
+ mp4Url,
1070
+ style
1071
+ }) => {
1072
+ const [videoFrozen, setVideoFrozen] = React.useState(false);
1073
+ const videoElem = React.useRef(null);
1074
+ const handleVideoTouch = () => {
1075
+ videoElem.current.play();
1076
+ setVideoFrozen(false);
1077
+ };
1078
+ const handleVideoError = () => {
1079
+ const video = videoElem.current;
1080
+ video.setAttribute('poster', video.dataset.gif);
1081
+ setVideoFrozen(false);
1082
+ };
1083
+ React.useEffect(() => {
1084
+ const video = videoElem.current;
1085
+ const {
1086
+ width: viewportWidth
1087
+ } = viewportSize();
1088
+ if (viewportWidth >= MediaQuerySizes.MOBILE) {
1089
+ video.setAttribute('autoplay', true);
1090
+ video.play();
1091
+ } else {
1092
+ setVideoFrozen(true);
1093
+ video.pause();
1094
+ video.addEventListener('touchstart', handleVideoTouch);
1095
+ }
1096
+ video.addEventListener('error', handleVideoError);
1097
+ return () => {
1098
+ video.removeEventListener('touchstart', handleVideoTouch);
1099
+ video.removeEventListener('error', handleVideoError);
1100
+ };
1101
+ }, []);
1102
+ return /*#__PURE__*/React.createElement("div", {
1103
+ className: styles$q.figure
1104
+ }, /*#__PURE__*/React.createElement("div", {
1105
+ className: styles$q.objectWrap,
1106
+ style: style,
1107
+ "data-frozen": videoFrozen
1108
+ }, /*#__PURE__*/React.createElement("video", {
1109
+ playsInline: true,
1110
+ muted: true,
1111
+ loop: true,
1112
+ autoPlay: true,
1113
+ preload: "metadata",
1114
+ "data-gif": gif,
1115
+ ref: videoElem
1116
+ }, /*#__PURE__*/React.createElement("source", {
1117
+ src: `https://meduza.io${mp4Url}`,
1118
+ type: "video/mp4"
1119
+ }))));
1120
+ };
1121
+
1122
+ const EmbedBlock = ({
1123
+ block,
1124
+ block: {
1125
+ data,
1126
+ data: {
1127
+ html,
1128
+ display,
1129
+ only_on: onlyOn,
1130
+ provider,
1131
+ cc,
1132
+ optimized,
1133
+ small_url: small,
1134
+ large_url: large,
1135
+ gif_url: gifUrl,
1136
+ mp4_url: mp4Url
1137
+ }
1138
+ },
1139
+ styleContext,
1140
+ children
1141
+ }) => {
1142
+ const [isPopoverShown, setIsPopoverShown] = React.useState(false);
1143
+ const style = {};
1144
+ const isProportional = block.data.height && block.data.width;
1145
+ const fullWidthProviders = ['youtube', 'vimeo', 'onetv', 'coub', 'meduza', 'facebook_video'];
1146
+ const mobileFullwidth = fullWidthProviders.indexOf(provider) > -1 || block.type === 'dots_on_image';
1147
+ const renderCC = context => ( /*#__PURE__*/React.createElement(MediaCaption, {
1148
+ credit: data.credit,
1149
+ caption: data.caption,
1150
+ styleContext: context || styleContext
1151
+ }));
1152
+ const renderEmbed = style => {
1153
+ switch (block.type) {
1154
+ case 'gif':
1155
+ {
1156
+ return /*#__PURE__*/React.createElement(EmbedGif, {
1157
+ gif: gifUrl,
1158
+ mp4Url: mp4Url,
1159
+ style: style
1160
+ });
1161
+ }
1162
+ case 'image':
1163
+ {
1164
+ return /*#__PURE__*/React.createElement("div", {
1165
+ className: styles$q.figure
1166
+ }, /*#__PURE__*/React.createElement(Image, {
1167
+ source: !optimized && [small, large],
1168
+ optimized: block.data.optimized,
1169
+ width: block.data.width,
1170
+ height: block.data.height,
1171
+ alt: block.data.caption,
1172
+ display: block.data.display,
1173
+ lazy: block.data.lazy,
1174
+ styleContext: styleContext
1175
+ }));
1176
+ }
1177
+ case 'game_embed':
1178
+ {
1179
+ return /*#__PURE__*/React.createElement("div", {
1180
+ className: styles$q.gameEmbed
1181
+ }, /*#__PURE__*/React.createElement("iframe", {
1182
+ src: block.data.game_src,
1183
+ id: block.data.game_id,
1184
+ title: "Game embed"
1185
+ }));
1186
+ }
1187
+ case 'dots_on_image':
1188
+ {
1189
+ return /*#__PURE__*/React.createElement("div", {
1190
+ className: styles$q.figure
1191
+ }, /*#__PURE__*/React.createElement(DotsOnImage, {
1192
+ block: data
1193
+ }));
1194
+ }
1195
+ default:
1196
+ {
1197
+ return /*#__PURE__*/React.createElement("div", {
1198
+ className: styles$q.object
1199
+ }, /*#__PURE__*/React.createElement("div", {
1200
+ className: styles$q.wrapper,
1201
+ style: style
1202
+ }, /*#__PURE__*/React.createElement(DangerousHTML, {
1203
+ className: styles$q.objectWrap,
1204
+ html: html
1205
+ })));
1206
+ }
1207
+ }
1208
+ };
1209
+ if (isProportional) {
1210
+ style.paddingBottom = `${block.data.height / block.data.width * 100}%`;
1211
+ style.height = 0;
1212
+ }
1213
+ let classNames = [[styles$q.root, true], [styles$q.cc, cc], [styles$q[display], !!display && styles$q[display]], [styles$q[provider], !!provider && !!styles$q[provider]], [styles$q[onlyOn], !!onlyOn && styles$q[onlyOn]], [styles$q.mobileFullwidth, mobileFullwidth], [styles$q.proportional, isProportional]];
1214
+ // Убираем из контекста все, что не начинается с приставки isIn,
1215
+ // чтобы не применились лишние модификаторы
1216
+ // TODO: в w6 модификаторы должны передаваться явно
1217
+ if (styleContext && Array.isArray(styleContext)) {
1218
+ const filteredContext = styleContext.filter(key => key.startsWith('isIn') && styles$q[key]).reduce((acc, key) => {
1219
+ acc.push(key);
1220
+ return acc;
1221
+ }, []);
1222
+ classNames = makeStyleContext(classNames, filteredContext, styles$q);
1223
+ }
1224
+ return /*#__PURE__*/React.createElement("figure", {
1225
+ className: makeClassName(classNames)
1226
+ }, children && ( /*#__PURE__*/React.createElement("div", {
1227
+ className: styles$q.object
1228
+ }, /*#__PURE__*/React.createElement("div", {
1229
+ className: styles$q.wrapper,
1230
+ style: style
1231
+ }, /*#__PURE__*/React.createElement("div", {
1232
+ className: styles$q.objectWrap
1233
+ }, children)))), !children && renderEmbed(style), cc === 'default' && /*#__PURE__*/React.createElement("figcaption", null, renderCC()), cc === 'button' && ( /*#__PURE__*/React.createElement("button", {
1234
+ className: styles$q.control,
1235
+ type: "button",
1236
+ "aria-label": "Open",
1237
+ onClick: () => {
1238
+ setIsPopoverShown(!isPopoverShown);
1239
+ }
1240
+ })), cc === 'button' && isPopoverShown && ( /*#__PURE__*/React.createElement(Popover, {
1241
+ onClose: () => {
1242
+ setIsPopoverShown(false);
1243
+ }
1244
+ }, renderCC('isInPopover'))));
1245
+ };
1246
+
1247
+ const IframeBlock = ({
1248
+ block,
1249
+ block: {
1250
+ id
1251
+ },
1252
+ styleContext,
1253
+ lang = 'ru'
1254
+ }) => {
1255
+ const element = React.useRef(null);
1256
+ const renderIframe = () => {
1257
+ const rootEl = document.createElement('div');
1258
+ const contentEl = document.createElement('div');
1259
+ const scriptEl = document.createElement('script');
1260
+ const style = document.createElement('style');
1261
+ const range = document.createRange();
1262
+ range.setStart(contentEl, 0);
1263
+ contentEl.setAttribute('id', 'content');
1264
+ scriptEl.textContent = `
1265
+ function getDocHeight() {
1266
+ var doc = document;
1267
+ var body = doc.body;
1268
+ var html = doc.documentElement;
1269
+ var height = Math.max( body.scrollHeight, body.offsetHeight,
1270
+ html.clientHeight, html.scrollHeight, html.offsetHeight );
1271
+
1272
+ doc.body.style.margin="0";
1273
+
1274
+ return document.getElementById('content') ? document.getElementById('content').offsetHeight : height;
1275
+ }
1276
+
1277
+ function sendDocHeightMsg() {
1278
+ var height = getDocHeight();
1279
+ var message = JSON.stringify({
1280
+ action: {
1281
+ type: "UPDATE_HEIGHT",
1282
+ payload: {
1283
+ id: "${block.id}",
1284
+ height: height
1285
+ }
1286
+ }
1287
+ });
1288
+ parent.postMessage("mdzMaterialEmbedHeight=" + message, '*');
1289
+ }
1290
+
1291
+ setInterval(sendDocHeightMsg, 300);
1292
+ `;
1293
+ style.type = 'text/css';
1294
+ style.innerHTML = block.type === 'embed_code' ? '.twitter-tweet { padding-top: 15px; margin: 0 !important; }' : '.twitter-tweet { margin: 0 !important; } .fb-post { display: block; } .instagram-media { min-width: 0 !important; }';
1295
+ contentEl.appendChild(range.createContextualFragment(block.data.html));
1296
+ rootEl.appendChild(scriptEl);
1297
+ rootEl.appendChild(contentEl);
1298
+ contentEl.appendChild(style);
1299
+ const frame = element.current.querySelector('iframe').contentDocument;
1300
+ frame.open();
1301
+ frame.close();
1302
+ frame.documentElement.setAttribute('lang', lang);
1303
+ frame.body.appendChild(rootEl);
1304
+ };
1305
+ React.useEffect(() => {
1306
+ renderIframe();
1307
+ }, []);
1308
+ return /*#__PURE__*/React.createElement(EmbedBlock, {
1309
+ block: block,
1310
+ styleContext: styleContext
1311
+ }, /*#__PURE__*/React.createElement("div", {
1312
+ ref: element,
1313
+ dangerouslySetInnerHTML: {
1314
+ __html: `<iframe id=${id} frameBorder="0" scrolling="no"></iframe>`
1315
+ }
1316
+ }));
1317
+ };
1318
+
1319
+ const EmbedBlockContainer = ({
1320
+ block,
1321
+ styleContext,
1322
+ lang
1323
+ }) => {
1324
+ if (block.data && block.data.wrap_with_iframe) {
1325
+ return /*#__PURE__*/React.createElement(IframeBlock, {
1326
+ block: block,
1327
+ styleContext: styleContext,
1328
+ lang: lang
1329
+ });
1330
+ }
1331
+ return /*#__PURE__*/React.createElement(EmbedBlock, {
1332
+ block: block,
1333
+ styleContext: styleContext
1334
+ });
1335
+ };
1336
+
1337
+ var styles$p = {"root":"QuoteBlock-module_root__4qa1J","center":"QuoteBlock-module_center__1f83y"};
1338
+
1339
+ const QuoteBlock = ({
1340
+ block: {
1341
+ data
1342
+ },
1343
+ styleContext
1344
+ }) => {
1345
+ let classNames = [[styles$p.root, true]];
1346
+ if (styleContext) {
1347
+ classNames = makeStyleContext(classNames, styleContext, styles$p);
1348
+ }
1349
+ return /*#__PURE__*/React.createElement("div", {
1350
+ "data-testid": "quote-block",
1351
+ className: makeClassName(classNames)
1352
+ }, /*#__PURE__*/React.createElement("p", {
1353
+ dangerouslySetInnerHTML: {
1354
+ __html: data
1355
+ }
1356
+ }));
1357
+ };
1358
+
1359
+ var styles$o = {"root":"CardTitle-module_root__Pvx--","index":"CardTitle-module_index__Keled","title":"CardTitle-module_title__Lkflo","mobile":"CardTitle-module_mobile__6N3hB","desktop":"CardTitle-module_desktop__sBokS"};
1360
+
1361
+ const CardTitle = ({
1362
+ block: {
1363
+ data: {
1364
+ only_on: onlyOn,
1365
+ index,
1366
+ text
1367
+ },
1368
+ id
1369
+ },
1370
+ styleContext
1371
+ }) => {
1372
+ return /*#__PURE__*/React.createElement("div", {
1373
+ "data-testid": "card-title",
1374
+ id: id,
1375
+ className: makeClassName([[styles$o.root, true], [styles$o[onlyOn], !!onlyOn], [styles$o[styleContext], !!styleContext && !!styles$o[styleContext]]])
1376
+ }, /*#__PURE__*/React.createElement("div", {
1377
+ className: styles$o.index
1378
+ }, index), /*#__PURE__*/React.createElement("h3", {
1379
+ className: styles$o.title
1380
+ }, text));
1381
+ };
1382
+
1383
+ var styles$n = {"root":"ChapterBlock-module_root__iw7d2","subtitle":"ChapterBlock-module_subtitle__IpWgz","mobile":"ChapterBlock-module_mobile__V1Eye","desktop":"ChapterBlock-module_desktop__9xWf4"};
1384
+
1385
+ const ChapterBlock = ({
1386
+ block: {
1387
+ data,
1388
+ only_on: onlyOn
1389
+ },
1390
+ styleContext,
1391
+ id
1392
+ }) => {
1393
+ return /*#__PURE__*/React.createElement("div", {
1394
+ "data-testid": "chapter-block",
1395
+ id: id,
1396
+ className: makeClassName([[styles$n.root, true], [styles$n[onlyOn], !!onlyOn]])
1397
+ }, /*#__PURE__*/React.createElement("div", {
1398
+ className: makeClassName([[styles$n.subtitle, true], [styles$n[styleContext], !!styleContext && !!styles$n[styleContext]]]),
1399
+ dangerouslySetInnerHTML: {
1400
+ __html: data
1401
+ }
1402
+ }));
1403
+ };
1404
+
1405
+ const generateGradient = (color, type) => {
1406
+ const steps = {
1407
+ mediaBlockBottom: [[0, 7], [0.08, 12], [0.16, 17], [0.22, 21], [0.32, 26], [0.42, 32], [0.52, 38], [0.62, 47], [0.72, 57], [0.82, 65], [1, 82]],
1408
+ mediaBlockTop: [[0.5, 0], [0, 97]]
1409
+ };
1410
+ const gradient = steps[type].map(i => `rgba(${color}, ${i[0]}) ${i[1]}%`);
1411
+ return `linear-gradient(-180deg, ${gradient})`;
1412
+ };
1413
+
1414
+ var styles$m = {"root":"SimpleTitle-module_root__YOzNn","mobile":"SimpleTitle-module_mobile__1QiJd","desktop":"SimpleTitle-module_desktop__ZF5Af"};
1415
+
1416
+ const SimpleTitle = ({
1417
+ block: {
1418
+ data: {
1419
+ first
1420
+ },
1421
+ only_on: onlyOn
1422
+ },
1423
+ styleContext
1424
+ }) => {
1425
+ let classNames = [[styles$m.root, true], [styles$m[onlyOn], true]];
1426
+ if (styleContext) {
1427
+ classNames = makeStyleContext(classNames, styleContext, styles$m);
1428
+ }
1429
+ return /*#__PURE__*/React.createElement("h1", {
1430
+ "data-testid": "simple-title",
1431
+ className: makeClassName(classNames)
1432
+ }, first);
1433
+ };
1434
+
1435
+ var styles$l = {"root":"RichTitle-module_root__U5XQu","slide":"RichTitle-module_slide__eU9Ob","game":"RichTitle-module_game__S1csb","podcastMaterial":"RichTitle-module_podcastMaterial__AulVF","half":"RichTitle-module_half__yBMby","featured":"RichTitle-module_featured__ULNQn","isInMediaBlock":"RichTitle-module_isInMediaBlock__2h6rl","isInBookRelated":"RichTitle-module_isInBookRelated__LcCPV","mobile":"RichTitle-module_mobile__W5L9E","desktop":"RichTitle-module_desktop__k0PkC"};
1436
+
1437
+ const RichTitle = ({
1438
+ block: {
1439
+ only_on: onlyOn,
1440
+ data: {
1441
+ featured,
1442
+ first,
1443
+ second,
1444
+ as: TagName = 'h1'
1445
+ }
1446
+ },
1447
+ styleContext
1448
+ }) => {
1449
+ let classNames = [[styles$l.root, true], [styles$l[onlyOn], true], [styles$l.featured, !!featured]];
1450
+ if (styleContext) {
1451
+ classNames = makeStyleContext(classNames, styleContext, styles$l);
1452
+ }
1453
+ return /*#__PURE__*/React.createElement(TagName, {
1454
+ "data-testid": "rich-title",
1455
+ className: makeClassName(classNames)
1456
+ }, first, second && /*#__PURE__*/React.createElement("span", null, " ", second));
1457
+ };
1458
+
1459
+ var styles$k = {"p":"SimpleBlock-module_p__7aRnT","h2":"SimpleBlock-module_h2__aWlMn","h3":"SimpleBlock-module_h3__uPh0-","h4":"SimpleBlock-module_h4__MxGXA","lead":"SimpleBlock-module_lead__NzEPT","lead_hr":"SimpleBlock-module_lead_hr__XN0rm","context_p":"SimpleBlock-module_context_p__Mdu1R","blockquote":"SimpleBlock-module_blockquote__nX-Ab","game":"SimpleBlock-module_game__uVeJJ","slide":"SimpleBlock-module_slide__MaaUF","dark":"SimpleBlock-module_dark__qtLhq","divider":"SimpleBlock-module_divider__-VXBu","isInIntro":"SimpleBlock-module_isInIntro__UOePf","center":"SimpleBlock-module_center__D1CsV","isInImportantLead":"SimpleBlock-module_isInImportantLead__qzKDo","podcastMaterial":"SimpleBlock-module_podcastMaterial__XEMjh","isInAnswer":"SimpleBlock-module_isInAnswer__Asx7d","mobile":"SimpleBlock-module_mobile__EVGYJ","desktop":"SimpleBlock-module_desktop__6ZH5e","isDark":"SimpleBlock-module_isDark__ehYKr"};
1460
+
1461
+ const SimpleBlock = ({
1462
+ block: {
1463
+ data,
1464
+ type,
1465
+ only_on: onlyOn
1466
+ },
1467
+ styleContext,
1468
+ id = null
1469
+ }) => {
1470
+ let TagName;
1471
+ let classNames = [[styles$k[type], !!type && !!styles$k[type]], [styles$k[onlyOn], true]];
1472
+ if (styleContext) {
1473
+ classNames = makeStyleContext(classNames, styleContext, styles$k);
1474
+ }
1475
+ switch (type) {
1476
+ case 'context_p':
1477
+ case 'lead':
1478
+ case 'note_caption':
1479
+ case 'note_credit':
1480
+ {
1481
+ TagName = 'p';
1482
+ break;
1483
+ }
1484
+ case 'divider':
1485
+ return /*#__PURE__*/React.createElement("hr", {
1486
+ className: makeClassName(classNames)
1487
+ });
1488
+ case 'lead_hr':
1489
+ {
1490
+ TagName = 'div';
1491
+ break;
1492
+ }
1493
+ default:
1494
+ TagName = type;
1495
+ }
1496
+ return /*#__PURE__*/React.createElement(TagName, {
1497
+ className: makeClassName(classNames),
1498
+ dangerouslySetInnerHTML: {
1499
+ __html: data
1500
+ },
1501
+ id: id
1502
+ });
1503
+ };
1504
+
1505
+ var styles$j = {"root":"ListBlock-module_root__dqomP","ol":"ListBlock-module_ol__1l6nP","ul":"ListBlock-module_ul__bgHlv","center":"ListBlock-module_center__bEBN-","isInImportantLead":"ListBlock-module_isInImportantLead__ewcD1","dark":"ListBlock-module_dark__NzpYz","mobile":"ListBlock-module_mobile__qEBsn","desktop":"ListBlock-module_desktop__HN0IU"};
1506
+
1507
+ const ListBlock = ({
1508
+ block: {
1509
+ type,
1510
+ data,
1511
+ only_on: onlyOn
1512
+ },
1513
+ styleContext
1514
+ }) => {
1515
+ const TagName = type;
1516
+ let classNames = [[styles$j.root, true], [styles$j[onlyOn], true], [styles$j[type], !!type && !!styles$j[type]]];
1517
+ if (styleContext) {
1518
+ classNames = makeStyleContext(classNames, styleContext, styles$j);
1519
+ }
1520
+ return /*#__PURE__*/React.createElement(TagName, {
1521
+ className: makeClassName(classNames),
1522
+ "data-testid": "list-block"
1523
+ }, data.map((item, index) => ( /*#__PURE__*/React.createElement("li", {
1524
+ key: index,
1525
+ dangerouslySetInnerHTML: {
1526
+ __html: item
1527
+ }
1528
+ }))));
1529
+ };
1530
+
1531
+ var styles$i = {"root":"RelatedBlock-module_root__cr1c-","header":"RelatedBlock-module_header__bfUJD","items":"RelatedBlock-module_items__rzzam","rich":"RelatedBlock-module_rich__1cWdn","first":"RelatedBlock-module_first__ZkcP5","simple":"RelatedBlock-module_simple__m22bj","center":"RelatedBlock-module_center__WVpIJ","isInSlideMaterial":"RelatedBlock-module_isInSlideMaterial__VumDw","mobile":"RelatedBlock-module_mobile__AScBA","desktop":"RelatedBlock-module_desktop__uMXUY"};
1532
+
1533
+ const RelatedBlock = ({
1534
+ block: {
1535
+ data: {
1536
+ title,
1537
+ related
1538
+ },
1539
+ only_on: onlyOn
1540
+ },
1541
+ styleContext
1542
+ }) => {
1543
+ let classNames = [[styles$i.root, true], [styles$i[onlyOn], true]];
1544
+ if (styleContext) {
1545
+ classNames = makeStyleContext(classNames, styleContext, styles$i);
1546
+ }
1547
+ return /*#__PURE__*/React.createElement("div", {
1548
+ "data-testid": "related-block",
1549
+ className: makeClassName(classNames)
1550
+ }, /*#__PURE__*/React.createElement("h3", {
1551
+ className: styles$i.header
1552
+ }, title), /*#__PURE__*/React.createElement("ul", {
1553
+ className: styles$i.items
1554
+ }, related.map((item, index) => ( /*#__PURE__*/React.createElement("li", {
1555
+ key: item.id || index,
1556
+ className: styles$i[item.layout]
1557
+ }, /*#__PURE__*/React.createElement(reactRouterDom.Link, {
1558
+ to: item.full_url || `/${item.url}`
1559
+ }, /*#__PURE__*/React.createElement("span", {
1560
+ className: styles$i.first
1561
+ }, item.title), item.second_title && ' ', item.second_title && /*#__PURE__*/React.createElement("span", null, item.second_title)))))));
1562
+ };
1563
+
1564
+ var styles$h = {"root":"SourceBlock-module_root__9dnI4","text":"SourceBlock-module_text__M5-uy","origin":"SourceBlock-module_origin__fyvxH","center":"SourceBlock-module_center__UOMwy","mobile":"SourceBlock-module_mobile__QVEyg","desktop":"SourceBlock-module_desktop__xdXWm","isDark":"SourceBlock-module_isDark__etwk1"};
1565
+
1566
+ const SourceBlock = ({
1567
+ block: {
1568
+ only_on: onlyOn,
1569
+ data: {
1570
+ quote,
1571
+ origin,
1572
+ url
1573
+ }
1574
+ },
1575
+ styleContext
1576
+ }) => {
1577
+ let classNames = [[styles$h.root, true], [styles$h[onlyOn], true]];
1578
+ if (styleContext) {
1579
+ classNames = makeStyleContext(classNames, styleContext, styles$h);
1580
+ }
1581
+ return /*#__PURE__*/React.createElement("blockquote", {
1582
+ "data-testid": "source-block",
1583
+ cite: url,
1584
+ className: makeClassName(classNames)
1585
+ }, /*#__PURE__*/React.createElement("a", {
1586
+ className: styles$h.text,
1587
+ href: url,
1588
+ target: "_blank",
1589
+ rel: "noopener noreferrer"
1590
+ }, quote.map((item, index) => ( /*#__PURE__*/React.createElement("p", {
1591
+ key: index,
1592
+ dangerouslySetInnerHTML: {
1593
+ __html: item.data
1594
+ }
1595
+ }))), /*#__PURE__*/React.createElement("footer", null, /*#__PURE__*/React.createElement("cite", {
1596
+ className: styles$h.origin
1597
+ }, origin))));
1598
+ };
1599
+
1600
+ var styles$g = {"root":"SensitiveBlock-module_root__1Nl9-","container":"SensitiveBlock-module_container__GE2tW","overlay":"SensitiveBlock-module_overlay__tEsK8","content":"SensitiveBlock-module_content__RYbdd","button":"SensitiveBlock-module_button__LGEEM","default":"SensitiveBlock-module_default__pkWhC","full":"SensitiveBlock-module_full__hlH41","media":"SensitiveBlock-module_media__nuL1S","super_full":"SensitiveBlock-module_super_full__C7UyP","visible":"SensitiveBlock-module_visible__bXhYO","isInCard":"SensitiveBlock-module_isInCard__uANYL","isInSlide":"SensitiveBlock-module_isInSlide__ZAVUU"};
1601
+
1602
+ const SensitiveBlock = ({
1603
+ block,
1604
+ block: {
1605
+ cc,
1606
+ caption,
1607
+ credit,
1608
+ blurred_image: blurredImage
1609
+ },
1610
+ block: {
1611
+ item: {
1612
+ data: {
1613
+ display
1614
+ }
1615
+ }
1616
+ },
1617
+ styleContext
1618
+ }) => {
1619
+ const [visible, isVisible] = React.useState(false);
1620
+ const handleClick = () => {
1621
+ isVisible(true);
1622
+ };
1623
+ let classNames = [[styles$g.root, true], [styles$g.visible, visible], [styles$g[display], display && styles$g[display]]];
1624
+ let context = ['isInSensitiveBlock'];
1625
+ if (styleContext) {
1626
+ classNames = makeStyleContext(classNames, styleContext, styles$g);
1627
+ context = [...styleContext, 'isInSensitiveBlock'];
1628
+ }
1629
+ return /*#__PURE__*/React.createElement("div", {
1630
+ "data-testid": "sensitive-block",
1631
+ className: makeClassName(classNames)
1632
+ }, /*#__PURE__*/React.createElement("div", {
1633
+ className: styles$g.container
1634
+ }, /*#__PURE__*/React.createElement("div", {
1635
+ className: styles$g.overlay,
1636
+ style: {
1637
+ backgroundImage: `url(${blurredImage})`
1638
+ }
1639
+ }, /*#__PURE__*/React.createElement("div", {
1640
+ className: styles$g.content
1641
+ }, /*#__PURE__*/React.createElement("p", {
1642
+ dangerouslySetInnerHTML: {
1643
+ __html: block.title
1644
+ }
1645
+ }), /*#__PURE__*/React.createElement("div", {
1646
+ className: styles$g.button
1647
+ }, /*#__PURE__*/React.createElement(Button, {
1648
+ onClick: () => handleClick(),
1649
+ theme: "light"
1650
+ }, block.button.text)))), /*#__PURE__*/React.createElement("div", {
1651
+ className: styles$g.media
1652
+ }, /*#__PURE__*/React.createElement(EmbedBlockContainer, {
1653
+ block: block.item,
1654
+ styleContext: context
1655
+ }))), cc && ( /*#__PURE__*/React.createElement("figcaption", {
1656
+ className: styles$g.figcaption
1657
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
1658
+ credit: credit,
1659
+ caption: caption,
1660
+ styleContext: styleContext
1661
+ }))));
1662
+ };
1663
+
1664
+ var styles$f = {"root":"GroupedBlock-module_root__MQQin","hasFigcaption":"GroupedBlock-module_hasFigcaption__Y05ed","item":"GroupedBlock-module_item__-InqF","items":"GroupedBlock-module_items__8X4js","figcaption":"GroupedBlock-module_figcaption__OE5-u","default":"GroupedBlock-module_default__Tha8f","full":"GroupedBlock-module_full__SNwyE","super_full":"GroupedBlock-module_super_full__HTA9D","mobile":"GroupedBlock-module_mobile__xqMw5","desktop":"GroupedBlock-module_desktop__Oobdp"};
1665
+
1666
+ const GroupedBlock = ({
1667
+ block,
1668
+ block: {
1669
+ only_on: onlyOn
1670
+ },
1671
+ styleContext
1672
+ }) => {
1673
+ const maxHeight = Math.min(...block.data.map(item => item.data && item.data.height || item.item && item.item.data.height));
1674
+ const normalizedBoxesWidth = block.data.map(item => {
1675
+ const width = item.data && item.data.width || item.item && item.item.data.heigh;
1676
+ const height = item.data && item.data.height || item.item && item.item.data.heigh;
1677
+ return width / (height / maxHeight);
1678
+ });
1679
+ const sumWidth = normalizedBoxesWidth.reduce((sum, x) => sum + x);
1680
+ let classNames = [[styles$f.root, true], [styles$f[onlyOn], true], [styles$f.hasFigcaption, block.cc === 'default'], [styles$f[block.display], !!block.display && styles$f[block.display]]];
1681
+ if (styleContext) {
1682
+ classNames = makeStyleContext(classNames, styleContext, styles$f);
1683
+ }
1684
+ return /*#__PURE__*/React.createElement("div", {
1685
+ "data-testid": "grouped-block",
1686
+ className: makeClassName(classNames)
1687
+ }, /*#__PURE__*/React.createElement("div", {
1688
+ className: styles$f.items
1689
+ }, block.data.map((item, index) => {
1690
+ const percentWidth = normalizedBoxesWidth[index] / sumWidth * 100;
1691
+ return /*#__PURE__*/React.createElement("div", {
1692
+ className: styles$f.item,
1693
+ key: item.id,
1694
+ style: {
1695
+ width: `${percentWidth}%`
1696
+ }
1697
+ }, item.type === 'sensitive' ? ( /*#__PURE__*/React.createElement(SensitiveBlock, {
1698
+ block: item,
1699
+ styleContext: ['isInGroupedBlock']
1700
+ })) : ( /*#__PURE__*/React.createElement(EmbedBlockContainer, {
1701
+ block: item,
1702
+ styleContext: ['isInGroupedBlock']
1703
+ })));
1704
+ })), block.cc && ( /*#__PURE__*/React.createElement("figcaption", {
1705
+ className: styles$f.figcaption
1706
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
1707
+ credit: block.credit,
1708
+ caption: block.caption,
1709
+ styleContext: styleContext
1710
+ }))));
1711
+ };
1712
+
1713
+ var styles$e = {"root":"MetaItem-module_root__sRbrZ","hasBullets":"MetaItem-module_hasBullets__b1eW9","hasSource":"MetaItem-module_hasSource__35olm","listened":"MetaItem-module_listened__XZWFQ","read":"MetaItem-module_read__O3cUz","datetime":"MetaItem-module_datetime__--O8c"};
1714
+
1715
+ const MetaItem = ({
1716
+ hasSource,
1717
+ type,
1718
+ children,
1719
+ bullets
1720
+ }) => {
1721
+ const classNames = [[styles$e.root, true], [styles$e[type], !!type && !!styles$e[type]], [styles$e.hasSource, !!hasSource], [styles$e.hasBullets, !!bullets]];
1722
+ return /*#__PURE__*/React.createElement("div", {
1723
+ "data-testid": "meta-item",
1724
+ className: makeClassName(classNames)
1725
+ }, children);
1726
+ };
1727
+
1728
+ var styles$d = {"root":"MetaItemLive-module_root__XfQiW","gold":"MetaItemLive-module_gold__f1UOy","frame":"MetaItemLive-module_frame__FHByQ","liveMiddle":"MetaItemLive-module_liveMiddle__SX4Gs","liveFirstWave":"MetaItemLive-module_liveFirstWave__QqstP","liveSecondWave":"MetaItemLive-module_liveSecondWave__hlbpt"};
1729
+
1730
+ const MetaItemLive = ({
1731
+ theme = 'gold'
1732
+ }) => {
1733
+ const classNames = [[styles$d.root, true], [styles$d[theme], !!theme && styles$d[theme]]];
1734
+ return /*#__PURE__*/React.createElement("div", {
1735
+ "data-testid": "meta-item-live",
1736
+ "data-meta": "live",
1737
+ className: makeClassName(classNames)
1738
+ }, /*#__PURE__*/React.createElement("div", {
1739
+ className: styles$d.frame
1740
+ }));
1741
+ };
1742
+
1743
+ const pluralize = (number, one, two, five) => {
1744
+ let n = Math.abs(number);
1745
+ n %= 100;
1746
+ if (n >= 5 && n <= 20) {
1747
+ return five;
1748
+ }
1749
+ n %= 10;
1750
+ if (n === 1) {
1751
+ return one;
1752
+ }
1753
+ if (n >= 2 && n <= 4) {
1754
+ return two;
1755
+ }
1756
+ return five;
1757
+ };
1758
+
1759
+ var styles$c = {"root":"DocumentItemsCount-module_root__u4M3y","items":"DocumentItemsCount-module_items__OE-hf"};
1760
+
1761
+ const DocumentItemsCount = ({
1762
+ type,
1763
+ lang = 'ru',
1764
+ items,
1765
+ children
1766
+ }) => {
1767
+ const i18n = {
1768
+ ru: {
1769
+ card: {
1770
+ one: 'карточка',
1771
+ two: 'карточки',
1772
+ five: 'карточек'
1773
+ },
1774
+ podcast: {
1775
+ one: 'эпизод',
1776
+ two: 'эпизода',
1777
+ five: 'эпизодов'
1778
+ }
1779
+ },
1780
+ en: {
1781
+ card: {
1782
+ one: 'card',
1783
+ two: 'cards',
1784
+ five: 'cards'
1785
+ },
1786
+ podcast: {
1787
+ one: 'episode',
1788
+ two: 'episodes',
1789
+ five: 'episodes'
1790
+ }
1791
+ }
1792
+ };
1793
+ const itemsCount = `${items} ${pluralize(items, i18n[lang][type].one, i18n[lang][type].two, i18n[lang][type].five)}`;
1794
+ return /*#__PURE__*/React.createElement("div", {
1795
+ "data-testid": "document-items-count",
1796
+ className: styles$c.root
1797
+ }, children, /*#__PURE__*/React.createElement("span", {
1798
+ className: styles$c.items
1799
+ }, itemsCount));
1800
+ };
1801
+
1802
+ const MetaContainer = ({
1803
+ lang,
1804
+ block,
1805
+ isRead,
1806
+ isListened,
1807
+ bookmarkAction,
1808
+ isInBookmarks,
1809
+ block: {
1810
+ data: {
1811
+ components,
1812
+ theme
1813
+ }
1814
+ },
1815
+ styleContext
1816
+ }) => {
1817
+ const themeColor = styleContext && styleContext.indexOf('dark') !== -1 ? 'light' : 'unset';
1818
+ const isPodcast = styleContext && styleContext.indexOf('podcast') !== -1;
1819
+ const isSlides = styleContext && styleContext.indexOf('slide') !== -1;
1820
+ let context = [];
1821
+ if (styleContext && Array.isArray(styleContext)) {
1822
+ context = styleContext.filter(item => {
1823
+ return item !== 'dark';
1824
+ });
1825
+ }
1826
+ const hasSource = !!components.find(item => item.type === 'source_name');
1827
+ return /*#__PURE__*/React.createElement(Meta, {
1828
+ styleContext: context,
1829
+ theme: theme || themeColor,
1830
+ onlyOn: block.only_on,
1831
+ hasSource: hasSource
1832
+ }, components.map(component => {
1833
+ switch (component.type) {
1834
+ case 'source_name':
1835
+ {
1836
+ return /*#__PURE__*/React.createElement(MetaItem, {
1837
+ hasSource: hasSource,
1838
+ bullets: true,
1839
+ key: component.id
1840
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, lang === 'ru' ? 'Источник: ' : 'Source: ', component.url && ( /*#__PURE__*/React.createElement("a", {
1841
+ href: component.url,
1842
+ rel: "noopener noreferrer",
1843
+ target: "_blank"
1844
+ }, component.text)), !component.url && component.text));
1845
+ }
1846
+ case 'duration':
1847
+ {
1848
+ return /*#__PURE__*/React.createElement(MetaItem, {
1849
+ hasSource: hasSource,
1850
+ bullets: true,
1851
+ key: component.id
1852
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SvgSymbol, {
1853
+ icon: "podcast",
1854
+ size: "small"
1855
+ }), component.text));
1856
+ }
1857
+ case 'datetime':
1858
+ {
1859
+ const format = component.format && toCamel(component.format) || 'date';
1860
+ return /*#__PURE__*/React.createElement(MetaItem, {
1861
+ hasSource: hasSource,
1862
+ bullets: true,
1863
+ key: component.id,
1864
+ type: "datetime"
1865
+ }, /*#__PURE__*/React.createElement(Timestamp, {
1866
+ publishedAt: component.datetime,
1867
+ type: format || 'date',
1868
+ locale: lang
1869
+ }));
1870
+ }
1871
+ case 'items_count':
1872
+ {
1873
+ return /*#__PURE__*/React.createElement(MetaItem, {
1874
+ hasSource: hasSource,
1875
+ bullets: true,
1876
+ key: component.id
1877
+ }, /*#__PURE__*/React.createElement(DocumentItemsCount, {
1878
+ items: component.count,
1879
+ type: isPodcast ? 'podcast' : 'card',
1880
+ lang: lang
1881
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1882
+ icon: "card",
1883
+ size: "unset"
1884
+ })));
1885
+ }
1886
+ case 'broadcast_active':
1887
+ {
1888
+ return /*#__PURE__*/React.createElement(MetaItem, {
1889
+ hasSource: hasSource,
1890
+ bullets: true,
1891
+ key: component.id
1892
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MetaItemLive, null), " \u041F\u0440\u044F\u043C\u043E\u0439 \u044D\u0444\u0438\u0440"));
1893
+ }
1894
+ case 'broadcast':
1895
+ {
1896
+ return /*#__PURE__*/React.createElement(MetaItem, {
1897
+ hasSource: hasSource,
1898
+ bullets: true,
1899
+ key: component.id
1900
+ }, /*#__PURE__*/React.createElement(React.Fragment, null, component.with_icon && /*#__PURE__*/React.createElement(MetaItemLive, null), component.label));
1901
+ }
1902
+ case 'string':
1903
+ {
1904
+ return /*#__PURE__*/React.createElement(MetaItem, {
1905
+ hasSource: hasSource,
1906
+ bullets: true,
1907
+ key: component.id
1908
+ }, component.text);
1909
+ }
1910
+ default:
1911
+ {
1912
+ return null;
1913
+ }
1914
+ }
1915
+ }), (isRead || isListened) && ( /*#__PURE__*/React.createElement(MetaItem, {
1916
+ hasSource: hasSource,
1917
+ bullets: true,
1918
+ type: isListened ? 'listened' : 'read'
1919
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
1920
+ icon: isListened ? 'listened' : 'read',
1921
+ size: "unset"
1922
+ }))), isSlides && lang === 'ru' && ( /*#__PURE__*/React.createElement("div", {
1923
+ className: styles$s.bookmark
1924
+ }, /*#__PURE__*/React.createElement(BookmarkButton, {
1925
+ isInBookmarks: isInBookmarks,
1926
+ onClick: () => bookmarkAction('bookmark', 'top')
1927
+ }))));
1928
+ };
1929
+
1930
+ var styles$b = {"root":"DonatesTeaser-module_root__XQCVy","main":"DonatesTeaser-module_main__eN9kd","title":"DonatesTeaser-module_title__9umo1","text":"DonatesTeaser-module_text__s6tyf","cta":"DonatesTeaser-module_cta__-50aB","center":"DonatesTeaser-module_center__gxLvW","isInCard":"DonatesTeaser-module_isInCard__vaUhd","isInSlide":"DonatesTeaser-module_isInSlide__Dh4NH","ru":"DonatesTeaser-module_ru__y-PlJ","en":"DonatesTeaser-module_en__0Iisr"};
1931
+
1932
+ const DonatesTeaser = ({
1933
+ styleContext,
1934
+ lang = 'ru'
1935
+ }) => {
1936
+ let classNames = [[styles$b.root, true], [styles$b[lang], styles$b[lang]]];
1937
+ if (styleContext) {
1938
+ classNames = makeStyleContext(classNames, styleContext, styles$b);
1939
+ }
1940
+ const data = {
1941
+ ru: {
1942
+ title: '«Медуза». Работаем 24/7. И&nbsp;только&nbsp;в&nbsp;интересах читателей',
1943
+ subtitle: 'Нам срочно нужна ваша поддержка',
1944
+ button: 'Хочу помочь',
1945
+ href: 'https://support.meduza.io/'
1946
+ },
1947
+ en: {
1948
+ title: 'Meduza, working 24/7, always&nbsp;for our readers',
1949
+ subtitle: 'We&nbsp;need&nbsp;your&nbsp;help like never&nbsp;before',
1950
+ button: 'Okay!',
1951
+ href: 'https://support.meduza.io/en'
1952
+ }
1953
+ };
1954
+ return /*#__PURE__*/React.createElement("div", {
1955
+ "data-testid": "donates-teaser",
1956
+ className: makeClassName(classNames)
1957
+ }, /*#__PURE__*/React.createElement("div", {
1958
+ className: styles$b.main
1959
+ }, /*#__PURE__*/React.createElement("h3", {
1960
+ className: styles$b.title
1961
+ }, /*#__PURE__*/React.createElement("span", {
1962
+ dangerouslySetInnerHTML: {
1963
+ __html: data[lang].title
1964
+ }
1965
+ }), ` `, /*#__PURE__*/React.createElement("span", {
1966
+ className: styles$b.text,
1967
+ dangerouslySetInnerHTML: {
1968
+ __html: data[lang].subtitle
1969
+ }
1970
+ }))), /*#__PURE__*/React.createElement("div", {
1971
+ className: styles$b.cta
1972
+ }, /*#__PURE__*/React.createElement("a", {
1973
+ href: data[lang].href,
1974
+ target: "_blank",
1975
+ rel: "noreferrer"
1976
+ }, /*#__PURE__*/React.createElement("span", null, data[lang].button))));
1977
+ };
1978
+
1979
+ var styles$a = {"root":"AnnouncementInText-module_root__C4-Oo","body":"AnnouncementInText-module_body__lZy-L","title":"AnnouncementInText-module_title__cb6i1","footer":"AnnouncementInText-module_footer__jRk9p","button":"AnnouncementInText-module_button__JuT-E","link":"AnnouncementInText-module_link__C0YxL","center":"AnnouncementInText-module_center__1DJjd","isInCard":"AnnouncementInText-module_isInCard__jIqpa","isInSlide":"AnnouncementInText-module_isInSlide__BWO-A","ru":"AnnouncementInText-module_ru__QHQad","en":"AnnouncementInText-module_en__r0PvM"};
1980
+
1981
+ const AnnouncementInText = ({
1982
+ styleContext,
1983
+ lang = 'ru'
1984
+ }) => {
1985
+ let classNames = [[styles$a.root, true], [styles$a[lang], styles$a[lang]]];
1986
+ if (styleContext) {
1987
+ classNames = makeStyleContext(classNames, styleContext, styles$a);
1988
+ }
1989
+ const data = {
1990
+ ru: {
1991
+ title: '&laquo;Медуза&raquo; заблокирована в&nbsp;России. Мы&nbsp;были к&nbsp;этому готовы&nbsp;&mdash; и&nbsp;продолжаем работать. Несмотря&nbsp;ни&nbsp;на&nbsp;что',
1992
+ text: '<p>Нам нужна ваша помощь как никогда. Прямо сейчас. Дальше всем нам будет еще труднее. Мы&nbsp;независимое издание и&nbsp;работаем только в&nbsp;интересах читателей.</p>',
1993
+ button: 'Хочу помочь',
1994
+ href: 'https://mdza.io/yiNxPZ7Bs-k'
1995
+ },
1996
+ en: {
1997
+ title: 'Meduza has been blocked in Russia. We&nbsp;were ready for this and our work continues, no matter what, but we need your support like never before. ',
1998
+ text: '<p>We need it now. Tomorrow could be too late. We are an independent publication, and we work only in the interests of our readers. Many&nbsp;of&nbsp;our&nbsp;readers in Russia can no longer contribute, so we turn to you, our audience around the world.</p>',
1999
+ button: 'I want to help',
2000
+ href: 'https://support.meduza.io/en'
2001
+ }
2002
+ };
2003
+ const localeData = data[lang];
2004
+ return /*#__PURE__*/React.createElement("div", {
2005
+ "data-testid": "announcement-in-text",
2006
+ className: makeClassName(classNames)
2007
+ }, /*#__PURE__*/React.createElement("div", {
2008
+ className: styles$a.body
2009
+ }, /*#__PURE__*/React.createElement("h3", {
2010
+ className: styles$a.title,
2011
+ dangerouslySetInnerHTML: {
2012
+ __html: localeData.title
2013
+ }
2014
+ }), /*#__PURE__*/React.createElement("div", {
2015
+ dangerouslySetInnerHTML: {
2016
+ __html: localeData.text
2017
+ }
2018
+ })), /*#__PURE__*/React.createElement("div", {
2019
+ className: styles$a.footer
2020
+ }, /*#__PURE__*/React.createElement("a", {
2021
+ className: styles$a.link,
2022
+ href: localeData.href,
2023
+ target: "_blank",
2024
+ rel: "noreferrer"
2025
+ }, /*#__PURE__*/React.createElement("span", null, localeData.button)), /*#__PURE__*/React.createElement("span", {
2026
+ className: styles$a.button
2027
+ }, /*#__PURE__*/React.createElement("span", null, localeData.button))));
2028
+ };
2029
+
2030
+ var styles$9 = {"root":"VersesBlock-module_root__CrgSZ","ol":"VersesBlock-module_ol__ToXjg","ul":"VersesBlock-module_ul__wfaQD","center":"VersesBlock-module_center__E1IS-","isInImportantLead":"VersesBlock-module_isInImportantLead__pdugk","dark":"VersesBlock-module_dark__FwaPS","mobile":"VersesBlock-module_mobile__EcHvz","desktop":"VersesBlock-module_desktop__quKfJ"};
2031
+
2032
+ const VersesBlock = ({
2033
+ block: {
2034
+ type,
2035
+ data,
2036
+ only_on: onlyOn
2037
+ },
2038
+ styleContext
2039
+ }) => {
2040
+ let classNames = [[styles$9.root, true], [styles$9[onlyOn], true], [styles$9[type], !!type && !!styles$9[type]]];
2041
+ if (styleContext) {
2042
+ classNames = makeStyleContext(classNames, styleContext, styles$9);
2043
+ }
2044
+ return /*#__PURE__*/React.createElement("ul", {
2045
+ className: makeClassName(classNames),
2046
+ "data-testid": "verses-block"
2047
+ }, data.map((item, index) => ( /*#__PURE__*/React.createElement("li", {
2048
+ key: index,
2049
+ dangerouslySetInnerHTML: {
2050
+ __html: item
2051
+ }
2052
+ }))));
2053
+ };
2054
+
2055
+ const RenderBlocks = ({
2056
+ block,
2057
+ styleContext,
2058
+ lang,
2059
+ isRead,
2060
+ isListened,
2061
+ bookmarkAction,
2062
+ isInBookmarks
2063
+ }) => {
2064
+ switch (block.type) {
2065
+ case 'tag':
2066
+ {
2067
+ return /*#__PURE__*/React.createElement(Tag, {
2068
+ size: "large",
2069
+ onlyOn: block.only_on,
2070
+ theme: block.data.theme,
2071
+ styleContext: styleContext
2072
+ }, block.data.text);
2073
+ }
2074
+ case 'simple_title':
2075
+ {
2076
+ return /*#__PURE__*/React.createElement(SimpleTitle, {
2077
+ block: block,
2078
+ styleContext: styleContext
2079
+ });
2080
+ }
2081
+ case 'rich_title':
2082
+ {
2083
+ return /*#__PURE__*/React.createElement(RichTitle, {
2084
+ block: block,
2085
+ styleContext: styleContext
2086
+ });
2087
+ }
2088
+ case 'meta':
2089
+ {
2090
+ return /*#__PURE__*/React.createElement(MetaContainer, {
2091
+ block: block,
2092
+ lang: block.data.lang,
2093
+ styleContext: styleContext,
2094
+ isRead: isRead,
2095
+ isListened: isListened,
2096
+ isInBookmarks: isInBookmarks,
2097
+ bookmarkAction: bookmarkAction
2098
+ });
2099
+ }
2100
+ case 'blockquote':
2101
+ case 'p':
2102
+ case 'context_p':
2103
+ case 'divider':
2104
+ case 'lead':
2105
+ case 'lead_hr':
2106
+ {
2107
+ return /*#__PURE__*/React.createElement(SimpleBlock, {
2108
+ block: block,
2109
+ styleContext: styleContext
2110
+ });
2111
+ }
2112
+ case 'h1':
2113
+ case 'h2':
2114
+ case 'h3':
2115
+ case 'h4':
2116
+ {
2117
+ return /*#__PURE__*/React.createElement(SimpleBlock, {
2118
+ block: block,
2119
+ styleContext: styleContext,
2120
+ id: block.id
2121
+ });
2122
+ }
2123
+ case 'quote':
2124
+ return /*#__PURE__*/React.createElement(QuoteBlock, {
2125
+ block: block,
2126
+ styleContext: styleContext
2127
+ });
2128
+ case 'ol':
2129
+ case 'ul':
2130
+ {
2131
+ return /*#__PURE__*/React.createElement(ListBlock, {
2132
+ block: block,
2133
+ styleContext: styleContext
2134
+ });
2135
+ }
2136
+ case 'verses':
2137
+ {
2138
+ return /*#__PURE__*/React.createElement(VersesBlock, {
2139
+ block: block,
2140
+ styleContext: styleContext
2141
+ });
2142
+ }
2143
+ case 'chapter-subtitle':
2144
+ {
2145
+ return /*#__PURE__*/React.createElement(ChapterBlock, {
2146
+ block: block,
2147
+ styleContext: styleContext,
2148
+ id: block.id
2149
+ });
2150
+ }
2151
+ case 'card_title':
2152
+ {
2153
+ return /*#__PURE__*/React.createElement(CardTitle, {
2154
+ block: block,
2155
+ styleContext: styleContext
2156
+ });
2157
+ }
2158
+ case 'related':
2159
+ {
2160
+ return /*#__PURE__*/React.createElement(RelatedBlock, {
2161
+ block: block,
2162
+ styleContext: styleContext
2163
+ });
2164
+ }
2165
+ case 'source':
2166
+ return /*#__PURE__*/React.createElement(SourceBlock, {
2167
+ block: block,
2168
+ styleContext: styleContext
2169
+ });
2170
+ case 'table':
2171
+ return /*#__PURE__*/React.createElement(Table, {
2172
+ block: block,
2173
+ styleContext: styleContext
2174
+ });
2175
+ case 'sensitive':
2176
+ return /*#__PURE__*/React.createElement(SensitiveBlock, {
2177
+ block: block,
2178
+ styleContext: styleContext
2179
+ });
2180
+ case 'embed':
2181
+ case 'embed_code':
2182
+ case 'game_embed':
2183
+ case 'image':
2184
+ case 'dots_on_image':
2185
+ case 'gif':
2186
+ return /*#__PURE__*/React.createElement(EmbedBlockContainer, {
2187
+ block: block,
2188
+ styleContext: styleContext,
2189
+ lang: lang
2190
+ });
2191
+ case 'grouped':
2192
+ return /*#__PURE__*/React.createElement(GroupedBlock, {
2193
+ block: block,
2194
+ styleContext: styleContext
2195
+ });
2196
+ case 'donation':
2197
+ return /*#__PURE__*/React.createElement(DonatesTeaser, {
2198
+ styleContext: styleContext,
2199
+ lang: lang
2200
+ });
2201
+ case 'material_note':
2202
+ return /*#__PURE__*/React.createElement(MaterialNote, {
2203
+ block: block,
2204
+ styleContext: styleContext
2205
+ });
2206
+ case 'announcement_in_text':
2207
+ return /*#__PURE__*/React.createElement(AnnouncementInText, {
2208
+ styleContext: styleContext,
2209
+ lang: lang
2210
+ });
2211
+ default:
2212
+ {
2213
+ return null;
2214
+ }
2215
+ }
2216
+ };
2217
+
2218
+ var styles$8 = {"root":"Cover-module_root__3pscq","body":"Cover-module_body__eJpUI","image":"Cover-module_image__frrrH","rich":"Cover-module_rich__YcxWa","dark":"Cover-module_dark__cRucL","light":"Cover-module_light__la-sk","control":"Cover-module_control__WP0G3","isInDynamicBlock":"Cover-module_isInDynamicBlock__qO-yt","mobile":"Cover-module_mobile__aotep","desktop":"Cover-module_desktop__dfbC-"};
2219
+
2220
+ const Cover = ({
2221
+ block: {
2222
+ only_on: onlyOn,
2223
+ data: {
2224
+ blocks,
2225
+ cover: {
2226
+ credit,
2227
+ caption,
2228
+ urls,
2229
+ mobile_ratio: mobileRatio,
2230
+ gradients,
2231
+ cc
2232
+ }
2233
+ }
2234
+ },
2235
+ styleContext
2236
+ }) => {
2237
+ const [isPopoverShown, setIsPopoverShown] = React.useState(false);
2238
+ const style = {};
2239
+ let classNames = [[styles$8.root, true], [styles$8[onlyOn], !!onlyOn && !!styles$8[onlyOn]]];
2240
+ if (styleContext) {
2241
+ classNames = makeStyleContext(classNames, styleContext, styles$8);
2242
+ }
2243
+ if (gradients) {
2244
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2245
+ classNames = makeStyleContext(classNames, theme, styles$8);
2246
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2247
+ }
2248
+ const renderCC = context => ( /*#__PURE__*/React.createElement(MediaCaption, {
2249
+ credit: credit,
2250
+ caption: caption,
2251
+ styleContext: context || styleContext
2252
+ }));
2253
+ return /*#__PURE__*/React.createElement("div", {
2254
+ "data-testid": "cover",
2255
+ className: makeClassName(classNames)
2256
+ }, /*#__PURE__*/React.createElement("div", {
2257
+ className: styles$8.image
2258
+ }, /*#__PURE__*/React.createElement(Image, {
2259
+ optimized: urls,
2260
+ ratio: mobileRatio,
2261
+ display: "narrow"
2262
+ })), /*#__PURE__*/React.createElement("div", {
2263
+ className: styles$8.body,
2264
+ style: style
2265
+ }, blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2266
+ key: item.id,
2267
+ block: item,
2268
+ styleContext: styleContext
2269
+ })))), cc === 'button' && ( /*#__PURE__*/React.createElement("button", {
2270
+ className: styles$8.control,
2271
+ type: "button",
2272
+ "aria-label": "Open",
2273
+ onClick: () => {
2274
+ setIsPopoverShown(!isPopoverShown);
2275
+ }
2276
+ })), cc === 'button' && isPopoverShown && ( /*#__PURE__*/React.createElement(Popover, {
2277
+ onClose: () => {
2278
+ setIsPopoverShown(false);
2279
+ }
2280
+ }, renderCC('isInPopover'))));
2281
+ };
2282
+
2283
+ var styles$7 = {"root":"HalfBlock-module_root__EXQbz","main":"HalfBlock-module_main__eIcRo","body":"HalfBlock-module_body__HPhGj","footer":"HalfBlock-module_footer__TFfCQ","image":"HalfBlock-module_image__XWLbK","mobile":"HalfBlock-module_mobile__uGGpm","desktop":"HalfBlock-module_desktop__p-hAq"};
2284
+
2285
+ const HalfBlock = ({
2286
+ block: {
2287
+ only_on: onlyOn,
2288
+ data,
2289
+ data: {
2290
+ cover: {
2291
+ optimized,
2292
+ ratio,
2293
+ credit,
2294
+ caption
2295
+ }
2296
+ }
2297
+ },
2298
+ styleContext
2299
+ }) => {
2300
+ let classNames = [[styles$7.root, true], [styles$7[onlyOn], true]];
2301
+ if (styleContext) {
2302
+ classNames = makeStyleContext(classNames, styleContext, styles$7);
2303
+ }
2304
+ return /*#__PURE__*/React.createElement("div", {
2305
+ "data-testid": "half-block",
2306
+ className: makeClassName(classNames)
2307
+ }, /*#__PURE__*/React.createElement("div", {
2308
+ className: styles$7.main
2309
+ }, /*#__PURE__*/React.createElement("div", {
2310
+ className: styles$7.image
2311
+ }, /*#__PURE__*/React.createElement(Image, {
2312
+ optimized: optimized,
2313
+ ratio: ratio,
2314
+ display: "super_full"
2315
+ })), /*#__PURE__*/React.createElement("div", {
2316
+ className: styles$7.body
2317
+ }, data.blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2318
+ key: item.id,
2319
+ block: item,
2320
+ styleContext: ['rich']
2321
+ }))))), /*#__PURE__*/React.createElement("div", {
2322
+ className: styles$7.footer
2323
+ }, /*#__PURE__*/React.createElement(MediaCaption, {
2324
+ credit: credit,
2325
+ caption: caption,
2326
+ styleContext: styleContext
2327
+ })));
2328
+ };
2329
+
2330
+ var styles$6 = {"root":"ImportantLead-module_root__-rnt6","slide":"ImportantLead-module_slide__zcovu","mobile":"ImportantLead-module_mobile__msInp","desktop":"ImportantLead-module_desktop__ELC2-"};
2331
+
2332
+ const ImportantLead = ({
2333
+ block: {
2334
+ only_on: onlyOn,
2335
+ data
2336
+ },
2337
+ styleContext
2338
+ }) => {
2339
+ let classNames = [[styles$6.root, true], [styles$6[onlyOn], !!onlyOn]];
2340
+ if (styleContext) {
2341
+ classNames = makeStyleContext(classNames, styleContext, styles$6);
2342
+ }
2343
+ return /*#__PURE__*/React.createElement("div", {
2344
+ "data-testid": "important-lead",
2345
+ className: makeClassName(classNames)
2346
+ }, data.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2347
+ key: item.id,
2348
+ block: item,
2349
+ styleContext: "isInImportantLead"
2350
+ }))));
2351
+ };
2352
+
2353
+ var styles$5 = {"root":"Spoiler-module_root__fAbb9","header":"Spoiler-module_header__iEKsQ","body":"Spoiler-module_body__jjqIn","spoiled":"Spoiler-module_spoiled__ENI93","footer":"Spoiler-module_footer__g21Zn","spoilerSticky":"Spoiler-module_spoilerSticky__YTiyF","spoilerStickyBg":"Spoiler-module_spoilerStickyBg__tmDnG","center":"Spoiler-module_center__0XCWo","full":"Spoiler-module_full__FtKDT","default":"Spoiler-module_default__wvlKw","mobile":"Spoiler-module_mobile__PWCMW","desktop":"Spoiler-module_desktop__qTakd"};
2354
+
2355
+ const Spoiler = ({
2356
+ block: {
2357
+ display,
2358
+ button,
2359
+ only_on: onlyOn,
2360
+ btn_title: buttonTitle,
2361
+ title,
2362
+ blocks
2363
+ },
2364
+ styleContext
2365
+ }) => {
2366
+ const [spoiled, setSpoiled] = React.useState(false);
2367
+ const ref = React.useRef(null);
2368
+ const handleButtonClick = () => {
2369
+ setSpoiled(!spoiled);
2370
+ if (spoiled) {
2371
+ postMessage('', 'closeSpoiler', 'click');
2372
+ const rect = ref.current.getBoundingClientRect();
2373
+ if (rect.top < 0) {
2374
+ ref.current.scrollIntoView({
2375
+ behavior: 'smooth'
2376
+ });
2377
+ }
2378
+ } else {
2379
+ postMessage('', 'openSpoiler', 'click');
2380
+ }
2381
+ };
2382
+ let classNames = [[styles$5.root, true], [styles$5[onlyOn], !!onlyOn], [styles$5[display], !!display && styles$5[display]], [[styles$5.spoiled], !!spoiled]];
2383
+ const context = ['center'];
2384
+ if (styleContext) {
2385
+ context.concat(styleContext);
2386
+ classNames = makeStyleContext(classNames, styleContext, styles$5);
2387
+ }
2388
+ const buttonCollapse = button ? button.collapse : 'Свернуть';
2389
+ const buttonExpande = button ? button.expand : buttonTitle;
2390
+ return /*#__PURE__*/React.createElement("div", {
2391
+ ref: ref,
2392
+ className: makeClassName(classNames),
2393
+ "data-testid": "spoiler"
2394
+ }, /*#__PURE__*/React.createElement("div", {
2395
+ className: styles$5.header
2396
+ }, title && /*#__PURE__*/React.createElement("h3", null, title)), /*#__PURE__*/React.createElement("div", {
2397
+ className: styles$5.body
2398
+ }, blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2399
+ key: item.id,
2400
+ block: item,
2401
+ styleContext: context
2402
+ })))), /*#__PURE__*/React.createElement("div", {
2403
+ className: styles$5.footer
2404
+ }, /*#__PURE__*/React.createElement(Button, {
2405
+ size: "default",
2406
+ theme: "gray",
2407
+ onClick: () => handleButtonClick(),
2408
+ styleContext: "isInSpoiler"
2409
+ }, spoiled ? buttonCollapse : buttonExpande, /*#__PURE__*/React.createElement(SvgSymbol, {
2410
+ icon: "arrow"
2411
+ }))));
2412
+ };
2413
+
2414
+ var styles$4 = {"root":"RelatedRichBlock-module_root__-SEe7","wrapper":"RelatedRichBlock-module_wrapper__YkEpr","overlay":"RelatedRichBlock-module_overlay__tWuyR","overlayHeader":"RelatedRichBlock-module_overlayHeader__V3ynX","body":"RelatedRichBlock-module_body__XhS0U","isRich":"RelatedRichBlock-module_isRich__Z2kQ8","hasGradient":"RelatedRichBlock-module_hasGradient__s5Krh","picture":"RelatedRichBlock-module_picture__OmRKx","isCard":"RelatedRichBlock-module_isCard__wkMw-","cover":"RelatedRichBlock-module_cover__3gnIx","tag":"RelatedRichBlock-module_tag__c18sv","center":"RelatedRichBlock-module_center__KANd-","dark":"RelatedRichBlock-module_dark__cnk4R","light":"RelatedRichBlock-module_light__aJLn7","mobile":"RelatedRichBlock-module_mobile__N-G4U","desktop":"RelatedRichBlock-module_desktop__EaPOr"};
2415
+
2416
+ /* eslint-disable react/jsx-no-target-blank */
2417
+ const RelatedRichBlock = ({
2418
+ block: {
2419
+ only_on: onlyOn,
2420
+ data: {
2421
+ blocks,
2422
+ url,
2423
+ cover: {
2424
+ urls,
2425
+ gradients,
2426
+ tag,
2427
+ layout,
2428
+ ratio
2429
+ }
2430
+ }
2431
+ },
2432
+ styleContext
2433
+ }) => {
2434
+ const style = {};
2435
+ const styleHeader = {};
2436
+ const cardType = `is${toCapitalize(layout)}`;
2437
+ const [ref, inView] = reactIntersectionObserver.useInView({
2438
+ threshold: 0,
2439
+ triggerOnce: true
2440
+ });
2441
+ React.useEffect(() => {
2442
+ if (inView) {
2443
+ if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
2444
+ postMessage('richRelated', url, 'view');
2445
+ }
2446
+ }
2447
+ }, [inView]);
2448
+ const handleClick = () => {
2449
+ postMessage('richRelated', url, 'click');
2450
+ };
2451
+ let classNames = [[styles$4.root, true], [styles$4[cardType], !!layout && !!styles$4[cardType]], [styles$4.hasGradient, !!gradients], [styles$4[onlyOn], !!onlyOn && !!styles$4[onlyOn]]];
2452
+ let context = ['isInMediaBlock'];
2453
+ if (styleContext) {
2454
+ classNames = makeStyleContext(classNames, styleContext, styles$4);
2455
+ context = [...styleContext, 'isInMediaBlock'];
2456
+ }
2457
+ if (gradients) {
2458
+ styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
2459
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2460
+ classNames = makeStyleContext(classNames, theme, styles$4);
2461
+ if (onlyOn === 'desktop') {
2462
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2463
+ }
2464
+ }
2465
+ return /*#__PURE__*/React.createElement(reactRouterDom.Link, {
2466
+ "data-testid": "related-rich-block",
2467
+ className: makeClassName(classNames),
2468
+ to: `/${url}`,
2469
+ onClick: () => handleClick(),
2470
+ ref: ref
2471
+ }, layout === 'rich' && ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2472
+ className: styles$4.overlay,
2473
+ style: style
2474
+ }), /*#__PURE__*/React.createElement("div", {
2475
+ className: styles$4.overlayHeader,
2476
+ style: styleHeader
2477
+ }))), /*#__PURE__*/React.createElement("div", {
2478
+ className: styles$4.tag
2479
+ }, /*#__PURE__*/React.createElement(Tag, {
2480
+ size: "small",
2481
+ theme: "inherit",
2482
+ styleContext: "richRelated"
2483
+ }, tag)), /*#__PURE__*/React.createElement("div", {
2484
+ className: styles$4.cover
2485
+ }, /*#__PURE__*/React.createElement("div", {
2486
+ className: styles$4.picture
2487
+ }, /*#__PURE__*/React.createElement(Image, {
2488
+ optimized: urls,
2489
+ ratio: ratio,
2490
+ display: "narrow"
2491
+ }))), /*#__PURE__*/React.createElement("div", {
2492
+ className: styles$4.body
2493
+ }, blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2494
+ key: item.id,
2495
+ block: item,
2496
+ styleContext: context
2497
+ })))));
2498
+ };
2499
+
2500
+ var styles$3 = {"root":"ShopRelatedBlock-module_root__eTGjC","wrapper":"ShopRelatedBlock-module_wrapper__v6yE3","overlay":"ShopRelatedBlock-module_overlay__oR67Y","overlayHeader":"ShopRelatedBlock-module_overlayHeader__YMcNw","body":"ShopRelatedBlock-module_body__W4pBN","hasGradient":"ShopRelatedBlock-module_hasGradient__50JTl","picture":"ShopRelatedBlock-module_picture__zjFL4","tag":"ShopRelatedBlock-module_tag__ixkda","center":"ShopRelatedBlock-module_center__IpBP4","title":"ShopRelatedBlock-module_title__COl93","price":"ShopRelatedBlock-module_price__5Qitu","dark":"ShopRelatedBlock-module_dark__d0QiW","light":"ShopRelatedBlock-module_light__lUDWA","mobile":"ShopRelatedBlock-module_mobile__I6Hih","desktop":"ShopRelatedBlock-module_desktop__ywKrb"};
2501
+
2502
+ /* eslint-disable react/jsx-no-target-blank */
2503
+ const ShopRelatedBlock = ({
2504
+ block: {
2505
+ only_on: onlyOn,
2506
+ data: {
2507
+ url,
2508
+ cover: {
2509
+ urls,
2510
+ gradients,
2511
+ tag,
2512
+ layout,
2513
+ ratio,
2514
+ first_title: firstTitle,
2515
+ second_title: secondTitle
2516
+ }
2517
+ }
2518
+ },
2519
+ styleContext
2520
+ }) => {
2521
+ const style = {};
2522
+ const styleHeader = {};
2523
+ const [ref, inView] = reactIntersectionObserver.useInView({
2524
+ threshold: 0,
2525
+ triggerOnce: true
2526
+ });
2527
+ React.useEffect(() => {
2528
+ if (inView) {
2529
+ if (onlyOn === 'mobile' && window.innerWidth <= 511 || onlyOn === 'desktop' && window.innerWidth >= 512 || !onlyOn) {
2530
+ postMessage('productRelated', url, 'view');
2531
+ }
2532
+ }
2533
+ }, [inView]);
2534
+ const handleClick = () => {
2535
+ postMessage('productRelated', url, 'click');
2536
+ };
2537
+ let classNames = [[styles$3.root, true], [styles$3.hasGradient, !!gradients], [styles$3[onlyOn], !!onlyOn && !!styles$3[onlyOn]]];
2538
+ if (styleContext) {
2539
+ classNames = makeStyleContext(classNames, styleContext, styles$3);
2540
+ }
2541
+ if (gradients) {
2542
+ styleHeader.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockTop');
2543
+ const theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
2544
+ classNames = makeStyleContext(classNames, theme, styles$3);
2545
+ if (onlyOn === 'desktop') {
2546
+ style.backgroundImage = generateGradient(gradients.bg_rgb, 'mediaBlockBottom');
2547
+ }
2548
+ }
2549
+ return /*#__PURE__*/React.createElement("a", {
2550
+ "data-testid": "related-rich-block",
2551
+ className: makeClassName(classNames),
2552
+ href: url,
2553
+ target: "_blank",
2554
+ onClick: () => handleClick(),
2555
+ ref: ref
2556
+ }, layout === 'rich' && ( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2557
+ className: styles$3.overlay,
2558
+ style: style
2559
+ }), /*#__PURE__*/React.createElement("div", {
2560
+ className: styles$3.overlayHeader,
2561
+ style: styleHeader
2562
+ }))), /*#__PURE__*/React.createElement("div", {
2563
+ className: styles$3.tag
2564
+ }, /*#__PURE__*/React.createElement(Tag, {
2565
+ size: "small",
2566
+ theme: "inherit",
2567
+ styleContext: "richRelated"
2568
+ }, tag)), /*#__PURE__*/React.createElement("div", {
2569
+ className: styles$3.cover
2570
+ }, /*#__PURE__*/React.createElement("div", {
2571
+ className: styles$3.picture
2572
+ }, /*#__PURE__*/React.createElement(Image, {
2573
+ optimized: urls,
2574
+ ratio: ratio,
2575
+ display: "narrow"
2576
+ }))), /*#__PURE__*/React.createElement("div", {
2577
+ className: styles$3.body
2578
+ }, /*#__PURE__*/React.createElement("h2", {
2579
+ className: styles$3.title
2580
+ }, firstTitle, /*#__PURE__*/React.createElement("span", {
2581
+ className: styles$3.price
2582
+ }, secondTitle))));
2583
+ };
2584
+
2585
+ var styles$2 = {"root":"RelatedBook-module_root__QsOmA","container":"RelatedBook-module_container__vdDiZ","imageWrap":"RelatedBook-module_imageWrap__WmwnE","image":"RelatedBook-module_image__U1e5t","picture":"RelatedBook-module_picture__NXg-K","tag":"RelatedBook-module_tag__mSbbz","contentWrap":"RelatedBook-module_contentWrap__HIGRi","content":"RelatedBook-module_content__23Pfr","title":"RelatedBook-module_title__VRbr-","footer":"RelatedBook-module_footer__Z05t-","center":"RelatedBook-module_center__Fa6cj","isLight":"RelatedBook-module_isLight__W-0TO","isDark":"RelatedBook-module_isDark__0mrtK"};
2586
+
2587
+ const RelatedBook = ({
2588
+ block,
2589
+ styleContext
2590
+ }) => {
2591
+ const theme = block.data.theme.text_color === '0,0,0' ? 'isDark' : 'isLight';
2592
+ let classNames = [[styles$2.root, true], [styles$2[theme], theme], [styles$2[block.data.onlyOn], !!block.data.onlyOn && !!styles$2[block.data.onlyOn]]];
2593
+ if (styleContext) {
2594
+ classNames = makeStyleContext(classNames, styleContext, styles$2);
2595
+ }
2596
+ const cssProps = {
2597
+ '--bgColor': `rgb(${block.data.theme.background_color || '0, 0, 0'})`
2598
+ };
2599
+ return /*#__PURE__*/React.createElement(reactRouterDom.Link, {
2600
+ to: `/${block.data.url}`,
2601
+ className: makeClassName(classNames),
2602
+ style: cssProps
2603
+ }, /*#__PURE__*/React.createElement("div", {
2604
+ className: styles$2.container
2605
+ }, /*#__PURE__*/React.createElement("div", {
2606
+ className: styles$2.imageWrap
2607
+ }, /*#__PURE__*/React.createElement("div", {
2608
+ className: styles$2.image
2609
+ }, /*#__PURE__*/React.createElement("picture", {
2610
+ className: styles$2.picture
2611
+ }, /*#__PURE__*/React.createElement(Image, {
2612
+ optimized: block.data.cover.urls,
2613
+ ratio: 0,
2614
+ display: "narrow",
2615
+ styleContext: ['isStatic'],
2616
+ lazy: true
2617
+ })))), /*#__PURE__*/React.createElement("div", {
2618
+ className: styles$2.contentWrap
2619
+ }, /*#__PURE__*/React.createElement("div", {
2620
+ className: styles$2.content
2621
+ }, block.data.blocks.map(item => ( /*#__PURE__*/React.createElement(RenderBlocks, {
2622
+ key: item.id,
2623
+ block: item,
2624
+ styleContext: ['isInMediaBlock', 'isInBookRelated', 'isCustom']
2625
+ })))))));
2626
+ };
2627
+
2628
+ const RawHtmlBlock = ({
2629
+ block,
2630
+ styleContext,
2631
+ isRead,
2632
+ isListened,
2633
+ isInBookmarks,
2634
+ bookmarkAction,
2635
+ lightBox,
2636
+ lang
2637
+ }) => {
2638
+ const context = {
2639
+ lightBox: lightBox || null
2640
+ };
2641
+ switch (block.type) {
2642
+ case 'important_lead':
2643
+ {
2644
+ return /*#__PURE__*/React.createElement(ImportantLead, {
2645
+ block: block,
2646
+ styleContext: styleContext
2647
+ });
2648
+ }
2649
+ case 'spoiler':
2650
+ {
2651
+ return /*#__PURE__*/React.createElement(BlockProvider, {
2652
+ value: context
2653
+ }, /*#__PURE__*/React.createElement(Spoiler, {
2654
+ block: block,
2655
+ styleContext: styleContext
2656
+ }));
2657
+ }
2658
+ case 'cover':
2659
+ {
2660
+ return /*#__PURE__*/React.createElement(Cover, {
2661
+ block: block,
2662
+ styleContext: styleContext
2663
+ });
2664
+ }
2665
+ case 'half':
2666
+ {
2667
+ return /*#__PURE__*/React.createElement(HalfBlock, {
2668
+ block: block,
2669
+ styleContext: styleContext
2670
+ });
2671
+ }
2672
+ case 'related_rich':
2673
+ {
2674
+ return /*#__PURE__*/React.createElement(RelatedRichBlock, {
2675
+ block: block,
2676
+ styleContext: styleContext
2677
+ });
2678
+ }
2679
+ case 'related_book':
2680
+ {
2681
+ return /*#__PURE__*/React.createElement(RelatedBook, {
2682
+ block: block,
2683
+ styleContext: styleContext
2684
+ });
2685
+ }
2686
+ case 'related_shop':
2687
+ {
2688
+ return /*#__PURE__*/React.createElement(ShopRelatedBlock, {
2689
+ block: block,
2690
+ styleContext: styleContext
2691
+ });
2692
+ }
2693
+ default:
2694
+ {
2695
+ return /*#__PURE__*/React.createElement(BlockProvider, {
2696
+ value: context
2697
+ }, /*#__PURE__*/React.createElement(RenderBlocks, {
2698
+ block: block,
2699
+ styleContext: styleContext,
2700
+ isRead: isRead,
2701
+ isListened: isListened,
2702
+ isInBookmarks: isInBookmarks,
2703
+ bookmarkAction: bookmarkAction,
2704
+ lang: lang
2705
+ }));
2706
+ }
2707
+ }
2708
+ };
2709
+
2710
+ var styles$1 = {"root":"ToolbarButton-module_root__upsEH","isDark":"ToolbarButton-module_isDark__gWpv-","dark":"ToolbarButton-module_dark__5XOEp","bookmark":"ToolbarButton-module_bookmark__7SWkm","isActive":"ToolbarButton-module_isActive__N4kkV","icon":"ToolbarButton-module_icon__Ldcgq","text":"ToolbarButton-module_text__4R2a0"};
2711
+
2712
+ const ToolbarButton = ({
2713
+ type,
2714
+ theme,
2715
+ isActive,
2716
+ lang = 'ru',
2717
+ text,
2718
+ icon,
2719
+ onClick
2720
+ }) => {
2721
+ const classNames = [[styles$1.root, true], [styles$1[type], !!styles$1[type]], [styles$1[theme], !!styles$1[theme] && !!theme], [styles$1.isActive, !!isActive]];
2722
+ const label = SocialLabels[lang][type];
2723
+ return /*#__PURE__*/React.createElement("button", {
2724
+ "data-testid": "toolbar-button",
2725
+ className: makeClassName(classNames),
2726
+ type: "button",
2727
+ onClick: event => onClick(event, type)
2728
+ }, icon && ( /*#__PURE__*/React.createElement("div", {
2729
+ className: styles$1.icon
2730
+ }, /*#__PURE__*/React.createElement(SvgSymbol, {
2731
+ size: "medium",
2732
+ icon: icon,
2733
+ styleContext: "isInToolbar"
2734
+ }))), /*#__PURE__*/React.createElement("span", {
2735
+ className: styles$1.text
2736
+ }, text || label));
2737
+ };
2738
+
2739
+ var styles = {"root":"Tooltip-module_root__xK21R","isCenterBottom":"Tooltip-module_isCenterBottom__-qv7D","isLeftBottom":"Tooltip-module_isLeftBottom__0-f5z","isCenterTop":"Tooltip-module_isCenterTop__xQ3Ql","isLeftTop":"Tooltip-module_isLeftTop__yjKrV","body":"Tooltip-module_body__5qgzu","footer":"Tooltip-module_footer__swU9S"};
2740
+
2741
+ const capitalizeFirstLetter = string => string.charAt(0).toUpperCase() + string.slice(1);
2742
+
2743
+ const Tooltip = ({
2744
+ children,
2745
+ position
2746
+ }) => {
2747
+ const [x, y] = position;
2748
+ const positionClass = `is${capitalizeFirstLetter(x)}${capitalizeFirstLetter(y)}`;
2749
+ return /*#__PURE__*/React.createElement("div", {
2750
+ className: makeClassName([[styles.root, true], [styles[positionClass], true]])
2751
+ }, /*#__PURE__*/React.createElement("div", {
2752
+ className: styles.body
2753
+ }, children));
2754
+ };
2755
+
2756
+ const TooltipFooter = ({
2757
+ children
2758
+ }) => {
2759
+ return /*#__PURE__*/React.createElement("div", {
2760
+ className: styles.footer
2761
+ }, children);
2762
+ };
2763
+
2764
+ exports.AnnouncementInText = AnnouncementInText;
2765
+ exports.BookmarkButton = BookmarkButton;
2766
+ exports.Button = Button;
2767
+ exports.ButtonLoader = ButtonLoader;
2768
+ exports.CardTitle = CardTitle;
2769
+ exports.ChapterBlock = ChapterBlock;
2770
+ exports.Cover = Cover;
2771
+ exports.DocumentItemsCount = DocumentItemsCount;
2772
+ exports.DonatesTeaser = DonatesTeaser;
2773
+ exports.DotsOnImage = DotsOnImage;
2774
+ exports.Dropdown = Dropdown;
2775
+ exports.EmbedBlockContainer = EmbedBlockContainer;
2776
+ exports.Footnote = Footnote;
2777
+ exports.GroupedBlock = GroupedBlock;
2778
+ exports.HalfBlock = HalfBlock;
2779
+ exports.Image = Image;
2780
+ exports.ImportantLead = ImportantLead;
2781
+ exports.Lazy = Lazy;
2782
+ exports.ListBlock = ListBlock;
2783
+ exports.MaterialNote = MaterialNote;
2784
+ exports.MaterialTitle = MaterialTitle;
2785
+ exports.MediaCaption = MediaCaption;
2786
+ exports.Menu = Menu;
2787
+ exports.Meta = Meta;
2788
+ exports.MetaItem = MetaItem;
2789
+ exports.MetaItemLive = MetaItemLive;
2790
+ exports.Popover = Popover;
2791
+ exports.Primary = Primary;
2792
+ exports.QuoteBlock = QuoteBlock;
2793
+ exports.RawHtmlBlock = RawHtmlBlock;
2794
+ exports.RelatedBlock = RelatedBlock;
2795
+ exports.RelatedRichBlock = RelatedRichBlock;
2796
+ exports.RenderBlocks = RenderBlocks;
2797
+ exports.RichTitle = RichTitle;
2798
+ exports.Secondary = Secondary;
2799
+ exports.SensitiveBlock = SensitiveBlock;
2800
+ exports.ShopRelatedBlock = ShopRelatedBlock;
2801
+ exports.SimpleBlock = SimpleBlock;
2802
+ exports.SimpleTitle = SimpleTitle;
2803
+ exports.SourceBlock = SourceBlock;
2804
+ exports.Spoiler = Spoiler;
2805
+ exports.SvgSymbol = SvgSymbol;
2806
+ exports.Switcher = Switcher;
2807
+ exports.Table = Table;
2808
+ exports.Tag = Tag;
2809
+ exports.Timestamp = Timestamp;
2810
+ exports.Toolbar = Toolbar;
2811
+ exports.ToolbarButton = ToolbarButton;
2812
+ exports.ToolbarItem = ToolbarItem;
2813
+ exports.Tooltip = Tooltip;
2814
+ exports.TooltipFooter = TooltipFooter;
2815
+ //# sourceMappingURL=ui-kit-2.cjs.development.js.map