@arc-ui/community-components 3.2.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/.turbo/turbo-build.log +133 -13
  2. package/CHANGELOG.md +31 -0
  3. package/lib/Accordion/Accordion.cjs +2 -3
  4. package/lib/Accordion/Accordion.mjs +2 -3
  5. package/lib/ActionTile/ActionTile.cjs +4 -5
  6. package/lib/ActionTile/ActionTile.mjs +10 -11
  7. package/lib/ActionTile/styles.css +1 -1
  8. package/lib/ArticleSidebar/ArticleSidebar.cjs +9 -10
  9. package/lib/ArticleSidebar/ArticleSidebar.mjs +46 -47
  10. package/lib/Author/Author.cjs +2 -3
  11. package/lib/Author/Author.mjs +2 -3
  12. package/lib/BannerWithTabs/BannerWithTabs.cjs +4 -5
  13. package/lib/BannerWithTabs/BannerWithTabs.mjs +8 -9
  14. package/lib/ContentInfoWidget/ContentInfoWidget.cjs +3 -2
  15. package/lib/ContentInfoWidget/ContentInfoWidget.mjs +8 -7
  16. package/lib/CopyLead/CopyLead.cjs +32 -23
  17. package/lib/CopyLead/CopyLead.mjs +60 -51
  18. package/lib/DownloadList/DownloadList.cjs +6 -8
  19. package/lib/DownloadList/DownloadList.mjs +11 -13
  20. package/lib/FAQs/FAQs.cjs +5 -6
  21. package/lib/FAQs/FAQs.mjs +22 -23
  22. package/lib/FeaturePost/FeaturePost.cjs +14 -15
  23. package/lib/FeaturePost/FeaturePost.mjs +54 -55
  24. package/lib/Highlights/Highlights.cjs +11 -12
  25. package/lib/Highlights/Highlights.mjs +24 -25
  26. package/lib/InlineLinkGroup/InlineLinkGroup.cjs +25 -0
  27. package/lib/InlineLinkGroup/InlineLinkGroup.mjs +23 -0
  28. package/lib/InlineLinkGroup/styles.css +1 -0
  29. package/lib/LinkTile/LinkTile.cjs +6 -6
  30. package/lib/LinkTile/LinkTile.mjs +7 -7
  31. package/lib/LinkTile/styles.css +1 -1
  32. package/lib/ProductNavigation/ProductNavigation.cjs +6 -7
  33. package/lib/ProductNavigation/ProductNavigation.mjs +18 -19
  34. package/lib/PromoListing/PromoListing.cjs +7 -8
  35. package/lib/PromoListing/PromoListing.mjs +17 -18
  36. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +7 -8
  37. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +9 -10
  38. package/lib/Quote/Quote.cjs +5 -6
  39. package/lib/Quote/Quote.mjs +9 -10
  40. package/lib/SectionHeading/SectionHeading.cjs +2 -3
  41. package/lib/SectionHeading/SectionHeading.mjs +2 -3
  42. package/lib/Statistics/Statistics.cjs +21 -19
  43. package/lib/Statistics/Statistics.mjs +35 -33
  44. package/lib/Statistics/styles.css +1 -1
  45. package/lib/Summary/Summary.cjs +4 -4
  46. package/lib/Summary/Summary.mjs +13 -13
  47. package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +2 -3
  48. package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +2 -3
  49. package/lib/VideoHeroCard/VideoHeroCard.cjs +76 -0
  50. package/lib/VideoHeroCard/VideoHeroCard.mjs +74 -0
  51. package/lib/VideoPortraitCard/VideoPortraitCard.cjs +22 -0
  52. package/lib/VideoPortraitCard/VideoPortraitCard.mjs +20 -0
  53. package/lib/_shared/cjs/{Accordion-DfNGOjTm.cjs → Accordion-QqDoB3pY.cjs} +8 -9
  54. package/lib/_shared/cjs/{Author-D4dKNQem.cjs → Author-aL8YXi7C.cjs} +4 -5
  55. package/lib/_shared/cjs/Preview-Dx1kCzJ1.cjs +102 -0
  56. package/lib/_shared/cjs/{SectionHeading-DeSFM0HV.cjs → SectionHeading-Dj-dJfv3.cjs} +4 -5
  57. package/lib/_shared/cjs/{ThumbnailSignpost-GkOiwt-Z.cjs → ThumbnailSignpost-SBnrGooA.cjs} +4 -5
  58. package/lib/_shared/cjs/VideoCardThumbnail-BqYgpk0u.cjs +440 -0
  59. package/lib/_shared/cjs/dash.all.min-BPXzla24.cjs +6 -0
  60. package/lib/_shared/cjs/{tslib.es6-BxB9I209.cjs → filter-attrs-C26zOt4_.cjs} +25 -0
  61. package/lib/_shared/cjs/hls-Ckhp5fVA.cjs +36628 -0
  62. package/lib/_shared/cjs/index-DjiIVIaV.cjs +96 -0
  63. package/lib/_shared/cjs/index-oGP6D6gL.cjs +14826 -0
  64. package/lib/_shared/cjs/{index.es-Dq8bYrbW.cjs → index.es-B0J3cvrY.cjs} +1 -1
  65. package/lib/_shared/cjs/mixin-BFwaXKGB.cjs +1027 -0
  66. package/lib/_shared/cjs/react-CEvhi3LL.cjs +737 -0
  67. package/lib/_shared/cjs/react-CqsEClV0.cjs +466 -0
  68. package/lib/_shared/cjs/react-DE6M3seI.cjs +496 -0
  69. package/lib/_shared/cjs/react-Dri2yjKm.cjs +554 -0
  70. package/lib/_shared/cjs/react-DxToimBj.cjs +4239 -0
  71. package/lib/_shared/cjs/react-JTfV8OSA.cjs +325 -0
  72. package/lib/_shared/cjs/react-caXJFZ8W.cjs +400 -0
  73. package/lib/_shared/cjs/react-fep2ei7j.cjs +727 -0
  74. package/lib/_shared/esm/{Accordion-cd1oYvBv.mjs → Accordion-DtU7jbCv.mjs} +16 -17
  75. package/lib/_shared/esm/Author-CJQFrQM9.mjs +27 -0
  76. package/lib/_shared/esm/Preview-CmbKOgEO.mjs +100 -0
  77. package/lib/_shared/esm/{SectionHeading-CpDLCndw.mjs → SectionHeading-BskdQ2Tt.mjs} +10 -11
  78. package/lib/_shared/esm/{ThumbnailSignpost-BeRiXbUp.mjs → ThumbnailSignpost-CBSdQiHw.mjs} +13 -14
  79. package/lib/_shared/esm/VideoCardThumbnail-VfOKmPCv.mjs +437 -0
  80. package/lib/_shared/esm/dash.all.min-CbWI_8dN.mjs +4 -0
  81. package/lib/_shared/esm/{tslib.es6-D6Wu-xwB.mjs → filter-attrs-D-1kWaCP.mjs} +25 -1
  82. package/lib/_shared/esm/hls-AFbJDS9D.mjs +36625 -0
  83. package/lib/_shared/esm/index-CrcIrdjn.mjs +14799 -0
  84. package/lib/_shared/esm/index-DYnuIO1L.mjs +94 -0
  85. package/lib/_shared/esm/{index.es-Bfdys5__.mjs → index.es-DraZ-qKh.mjs} +1 -1
  86. package/lib/_shared/esm/mixin-BGGG8VrM.mjs +1024 -0
  87. package/lib/_shared/esm/react-BGimq-TB.mjs +4237 -0
  88. package/lib/_shared/esm/react-BHT4t_eQ.mjs +494 -0
  89. package/lib/_shared/esm/react-BSd0sGcO.mjs +464 -0
  90. package/lib/_shared/esm/react-CSr43fZV.mjs +552 -0
  91. package/lib/_shared/esm/react-Ca6E7Fr-.mjs +398 -0
  92. package/lib/_shared/esm/react-DG070IvZ.mjs +725 -0
  93. package/lib/_shared/esm/react-DZyqy7W7.mjs +735 -0
  94. package/lib/_shared/esm/react-WW_9iHcl.mjs +323 -0
  95. package/lib/index.cjs +299 -181
  96. package/lib/index.cjs.map +1 -1
  97. package/lib/index.d.cts +77 -63
  98. package/lib/index.d.mts +77 -63
  99. package/lib/index.mjs +297 -181
  100. package/lib/index.mjs.map +1 -1
  101. package/lib/styles.css +1 -1
  102. package/package.json +15 -12
  103. package/rollup.config.js +1 -1
  104. package/src/components/ActionTile/ActionTile.module.css +56 -37
  105. package/src/components/ActionTile/ActionTile.tsx +1 -1
  106. package/src/components/ArticleSidebar/ArticleSidebar.tsx +4 -6
  107. package/src/components/Author/Author.tsx +0 -3
  108. package/src/components/BannerWithTabs/BannerWithTabs.tsx +4 -6
  109. package/src/components/ContentInfoWidget/ContentInfoWidget.tsx +3 -4
  110. package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +7 -6
  111. package/src/components/CopyLead/templates/Content/Content.tsx +5 -3
  112. package/src/components/CopyLead/templates/Media/Media.tsx +5 -6
  113. package/src/components/DownloadList/DownloadList.tsx +8 -8
  114. package/src/components/FeaturePost/FeaturePost.tsx +3 -7
  115. package/src/components/Highlights/Highlights.tsx +3 -2
  116. package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +3 -2
  117. package/src/components/Highlights/components/HighlightList/HighlightList.tsx +5 -2
  118. package/src/components/InlineLinkGroup/InlineLinkGroup.module.css +81 -0
  119. package/src/components/InlineLinkGroup/InlineLinkGroup.tsx +67 -0
  120. package/src/components/InlineLinkGroup/index.ts +5 -0
  121. package/src/components/LinkTile/LinkTile.module.css +62 -26
  122. package/src/components/LinkTile/LinkTile.tsx +8 -1
  123. package/src/components/PromoListing/PromoListing.tsx +3 -11
  124. package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +2 -0
  125. package/src/components/Quote/Quote.tsx +1 -7
  126. package/src/components/Statistics/Statistics.module.css +0 -10
  127. package/src/components/Statistics/Statistics.tsx +35 -32
  128. package/src/components/Summary/Summary.tsx +3 -1
  129. package/src/components/VideoHeroCard/VideoHeroCard.tsx +63 -0
  130. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.module.css +32 -0
  131. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.tsx +97 -0
  132. package/src/components/VideoHeroCard/components/VideoHeroCardContent/index.ts +4 -0
  133. package/src/components/VideoHeroCard/index.ts +1 -0
  134. package/src/components/VideoPortraitCard/VideoPortraitCard.tsx +54 -0
  135. package/src/components/VideoPortraitCard/index.ts +4 -0
  136. package/src/components/index.ts +3 -1
  137. package/src/internal/MultiLineText/MultiLineText.tsx +25 -0
  138. package/src/internal/MultiLineText/index.ts +1 -0
  139. package/src/internal/VideoCardPlayer/VideoCardPlayer.module.css +54 -0
  140. package/src/internal/VideoCardPlayer/VideoCardPlayer.tsx +62 -0
  141. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.module.css +41 -0
  142. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.tsx +28 -0
  143. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/index.ts +1 -0
  144. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.module.css +58 -0
  145. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.tsx +38 -0
  146. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/index.ts +1 -0
  147. package/src/internal/VideoCardPlayer/index.ts +2 -0
  148. package/src/internal/VideoCardPlayer/types/player-props.ts +6 -0
  149. package/versions.json +1 -1
  150. package/lib/HeroLink/HeroLink.cjs +0 -35
  151. package/lib/HeroLink/HeroLink.mjs +0 -33
  152. package/lib/HeroLink/styles.css +0 -1
  153. package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +0 -27
  154. package/lib/_shared/esm/Author-HnYsFTPT.mjs +0 -28
  155. package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +0 -25
  156. package/src/components/HeroLink/HeroLink.module.css +0 -44
  157. package/src/components/HeroLink/HeroLink.tsx +0 -136
  158. package/src/components/HeroLink/index.ts +0 -2
@@ -0,0 +1,440 @@
1
+ 'use strict';
2
+
3
+ var filterAttrs = require('./filter-attrs-C26zOt4_.cjs');
4
+ var React = require('react');
5
+ var index = require('./index-Bp6Dd2i1.cjs');
6
+ var Icon = require('@arc-ui/components/Icon');
7
+ var Visible = require('@arc-ui/components/Visible');
8
+
9
+ /**
10
+ * Do not edit directly
11
+ * Generated file
12
+ */
13
+
14
+ const ArcIconPlay =
15
+ "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 56 56'%3e%3cpath fill='currentColor' d='M36.468 26.32 23.907 19.07A1.938 1.938 0 0 0 21 20.745V35.25a1.935 1.935 0 0 0 2.907 1.68l12.561-7.254a1.938 1.938 0 0 0 0-3.354m-.875 1.84-12.561 7.254a.18.18 0 0 1-.187 0 .18.18 0 0 1-.095-.165V20.745a.18.18 0 0 1 .095-.16.18.18 0 0 1 .187 0l12.561 7.25a.18.18 0 0 1 .095.164.18.18 0 0 1-.095.16'/%3e%3c/svg%3e";
16
+
17
+ const AUDIO_EXTENSIONS = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
18
+ const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
19
+ const HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
20
+ const DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
21
+ const MATCH_URL_MUX = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/;
22
+ const MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//;
23
+ const MATCH_URL_VIMEO = /vimeo\.com\/(?!progressive_redirect).+/;
24
+ const MATCH_URL_WISTIA = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/;
25
+ const MATCH_URL_SPOTIFY = /open\.spotify\.com\/(\w+)\/(\w+)/i;
26
+ const MATCH_URL_TWITCH = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/;
27
+ const MATCH_URL_TIKTOK = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/;
28
+ const canPlayFile = (url, test) => {
29
+ if (Array.isArray(url)) {
30
+ for (const item of url) {
31
+ if (typeof item === "string" && canPlayFile(item, test)) {
32
+ return true;
33
+ }
34
+ if (canPlayFile(item.src, test)) {
35
+ return true;
36
+ }
37
+ }
38
+ return false;
39
+ }
40
+ return test(url);
41
+ };
42
+ const canPlay = {
43
+ html: (url) => canPlayFile(url, (u) => AUDIO_EXTENSIONS.test(u) || VIDEO_EXTENSIONS.test(u)),
44
+ hls: (url) => canPlayFile(url, (u) => HLS_EXTENSIONS.test(u)),
45
+ dash: (url) => canPlayFile(url, (u) => DASH_EXTENSIONS.test(u)),
46
+ mux: (url) => MATCH_URL_MUX.test(url),
47
+ youtube: (url) => MATCH_URL_YOUTUBE.test(url),
48
+ vimeo: (url) => MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url),
49
+ wistia: (url) => MATCH_URL_WISTIA.test(url),
50
+ spotify: (url) => MATCH_URL_SPOTIFY.test(url),
51
+ twitch: (url) => MATCH_URL_TWITCH.test(url),
52
+ tiktok: (url) => MATCH_URL_TIKTOK.test(url)
53
+ };
54
+
55
+ const HtmlPlayer = React.forwardRef((props, ref) => {
56
+ const Media = AUDIO_EXTENSIONS.test(`${props.src}`) ? "audio" : "video";
57
+ return /* @__PURE__ */ React.createElement(Media, { ...props, ref }, props.children);
58
+ });
59
+ var HtmlPlayer_default = HtmlPlayer;
60
+
61
+ const Players = [
62
+ {
63
+ key: "hls",
64
+ name: "hls.js",
65
+ canPlay: canPlay.hls,
66
+ canEnablePIP: () => true,
67
+ player: React.lazy(
68
+ () => Promise.resolve().then(function () { return require(
69
+ /* webpackChunkName: 'reactPlayerHls' */
70
+ './react-caXJFZ8W.cjs'
71
+ ); })
72
+ )
73
+ },
74
+ {
75
+ key: "dash",
76
+ name: "dash.js",
77
+ canPlay: canPlay.dash,
78
+ canEnablePIP: () => true,
79
+ player: React.lazy(
80
+ () => Promise.resolve().then(function () { return require(
81
+ /* webpackChunkName: 'reactPlayerDash' */
82
+ './react-JTfV8OSA.cjs'
83
+ ); })
84
+ )
85
+ },
86
+ {
87
+ key: "mux",
88
+ name: "Mux",
89
+ canPlay: canPlay.mux,
90
+ canEnablePIP: () => true,
91
+ player: React.lazy(
92
+ () => Promise.resolve().then(function () { return require(
93
+ /* webpackChunkName: 'reactPlayerMux' */
94
+ './index-oGP6D6gL.cjs'
95
+ ); })
96
+ )
97
+ },
98
+ {
99
+ key: "youtube",
100
+ name: "YouTube",
101
+ canPlay: canPlay.youtube,
102
+ player: React.lazy(
103
+ () => Promise.resolve().then(function () { return require(
104
+ /* webpackChunkName: 'reactPlayerYouTube' */
105
+ './react-CEvhi3LL.cjs'
106
+ ); })
107
+ )
108
+ },
109
+ {
110
+ key: "vimeo",
111
+ name: "Vimeo",
112
+ canPlay: canPlay.vimeo,
113
+ player: React.lazy(
114
+ () => Promise.resolve().then(function () { return require(
115
+ /* webpackChunkName: 'reactPlayerVimeo' */
116
+ './react-DxToimBj.cjs'
117
+ ); })
118
+ )
119
+ },
120
+ {
121
+ key: "wistia",
122
+ name: "Wistia",
123
+ canPlay: canPlay.wistia,
124
+ canEnablePIP: () => true,
125
+ player: React.lazy(
126
+ () => Promise.resolve().then(function () { return require(
127
+ /* webpackChunkName: 'reactPlayerWistia' */
128
+ './react-fep2ei7j.cjs'
129
+ ); })
130
+ )
131
+ },
132
+ {
133
+ key: "spotify",
134
+ name: "Spotify",
135
+ canPlay: canPlay.spotify,
136
+ canEnablePIP: () => false,
137
+ player: React.lazy(
138
+ () => Promise.resolve().then(function () { return require(
139
+ /* webpackChunkName: 'reactPlayerSpotify' */
140
+ './react-DE6M3seI.cjs'
141
+ ); })
142
+ )
143
+ },
144
+ {
145
+ key: "twitch",
146
+ name: "Twitch",
147
+ canPlay: canPlay.twitch,
148
+ canEnablePIP: () => false,
149
+ player: React.lazy(
150
+ () => Promise.resolve().then(function () { return require(
151
+ /* webpackChunkName: 'reactPlayerTwitch' */
152
+ './react-Dri2yjKm.cjs'
153
+ ); })
154
+ )
155
+ },
156
+ {
157
+ key: "tiktok",
158
+ name: "TikTok",
159
+ canPlay: canPlay.tiktok,
160
+ canEnablePIP: () => false,
161
+ player: React.lazy(
162
+ () => Promise.resolve().then(function () { return require(
163
+ /* webpackChunkName: 'reactPlayerTiktok' */
164
+ './react-CqsEClV0.cjs'
165
+ ); })
166
+ )
167
+ },
168
+ {
169
+ key: "html",
170
+ name: "html",
171
+ canPlay: canPlay.html,
172
+ canEnablePIP: () => true,
173
+ player: HtmlPlayer_default
174
+ }
175
+ ];
176
+ var players_default = Players;
177
+
178
+ const defaultProps = {
179
+ // Falsy values don't need to be defined
180
+ //
181
+ // native video attrs
182
+ // src: undefined,
183
+ // preload: undefined,
184
+ // crossOrigin: undefined,
185
+ // autoPlay: false,
186
+ // muted: false,
187
+ // loop: false,
188
+ // controls: false,
189
+ // playsInline: false,
190
+ // disableRemotePlayback: false,
191
+ width: "320px",
192
+ height: "180px",
193
+ // native video props
194
+ volume: 1,
195
+ playbackRate: 1,
196
+ // custom props
197
+ // playing: undefined,
198
+ // pip: false,
199
+ // light: false,
200
+ // fallback: null,
201
+ previewTabIndex: 0,
202
+ previewAriaLabel: "",
203
+ oEmbedUrl: "https://noembed.com/embed?url={url}"
204
+ };
205
+
206
+ const Player = React.forwardRef((props, ref) => {
207
+ const { playing, pip } = props;
208
+ const Player2 = props.activePlayer;
209
+ const playerRef = React.useRef(null);
210
+ const startOnPlayRef = React.useRef(true);
211
+ React.useEffect(() => {
212
+ var _a, _b;
213
+ if (!playerRef.current) return;
214
+ if (playerRef.current.paused && playing === true) {
215
+ playerRef.current.play();
216
+ }
217
+ if (!playerRef.current.paused && playing === false) {
218
+ playerRef.current.pause();
219
+ }
220
+ playerRef.current.playbackRate = (_a = props.playbackRate) != null ? _a : 1;
221
+ playerRef.current.volume = (_b = props.volume) != null ? _b : 1;
222
+ });
223
+ React.useEffect(() => {
224
+ var _a, _b, _c, _d, _e;
225
+ if (!playerRef.current || !globalThis.document) return;
226
+ if (pip && !document.pictureInPictureElement) {
227
+ try {
228
+ (_b = (_a = playerRef.current).requestPictureInPicture) == null ? void 0 : _b.call(_a);
229
+ } catch (err) {
230
+ }
231
+ }
232
+ if (!pip && document.pictureInPictureElement) {
233
+ try {
234
+ (_d = (_c = playerRef.current).exitPictureInPicture) == null ? void 0 : _d.call(_c);
235
+ (_e = document.exitPictureInPicture) == null ? void 0 : _e.call(document);
236
+ } catch (err) {
237
+ }
238
+ }
239
+ }, [pip]);
240
+ const handleLoadStart = (event) => {
241
+ var _a, _b;
242
+ startOnPlayRef.current = true;
243
+ (_a = props.onReady) == null ? void 0 : _a.call(props);
244
+ (_b = props.onLoadStart) == null ? void 0 : _b.call(props, event);
245
+ };
246
+ const handlePlay = (event) => {
247
+ var _a, _b;
248
+ if (startOnPlayRef.current) {
249
+ startOnPlayRef.current = false;
250
+ (_a = props.onStart) == null ? void 0 : _a.call(props, event);
251
+ }
252
+ (_b = props.onPlay) == null ? void 0 : _b.call(props, event);
253
+ };
254
+ if (!Player2) {
255
+ return null;
256
+ }
257
+ const eventProps = {};
258
+ const reactPlayerEventHandlers = ["onReady", "onStart"];
259
+ for (const key in props) {
260
+ if (key.startsWith("on") && !reactPlayerEventHandlers.includes(key)) {
261
+ eventProps[key] = props[key];
262
+ }
263
+ }
264
+ return /* @__PURE__ */ React.createElement(
265
+ Player2,
266
+ {
267
+ ...eventProps,
268
+ style: props.style,
269
+ className: props.className,
270
+ slot: props.slot,
271
+ ref: React.useCallback(
272
+ (node) => {
273
+ playerRef.current = node;
274
+ if (typeof ref === "function") {
275
+ ref(node);
276
+ } else if (ref !== null) {
277
+ ref.current = node;
278
+ }
279
+ },
280
+ [ref]
281
+ ),
282
+ src: props.src,
283
+ crossOrigin: props.crossOrigin,
284
+ preload: props.preload,
285
+ controls: props.controls,
286
+ muted: props.muted,
287
+ autoPlay: props.autoPlay,
288
+ loop: props.loop,
289
+ playsInline: props.playsInline,
290
+ disableRemotePlayback: props.disableRemotePlayback,
291
+ config: props.config,
292
+ onLoadStart: handleLoadStart,
293
+ onPlay: handlePlay
294
+ },
295
+ props.children
296
+ );
297
+ });
298
+ Player.displayName = "Player";
299
+ var Player_default = Player;
300
+
301
+ const Preview = React.lazy(() => Promise.resolve().then(function () { return require(
302
+ /* webpackChunkName: 'reactPlayerPreview' */
303
+ './Preview-Dx1kCzJ1.cjs'
304
+ ); }));
305
+ const customPlayers = [];
306
+ const createReactPlayer = (players, playerFallback) => {
307
+ const getActivePlayer = (src) => {
308
+ for (const player of [...customPlayers, ...players]) {
309
+ if (src && player.canPlay(src)) {
310
+ return player;
311
+ }
312
+ }
313
+ if (playerFallback) {
314
+ return playerFallback;
315
+ }
316
+ return null;
317
+ };
318
+ const ReactPlayer = React.forwardRef((_props, ref) => {
319
+ const props = { ...defaultProps, ..._props };
320
+ const { src, slot, className, style, width, height, fallback, wrapper } = props;
321
+ const [showPreview, setShowPreview] = React.useState(!!props.light);
322
+ React.useEffect(() => {
323
+ if (props.light) {
324
+ setShowPreview(true);
325
+ } else {
326
+ setShowPreview(false);
327
+ }
328
+ }, [props.light]);
329
+ const handleClickPreview = (e) => {
330
+ var _a;
331
+ setShowPreview(false);
332
+ (_a = props.onClickPreview) == null ? void 0 : _a.call(props, e);
333
+ };
334
+ const renderPreview = (src2) => {
335
+ if (!src2) return null;
336
+ const { light, playIcon, previewTabIndex, oEmbedUrl, previewAriaLabel } = props;
337
+ return /* @__PURE__ */ React.createElement(
338
+ Preview,
339
+ {
340
+ src: src2,
341
+ light,
342
+ playIcon,
343
+ previewTabIndex,
344
+ previewAriaLabel,
345
+ oEmbedUrl,
346
+ onClickPreview: handleClickPreview
347
+ }
348
+ );
349
+ };
350
+ const renderActivePlayer = (src2) => {
351
+ var _a, _b;
352
+ const player = getActivePlayer(src2);
353
+ if (!player) return null;
354
+ const { style: style2, width: width2, height: height2, wrapper: wrapper2 } = props;
355
+ const config = (_a = props.config) == null ? void 0 : _a[player.key];
356
+ return /* @__PURE__ */ React.createElement(
357
+ Player_default,
358
+ {
359
+ ...props,
360
+ ref,
361
+ activePlayer: (_b = player.player) != null ? _b : player,
362
+ slot: wrapper2 ? void 0 : slot,
363
+ className: wrapper2 ? void 0 : className,
364
+ style: wrapper2 ? { display: "block", width: "100%", height: "100%" } : { display: "block", width: width2, height: height2, ...style2 },
365
+ config
366
+ }
367
+ );
368
+ };
369
+ const Wrapper = wrapper == null ? ForwardChildren : wrapper;
370
+ const UniversalSuspense = fallback === false ? ForwardChildren : React.Suspense;
371
+ return /* @__PURE__ */ React.createElement(Wrapper, { slot, className, style: { width, height, ...style } }, /* @__PURE__ */ React.createElement(UniversalSuspense, { fallback }, showPreview ? renderPreview(src) : renderActivePlayer(src)));
372
+ });
373
+ ReactPlayer.displayName = "ReactPlayer";
374
+ ReactPlayer.addCustomPlayer = (player) => {
375
+ customPlayers.push(player);
376
+ };
377
+ ReactPlayer.removeCustomPlayers = () => {
378
+ customPlayers.length = 0;
379
+ };
380
+ ReactPlayer.canPlay = (src) => {
381
+ if (src) {
382
+ for (const Player2 of [...customPlayers, ...players]) {
383
+ if (Player2.canPlay(src)) {
384
+ return true;
385
+ }
386
+ }
387
+ }
388
+ return false;
389
+ };
390
+ ReactPlayer.canEnablePIP = (src) => {
391
+ var _a;
392
+ if (src) {
393
+ for (const Player2 of [...customPlayers, ...players]) {
394
+ if (Player2.canPlay(src) && ((_a = Player2.canEnablePIP) == null ? void 0 : _a.call(Player2))) {
395
+ return true;
396
+ }
397
+ }
398
+ }
399
+ return false;
400
+ };
401
+ return ReactPlayer;
402
+ };
403
+ const ForwardChildren = ({ children }) => children;
404
+
405
+ const fallback = players_default[players_default.length - 1];
406
+ var src_default = createReactPlayer(players_default, fallback);
407
+
408
+ var styles$2 = {"playIconContainer":"VideoCardPlayIcon-module_playIconContainer__ZqZP3","playIconContainer--s":"VideoCardPlayIcon-module_playIconContainer--s__ETbOZ","playIconContainer--l":"VideoCardPlayIcon-module_playIconContainer--l__OGccg","playIcon":"VideoCardPlayIcon-module_playIcon__kzito"};
409
+
410
+ var VideoCardPlayIcon = function (_a) {
411
+ var _b = _a.size, size = _b === void 0 ? "l" : _b;
412
+ return (React.createElement("div", { className: index.classNames(styles$2.playIconContainer, styles$2["playIconContainer--".concat(size)]) },
413
+ React.createElement("div", { className: styles$2.playIcon },
414
+ React.createElement(Icon.Icon, { icon: ArcIconPlay }))));
415
+ };
416
+
417
+ var styles$1 = {"container":"VideoCardPlayer-module_container__G-Uta","player":"VideoCardPlayer-module_player__BgueT","playerWrapper":"VideoCardPlayer-module_playerWrapper__UcH1q","playerWrapper--landscape":"VideoCardPlayer-module_playerWrapper--landscape__shKv-","playerWrapper--portrait":"VideoCardPlayer-module_playerWrapper--portrait__7bKAr"};
418
+
419
+ var VideoCardPlayer = function (_a) {
420
+ var thumbnail = _a.thumbnail, playIconSize = _a.playIconSize, orientation = _a.orientation, children = _a.children, player = _a.player, props = filterAttrs.__rest(_a, ["thumbnail", "playIconSize", "orientation", "children", "player"]);
421
+ var _b = React.useState(false), isClient = _b[0], setIsClient = _b[1];
422
+ React.useEffect(function () {
423
+ setIsClient(true);
424
+ }, []);
425
+ var playerProps = filterAttrs.__assign(filterAttrs.__assign({}, player), { light: thumbnail, playIcon: React.createElement(VideoCardPlayIcon, { size: playIconSize }), muted: !thumbnail, playing: true, controls: true, className: styles$1.player, width: "100%", height: "100%" });
426
+ return (React.createElement("div", filterAttrs.__assign({ className: styles$1.container }, filterAttrs.filterAttrs(props)),
427
+ React.createElement("div", { "data-testid": "arc-video-card", className: index.classNames(styles$1.playerWrapper, styles$1["playerWrapper--".concat(orientation)]) }, isClient && React.createElement(src_default, filterAttrs.__assign({}, playerProps))),
428
+ children));
429
+ };
430
+
431
+ var styles = {"thumbnail":"VideoCardThumbnail-module_thumbnail__Yamk0","thumbnail--landscape":"VideoCardThumbnail-module_thumbnail--landscape__FmnLk","thumbnail--portrait":"VideoCardThumbnail-module_thumbnail--portrait__FZS93","thumbnailContent":"VideoCardThumbnail-module_thumbnailContent__cHham"};
432
+
433
+ var VideoCardThumbnail = function (_a) {
434
+ var orientation = _a.orientation, contentVisibility = _a.contentVisibility, src = _a.src, children = _a.children;
435
+ var content = React.createElement("div", { className: styles.thumbnailContent }, children);
436
+ return (React.createElement("div", { className: index.classNames(styles.thumbnail, styles["thumbnail--".concat(orientation)]), style: { backgroundImage: "url(".concat(src, ")") } }, contentVisibility ? (React.createElement(Visible.Visible, filterAttrs.__assign({}, contentVisibility), content)) : (content)));
437
+ };
438
+
439
+ exports.VideoCardPlayer = VideoCardPlayer;
440
+ exports.VideoCardThumbnail = VideoCardThumbnail;