diff --git a/cms/version.py b/cms/version.py index b8ea68a4..2536c2e4 100644 --- a/cms/version.py +++ b/cms/version.py @@ -1 +1 @@ -VERSION = "8.1.4" +VERSION = "8.0.1a" diff --git a/frontend-tools/video-js/src/components/overlays/EmbedInfoOverlay.js b/frontend-tools/video-js/src/components/overlays/EmbedInfoOverlay.js index 07732cc5..b488c00d 100644 --- a/frontend-tools/video-js/src/components/overlays/EmbedInfoOverlay.js +++ b/frontend-tools/video-js/src/components/overlays/EmbedInfoOverlay.js @@ -14,6 +14,7 @@ class EmbedInfoOverlay extends Component { this.authorThumbnail = options.authorThumbnail || ''; this.videoTitle = options.videoTitle || 'Video'; this.videoUrl = options.videoUrl || ''; + this.titleTarget = options.titleTarget || '_blank'; this.showTitle = options.showTitle !== undefined ? options.showTitle : true; this.showRelated = options.showRelated !== undefined ? options.showRelated : true; this.showUserAvatar = options.showUserAvatar !== undefined ? options.showUserAvatar : true; @@ -140,7 +141,7 @@ class EmbedInfoOverlay extends Component { if (this.videoUrl && this.linkTitle) { const titleLink = document.createElement('a'); titleLink.href = this.videoUrl; - titleLink.target = '_blank'; + titleLink.target = this.titleTarget; titleLink.rel = 'noopener noreferrer'; titleLink.textContent = this.videoTitle; titleLink.title = this.videoTitle; diff --git a/frontend-tools/video-js/src/components/video-player/VideoJSPlayer.jsx b/frontend-tools/video-js/src/components/video-player/VideoJSPlayer.jsx index 125a7bc7..c85934ed 100644 --- a/frontend-tools/video-js/src/components/video-player/VideoJSPlayer.jsx +++ b/frontend-tools/video-js/src/components/video-player/VideoJSPlayer.jsx @@ -2216,12 +2216,26 @@ function VideoJSPlayer({ videoId = 'default-video', showTitle = true, showRelate // BEGIN: Add Embed Info Overlay Component (for embed player only) if (isEmbedPlayer) { + let overlayVideoUrl = currentVideo.url; + let overlayTitleTarget = '_blank'; + + const parentMediaBase = mediaData?.parentMediaBase; + if (parentMediaBase) { + const token = new URLSearchParams(window.location.search).get('m'); + if (token) { + const sep = parentMediaBase.includes('?') ? '&' : '?'; + overlayVideoUrl = `${parentMediaBase}${sep}token=${token}`; + overlayTitleTarget = '_blank'; + } + } + customComponents.current.embedInfoOverlay = new EmbedInfoOverlay(playerRef.current, { authorName: currentVideo.author_name, authorProfile: currentVideo.author_profile, authorThumbnail: currentVideo.author_thumbnail, videoTitle: currentVideo.title, - videoUrl: currentVideo.url, + videoUrl: overlayVideoUrl, + titleTarget: overlayTitleTarget, showTitle: finalShowTitle, showRelated: finalShowRelated, showUserAvatar: finalShowUserAvatar, diff --git a/frontend-tools/video-js/src/main.jsx b/frontend-tools/video-js/src/main.jsx index a8450efc..db6653dd 100644 --- a/frontend-tools/video-js/src/main.jsx +++ b/frontend-tools/video-js/src/main.jsx @@ -3,50 +3,52 @@ import { createRoot } from 'react-dom/client'; import VideoJS from './VideoJS.jsx'; -// Mount the components when the DOM is ready -const mountComponents = () => { - // Mount main video player - const rootContainerMainNew = document.getElementById('video-js-root-main'); - if (rootContainerMainNew && !rootContainerMainNew.hasChildNodes()) { - const rootMain = createRoot(rootContainerMainNew); - rootMain.render( - - - - ); - } +// Track root instances keyed by container id. +// Each entry: { root, container } so we can detect if the DOM element was replaced. +const roots = {}; - // Mount embed video player - const rootContainerEmbedNew = document.getElementById('video-js-root-embed'); - if (rootContainerEmbedNew && !rootContainerEmbedNew.hasChildNodes()) { - const rootEmbed = createRoot(rootContainerEmbedNew); - rootEmbed.render( - - - - ); +const mountComponents = () => { + const containers = [ + { id: 'video-js-root-main', videoId: 'video-main' }, + { id: 'video-js-root-embed', videoId: 'video-embed' }, + ]; + + for (const { id, videoId } of containers) { + const container = document.getElementById(id); + if (!container) continue; + + const existing = roots[id]; + + if (existing && existing.container === container) { + // Same DOM node — re-render with latest MEDIA_DATA. + existing.root.render( + + + + ); + } else { + // First mount, or container was replaced (SPA navigation). + if (existing) { + existing.root.unmount(); + } + const root = createRoot(container); + root.render( + + + + ); + roots[id] = { root, container }; + } } }; -// Expose the mounting function globally for manual triggering +// Expose globally so VideoJSEmbed can trigger a re-mount after MEDIA_DATA is updated. window.triggerVideoJSMount = mountComponents; -// Listen for custom events to trigger mounting -document.addEventListener('triggerVideoJSMount', () => { - mountComponents(); -}); +document.addEventListener('triggerVideoJSMount', mountComponents); -// Initial mount if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', mountComponents); } else { mountComponents(); } - -// Also periodically check for new containers (as a fallback) -setInterval(() => { - const embedContainer = document.getElementById('video-js-root-embed'); - if (embedContainer && !embedContainer.hasChildNodes()) { - mountComponents(); - } -}, 1000); diff --git a/frontend-tools/video-js/yarn.lock b/frontend-tools/video-js/yarn.lock index c89bd4dc..403478c6 100644 --- a/frontend-tools/video-js/yarn.lock +++ b/frontend-tools/video-js/yarn.lock @@ -10,7 +10,7 @@ "@jridgewell/gen-mapping" "^0.3.5" "@jridgewell/trace-mapping" "^0.3.24" -"@babel/code-frame@^7.27.1": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.27.1": version "7.27.1" resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz" integrity sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg== @@ -24,7 +24,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.27.5.tgz" integrity sha512-KiRAp/VoJaWkkte84TvUd9qjdbZAdiqyvMxrGl1N6vzFogKmaLgoM3L1kgtLicp2HP5fBJS8JrZKLVIZGVJAVg== -"@babel/core@^7.27.4": +"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.21.3", "@babel/core@^7.27.4": version "7.27.4" resolved "https://registry.npmjs.org/@babel/core/-/core-7.27.4.tgz" integrity sha512-bXYxrXFubeYdvB0NhD/NBB3Qi6aZeV20GOWVI47t2dkecCEoneR4NPVcb7abpXDEvejgrUfFtG6vG/zxAKmg+g== @@ -160,7 +160,7 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.27.3", "@babel/types@^7.27.6": +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.21.3", "@babel/types@^7.27.1", "@babel/types@^7.27.3", "@babel/types@^7.27.6": version "7.27.6" resolved "https://registry.npmjs.org/@babel/types/-/types-7.27.6.tgz" integrity sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q== @@ -168,116 +168,11 @@ "@babel/helper-string-parser" "^7.27.1" "@babel/helper-validator-identifier" "^7.27.1" -"@esbuild/android-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" - integrity sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ== - -"@esbuild/android-arm@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.20.tgz#fedb265bc3a589c84cc11f810804f234947c3682" - integrity sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw== - -"@esbuild/android-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.20.tgz#35cf419c4cfc8babe8893d296cd990e9e9f756f2" - integrity sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg== - -"@esbuild/darwin-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz" - integrity sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA== - -"@esbuild/darwin-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz#d70d5790d8bf475556b67d0f8b7c5bdff053d85d" - integrity sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ== - -"@esbuild/freebsd-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz#98755cd12707f93f210e2494d6a4b51b96977f54" - integrity sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw== - -"@esbuild/freebsd-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz#c1eb2bff03915f87c29cece4c1a7fa1f423b066e" - integrity sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ== - -"@esbuild/linux-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz#bad4238bd8f4fc25b5a021280c770ab5fc3a02a0" - integrity sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA== - -"@esbuild/linux-arm@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz#3e617c61f33508a27150ee417543c8ab5acc73b0" - integrity sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg== - -"@esbuild/linux-ia32@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz#699391cccba9aee6019b7f9892eb99219f1570a7" - integrity sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA== - -"@esbuild/linux-loong64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz#e6fccb7aac178dd2ffb9860465ac89d7f23b977d" - integrity sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg== - -"@esbuild/linux-mips64el@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz#eeff3a937de9c2310de30622a957ad1bd9183231" - integrity sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ== - -"@esbuild/linux-ppc64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz#2f7156bde20b01527993e6881435ad79ba9599fb" - integrity sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA== - -"@esbuild/linux-riscv64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz#6628389f210123d8b4743045af8caa7d4ddfc7a6" - integrity sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A== - -"@esbuild/linux-s390x@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz#255e81fb289b101026131858ab99fba63dcf0071" - integrity sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ== - "@esbuild/linux-x64@0.18.20": version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz#c7690b3417af318a9b6f96df3031a8865176d338" + resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz" integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w== -"@esbuild/netbsd-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz#30e8cd8a3dded63975e2df2438ca109601ebe0d1" - integrity sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A== - -"@esbuild/openbsd-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz#7812af31b205055874c8082ea9cf9ab0da6217ae" - integrity sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg== - -"@esbuild/sunos-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz#d5c275c3b4e73c9b0ecd38d1ca62c020f887ab9d" - integrity sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ== - -"@esbuild/win32-arm64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz#73bc7f5a9f8a77805f357fab97f290d0e4820ac9" - integrity sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg== - -"@esbuild/win32-ia32@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz#ec93cbf0ef1085cc12e71e0d661d20569ff42102" - integrity sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g== - -"@esbuild/win32-x64@0.18.20": - version "0.18.20" - resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" - integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ== - "@eslint-community/eslint-utils@^4.2.0": version "4.7.0" resolved "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz" @@ -333,7 +228,7 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.29.0", "@eslint/js@^9.25.0": +"@eslint/js@^9.25.0", "@eslint/js@9.29.0": version "9.29.0" resolved "https://registry.npmjs.org/@eslint/js/-/js-9.29.0.tgz" integrity sha512-3PIF4cBw/y+1u2EazflInpV+lYsSG0aByVIQzAgb1m1MhHFSbqTyNqtBKHgWf/9Ykud+DhILS9EGkmekVhbKoQ== @@ -411,74 +306,19 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@parcel/watcher-android-arm64@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz#507f836d7e2042f798c7d07ad19c3546f9848ac1" - integrity sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA== - -"@parcel/watcher-darwin-arm64@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz#3d26dce38de6590ef79c47ec2c55793c06ad4f67" - integrity sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw== - -"@parcel/watcher-darwin-x64@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz#99f3af3869069ccf774e4ddfccf7e64fd2311ef8" - integrity sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg== - -"@parcel/watcher-freebsd-x64@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz#14d6857741a9f51dfe51d5b08b7c8afdbc73ad9b" - integrity sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ== - -"@parcel/watcher-linux-arm-glibc@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz#43c3246d6892381db473bb4f663229ad20b609a1" - integrity sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA== - -"@parcel/watcher-linux-arm-musl@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz#663750f7090bb6278d2210de643eb8a3f780d08e" - integrity sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q== - -"@parcel/watcher-linux-arm64-glibc@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz#ba60e1f56977f7e47cd7e31ad65d15fdcbd07e30" - integrity sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w== - -"@parcel/watcher-linux-arm64-musl@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz#f7fbcdff2f04c526f96eac01f97419a6a99855d2" - integrity sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg== - "@parcel/watcher-linux-x64-glibc@2.5.1": version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz#4d2ea0f633eb1917d83d483392ce6181b6a92e4e" + resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz" integrity sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A== "@parcel/watcher-linux-x64-musl@2.5.1": version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz#277b346b05db54f55657301dd77bdf99d63606ee" + resolved "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz" integrity sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg== -"@parcel/watcher-win32-arm64@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz#7e9e02a26784d47503de1d10e8eab6cceb524243" - integrity sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw== - -"@parcel/watcher-win32-ia32@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz#2d0f94fa59a873cdc584bf7f6b1dc628ddf976e6" - integrity sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ== - -"@parcel/watcher-win32-x64@2.5.1": - version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz#ae52693259664ba6f2228fa61d7ee44b64ea0947" - integrity sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA== - "@parcel/watcher@^2.4.1": version "2.5.1" - resolved "https://registry.yarnpkg.com/@parcel/watcher/-/watcher-2.5.1.tgz#342507a9cfaaf172479a882309def1e991fb1200" + resolved "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz" integrity sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg== dependencies: detect-libc "^1.0.3" @@ -505,6 +345,98 @@ resolved "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.11.tgz" integrity sha512-L/gAA/hyCSuzTF1ftlzUSI/IKr2POHsv1Dd78GfqkR83KMNuswWD61JxGV2L7nRwBBBSDr6R1gCkdTmoN7W4ag== +"@rollup/pluginutils@^5.2.0": + version "5.3.0" + resolved "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz" + integrity sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q== + dependencies: + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^4.0.2" + +"@svgr/babel-plugin-add-jsx-attribute@8.0.0": + version "8.0.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz" + integrity sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g== + +"@svgr/babel-plugin-remove-jsx-attribute@8.0.0": + version "8.0.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz" + integrity sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA== + +"@svgr/babel-plugin-remove-jsx-empty-expression@8.0.0": + version "8.0.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz" + integrity sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA== + +"@svgr/babel-plugin-replace-jsx-attribute-value@8.0.0": + version "8.0.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-replace-jsx-attribute-value/-/babel-plugin-replace-jsx-attribute-value-8.0.0.tgz" + integrity sha512-KVQ+PtIjb1BuYT3ht8M5KbzWBhdAjjUPdlMtpuw/VjT8coTrItWX6Qafl9+ji831JaJcu6PJNKCV0bp01lBNzQ== + +"@svgr/babel-plugin-svg-dynamic-title@8.0.0": + version "8.0.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-svg-dynamic-title/-/babel-plugin-svg-dynamic-title-8.0.0.tgz" + integrity sha512-omNiKqwjNmOQJ2v6ge4SErBbkooV2aAWwaPFs2vUY7p7GhVkzRkJ00kILXQvRhA6miHnNpXv7MRnnSjdRjK8og== + +"@svgr/babel-plugin-svg-em-dimensions@8.0.0": + version "8.0.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-svg-em-dimensions/-/babel-plugin-svg-em-dimensions-8.0.0.tgz" + integrity sha512-mURHYnu6Iw3UBTbhGwE/vsngtCIbHE43xCRK7kCw4t01xyGqb2Pd+WXekRRoFOBIY29ZoOhUCTEweDMdrjfi9g== + +"@svgr/babel-plugin-transform-react-native-svg@8.1.0": + version "8.1.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-transform-react-native-svg/-/babel-plugin-transform-react-native-svg-8.1.0.tgz" + integrity sha512-Tx8T58CHo+7nwJ+EhUwx3LfdNSG9R2OKfaIXXs5soiy5HtgoAEkDay9LIimLOcG8dJQH1wPZp/cnAv6S9CrR1Q== + +"@svgr/babel-plugin-transform-svg-component@8.0.0": + version "8.0.0" + resolved "https://registry.npmjs.org/@svgr/babel-plugin-transform-svg-component/-/babel-plugin-transform-svg-component-8.0.0.tgz" + integrity sha512-DFx8xa3cZXTdb/k3kfPeaixecQLgKh5NVBMwD0AQxOzcZawK4oo1Jh9LbrcACUivsCA7TLG8eeWgrDXjTMhRmw== + +"@svgr/babel-preset@8.1.0": + version "8.1.0" + resolved "https://registry.npmjs.org/@svgr/babel-preset/-/babel-preset-8.1.0.tgz" + integrity sha512-7EYDbHE7MxHpv4sxvnVPngw5fuR6pw79SkcrILHJ/iMpuKySNCl5W1qcwPEpU+LgyRXOaAFgH0KhwD18wwg6ug== + dependencies: + "@svgr/babel-plugin-add-jsx-attribute" "8.0.0" + "@svgr/babel-plugin-remove-jsx-attribute" "8.0.0" + "@svgr/babel-plugin-remove-jsx-empty-expression" "8.0.0" + "@svgr/babel-plugin-replace-jsx-attribute-value" "8.0.0" + "@svgr/babel-plugin-svg-dynamic-title" "8.0.0" + "@svgr/babel-plugin-svg-em-dimensions" "8.0.0" + "@svgr/babel-plugin-transform-react-native-svg" "8.1.0" + "@svgr/babel-plugin-transform-svg-component" "8.0.0" + +"@svgr/core@*", "@svgr/core@^8.1.0": + version "8.1.0" + resolved "https://registry.npmjs.org/@svgr/core/-/core-8.1.0.tgz" + integrity sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA== + dependencies: + "@babel/core" "^7.21.3" + "@svgr/babel-preset" "8.1.0" + camelcase "^6.2.0" + cosmiconfig "^8.1.3" + snake-case "^3.0.4" + +"@svgr/hast-util-to-babel-ast@8.0.0": + version "8.0.0" + resolved "https://registry.npmjs.org/@svgr/hast-util-to-babel-ast/-/hast-util-to-babel-ast-8.0.0.tgz" + integrity sha512-EbDKwO9GpfWP4jN9sGdYwPBU0kdomaPIL2Eu4YwmgP+sJeXT+L7bMwJUBnhzfH8Q2qMBqZ4fJwpCyYsAN3mt2Q== + dependencies: + "@babel/types" "^7.21.3" + entities "^4.4.0" + +"@svgr/plugin-jsx@^8.1.0": + version "8.1.0" + resolved "https://registry.npmjs.org/@svgr/plugin-jsx/-/plugin-jsx-8.1.0.tgz" + integrity sha512-0xiIyBsLlr8quN+WyuxooNW9RJ0Dpr8uOnH/xrCVO8GLUcwHISwj1AG0k+LFzteTkAA0GbX0kj9q6Dk70PTiPA== + dependencies: + "@babel/core" "^7.21.3" + "@svgr/babel-preset" "8.1.0" + "@svgr/hast-util-to-babel-ast" "8.0.0" + svg-parser "^2.0.4" + "@types/babel__core@^7.20.5": version "7.20.5" resolved "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz" @@ -538,7 +470,7 @@ dependencies: "@babel/types" "^7.20.7" -"@types/estree@^1.0.6": +"@types/estree@^1.0.0", "@types/estree@^1.0.6": version "1.0.8" resolved "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz" integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== @@ -553,7 +485,7 @@ resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.6.tgz" integrity sha512-4hOiT/dwO8Ko0gV1m/TJZYk3y0KBnY9vzDh7W+DH17b2HFSOGgdj33dhihPeuy3l0q23+4e+hoXHV6hCC4dCXw== -"@types/react@^19.1.2": +"@types/react@^19.0.0", "@types/react@^19.1.2": version "19.1.8" resolved "https://registry.npmjs.org/@types/react/-/react-19.1.8.tgz" integrity sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g== @@ -613,7 +545,7 @@ acorn-jsx@^5.3.2: resolved "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.15.0: +"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.15.0: version "8.15.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz" integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== @@ -665,12 +597,12 @@ brace-expansion@^1.1.7: braces@^3.0.3: version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: fill-range "^7.1.1" -browserslist@^4.24.0: +browserslist@^4.24.0, "browserslist@>= 4.21.0": version "4.25.0" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz" integrity sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA== @@ -685,6 +617,11 @@ callsites@^3.0.0: resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== +camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + caniuse-lite@^1.0.30001718: version "1.0.30001723" resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001723.tgz" @@ -700,7 +637,7 @@ chalk@^4.0.0: chokidar@^4.0.0: version "4.0.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-4.0.3.tgz#7be37a4c03c9aee1ecfe862a4a23b2c70c205d30" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz" integrity sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA== dependencies: readdirp "^4.0.1" @@ -732,6 +669,16 @@ cookie@^1.0.1: resolved "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz" integrity sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA== +cosmiconfig@^8.1.3: + version "8.3.6" + resolved "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz" + integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== + dependencies: + import-fresh "^3.3.0" + js-yaml "^4.1.0" + parse-json "^5.2.0" + path-type "^4.0.0" + cross-spawn@^7.0.6: version "7.0.6" resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz" @@ -760,7 +707,7 @@ deep-is@^0.1.3: detect-libc@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + resolved "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz" integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== dom-walk@^0.1.0: @@ -768,11 +715,31 @@ dom-walk@^0.1.0: resolved "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz" integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + electron-to-chromium@^1.5.160: version "1.5.168" resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.168.tgz" integrity sha512-RUNQmFLNIWVW6+z32EJQ5+qx8ci6RGvdtDC0Ls+F89wz6I2AthpXF0w0DIrn2jpLX0/PU9ZCo+Qp7bg/EckJmA== +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + +error-ex@^1.3.1: + version "1.3.4" + resolved "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz" + integrity sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ== + dependencies: + is-arrayish "^0.2.1" + esbuild@^0.18.10: version "0.18.20" resolved "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz" @@ -839,7 +806,7 @@ eslint-visitor-keys@^4.2.1: resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz" integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== -eslint@^9.25.0: +"eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@^9.25.0, eslint@>=8.40: version "9.29.0" resolved "https://registry.npmjs.org/eslint/-/eslint-9.29.0.tgz" integrity sha512-GsGizj2Y1rCWDu6XoEekL3RLilp0voSePurjZIkxL3wlm5o5EC9VpgaP7lrCvjnkuLvzFBQWB3vWB3K5KQTveQ== @@ -908,6 +875,11 @@ estraverse@^5.1.0, estraverse@^5.2.0: resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-walker@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" @@ -937,7 +909,7 @@ file-entry-cache@^8.0.0: fill-range@^7.1.1: version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz" integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" @@ -963,11 +935,6 @@ flatted@^3.2.9: resolved "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz" integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== -fsevents@~2.3.2: - version "2.3.3" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" - integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== - gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz" @@ -980,7 +947,7 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" -global@4.4.0, global@^4.3.1, global@^4.4.0, global@~4.4.0: +global@^4.3.1, global@^4.4.0, global@~4.4.0, global@4.4.0: version "4.4.0" resolved "https://registry.npmjs.org/global/-/global-4.4.0.tgz" integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== @@ -1015,10 +982,10 @@ ignore@^5.2.0: immutable@^5.0.2: version "5.1.3" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-5.1.3.tgz#e6486694c8b76c37c063cca92399fa64098634d4" + resolved "https://registry.npmjs.org/immutable/-/immutable-5.1.3.tgz" integrity sha512-+chQdDfvscSF1SJqv2gn4SRO2ZyS3xL3r7IW/wWEEzrzLisnOlKiQu5ytC/BVNcS15C39WT2Hg/bjKjDMcu+zg== -import-fresh@^3.2.1: +import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.1" resolved "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz" integrity sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ== @@ -1031,6 +998,11 @@ imurmurhash@^0.1.4: resolved "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" @@ -1050,7 +1022,7 @@ is-glob@^4.0.0, is-glob@^4.0.3: is-number@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== isexe@^2.0.0: @@ -1080,6 +1052,11 @@ json-buffer@3.0.1: resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" @@ -1110,6 +1087,11 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + locate-path@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" @@ -1122,6 +1104,13 @@ lodash.merge@^4.6.2: resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz" @@ -1140,7 +1129,7 @@ m3u8-parser@^7.2.0: micromatch@^4.0.5: version "4.0.8" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: braces "^3.0.3" @@ -1175,7 +1164,7 @@ ms@^2.1.3: resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -mux.js@7.1.0, mux.js@^7.0.1: +mux.js@^7.0.1, mux.js@7.1.0: version "7.1.0" resolved "https://registry.npmjs.org/mux.js/-/mux.js-7.1.0.tgz" integrity sha512-NTxawK/BBELJrYsZThEulyUMDVlLizKdxyAsMuzoCD1eFj97BVaA8D/CvKsKu6FOLYkFojN5CbM9h++ZTZtknA== @@ -1193,9 +1182,17 @@ natural-compare@^1.4.0: resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + node-addon-api@^7.0.0: version "7.1.1" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.1.1.tgz#1aba6693b0f255258a049d621329329322aad558" + resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz" integrity sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ== node-releases@^2.0.19: @@ -1236,6 +1233,16 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" @@ -1246,6 +1253,11 @@ path-key@^3.1.0: resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + picocolors@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz" @@ -1253,9 +1265,14 @@ picocolors@^1.1.1: picomatch@^2.3.1: version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.2: + version "4.0.3" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== + pkcs7@^1.0.4: version "1.0.4" resolved "https://registry.npmjs.org/pkcs7/-/pkcs7-1.0.4.tgz" @@ -1279,7 +1296,7 @@ prelude-ls@^1.2.1: prettier@^3.6.0: version "3.6.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" + resolved "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz" integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== process@^0.11.10: @@ -1292,7 +1309,7 @@ punycode@^2.1.0: resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== -react-dom@^19.1.0: +react-dom@^19.1.0, react-dom@>=18: version "19.1.0" resolved "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz" integrity sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g== @@ -1319,14 +1336,14 @@ react-router@7.6.2: cookie "^1.0.1" set-cookie-parser "^2.6.0" -react@^19.1.0: +react@^19.1.0, react@>=18: version "19.1.0" resolved "https://registry.npmjs.org/react/-/react-19.1.0.tgz" integrity sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg== readdirp@^4.0.1: version "4.1.2" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-4.1.2.tgz#eb85801435fbf2a7ee58f19e0921b068fc69948d" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz" integrity sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg== resolve-from@^4.0.0: @@ -1334,17 +1351,17 @@ resolve-from@^4.0.0: resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -rollup@^3.27.1: +rollup@^1.20.0||^2.0.0||^3.0.0||^4.0.0, rollup@^3.27.1: version "3.29.5" resolved "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz" integrity sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w== optionalDependencies: fsevents "~2.3.2" -sass@^1.89.2: - version "1.89.2" - resolved "https://registry.yarnpkg.com/sass/-/sass-1.89.2.tgz#a771716aeae774e2b529f72c0ff2dfd46c9de10e" - integrity sha512-xCmtksBKd/jdJ9Bt9p7nPKiuqrlBMBuuGkQlkhZjjQk3Ty48lv93k5Dq6OPkKt4XwxDJ7tvlfrTa1MPA9bf+QA== +sass@*, sass@^1.89.2: + version "1.93.2" + resolved "https://registry.npmjs.org/sass/-/sass-1.93.2.tgz" + integrity sha512-t+YPtOQHpGW1QWsh1CHQ5cPIr9lbbGZLZnbihP/D/qZj/yuV68m8qarcV17nvkOX81BCrvzAlq2klCQFZghyTg== dependencies: chokidar "^4.0.0" immutable "^5.0.2" @@ -1379,7 +1396,15 @@ shebang-regex@^3.0.0: resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== -"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.2.1: +snake-case@^3.0.4: + version "3.0.4" + resolved "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz" + integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +source-map-js@^1.2.1, "source-map-js@>=0.6.2 <2.0.0": version "1.2.1" resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz" integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== @@ -1396,13 +1421,23 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +svg-parser@^2.0.4: + version "2.0.4" + resolved "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz" + integrity sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ== + to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" +tslib@^2.0.3: + version "2.8.1" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz" @@ -1425,7 +1460,7 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -"video.js@^7 || ^8", video.js@^8.23.3: +"video.js@^7 || ^8", video.js@^8, video.js@^8.23.3: version "8.23.3" resolved "https://registry.npmjs.org/video.js/-/video.js-8.23.3.tgz" integrity sha512-Toe0VLlDZcUhiaWfcePS1OEdT3ATfktm0hk/PELfD7zUoPDHeT+cJf/wZmCy5M5eGVwtGUg25RWPCj1L/1XufA== @@ -1462,7 +1497,16 @@ videojs-vtt.js@0.15.5: dependencies: global "^4.3.1" -vite@^4.5.14: +vite-plugin-svgr@^4.5.0: + version "4.5.0" + resolved "https://registry.npmjs.org/vite-plugin-svgr/-/vite-plugin-svgr-4.5.0.tgz" + integrity sha512-W+uoSpmVkSmNOGPSsDCWVW/DDAyv+9fap9AZXBvWiQqrboJ08j2vh0tFxTD/LjwqwAd3yYSVJgm54S/1GhbdnA== + dependencies: + "@rollup/pluginutils" "^5.2.0" + "@svgr/core" "^8.1.0" + "@svgr/plugin-jsx" "^8.1.0" + +"vite@^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0", vite@^4.5.14, vite@>=2.6.0: version "4.5.14" resolved "https://registry.npmjs.org/vite/-/vite-4.5.14.tgz" integrity sha512-+v57oAaoYNnO3hIu5Z/tJRZjq5aHM2zDve9YZ8HngVHbhk66RStobhb1sqPMIPEleV6cNKYK4eGrAbE9Ulbl2g== diff --git a/frontend/src/static/js/components/VideoJS/VideoJSEmbed.jsx b/frontend/src/static/js/components/VideoJS/VideoJSEmbed.jsx index 0e16c061..ce51675f 100644 --- a/frontend/src/static/js/components/VideoJS/VideoJSEmbed.jsx +++ b/frontend/src/static/js/components/VideoJS/VideoJSEmbed.jsx @@ -36,6 +36,7 @@ const VideoJSEmbed = ({ showRelated, showUserAvatar, linkTitle, + parentMediaBase, hasTheaterMode, hasNextLink, nextLink, @@ -89,6 +90,7 @@ const VideoJSEmbed = ({ previewSprite: previewSprite || null, subtitlesInfo: subtitlesInfo || [], inEmbed: inEmbed || false, + parentMediaBase: parentMediaBase || null, showTitle: showTitle || false, showRelated: showRelated !== undefined ? showRelated : (urlShowRelated === '1' || urlShowRelated === 'true' || urlShowRelated === null), showUserAvatar: showUserAvatar !== undefined ? showUserAvatar : (urlShowUserAvatar === '1' || urlShowUserAvatar === 'true' || urlShowUserAvatar === null), diff --git a/frontend/src/static/js/components/media-viewer/VideoViewer/index.js b/frontend/src/static/js/components/media-viewer/VideoViewer/index.js index f4cfd02e..83f29f4a 100644 --- a/frontend/src/static/js/components/media-viewer/VideoViewer/index.js +++ b/frontend/src/static/js/components/media-viewer/VideoViewer/index.js @@ -180,9 +180,9 @@ export default class VideoViewer extends React.PureComponent { if (titleLink) { titleLink.setAttribute('class', 'title-link'); - titleLink.setAttribute('href', this.props.data.url); - titleLink.setAttribute('title', this.props.data.title); + titleLink.setAttribute('href', this.props.data.url || '#'); titleLink.setAttribute('target', linkTarget); + titleLink.setAttribute('title', this.props.data.title); titleLink.innerHTML = this.props.data.title; } @@ -413,6 +413,7 @@ export default class VideoViewer extends React.PureComponent { previewSprite: previewSprite, subtitlesInfo: this.props.data.subtitles_info, inEmbed: this.props.inEmbed, + parentMediaBase: this.props.parentMediaBase || null, showTitle: this.props.showTitle, showRelated: this.props.showRelated, showUserAvatar: this.props.showUserAvatar, diff --git a/frontend/src/static/js/pages/EmbedPage.tsx b/frontend/src/static/js/pages/EmbedPage.tsx index a91d4d69..8ed38e63 100644 --- a/frontend/src/static/js/pages/EmbedPage.tsx +++ b/frontend/src/static/js/pages/EmbedPage.tsx @@ -2,6 +2,7 @@ import React, { useState, useEffect, CSSProperties } from 'react'; import { SiteConsumer } from '../utils/contexts/'; import { MediaPageStore } from '../utils/stores/'; import { MediaPageActions } from '../utils/actions/'; +import { getParentMediaBase } from '../utils/helpers/'; import VideoViewer from '../components/media-viewer/VideoViewer'; const wrapperStyles = { @@ -72,16 +73,20 @@ export const EmbedPage: React.FC = () => { const urlTimestamp = urlParams.get('t'); const timestamp = urlTimestamp ? parseInt(urlTimestamp, 10) : null; + const parentMediaBase = getParentMediaBase(); + return ( - ); }} diff --git a/frontend/src/static/js/utils/helpers/embeddedApp.ts b/frontend/src/static/js/utils/helpers/embeddedApp.ts index 612a3119..bd06f294 100644 --- a/frontend/src/static/js/utils/helpers/embeddedApp.ts +++ b/frontend/src/static/js/utils/helpers/embeddedApp.ts @@ -58,6 +58,33 @@ export function inSelectMediaEmbedMode() { return inEmbeddedApp() && isSelectMediaMode(); } +// When MediaCMS is embedded inside a host platform (e.g. an LMS), the host passes a +// `parent_media_base` URL via LTI custom params so that media title links in the embed +// player navigate the parent frame to the host's own media viewer (e.g. Moodle My Media) +// instead of opening a bare MediaCMS URL. The VideoViewer appends `?token=` +// and uses `target="_parent"` to perform the navigation. +export function getParentMediaBase(): string | null { + try { + const params = new URL(globalThis.location.href).searchParams; + const mode = params.get('mode'); + const base = params.get('parent_media_base'); + + if (mode === 'standard') { + sessionStorage.removeItem('parent_media_base'); + return null; + } + + if (base) { + sessionStorage.setItem('parent_media_base', base); + return base; + } + + return sessionStorage.getItem('parent_media_base'); + } catch (e) { + return null; + } +} + export function getLtiContextId(): string | null { try { const params = new URL(globalThis.location.href).searchParams; diff --git a/frontend/src/static/js/utils/helpers/index.js b/frontend/src/static/js/utils/helpers/index.js index d0d02587..bafe8114 100644 --- a/frontend/src/static/js/utils/helpers/index.js +++ b/frontend/src/static/js/utils/helpers/index.js @@ -14,4 +14,4 @@ export * from './quickSort'; export * from './requests'; export { translateString } from './translate'; export { replaceString } from './replacementStrings'; -export { inEmbeddedApp, inSelectMediaEmbedMode, isSelectMediaMode, isShareMediaDisabled } from './embeddedApp'; +export { getParentMediaBase, inEmbeddedApp, inSelectMediaEmbedMode, isSelectMediaMode, isShareMediaDisabled } from './embeddedApp'; diff --git a/lms-plugins/mediacms-moodle/filter/mediacms/classes/text_filter.php b/lms-plugins/mediacms-moodle/filter/mediacms/classes/text_filter.php index 7b11d9aa..b0cb1395 100644 --- a/lms-plugins/mediacms-moodle/filter/mediacms/classes/text_filter.php +++ b/lms-plugins/mediacms-moodle/filter/mediacms/classes/text_filter.php @@ -39,9 +39,18 @@ class text_filter extends \core_filters\text_filter { $pattern_tag = '/\[mediacms:([a-zA-Z0-9]+)\]/'; $newtext = preg_replace_callback($pattern_tag, [$this, 'callback_tag'], $newtext); - // 2. Auto-convert MediaCMS URLs to embedded players + // 2a. Convert MediaCMS URLs that are already inside `;const e=V.split(":"),t=`${e[0]} / ${e[1]}`;return``}return``}()}),n.createElement("div",{className:"iframe-config"},n.createElement("div",{className:"iframe-config-options-title"},"Embed options"),n.createElement("div",{className:"iframe-config-option"},n.createElement("div",{className:"option-content"},n.createElement("div",{className:"ratio-options",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 10px"}},n.createElement("div",{className:"options-group"},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap"}},n.createElement("input",{type:"checkbox",checked:E,onChange:function(){y(!E)}}),"Show title")),n.createElement("div",{className:"options-group"},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap",opacity:E?1:.5}},n.createElement("input",{type:"checkbox",checked:M,onChange:function(){k(!M)},disabled:!E}),"Link title")),n.createElement("div",{className:"options-group"},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap"}},n.createElement("input",{type:"checkbox",checked:b,onChange:function(){S(!b)}}),"Show related")),n.createElement("div",{className:"options-group"},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap",opacity:E?1:.5}},n.createElement("input",{type:"checkbox",checked:w,onChange:function(){P(!w)},disabled:!E}),"Show user avatar")),n.createElement("div",{className:"options-group",style:{display:"flex",alignItems:"center"}},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap",display:"flex",alignItems:"center",marginRight:"10px"}},n.createElement("input",{type:"checkbox",checked:_,onChange:function(){const e=!_;if(N(e),e)v(!1);else if("custom"!==V){const e=V.split(":"),t=e[0],a=e[1];v(!0),F(parseInt(A*a/t,10))}else v(!1)}}),"Responsive")),n.createElement("div",{className:"options-group",style:{display:"flex",alignItems:"center"}},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap",display:"flex",alignItems:"center",marginRight:"10px"}},n.createElement("input",{type:"checkbox",checked:C,onChange:function(){x(!C)}}),"Start at"),C&&n.createElement("input",{type:"text",value:L,onChange:function(e){I(e.target.value)},style:{width:"60px",height:"28px",fontSize:"12px",padding:"2px 5px"}})),n.createElement("div",{className:"options-group",style:{display:"flex",flexDirection:"column",justifyContent:"center"}},n.createElement("div",{style:{fontSize:"12px",marginBottom:"4px",color:"rgba(0,0,0,0.6)"}},"Aspect Ratio"),n.createElement("div",{style:{display:"flex",alignItems:"center"}},n.createElement("select",{ref:o,onChange:function(){const e=o.current.value;if("custom"===e)T(e),v(!1);else{const t=e.split(":"),a=t[0],i=t[1];T(e),v(!0),F(parseInt(A*i/a,10))}},value:V,style:{height:"28px",fontSize:"12px"}},n.createElement("option",{value:"16:9"},"16:9"),n.createElement("option",{value:"4:3"},"4:3"),n.createElement("option",{value:"3:2"},"3:2"),n.createElement("option",{value:"custom"},"Custom"))))),n.createElement("br",null),!_&&n.createElement(n.Fragment,null,n.createElement("div",{className:"options-group"},n.createElement(s.NumericInputWithUnit,{valueCallback:function(e){e=""===e?0:e;const t=V.split(":"),a=t[0],i=t[1];R(e),F(h?parseInt(e*i/a,10):O)},unitCallback:function(e){D(e)},label:"Width",defaultValue:parseInt(A,10),defaultUnit:U,minValue:1,maxValue:99999,units:z})),n.createElement("div",{className:"options-group"},n.createElement(s.NumericInputWithUnit,{valueCallback:function(e){e=""===e?0:e;const t=V.split(":"),a=t[0],i=t[1];F(e),R(h?parseInt(e*a/i,10):A)},unitCallback:function(e){j(e)},label:"Height",defaultValue:parseInt(O,10),defaultUnit:H,minValue:1,maxValue:99999,units:z}))))))),n.createElement("div",{ref:u,className:"on-right-bottom"},n.createElement("button",{onClick:function(){f.MediaPageActions.copyEmbedMediaCode(m.current.querySelector("textarea"))}},"COPY")))))}te.propTypes={triggerPopupClose:h().func};var ae=a(5289);function ie(e){let{onClick:t}=e;return n.createElement("span",{className:"next-slide"},n.createElement(s.CircleIconButton,{buttonShadow:!0,onClick:t},n.createElement("i",{className:"material-icons"},"keyboard_arrow_right")))}function ne(e){let{onClick:t}=e;return n.createElement("span",{className:"previous-slide"},n.createElement(s.CircleIconButton,{buttonShadow:!0,onClick:t},n.createElement("i",{className:"material-icons"},"keyboard_arrow_left")))}function le(){return{maxFormContentHeight:window.innerHeight-196,maxPopupWidth:518>window.innerWidth-80?window.innerWidth-80:null}}function re(e){const t=(0,n.useRef)(null),a=(0,n.useRef)(null),i=r.MediaPageStore.get("media-url"),[o,s]=(0,n.useState)(null),[d,c]=(0,n.useState)({prev:!1,next:!1}),[m,u]=(0,n.useState)(le()),[p]=(0,n.useState)(function(){const e=function(){const e=l.ShareOptionsContext._currentValue,t=r.MediaPageStore.get("media-url"),a=(r.MediaPageStore.get("media-data").title,{});let i=0;for(;i{s(new ae.A(a.current,".sh-option"))}),[p]),(0,n.useEffect)((()=>{o&&(o.updateDataStateOnResize(p.length,!0,!0),k())}),[m,o]),(0,n.useEffect)((()=>{r.PageStore.on("window_resize",P),r.MediaPageStore.on("copied_media_link",M);const e=function(){const e=document.getElementsByTagName("video");return e[0]?.currentTime}();return h(e),E(function(e){let t=parseInt(e,10),a=Math.floor(t/3600),i=Math.floor((t-3600*a)/60),n=t-3600*a-60*i;return a<10&&(a="0"+a),i<10&&(i="0"+i),n<10&&(n="0"+n),a>=1?a+":"+i+":"+n:i+":"+n}(e)),()=>{r.PageStore.removeListener("window_resize",P),r.MediaPageStore.removeListener("copied_media_link",M),s(null)}}),[]),n.createElement("div",{ref:t,style:null!==m.maxPopupWidth?{maxWidth:m.maxPopupWidth+"px"}:null},n.createElement("div",{className:"scrollable-content",style:null!==m.maxFormContentHeight?{maxHeight:m.maxFormContentHeight+"px"}:null},n.createElement("div",{className:"share-popup-title"},"Share media"),p.length?n.createElement("div",{className:"share-options"},d.prev?n.createElement(ne,{onClick:function(){o.previousSlide(),k()}}):null,n.createElement("div",{ref:a,className:"share-options-inner"},p),d.next?n.createElement(ie,{onClick:function(){o.nextSlide(),k()}}):null):null),n.createElement("div",{className:"copy-field"},n.createElement("div",null,n.createElement("input",{type:"text",readOnly:!0,value:S}),n.createElement("button",{onClick:function(){f.MediaPageActions.copyShareLink(t.current.querySelector(".copy-field input"))}},"COPY"))),n.createElement("div",{className:"start-at"},n.createElement("label",null,n.createElement("input",{type:"checkbox",name:"start-at-checkbox",id:"id-start-at-checkbox",checked:y,onChange:function(){b(!y),function(){const e=y?i:i+"&t="+Math.trunc(g);w(e)}()}}),"Start at ",v)))}function oe(){return{shareOptions:n.createElement("div",{className:"popup-fullscreen"},n.createElement(s.PopupMain,null,n.createElement("span",{className:"popup-fullscreen-overlay"}),n.createElement(re,null)))}}function se(e){const[t,a,i]=(0,C.usePopup)(),[l,r]=(0,n.useState)("shareOptions");return n.createElement("div",{className:"share"},n.createElement(i,{contentRef:t},n.createElement("button",null,n.createElement(s.CircleIconButton,{type:"span"},n.createElement(s.MaterialIcon,{type:"share"})),n.createElement("span",null,(0,v.translateString)("SHARE")))),n.createElement(a,{contentRef:t,hideCallback:function(){r("shareOptions")}},n.createElement(s.NavigationContentApp,{initPage:l,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id",pages:e.isVideo?(o=function(){t.current.toggle()},{...oe(),shareEmbed:n.createElement("div",{className:"popup-fullscreen share-embed-popup"},n.createElement(s.PopupMain,null,n.createElement("span",{className:"popup-fullscreen-overlay"}),n.createElement(te,{triggerPopupClose:o})))}):oe(),focusFirstItemOnPageChange:!1,pageChangeCallback:function(e){r(e)}})));var o}function de(e){return n.createElement("div",{className:"download hidden-only-in-small"},n.createElement("a",{href:e.link,target:"_blank",download:e.title,title:"Download",rel:"noreferrer"},n.createElement(s.CircleIconButton,{type:"span"},n.createElement(s.MaterialIcon,{type:"arrow_downward"})),n.createElement("span",null,"DOWNLOAD")))}function ce(){const e=r.MediaPageStore.get("media-data"),t=(e.title,e.encodings_info),a={};let i,n;for(i in t)if(t.hasOwnProperty(i)&&Object.keys(t[i]).length)for(n in t[i])if(t[i].hasOwnProperty(n)&&"success"===t[i][n].status&&100===t[i][n].progress&&null!==t[i][n].url){const r=e.original_media_url,o=r?r.substring(r.lastIndexOf("/")+1):e.title;a[t[i][n].title]={text:i+" - "+n.toUpperCase()+" ("+t[i][n].size+")",link:(0,v.formatInnerLink)(e.original_media_url,l.SiteContext._currentValue.url),linkAttr:{target:"_blank",download:o}}}const o=e.original_media_url,s=o?o.substring(o.lastIndexOf("/")+1):e.title;return a.original_media_url={text:"Original file ("+e.size+")",link:(0,v.formatInnerLink)(e.original_media_url,l.SiteContext._currentValue.url),linkAttr:{target:"_blank",download:s}},Object.values(a)}function me(e){const[t,a,i]=(0,C.usePopup)(),[l,r]=(0,n.useState)("main");return n.createElement("div",{className:"video-downloads hidden-only-in-small"},n.createElement(i,{contentRef:t},n.createElement("button",null,n.createElement(s.CircleIconButton,{type:"span"},n.createElement(s.MaterialIcon,{type:"arrow_downward"})),n.createElement("span",null,(0,v.translateString)("DOWNLOAD")))),n.createElement("div",{className:"nav-page-"+l},n.createElement(a,{contentRef:t},n.createElement(s.NavigationContentApp,{pageChangeCallback:null,initPage:"main",focusFirstItemOnPageChange:!1,pages:{main:n.createElement("div",{className:"main-options"},n.createElement(s.PopupMain,null,n.createElement(s.NavigationMenuList,{items:ce()})))},pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"}))))}de.propTypes={link:h().string.isRequired,title:h().string.isRequired};class ue extends n.PureComponent{constructor(e){super(e),this.state={likedMedia:r.MediaPageStore.get("user-liked-media"),dislikedMedia:r.MediaPageStore.get("user-disliked-media")},this.downloadLink="video"!==r.MediaPageStore.get("media-type")?(0,v.formatInnerLink)(r.MediaPageStore.get("media-original-url"),l.SiteContext._currentValue.url):null;const t=r.MediaPageStore.get("media-original-url");this.downloadFilename=t?t.substring(t.lastIndexOf("/")+1):this.props.title,this.updateStateValues=this.updateStateValues.bind(this)}componentDidMount(){r.MediaPageStore.on("liked_media",this.updateStateValues),r.MediaPageStore.on("unliked_media",this.updateStateValues),r.MediaPageStore.on("disliked_media",this.updateStateValues),r.MediaPageStore.on("undisliked_media",this.updateStateValues);const e=document.querySelectorAll("[data-tooltip]");e.length&&e.forEach((e=>function(e){const t=document.body,a=document.createElement("span");function i(){const t=e.getBoundingClientRect();a.style.top=t.top-(0+a.offsetHeight)+"px",a.style.left=t.left+"px"}a.innerText=e.getAttribute("data-tooltip"),a.setAttribute("class","tooltip"),e.removeAttribute("data-tooltip"),e.addEventListener("mouseenter",(function(){const n=e.getBoundingClientRect();t.appendChild(a),a.style.top=n.top-(0+a.offsetHeight)+"px",a.style.left=n.left+"px",document.addEventListener("scroll",i)})),e.addEventListener("mouseleave",(function(){t.removeChild(a),a.style.top="",a.style.left="",document.removeEventListener("scroll",i)}))}(e)))}updateStateValues(){this.setState({likedMedia:r.MediaPageStore.get("user-liked-media"),dislikedMedia:r.MediaPageStore.get("user-disliked-media")})}mediaCategories(e){if(void 0===this.props.categories||null===this.props.categories||!this.props.categories.length)return null;let t=0,a=[];for(;t=this.props.views?"view":"views"):null,n.createElement("div",{className:"media-actions"},n.createElement("div",null,l.MemberContext._currentValue.can.likeMedia?n.createElement(W,null):null,l.MemberContext._currentValue.can.dislikeMedia?n.createElement(q,null):null,l.MemberContext._currentValue.can.shareMedia?n.createElement(se,{isVideo:!1}):null,!l.MemberContext._currentValue.is.anonymous&&l.MemberContext._currentValue.can.saveMedia?n.createElement(K,null):null,this.props.allowDownload&&l.MemberContext._currentValue.can.downloadMedia?this.downloadLink?n.createElement(de,{link:this.downloadLink,title:this.downloadFilename}):n.createElement(me,null):null,n.createElement(J,{allowDownload:this.props.allowDownload})))))}}ue.propTypes={allowDownload:h().bool.isRequired},ue.defaultProps={allowDownload:!1};class pe extends ue{render(){const e=r.PageStore.get("config-options").pages.media.displayViews&&void 0!==this.props.views,t=r.MediaPageStore.get("media-data"),a=t.state,i=t.is_shared;let o="";switch(a){case"private":o="The site admins have to make its access public";break;case"unlisted":o="The site admins have to make it appear on listings"}return n.createElement("div",{className:"media-title-banner"},e&&r.PageStore.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories(!0):null,void 0!==this.props.title?n.createElement("h1",null,this.props.title):null,i||"public"!==a?n.createElement("div",{className:"media-labels-area"},n.createElement("div",{className:"media-labels-area-inner"},i?n.createElement(n.Fragment,null,n.createElement("span",{className:"media-label-state"},n.createElement("span",null,"shared")),n.createElement("span",{className:"helper-icon","data-tooltip":"This media is shared with specific users or categories"},n.createElement("i",{className:"material-icons"},"help_outline"))):"public"!==a?n.createElement(n.Fragment,null,n.createElement("span",{className:"media-label-state"},n.createElement("span",null,a)),n.createElement("span",{className:"helper-icon","data-tooltip":o},n.createElement("i",{className:"material-icons"},"help_outline"))):null)):null,n.createElement("div",{className:"media-views-actions"+(this.state.likedMedia?" liked-media":"")+(this.state.dislikedMedia?" disliked-media":"")},!e&&r.PageStore.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories():null,e?n.createElement("div",{className:"media-views"},(0,v.formatViewsNumber)(this.props.views,!0)," ",1>=this.props.views?(0,v.translateString)("view"):(0,v.translateString)("views")):null,n.createElement("div",{className:"media-actions"},n.createElement("div",null,l.MemberContext._currentValue.can.likeMedia?n.createElement(W,null):null,l.MemberContext._currentValue.can.dislikeMedia?n.createElement(q,null):null,!(0,v.inEmbeddedApp)()&&l.MemberContext._currentValue.can.shareMedia?n.createElement(se,{isVideo:!0}):null,!l.MemberContext._currentValue.is.anonymous&&l.MemberContext._currentValue.can.saveMedia?n.createElement(K,null):null,this.props.allowDownload&&l.MemberContext._currentValue.can.downloadMedia?this.downloadLink?n.createElement(de,{link:this.downloadLink,title:this.downloadFilename}):n.createElement(me,null):null,n.createElement(J,{allowDownload:this.props.allowDownload})))))}}class ge extends n.PureComponent{constructor(e){super(e),this.state={videoLoaded:!1},this.onVideoLoad=this.onVideoLoad.bind(this),r.MediaPageStore.on("loaded_media_data",this.onVideoLoad)}onVideoLoad(){this.setState({videoLoaded:!0})}render(){let e,t,a,i,l,o,s=!1;return this.state.videoLoaded&&(s=r.MediaPageStore.get("media-data").allow_download,s=void 0===s||!!s,e=r.MediaPageStore.get("media-data").views,t=r.MediaPageStore.get("media-data").categories_info,a=r.MediaPageStore.get("media-data").title,i={name:r.MediaPageStore.get("media-data").author_name,url:r.MediaPageStore.get("media-data").author_profile,thumb:r.MediaPageStore.get("media-author-thumbnail-url")},l=r.MediaPageStore.get("media-data").add_date,o=r.MediaPageStore.get("media-data").description),this.state.videoLoaded?n.createElement("div",{className:"viewer-info"},n.createElement("div",{className:"viewer-info-inner"},n.createElement(ue,{title:a,views:e,categories:t,allowDownload:s}),n.createElement(B,{author:i,published:l,description:o}))):null}}class he extends ge{render(){let e,t,a,i,l,o,s=!1;return this.state.videoLoaded&&(s=r.MediaPageStore.get("media-data").allow_download,s=void 0===s||!!s,e=r.MediaPageStore.get("media-data").views,t=r.MediaPageStore.get("media-data").categories_info,a=r.MediaPageStore.get("media-data").title,i={name:r.MediaPageStore.get("media-data").author_name,url:r.MediaPageStore.get("media-data").author_profile,thumb:r.MediaPageStore.get("media-author-thumbnail-url")},l=r.MediaPageStore.get("media-data").add_date,o=r.MediaPageStore.get("media-data").description),this.state.videoLoaded?n.createElement("div",{className:"viewer-info"},n.createElement("div",{className:"viewer-info-inner"},n.createElement(pe,{title:a,views:e,categories:t,allowDownload:s}),n.createElement(B,{author:i,published:l,description:o}))):null}}class fe extends n.PureComponent{render(){return n.createElement("div",{className:"viewer-container",key:"viewer-container-error"},n.createElement("div",{className:"player-container player-container-error"},n.createElement("div",{className:"player-container-inner"},n.createElement("div",{className:"error-container"},n.createElement("div",{className:"error-container-inner"},n.createElement("span",{className:"icon-wrap"},n.createElement("i",{className:"material-icons"},"error_outline")),n.createElement("span",{className:"msg-wrap"},r.MediaPageStore.get("media-load-error-message")))))))}}var ve=a(4737);function Ee(e){return n.createElement(ve.k,{className:"items-list-hor",pageItems:9999,maxItems:9999,items:e.items,hideDate:!0,hideViews:!0,hidePlaylistOrderNumber:!1,horizontalItemsOrientation:!0,inPlaylistView:!0,singleLinkContent:!0,playlistActiveItem:e.playlistActiveItem})}Ee.propTypes={items:h().array.isRequired,playlistActiveItem:v.PositiveIntegerOrZero},Ee.defaultProps={playlistActiveItem:1};class ye extends n.PureComponent{constructor(e){super(e),this.state={expanded:!0,loopRepeat:r.PlaylistViewStore.get("enabled-loop"),shuffle:r.PlaylistViewStore.get("enabled-shuffle"),savedPlaylist:r.PlaylistViewStore.get("saved-playlist-loop"),title:e.playlistData.title,link:e.playlistData.url,authorName:e.playlistData.user,authorLink:l.LinksContext._currentValue.home+"/user/"+e.playlistData.user,activeItem:e.activeItem,totalMedia:e.playlistData.media_count,items:e.playlistData.playlist_media},this.onHeaderClick=this.onHeaderClick.bind(this),this.onLoopClick=this.onLoopClick.bind(this),this.onShuffleClick=this.onShuffleClick.bind(this),this.onSaveClick=this.onSaveClick.bind(this),this.onLoopRepeatUpdate=this.onLoopRepeatUpdate.bind(this),this.onShuffleUpdate=this.onShuffleUpdate.bind(this),this.onPlaylistSaveUpdate=this.onPlaylistSaveUpdate.bind(this),r.PlaylistViewStore.on("loop-repeat-updated",this.onLoopRepeatUpdate),r.PlaylistViewStore.on("shuffle-updated",this.onShuffleUpdate),r.PlaylistViewStore.on("saved-updated",this.onPlaylistSaveUpdate)}onHeaderClick(e){this.setState({expanded:!this.state.expanded})}onLoopClick(){f.PlaylistViewActions.toggleLoop()}onShuffleClick(){f.PlaylistViewActions.toggleShuffle()}onSaveClick(){f.PlaylistViewActions.toggleSave()}onShuffleUpdate(){this.setState({shuffle:r.PlaylistViewStore.get("enabled-shuffle")},(()=>{this.state.shuffle?f.PageActions.addNotification("Playlist shuffle is on","shuffle-on"):f.PageActions.addNotification("Playlist shuffle is off","shuffle-off")}))}onLoopRepeatUpdate(){this.setState({loopRepeat:r.PlaylistViewStore.get("enabled-loop")},(()=>{this.state.loopRepeat?f.PageActions.addNotification("Playlist loop is on","loop-on"):f.PageActions.addNotification("Playlist loop is off","loop-off")}))}onPlaylistSaveUpdate(){this.setState({savedPlaylist:r.PlaylistViewStore.get("saved-playlist")},(()=>{this.state.savedPlaylist?f.PageActions.addNotification("Added to playlists library","added-to-playlists-lib"):f.PageActions.addNotification("Removed from playlists library","removed-from-playlists-lib")}))}render(){return n.createElement("div",{className:"playlist-view-wrap"},n.createElement("div",{className:"playlist-view"+(this.state.expanded?" playlist-expanded-view":"")},n.createElement("div",{className:"playlist-header"},n.createElement("div",{className:"playlist-title"},n.createElement("a",{href:this.state.link,title:this.state.title},this.state.title)),n.createElement("div",{className:"playlist-meta"},n.createElement("span",null,n.createElement("a",{href:this.state.authorLink,title:this.state.authorName},this.state.authorName)),"  -  ",n.createElement("span",{className:"counter"},this.state.activeItem," / ",this.state.totalMedia)),n.createElement(s.CircleIconButton,{className:"toggle-playlist-view",onClick:this.onHeaderClick},this.state.expanded?n.createElement("i",{className:"material-icons"},"keyboard_arrow_up"):n.createElement("i",{className:"material-icons"},"keyboard_arrow_down"))),this.state.expanded?n.createElement("div",{className:"playlist-actions"},n.createElement(s.CircleIconButton,{className:this.state.loopRepeat?"active":"",onClick:this.onLoopClick,title:"Loop playlist"},n.createElement("i",{className:"material-icons"},"repeat"))):null,this.state.expanded&&this.state.items.length?n.createElement("div",{className:"playlist-media"},n.createElement(Ee,{items:this.state.items,playlistActiveItem:this.state.activeItem})):null))}}ye.propTypes={playlistData:h().object.isRequired,activeItem:v.PositiveIntegerOrZero},ye.defaultProps={};class be extends n.PureComponent{constructor(e){if(super(e),this.state={playlistData:e.playlistData,isPlaylistPage:!!e.playlistData,activeItem:0},e.playlistData){let t=0;for(;t{let e=null,t=null;const a=window.location.search.split("?")[1];return a&&a.split("&").forEach((a=>{0===a.indexOf("m=")?e=a.split("m=")[1]:0===a.indexOf("pl=")&&(t=a.split("pl=")[1])})),{mediaId:e,playlistId:t}},{mediaId:t,playlistId:a}=e();t&&(window.MediaCMS.mediaId=t),a&&(window.MediaCMS.playlistId=a)}(0,i.C)("page-media",class extends we{viewerContainerContent(e){switch(r.MediaPageStore.get("media-type")){case"video":case"audio":return n.createElement(l.SiteConsumer,null,(t=>n.createElement(N,{data:e,siteUrl:t.url,inEmbed:!1})));case"image":return n.createElement(c,null);case"pdf":const t=(0,v.formatInnerLink)(r.MediaPageStore.get("media-original-url"),l.SiteContext._currentValue.url);return n.createElement(p,{fileUrl:t})}return n.createElement(o,null)}})},463:function(e,t,a){"use strict";a.d(t,{c:function(){return l}});var i=a(4571),n=a.n(i);function l(e,t){let a=n()(e,{});return""!==a.origin&&"null"!==a.origin&&a.origin||(a=n()(t+"/"+e.replace(/^\//g,""),{})),a.toString()}},878:function(e,t,a){"use strict";a.d(t,{c:function(){return d}});var i=a(9471),n=a(8713),l=a.n(n),r=a(6387),o=a(5321),s=a(2828);function d(e){const{thumbnail:t}=(0,r.useUser)(),a={"aria-label":"Account profile photo that opens list of options and settings pages links",className:"thumbnail"};switch(e.isButton?void 0!==e.onClick&&(a.onClick=e.onClick):a.type="span",e.size){case"small":case"large":a.className+=" "+e.size+"-thumb"}return i.createElement(o.i,a,t?i.createElement("img",{src:t,alt:""}):i.createElement(s.Z,{type:"person"}))}d.propTypes={isButton:l().bool,size:l().oneOf(["small","medium","large"]),onClick:l().func},d.defaultProps={isButton:!1,size:"medium"}},1815:function(){},2787:function(){},3237:function(){},3818:function(e,t,a){"use strict";a.d(t,{_:function(){return r}});var i=a(9471),n=a(8713),l=a.n(n);function r(e){const t=(0,i.useRef)(null),a=(0,i.useRef)(null),[n,l]=(0,i.useState)(null),[r,o]=(0,i.useState)(null);return(0,i.useEffect)((()=>{l(function(e,t,a){if(void 0!==e){let i=null;return i=void 0!==t&&t>e?t:e,i=void 0!==a&&a=l)&&Object.keys(i.O).every((function(e){return i.O[e](a[s])}))?a.splice(s--,1):(o=!1,l0&&e[c-1][2]>l;c--)e[c]=e[c-1];e[c]=[a,n,l]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=201,function(){var e={201:0};i.O.j=function(t){return 0===e[t]};var t=function(t,a){var n,l,r=a[0],o=a[1],s=a[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(n in o)i.o(o,n)&&(i.m[n]=o[n]);if(s)var c=s(i)}for(t&&t(a);d{m.current&&c({height:m.current.clientHeight||0,width:m.current.clientWidth||0})}),[o]);const u={right:{left:"100%",marginLeft:"10px",top:"-50%"},left:{right:"100%",marginRight:"10px",top:"-50%"},top:{left:"50%",top:`-${d.height+10}px`,transform:"translateX(-50%)"},center:{top:"50%",left:"50%",translate:"x-[-50%]"},"bottom-left":{left:`-${d.width-20}px`,top:"100%",marginTop:"10px"}};return n.createElement("div",{onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)}},n.createElement("div",{ref:m,className:`tooltip-box ${o?"show":"hide"} ${r}`,style:u[l]},i&&n.createElement("div",{className:"tooltip-title"},i),n.createElement("div",{className:"tooltip-content"},a)),t)};function c(){const e=(0,n.useContext)(l.SiteContext);let t=y();t=t||r.MediaPageStore.get("media-data").thumbnail_url,t=t||"";const[a,i]=(0,n.useState)(t),[o,c]=(0,n.useState)([]),[m,u]=(0,n.useState)(!1),[p,g]=(0,n.useState)(0),[h,f]=(0,n.useState)(!0),v=n.useRef();function E(){i(y())}function y(){const t=r.MediaPageStore.get("media-data");let a=t.poster_url?.trim()||t.thumbnail_url?.trim()||r.MediaPageStore.get("media-original-url")?.trim()||"#";return e.url+"/"+a.replace(/^\//g,"")}(0,n.useEffect)((()=>{a&&(()=>{const e=r.MediaPageStore.get("media-data").slideshow_items;Array.isArray(e)&&c(e)})()}),[a]),(0,n.useEffect)((()=>(r.MediaPageStore.on("loaded_image_data",E),()=>r.MediaPageStore.removeListener("loaded_image_data",E))),[]),(0,n.useEffect)((()=>{if(m)return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}}),[m,o]);const b=e=>{"ArrowRight"===e.key&&w(),"ArrowLeft"===e.key&&P(),"Escape"===e.key&&S()},S=()=>u(!1),w=()=>{f(!0),g((e=>(e+1)%o.length))},P=()=>{f(!0),g((e=>(e-1+o.length)%o.length))},M=e=>{if(v.current){const t=10;"left"===e?v.current.scrollBy({left:-t,behavior:"smooth"}):"right"===e&&v.current.scrollBy({left:t,behavior:"smooth"})}};return a?n.createElement("div",{className:"viewer-image-container"},n.createElement(d,{content:"load full-image",position:"center"},n.createElement("img",{src:a,alt:r.MediaPageStore.get("media-data").title||null,onClick:()=>u(!0)})),m&&o&&n.createElement("div",{className:"modal-overlay",onClick:()=>u(!1)},n.createElement("div",{className:"slideshow-container",onClick:e=>e.stopPropagation()},!h&&n.createElement("button",{className:"arrow left",onClick:P,"aria-label":"Previous slide"},"‹"),n.createElement("div",{className:"slideshow-image"},h&&n.createElement(s.SpinnerLoader,{size:"large"}),n.createElement("img",{src:e.url+"/"+o[p]?.original_media_url,alt:`Slide ${p+1}`,onClick:()=>(t=>{const a=e.url+o[t]?.url;window.location.href=a})(p),onLoad:()=>f(!1),onError:()=>f(!1),style:{display:h?"none":"block"}}),!h&&n.createElement("div",{className:"slideshow-title"},o[p]?.title)),!h&&n.createElement("button",{className:"arrow right",onClick:w,"aria-label":"Next slide"},"›"),n.createElement("div",{className:"thumbnail-navigation"},o.length>5&&n.createElement("button",{className:"arrow left",onClick:()=>M("left"),"aria-label":"Scroll left"},"‹"),n.createElement("div",{className:"thumbnail-container "+(o.length<=5?"center-thumbnails":""),ref:v},o.map(((t,a)=>n.createElement("img",{key:a,src:e.url+"/"+t.thumbnail_url,alt:`Thumbnail ${a+1}`,className:"thumbnail "+(p===a?"active":""),onClick:()=>(e=>{f(!0),g(e)})(a)})))),o.length>5&&n.createElement("button",{className:"arrow right",onClick:()=>M("right"),"aria-label":"Scroll right"},"›"))))):null}var m=a(7118),u=a(5928);function p(e){let{fileUrl:t}=e;const a=(0,u.defaultLayoutPlugin)();return n.createElement("div",{className:"pdf-container"},n.createElement(m.Worker,{workerUrl:"https://unpkg.com/pdfjs-dist@3.4.120/build/pdf.worker.min.js"},n.createElement(m.Viewer,{fileUrl:t,plugins:[a]})))}var g=a(8713),h=a.n(g),f=a(285),v=a(6014),E=a(7154),y=a(8974);const b=["hls","h265","vp9","h264","vp8","mp4","theora"];function S(e,t){let a=null,i=document.createElement("video");if(i.canPlayType)try{switch(e){case"hls":case"mp4":a=!0;break;case"h265":a="probably"===i.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')||"probably"===i.canPlayType('video/mp4; codecs="hev1.1.L0.0"');break;case"h264":a="probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E"')||"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');break;case"vp9":a="probably"===i.canPlayType('video/webm; codecs="vp9"');break;case"vp8":a="probably"===i.canPlayType('video/webm; codecs="vp8, vorbis"');break;case"theora":a="probably"===i.canPlayType('video/ogg; codecs="theora"')}if(t=(t instanceof Boolean||0===t||1==t)&&t){if("no"===i.canPlayType("video/nonsense")&&y.warn('BUGGY: Codec detection bug in Firefox 3.5.0 - 3.5.1 and Safari 4.0.0 - 4.0.4 that answer "no" to unknown codecs instead of an empty string'),"probably"===i.canPlayType("video/webm")&&y.warn('BUGGY: Codec detection bug that Firefox 27 and earlier always says "probably" when asked about WebM, even when the codecs string is not present'),"maybe"===i.canPlayType('video/mp4; codecs="avc1.42E01E"'))switch(i.canPlayType("video/mp4")){case"probably":y.warn('BUGGY: Codec detection bug in iOS 4.1 and earlier that switches "maybe" and "probably" around');break;case"maybe":y.warn('BUGGY: Codec detection bug in Android where no better answer than "maybe" is given')}"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')&&"probably"!==i.canPlayType('video/mp4; codecs="avc1.42E01E"')&&y.warn("BUGGY: Codec detection bug in Internet Explorer 9 that requires both audio and video codec on test")}}catch(e){y.warn(e)}return a}function w(e){let t=[],a={},i=document.createElement("video");return i.canPlayType&&(a.hls=!0,t.push("hls"),(i.canPlayType('video/mp4; codecs="hvc1.1.L0.0"')||"probably"===i.canPlayType('video/mp4; codecs="hev1.1.L0.0"'))&&(a.h265=!0,t.push("h265")),"probably"===i.canPlayType('video/mp4; codecs="avc1.42E01E"')&&(a.h264=!0,t.push("h264")),"probably"===i.canPlayType('video/webm; codecs="vp9"')&&(a.vp9=!0,t.push("vp9")),e&&("probably"===i.canPlayType('video/webm; codecs="vp8, vorbis"')&&(a.vp8=!0,t.push("vp8")),"probably"===i.canPlayType('video/ogg; codecs="theora"')&&(a.theora=!0,t.push("theora"))),"probably"===i.canPlayType('video/mp4; codecs="mp4v.20.8"')&&(a.mp4=!0,t.push("mp4"))),{order:t,support:a}}var P=a(8974);const M=e=>{let{data:t,useRoundedCorners:a,version:i,isPlayList:l,playerVolume:r,playerSoundMuted:o,videoQuality:s,videoPlaybackSpeed:d,inTheaterMode:c,siteId:m,siteUrl:u,info:p,cornerLayers:g,sources:h,poster:f,previewSprite:v,subtitlesInfo:E,inEmbed:y,showTitle:b,showRelated:S,showUserAvatar:w,linkTitle:M,parentMediaBase:k,hasTheaterMode:_,hasNextLink:N,nextLink:C,hasPreviousLink:x,errorMessage:L,onClickNextCallback:I,onClickPreviousCallback:V,onStateUpdateCallback:T,onPlayerInitCallback:A}=e;const R=(0,n.useRef)(null),U=(0,n.useRef)(!1),D=(0,n.useRef)(null),O=(0,n.useRef)(y),F=e=>new URLSearchParams(window.location.search).get(e);(0,n.useEffect)((()=>{if(O.current=y,"undefined"!=typeof window){const e=F("t"),n=F("muted"),o=F("showRelated"),P=F("showUserAvatar"),R=F("linkTitle");window.MEDIA_DATA={data:t||{},useRoundedCorners:a,version:i,isPlayList:l,playerVolume:r||.5,playerSoundMuted:"1"===n,videoQuality:s||"auto",videoPlaybackSpeed:d||1,inTheaterMode:c||!1,siteId:m||"",siteUrl:u||"",info:p||{},cornerLayers:g||[],sources:h||[],poster:f||"",previewSprite:v||null,subtitlesInfo:E||[],inEmbed:y||!1,parentMediaBase:k||null,showTitle:b||!1,showRelated:void 0!==S?S:"1"===o||"true"===o||null===o,showUserAvatar:void 0!==w?w:"1"===P||"true"===P||null===P,linkTitle:void 0!==M?M:"1"===R||"true"===R||null===R,hasTheaterMode:_||!1,hasNextLink:N||!1,nextLink:C||null,hasPreviousLink:x||!1,errorMessage:L||"",urlTimestamp:e?parseInt(e,10):null,urlMuted:"1"===n,urlShowRelated:"1"===o||"true"===o,urlShowUserAvatar:"1"===P||"true"===P,urlLinkTitle:"1"===R||"true"===R,onClickNextCallback:I||null,onClickPreviousCallback:V||null,onStateUpdateCallback:T||null,onPlayerInitCallback:(e,t)=>{D.current=e,A&&A(e,t)}}}U.current||(H(),U.current=!0)}),[t,u,y]),(0,n.useEffect)((()=>{if(y&&R.current){const e=setTimeout((()=>{const e=new CustomEvent("triggerVideoJSMount",{detail:{targetId:"video-js-root-embed"}});document.dispatchEvent(e),"undefined"!=typeof window&&window.triggerVideoJSMount&&window.triggerVideoJSMount()}),100);return()=>clearTimeout(e)}}),[y,R.current]),(0,n.useEffect)((()=>{const e=e=>{if(e.target.classList.contains("video-timestamp")){e.preventDefault();const t=parseInt(e.target.dataset.timestamp,10);let a=null;if(D.current&&D.current.player&&(a=D.current.player),!a&&"undefined"!=typeof window&&window.videojsPlayers){const e=O.current?"video-embed":"video-main";a=window.videojsPlayers[e]}if(!a&&"undefined"!=typeof window&&window.videojs){const e=document.querySelector(O.current?"#video-embed":"#video-main");e&&e.player&&(a=e.player)}if(a){t>=0&&t=0&&a.play();const e=document.querySelector(O.current?"#video-embed":"#video-main");if(e){const t=F("scroll");window.parent!==window&&"1"!==t&&"true"!==t||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}}else P.warn("VideoJS player not found for timestamp navigation")}};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[]);const H=()=>{const e=document.querySelector('link[href*="video-js.css"]'),t=document.querySelector('script[src*="video-js.js"]');if(!e){const e=document.createElement("link");e.rel="stylesheet",e.href=u+"/static/video_js/video-js.css?v="+i,document.head.appendChild(e)}if(!t){const e=document.createElement("script");e.src=u+"/static/video_js/video-js.js?v="+i,document.head.appendChild(e)}};return n.createElement("div",{className:"video-js-wrapper",ref:R},y?n.createElement("div",{id:"video-js-root-embed",className:"video-js-root-embed"}):n.createElement("div",{id:"video-js-root-main",className:"video-js-root-main"}))};M.defaultProps={data:{},siteUrl:""};var k=M,_=a(8974);class N extends n.PureComponent{constructor(e){if(super(e),this.state={displayPlayer:!1},this.videoSources=[],function(e){switch(e){case"running_X":r.MediaPageStore.set("media-load-error-type","encodingRunning"),r.MediaPageStore.set("media-load-error-message","Media encoding is currently running. Try again in few minutes.");break;case"pending_X":r.MediaPageStore.set("media-load-error-type","encodingPending"),r.MediaPageStore.set("media-load-error-message","Media encoding is pending");break;case"fail":r.MediaPageStore.set("media-load-error-type","encodingFailed"),r.MediaPageStore.set("media-load-error-message","Media encoding failed")}}(this.props.data.encoding_status),null!==r.MediaPageStore.get("media-load-error-type"))return void(this.state.displayPlayer=!0);if("string"==typeof this.props.data.poster_url?this.videoPoster=(0,v.formatInnerLink)(this.props.data.poster_url,this.props.siteUrl):"string"==typeof this.props.data.thumbnail_url&&(this.videoPoster=(0,v.formatInnerLink)(this.props.data.thumbnail_url,this.props.siteUrl)),this.videoInfo=function(e,t,a){const i={};let n,r,o;a=void 0===a?w():a;const s={hls:["m3u8"],h265:["mp4","webm"],h264:["mp4","webm"],vp9:["mp4","webm"],vp8:["mp4","webm"],theora:["ogg"],mp4:["mp4"]};for(n in t)t.hasOwnProperty(n)&&(r=null,"master_file"===n?r="Auto":(r=n.split("_playlist"),r=2===r.length?r[0]:null),null!==r&&(i[r]=void 0===i[r]?{format:[],url:[]}:i[r],i[r].format.push("hls"),i[r].url.push((0,v.formatInnerLink)(t[n],l.SiteContext._currentValue.url))));for(r in e)if(e.hasOwnProperty(r)&&Object.keys(e[r]).length&&(1080>=parseInt(r,10)||1080=parseInt(i[i.length-1],10))return i[i.length-1];if(parseInt(e,10)<=parseInt(i[0],10))return i[0];for(a=i.length-1;a>=0;){if(parseInt(e,10)>=parseInt(i[a],10))return i[a+1];a-=1}}(e,this.videoInfo);"Auto"===e&&void 0!==this.videoInfo.Auto&&this.videoSources.push({src:this.videoInfo.Auto.url[0]});const a=w();let i,n;for(n=0;n-1?"_self":"_blank";t&&(t.setAttribute("class","title-link"),t.setAttribute("href",this.props.data.url||"#"),t.setAttribute("target",i),t.setAttribute("title",this.props.data.title),t.innerHTML=this.props.data.title),a&&(a.setAttribute("class","user-thumb-link"),a.setAttribute("href",(0,v.formatInnerLink)(this.props.data.author_profile,this.props.siteUrl)),a.setAttribute("title",this.props.data.author_name),a.setAttribute("target",i),a.setAttribute("style","background-image:url("+(0,v.formatInnerLink)(r.MediaPageStore.get("media-author-thumbnail-url"),this.props.siteUrl)+")")),e.appendChild(a),e.appendChild(t)}let t='';t+='',this.cornerLayers={topLeft:e,topRight:this.upNextLoaderView?this.upNextLoaderView.html():null,bottomLeft:this.recommendedMedia?this.recommendedMedia.html():null,bottomRight:this.props.inEmbed?t:null},this.setState({displayPlayer:!0},(function(){setTimeout((function(){const e=document.querySelector(".share-video-btn"),t=document.querySelector(".share-options-wrapper"),a=document.querySelector(".share-options-inner");e&&e.addEventListener("click",(function(e){(0,v.addClassname)(document.querySelector(".video-js.vjs-mediacms"),"vjs-visible-share-options")})),t&&t.addEventListener("click",(function(e){e.target!==a&&e.target!==t||(0,v.removeClassname)(document.querySelector(".video-js.vjs-mediacms"),"vjs-visible-share-options")}))}),1e3)}))}}onClickNext(){let e;r.MediaPageStore.get("playlist-id")?(e=r.MediaPageStore.get("playlist-next-media-url"),null===e&&(e=this.props.data.related_media[0].url)):this.props.inEmbed||(e=this.props.data.related_media[0].url),window.location.href=e}onClickPrevious(){let e;r.MediaPageStore.get("playlist-id")?(e=r.MediaPageStore.get("playlist-previous-media-url"),null===e&&(e=this.props.data.related_media[0].url)):this.props.inEmbed||(e=this.props.data.related_media[0].url),window.location.href=e}onStateUpdate(e){r.VideoViewerStore.get("in-theater-mode")!==e.theaterMode&&f.VideoViewerActions.set_viewer_mode(e.theaterMode),r.VideoViewerStore.get("player-volume")!==e.volume&&f.VideoViewerActions.set_player_volume(e.volume),r.VideoViewerStore.get("player-sound-muted")!==e.soundMuted&&f.VideoViewerActions.set_player_sound_muted(e.soundMuted),r.VideoViewerStore.get("video-quality")!==e.quality&&f.VideoViewerActions.set_video_quality(e.quality),r.VideoViewerStore.get("video-playback-speed")!==e.playbackSpeed&&f.VideoViewerActions.set_video_playback_speed(e.playbackSpeed)}onPlayerInit(e,t){this.playerElem=t,this.playerInstance=e,this.upNextLoaderView&&(this.upNextLoaderView.setVideoJsPlayerElem(this.playerInstance.player.el_),this.onUpdateMediaAutoPlay()),this.props.inEmbed||this.playerElem.parentNode.focus()}onUpdateMediaAutoPlay(){this.upNextLoaderView&&(r.PageStore.get("media-auto-play")||this.upNextLoaderView.hideTimerView())}render(){let e=null,t=null;!this.props.inEmbed&&r.MediaPageStore.get("playlist-id")?(e=r.MediaPageStore.get("playlist-next-media-url"),t=r.MediaPageStore.get("playlist-previous-media-url")):e=this.props.data.related_media.length&&!this.props.inEmbed?this.props.data.related_media[0].url:null;const a=this.props.data.sprites_url?{url:this.props.siteUrl+"/"+this.props.data.sprites_url.replace(/^\//g,""),frame:{width:160,height:90,seconds:10}}:null;return n.createElement(n.Fragment,null,n.createElement("div",{key:(this.props.inEmbed?"embed-":"")+"player-container",className:"player-container"+(this.videoSources.length?"":" player-container-error"),style:this.props.containerStyles,ref:"playerContainer"},n.createElement("div",{className:"player-container-inner",ref:"playerContainerInner",style:this.props.containerStyles},null==r.MediaPageStore.get("media-load-error-type")?n.createElement("div",{className:"video-player",ref:"videoJSPlayerWrapper",key:"videoJSPlayerWrapper"},n.createElement(l.SiteConsumer,null,(i=>n.createElement(k,{data:this.props.data,useRoundedCorners:i.useRoundedCorners,version:i.version,isPlayList:!!r.MediaPageStore.get("playlist-id"),playerVolume:this.browserCache.get("player-volume"),playerSoundMuted:this.browserCache.get("player-sound-muted"),videoQuality:this.browserCache.get("video-quality"),videoPlaybackSpeed:parseInt(this.browserCache.get("video-playback-speed"),10),inTheaterMode:this.browserCache.get("in-theater-mode"),siteId:i.id,siteUrl:i.url,info:this.videoInfo,cornerLayers:this.cornerLayers,sources:this.videoSources,poster:this.videoPoster,previewSprite:a,subtitlesInfo:this.props.data.subtitles_info,inEmbed:this.props.inEmbed,parentMediaBase:this.props.parentMediaBase||null,showTitle:this.props.showTitle,showRelated:this.props.showRelated,showUserAvatar:this.props.showUserAvatar,linkTitle:this.props.linkTitle,urlTimestamp:this.props.timestamp,hasTheaterMode:!this.props.inEmbed,hasNextLink:!!e,nextLink:e,hasPreviousLink:!!t,errorMessage:r.MediaPageStore.get("media-load-error-message"),onClickNextCallback:this.onClickNext,onClickPreviousCallback:this.onClickPrevious,onStateUpdateCallback:this.onStateUpdate,onPlayerInitCallback:this.onPlayerInit})))):null)))}}N.defaultProps={inEmbed:!0,showTitle:!0,showRelated:!0,showUserAvatar:!0,linkTitle:!0,timestamp:null,siteUrl:h().string.isRequired},N.propTypes={inEmbed:h().bool,showTitle:h().bool,showRelated:h().bool,showUserAvatar:h().bool,linkTitle:h().bool,timestamp:h().number};var C=a(5338),x=a(6619),L=a(4350);const I={single:(0,v.translateString)("comment"),uppercaseSingle:(0,v.translateString)("COMMENT"),ucfirstSingle:(0,v.translateString)("Comment"),ucfirstPlural:(0,v.translateString)("Comments"),submitCommentText:(0,v.translateString)("SUBMIT"),disabledCommentsMsg:(0,v.translateString)("Comments are disabled")};function V(e){const t=(0,n.useRef)(null),[a,i]=(0,n.useState)(""),[o,d]=(0,n.useState)(!1),[c,m]=(0,n.useState)(!1),[u,p]=(0,n.useState)(-1),[g,h]=(0,n.useState)(""),[E]=(0,n.useState)(l.MemberContext._currentValue.is.anonymous?l.LinksContext._currentValue.signin+"?next=/"+window.location.href.replace(l.SiteContext._currentValue.url,"").replace(/^\//g,""):null);function y(){m(!0)}function b(){m(!1)}function S(){const e=[...r.MediaPageStore.get("users")],t=[];e.forEach((e=>{t.push({id:e.username,display:e.name})})),h(t)}function w(){t.current.style.height="";const e=t.current.scrollHeight,a=0(r.MediaPageStore.on("comment_submit",w),r.MediaPageStore.on("comment_submit_fail",P),!0===MediaCMS.features.media.actions.comment_mention&&r.MediaPageStore.on("users_load",S),()=>{r.MediaPageStore.removeListener("comment_submit",w),r.MediaPageStore.removeListener("comment_submit_fail",P),!0===MediaCMS.features.media.actions.comment_mention&&r.MediaPageStore.removeListener("users_load",S)}))),l.MemberContext._currentValue.is.anonymous?n.createElement("div",{className:"comments-form"},n.createElement("div",{className:"comments-form-inner"},n.createElement(s.UserThumbnail,null),n.createElement("div",{className:"form"},n.createElement("a",{href:E,rel:"noffolow",className:"form-textarea-wrap",title:(0,v.translateString)("Add a ")+I.single+"..."},n.createElement("span",{className:"form-textarea"},(0,v.translateString)("Add a ")+I.single+"...")),n.createElement("div",{className:"form-buttons"},n.createElement("a",{href:E,rel:"noffolow",className:"disabled"},I.submitCommentText))))):n.createElement("div",{className:"comments-form"},n.createElement("div",{className:"comments-form-inner"},n.createElement(s.UserThumbnail,null),n.createElement("div",{className:"form"},n.createElement("div",{className:"form-textarea-wrap"+(c?" focused":"")},MediaCMS.features.media.actions.comment_mention?n.createElement(x.G,{inputRef:t,className:"form-textarea",rows:"1",placeholder:"Add a "+I.single+"...",value:a,onChange:function(e,a,n,l){t.current.style.height="",i(a),d(!0);const r=t.current.scrollHeight,o=0()=>{}),[]),n.createElement("div",{className:"comment"},n.createElement("div",{className:"comment-inner"},n.createElement("a",{className:"comment-author-thumb",href:e.author_link,title:e.author_name},n.createElement("img",{src:e.author_thumb,alt:e.author_name})),n.createElement("div",{className:"comment-content"},n.createElement("div",{className:"comment-meta"},n.createElement("div",{className:"comment-author"},n.createElement("a",{href:e.author_link,title:e.author_name},e.author_name)),n.createElement("div",{className:"comment-date"},(0,v.replaceString)((0,L.GP)(new Date(e.publish_date))))),n.createElement("div",{ref:t,className:"comment-text"+(i?" show-all":"")},n.createElement("div",{ref:a,className:"comment-text-inner",dangerouslySetInnerHTML:(d=e.text,{__html:d.replace(/\n/g,"
")})})),o?n.createElement("button",{className:"toggle-more",onClick:function(){r(!i)}},i?"Show less":"Read more"):null,l.MemberContext._currentValue.can.deleteComment?n.createElement(T,{comment_id:e.comment_id}):null)));var d}A.propTypes={comment_id:h().oneOfType([h().string,h().number]).isRequired,media_id:h().oneOfType([h().string,h().number]).isRequired,text:h().string,author_name:h().string,author_link:h().string,author_thumb:h().string,publish_date:h().oneOfType([h().string,h().number]),likes:h().number,dislikes:h().number},A.defaultProps={author_name:"",author_link:"#",publish_date:0,likes:0,dislikes:0};const R=e=>{let{commentsLength:t,ordering:a,onToggleOrdering:i}=e;return n.createElement(n.Fragment,null,!l.MemberContext._currentValue.can.readComment||r.MediaPageStore.get("media-data").enable_comments?null:n.createElement("span",{className:"disabled-comments-msg"},I.disabledCommentsMsg),l.MemberContext._currentValue.can.readComment&&(r.MediaPageStore.get("media-data").enable_comments||l.MemberContext._currentValue.can.editMedia)?n.createElement("h2",null,t?10&&n.createElement("button",{className:"comments-order-toggle",onClick:i},n.createElement("span",{className:"material-icons"},"swap_vert"),n.createElement("span",{className:"comments-order-label"},"newest"===a?(0,v.translateString)("Newest first"):(0,v.translateString)("Oldest first")))):null)};function U(e){const[t,a]=(0,n.useState)(r.MediaPageStore.get("media-id")),[i,o]=(0,n.useState)(l.MemberContext._currentValue.can.readComment?r.MediaPageStore.get("media-comments"):[]),[s,d]=(0,n.useState)(!1),[c,m]=(0,n.useState)("newest");function u(){const e=[...r.MediaPageStore.get("media-comments")];e.forEach((e=>{e.text=function(e){const t=new RegExp("((\\d)?\\d:)?(\\d)?\\d:\\d\\d","g");return e.replace(t,(function(e,t){let a=e.split(":"),i=0,n=1;for(;a.length>0;)i+=n*parseInt(a.pop(),10),n*=60;return`${e}`}))}(e.text)})),function(){var e=document.querySelector(".page-main"),t=e.querySelector(".no-comment");const a=r.PageStore.get("config-contents").uploader.postUploadMessage;if(""===a)t&&0===comm.length&&t.parentNode.removeChild(t);else if(0===comm.length&&"unlisted"===r.MediaPageStore.get("media-data").state){if(-1f.PageActions.addNotification(I.ucfirstSingle+" added","commentSubmit")),100)}function g(){setTimeout((()=>f.PageActions.addNotification(I.ucfirstSingle+" submission failed","commentSubmitFail")),100)}function h(e){u(),setTimeout((()=>f.PageActions.addNotification(I.ucfirstSingle+" removed","commentDelete")),100)}function v(e){setTimeout((()=>f.PageActions.addNotification(I.ucfirstSingle+" removal failed","commentDeleteFail")),100)}return(0,n.useEffect)((()=>{d(i.length&&l.MemberContext._currentValue.can.readComment&&(r.MediaPageStore.get("media-data").enable_comments||l.MemberContext._currentValue.can.editMedia))}),[i]),(0,n.useEffect)((()=>(r.MediaPageStore.on("comments_load",u),r.MediaPageStore.on("comment_submit",p),r.MediaPageStore.on("comment_submit_fail",g),r.MediaPageStore.on("comment_delete",h),r.MediaPageStore.on("comment_delete_fail",v),()=>{r.MediaPageStore.removeListener("comments_load",u),r.MediaPageStore.removeListener("comment_submit",p),r.MediaPageStore.removeListener("comment_submit_fail",g),r.MediaPageStore.removeListener("comment_delete",h),r.MediaPageStore.removeListener("comment_delete_fail",v)})),[]),n.createElement("div",{className:"comments-list"},n.createElement("div",{className:"comments-list-inner"},n.createElement(R,{commentsLength:i.length,ordering:c,onToggleOrdering:function(){m((e=>"newest"===e?"oldest":"newest"))}}),r.MediaPageStore.get("media-data").enable_comments?n.createElement(V,{media_id:t}):null,s?function(e,t){const a=[...e];return a.sort(((e,a)=>{const i=new Date(e.add_date),n=new Date(a.add_date);return"newest"===t?n-i:i-n})),a}(i,c).map((e=>n.createElement(A,{key:e.uid,comment_id:e.uid,media_id:t,text:e.text,author_name:e.author_name,author_link:e.author_profile,author_thumb:l.SiteContext._currentValue.url+"/"+e.author_thumbnail_url.replace(/^\//g,""),publish_date:e.add_date,likes:0,dislikes:0}))):null))}var D=a(8974);function O(e){let t,a,i=[];if(e&&e.length)for(t=0,a=1!0===e.is_lms_course)));const d=r.PageStore.get("config-options").pages.media.categoriesWithTitle?[]:!r.PageStore.get("config-enabled").taxonomies.categories||r.PageStore.get("config-enabled").taxonomies.categories.enabled?O(o):[];let c=r.MediaPageStore.get("media-summary");c=c?c.trim():"";const[m,u,p]=(0,C.usePopup)(),[g,h]=(0,n.useState)(""!==c),[E,y]=(0,n.useState)(""==c);function b(e){setTimeout((function(){f.PageActions.addNotification("Media removed. Redirecting...","mediaDelete"),setTimeout((function(){window.location.href=l.SiteContext._currentValue.url+"/"+r.MediaPageStore.get("media-data").author_profile.replace(/^\//g,"")}),2e3)}),100),void 0!==e&&D.info("Removed media '"+e+'"')}function S(e){setTimeout((function(){f.PageActions.addNotification("Media removal failed","mediaDeleteFail")}),100),void 0!==e&&D.info('Media "'+e+'" removal failed')}(0,n.useEffect)((()=>(r.MediaPageStore.on("media_delete",b),r.MediaPageStore.on("media_delete_fail",S),()=>{r.MediaPageStore.removeListener("media_delete",b),r.MediaPageStore.removeListener("media_delete_fail",S)})),[]);const w=(0,v.formatInnerLink)(e.author.url,l.SiteContext._currentValue.url),P=(0,v.formatInnerLink)(e.author.thumb,l.SiteContext._currentValue.url);return n.createElement("div",{className:"media-info-content"},void 0===r.PageStore.get("config-media-item").displayAuthor||null===r.PageStore.get("config-media-item").displayAuthor||r.PageStore.get("config-media-item").displayAuthor?n.createElement(F,{link:w,thumb:P,name:e.author.name,published:e.published}):null,n.createElement("div",{className:"media-content-banner"},n.createElement("div",{className:"media-content-banner-inner"},g?n.createElement("div",{className:"media-content-summary"},c):null,g&&!E||!a?null:n.createElement("div",{className:"media-content-description",dangerouslySetInnerHTML:{__html:function(e){const t=new RegExp("((\\d)?\\d:)?(\\d)?\\d:\\d\\d","g");return e.replace(t,(function(e,t){let a=e.split(":"),i=0,n=1;for(;a.length>0;)i+=n*parseInt(a.pop(),10),n*=60;return`${e}`}))}(a)}}),g?n.createElement("button",{className:"load-more",onClick:function(){y(!E)}},E?"SHOW LESS":"SHOW MORE"):null,i.length?n.createElement(H,{value:i,title:1(r.MediaPageStore.on("disliked_media",d),r.MediaPageStore.on("undisliked_media",c),r.MediaPageStore.on("disliked_media_failed_request",m),()=>{r.MediaPageStore.removeListener("disliked_media",d),r.MediaPageStore.removeListener("undisliked_media",c),r.MediaPageStore.removeListener("disliked_media_failed_request",m)})),[]),n.createElement("div",{className:"like"},n.createElement("button",{onClick:function(t){t.preventDefault(),t.stopPropagation(),f.MediaPageActions[e?"undislikeMedia":"dislikeMedia"]()}},n.createElement(s.CircleIconButton,{type:"span"},n.createElement(s.MaterialIcon,{type:"thumb_down"})),n.createElement("span",{className:"dislikes-counter"},a)))}function W(){const[e,t]=(0,n.useState)(r.MediaPageStore.get("user-liked-media")),[a,i]=(0,n.useState)((0,v.formatViewsNumber)(r.MediaPageStore.get("media-likes"),!1));function o(){t(r.MediaPageStore.get("user-liked-media")),i((0,v.formatViewsNumber)(r.MediaPageStore.get("media-likes"),!1))}function d(){o(),f.PageActions.addNotification(l.TextsContext._currentValue.addToLiked,"likedMedia")}function c(){o(),f.PageActions.addNotification(l.TextsContext._currentValue.removeFromLiked,"unlikedMedia")}function m(){f.PageActions.addNotification("Action failed","likedMediaRequestFail")}return(0,n.useEffect)((()=>(r.MediaPageStore.on("liked_media",d),r.MediaPageStore.on("unliked_media",c),r.MediaPageStore.on("liked_media_failed_request",m),()=>{r.MediaPageStore.removeListener("liked_media",d),r.MediaPageStore.removeListener("unliked_media",c),r.MediaPageStore.removeListener("liked_media_failed_request",m)})),[]),n.createElement("div",{className:"like"},n.createElement("button",{onClick:function(t){t.preventDefault(),t.stopPropagation(),f.MediaPageActions[e?"unlikeMedia":"likeMedia"]()}},n.createElement(s.CircleIconButton,{type:"span"},n.createElement(s.MaterialIcon,{type:"thumb_up"})),n.createElement("span",{className:"likes-counter"},a)))}function $(e){const t=(0,n.useRef)(null),a=(0,n.useRef)(null),[i,l]=(0,n.useState)(null);function o(){l(window.innerHeight-(104+t.current.offsetHeight))}return(0,n.useEffect)((()=>(o(),r.PageStore.on("window_resize",o),()=>{r.PageStore.removeListener("window_resize",o)})),[]),n.createElement("form",null,n.createElement("div",{className:"report-form",style:null!==i?{maxHeight:i+"px"}:null},n.createElement("div",{className:"form-title"},"Report media"),n.createElement("div",{className:"form-field"},n.createElement("span",{className:"label"},"URL"),n.createElement("input",{type:"text",readOnly:!0,value:e.mediaUrl})),n.createElement("div",{className:"form-field"},n.createElement("span",{className:"label"},"Description"),n.createElement("textarea",{ref:a,required:!0})),n.createElement("div",{className:"form-field form-help-text"},"Reported media is reviewed")),n.createElement("div",{ref:t,className:"form-actions-bottom"},n.createElement("button",{className:"cancel",onClick:function(t){t.preventDefault(),void 0!==e.cancelReportForm&&e.cancelReportForm()}},"CANCEL"),n.createElement("button",{onClick:function(t){const i=a.current.value.trim();""!==i&&(t.preventDefault(),void 0!==e.submitReportForm&&e.submitReportForm(i))}},"SUBMIT")))}function z(e,t){const a=l.SiteContext._currentValue,i=e.encodings_info,n={};let r,o;for(r in i)if(i.hasOwnProperty(r)&&Object.keys(i[r]).length)for(o in i[r])i[r].hasOwnProperty(o)&&"success"===i[r][o].status&&100===i[r][o].progress&&null!==i[r][o].url&&(n[i[r][o].title]={text:r+" - "+o.toUpperCase()+" ("+i[r][o].size+")",link:(0,v.formatInnerLink)(i[r][o].url,a.url),linkAttr:{target:"_blank",download:e.title+"_"+r+"_"+o.toUpperCase()}});return n.original_media_url={text:"Original file ("+e.size+")",link:(0,v.formatInnerLink)(e.original_media_url,a.url),linkAttr:{target:"_blank",download:e.title}},Object.values(n)}function G(e,t,a,i,l,r,o){const d=t.url,c=t.media_type,m=t.state||"N/A",u=t.encoding_status||"N/A",p=t.reported_times,g=t.is_reviewed,h="video"===c,f=function(e,t,a,i,n){const l=[],r="video"===t.media_type,o=t.reported_times;return a&&e.downloadMedia&&(r?l.push({itemType:"open-subpage",text:"Download",icon:"arrow_downward",itemAttr:{className:"visible-only-in-small"},buttonAttr:{className:"change-page","data-page-id":"videoDownloadOptions"}}):i&&l.push({itemType:"link",link:i,text:"Download",icon:"arrow_downward",itemAttr:{className:"visible-only-in-small"},linkAttr:{target:"_blank",download:t.title}})),r&&e.editMedia&&l.push({itemType:"open-subpage",text:"Status info",icon:"info",buttonAttr:{className:"change-page","data-page-id":"mediaStatusInfo"}}),e.reportMedia&&(n?l.push({itemType:"div",text:"Reported",icon:"flag",divAttr:{className:"reported-label loggedin-media-reported"}}):l.push({itemType:"open-subpage",text:"Report",icon:"flag",buttonAttr:{className:"change-page"+(o?" loggedin-media-reported":""),"data-page-id":"loggedInReportMedia"}})),l}(e,t,a,i,l),v={};return f.length&&(v.main=n.createElement("div",{className:"main-options"},n.createElement(s.PopupMain,null,n.createElement(s.NavigationMenuList,{items:f})))),e.reportMedia&&(v.loggedInReportMedia=l?null:n.createElement("div",{className:"popup-fullscreen"},n.createElement(s.PopupMain,null,n.createElement("span",{className:"popup-fullscreen-overlay"}),n.createElement("div",null,n.createElement($,{mediaUrl:d,submitReportForm:r,cancelReportForm:o}))))),e.editMedia&&(v.mediaStatusInfo=n.createElement("div",{className:"main-options"},n.createElement(s.PopupMain,null,n.createElement("ul",{className:"media-status-info"},n.createElement("li",null,"Media type: ",n.createElement("span",null,c)),n.createElement("li",null,"State: ",n.createElement("span",null,m)),n.createElement("li",null,"Review state: ",n.createElement("span",null,g?"Is reviewed":"Pending review")),h?n.createElement("li",null,"Encoding Status: ",n.createElement("span",null,u)):null,p?n.createElement("li",{className:"reports"},"Reports: ",n.createElement("span",null,p)):null)))),a&&e.downloadMedia&&h&&(v.videoDownloadOptions=n.createElement("div",{className:"video-download-options"},n.createElement(s.PopupMain,null,n.createElement(s.NavigationMenuList,{items:z(t)})))),v}$.propTypes={mediaUrl:h().string.isRequired,cancelReportForm:h().func,submitReportForm:h().func};const Y="more-options active-options";function J(e){const{userCan:t}=(0,C.useUser)(),a=l.SiteContext._currentValue,i=(0,v.formatInnerLink)(r.MediaPageStore.get("media-original-url"),a.url),o=r.MediaPageStore.get("media-data"),d="video"===o.media_type,[c,m,u]=(0,C.usePopup)(),[p,g]=(0,n.useState)(!1),[h,E]=(0,n.useState)(!1),[y,b]=(0,n.useState)({}),[S,w]=(0,n.useState)("main"),[P,M]=(0,n.useState)(Y);function k(e){f.MediaPageActions.reportMedia(e)}function _(){c.current.toggle()}function N(){c.current.tryToHide(),setTimeout((function(){f.PageActions.addNotification("Media Reported","reportedMedia"),E(!0),r.MediaPageStore.removeListener("reported_media",N)}),100)}return(0,n.useEffect)((()=>{h||(p?r.MediaPageStore.on("reported_media",N):r.MediaPageStore.removeListener("reported_media",N))}),[p]),(0,n.useEffect)((()=>{g(Object.keys(y).length&&e.allowDownload&&t.downloadMedia)}),[y]),(0,n.useEffect)((()=>{let a=Y;e.allowDownload&&t.downloadMedia&&"videoDownloadOptions"===S&&(a+=" video-downloads"),1===Object.keys(y).length&&e.allowDownload&&t.downloadMedia&&(d||i)&&(a+=" visible-only-in-small"),M(a)}),[S]),(0,n.useEffect)((()=>{b(G(t,o,e.allowDownload,i,h,k,_))}),[h]),(0,n.useEffect)((()=>(b(G(t,o,e.allowDownload,i,h,k,_)),()=>{p&&!h&&r.MediaPageStore.removeListener("reported_media",N)})),[]),p?n.createElement("div",{className:P},n.createElement(u,{contentRef:c},n.createElement("span",null,n.createElement(s.CircleIconButton,{type:"button"},n.createElement(s.MaterialIcon,{type:"more_horiz"})))),n.createElement("div",{className:"nav-page-"+S},n.createElement(m,{contentRef:c,hideCallback:function(){w("main")}},n.createElement(s.NavigationContentApp,{pageChangeCallback:function(e){w(e)},initPage:S,focusFirstItemOnPageChange:!1,pages:y,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"})))):null}J.propTypes={allowDownload:h().bool.isRequired},J.defaultProps={allowDownload:!1};var Z=a(3706);function Q(e){return e.renderDate?n.createElement("label",null,n.createElement("input",{type:"checkbox",checked:e.isChecked,onChange:function(t){t.persist(),e.isChecked?f.MediaPageActions.removeMediaFromPlaylist(e.playlistId,r.MediaPageStore.get("media-id")):f.MediaPageActions.addMediaToPlaylist(e.playlistId,r.MediaPageStore.get("media-id"))}}),n.createElement("span",null,e.title)):null}function X(e){const t=(0,n.useRef)(null),a=(0,n.useRef)(null),[i,l]=(0,n.useState)(new Date),[o,d]=(0,n.useState)(r.MediaPageStore.get("playlists")),[c,m]=(0,n.useState)(!1);function u(){y()}function p(){d(r.MediaPageStore.get("playlists")),l(new Date)}function g(){d(r.MediaPageStore.get("playlists")),l(new Date),setTimeout((function(){f.PageActions.addNotification("Media added to playlist","playlistMediaAdditionComplete")}),100)}function h(){setTimeout((function(){f.PageActions.addNotification("Media's addition to playlist failed","playlistMediaAdditionFail")}),100)}function v(){d(r.MediaPageStore.get("playlists")),l(new Date),setTimeout((function(){f.PageActions.addNotification("Media removed from playlist","playlistMediaRemovalComplete")}),100)}function E(){setTimeout((function(){f.PageActions.addNotification("Media's removal from playlist failed","playlistMediaaRemovalFail")}),100)}function y(){null!==a.current&&(a.current.style.maxHeight=window.innerHeight-74-(t.current.offsetHeight-a.current.offsetHeight)+"px")}function b(){m(!c),y()}return(0,n.useEffect)((()=>{y()})),(0,n.useEffect)((()=>(r.PageStore.on("window_resize",u),r.MediaPageStore.on("playlists_load",p),r.MediaPageStore.on("media_playlist_addition_completed",g),r.MediaPageStore.on("media_playlist_addition_failed",h),r.MediaPageStore.on("media_playlist_removal_completed",v),r.MediaPageStore.on("media_playlist_removal_failed",E),()=>{r.PageStore.removeListener("window_resize",u),r.MediaPageStore.removeListener("playlists_load",p),r.MediaPageStore.removeListener("media_playlist_addition_completed",g),r.MediaPageStore.removeListener("media_playlist_addition_failed",h),r.MediaPageStore.removeListener("media_playlist_removal_completed",v),r.MediaPageStore.removeListener("media_playlist_removal_failed",E)})),[]),n.createElement("div",{ref:t,className:"saveto-popup"},n.createElement("div",{className:"saveto-title"},"Save to...",n.createElement(s.CircleIconButton,{type:"button",onClick:function(){m(!1),void 0!==e.triggerPopupClose&&e.triggerPopupClose()}},n.createElement(s.MaterialIcon,{type:"close"}))),o.length?n.createElement("div",{ref:a,className:"saveto-select"},function(){const e=r.MediaPageStore.get("media-id");let t=[],a=0;for(;a{g(window.innerHeight-144+56),q(c.current.offsetHeight),$(u.current.offsetHeight)})),(0,n.useEffect)((()=>(r.PageStore.on("window_resize",Y),r.MediaPageStore.on("copied_embed_media_code",J),()=>{r.PageStore.removeListener("window_resize",Y),r.MediaPageStore.removeListener("copied_embed_media_code",J)})),[]),(0,n.useEffect)((()=>{!function(e){try{localStorage.setItem(ee,JSON.stringify(e))}catch(e){}}({showTitle:E,showRelated:b,showUserAvatar:w,linkTitle:M,responsive:_,aspectRatio:V,embedWidthValue:A,embedWidthUnit:U,embedHeightValue:O,embedHeightUnit:H,keepAspectRatio:h})}),[E,b,w,M,_,V,A,U,O,H,h]),n.createElement("div",{className:"share-embed",style:{maxHeight:p+"px"}},n.createElement("div",{className:"share-embed-inner"},n.createElement("div",{className:"on-left"},n.createElement("div",{className:"media-embed-wrap"},n.createElement(l.SiteConsumer,null,(e=>{const t=`${i.embed+r.MediaPageStore.get("media-id")}&showTitle=${E?"1":"0"}&showRelated=${b?"1":"0"}&showUserAvatar=${w?"1":"0"}&linkTitle=${M?"1":"0"}${C?"&t="+L.split(":").reverse().reduce(((e,t,a)=>e+(parseInt(t,10)||0)*Math.pow(60,a)),0):""}`;return n.createElement("div",{style:{width:"100%",height:"480px",overflow:"hidden"}},n.createElement("iframe",{width:"100%",height:"100%",src:t,frameBorder:"0",allowFullScreen:!0}))})))),n.createElement("div",{ref:d,className:"on-right"},n.createElement("div",{ref:c,className:"on-right-top"},n.createElement("div",{className:"on-right-top-inner"},n.createElement("span",{className:"ttl"},"Embed Video"),n.createElement(s.CircleIconButton,{type:"button",onClick:function(){void 0!==e.triggerPopupClose&&e.triggerPopupClose()}},n.createElement(s.MaterialIcon,{type:"close"})))),n.createElement("div",{ref:m,className:"on-right-middle",style:{top:j+"px",bottom:W+"px"}},n.createElement("textarea",{readOnly:!0,value:function(){const e=r.MediaPageStore.get("media-id"),t=new URLSearchParams;if(E?t.set("showTitle","1"):t.set("showTitle","0"),b?t.set("showRelated","1"):t.set("showRelated","0"),w?t.set("showUserAvatar","1"):t.set("showUserAvatar","0"),M?t.set("linkTitle","1"):t.set("linkTitle","0"),C&&L){const e=L.split(":").reverse();let a=0;e[0]&&(a+=parseInt(e[0],10)||0),e[1]&&(a+=60*(parseInt(e[1],10)||0)),e[2]&&(a+=3600*(parseInt(e[2],10)||0)),a>0&&t.set("t",a)}const a=i.embed.includes("?")?"&":"?",n=`${i.embed}${e}${a}${t.toString()}`;if(_){if("custom"===V)return``;const e=V.split(":"),t=`${e[0]} / ${e[1]}`;return``}return``}()}),n.createElement("div",{className:"iframe-config"},n.createElement("div",{className:"iframe-config-options-title"},"Embed options"),n.createElement("div",{className:"iframe-config-option"},n.createElement("div",{className:"option-content"},n.createElement("div",{className:"ratio-options",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0 10px"}},n.createElement("div",{className:"options-group"},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap"}},n.createElement("input",{type:"checkbox",checked:E,onChange:function(){y(!E)}}),"Show title")),n.createElement("div",{className:"options-group"},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap",opacity:E?1:.5}},n.createElement("input",{type:"checkbox",checked:M,onChange:function(){k(!M)},disabled:!E}),"Link title")),n.createElement("div",{className:"options-group"},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap"}},n.createElement("input",{type:"checkbox",checked:b,onChange:function(){S(!b)}}),"Show related")),n.createElement("div",{className:"options-group"},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap",opacity:E?1:.5}},n.createElement("input",{type:"checkbox",checked:w,onChange:function(){P(!w)},disabled:!E}),"Show user avatar")),n.createElement("div",{className:"options-group",style:{display:"flex",alignItems:"center"}},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap",display:"flex",alignItems:"center",marginRight:"10px"}},n.createElement("input",{type:"checkbox",checked:_,onChange:function(){const e=!_;if(N(e),e)v(!1);else if("custom"!==V){const e=V.split(":"),t=e[0],a=e[1];v(!0),F(parseInt(A*a/t,10))}else v(!1)}}),"Responsive")),n.createElement("div",{className:"options-group",style:{display:"flex",alignItems:"center"}},n.createElement("label",{style:{minHeight:"36px",whiteSpace:"nowrap",display:"flex",alignItems:"center",marginRight:"10px"}},n.createElement("input",{type:"checkbox",checked:C,onChange:function(){x(!C)}}),"Start at"),C&&n.createElement("input",{type:"text",value:L,onChange:function(e){I(e.target.value)},style:{width:"60px",height:"28px",fontSize:"12px",padding:"2px 5px"}})),n.createElement("div",{className:"options-group",style:{display:"flex",flexDirection:"column",justifyContent:"center"}},n.createElement("div",{style:{fontSize:"12px",marginBottom:"4px",color:"rgba(0,0,0,0.6)"}},"Aspect Ratio"),n.createElement("div",{style:{display:"flex",alignItems:"center"}},n.createElement("select",{ref:o,onChange:function(){const e=o.current.value;if("custom"===e)T(e),v(!1);else{const t=e.split(":"),a=t[0],i=t[1];T(e),v(!0),F(parseInt(A*i/a,10))}},value:V,style:{height:"28px",fontSize:"12px"}},n.createElement("option",{value:"16:9"},"16:9"),n.createElement("option",{value:"4:3"},"4:3"),n.createElement("option",{value:"3:2"},"3:2"),n.createElement("option",{value:"custom"},"Custom"))))),n.createElement("br",null),!_&&n.createElement(n.Fragment,null,n.createElement("div",{className:"options-group"},n.createElement(s.NumericInputWithUnit,{valueCallback:function(e){e=""===e?0:e;const t=V.split(":"),a=t[0],i=t[1];R(e),F(h?parseInt(e*i/a,10):O)},unitCallback:function(e){D(e)},label:"Width",defaultValue:parseInt(A,10),defaultUnit:U,minValue:1,maxValue:99999,units:z})),n.createElement("div",{className:"options-group"},n.createElement(s.NumericInputWithUnit,{valueCallback:function(e){e=""===e?0:e;const t=V.split(":"),a=t[0],i=t[1];F(e),R(h?parseInt(e*a/i,10):A)},unitCallback:function(e){B(e)},label:"Height",defaultValue:parseInt(O,10),defaultUnit:H,minValue:1,maxValue:99999,units:z}))))))),n.createElement("div",{ref:u,className:"on-right-bottom"},n.createElement("button",{onClick:function(){f.MediaPageActions.copyEmbedMediaCode(m.current.querySelector("textarea"))}},"COPY")))))}te.propTypes={triggerPopupClose:h().func};var ae=a(5289);function ie(e){let{onClick:t}=e;return n.createElement("span",{className:"next-slide"},n.createElement(s.CircleIconButton,{buttonShadow:!0,onClick:t},n.createElement("i",{className:"material-icons"},"keyboard_arrow_right")))}function ne(e){let{onClick:t}=e;return n.createElement("span",{className:"previous-slide"},n.createElement(s.CircleIconButton,{buttonShadow:!0,onClick:t},n.createElement("i",{className:"material-icons"},"keyboard_arrow_left")))}function le(){return{maxFormContentHeight:window.innerHeight-196,maxPopupWidth:518>window.innerWidth-80?window.innerWidth-80:null}}function re(e){const t=(0,n.useRef)(null),a=(0,n.useRef)(null),i=r.MediaPageStore.get("media-url"),[o,s]=(0,n.useState)(null),[d,c]=(0,n.useState)({prev:!1,next:!1}),[m,u]=(0,n.useState)(le()),[p]=(0,n.useState)(function(){const e=function(){const e=l.ShareOptionsContext._currentValue,t=r.MediaPageStore.get("media-url"),a=(r.MediaPageStore.get("media-data").title,{});let i=0;for(;i{s(new ae.A(a.current,".sh-option"))}),[p]),(0,n.useEffect)((()=>{o&&(o.updateDataStateOnResize(p.length,!0,!0),k())}),[m,o]),(0,n.useEffect)((()=>{r.PageStore.on("window_resize",P),r.MediaPageStore.on("copied_media_link",M);const e=function(){const e=document.getElementsByTagName("video");return e[0]?.currentTime}();return h(e),E(function(e){let t=parseInt(e,10),a=Math.floor(t/3600),i=Math.floor((t-3600*a)/60),n=t-3600*a-60*i;return a<10&&(a="0"+a),i<10&&(i="0"+i),n<10&&(n="0"+n),a>=1?a+":"+i+":"+n:i+":"+n}(e)),()=>{r.PageStore.removeListener("window_resize",P),r.MediaPageStore.removeListener("copied_media_link",M),s(null)}}),[]),n.createElement("div",{ref:t,style:null!==m.maxPopupWidth?{maxWidth:m.maxPopupWidth+"px"}:null},n.createElement("div",{className:"scrollable-content",style:null!==m.maxFormContentHeight?{maxHeight:m.maxFormContentHeight+"px"}:null},n.createElement("div",{className:"share-popup-title"},"Share media"),p.length?n.createElement("div",{className:"share-options"},d.prev?n.createElement(ne,{onClick:function(){o.previousSlide(),k()}}):null,n.createElement("div",{ref:a,className:"share-options-inner"},p),d.next?n.createElement(ie,{onClick:function(){o.nextSlide(),k()}}):null):null),n.createElement("div",{className:"copy-field"},n.createElement("div",null,n.createElement("input",{type:"text",readOnly:!0,value:S}),n.createElement("button",{onClick:function(){f.MediaPageActions.copyShareLink(t.current.querySelector(".copy-field input"))}},"COPY"))),n.createElement("div",{className:"start-at"},n.createElement("label",null,n.createElement("input",{type:"checkbox",name:"start-at-checkbox",id:"id-start-at-checkbox",checked:y,onChange:function(){b(!y),function(){const e=y?i:i+"&t="+Math.trunc(g);w(e)}()}}),"Start at ",v)))}function oe(){return{shareOptions:n.createElement("div",{className:"popup-fullscreen"},n.createElement(s.PopupMain,null,n.createElement("span",{className:"popup-fullscreen-overlay"}),n.createElement(re,null)))}}function se(e){const[t,a,i]=(0,C.usePopup)(),[l,r]=(0,n.useState)("shareOptions");return n.createElement("div",{className:"share"},n.createElement(i,{contentRef:t},n.createElement("button",null,n.createElement(s.CircleIconButton,{type:"span"},n.createElement(s.MaterialIcon,{type:"share"})),n.createElement("span",null,(0,v.translateString)("SHARE")))),n.createElement(a,{contentRef:t,hideCallback:function(){r("shareOptions")}},n.createElement(s.NavigationContentApp,{initPage:l,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id",pages:e.isVideo?(o=function(){t.current.toggle()},{...oe(),shareEmbed:n.createElement("div",{className:"popup-fullscreen share-embed-popup"},n.createElement(s.PopupMain,null,n.createElement("span",{className:"popup-fullscreen-overlay"}),n.createElement(te,{triggerPopupClose:o})))}):oe(),focusFirstItemOnPageChange:!1,pageChangeCallback:function(e){r(e)}})));var o}function de(e){return n.createElement("div",{className:"download hidden-only-in-small"},n.createElement("a",{href:e.link,target:"_blank",download:e.title,title:"Download",rel:"noreferrer"},n.createElement(s.CircleIconButton,{type:"span"},n.createElement(s.MaterialIcon,{type:"arrow_downward"})),n.createElement("span",null,"DOWNLOAD")))}function ce(){const e=r.MediaPageStore.get("media-data"),t=(e.title,e.encodings_info),a={};let i,n;for(i in t)if(t.hasOwnProperty(i)&&Object.keys(t[i]).length)for(n in t[i])if(t[i].hasOwnProperty(n)&&"success"===t[i][n].status&&100===t[i][n].progress&&null!==t[i][n].url){const r=e.original_media_url,o=r?r.substring(r.lastIndexOf("/")+1):e.title;a[t[i][n].title]={text:i+" - "+n.toUpperCase()+" ("+t[i][n].size+")",link:(0,v.formatInnerLink)(e.original_media_url,l.SiteContext._currentValue.url),linkAttr:{target:"_blank",download:o}}}const o=e.original_media_url,s=o?o.substring(o.lastIndexOf("/")+1):e.title;return a.original_media_url={text:"Original file ("+e.size+")",link:(0,v.formatInnerLink)(e.original_media_url,l.SiteContext._currentValue.url),linkAttr:{target:"_blank",download:s}},Object.values(a)}function me(e){const[t,a,i]=(0,C.usePopup)(),[l,r]=(0,n.useState)("main");return n.createElement("div",{className:"video-downloads hidden-only-in-small"},n.createElement(i,{contentRef:t},n.createElement("button",null,n.createElement(s.CircleIconButton,{type:"span"},n.createElement(s.MaterialIcon,{type:"arrow_downward"})),n.createElement("span",null,(0,v.translateString)("DOWNLOAD")))),n.createElement("div",{className:"nav-page-"+l},n.createElement(a,{contentRef:t},n.createElement(s.NavigationContentApp,{pageChangeCallback:null,initPage:"main",focusFirstItemOnPageChange:!1,pages:{main:n.createElement("div",{className:"main-options"},n.createElement(s.PopupMain,null,n.createElement(s.NavigationMenuList,{items:ce()})))},pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"}))))}de.propTypes={link:h().string.isRequired,title:h().string.isRequired};class ue extends n.PureComponent{constructor(e){super(e),this.state={likedMedia:r.MediaPageStore.get("user-liked-media"),dislikedMedia:r.MediaPageStore.get("user-disliked-media")},this.downloadLink="video"!==r.MediaPageStore.get("media-type")?(0,v.formatInnerLink)(r.MediaPageStore.get("media-original-url"),l.SiteContext._currentValue.url):null;const t=r.MediaPageStore.get("media-original-url");this.downloadFilename=t?t.substring(t.lastIndexOf("/")+1):this.props.title,this.updateStateValues=this.updateStateValues.bind(this)}componentDidMount(){r.MediaPageStore.on("liked_media",this.updateStateValues),r.MediaPageStore.on("unliked_media",this.updateStateValues),r.MediaPageStore.on("disliked_media",this.updateStateValues),r.MediaPageStore.on("undisliked_media",this.updateStateValues);const e=document.querySelectorAll("[data-tooltip]");e.length&&e.forEach((e=>function(e){const t=document.body,a=document.createElement("span");function i(){const t=e.getBoundingClientRect();a.style.top=t.top-(0+a.offsetHeight)+"px",a.style.left=t.left+"px"}a.innerText=e.getAttribute("data-tooltip"),a.setAttribute("class","tooltip"),e.removeAttribute("data-tooltip"),e.addEventListener("mouseenter",(function(){const n=e.getBoundingClientRect();t.appendChild(a),a.style.top=n.top-(0+a.offsetHeight)+"px",a.style.left=n.left+"px",document.addEventListener("scroll",i)})),e.addEventListener("mouseleave",(function(){t.removeChild(a),a.style.top="",a.style.left="",document.removeEventListener("scroll",i)}))}(e)))}updateStateValues(){this.setState({likedMedia:r.MediaPageStore.get("user-liked-media"),dislikedMedia:r.MediaPageStore.get("user-disliked-media")})}mediaCategories(e){if(void 0===this.props.categories||null===this.props.categories||!this.props.categories.length)return null;let t=0,a=[];for(;t=this.props.views?"view":"views"):null,n.createElement("div",{className:"media-actions"},n.createElement("div",null,l.MemberContext._currentValue.can.likeMedia?n.createElement(W,null):null,l.MemberContext._currentValue.can.dislikeMedia?n.createElement(q,null):null,l.MemberContext._currentValue.can.shareMedia?n.createElement(se,{isVideo:!1}):null,!l.MemberContext._currentValue.is.anonymous&&l.MemberContext._currentValue.can.saveMedia?n.createElement(K,null):null,this.props.allowDownload&&l.MemberContext._currentValue.can.downloadMedia?this.downloadLink?n.createElement(de,{link:this.downloadLink,title:this.downloadFilename}):n.createElement(me,null):null,n.createElement(J,{allowDownload:this.props.allowDownload})))))}}ue.propTypes={allowDownload:h().bool.isRequired},ue.defaultProps={allowDownload:!1};class pe extends ue{render(){const e=r.PageStore.get("config-options").pages.media.displayViews&&void 0!==this.props.views,t=r.MediaPageStore.get("media-data"),a=t.state,i=t.is_shared;let o="";switch(a){case"private":o="The site admins have to make its access public";break;case"unlisted":o="The site admins have to make it appear on listings"}return n.createElement("div",{className:"media-title-banner"},e&&r.PageStore.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories(!0):null,void 0!==this.props.title?n.createElement("h1",null,this.props.title):null,i||"public"!==a?n.createElement("div",{className:"media-labels-area"},n.createElement("div",{className:"media-labels-area-inner"},i?n.createElement(n.Fragment,null,n.createElement("span",{className:"media-label-state"},n.createElement("span",null,"shared")),n.createElement("span",{className:"helper-icon","data-tooltip":"This media is shared with specific users or categories"},n.createElement("i",{className:"material-icons"},"help_outline"))):"public"!==a?n.createElement(n.Fragment,null,n.createElement("span",{className:"media-label-state"},n.createElement("span",null,a)),n.createElement("span",{className:"helper-icon","data-tooltip":o},n.createElement("i",{className:"material-icons"},"help_outline"))):null)):null,n.createElement("div",{className:"media-views-actions"+(this.state.likedMedia?" liked-media":"")+(this.state.dislikedMedia?" disliked-media":"")},!e&&r.PageStore.get("config-options").pages.media.categoriesWithTitle?this.mediaCategories():null,e?n.createElement("div",{className:"media-views"},(0,v.formatViewsNumber)(this.props.views,!0)," ",1>=this.props.views?(0,v.translateString)("view"):(0,v.translateString)("views")):null,n.createElement("div",{className:"media-actions"},n.createElement("div",null,l.MemberContext._currentValue.can.likeMedia?n.createElement(W,null):null,l.MemberContext._currentValue.can.dislikeMedia?n.createElement(q,null):null,!(0,v.inEmbeddedApp)()&&l.MemberContext._currentValue.can.shareMedia?n.createElement(se,{isVideo:!0}):null,!l.MemberContext._currentValue.is.anonymous&&l.MemberContext._currentValue.can.saveMedia?n.createElement(K,null):null,this.props.allowDownload&&l.MemberContext._currentValue.can.downloadMedia?this.downloadLink?n.createElement(de,{link:this.downloadLink,title:this.downloadFilename}):n.createElement(me,null):null,n.createElement(J,{allowDownload:this.props.allowDownload})))))}}class ge extends n.PureComponent{constructor(e){super(e),this.state={videoLoaded:!1},this.onVideoLoad=this.onVideoLoad.bind(this),r.MediaPageStore.on("loaded_media_data",this.onVideoLoad)}onVideoLoad(){this.setState({videoLoaded:!0})}render(){let e,t,a,i,l,o,s=!1;return this.state.videoLoaded&&(s=r.MediaPageStore.get("media-data").allow_download,s=void 0===s||!!s,e=r.MediaPageStore.get("media-data").views,t=r.MediaPageStore.get("media-data").categories_info,a=r.MediaPageStore.get("media-data").title,i={name:r.MediaPageStore.get("media-data").author_name,url:r.MediaPageStore.get("media-data").author_profile,thumb:r.MediaPageStore.get("media-author-thumbnail-url")},l=r.MediaPageStore.get("media-data").add_date,o=r.MediaPageStore.get("media-data").description),this.state.videoLoaded?n.createElement("div",{className:"viewer-info"},n.createElement("div",{className:"viewer-info-inner"},n.createElement(ue,{title:a,views:e,categories:t,allowDownload:s}),n.createElement(j,{author:i,published:l,description:o}))):null}}class he extends ge{render(){let e,t,a,i,l,o,s=!1;return this.state.videoLoaded&&(s=r.MediaPageStore.get("media-data").allow_download,s=void 0===s||!!s,e=r.MediaPageStore.get("media-data").views,t=r.MediaPageStore.get("media-data").categories_info,a=r.MediaPageStore.get("media-data").title,i={name:r.MediaPageStore.get("media-data").author_name,url:r.MediaPageStore.get("media-data").author_profile,thumb:r.MediaPageStore.get("media-author-thumbnail-url")},l=r.MediaPageStore.get("media-data").add_date,o=r.MediaPageStore.get("media-data").description),this.state.videoLoaded?n.createElement("div",{className:"viewer-info"},n.createElement("div",{className:"viewer-info-inner"},n.createElement(pe,{title:a,views:e,categories:t,allowDownload:s}),n.createElement(j,{author:i,published:l,description:o}))):null}}class fe extends n.PureComponent{render(){return n.createElement("div",{className:"viewer-container",key:"viewer-container-error"},n.createElement("div",{className:"player-container player-container-error"},n.createElement("div",{className:"player-container-inner"},n.createElement("div",{className:"error-container"},n.createElement("div",{className:"error-container-inner"},n.createElement("span",{className:"icon-wrap"},n.createElement("i",{className:"material-icons"},"error_outline")),n.createElement("span",{className:"msg-wrap"},r.MediaPageStore.get("media-load-error-message")))))))}}var ve=a(4737);function Ee(e){return n.createElement(ve.k,{className:"items-list-hor",pageItems:9999,maxItems:9999,items:e.items,hideDate:!0,hideViews:!0,hidePlaylistOrderNumber:!1,horizontalItemsOrientation:!0,inPlaylistView:!0,singleLinkContent:!0,playlistActiveItem:e.playlistActiveItem})}Ee.propTypes={items:h().array.isRequired,playlistActiveItem:v.PositiveIntegerOrZero},Ee.defaultProps={playlistActiveItem:1};class ye extends n.PureComponent{constructor(e){super(e),this.state={expanded:!0,loopRepeat:r.PlaylistViewStore.get("enabled-loop"),shuffle:r.PlaylistViewStore.get("enabled-shuffle"),savedPlaylist:r.PlaylistViewStore.get("saved-playlist-loop"),title:e.playlistData.title,link:e.playlistData.url,authorName:e.playlistData.user,authorLink:l.LinksContext._currentValue.home+"/user/"+e.playlistData.user,activeItem:e.activeItem,totalMedia:e.playlistData.media_count,items:e.playlistData.playlist_media},this.onHeaderClick=this.onHeaderClick.bind(this),this.onLoopClick=this.onLoopClick.bind(this),this.onShuffleClick=this.onShuffleClick.bind(this),this.onSaveClick=this.onSaveClick.bind(this),this.onLoopRepeatUpdate=this.onLoopRepeatUpdate.bind(this),this.onShuffleUpdate=this.onShuffleUpdate.bind(this),this.onPlaylistSaveUpdate=this.onPlaylistSaveUpdate.bind(this),r.PlaylistViewStore.on("loop-repeat-updated",this.onLoopRepeatUpdate),r.PlaylistViewStore.on("shuffle-updated",this.onShuffleUpdate),r.PlaylistViewStore.on("saved-updated",this.onPlaylistSaveUpdate)}onHeaderClick(e){this.setState({expanded:!this.state.expanded})}onLoopClick(){f.PlaylistViewActions.toggleLoop()}onShuffleClick(){f.PlaylistViewActions.toggleShuffle()}onSaveClick(){f.PlaylistViewActions.toggleSave()}onShuffleUpdate(){this.setState({shuffle:r.PlaylistViewStore.get("enabled-shuffle")},(()=>{this.state.shuffle?f.PageActions.addNotification("Playlist shuffle is on","shuffle-on"):f.PageActions.addNotification("Playlist shuffle is off","shuffle-off")}))}onLoopRepeatUpdate(){this.setState({loopRepeat:r.PlaylistViewStore.get("enabled-loop")},(()=>{this.state.loopRepeat?f.PageActions.addNotification("Playlist loop is on","loop-on"):f.PageActions.addNotification("Playlist loop is off","loop-off")}))}onPlaylistSaveUpdate(){this.setState({savedPlaylist:r.PlaylistViewStore.get("saved-playlist")},(()=>{this.state.savedPlaylist?f.PageActions.addNotification("Added to playlists library","added-to-playlists-lib"):f.PageActions.addNotification("Removed from playlists library","removed-from-playlists-lib")}))}render(){return n.createElement("div",{className:"playlist-view-wrap"},n.createElement("div",{className:"playlist-view"+(this.state.expanded?" playlist-expanded-view":"")},n.createElement("div",{className:"playlist-header"},n.createElement("div",{className:"playlist-title"},n.createElement("a",{href:this.state.link,title:this.state.title},this.state.title)),n.createElement("div",{className:"playlist-meta"},n.createElement("span",null,n.createElement("a",{href:this.state.authorLink,title:this.state.authorName},this.state.authorName)),"  -  ",n.createElement("span",{className:"counter"},this.state.activeItem," / ",this.state.totalMedia)),n.createElement(s.CircleIconButton,{className:"toggle-playlist-view",onClick:this.onHeaderClick},this.state.expanded?n.createElement("i",{className:"material-icons"},"keyboard_arrow_up"):n.createElement("i",{className:"material-icons"},"keyboard_arrow_down"))),this.state.expanded?n.createElement("div",{className:"playlist-actions"},n.createElement(s.CircleIconButton,{className:this.state.loopRepeat?"active":"",onClick:this.onLoopClick,title:"Loop playlist"},n.createElement("i",{className:"material-icons"},"repeat"))):null,this.state.expanded&&this.state.items.length?n.createElement("div",{className:"playlist-media"},n.createElement(Ee,{items:this.state.items,playlistActiveItem:this.state.activeItem})):null))}}ye.propTypes={playlistData:h().object.isRequired,activeItem:v.PositiveIntegerOrZero},ye.defaultProps={};class be extends n.PureComponent{constructor(e){if(super(e),this.state={playlistData:e.playlistData,isPlaylistPage:!!e.playlistData,activeItem:0},e.playlistData){let t=0;for(;t{let e=null,t=null;const a=window.location.search.split("?")[1];return a&&a.split("&").forEach((a=>{0===a.indexOf("m=")?e=a.split("m=")[1]:0===a.indexOf("pl=")&&(t=a.split("pl=")[1])})),{mediaId:e,playlistId:t}},{mediaId:t,playlistId:a}=e();t&&(window.MediaCMS.mediaId=t),a&&(window.MediaCMS.playlistId=a)}(0,i.C)("page-media",class extends we{viewerContainerContent(e){switch(r.MediaPageStore.get("media-type")){case"video":case"audio":return n.createElement(l.SiteConsumer,null,(t=>n.createElement(N,{data:e,siteUrl:t.url,inEmbed:!1})));case"image":return n.createElement(c,null);case"pdf":const t=(0,v.formatInnerLink)(r.MediaPageStore.get("media-original-url"),l.SiteContext._currentValue.url);return n.createElement(p,{fileUrl:t})}return n.createElement(o,null)}})},463:function(e,t,a){"use strict";a.d(t,{c:function(){return l}});var i=a(4571),n=a.n(i);function l(e,t){let a=n()(e,{});return""!==a.origin&&"null"!==a.origin&&a.origin||(a=n()(t+"/"+e.replace(/^\//g,""),{})),a.toString()}},878:function(e,t,a){"use strict";a.d(t,{c:function(){return d}});var i=a(9471),n=a(8713),l=a.n(n),r=a(6387),o=a(5321),s=a(2828);function d(e){const{thumbnail:t}=(0,r.useUser)(),a={"aria-label":"Account profile photo that opens list of options and settings pages links",className:"thumbnail"};switch(e.isButton?void 0!==e.onClick&&(a.onClick=e.onClick):a.type="span",e.size){case"small":case"large":a.className+=" "+e.size+"-thumb"}return i.createElement(o.i,a,t?i.createElement("img",{src:t,alt:""}):i.createElement(s.Z,{type:"person"}))}d.propTypes={isButton:l().bool,size:l().oneOf(["small","medium","large"]),onClick:l().func},d.defaultProps={isButton:!1,size:"medium"}},1815:function(){},2787:function(){},3237:function(){},3818:function(e,t,a){"use strict";a.d(t,{_:function(){return r}});var i=a(9471),n=a(8713),l=a.n(n);function r(e){const t=(0,i.useRef)(null),a=(0,i.useRef)(null),[n,l]=(0,i.useState)(null),[r,o]=(0,i.useState)(null);return(0,i.useEffect)((()=>{l(function(e,t,a){if(void 0!==e){let i=null;return i=void 0!==t&&t>e?t:e,i=void 0!==a&&a=l)&&Object.keys(i.O).every((function(e){return i.O[e](a[s])}))?a.splice(s--,1):(o=!1,l0&&e[c-1][2]>l;c--)e[c]=e[c-1];e[c]=[a,n,l]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=201,function(){var e={201:0};i.O.j=function(t){return 0===e[t]};var t=function(t,a){var n,l,r=a[0],o=a[1],s=a[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(n in o)i.o(o,n)&&(i.m[n]=o[n]);if(s)var c=s(i)}for(t&&t(a);d{n.PlaylistPageActions.reorderedMediaInPlaylist(this.state.media)}))}.bind(this);m.Ay.create(e,{onStart:function(t){e.classList.add("on-dragging")},onEnd:function(n){const o=[],c=e.querySelectorAll(".item-order-number div div");let d,m,p,y=0;for(;y{let e=null,t=null;const a=window.location.search.split("?")[1];return a&&a.split("&").forEach((a=>{0===a.indexOf("m=")?e=a.split("m=")[1]:0===a.indexOf("pl=")&&(t=a.split("pl=")[1])})),{mediaId:e,playlistId:t}},{playlistId:t}=e();t&&(window.MediaCMS.playlistId=t)}function v(e){if(!e.media||!e.media.length)return i.createElement("span",null,e.children);let t=e.media[0].url;return window.MediaCMS.site.devEnv&&-1{if(e.thumb&&"string"==typeof e.thumb){const t=e.thumb.trim();a(""!==t?t:null)}else a(null)}),[e.thumb]),i.createElement("div",{className:"playlist-thumb"+(t?"":" no-thumb"),style:{backgroundImage:'url("'+t+'")'}},i.createElement(v,{id:e.id,media:e.media},i.createElement("span",null,t?i.createElement("img",{src:t,alt:""}):null,i.createElement("span",{className:"play-all"},i.createElement("span",null,i.createElement("span",null,i.createElement("i",{className:"material-icons"},"play_arrow"),i.createElement("span",{className:"play-all-label"},"PLAY ALL")))))))}function E(e){return i.createElement("div",{className:"playlist-title"},i.createElement("h1",null,e.title))}function S(e){return i.createElement("div",{className:"playlist-meta"},i.createElement("div",{className:"playlist-videos-number"},e.totalItems," media"),e.dateLabel?i.createElement("div",{className:"playlist-last-update"},e.dateLabel):null)}function C(e){const[t,a,l]=(0,r.usePopup)(),[s,o]=(0,i.useState)("main");return i.createElement("div",{className:"playlist-options-wrap"+("main"===s?" playlist-options-main":"")},i.createElement(l,{contentRef:t},i.createElement(c.CircleIconButton,null,i.createElement(c.MaterialIcon,{type:"more_horiz"}))),i.createElement(a,{contentRef:t},i.createElement(c.NavigationContentApp,{pageChangeCallback:o,initPage:"main",focusFirstItemOnPageChange:!1,pages:(d=function(){n.PlaylistPageActions.removePlaylist(),t.current.toggle()},m=function(){t.current.toggle()},{main:i.createElement(c.PopupMain,null,i.createElement(c.NavigationMenuList,{items:[{itemType:"open-subpage",text:"Delete",icon:"delete",buttonAttr:{className:"change-page","data-page-id":"proceedPlaylistRemovalPopup"}}]})),proceedPlaylistRemovalPopup:i.createElement(c.PopupMain,null,i.createElement("div",{className:"popup-message"},i.createElement("span",{className:"popup-message-title"},"Playlist removal"),i.createElement("span",{className:"popup-message-main"},"You're willing to remove playlist permanently?")),i.createElement("hr",null),i.createElement("span",{className:"popup-message-bottom"},i.createElement("button",{className:"button-link cancel-playlist-removal",onClick:m},"CANCEL"),i.createElement("button",{className:"button-link proceed-playlist-removal",onClick:d},"PROCEED")))}),pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"})));var d,m}function N(e){const[t,a,l]=(0,r.usePopup)();function m(){t.current.toggle()}function u(e){setTimeout((function(){n.PageActions.addNotification("Playlist updated","playlistUpdateCompleted"),m()}),100)}function p(){setTimeout((function(){n.PageActions.addNotification("Playlist update failed","playlistUpdateFailed"),m()}),100)}function y(e){setTimeout((function(){n.PageActions.addNotification("Playlist removed. Redirecting...","playlistDelete"),setTimeout((function(){window.location.href=s.MemberContext._currentValue.pages.playlists}),2e3)}),100)}function g(e){setTimeout((function(){n.PageActions.addNotification("Playlist removal failed","playlistDeleteFail")}),100)}return(0,i.useEffect)((()=>(o.PlaylistPageStore.on("playlist_update_completed",u),o.PlaylistPageStore.on("playlist_update_failed",p),o.PlaylistPageStore.on("playlist_removal_completed",y),o.PlaylistPageStore.on("playlist_removal_failed",g),()=>{o.PlaylistPageStore.removeListener("playlist_update_completed",u),o.PlaylistPageStore.removeListener("playlist_update_failed",p),o.PlaylistPageStore.removeListener("playlist_removal_completed",y),o.PlaylistPageStore.removeListener("playlist_removal_failed",g)})),[]),i.createElement("div",{className:"edit-playlist"},i.createElement(l,{contentRef:t},i.createElement(c.CircleIconButton,null,i.createElement(c.MaterialIcon,{type:"edit"}),i.createElement("span",null,"EDIT"))),i.createElement(a,{contentRef:t},i.createElement("div",{className:"popup-fullscreen"},i.createElement(c.PopupMain,null,i.createElement("span",{className:"popup-fullscreen-overlay"}),i.createElement("div",{className:"edit-playlist-form-wrap"},i.createElement("div",{className:"edit-playlist-popup-title"},"Edit playlist",i.createElement(c.CircleIconButton,{type:"button",onClick:m},i.createElement(c.MaterialIcon,{type:"close"}))),i.createElement(d.w,{date:(new Date).getTime(),id:o.PlaylistPageStore.get("playlistId"),onCancel:m,onPlaylistSave:function(){}}))))))}function _(e){return e.loggedinUserPlaylist?i.createElement("div",{className:"playlist-actions"},e.loggedinUserPlaylist?i.createElement(C,null):null):null}function k(e){return i.createElement("div",{className:"playlist-author"},i.createElement("div",null,i.createElement("div",{className:"playlist-author-thumb"},i.createElement("a",{href:e.link,title:e.name},e.thumb?i.createElement("span",{style:{backgroundImage:"url("+e.thumb+")"}},i.createElement("img",{src:e.thumb,alt:""})):i.createElement("span",null,i.createElement(c.MaterialIcon,{type:"person"})))),i.createElement("div",{className:"playlist-author-name"},i.createElement("a",{href:e.link,title:e.name},e.name)),e.loggedinUserPlaylist?i.createElement(N,null):null))}class I extends h.Y{constructor(e){super(e,"playlist-page"),this.state={thumb:o.PlaylistPageStore.get("thumb"),media:o.PlaylistPageStore.get("playlist-media"),savedPlaylist:o.PlaylistPageStore.get("saved-playlist"),loggedinUserPlaylist:o.PlaylistPageStore.get("logged-in-user-playlist"),title:o.PlaylistPageStore.get("title"),description:o.PlaylistPageStore.get("description")},this.onLoadPlaylistData=this.onLoadPlaylistData.bind(this),o.PlaylistPageStore.on("loaded_playlist_data",this.onLoadPlaylistData),this.onMediaRemovedFromPlaylist=this.onMediaRemovedFromPlaylist.bind(this),o.PlaylistPageStore.on("removed_media_from_playlist",this.onMediaRemovedFromPlaylist),this.onMediaReorderedInPlaylist=this.onMediaReorderedInPlaylist.bind(this),o.PlaylistPageStore.on("reordered_media_in_playlist",this.onMediaReorderedInPlaylist),this.onCompletePlaylistUpdate=this.onCompletePlaylistUpdate.bind(this),o.PlaylistPageStore.on("playlist_update_completed",this.onCompletePlaylistUpdate)}onCompletePlaylistUpdate(){this.setState({thumb:o.PlaylistPageStore.get("thumb"),title:o.PlaylistPageStore.get("title"),description:o.PlaylistPageStore.get("description")})}onLoadPlaylistData(){this.setState({thumb:o.PlaylistPageStore.get("thumb"),title:o.PlaylistPageStore.get("title"),description:o.PlaylistPageStore.get("description"),media:o.PlaylistPageStore.get("playlist-media"),savedPlaylist:o.PlaylistPageStore.get("saved-playlist"),loggedinUserPlaylist:o.PlaylistPageStore.get("logged-in-user-playlist")})}componentDidMount(){n.PlaylistPageActions.loadPlaylistData()}onMediaRemovedFromPlaylist(){this.setState({media:o.PlaylistPageStore.get("playlist-media"),thumb:o.PlaylistPageStore.get("thumb")})}onMediaReorderedInPlaylist(){this.setState({media:o.PlaylistPageStore.get("playlist-media"),thumb:o.PlaylistPageStore.get("thumb")})}pageContent(){const e=o.PlaylistPageStore.get("playlistId");return e?[i.createElement("div",{key:"playlistDetails",className:"playlist-details"},i.createElement(b,{id:e,thumb:this.state.thumb,media:this.state.media}),i.createElement(E,{title:this.state.title}),i.createElement(S,{totalItems:o.PlaylistPageStore.get("total-items"),dateLabel:o.PlaylistPageStore.get("date-label"),viewsCount:o.PlaylistPageStore.get("views-count")}),i.createElement(_,{loggedinUserPlaylist:this.state.loggedinUserPlaylist,savedPlaylist:this.state.savedPlaylist}),this.state.description?i.createElement("div",{className:"playlist-description"},this.state.description):null,i.createElement(k,{name:o.PlaylistPageStore.get("author-name"),link:o.PlaylistPageStore.get("author-link"),thumb:o.PlaylistPageStore.get("author-thumb"),loggedinUserPlaylist:this.state.loggedinUserPlaylist})),i.createElement(f,{key:"playlistMediaList_"+this.state.media.length,id:e,media:this.state.media,loggedinUserPlaylist:this.state.loggedinUserPlaylist})]:null}}(0,l.C)("page-playlist",I)},878:function(e,t,a){a.d(t,{c:function(){return c}});var l=a(9471),i=a(8713),n=a.n(i),s=a(6387),r=a(5321),o=a(2828);function c(e){const{thumbnail:t}=(0,s.useUser)(),a={"aria-label":"Account profile photo that opens list of options and settings pages links",className:"thumbnail"};switch(e.isButton?void 0!==e.onClick&&(a.onClick=e.onClick):a.type="span",e.size){case"small":case"large":a.className+=" "+e.size+"-thumb"}return l.createElement(r.i,a,t?l.createElement("img",{src:t,alt:""}):l.createElement(o.Z,{type:"person"}))}c.propTypes={isButton:n().bool,size:n().oneOf(["small","medium","large"]),onClick:n().func},c.defaultProps={isButton:!1,size:"medium"}},3818:function(e,t,a){a(9471);var l=a(8713),i=a.n(l);i().string,i().array.isRequired,i().string,i().number,i().number,i().number,i().func,i().func},6568:function(e,t,a){a.d(t,{x:function(){return s}});var l=a(9471),i=a(8713),n=a.n(i);function s(e){let t="spinner-loader";switch(e.size){case"tiny":case"x-small":case"small":case"large":case"x-large":t+=" "+e.size}return l.createElement("div",{className:t},l.createElement("svg",{className:"circular",viewBox:"25 25 50 50"},l.createElement("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:"1.5",strokeMiterlimit:"10"})))}s.propTypes={size:n().oneOf(["tiny","x-small","small","medium","large","x-large"])},s.defaultProps={size:"medium"}},7664:function(e,t,a){a.d(t,{CircleIconButton:function(){return l.i},MaterialIcon:function(){return i.Z},NavigationContentApp:function(){return n.V},NavigationMenuList:function(){return s.S},Notifications:function(){return r.$},PopupMain:function(){return o.AP},PopupTop:function(){return o.cp},SpinnerLoader:function(){return c.x},UserThumbnail:function(){return d.c}});var l=a(5321),i=(a(7256),a(3135),a(2828)),n=a(5305),s=a(7201),r=a(6089),o=(a(3818),a(2901)),c=a(6568),d=a(878)}},a={};function l(e){var i=a[e];if(void 0!==i)return i.exports;var n=a[e]={exports:{}};return t[e].call(n.exports,n,n.exports,l),n.exports}l.m=t,e=[],l.O=function(t,a,i,n){if(!a){var s=1/0;for(d=0;d=n)&&Object.keys(l.O).every((function(e){return l.O[e](a[o])}))?a.splice(o--,1):(r=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,i,n]},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.j=33,function(){var e={33:0};l.O.j=function(t){return 0===e[t]};var t=function(t,a){var i,n,s=a[0],r=a[1],o=a[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(i in r)l.o(r,i)&&(l.m[i]=r[i]);if(o)var d=o(l)}for(t&&t(a);c{n.PlaylistPageActions.reorderedMediaInPlaylist(this.state.media)}))}.bind(this);m.Ay.create(e,{onStart:function(t){e.classList.add("on-dragging")},onEnd:function(n){const o=[],c=e.querySelectorAll(".item-order-number div div");let d,m,p,y=0;for(;y{let e=null,t=null;const a=window.location.search.split("?")[1];return a&&a.split("&").forEach((a=>{0===a.indexOf("m=")?e=a.split("m=")[1]:0===a.indexOf("pl=")&&(t=a.split("pl=")[1])})),{mediaId:e,playlistId:t}},{playlistId:t}=e();t&&(window.MediaCMS.playlistId=t)}function v(e){if(!e.media||!e.media.length)return i.createElement("span",null,e.children);let t=e.media[0].url;return window.MediaCMS.site.devEnv&&-1{if(e.thumb&&"string"==typeof e.thumb){const t=e.thumb.trim();a(""!==t?t:null)}else a(null)}),[e.thumb]),i.createElement("div",{className:"playlist-thumb"+(t?"":" no-thumb"),style:{backgroundImage:'url("'+t+'")'}},i.createElement(v,{id:e.id,media:e.media},i.createElement("span",null,t?i.createElement("img",{src:t,alt:""}):null,i.createElement("span",{className:"play-all"},i.createElement("span",null,i.createElement("span",null,i.createElement("i",{className:"material-icons"},"play_arrow"),i.createElement("span",{className:"play-all-label"},"PLAY ALL")))))))}function E(e){return i.createElement("div",{className:"playlist-title"},i.createElement("h1",null,e.title))}function S(e){return i.createElement("div",{className:"playlist-meta"},i.createElement("div",{className:"playlist-videos-number"},e.totalItems," media"),e.dateLabel?i.createElement("div",{className:"playlist-last-update"},e.dateLabel):null)}function C(e){const[t,a,l]=(0,r.usePopup)(),[s,o]=(0,i.useState)("main");return i.createElement("div",{className:"playlist-options-wrap"+("main"===s?" playlist-options-main":"")},i.createElement(l,{contentRef:t},i.createElement(c.CircleIconButton,null,i.createElement(c.MaterialIcon,{type:"more_horiz"}))),i.createElement(a,{contentRef:t},i.createElement(c.NavigationContentApp,{pageChangeCallback:o,initPage:"main",focusFirstItemOnPageChange:!1,pages:(d=function(){n.PlaylistPageActions.removePlaylist(),t.current.toggle()},m=function(){t.current.toggle()},{main:i.createElement(c.PopupMain,null,i.createElement(c.NavigationMenuList,{items:[{itemType:"open-subpage",text:"Delete",icon:"delete",buttonAttr:{className:"change-page","data-page-id":"proceedPlaylistRemovalPopup"}}]})),proceedPlaylistRemovalPopup:i.createElement(c.PopupMain,null,i.createElement("div",{className:"popup-message"},i.createElement("span",{className:"popup-message-title"},"Playlist removal"),i.createElement("span",{className:"popup-message-main"},"You're willing to remove playlist permanently?")),i.createElement("hr",null),i.createElement("span",{className:"popup-message-bottom"},i.createElement("button",{className:"button-link cancel-playlist-removal",onClick:m},"CANCEL"),i.createElement("button",{className:"button-link proceed-playlist-removal",onClick:d},"PROCEED")))}),pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id"})));var d,m}function N(e){const[t,a,l]=(0,r.usePopup)();function m(){t.current.toggle()}function u(e){setTimeout((function(){n.PageActions.addNotification("Playlist updated","playlistUpdateCompleted"),m()}),100)}function p(){setTimeout((function(){n.PageActions.addNotification("Playlist update failed","playlistUpdateFailed"),m()}),100)}function y(e){setTimeout((function(){n.PageActions.addNotification("Playlist removed. Redirecting...","playlistDelete"),setTimeout((function(){window.location.href=s.MemberContext._currentValue.pages.playlists}),2e3)}),100)}function g(e){setTimeout((function(){n.PageActions.addNotification("Playlist removal failed","playlistDeleteFail")}),100)}return(0,i.useEffect)((()=>(o.PlaylistPageStore.on("playlist_update_completed",u),o.PlaylistPageStore.on("playlist_update_failed",p),o.PlaylistPageStore.on("playlist_removal_completed",y),o.PlaylistPageStore.on("playlist_removal_failed",g),()=>{o.PlaylistPageStore.removeListener("playlist_update_completed",u),o.PlaylistPageStore.removeListener("playlist_update_failed",p),o.PlaylistPageStore.removeListener("playlist_removal_completed",y),o.PlaylistPageStore.removeListener("playlist_removal_failed",g)})),[]),i.createElement("div",{className:"edit-playlist"},i.createElement(l,{contentRef:t},i.createElement(c.CircleIconButton,null,i.createElement(c.MaterialIcon,{type:"edit"}),i.createElement("span",null,"EDIT"))),i.createElement(a,{contentRef:t},i.createElement("div",{className:"popup-fullscreen"},i.createElement(c.PopupMain,null,i.createElement("span",{className:"popup-fullscreen-overlay"}),i.createElement("div",{className:"edit-playlist-form-wrap"},i.createElement("div",{className:"edit-playlist-popup-title"},"Edit playlist",i.createElement(c.CircleIconButton,{type:"button",onClick:m},i.createElement(c.MaterialIcon,{type:"close"}))),i.createElement(d.w,{date:(new Date).getTime(),id:o.PlaylistPageStore.get("playlistId"),onCancel:m,onPlaylistSave:function(){}}))))))}function _(e){return e.loggedinUserPlaylist?i.createElement("div",{className:"playlist-actions"},e.loggedinUserPlaylist?i.createElement(C,null):null):null}function k(e){return i.createElement("div",{className:"playlist-author"},i.createElement("div",null,i.createElement("div",{className:"playlist-author-thumb"},i.createElement("a",{href:e.link,title:e.name},e.thumb?i.createElement("span",{style:{backgroundImage:"url("+e.thumb+")"}},i.createElement("img",{src:e.thumb,alt:""})):i.createElement("span",null,i.createElement(c.MaterialIcon,{type:"person"})))),i.createElement("div",{className:"playlist-author-name"},i.createElement("a",{href:e.link,title:e.name},e.name)),e.loggedinUserPlaylist?i.createElement(N,null):null))}class I extends h.Y{constructor(e){super(e,"playlist-page"),this.state={thumb:o.PlaylistPageStore.get("thumb"),media:o.PlaylistPageStore.get("playlist-media"),savedPlaylist:o.PlaylistPageStore.get("saved-playlist"),loggedinUserPlaylist:o.PlaylistPageStore.get("logged-in-user-playlist"),title:o.PlaylistPageStore.get("title"),description:o.PlaylistPageStore.get("description")},this.onLoadPlaylistData=this.onLoadPlaylistData.bind(this),o.PlaylistPageStore.on("loaded_playlist_data",this.onLoadPlaylistData),this.onMediaRemovedFromPlaylist=this.onMediaRemovedFromPlaylist.bind(this),o.PlaylistPageStore.on("removed_media_from_playlist",this.onMediaRemovedFromPlaylist),this.onMediaReorderedInPlaylist=this.onMediaReorderedInPlaylist.bind(this),o.PlaylistPageStore.on("reordered_media_in_playlist",this.onMediaReorderedInPlaylist),this.onCompletePlaylistUpdate=this.onCompletePlaylistUpdate.bind(this),o.PlaylistPageStore.on("playlist_update_completed",this.onCompletePlaylistUpdate)}onCompletePlaylistUpdate(){this.setState({thumb:o.PlaylistPageStore.get("thumb"),title:o.PlaylistPageStore.get("title"),description:o.PlaylistPageStore.get("description")})}onLoadPlaylistData(){this.setState({thumb:o.PlaylistPageStore.get("thumb"),title:o.PlaylistPageStore.get("title"),description:o.PlaylistPageStore.get("description"),media:o.PlaylistPageStore.get("playlist-media"),savedPlaylist:o.PlaylistPageStore.get("saved-playlist"),loggedinUserPlaylist:o.PlaylistPageStore.get("logged-in-user-playlist")})}componentDidMount(){n.PlaylistPageActions.loadPlaylistData()}onMediaRemovedFromPlaylist(){this.setState({media:o.PlaylistPageStore.get("playlist-media"),thumb:o.PlaylistPageStore.get("thumb")})}onMediaReorderedInPlaylist(){this.setState({media:o.PlaylistPageStore.get("playlist-media"),thumb:o.PlaylistPageStore.get("thumb")})}pageContent(){const e=o.PlaylistPageStore.get("playlistId");return e?[i.createElement("div",{key:"playlistDetails",className:"playlist-details"},i.createElement(b,{id:e,thumb:this.state.thumb,media:this.state.media}),i.createElement(E,{title:this.state.title}),i.createElement(S,{totalItems:o.PlaylistPageStore.get("total-items"),dateLabel:o.PlaylistPageStore.get("date-label"),viewsCount:o.PlaylistPageStore.get("views-count")}),i.createElement(_,{loggedinUserPlaylist:this.state.loggedinUserPlaylist,savedPlaylist:this.state.savedPlaylist}),this.state.description?i.createElement("div",{className:"playlist-description"},this.state.description):null,i.createElement(k,{name:o.PlaylistPageStore.get("author-name"),link:o.PlaylistPageStore.get("author-link"),thumb:o.PlaylistPageStore.get("author-thumb"),loggedinUserPlaylist:this.state.loggedinUserPlaylist})),i.createElement(f,{key:"playlistMediaList_"+this.state.media.length,id:e,media:this.state.media,loggedinUserPlaylist:this.state.loggedinUserPlaylist})]:null}}(0,l.C)("page-playlist",I)},878:function(e,t,a){a.d(t,{c:function(){return c}});var l=a(9471),i=a(8713),n=a.n(i),s=a(6387),r=a(5321),o=a(2828);function c(e){const{thumbnail:t}=(0,s.useUser)(),a={"aria-label":"Account profile photo that opens list of options and settings pages links",className:"thumbnail"};switch(e.isButton?void 0!==e.onClick&&(a.onClick=e.onClick):a.type="span",e.size){case"small":case"large":a.className+=" "+e.size+"-thumb"}return l.createElement(r.i,a,t?l.createElement("img",{src:t,alt:""}):l.createElement(o.Z,{type:"person"}))}c.propTypes={isButton:n().bool,size:n().oneOf(["small","medium","large"]),onClick:n().func},c.defaultProps={isButton:!1,size:"medium"}},3818:function(e,t,a){a(9471);var l=a(8713),i=a.n(l);i().string,i().array.isRequired,i().string,i().number,i().number,i().number,i().func,i().func},6568:function(e,t,a){a.d(t,{x:function(){return s}});var l=a(9471),i=a(8713),n=a.n(i);function s(e){let t="spinner-loader";switch(e.size){case"tiny":case"x-small":case"small":case"large":case"x-large":t+=" "+e.size}return l.createElement("div",{className:t},l.createElement("svg",{className:"circular",viewBox:"25 25 50 50"},l.createElement("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:"1.5",strokeMiterlimit:"10"})))}s.propTypes={size:n().oneOf(["tiny","x-small","small","medium","large","x-large"])},s.defaultProps={size:"medium"}},7664:function(e,t,a){a.d(t,{CircleIconButton:function(){return l.i},MaterialIcon:function(){return i.Z},NavigationContentApp:function(){return n.V},NavigationMenuList:function(){return s.S},Notifications:function(){return r.$},PopupMain:function(){return o.AP},PopupTop:function(){return o.cp},SpinnerLoader:function(){return c.x},UserThumbnail:function(){return d.c}});var l=a(5321),i=(a(7256),a(3135),a(2828)),n=a(5305),s=a(7201),r=a(6089),o=(a(3818),a(2901)),c=a(6568),d=a(878)}},a={};function l(e){var i=a[e];if(void 0!==i)return i.exports;var n=a[e]={exports:{}};return t[e].call(n.exports,n,n.exports,l),n.exports}l.m=t,e=[],l.O=function(t,a,i,n){if(!a){var s=1/0;for(d=0;d=n)&&Object.keys(l.O).every((function(e){return l.O[e](a[o])}))?a.splice(o--,1):(r=!1,n0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,i,n]},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var a in t)l.o(t,a)&&!l.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.j=33,function(){var e={33:0};l.O.j=function(t){return 0===e[t]};var t=function(t,a){var i,n,s=a[0],r=a[1],o=a[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(i in r)l.o(r,i)&&(l.m[i]=r[i]);if(o)var d=o(l)}for(t&&t(a);c=0?null:(0,s.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(i||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var n},a=function(e,t,i){return void 0===e[t]||(n=e[t])===Math.trunc(n)&&n>0?null:(0,s.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(i||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var n}},1936:function(e,t,i){"use strict";i.d(t,{PageHeader:function(){return s.z},PageMain:function(){return n.P},PageSidebar:function(){return a.E}});var s=i(1254),n=i(3212),a=i(795);i(1470)},2828:function(e,t,i){"use strict";i.d(t,{Z:function(){return n}});var s=i(9471);const n=e=>{let{type:t}=e;return t?s.createElement("i",{className:"material-icons","data-icon":t}):null}},2901:function(e,t,i){"use strict";i.d(t,{AP:function(){return l},cp:function(){return a}});var s=i(9471);const n=s.forwardRef(((e,t)=>void 0!==e.children?s.createElement("div",{ref:t,className:"popup"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null));function a(e){return void 0!==e.children?s.createElement("div",{className:"popup-top"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}function l(e){return void 0!==e.children?s.createElement("div",{className:"popup-main"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}t.Ay=n},3135:function(e,t,i){"use strict";i.d(t,{I:function(){return r}});var s=i(9471),n=i(8713),a=i.n(n),l=i(2828);function r(e){const[t,i]=(0,s.useState)(e.active);return s.createElement("div",{className:"mi-filters-toggle"},s.createElement("button",{className:t?"active":"","aria-label":"Filter",onClick:function(){i(!t),void 0!==e.onClick&&e.onClick()}},s.createElement(l.Z,{type:"filter_list"}),s.createElement("span",{className:"filter-button-label"},s.createElement("span",{className:"filter-button-label-text"},"FILTERS"))))}r.propTypes={onClick:a().func,active:a().bool},r.defaultProps={active:!1}},3818:function(e,t,i){"use strict";i.d(t,{_:function(){return l}});var s=i(9471),n=i(8713),a=i.n(n);function l(e){const t=(0,s.useRef)(null),i=(0,s.useRef)(null),[n,a]=(0,s.useState)(null),[l,r]=(0,s.useState)(null);return(0,s.useEffect)((()=>{a(function(e,t,i){if(void 0!==e){let s=null;return s=void 0!==t&&t>e?t:e,s=void 0!==i&&i{void 0!==e.pages[e.initPage]?a(e.initPage):Object.keys(e.pages).length?a(Object.keys(e.pages)[0]):a(null)}),[e.initPage]),(0,s.useEffect)((()=>{!function(){let e=0;for(;et=>r(e,t))(i),l[i].elem.addEventListener("click",l[i].listener)),i+=1;e.focusFirstItemOnPageChange&&a.focus()}(),"function"==typeof e.pageChangeCallback&&e.pageChangeCallback(i))}),[i]),i?s.createElement("div",{ref:t},s.cloneElement(e.pages[i])):null}r.propTypes={initPage:l().string,pages:l().object.isRequired,pageChangeSelector:l().string.isRequired,pageIdSelectorAttr:l().string.isRequired,focusFirstItemOnPageChange:l().bool,pageChangeCallback:l().func},r.defaultProps={focusFirstItemOnPageChange:!0}},5321:function(e,t,i){"use strict";i.d(t,{i:function(){return r}});var s=i(9471),n=i(8713),a=i.n(n);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t(l=setTimeout((function(){r=setTimeout((function(){a(!1),r=null}),1e3),l=null,i(!0),e.onHide(e.id)}),5e3),()=>{l&&clearTimeout(l),r&&clearTimeout(r)})),[]),n?s.createElement("div",{className:"notification-item"+(t?" hidden":"")},s.createElement("div",null,s.createElement("span",null,e.children||"No message"))):null}function r(){const[e,t]=(0,s.useState)(a.length);function i(){t(n.default.get("notifications-size")+a.length)}function r(e){const t=[];a.map((i=>{i[0]!==e&&t.push(i)})),a=t}return(0,s.useEffect)((()=>(i(),n.default.on("added_notification",i),()=>n.default.removeListener("added_notification",i))),[]),e?s.createElement("div",{className:"notifications"},s.createElement("div",null,function(){const e=n.default.get("notifications");return[...a.map((e=>s.createElement(l,{key:e[0],id:e[0],onHide:r},e[1]))),...e.map((e=>(a.push(e),s.createElement(l,{key:e[0],id:e[0],onHide:r},e[1]))))]}())," "):null}},6371:function(e,t,i){"use strict";i.r(t);var s=i(9032),n=i.n(s),a=i(7154),l=i(9200),r=i(3997);function o(){let e=new Uint32Array(3);return window.crypto.getRandomValues(e),(performance.now().toString(36)+Array.from(e).map((e=>e.toString(36))).join("")).replace(/./g,""+Math.random()+Intl.DateTimeFormat().resolvedOptions().timeZone+Date.now())}let u,c=null,d=null;class h extends(n()){constructor(e){super(),d=(0,r.$)(window.MediaCMS),u=new a.BrowserCache(d.site.id,86400),c={mediaAutoPlay:u.get("media-auto-play")},c.mediaAutoPlay=null===c.mediaAutoPlay||c.mediaAutoPlay,this.browserEvents=(0,l.BrowserEvents)(),this.browserEvents.doc(this.onDocumentVisibilityChange.bind(this)),this.browserEvents.win(this.onWindowResize.bind(this),this.onWindowScroll.bind(this)),this.notifications=function(e){let t=[];function i(e){"string"==typeof e&&t.push([o(),e])}return e.map(i),{size:function(){return t.length},push:i,clear:function(){t=[]},messages:function(){return[...t]}}}(void 0!==window.MediaCMS&&void 0!==window.MediaCMS.notifications?window.MediaCMS.notifications:[])}onDocumentVisibilityChange(){this.emit("document_visibility_change")}onWindowScroll(){this.emit("window_scroll")}onWindowResize(){this.emit("window_resize")}initPage(e){c.currentPage=e}get(e){let t;switch(e){case"browser-cache":t=u;break;case"media-auto-play":t=c.mediaAutoPlay;break;case"config-contents":t=d.contents;break;case"config-enabled":t=d.enabled;break;case"config-media-item":t=d.media.item;break;case"config-options":t=d.options;break;case"config-site":t=d.site;break;case"api-playlists":i=e.split("-")[1],t=d.api[i]||null;break;case"notifications-size":t=this.notifications.size();break;case"notifications":t=this.notifications.messages(),this.notifications.clear();break;case"current-page":t=c.currentPage}var i;return t}actions_handler(e){switch(e.type){case"INIT_PAGE":this.initPage(e.page),this.emit("page_init");break;case"TOGGLE_AUTO_PLAY":c.mediaAutoPlay=!c.mediaAutoPlay,u.set("media-auto-play",c.mediaAutoPlay),this.emit("switched_media_auto_play");break;case"ADD_NOTIFICATION":this.notifications.push(e.notification),this.emit("added_notification")}}}t.default=(0,l.exportStore)(new h,"actions_handler")},6403:function(e,t,i){"use strict";i.d(t,{g:function(){return l},m:function(){return a}});var s=i(8004);function n(e,t,i){let s;switch(i){case TypeError:case RangeError:case SyntaxError:case ReferenceError:s=new i(t[0]);break;default:s=new Error(t[0])}return e(s.message,...t.slice(1)),s}function a(e,t){return n(s.z,e,t)}function l(e,t){return n(s.R,e,t)}},6568:function(e,t,i){"use strict";i.d(t,{x:function(){return l}});var s=i(9471),n=i(8713),a=i.n(n);function l(e){let t="spinner-loader";switch(e.size){case"tiny":case"x-small":case"small":case"large":case"x-large":t+=" "+e.size}return s.createElement("div",{className:t},s.createElement("svg",{className:"circular",viewBox:"25 25 50 50"},s.createElement("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:"1.5",strokeMiterlimit:"10"})))}l.propTypes={size:a().oneOf(["tiny","x-small","small","medium","large","x-large"])},l.defaultProps={size:"medium"}},7143:function(e,t,i){const s=i(2063).Dispatcher;e.exports=new s},7201:function(e,t,i){"use strict";i.d(t,{S:function(){return u}});var s=i(9471),n=i(8713),a=i.n(n),l=i(2828);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;ts.createElement(o,r({key:t},e))));return t.length?s.createElement("div",{className:"nav-menu"+(e.removeVerticalPadding?" pv0":"")},s.createElement("nav",null,s.createElement("ul",null,t))):null}o.propTypes={itemType:a().oneOf(["link","open-subpage","button","label","div"]),link:a().string,icon:a().string,iconPos:a().oneOf(["left","right"]),text:a().string,active:a().bool,divAttr:a().object,buttonAttr:a().object,itemAttr:a().object,linkAttr:a().object},o.defaultProps={itemType:"link",iconPos:"left",active:!1},u.propTypes={removeVerticalPadding:a().bool,items:a().arrayOf(a().shape(o.propTypes)).isRequired},u.defaultProps={removeVerticalPadding:!1}},7256:function(e,t,i){"use strict";i.d(t,{P:function(){return r}});var s=i(9471),n=i(8713),a=i.n(n),l=i(2828);function r(e){return e.options.map((t=>s.createElement("div",{key:t.id,className:t.id===e.selected?"active":""},s.createElement("button",{onClick:e.onSelect,filter:e.id,value:t.id},s.createElement("span",null,t.title),t.id===e.selected?s.createElement(l.Z,{type:"close"}):null))))}r.propTypes={id:a().string.isRequired,selected:a().string.isRequired,onSelect:a().func.isRequired}},8004:function(e,t,i){"use strict";i.d(t,{R:function(){return a},z:function(){return l}});var s=i(8974);const n=function(){for(var e=arguments.length,t=new Array(e),i=0;i(a(new k.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,r,o,e.onResponseDataLoaded)),h.PageStore.on("window_scroll",u),h.PageStore.on("document_visibility_change",c),u(),()=>{h.PageStore.removeListener("window_scroll",u),h.PageStore.removeListener("document_visibility_change",c),s&&(s.cancelAll(),a(null))})),[]),(0,n.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),i?t.length?n.createElement("div",{className:l.listOuter},m(),n.createElement("div",{ref:d,className:"items-list-wrap"},n.createElement("div",{ref:p,className:l.list},t.map(((t,i)=>n.createElement(v.c,C({key:i},(0,v.k)(e,t,i),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),g()):null:n.createElement(S.e,{className:l.listOuter})}_.propTypes={...y.ItemListAsync.propTypes},_.defaultProps={...y.ItemListAsync.defaultProps,pageItems:2};var A=i(5514),E=i(3160),P=i(9294),w=i(7670),T=i(4473),M=i(6670),N=i(9479);function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(this.state.query){let t="";t=e?1===e?(0,c.translateString)("1 result for")+' "'+this.state.query+'"':e+" "+(0,c.translateString)("results for")+' "'+this.state.query+'"':(0,c.translateString)("No results for")+' "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?u.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(e)+this.state.filterArgs:u.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs;let i=this.state.title;""===e&&(i=this.props.title),this.setState({requestUrl:t,query:e,title:i})}handleMediaSelection(e,t){if(this.setState((()=>{const i=new Set;return t&&i.add(e),{selectedMedia:i}})),t){const t=`${window.location.origin}/embed?m=${e}`,i=()=>{window.parent!==window&&window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*")};fetch(`/api/v1/media/${e}/share`,{method:"POST",headers:{"X-CSRFToken":this.props.bulkActions.getCsrfToken(),"Content-Type":"application/json"}}).then(i).catch(i)}}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const i=[];for(let e in t)null!==t[e]&&i.push(e+"="+t[e]);this.setState({filterArgs:i.length?"&"+i.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?u.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:u.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}pageContent(){const e=h.ProfilePageStore.get("author-data"),t=e&&e.username===u.MemberContext._currentValue.username,i=(0,c.inSelectMediaEmbedMode)(),s=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state=")),a=this.state.selectedTag&&"all"!==this.state.selectedTag,l=this.state.selectedSort&&"date_added_desc"!==this.state.selectedSort;return[this.state.author?n.createElement(p.A,{key:"ProfilePagesHeader",type:"media",author:this.state.author,onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:s,hasActiveTags:a,hasActiveSort:l,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,c.inEmbeddedApp)()}):null,this.state.author?n.createElement(m.A,{key:"ProfilePagesContent"},n.createElement(f.MediaListWrapper,{title:(0,c.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,c.inEmbeddedApp)()?{marginTop:"24px"}:void 0,showBulkActions:!i&&t,selectedCount:i?this.state.selectedMedia.size:this.props.bulkActions.selectedMedia.size,totalCount:i?0:this.props.bulkActions.availableMediaIds.length,onBulkAction:this.props.bulkActions.handleBulkAction,onSelectAll:this.props.bulkActions.handleSelectAll,onDeselectAll:this.props.bulkActions.handleDeselectAll,showAddMediaButton:!i&&t,hasContributorCourses:this.props.bulkActions.hasContributorCourses},n.createElement(E.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate,selectedTag:this.state.selectedTag,selectedSort:this.state.selectedSort}),n.createElement(P.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),n.createElement(T.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),n.createElement(w.W,{hidden:this.state.hiddenSharing,sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),n.createElement(_,{key:`${this.state.requestUrl}-${this.props.bulkActions.listKey}`,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!h.PageStore.get("config-media-item").displayViews,hideDate:!h.PageStore.get("config-media-item").displayPublishDate,canEdit:t,showSelection:t||i,hasAnySelection:i?this.state.selectedMedia.size>0:this.props.bulkActions.selectedMedia.size>0,selectedMedia:i?this.state.selectedMedia:this.props.bulkActions.selectedMedia,onMediaSelection:i?this.handleMediaSelection:this.props.bulkActions.handleMediaSelection,onItemsUpdate:i?void 0:this.props.bulkActions.handleItemsUpdate,onResponseDataLoaded:this.onResponseDataLoaded}))):null,this.state.author&&t&&!i?n.createElement(A.w,U({key:"BulkActionsModals"},this.props.bulkActions,{selectedMediaIds:Array.from(this.props.bulkActions.selectedMedia),csrfToken:this.props.bulkActions.getCsrfToken(),username:this.state.author.username,onConfirmCancel:this.props.bulkActions.handleConfirmCancel,onConfirmProceed:this.props.bulkActions.handleConfirmProceed,onPermissionModalCancel:this.props.bulkActions.handlePermissionModalCancel,onPermissionModalSuccess:this.props.bulkActions.handlePermissionModalSuccess,onPermissionModalError:this.props.bulkActions.handlePermissionModalError,onPlaylistModalCancel:this.props.bulkActions.handlePlaylistModalCancel,onPlaylistModalSuccess:this.props.bulkActions.handlePlaylistModalSuccess,onPlaylistModalError:this.props.bulkActions.handlePlaylistModalError,onChangeOwnerModalCancel:this.props.bulkActions.handleChangeOwnerModalCancel,onChangeOwnerModalSuccess:this.props.bulkActions.handleChangeOwnerModalSuccess,onChangeOwnerModalError:this.props.bulkActions.handleChangeOwnerModalError,onPublishStateModalCancel:this.props.bulkActions.handlePublishStateModalCancel,onPublishStateModalSuccess:this.props.bulkActions.handlePublishStateModalSuccess,onPublishStateModalError:this.props.bulkActions.handlePublishStateModalError,onCategoryModalCancel:this.props.bulkActions.handleCategoryModalCancel,onCategoryModalSuccess:this.props.bulkActions.handleCategoryModalSuccess,onCategoryModalError:this.props.bulkActions.handleCategoryModalError,onTagModalCancel:this.props.bulkActions.handleTagModalCancel,onTagModalSuccess:this.props.bulkActions.handleTagModalSuccess,onTagModalError:this.props.bulkActions.handleTagModalError,showCourseCleanupModal:this.props.bulkActions.showCourseCleanupModal,onCourseCleanupModalCancel:this.props.bulkActions.handleCourseCleanupModalCancel,onCourseCleanupModalSuccess:this.props.bulkActions.handleCourseCleanupModalSuccess,onCourseCleanupModalError:this.props.bulkActions.handleCourseCleanupModalError})):null]}}x.propTypes={title:l().string.isRequired,bulkActions:l().object.isRequired},x.defaultProps={title:"Uploads"},(0,M.k)(x);var O=i(8974);class I extends n.PureComponent{constructor(e){super(e),this.state={subject:"",body:"",isSending:!1},this.onUpdateSubject=this.onUpdateSubject.bind(this),this.onUpdateBody=this.onUpdateBody.bind(this),this.onSubmit=this.onSubmit.bind(this),this.onSubmitSuccess=this.onSubmitSuccess.bind(this),this.onSubmitFail=this.onSubmitFail.bind(this)}onUpdateSubject(){this.setState({subject:this.refs.msgSubject.value.trim()})}onUpdateBody(){this.setState({body:this.refs.msgBody.value.trim()})}onSubmitSuccess(e){this.setState({subject:"",body:"",isSending:!1},(function(){setTimeout(function(){d.PageActions.addNotification("Your message was successfully submitted to "+this.props.author.name,"messageSubmitSucceed")}.bind(this),100)}))}onSubmitFail(e){this.setState({isSending:!1},(function(){O.log(e),setTimeout(function(){d.PageActions.addNotification("Your message failed to submit. Please try again","messageSubmitFailed")}.bind(this),100)}))}onSubmit(e){this.state.isSending||""===this.state.subject||""===this.state.body||(e.preventDefault(),e.stopPropagation(),this.setState({isSending:!0},(function(){const e=u.ApiUrlContext._currentValue.users+"/"+this.props.author.username+"/contact";(0,c.postRequest)(e,{subject:this.state.subject,body:this.state.body},{headers:{"X-CSRFToken":(0,c.csrfToken)()}},!1,this.onSubmitSuccess,this.onSubmitFail)})))}render(){return n.createElement("div",{className:"media-list-row profile-contact"},n.createElement("div",{className:"media-list-header"},n.createElement("h2",null,"Contact")),n.createElement("form",{method:"post",className:"user-contact-form"+(this.state.isSending?" pending-response":"")},n.createElement("span",null,n.createElement("label",null,"Subject"),n.createElement("input",{ref:"msgSubject",type:"text",required:!0,onChange:this.onUpdateSubject,value:this.state.subject})),n.createElement("span",null,n.createElement("label",null,"Message"),n.createElement("textarea",{ref:"msgBody",required:!0,cols:"40",rows:"10",onChange:this.onUpdateBody,value:this.state.body})),n.createElement("button",{onClick:this.onSubmit},"SUBMIT")))}}class F extends x{constructor(e){super(e,"author-about"),this.userIsAuthor=null,this.enabledContactForm=!1}pageContent(){let e=null,t=[],i=[];if(this.state.author){let s,a;if(null===this.userIsAuthor&&(u.MemberContext._currentValue.is.anonymous?(this.userIsAuthor=!1,this.enabledContactForm=!1):(this.userIsAuthor=h.ProfilePageStore.get("author-data").username===u.MemberContext._currentValue.username,this.enabledContactForm=!this.userIsAuthor&&u.MemberContext._currentValue.can.contactUser)),void 0!==this.state.author.description&&this.state.author.description&&""!==this.state.author.description&&(e=this.state.author.description),void 0!==this.state.author.location_info&&this.state.author.location_info.length){let e=[];for(s=0;s=a)&&Object.keys(s.O).every((function(e){return s.O[e](i[o])}))?i.splice(o--,1):(r=!1,a0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[i,n,a]},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=382,function(){var e={382:0};s.O.j=function(t){return 0===e[t]};var t=function(t,i){var n,a,l=i[0],r=i[1],o=i[2],u=0;if(l.some((function(t){return 0!==e[t]}))){for(n in r)s.o(r,n)&&(s.m[n]=r[n]);if(o)var c=o(s)}for(t&&t(i);u=0?null:(0,s.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(i||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var n},a=function(e,t,i){return void 0===e[t]||(n=e[t])===Math.trunc(n)&&n>0?null:(0,s.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(i||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var n}},1936:function(e,t,i){"use strict";i.d(t,{PageHeader:function(){return s.z},PageMain:function(){return n.P},PageSidebar:function(){return a.E}});var s=i(1254),n=i(3212),a=i(795);i(1470)},2828:function(e,t,i){"use strict";i.d(t,{Z:function(){return n}});var s=i(9471);const n=e=>{let{type:t}=e;return t?s.createElement("i",{className:"material-icons","data-icon":t}):null}},2901:function(e,t,i){"use strict";i.d(t,{AP:function(){return l},cp:function(){return a}});var s=i(9471);const n=s.forwardRef(((e,t)=>void 0!==e.children?s.createElement("div",{ref:t,className:"popup"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null));function a(e){return void 0!==e.children?s.createElement("div",{className:"popup-top"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}function l(e){return void 0!==e.children?s.createElement("div",{className:"popup-main"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}t.Ay=n},3135:function(e,t,i){"use strict";i.d(t,{I:function(){return r}});var s=i(9471),n=i(8713),a=i.n(n),l=i(2828);function r(e){const[t,i]=(0,s.useState)(e.active);return s.createElement("div",{className:"mi-filters-toggle"},s.createElement("button",{className:t?"active":"","aria-label":"Filter",onClick:function(){i(!t),void 0!==e.onClick&&e.onClick()}},s.createElement(l.Z,{type:"filter_list"}),s.createElement("span",{className:"filter-button-label"},s.createElement("span",{className:"filter-button-label-text"},"FILTERS"))))}r.propTypes={onClick:a().func,active:a().bool},r.defaultProps={active:!1}},3818:function(e,t,i){"use strict";i.d(t,{_:function(){return l}});var s=i(9471),n=i(8713),a=i.n(n);function l(e){const t=(0,s.useRef)(null),i=(0,s.useRef)(null),[n,a]=(0,s.useState)(null),[l,r]=(0,s.useState)(null);return(0,s.useEffect)((()=>{a(function(e,t,i){if(void 0!==e){let s=null;return s=void 0!==t&&t>e?t:e,s=void 0!==i&&i{void 0!==e.pages[e.initPage]?a(e.initPage):Object.keys(e.pages).length?a(Object.keys(e.pages)[0]):a(null)}),[e.initPage]),(0,s.useEffect)((()=>{!function(){let e=0;for(;et=>r(e,t))(i),l[i].elem.addEventListener("click",l[i].listener)),i+=1;e.focusFirstItemOnPageChange&&a.focus()}(),"function"==typeof e.pageChangeCallback&&e.pageChangeCallback(i))}),[i]),i?s.createElement("div",{ref:t},s.cloneElement(e.pages[i])):null}r.propTypes={initPage:l().string,pages:l().object.isRequired,pageChangeSelector:l().string.isRequired,pageIdSelectorAttr:l().string.isRequired,focusFirstItemOnPageChange:l().bool,pageChangeCallback:l().func},r.defaultProps={focusFirstItemOnPageChange:!0}},5321:function(e,t,i){"use strict";i.d(t,{i:function(){return r}});var s=i(9471),n=i(8713),a=i.n(n);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t(l=setTimeout((function(){r=setTimeout((function(){a(!1),r=null}),1e3),l=null,i(!0),e.onHide(e.id)}),5e3),()=>{l&&clearTimeout(l),r&&clearTimeout(r)})),[]),n?s.createElement("div",{className:"notification-item"+(t?" hidden":"")},s.createElement("div",null,s.createElement("span",null,e.children||"No message"))):null}function r(){const[e,t]=(0,s.useState)(a.length);function i(){t(n.default.get("notifications-size")+a.length)}function r(e){const t=[];a.map((i=>{i[0]!==e&&t.push(i)})),a=t}return(0,s.useEffect)((()=>(i(),n.default.on("added_notification",i),()=>n.default.removeListener("added_notification",i))),[]),e?s.createElement("div",{className:"notifications"},s.createElement("div",null,function(){const e=n.default.get("notifications");return[...a.map((e=>s.createElement(l,{key:e[0],id:e[0],onHide:r},e[1]))),...e.map((e=>(a.push(e),s.createElement(l,{key:e[0],id:e[0],onHide:r},e[1]))))]}())," "):null}},6371:function(e,t,i){"use strict";i.r(t);var s=i(9032),n=i.n(s),a=i(7154),l=i(6014),r=i(3997);function o(){let e=new Uint32Array(3);return window.crypto.getRandomValues(e),(performance.now().toString(36)+Array.from(e).map((e=>e.toString(36))).join("")).replace(/./g,""+Math.random()+Intl.DateTimeFormat().resolvedOptions().timeZone+Date.now())}let u,c=null,d=null;class h extends(n()){constructor(e){super(),d=(0,r.$)(window.MediaCMS),u=new a.BrowserCache(d.site.id,86400),c={mediaAutoPlay:u.get("media-auto-play")},c.mediaAutoPlay=null===c.mediaAutoPlay||c.mediaAutoPlay,this.browserEvents=(0,l.BrowserEvents)(),this.browserEvents.doc(this.onDocumentVisibilityChange.bind(this)),this.browserEvents.win(this.onWindowResize.bind(this),this.onWindowScroll.bind(this)),this.notifications=function(e){let t=[];function i(e){"string"==typeof e&&t.push([o(),e])}return e.map(i),{size:function(){return t.length},push:i,clear:function(){t=[]},messages:function(){return[...t]}}}(void 0!==window.MediaCMS&&void 0!==window.MediaCMS.notifications?window.MediaCMS.notifications:[])}onDocumentVisibilityChange(){this.emit("document_visibility_change")}onWindowScroll(){this.emit("window_scroll")}onWindowResize(){this.emit("window_resize")}initPage(e){c.currentPage=e}get(e){let t;switch(e){case"browser-cache":t=u;break;case"media-auto-play":t=c.mediaAutoPlay;break;case"config-contents":t=d.contents;break;case"config-enabled":t=d.enabled;break;case"config-media-item":t=d.media.item;break;case"config-options":t=d.options;break;case"config-site":t=d.site;break;case"api-playlists":i=e.split("-")[1],t=d.api[i]||null;break;case"notifications-size":t=this.notifications.size();break;case"notifications":t=this.notifications.messages(),this.notifications.clear();break;case"current-page":t=c.currentPage}var i;return t}actions_handler(e){switch(e.type){case"INIT_PAGE":this.initPage(e.page),this.emit("page_init");break;case"TOGGLE_AUTO_PLAY":c.mediaAutoPlay=!c.mediaAutoPlay,u.set("media-auto-play",c.mediaAutoPlay),this.emit("switched_media_auto_play");break;case"ADD_NOTIFICATION":this.notifications.push(e.notification),this.emit("added_notification")}}}t.default=(0,l.exportStore)(new h,"actions_handler")},6403:function(e,t,i){"use strict";i.d(t,{g:function(){return l},m:function(){return a}});var s=i(8004);function n(e,t,i){let s;switch(i){case TypeError:case RangeError:case SyntaxError:case ReferenceError:s=new i(t[0]);break;default:s=new Error(t[0])}return e(s.message,...t.slice(1)),s}function a(e,t){return n(s.z,e,t)}function l(e,t){return n(s.R,e,t)}},6568:function(e,t,i){"use strict";i.d(t,{x:function(){return l}});var s=i(9471),n=i(8713),a=i.n(n);function l(e){let t="spinner-loader";switch(e.size){case"tiny":case"x-small":case"small":case"large":case"x-large":t+=" "+e.size}return s.createElement("div",{className:t},s.createElement("svg",{className:"circular",viewBox:"25 25 50 50"},s.createElement("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:"1.5",strokeMiterlimit:"10"})))}l.propTypes={size:a().oneOf(["tiny","x-small","small","medium","large","x-large"])},l.defaultProps={size:"medium"}},7143:function(e,t,i){const s=i(2063).Dispatcher;e.exports=new s},7201:function(e,t,i){"use strict";i.d(t,{S:function(){return u}});var s=i(9471),n=i(8713),a=i.n(n),l=i(2828);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;ts.createElement(o,r({key:t},e))));return t.length?s.createElement("div",{className:"nav-menu"+(e.removeVerticalPadding?" pv0":"")},s.createElement("nav",null,s.createElement("ul",null,t))):null}o.propTypes={itemType:a().oneOf(["link","open-subpage","button","label","div"]),link:a().string,icon:a().string,iconPos:a().oneOf(["left","right"]),text:a().string,active:a().bool,divAttr:a().object,buttonAttr:a().object,itemAttr:a().object,linkAttr:a().object},o.defaultProps={itemType:"link",iconPos:"left",active:!1},u.propTypes={removeVerticalPadding:a().bool,items:a().arrayOf(a().shape(o.propTypes)).isRequired},u.defaultProps={removeVerticalPadding:!1}},7256:function(e,t,i){"use strict";i.d(t,{P:function(){return r}});var s=i(9471),n=i(8713),a=i.n(n),l=i(2828);function r(e){return e.options.map((t=>s.createElement("div",{key:t.id,className:t.id===e.selected?"active":""},s.createElement("button",{onClick:e.onSelect,filter:e.id,value:t.id},s.createElement("span",null,t.title),t.id===e.selected?s.createElement(l.Z,{type:"close"}):null))))}r.propTypes={id:a().string.isRequired,selected:a().string.isRequired,onSelect:a().func.isRequired}},8004:function(e,t,i){"use strict";i.d(t,{R:function(){return a},z:function(){return l}});var s=i(8974);const n=function(){for(var e=arguments.length,t=new Array(e),i=0;i(a(new k.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,r,o,e.onResponseDataLoaded)),h.PageStore.on("window_scroll",u),h.PageStore.on("document_visibility_change",c),u(),()=>{h.PageStore.removeListener("window_scroll",u),h.PageStore.removeListener("document_visibility_change",c),s&&(s.cancelAll(),a(null))})),[]),(0,n.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),i?t.length?n.createElement("div",{className:l.listOuter},m(),n.createElement("div",{ref:d,className:"items-list-wrap"},n.createElement("div",{ref:p,className:l.list},t.map(((t,i)=>n.createElement(v.c,C({key:i},(0,v.k)(e,t,i),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),g()):null:n.createElement(S.e,{className:l.listOuter})}_.propTypes={...y.ItemListAsync.propTypes},_.defaultProps={...y.ItemListAsync.defaultProps,pageItems:2};var A=i(5514),E=i(3160),P=i(9294),w=i(7670),T=i(4473),M=i(6670),N=i(9479);function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(this.state.query){let t="";t=e?1===e?(0,c.translateString)("1 result for")+' "'+this.state.query+'"':e+" "+(0,c.translateString)("results for")+' "'+this.state.query+'"':(0,c.translateString)("No results for")+' "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?u.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(e)+this.state.filterArgs:u.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs;let i=this.state.title;""===e&&(i=this.props.title),this.setState({requestUrl:t,query:e,title:i})}handleMediaSelection(e,t){if(this.setState((()=>{const i=new Set;return t&&i.add(e),{selectedMedia:i}})),t){const t=`${window.location.origin}/embed?m=${e}`,i=()=>{window.parent!==window&&window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*")};fetch(`/api/v1/media/${e}/share`,{method:"POST",headers:{"X-CSRFToken":this.props.bulkActions.getCsrfToken(),"Content-Type":"application/json"}}).then(i).catch(i)}}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const i=[];for(let e in t)null!==t[e]&&i.push(e+"="+t[e]);this.setState({filterArgs:i.length?"&"+i.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?u.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:u.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}pageContent(){const e=h.ProfilePageStore.get("author-data"),t=e&&e.username===u.MemberContext._currentValue.username,i=(0,c.inSelectMediaEmbedMode)(),s=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state=")),a=this.state.selectedTag&&"all"!==this.state.selectedTag,l=this.state.selectedSort&&"date_added_desc"!==this.state.selectedSort;return[this.state.author?n.createElement(p.A,{key:"ProfilePagesHeader",type:"media",author:this.state.author,onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:s,hasActiveTags:a,hasActiveSort:l,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,c.inEmbeddedApp)()}):null,this.state.author?n.createElement(m.A,{key:"ProfilePagesContent"},n.createElement(f.MediaListWrapper,{title:(0,c.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,c.inEmbeddedApp)()?{marginTop:"24px"}:void 0,showBulkActions:!i&&t,selectedCount:i?this.state.selectedMedia.size:this.props.bulkActions.selectedMedia.size,totalCount:i?0:this.props.bulkActions.availableMediaIds.length,onBulkAction:this.props.bulkActions.handleBulkAction,onSelectAll:this.props.bulkActions.handleSelectAll,onDeselectAll:this.props.bulkActions.handleDeselectAll,showAddMediaButton:!i&&t,hasContributorCourses:this.props.bulkActions.hasContributorCourses},n.createElement(E.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate,selectedTag:this.state.selectedTag,selectedSort:this.state.selectedSort}),n.createElement(P.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),n.createElement(T.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),n.createElement(w.W,{hidden:this.state.hiddenSharing,sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),n.createElement(_,{key:`${this.state.requestUrl}-${this.props.bulkActions.listKey}`,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!h.PageStore.get("config-media-item").displayViews,hideDate:!h.PageStore.get("config-media-item").displayPublishDate,canEdit:t,showSelection:t||i,hasAnySelection:i?this.state.selectedMedia.size>0:this.props.bulkActions.selectedMedia.size>0,selectedMedia:i?this.state.selectedMedia:this.props.bulkActions.selectedMedia,onMediaSelection:i?this.handleMediaSelection:this.props.bulkActions.handleMediaSelection,onItemsUpdate:i?void 0:this.props.bulkActions.handleItemsUpdate,onResponseDataLoaded:this.onResponseDataLoaded}))):null,this.state.author&&t&&!i?n.createElement(A.w,U({key:"BulkActionsModals"},this.props.bulkActions,{selectedMediaIds:Array.from(this.props.bulkActions.selectedMedia),csrfToken:this.props.bulkActions.getCsrfToken(),username:this.state.author.username,onConfirmCancel:this.props.bulkActions.handleConfirmCancel,onConfirmProceed:this.props.bulkActions.handleConfirmProceed,onPermissionModalCancel:this.props.bulkActions.handlePermissionModalCancel,onPermissionModalSuccess:this.props.bulkActions.handlePermissionModalSuccess,onPermissionModalError:this.props.bulkActions.handlePermissionModalError,onPlaylistModalCancel:this.props.bulkActions.handlePlaylistModalCancel,onPlaylistModalSuccess:this.props.bulkActions.handlePlaylistModalSuccess,onPlaylistModalError:this.props.bulkActions.handlePlaylistModalError,onChangeOwnerModalCancel:this.props.bulkActions.handleChangeOwnerModalCancel,onChangeOwnerModalSuccess:this.props.bulkActions.handleChangeOwnerModalSuccess,onChangeOwnerModalError:this.props.bulkActions.handleChangeOwnerModalError,onPublishStateModalCancel:this.props.bulkActions.handlePublishStateModalCancel,onPublishStateModalSuccess:this.props.bulkActions.handlePublishStateModalSuccess,onPublishStateModalError:this.props.bulkActions.handlePublishStateModalError,onCategoryModalCancel:this.props.bulkActions.handleCategoryModalCancel,onCategoryModalSuccess:this.props.bulkActions.handleCategoryModalSuccess,onCategoryModalError:this.props.bulkActions.handleCategoryModalError,onTagModalCancel:this.props.bulkActions.handleTagModalCancel,onTagModalSuccess:this.props.bulkActions.handleTagModalSuccess,onTagModalError:this.props.bulkActions.handleTagModalError,showCourseCleanupModal:this.props.bulkActions.showCourseCleanupModal,onCourseCleanupModalCancel:this.props.bulkActions.handleCourseCleanupModalCancel,onCourseCleanupModalSuccess:this.props.bulkActions.handleCourseCleanupModalSuccess,onCourseCleanupModalError:this.props.bulkActions.handleCourseCleanupModalError})):null]}}x.propTypes={title:l().string.isRequired,bulkActions:l().object.isRequired},x.defaultProps={title:"Uploads"},(0,M.k)(x);var O=i(8974);class I extends n.PureComponent{constructor(e){super(e),this.state={subject:"",body:"",isSending:!1},this.onUpdateSubject=this.onUpdateSubject.bind(this),this.onUpdateBody=this.onUpdateBody.bind(this),this.onSubmit=this.onSubmit.bind(this),this.onSubmitSuccess=this.onSubmitSuccess.bind(this),this.onSubmitFail=this.onSubmitFail.bind(this)}onUpdateSubject(){this.setState({subject:this.refs.msgSubject.value.trim()})}onUpdateBody(){this.setState({body:this.refs.msgBody.value.trim()})}onSubmitSuccess(e){this.setState({subject:"",body:"",isSending:!1},(function(){setTimeout(function(){d.PageActions.addNotification("Your message was successfully submitted to "+this.props.author.name,"messageSubmitSucceed")}.bind(this),100)}))}onSubmitFail(e){this.setState({isSending:!1},(function(){O.log(e),setTimeout(function(){d.PageActions.addNotification("Your message failed to submit. Please try again","messageSubmitFailed")}.bind(this),100)}))}onSubmit(e){this.state.isSending||""===this.state.subject||""===this.state.body||(e.preventDefault(),e.stopPropagation(),this.setState({isSending:!0},(function(){const e=u.ApiUrlContext._currentValue.users+"/"+this.props.author.username+"/contact";(0,c.postRequest)(e,{subject:this.state.subject,body:this.state.body},{headers:{"X-CSRFToken":(0,c.csrfToken)()}},!1,this.onSubmitSuccess,this.onSubmitFail)})))}render(){return n.createElement("div",{className:"media-list-row profile-contact"},n.createElement("div",{className:"media-list-header"},n.createElement("h2",null,"Contact")),n.createElement("form",{method:"post",className:"user-contact-form"+(this.state.isSending?" pending-response":"")},n.createElement("span",null,n.createElement("label",null,"Subject"),n.createElement("input",{ref:"msgSubject",type:"text",required:!0,onChange:this.onUpdateSubject,value:this.state.subject})),n.createElement("span",null,n.createElement("label",null,"Message"),n.createElement("textarea",{ref:"msgBody",required:!0,cols:"40",rows:"10",onChange:this.onUpdateBody,value:this.state.body})),n.createElement("button",{onClick:this.onSubmit},"SUBMIT")))}}class F extends x{constructor(e){super(e,"author-about"),this.userIsAuthor=null,this.enabledContactForm=!1}pageContent(){let e=null,t=[],i=[];if(this.state.author){let s,a;if(null===this.userIsAuthor&&(u.MemberContext._currentValue.is.anonymous?(this.userIsAuthor=!1,this.enabledContactForm=!1):(this.userIsAuthor=h.ProfilePageStore.get("author-data").username===u.MemberContext._currentValue.username,this.enabledContactForm=!this.userIsAuthor&&u.MemberContext._currentValue.can.contactUser)),void 0!==this.state.author.description&&this.state.author.description&&""!==this.state.author.description&&(e=this.state.author.description),void 0!==this.state.author.location_info&&this.state.author.location_info.length){let e=[];for(s=0;s=a)&&Object.keys(s.O).every((function(e){return s.O[e](i[o])}))?i.splice(o--,1):(r=!1,a0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[i,n,a]},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=382,function(){var e={382:0};s.O.j=function(t){return 0===e[t]};var t=function(t,i){var n,a,l=i[0],r=i[1],o=i[2],u=0;if(l.some((function(t){return 0!==e[t]}))){for(n in r)s.o(r,n)&&(s.m[n]=r[n]);if(o)var c=o(s)}for(t&&t(i);u=0?null:(0,i.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var a},n=function(e,t,s){return void 0===e[t]||(a=e[t])===Math.trunc(a)&&a>0?null:(0,i.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var a}},1936:function(e,t,s){"use strict";s.d(t,{PageHeader:function(){return i.z},PageMain:function(){return a.P},PageSidebar:function(){return n.E}});var i=s(1254),a=s(3212),n=s(795);s(1470)},4190:function(e,t,s){"use strict";var i=s(2985),a=s(9471),n=s(8713),r=s.n(n),o=s(8790),l=s(7460),d=s(285),h=s(9200),u=s(2855),c=s(1177),g=s(239),p=s(5338),f=s(4685),S=s(2495),b=s(4433),m=s(5633);function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t(n(new m.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,o,d,e.onResponseDataLoaded)),l.PageStore.on("window_scroll",h),l.PageStore.on("document_visibility_change",u),h(),()=>{l.PageStore.removeListener("window_scroll",h),l.PageStore.removeListener("document_visibility_change",u),i&&(i.cancelAll(),n(null))})),[]),(0,a.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),s?t.length?a.createElement("div",{className:r.listOuter},f(),a.createElement("div",{ref:c,className:"items-list-wrap"},a.createElement("div",{ref:g,className:r.list},t.map(((t,s)=>a.createElement(b.c,y({key:s},(0,b.k)(e,t,s),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),A()):null:a.createElement(S.e,{className:r.listOuter})}A.propTypes={...f.ItemListAsync.propTypes},A.defaultProps={...f.ItemListAsync.defaultProps,pageItems:2};var _=s(5514),C=s(3160),k=s(9294),v=s(7670),M=s(4473),T=s(6670),P=s(9479);function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(this.state.query){let t="";t=e?1===e?(0,h.translateString)("1 result for")+' "'+this.state.query+'"':e+" "+(0,h.translateString)("results for")+' "'+this.state.query+'"':(0,h.translateString)("No results for")+' "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(e)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs;let s=this.state.title;""===e&&(s=this.props.title),this.setState({requestUrl:t,query:e,title:s})}handleMediaSelection(e,t){if(this.setState((()=>{const s=new Set;return t&&s.add(e),{selectedMedia:s}})),t){const t=`${window.location.origin}/embed?m=${e}`,s=()=>{window.parent!==window&&window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*")};fetch(`/api/v1/media/${e}/share`,{method:"POST",headers:{"X-CSRFToken":this.props.bulkActions.getCsrfToken(),"Content-Type":"application/json"}}).then(s).catch(s)}}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const s=[];for(let e in t)null!==t[e]&&s.push(e+"="+t[e]);this.setState({filterArgs:s.length?"&"+s.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}pageContent(){const e=l.ProfilePageStore.get("author-data"),t=e&&e.username===o.MemberContext._currentValue.username,s=(0,h.inSelectMediaEmbedMode)(),i=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state=")),n=this.state.selectedTag&&"all"!==this.state.selectedTag,r=this.state.selectedSort&&"date_added_desc"!==this.state.selectedSort;return[this.state.author?a.createElement(c.A,{key:"ProfilePagesHeader",type:"media",author:this.state.author,onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:i,hasActiveTags:n,hasActiveSort:r,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,h.inEmbeddedApp)()}):null,this.state.author?a.createElement(g.A,{key:"ProfilePagesContent"},a.createElement(u.MediaListWrapper,{title:(0,h.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,h.inEmbeddedApp)()?{marginTop:"24px"}:void 0,showBulkActions:!s&&t,selectedCount:s?this.state.selectedMedia.size:this.props.bulkActions.selectedMedia.size,totalCount:s?0:this.props.bulkActions.availableMediaIds.length,onBulkAction:this.props.bulkActions.handleBulkAction,onSelectAll:this.props.bulkActions.handleSelectAll,onDeselectAll:this.props.bulkActions.handleDeselectAll,showAddMediaButton:!s&&t,hasContributorCourses:this.props.bulkActions.hasContributorCourses},a.createElement(C.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate,selectedTag:this.state.selectedTag,selectedSort:this.state.selectedSort}),a.createElement(k.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),a.createElement(M.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),a.createElement(v.W,{hidden:this.state.hiddenSharing,sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),a.createElement(A,{key:`${this.state.requestUrl}-${this.props.bulkActions.listKey}`,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!l.PageStore.get("config-media-item").displayViews,hideDate:!l.PageStore.get("config-media-item").displayPublishDate,canEdit:t,showSelection:t||s,hasAnySelection:s?this.state.selectedMedia.size>0:this.props.bulkActions.selectedMedia.size>0,selectedMedia:s?this.state.selectedMedia:this.props.bulkActions.selectedMedia,onMediaSelection:s?this.handleMediaSelection:this.props.bulkActions.handleMediaSelection,onItemsUpdate:s?void 0:this.props.bulkActions.handleItemsUpdate,onResponseDataLoaded:this.onResponseDataLoaded}))):null,this.state.author&&t&&!s?a.createElement(_.w,w({key:"BulkActionsModals"},this.props.bulkActions,{selectedMediaIds:Array.from(this.props.bulkActions.selectedMedia),csrfToken:this.props.bulkActions.getCsrfToken(),username:this.state.author.username,onConfirmCancel:this.props.bulkActions.handleConfirmCancel,onConfirmProceed:this.props.bulkActions.handleConfirmProceed,onPermissionModalCancel:this.props.bulkActions.handlePermissionModalCancel,onPermissionModalSuccess:this.props.bulkActions.handlePermissionModalSuccess,onPermissionModalError:this.props.bulkActions.handlePermissionModalError,onPlaylistModalCancel:this.props.bulkActions.handlePlaylistModalCancel,onPlaylistModalSuccess:this.props.bulkActions.handlePlaylistModalSuccess,onPlaylistModalError:this.props.bulkActions.handlePlaylistModalError,onChangeOwnerModalCancel:this.props.bulkActions.handleChangeOwnerModalCancel,onChangeOwnerModalSuccess:this.props.bulkActions.handleChangeOwnerModalSuccess,onChangeOwnerModalError:this.props.bulkActions.handleChangeOwnerModalError,onPublishStateModalCancel:this.props.bulkActions.handlePublishStateModalCancel,onPublishStateModalSuccess:this.props.bulkActions.handlePublishStateModalSuccess,onPublishStateModalError:this.props.bulkActions.handlePublishStateModalError,onCategoryModalCancel:this.props.bulkActions.handleCategoryModalCancel,onCategoryModalSuccess:this.props.bulkActions.handleCategoryModalSuccess,onCategoryModalError:this.props.bulkActions.handleCategoryModalError,onTagModalCancel:this.props.bulkActions.handleTagModalCancel,onTagModalSuccess:this.props.bulkActions.handleTagModalSuccess,onTagModalError:this.props.bulkActions.handleTagModalError,showCourseCleanupModal:this.props.bulkActions.showCourseCleanupModal,onCourseCleanupModalCancel:this.props.bulkActions.handleCourseCleanupModalCancel,onCourseCleanupModalSuccess:this.props.bulkActions.handleCourseCleanupModalSuccess,onCourseCleanupModalError:this.props.bulkActions.handleCourseCleanupModalError})):null]}}E.propTypes={title:r().string.isRequired,bulkActions:r().object.isRequired},E.defaultProps={title:"Uploads"};const U=(0,T.k)(E);(0,i.C)("page-profile-media",U)},6403:function(e,t,s){"use strict";s.d(t,{g:function(){return r},m:function(){return n}});var i=s(8004);function a(e,t,s){let i;switch(s){case TypeError:case RangeError:case SyntaxError:case ReferenceError:i=new s(t[0]);break;default:i=new Error(t[0])}return e(i.message,...t.slice(1)),i}function n(e,t){return a(i.z,e,t)}function r(e,t){return a(i.R,e,t)}},7143:function(e,t,s){const i=s(2063).Dispatcher;e.exports=new i},8004:function(e,t,s){"use strict";s.d(t,{R:function(){return n},z:function(){return r}});var i=s(8974);const a=function(){for(var e=arguments.length,t=new Array(e),s=0;s=n)&&Object.keys(i.O).every((function(e){return i.O[e](s[l])}))?s.splice(l--,1):(o=!1,n0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[s,a,n]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=301,function(){var e={301:0};i.O.j=function(t){return 0===e[t]};var t=function(t,s){var a,n,r=s[0],o=s[1],l=s[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(a in o)i.o(o,a)&&(i.m[a]=o[a]);if(l)var h=l(i)}for(t&&t(s);d=0?null:(0,i.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var a},n=function(e,t,s){return void 0===e[t]||(a=e[t])===Math.trunc(a)&&a>0?null:(0,i.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var a}},1936:function(e,t,s){"use strict";s.d(t,{PageHeader:function(){return i.z},PageMain:function(){return a.P},PageSidebar:function(){return n.E}});var i=s(1254),a=s(3212),n=s(795);s(1470)},4190:function(e,t,s){"use strict";var i=s(2985),a=s(9471),n=s(8713),r=s.n(n),o=s(8790),l=s(7460),d=s(285),h=s(6014),u=s(2855),c=s(1177),g=s(239),p=s(5338),f=s(4685),S=s(2495),b=s(4433),m=s(5633);function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t(n(new m.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,o,d,e.onResponseDataLoaded)),l.PageStore.on("window_scroll",h),l.PageStore.on("document_visibility_change",u),h(),()=>{l.PageStore.removeListener("window_scroll",h),l.PageStore.removeListener("document_visibility_change",u),i&&(i.cancelAll(),n(null))})),[]),(0,a.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),s?t.length?a.createElement("div",{className:r.listOuter},f(),a.createElement("div",{ref:c,className:"items-list-wrap"},a.createElement("div",{ref:g,className:r.list},t.map(((t,s)=>a.createElement(b.c,y({key:s},(0,b.k)(e,t,s),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),A()):null:a.createElement(S.e,{className:r.listOuter})}A.propTypes={...f.ItemListAsync.propTypes},A.defaultProps={...f.ItemListAsync.defaultProps,pageItems:2};var _=s(5514),C=s(3160),k=s(9294),v=s(7670),M=s(4473),T=s(6670),P=s(9479);function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(this.state.query){let t="";t=e?1===e?(0,h.translateString)("1 result for")+' "'+this.state.query+'"':e+" "+(0,h.translateString)("results for")+' "'+this.state.query+'"':(0,h.translateString)("No results for")+' "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(e)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs;let s=this.state.title;""===e&&(s=this.props.title),this.setState({requestUrl:t,query:e,title:s})}handleMediaSelection(e,t){if(this.setState((()=>{const s=new Set;return t&&s.add(e),{selectedMedia:s}})),t){const t=`${window.location.origin}/embed?m=${e}`,s=()=>{window.parent!==window&&window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*")};fetch(`/api/v1/media/${e}/share`,{method:"POST",headers:{"X-CSRFToken":this.props.bulkActions.getCsrfToken(),"Content-Type":"application/json"}}).then(s).catch(s)}}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const s=[];for(let e in t)null!==t[e]&&s.push(e+"="+t[e]);this.setState({filterArgs:s.length?"&"+s.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}pageContent(){const e=l.ProfilePageStore.get("author-data"),t=e&&e.username===o.MemberContext._currentValue.username,s=(0,h.inSelectMediaEmbedMode)(),i=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state=")),n=this.state.selectedTag&&"all"!==this.state.selectedTag,r=this.state.selectedSort&&"date_added_desc"!==this.state.selectedSort;return[this.state.author?a.createElement(c.A,{key:"ProfilePagesHeader",type:"media",author:this.state.author,onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:i,hasActiveTags:n,hasActiveSort:r,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,h.inEmbeddedApp)()}):null,this.state.author?a.createElement(g.A,{key:"ProfilePagesContent"},a.createElement(u.MediaListWrapper,{title:(0,h.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,h.inEmbeddedApp)()?{marginTop:"24px"}:void 0,showBulkActions:!s&&t,selectedCount:s?this.state.selectedMedia.size:this.props.bulkActions.selectedMedia.size,totalCount:s?0:this.props.bulkActions.availableMediaIds.length,onBulkAction:this.props.bulkActions.handleBulkAction,onSelectAll:this.props.bulkActions.handleSelectAll,onDeselectAll:this.props.bulkActions.handleDeselectAll,showAddMediaButton:!s&&t,hasContributorCourses:this.props.bulkActions.hasContributorCourses},a.createElement(C.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate,selectedTag:this.state.selectedTag,selectedSort:this.state.selectedSort}),a.createElement(k.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),a.createElement(M.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),a.createElement(v.W,{hidden:this.state.hiddenSharing,sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),a.createElement(A,{key:`${this.state.requestUrl}-${this.props.bulkActions.listKey}`,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!l.PageStore.get("config-media-item").displayViews,hideDate:!l.PageStore.get("config-media-item").displayPublishDate,canEdit:t,showSelection:t||s,hasAnySelection:s?this.state.selectedMedia.size>0:this.props.bulkActions.selectedMedia.size>0,selectedMedia:s?this.state.selectedMedia:this.props.bulkActions.selectedMedia,onMediaSelection:s?this.handleMediaSelection:this.props.bulkActions.handleMediaSelection,onItemsUpdate:s?void 0:this.props.bulkActions.handleItemsUpdate,onResponseDataLoaded:this.onResponseDataLoaded}))):null,this.state.author&&t&&!s?a.createElement(_.w,w({key:"BulkActionsModals"},this.props.bulkActions,{selectedMediaIds:Array.from(this.props.bulkActions.selectedMedia),csrfToken:this.props.bulkActions.getCsrfToken(),username:this.state.author.username,onConfirmCancel:this.props.bulkActions.handleConfirmCancel,onConfirmProceed:this.props.bulkActions.handleConfirmProceed,onPermissionModalCancel:this.props.bulkActions.handlePermissionModalCancel,onPermissionModalSuccess:this.props.bulkActions.handlePermissionModalSuccess,onPermissionModalError:this.props.bulkActions.handlePermissionModalError,onPlaylistModalCancel:this.props.bulkActions.handlePlaylistModalCancel,onPlaylistModalSuccess:this.props.bulkActions.handlePlaylistModalSuccess,onPlaylistModalError:this.props.bulkActions.handlePlaylistModalError,onChangeOwnerModalCancel:this.props.bulkActions.handleChangeOwnerModalCancel,onChangeOwnerModalSuccess:this.props.bulkActions.handleChangeOwnerModalSuccess,onChangeOwnerModalError:this.props.bulkActions.handleChangeOwnerModalError,onPublishStateModalCancel:this.props.bulkActions.handlePublishStateModalCancel,onPublishStateModalSuccess:this.props.bulkActions.handlePublishStateModalSuccess,onPublishStateModalError:this.props.bulkActions.handlePublishStateModalError,onCategoryModalCancel:this.props.bulkActions.handleCategoryModalCancel,onCategoryModalSuccess:this.props.bulkActions.handleCategoryModalSuccess,onCategoryModalError:this.props.bulkActions.handleCategoryModalError,onTagModalCancel:this.props.bulkActions.handleTagModalCancel,onTagModalSuccess:this.props.bulkActions.handleTagModalSuccess,onTagModalError:this.props.bulkActions.handleTagModalError,showCourseCleanupModal:this.props.bulkActions.showCourseCleanupModal,onCourseCleanupModalCancel:this.props.bulkActions.handleCourseCleanupModalCancel,onCourseCleanupModalSuccess:this.props.bulkActions.handleCourseCleanupModalSuccess,onCourseCleanupModalError:this.props.bulkActions.handleCourseCleanupModalError})):null]}}E.propTypes={title:r().string.isRequired,bulkActions:r().object.isRequired},E.defaultProps={title:"Uploads"};const U=(0,T.k)(E);(0,i.C)("page-profile-media",U)},6403:function(e,t,s){"use strict";s.d(t,{g:function(){return r},m:function(){return n}});var i=s(8004);function a(e,t,s){let i;switch(s){case TypeError:case RangeError:case SyntaxError:case ReferenceError:i=new s(t[0]);break;default:i=new Error(t[0])}return e(i.message,...t.slice(1)),i}function n(e,t){return a(i.z,e,t)}function r(e,t){return a(i.R,e,t)}},7143:function(e,t,s){const i=s(2063).Dispatcher;e.exports=new i},8004:function(e,t,s){"use strict";s.d(t,{R:function(){return n},z:function(){return r}});var i=s(8974);const a=function(){for(var e=arguments.length,t=new Array(e),s=0;s=n)&&Object.keys(i.O).every((function(e){return i.O[e](s[l])}))?s.splice(l--,1):(o=!1,n0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[s,a,n]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=301,function(){var e={301:0};i.O.j=function(t){return 0===e[t]};var t=function(t,s){var a,n,r=s[0],o=s[1],l=s[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(a in o)i.o(o,a)&&(i.m[a]=o[a]);if(l)var h=l(i)}for(t&&t(s);d=0?null:(0,i.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var a},n=function(e,t,s){return void 0===e[t]||(a=e[t])===Math.trunc(a)&&a>0?null:(0,i.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var a}},1936:function(e,t,s){"use strict";s.d(t,{PageHeader:function(){return i.z},PageMain:function(){return a.P},PageSidebar:function(){return n.E}});var i=s(1254),a=s(3212),n=s(795);s(1470)},5810:function(e,t,s){"use strict";var i=s(2985),a=s(9471),n=s(8790),r=s(7460),l=s(9200),o=s(2855),d=s(1177),h=s(239),u=s(5338),c=s(4685),g=s(2495),p=s(4433),f=s(5633);function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t(n(new f.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,o,d,e.onResponseDataLoaded)),r.PageStore.on("window_scroll",h),r.PageStore.on("document_visibility_change",c),h(),()=>{r.PageStore.removeListener("window_scroll",h),r.PageStore.removeListener("document_visibility_change",c),i&&(i.cancelAll(),n(null))})),[]),(0,a.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),s?t.length?a.createElement("div",{className:l.listOuter},y(),a.createElement("div",{ref:m,className:"items-list-wrap"},a.createElement("div",{ref:b,className:l.list},t.map(((t,s)=>a.createElement(p.c,S({key:s},(0,p.k)(e,t,s),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),A()):null:a.createElement(g.e,{className:l.listOuter})}m.propTypes={...c.ItemListAsync.propTypes},m.defaultProps={...c.ItemListAsync.defaultProps,pageItems:2};var b=s(8713),y=s.n(b),A=s(285),C=s(5514),_=s(3160),k=s(9294),v=s(7670),M=s(4473),P=s(6670),T=s(9479);function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(this.state.query){let t="";t=e?1===e?(0,l.translateString)("1 result for")+' "'+this.state.query+'"':e+" "+(0,l.translateString)("results for")+' "'+this.state.query+'"':(0,l.translateString)("No results for")+' "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?n.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(e)+this.state.filterArgs:n.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs;let s=this.state.title;""===e&&(s=this.props.title),this.setState({requestUrl:t,query:e,title:s})}handleMediaSelection(e,t){if(this.setState((()=>{const s=new Set;return t&&s.add(e),{selectedMedia:s}})),t){const t=`${window.location.origin}/embed?m=${e}`,s=()=>{window.parent!==window&&window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*")};fetch(`/api/v1/media/${e}/share`,{method:"POST",headers:{"X-CSRFToken":this.props.bulkActions.getCsrfToken(),"Content-Type":"application/json"}}).then(s).catch(s)}}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const s=[];for(let e in t)null!==t[e]&&s.push(e+"="+t[e]);this.setState({filterArgs:s.length?"&"+s.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?n.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:n.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}pageContent(){const e=r.ProfilePageStore.get("author-data"),t=e&&e.username===n.MemberContext._currentValue.username,s=(0,l.inSelectMediaEmbedMode)(),i=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state=")),u=this.state.selectedTag&&"all"!==this.state.selectedTag,c=this.state.selectedSort&&"date_added_desc"!==this.state.selectedSort;return[this.state.author?a.createElement(d.A,{key:"ProfilePagesHeader",type:"media",author:this.state.author,onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:i,hasActiveTags:u,hasActiveSort:c,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,l.inEmbeddedApp)()}):null,this.state.author?a.createElement(h.A,{key:"ProfilePagesContent"},a.createElement(o.MediaListWrapper,{title:(0,l.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,l.inEmbeddedApp)()?{marginTop:"24px"}:void 0,showBulkActions:!s&&t,selectedCount:s?this.state.selectedMedia.size:this.props.bulkActions.selectedMedia.size,totalCount:s?0:this.props.bulkActions.availableMediaIds.length,onBulkAction:this.props.bulkActions.handleBulkAction,onSelectAll:this.props.bulkActions.handleSelectAll,onDeselectAll:this.props.bulkActions.handleDeselectAll,showAddMediaButton:!s&&t,hasContributorCourses:this.props.bulkActions.hasContributorCourses},a.createElement(_.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate,selectedTag:this.state.selectedTag,selectedSort:this.state.selectedSort}),a.createElement(k.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),a.createElement(M.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),a.createElement(v.W,{hidden:this.state.hiddenSharing,sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),a.createElement(m,{key:`${this.state.requestUrl}-${this.props.bulkActions.listKey}`,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!r.PageStore.get("config-media-item").displayViews,hideDate:!r.PageStore.get("config-media-item").displayPublishDate,canEdit:t,showSelection:t||s,hasAnySelection:s?this.state.selectedMedia.size>0:this.props.bulkActions.selectedMedia.size>0,selectedMedia:s?this.state.selectedMedia:this.props.bulkActions.selectedMedia,onMediaSelection:s?this.handleMediaSelection:this.props.bulkActions.handleMediaSelection,onItemsUpdate:s?void 0:this.props.bulkActions.handleItemsUpdate,onResponseDataLoaded:this.onResponseDataLoaded}))):null,this.state.author&&t&&!s?a.createElement(C.w,w({key:"BulkActionsModals"},this.props.bulkActions,{selectedMediaIds:Array.from(this.props.bulkActions.selectedMedia),csrfToken:this.props.bulkActions.getCsrfToken(),username:this.state.author.username,onConfirmCancel:this.props.bulkActions.handleConfirmCancel,onConfirmProceed:this.props.bulkActions.handleConfirmProceed,onPermissionModalCancel:this.props.bulkActions.handlePermissionModalCancel,onPermissionModalSuccess:this.props.bulkActions.handlePermissionModalSuccess,onPermissionModalError:this.props.bulkActions.handlePermissionModalError,onPlaylistModalCancel:this.props.bulkActions.handlePlaylistModalCancel,onPlaylistModalSuccess:this.props.bulkActions.handlePlaylistModalSuccess,onPlaylistModalError:this.props.bulkActions.handlePlaylistModalError,onChangeOwnerModalCancel:this.props.bulkActions.handleChangeOwnerModalCancel,onChangeOwnerModalSuccess:this.props.bulkActions.handleChangeOwnerModalSuccess,onChangeOwnerModalError:this.props.bulkActions.handleChangeOwnerModalError,onPublishStateModalCancel:this.props.bulkActions.handlePublishStateModalCancel,onPublishStateModalSuccess:this.props.bulkActions.handlePublishStateModalSuccess,onPublishStateModalError:this.props.bulkActions.handlePublishStateModalError,onCategoryModalCancel:this.props.bulkActions.handleCategoryModalCancel,onCategoryModalSuccess:this.props.bulkActions.handleCategoryModalSuccess,onCategoryModalError:this.props.bulkActions.handleCategoryModalError,onTagModalCancel:this.props.bulkActions.handleTagModalCancel,onTagModalSuccess:this.props.bulkActions.handleTagModalSuccess,onTagModalError:this.props.bulkActions.handleTagModalError,showCourseCleanupModal:this.props.bulkActions.showCourseCleanupModal,onCourseCleanupModalCancel:this.props.bulkActions.handleCourseCleanupModalCancel,onCourseCleanupModalSuccess:this.props.bulkActions.handleCourseCleanupModalSuccess,onCourseCleanupModalError:this.props.bulkActions.handleCourseCleanupModalError})):null]}}E.propTypes={title:y().string.isRequired,bulkActions:y().object.isRequired},E.defaultProps={title:"Uploads"},(0,P.k)(E),(0,i.C)("page-profile-playlists",class extends E{constructor(e){super(e,"author-playlists"),this.state={loadedAuthor:!1,loadedPlaylists:!1,playlistsCount:-1},this.getPlaylistsCountFunc=this.getPlaylistsCountFunc.bind(this)}getPlaylistsCountFunc(e){this.setState({loadedPlaylists:!0,playlistsCount:e})}pageContent(){return[this.state.author?a.createElement(d.A,{key:"ProfilePagesHeader",author:this.state.author,type:"playlists",hideChannelBanner:(0,l.inEmbeddedApp)()}):null,this.state.author?a.createElement(h.A,{key:"ProfilePagesContent"},a.createElement(n.ApiUrlConsumer,null,(e=>a.createElement(o.MediaListWrapper,{title:-1=n)&&Object.keys(i.O).every((function(e){return i.O[e](s[o])}))?s.splice(o--,1):(l=!1,n0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[s,a,n]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=956,function(){var e={956:0};i.O.j=function(t){return 0===e[t]};var t=function(t,s){var a,n,r=s[0],l=s[1],o=s[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(a in l)i.o(l,a)&&(i.m[a]=l[a]);if(o)var h=o(i)}for(t&&t(s);d=0?null:(0,i.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var a},n=function(e,t,s){return void 0===e[t]||(a=e[t])===Math.trunc(a)&&a>0?null:(0,i.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var a}},1936:function(e,t,s){"use strict";s.d(t,{PageHeader:function(){return i.z},PageMain:function(){return a.P},PageSidebar:function(){return n.E}});var i=s(1254),a=s(3212),n=s(795);s(1470)},5810:function(e,t,s){"use strict";var i=s(2985),a=s(9471),n=s(8790),r=s(7460),l=s(6014),o=s(2855),d=s(1177),h=s(239),u=s(5338),c=s(4685),g=s(2495),p=s(4433),f=s(5633);function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t(n(new f.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,o,d,e.onResponseDataLoaded)),r.PageStore.on("window_scroll",h),r.PageStore.on("document_visibility_change",c),h(),()=>{r.PageStore.removeListener("window_scroll",h),r.PageStore.removeListener("document_visibility_change",c),i&&(i.cancelAll(),n(null))})),[]),(0,a.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),s?t.length?a.createElement("div",{className:l.listOuter},y(),a.createElement("div",{ref:m,className:"items-list-wrap"},a.createElement("div",{ref:b,className:l.list},t.map(((t,s)=>a.createElement(p.c,S({key:s},(0,p.k)(e,t,s),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),A()):null:a.createElement(g.e,{className:l.listOuter})}m.propTypes={...c.ItemListAsync.propTypes},m.defaultProps={...c.ItemListAsync.defaultProps,pageItems:2};var b=s(8713),y=s.n(b),A=s(285),C=s(5514),_=s(3160),k=s(9294),v=s(7670),M=s(4473),P=s(6670),T=s(9479);function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(this.state.query){let t="";t=e?1===e?(0,l.translateString)("1 result for")+' "'+this.state.query+'"':e+" "+(0,l.translateString)("results for")+' "'+this.state.query+'"':(0,l.translateString)("No results for")+' "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?n.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(e)+this.state.filterArgs:n.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs;let s=this.state.title;""===e&&(s=this.props.title),this.setState({requestUrl:t,query:e,title:s})}handleMediaSelection(e,t){if(this.setState((()=>{const s=new Set;return t&&s.add(e),{selectedMedia:s}})),t){const t=`${window.location.origin}/embed?m=${e}`,s=()=>{window.parent!==window&&window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*")};fetch(`/api/v1/media/${e}/share`,{method:"POST",headers:{"X-CSRFToken":this.props.bulkActions.getCsrfToken(),"Content-Type":"application/json"}}).then(s).catch(s)}}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.includes("media_type")?this.state.filterArgs.match(/media_type=([^&]*)/)?.[1]:null,upload_date:this.state.filterArgs.includes("upload_date")?this.state.filterArgs.match(/upload_date=([^&]*)/)?.[1]:null,duration:this.state.filterArgs.includes("duration")?this.state.filterArgs.match(/duration=([^&]*)/)?.[1]:null,publish_state:this.state.filterArgs.includes("publish_state")?this.state.filterArgs.match(/publish_state=([^&]*)/)?.[1]:null,sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const s=[];for(let e in t)null!==t[e]&&s.push(e+"="+t[e]);this.setState({filterArgs:s.length?"&"+s.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?n.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:n.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}pageContent(){const e=r.ProfilePageStore.get("author-data"),t=e&&e.username===n.MemberContext._currentValue.username,s=(0,l.inSelectMediaEmbedMode)(),i=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state=")),u=this.state.selectedTag&&"all"!==this.state.selectedTag,c=this.state.selectedSort&&"date_added_desc"!==this.state.selectedSort;return[this.state.author?a.createElement(d.A,{key:"ProfilePagesHeader",type:"media",author:this.state.author,onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:i,hasActiveTags:u,hasActiveSort:c,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,l.inEmbeddedApp)()}):null,this.state.author?a.createElement(h.A,{key:"ProfilePagesContent"},a.createElement(o.MediaListWrapper,{title:(0,l.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,l.inEmbeddedApp)()?{marginTop:"24px"}:void 0,showBulkActions:!s&&t,selectedCount:s?this.state.selectedMedia.size:this.props.bulkActions.selectedMedia.size,totalCount:s?0:this.props.bulkActions.availableMediaIds.length,onBulkAction:this.props.bulkActions.handleBulkAction,onSelectAll:this.props.bulkActions.handleSelectAll,onDeselectAll:this.props.bulkActions.handleDeselectAll,showAddMediaButton:!s&&t,hasContributorCourses:this.props.bulkActions.hasContributorCourses},a.createElement(_.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate,selectedTag:this.state.selectedTag,selectedSort:this.state.selectedSort}),a.createElement(k.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),a.createElement(M.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),a.createElement(v.W,{hidden:this.state.hiddenSharing,sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),a.createElement(m,{key:`${this.state.requestUrl}-${this.props.bulkActions.listKey}`,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!r.PageStore.get("config-media-item").displayViews,hideDate:!r.PageStore.get("config-media-item").displayPublishDate,canEdit:t,showSelection:t||s,hasAnySelection:s?this.state.selectedMedia.size>0:this.props.bulkActions.selectedMedia.size>0,selectedMedia:s?this.state.selectedMedia:this.props.bulkActions.selectedMedia,onMediaSelection:s?this.handleMediaSelection:this.props.bulkActions.handleMediaSelection,onItemsUpdate:s?void 0:this.props.bulkActions.handleItemsUpdate,onResponseDataLoaded:this.onResponseDataLoaded}))):null,this.state.author&&t&&!s?a.createElement(C.w,w({key:"BulkActionsModals"},this.props.bulkActions,{selectedMediaIds:Array.from(this.props.bulkActions.selectedMedia),csrfToken:this.props.bulkActions.getCsrfToken(),username:this.state.author.username,onConfirmCancel:this.props.bulkActions.handleConfirmCancel,onConfirmProceed:this.props.bulkActions.handleConfirmProceed,onPermissionModalCancel:this.props.bulkActions.handlePermissionModalCancel,onPermissionModalSuccess:this.props.bulkActions.handlePermissionModalSuccess,onPermissionModalError:this.props.bulkActions.handlePermissionModalError,onPlaylistModalCancel:this.props.bulkActions.handlePlaylistModalCancel,onPlaylistModalSuccess:this.props.bulkActions.handlePlaylistModalSuccess,onPlaylistModalError:this.props.bulkActions.handlePlaylistModalError,onChangeOwnerModalCancel:this.props.bulkActions.handleChangeOwnerModalCancel,onChangeOwnerModalSuccess:this.props.bulkActions.handleChangeOwnerModalSuccess,onChangeOwnerModalError:this.props.bulkActions.handleChangeOwnerModalError,onPublishStateModalCancel:this.props.bulkActions.handlePublishStateModalCancel,onPublishStateModalSuccess:this.props.bulkActions.handlePublishStateModalSuccess,onPublishStateModalError:this.props.bulkActions.handlePublishStateModalError,onCategoryModalCancel:this.props.bulkActions.handleCategoryModalCancel,onCategoryModalSuccess:this.props.bulkActions.handleCategoryModalSuccess,onCategoryModalError:this.props.bulkActions.handleCategoryModalError,onTagModalCancel:this.props.bulkActions.handleTagModalCancel,onTagModalSuccess:this.props.bulkActions.handleTagModalSuccess,onTagModalError:this.props.bulkActions.handleTagModalError,showCourseCleanupModal:this.props.bulkActions.showCourseCleanupModal,onCourseCleanupModalCancel:this.props.bulkActions.handleCourseCleanupModalCancel,onCourseCleanupModalSuccess:this.props.bulkActions.handleCourseCleanupModalSuccess,onCourseCleanupModalError:this.props.bulkActions.handleCourseCleanupModalError})):null]}}E.propTypes={title:y().string.isRequired,bulkActions:y().object.isRequired},E.defaultProps={title:"Uploads"},(0,P.k)(E),(0,i.C)("page-profile-playlists",class extends E{constructor(e){super(e,"author-playlists"),this.state={loadedAuthor:!1,loadedPlaylists:!1,playlistsCount:-1},this.getPlaylistsCountFunc=this.getPlaylistsCountFunc.bind(this)}getPlaylistsCountFunc(e){this.setState({loadedPlaylists:!0,playlistsCount:e})}pageContent(){return[this.state.author?a.createElement(d.A,{key:"ProfilePagesHeader",author:this.state.author,type:"playlists",hideChannelBanner:(0,l.inEmbeddedApp)()}):null,this.state.author?a.createElement(h.A,{key:"ProfilePagesContent"},a.createElement(n.ApiUrlConsumer,null,(e=>a.createElement(o.MediaListWrapper,{title:-1=n)&&Object.keys(i.O).every((function(e){return i.O[e](s[o])}))?s.splice(o--,1):(l=!1,n0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[s,a,n]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=956,function(){var e={956:0};i.O.j=function(t){return 0===e[t]};var t=function(t,s){var a,n,r=s[0],l=s[1],o=s[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(a in l)i.o(l,a)&&(i.m[a]=l[a]);if(o)var h=o(i)}for(t&&t(s);d=0?null:(0,a.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var i},n=function(e,t,s){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>0?null:(0,a.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var i}},1936:function(e,t,s){"use strict";s.d(t,{PageHeader:function(){return a.z},PageMain:function(){return i.P},PageSidebar:function(){return n.E}});var a=s(1254),i=s(3212),n=s(795);s(1470)},5370:function(e,t,s){"use strict";var a=s(2985),i=s(9471),n=s(8713),r=s.n(n),o=s(8790),l=s(7460),d=s(285),h=s(2855),u=s(1177),c=s(239),g=s(7731),p=s(3160),f=s(9294),m=s(7670),b=s(4473),S=s(5514),y=s(9200),_=s(6670),C=s(9479),A=s(8974);function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;ti.createElement("div",{className:"empty-media empty-channel-media"},i.createElement("div",{className:"welcome-title"},"No shared media"),i.createElement("div",{className:"start-uploading"},"Media that you have shared with others will show up here."))))}class M extends C.Y{constructor(e,t){super(e,"string"==typeof t?t:"author-shared-by-me"),this.profilePageSlug="string"==typeof t?t:"author-shared-by-me",this.state={channelMediaCount:-1,author:l.ProfilePageStore.get("author-data"),uploadsPreviewItemsCount:0,title:this.props.title,query:l.ProfilePageStore.get("author-query"),requestUrl:null,hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0,filterArgs:"",availableTags:[],selectedTag:"all",selectedSort:"date_added_desc",selectedMedia:new Set,sharedUsers:[],sharedGroups:[],selectedSharingType:null,selectedSharingValue:null},this.authorDataLoad=this.authorDataLoad.bind(this),this.onAuthorPreviewItemsCountCallback=this.onAuthorPreviewItemsCountCallback.bind(this),this.getCountFunc=this.getCountFunc.bind(this),this.changeRequestQuery=this.changeRequestQuery.bind(this),this.onToggleFiltersClick=this.onToggleFiltersClick.bind(this),this.onToggleTagsClick=this.onToggleTagsClick.bind(this),this.onToggleSortingClick=this.onToggleSortingClick.bind(this),this.onToggleSharingClick=this.onToggleSharingClick.bind(this),this.onFiltersUpdate=this.onFiltersUpdate.bind(this),this.onTagSelect=this.onTagSelect.bind(this),this.onSortSelect=this.onSortSelect.bind(this),this.onSharingSelect=this.onSharingSelect.bind(this),this.onResponseDataLoaded=this.onResponseDataLoaded.bind(this),this.handleMediaSelection=this.handleMediaSelection.bind(this),l.ProfilePageStore.on("load-author-data",this.authorDataLoad)}componentDidMount(){d.ProfilePageActions.load_author_data()}authorDataLoad(){const e=l.ProfilePageStore.get("author-data");let t=this.state.requestUrl;e&&(t=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+e.id+"&show=shared_by_me&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+e.id+"&show=shared_by_me"+this.state.filterArgs),this.setState({author:e,requestUrl:t})}onAuthorPreviewItemsCountCallback(e){this.setState({uploadsPreviewItemsCount:e})}getCountFunc(e){this.setState({channelMediaCount:e},(()=>{if(this.state.query){let t="";t=e?1===e?'1 result for "'+this.state.query+'"':e+' results for "'+this.state.query+'"':'No results for "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_by_me&q="+encodeURIComponent(e)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_by_me"+this.state.filterArgs;let s=this.state.title;""===e&&(s=this.props.title),this.setState({requestUrl:t,query:e,title:s})}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const s=[];for(let e in t)null!==t[e]&&s.push(e+"="+t[e]);this.setState({filterArgs:s.length?"&"+s.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_by_me&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_by_me"+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}handleMediaSelection(e,t){const s=(0,y.inSelectMediaEmbedMode)();this.setState((a=>{const i=new Set;if(s){if(t&&(i.add(e),A.log("Selected media item:",e),window.parent!==window)){const t=`${window.location.origin}/embed?m=${e}`;window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*"),A.log("Sent postMessage to parent:",{embedUrl:t,videoId:e})}}else i.clear(),a.selectedMedia.forEach((e=>i.add(e))),t?i.add(e):i.delete(e);return{selectedMedia:i}}))}pageContent(){const e=l.ProfilePageStore.get("author-data"),t=e&&e.username===o.MemberContext._currentValue.username,s=(0,y.inSelectMediaEmbedMode)(),a=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state="));return[this.state.author?i.createElement(u.A,{key:"ProfilePagesHeader",author:this.state.author,type:"shared_by_me",onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:a,hasActiveTags:"all"!==this.state.selectedTag,hasActiveSort:"date_added_desc"!==this.state.selectedSort,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,y.inEmbeddedApp)()}):null,this.state.author?i.createElement(c.A,{key:"ProfilePagesContent"},i.createElement(h.MediaListWrapper,{title:(0,y.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,y.inEmbeddedApp)()?{marginTop:"24px"}:void 0,showBulkActions:!s&&t,selectedCount:s?this.state.selectedMedia.size:this.props.bulkActions.selectedMedia.size,totalCount:s?0:this.props.bulkActions.availableMediaIds.length,onBulkAction:this.props.bulkActions.handleBulkAction,onSelectAll:this.props.bulkActions.handleSelectAll,onDeselectAll:this.props.bulkActions.handleDeselectAll,hasContributorCourses:this.props.bulkActions.hasContributorCourses},i.createElement(p.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate}),i.createElement(f.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),i.createElement(b.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),i.createElement(m.W,{hidden:this.state.hiddenSharing,sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),i.createElement(g.LazyLoadItemListAsync,{key:s?this.state.requestUrl:`${this.state.requestUrl}-${this.props.bulkActions.listKey}`,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!l.PageStore.get("config-media-item").displayViews,hideDate:!l.PageStore.get("config-media-item").displayPublishDate,canEdit:!s&&t,onResponseDataLoaded:this.onResponseDataLoaded,showSelection:t||s,hasAnySelection:s?this.state.selectedMedia.size>0:this.props.bulkActions.selectedMedia.size>0,selectedMedia:s?this.state.selectedMedia:this.props.bulkActions.selectedMedia,onMediaSelection:s?this.handleMediaSelection:this.props.bulkActions.handleMediaSelection,onItemsUpdate:s?void 0:this.props.bulkActions.handleItemsUpdate}),t&&0===this.state.channelMediaCount&&!this.state.query?i.createElement(v,{name:this.state.author.name}):null)):null,this.state.author&&t&&!s?i.createElement(S.w,k({key:"BulkActionsModals"},this.props.bulkActions,{selectedMediaIds:Array.from(this.props.bulkActions.selectedMedia),csrfToken:this.props.bulkActions.getCsrfToken(),username:this.state.author.username,onConfirmCancel:this.props.bulkActions.handleConfirmCancel,onConfirmProceed:this.props.bulkActions.handleConfirmProceed,onPermissionModalCancel:this.props.bulkActions.handlePermissionModalCancel,onPermissionModalSuccess:this.props.bulkActions.handlePermissionModalSuccess,onPermissionModalError:this.props.bulkActions.handlePermissionModalError,onPlaylistModalCancel:this.props.bulkActions.handlePlaylistModalCancel,onPlaylistModalSuccess:this.props.bulkActions.handlePlaylistModalSuccess,onPlaylistModalError:this.props.bulkActions.handlePlaylistModalError,onChangeOwnerModalCancel:this.props.bulkActions.handleChangeOwnerModalCancel,onChangeOwnerModalSuccess:this.props.bulkActions.handleChangeOwnerModalSuccess,onChangeOwnerModalError:this.props.bulkActions.handleChangeOwnerModalError,onPublishStateModalCancel:this.props.bulkActions.handlePublishStateModalCancel,onPublishStateModalSuccess:this.props.bulkActions.handlePublishStateModalSuccess,onPublishStateModalError:this.props.bulkActions.handlePublishStateModalError,onCategoryModalCancel:this.props.bulkActions.handleCategoryModalCancel,onCategoryModalSuccess:this.props.bulkActions.handleCategoryModalSuccess,onCategoryModalError:this.props.bulkActions.handleCategoryModalError,onTagModalCancel:this.props.bulkActions.handleTagModalCancel,onTagModalSuccess:this.props.bulkActions.handleTagModalSuccess,onTagModalError:this.props.bulkActions.handleTagModalError,showCourseCleanupModal:this.props.bulkActions.showCourseCleanupModal,onCourseCleanupModalCancel:this.props.bulkActions.handleCourseCleanupModalCancel,onCourseCleanupModalSuccess:this.props.bulkActions.handleCourseCleanupModalSuccess,onCourseCleanupModalError:this.props.bulkActions.handleCourseCleanupModalError})):null]}}M.propTypes={title:r().string.isRequired,bulkActions:r().object.isRequired},M.defaultProps={title:"Shared by me"};const w=(0,_.k)(M);(0,a.C)("page-profile-shared-by-me",w)},6403:function(e,t,s){"use strict";s.d(t,{g:function(){return r},m:function(){return n}});var a=s(8004);function i(e,t,s){let a;switch(s){case TypeError:case RangeError:case SyntaxError:case ReferenceError:a=new s(t[0]);break;default:a=new Error(t[0])}return e(a.message,...t.slice(1)),a}function n(e,t){return i(a.z,e,t)}function r(e,t){return i(a.R,e,t)}},7143:function(e,t,s){const a=s(2063).Dispatcher;e.exports=new a},7731:function(e,t,s){"use strict";s.d(t,{LazyLoadItemListAsync:function(){return u}});var a=s(9471),i=s(7460),n=s(5338),r=s(4685),o=s(2495),l=s(4433),d=s(5633);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t(u(new d.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,g,p,e.onResponseDataLoaded)),i.PageStore.on("window_scroll",f),i.PageStore.on("document_visibility_change",m),f(),()=>{i.PageStore.removeListener("window_scroll",f),i.PageStore.removeListener("document_visibility_change",m),r&&(r.cancelAll(),u(null))})),[]),(0,a.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),s?t.length?a.createElement("div",{className:c.listOuter},y(),a.createElement("div",{ref:b,className:"items-list-wrap"},a.createElement("div",{ref:S,className:c.list},t.map(((t,s)=>a.createElement(l.c,h({key:s},(0,l.k)(e,t,s),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),_()):null:a.createElement(o.e,{className:c.listOuter})}u.propTypes={...r.ItemListAsync.propTypes},u.defaultProps={...r.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,s){"use strict";s.d(t,{R:function(){return n},z:function(){return r}});var a=s(8974);const i=function(){for(var e=arguments.length,t=new Array(e),s=0;s=n)&&Object.keys(a.O).every((function(e){return a.O[e](s[l])}))?s.splice(l--,1):(o=!1,n0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[s,i,n]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.j=749,function(){var e={749:0};a.O.j=function(t){return 0===e[t]};var t=function(t,s){var i,n,r=s[0],o=s[1],l=s[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(i in o)a.o(o,i)&&(a.m[i]=o[i]);if(l)var h=l(a)}for(t&&t(s);d=0?null:(0,a.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var i},n=function(e,t,s){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>0?null:(0,a.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(s||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var i}},1936:function(e,t,s){"use strict";s.d(t,{PageHeader:function(){return a.z},PageMain:function(){return i.P},PageSidebar:function(){return n.E}});var a=s(1254),i=s(3212),n=s(795);s(1470)},5370:function(e,t,s){"use strict";var a=s(2985),i=s(9471),n=s(8713),r=s.n(n),o=s(8790),l=s(7460),d=s(285),h=s(2855),u=s(1177),c=s(239),g=s(7731),p=s(3160),f=s(9294),m=s(7670),b=s(4473),S=s(5514),y=s(6014),_=s(6670),C=s(9479),A=s(8974);function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;ti.createElement("div",{className:"empty-media empty-channel-media"},i.createElement("div",{className:"welcome-title"},"No shared media"),i.createElement("div",{className:"start-uploading"},"Media that you have shared with others will show up here."))))}class M extends C.Y{constructor(e,t){super(e,"string"==typeof t?t:"author-shared-by-me"),this.profilePageSlug="string"==typeof t?t:"author-shared-by-me",this.state={channelMediaCount:-1,author:l.ProfilePageStore.get("author-data"),uploadsPreviewItemsCount:0,title:this.props.title,query:l.ProfilePageStore.get("author-query"),requestUrl:null,hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0,filterArgs:"",availableTags:[],selectedTag:"all",selectedSort:"date_added_desc",selectedMedia:new Set,sharedUsers:[],sharedGroups:[],selectedSharingType:null,selectedSharingValue:null},this.authorDataLoad=this.authorDataLoad.bind(this),this.onAuthorPreviewItemsCountCallback=this.onAuthorPreviewItemsCountCallback.bind(this),this.getCountFunc=this.getCountFunc.bind(this),this.changeRequestQuery=this.changeRequestQuery.bind(this),this.onToggleFiltersClick=this.onToggleFiltersClick.bind(this),this.onToggleTagsClick=this.onToggleTagsClick.bind(this),this.onToggleSortingClick=this.onToggleSortingClick.bind(this),this.onToggleSharingClick=this.onToggleSharingClick.bind(this),this.onFiltersUpdate=this.onFiltersUpdate.bind(this),this.onTagSelect=this.onTagSelect.bind(this),this.onSortSelect=this.onSortSelect.bind(this),this.onSharingSelect=this.onSharingSelect.bind(this),this.onResponseDataLoaded=this.onResponseDataLoaded.bind(this),this.handleMediaSelection=this.handleMediaSelection.bind(this),l.ProfilePageStore.on("load-author-data",this.authorDataLoad)}componentDidMount(){d.ProfilePageActions.load_author_data()}authorDataLoad(){const e=l.ProfilePageStore.get("author-data");let t=this.state.requestUrl;e&&(t=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+e.id+"&show=shared_by_me&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+e.id+"&show=shared_by_me"+this.state.filterArgs),this.setState({author:e,requestUrl:t})}onAuthorPreviewItemsCountCallback(e){this.setState({uploadsPreviewItemsCount:e})}getCountFunc(e){this.setState({channelMediaCount:e},(()=>{if(this.state.query){let t="";t=e?1===e?'1 result for "'+this.state.query+'"':e+' results for "'+this.state.query+'"':'No results for "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_by_me&q="+encodeURIComponent(e)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_by_me"+this.state.filterArgs;let s=this.state.title;""===e&&(s=this.props.title),this.setState({requestUrl:t,query:e,title:s})}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const s=[];for(let e in t)null!==t[e]&&s.push(e+"="+t[e]);this.setState({filterArgs:s.length?"&"+s.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_by_me&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_by_me"+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}handleMediaSelection(e,t){const s=(0,y.inSelectMediaEmbedMode)();this.setState((a=>{const i=new Set;if(s){if(t&&(i.add(e),A.log("Selected media item:",e),window.parent!==window)){const t=`${window.location.origin}/embed?m=${e}`;window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*"),A.log("Sent postMessage to parent:",{embedUrl:t,videoId:e})}}else i.clear(),a.selectedMedia.forEach((e=>i.add(e))),t?i.add(e):i.delete(e);return{selectedMedia:i}}))}pageContent(){const e=l.ProfilePageStore.get("author-data"),t=e&&e.username===o.MemberContext._currentValue.username,s=(0,y.inSelectMediaEmbedMode)(),a=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state="));return[this.state.author?i.createElement(u.A,{key:"ProfilePagesHeader",author:this.state.author,type:"shared_by_me",onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:a,hasActiveTags:"all"!==this.state.selectedTag,hasActiveSort:"date_added_desc"!==this.state.selectedSort,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,y.inEmbeddedApp)()}):null,this.state.author?i.createElement(c.A,{key:"ProfilePagesContent"},i.createElement(h.MediaListWrapper,{title:(0,y.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,y.inEmbeddedApp)()?{marginTop:"24px"}:void 0,showBulkActions:!s&&t,selectedCount:s?this.state.selectedMedia.size:this.props.bulkActions.selectedMedia.size,totalCount:s?0:this.props.bulkActions.availableMediaIds.length,onBulkAction:this.props.bulkActions.handleBulkAction,onSelectAll:this.props.bulkActions.handleSelectAll,onDeselectAll:this.props.bulkActions.handleDeselectAll,hasContributorCourses:this.props.bulkActions.hasContributorCourses},i.createElement(p.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate}),i.createElement(f.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),i.createElement(b.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),i.createElement(m.W,{hidden:this.state.hiddenSharing,sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),i.createElement(g.LazyLoadItemListAsync,{key:s?this.state.requestUrl:`${this.state.requestUrl}-${this.props.bulkActions.listKey}`,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!l.PageStore.get("config-media-item").displayViews,hideDate:!l.PageStore.get("config-media-item").displayPublishDate,canEdit:!s&&t,onResponseDataLoaded:this.onResponseDataLoaded,showSelection:t||s,hasAnySelection:s?this.state.selectedMedia.size>0:this.props.bulkActions.selectedMedia.size>0,selectedMedia:s?this.state.selectedMedia:this.props.bulkActions.selectedMedia,onMediaSelection:s?this.handleMediaSelection:this.props.bulkActions.handleMediaSelection,onItemsUpdate:s?void 0:this.props.bulkActions.handleItemsUpdate}),t&&0===this.state.channelMediaCount&&!this.state.query?i.createElement(v,{name:this.state.author.name}):null)):null,this.state.author&&t&&!s?i.createElement(S.w,k({key:"BulkActionsModals"},this.props.bulkActions,{selectedMediaIds:Array.from(this.props.bulkActions.selectedMedia),csrfToken:this.props.bulkActions.getCsrfToken(),username:this.state.author.username,onConfirmCancel:this.props.bulkActions.handleConfirmCancel,onConfirmProceed:this.props.bulkActions.handleConfirmProceed,onPermissionModalCancel:this.props.bulkActions.handlePermissionModalCancel,onPermissionModalSuccess:this.props.bulkActions.handlePermissionModalSuccess,onPermissionModalError:this.props.bulkActions.handlePermissionModalError,onPlaylistModalCancel:this.props.bulkActions.handlePlaylistModalCancel,onPlaylistModalSuccess:this.props.bulkActions.handlePlaylistModalSuccess,onPlaylistModalError:this.props.bulkActions.handlePlaylistModalError,onChangeOwnerModalCancel:this.props.bulkActions.handleChangeOwnerModalCancel,onChangeOwnerModalSuccess:this.props.bulkActions.handleChangeOwnerModalSuccess,onChangeOwnerModalError:this.props.bulkActions.handleChangeOwnerModalError,onPublishStateModalCancel:this.props.bulkActions.handlePublishStateModalCancel,onPublishStateModalSuccess:this.props.bulkActions.handlePublishStateModalSuccess,onPublishStateModalError:this.props.bulkActions.handlePublishStateModalError,onCategoryModalCancel:this.props.bulkActions.handleCategoryModalCancel,onCategoryModalSuccess:this.props.bulkActions.handleCategoryModalSuccess,onCategoryModalError:this.props.bulkActions.handleCategoryModalError,onTagModalCancel:this.props.bulkActions.handleTagModalCancel,onTagModalSuccess:this.props.bulkActions.handleTagModalSuccess,onTagModalError:this.props.bulkActions.handleTagModalError,showCourseCleanupModal:this.props.bulkActions.showCourseCleanupModal,onCourseCleanupModalCancel:this.props.bulkActions.handleCourseCleanupModalCancel,onCourseCleanupModalSuccess:this.props.bulkActions.handleCourseCleanupModalSuccess,onCourseCleanupModalError:this.props.bulkActions.handleCourseCleanupModalError})):null]}}M.propTypes={title:r().string.isRequired,bulkActions:r().object.isRequired},M.defaultProps={title:"Shared by me"};const w=(0,_.k)(M);(0,a.C)("page-profile-shared-by-me",w)},6403:function(e,t,s){"use strict";s.d(t,{g:function(){return r},m:function(){return n}});var a=s(8004);function i(e,t,s){let a;switch(s){case TypeError:case RangeError:case SyntaxError:case ReferenceError:a=new s(t[0]);break;default:a=new Error(t[0])}return e(a.message,...t.slice(1)),a}function n(e,t){return i(a.z,e,t)}function r(e,t){return i(a.R,e,t)}},7143:function(e,t,s){const a=s(2063).Dispatcher;e.exports=new a},7731:function(e,t,s){"use strict";s.d(t,{LazyLoadItemListAsync:function(){return u}});var a=s(9471),i=s(7460),n=s(5338),r=s(4685),o=s(2495),l=s(4433),d=s(5633);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t(u(new d.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,g,p,e.onResponseDataLoaded)),i.PageStore.on("window_scroll",f),i.PageStore.on("document_visibility_change",m),f(),()=>{i.PageStore.removeListener("window_scroll",f),i.PageStore.removeListener("document_visibility_change",m),r&&(r.cancelAll(),u(null))})),[]),(0,a.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),s?t.length?a.createElement("div",{className:c.listOuter},y(),a.createElement("div",{ref:b,className:"items-list-wrap"},a.createElement("div",{ref:S,className:c.list},t.map(((t,s)=>a.createElement(l.c,h({key:s},(0,l.k)(e,t,s),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),_()):null:a.createElement(o.e,{className:c.listOuter})}u.propTypes={...r.ItemListAsync.propTypes},u.defaultProps={...r.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,s){"use strict";s.d(t,{R:function(){return n},z:function(){return r}});var a=s(8974);const i=function(){for(var e=arguments.length,t=new Array(e),s=0;s=n)&&Object.keys(a.O).every((function(e){return a.O[e](s[l])}))?s.splice(l--,1):(o=!1,n0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[s,i,n]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.j=749,function(){var e={749:0};a.O.j=function(t){return 0===e[t]};var t=function(t,s){var i,n,r=s[0],o=s[1],l=s[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(i in o)a.o(o,i)&&(a.m[i]=o[i]);if(l)var h=l(a)}for(t&&t(s);di.createElement("div",{className:"empty-media empty-channel-media"},i.createElement("div",{className:"welcome-title"},"No shared media"),i.createElement("div",{className:"start-uploading"},"Media that others have shared with you will show up here."))))}class v extends _.Y{constructor(e,t){super(e,"string"==typeof t?t:"author-shared-with-me"),this.profilePageSlug="string"==typeof t?t:"author-shared-with-me",this.state={channelMediaCount:-1,author:l.ProfilePageStore.get("author-data"),uploadsPreviewItemsCount:0,title:this.props.title,query:l.ProfilePageStore.get("author-query"),requestUrl:null,hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0,filterArgs:"",availableTags:[],selectedTag:"all",selectedSort:"date_added_desc",selectedMedia:new Set,sharedUsers:[],sharedGroups:[],selectedSharingType:null,selectedSharingValue:null},this.authorDataLoad=this.authorDataLoad.bind(this),this.onAuthorPreviewItemsCountCallback=this.onAuthorPreviewItemsCountCallback.bind(this),this.getCountFunc=this.getCountFunc.bind(this),this.changeRequestQuery=this.changeRequestQuery.bind(this),this.onToggleFiltersClick=this.onToggleFiltersClick.bind(this),this.onToggleTagsClick=this.onToggleTagsClick.bind(this),this.onToggleSortingClick=this.onToggleSortingClick.bind(this),this.onToggleSharingClick=this.onToggleSharingClick.bind(this),this.onFiltersUpdate=this.onFiltersUpdate.bind(this),this.onTagSelect=this.onTagSelect.bind(this),this.onSortSelect=this.onSortSelect.bind(this),this.onSharingSelect=this.onSharingSelect.bind(this),this.onResponseDataLoaded=this.onResponseDataLoaded.bind(this),this.handleMediaSelection=this.handleMediaSelection.bind(this),l.ProfilePageStore.on("load-author-data",this.authorDataLoad)}componentDidMount(){d.ProfilePageActions.load_author_data()}authorDataLoad(){const e=l.ProfilePageStore.get("author-data");let t=this.state.requestUrl;if(e){const a=(0,y.isShareMediaDisabled)()?"&exclude_lti_embed=1":"";t=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+e.id+"&show=shared_with_me&q="+encodeURIComponent(this.state.query)+a+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+e.id+"&show=shared_with_me"+a+this.state.filterArgs}this.setState({author:e,requestUrl:t})}onAuthorPreviewItemsCountCallback(e){this.setState({uploadsPreviewItemsCount:e})}getCountFunc(e){this.setState({channelMediaCount:e},(()=>{if(this.state.query){let t="";t=e?1===e?'1 result for "'+this.state.query+'"':e+' results for "'+this.state.query+'"':'No results for "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_with_me&q="+encodeURIComponent(e)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_with_me"+this.state.filterArgs;let a=this.state.title;""===e&&(a=this.props.title),this.setState({requestUrl:t,query:e,title:a})}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const a=[];for(let e in t)null!==t[e]&&a.push(e+"="+t[e]);this.setState({filterArgs:a.length?"&"+a.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_with_me&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_with_me"+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}handleMediaSelection(e,t){const a=(0,y.inSelectMediaEmbedMode)();this.setState((s=>{const i=new Set;if(a){if(t&&(i.add(e),b.log("Selected media item:",e),window.parent!==window)){const t=`${window.location.origin}/embed?m=${e}`;window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*"),b.log("Sent postMessage to parent:",{embedUrl:t,videoId:e})}}else i.clear(),s.selectedMedia.forEach((e=>i.add(e))),t?i.add(e):i.delete(e);return{selectedMedia:i}}))}pageContent(){const e=l.ProfilePageStore.get("author-data"),t=e&&e.username===o.MemberContext._currentValue.username,a=(0,y.inSelectMediaEmbedMode)(),s=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state="));return[this.state.author?i.createElement(c.A,{key:"ProfilePagesHeader",author:this.state.author,type:"shared_with_me",onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:s,hasActiveTags:"all"!==this.state.selectedTag,hasActiveSort:"date_added_desc"!==this.state.selectedSort,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,y.inEmbeddedApp)()}):null,this.state.author?i.createElement(u.A,{key:"ProfilePagesContent"},i.createElement(h.MediaListWrapper,{title:(0,y.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,y.inEmbeddedApp)()?{marginTop:"24px"}:void 0},i.createElement(m.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate}),i.createElement(p.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),i.createElement(f.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),i.createElement(S.W,{hidden:this.state.hiddenSharing,mode:"shared_with_me",sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),i.createElement(g.LazyLoadItemListAsync,{key:this.state.requestUrl,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!l.PageStore.get("config-media-item").displayViews,hideDate:!l.PageStore.get("config-media-item").displayPublishDate,canEdit:!1,onResponseDataLoaded:this.onResponseDataLoaded,showSelection:a,hasAnySelection:this.state.selectedMedia.size>0,selectedMedia:this.state.selectedMedia,onMediaSelection:this.handleMediaSelection}),t&&0===this.state.channelMediaCount&&!this.state.query?i.createElement(w,{name:this.state.author.name}):null)):null]}}v.propTypes={title:r().string.isRequired},v.defaultProps={title:"Shared with me"},(0,s.C)("page-profile-shared-with-me",v)},977:function(e,t,a){"use strict";a.d(t,{A:function(){return i}});var s=a(7143);function i(e,t){return s.register(e[t].bind(e)),e}},1702:function(e,t,a){"use strict";a.d(t,{R:function(){return i},e:function(){return n}});var s=a(6403);const i=function(e,t,a){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>=0?null:(0,s.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(a||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var i},n=function(e,t,a){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>0?null:(0,s.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(a||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var i}},1936:function(e,t,a){"use strict";a.d(t,{PageHeader:function(){return s.z},PageMain:function(){return i.P},PageSidebar:function(){return n.E}});var s=a(1254),i=a(3212),n=a(795);a(1470)},4853:function(e,t,a){"use strict";a.r(t),a.d(t,{useBulkActions:function(){return r}});var s=a(9471),i=a(9200),n=a(5742);function r(){const[e,t]=(0,s.useState)(new Set),[a,r]=(0,s.useState)([]),[o,l]=(0,s.useState)(!1),[d,h]=(0,s.useState)(null),[c,u]=(0,s.useState)(""),[g,m]=(0,s.useState)(0),[p,S]=(0,s.useState)(""),[f,y]=(0,s.useState)(!1),[_,b]=(0,s.useState)("success"),[w,v]=(0,s.useState)(!1),[C,T]=(0,s.useState)(null),[k,A]=(0,s.useState)(!1),[M,P]=(0,s.useState)(!1),[E,F]=(0,s.useState)(!1),[U,O]=(0,s.useState)(!1),[q,R]=(0,s.useState)(!1),[j,I]=(0,s.useState)(!1),[L,x]=(0,s.useState)(!1);(0,s.useEffect)((()=>{(0,n.inEmbeddedApp)()&&fetch("/api/v1/categories/contributor?lms_courses_only=true").then((e=>e.ok?e.json():null)).then((e=>{if(!e)return;const t=e.results||e;x(Array.isArray(t)&&t.length>0)})).catch((()=>{}))}),[]);const D=()=>{let e=null;if(document.cookie&&""!==document.cookie){const t=document.cookie.split(";");for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:"success";S(e),y(!0),b(t),setTimeout((()=>{y(!1)}),5e3)},V=()=>{t(new Set)},$=()=>{t(new Set),m((e=>e+1))};return{selectedMedia:e,availableMediaIds:a,listKey:g,showConfirmModal:o,confirmMessage:c,notificationMessage:p,showNotification:f,notificationType:_,showPermissionModal:w,permissionType:C,showPlaylistModal:k,showChangeOwnerModal:M,showPublishStateModal:E,showCategoryModal:U,showTagModal:q,showCourseCleanupModal:j,hasContributorCourses:L,handleMediaSelection:(e,a)=>{t((t=>{const s=new Set(t);return a?s.add(e):s.delete(e),s}))},handleItemsUpdate:e=>{const t=e.map((e=>e.friendly_token||e.uid||e.id));r(t)},handleSelectAll:()=>{t(new Set(a))},handleDeselectAll:()=>{t(new Set)},handleBulkAction:t=>{const a=e.size;"course-cleanup"!==t?0!==a&&("delete-media"===t?(l(!0),h(t),u((0,i.translateString)("You are going to delete")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"enable-comments"===t?(l(!0),h(t),u((0,i.translateString)("You are going to enable comments to")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"disable-comments"===t?(l(!0),h(t),u((0,i.translateString)("You are going to disable comments to")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"delete-comments"===t?(l(!0),h(t),u((0,i.translateString)("You are going to delete all comments from")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"enable-download"===t?(l(!0),h(t),u((0,i.translateString)("You are going to enable download for")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"disable-download"===t?(l(!0),h(t),u((0,i.translateString)("You are going to disable download for")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"copy-media"===t?(l(!0),h(t),u((0,i.translateString)("You are going to copy")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"add-remove-coviewers"===t?(v(!0),T("viewer")):"add-remove-coeditors"===t?(v(!0),T("editor")):"add-remove-coowners"===t?(v(!0),T("owner")):"add-remove-playlist"===t?A(!0):"change-owner"===t?P(!0):"publish-state"===t?F(!0):"add-remove-category"===t?O(!0):"add-remove-tags"===t&&R(!0)):I(!0)},handleConfirmCancel:()=>{l(!1),h(null),u("")},handleConfirmProceed:()=>{const t=d;l(!1),h(null),u(""),"delete-media"===t?(()=>{const t=Array.from(e),a=t.length;fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"delete_media",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to delete media");return e.json()})).then((e=>{const t=1===a?(0,i.translateString)("The media was deleted successfully."):(0,i.translateString)("Successfully deleted")+` ${a} `+(0,i.translateString)("media.");N(t),$()})).catch((e=>{N((0,i.translateString)("Failed to delete media. Please try again."),"error"),$()}))})():"enable-comments"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"enable_comments",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to enable comments");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Enabled comments")),V()})).catch((e=>{N((0,i.translateString)("Failed to enable comments."),"error"),V()}))})():"disable-comments"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"disable_comments",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to disable comments");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Disabled comments")),V()})).catch((e=>{N((0,i.translateString)("Failed to disable comments."),"error"),V()}))})():"delete-comments"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"delete_comments",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to delete comments");return e.json()})).then((e=>{N((0,i.translateString)("Successfully deleted comments")),V()})).catch((e=>{N((0,i.translateString)("Failed to delete comments."),"error"),V()}))})():"enable-download"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"enable_download",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to enable download");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Enabled Download")),V()})).catch((e=>{N((0,i.translateString)("Failed to enable download."),"error"),V()}))})():"disable-download"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"disable_download",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to disable download");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Disabled Download")),V()})).catch((e=>{N((0,i.translateString)("Failed to disable download."),"error"),V()}))})():"copy-media"===t&&(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"copy_media",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to copy media");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Copied")),$()})).catch((e=>{N((0,i.translateString)("Failed to copy media."),"error"),V()}))})()},handlePermissionModalCancel:()=>{v(!1),T(null)},handlePermissionModalSuccess:e=>{N(e),V(),v(!1),T(null)},handlePermissionModalError:e=>{N(e,"error"),v(!1),T(null)},handlePlaylistModalCancel:()=>{A(!1)},handlePlaylistModalSuccess:e=>{N(e),V(),A(!1)},handlePlaylistModalError:e=>{N(e,"error"),A(!1)},handleChangeOwnerModalCancel:()=>{P(!1)},handleChangeOwnerModalSuccess:e=>{N(e),$(),P(!1)},handleChangeOwnerModalError:e=>{N(e,"error"),P(!1)},handlePublishStateModalCancel:()=>{F(!1)},handlePublishStateModalSuccess:e=>{N(e),$(),F(!1)},handlePublishStateModalError:e=>{N(e,"error"),F(!1)},handleCategoryModalCancel:()=>{O(!1)},handleCategoryModalSuccess:e=>{N(e),V(),O(!1)},handleCategoryModalError:e=>{N(e,"error"),O(!1)},handleTagModalCancel:()=>{R(!1)},handleTagModalSuccess:e=>{N(e),V(),R(!1)},handleTagModalError:e=>{N(e,"error"),R(!1)},handleCourseCleanupModalCancel:()=>{I(!1)},handleCourseCleanupModalSuccess:e=>{N(e),$(),I(!1)},handleCourseCleanupModalError:e=>{N(e,"error"),I(!1)},getCsrfToken:D,clearSelection:V,clearSelectionAndRefresh:$}}},6403:function(e,t,a){"use strict";a.d(t,{g:function(){return r},m:function(){return n}});var s=a(8004);function i(e,t,a){let s;switch(a){case TypeError:case RangeError:case SyntaxError:case ReferenceError:s=new a(t[0]);break;default:s=new Error(t[0])}return e(s.message,...t.slice(1)),s}function n(e,t){return i(s.z,e,t)}function r(e,t){return i(s.R,e,t)}},7143:function(e,t,a){const s=a(2063).Dispatcher;e.exports=new s},7731:function(e,t,a){"use strict";a.d(t,{LazyLoadItemListAsync:function(){return c}});var s=a(9471),i=a(7460),n=a(5338),r=a(4685),o=a(2495),l=a(4433),d=a(5633);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t(c(new d.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,g,m,e.onResponseDataLoaded)),i.PageStore.on("window_scroll",p),i.PageStore.on("document_visibility_change",S),p(),()=>{i.PageStore.removeListener("window_scroll",p),i.PageStore.removeListener("document_visibility_change",S),r&&(r.cancelAll(),c(null))})),[]),(0,s.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),a?t.length?s.createElement("div",{className:u.listOuter},_(),s.createElement("div",{ref:f,className:"items-list-wrap"},s.createElement("div",{ref:y,className:u.list},t.map(((t,a)=>s.createElement(l.c,h({key:a},(0,l.k)(e,t,a),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),b()):null:s.createElement(o.e,{className:u.listOuter})}c.propTypes={...r.ItemListAsync.propTypes},c.defaultProps={...r.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,a){"use strict";a.d(t,{R:function(){return n},z:function(){return r}});var s=a(8974);const i=function(){for(var e=arguments.length,t=new Array(e),a=0;a=n)&&Object.keys(s.O).every((function(e){return s.O[e](a[l])}))?a.splice(l--,1):(o=!1,n0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[a,i,n]},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=92,function(){var e={92:0};s.O.j=function(t){return 0===e[t]};var t=function(t,a){var i,n,r=a[0],o=a[1],l=a[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(i in o)s.o(o,i)&&(s.m[i]=o[i]);if(l)var h=l(s)}for(t&&t(a);di.createElement("div",{className:"empty-media empty-channel-media"},i.createElement("div",{className:"welcome-title"},"No shared media"),i.createElement("div",{className:"start-uploading"},"Media that others have shared with you will show up here."))))}class v extends _.Y{constructor(e,t){super(e,"string"==typeof t?t:"author-shared-with-me"),this.profilePageSlug="string"==typeof t?t:"author-shared-with-me",this.state={channelMediaCount:-1,author:l.ProfilePageStore.get("author-data"),uploadsPreviewItemsCount:0,title:this.props.title,query:l.ProfilePageStore.get("author-query"),requestUrl:null,hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0,filterArgs:"",availableTags:[],selectedTag:"all",selectedSort:"date_added_desc",selectedMedia:new Set,sharedUsers:[],sharedGroups:[],selectedSharingType:null,selectedSharingValue:null},this.authorDataLoad=this.authorDataLoad.bind(this),this.onAuthorPreviewItemsCountCallback=this.onAuthorPreviewItemsCountCallback.bind(this),this.getCountFunc=this.getCountFunc.bind(this),this.changeRequestQuery=this.changeRequestQuery.bind(this),this.onToggleFiltersClick=this.onToggleFiltersClick.bind(this),this.onToggleTagsClick=this.onToggleTagsClick.bind(this),this.onToggleSortingClick=this.onToggleSortingClick.bind(this),this.onToggleSharingClick=this.onToggleSharingClick.bind(this),this.onFiltersUpdate=this.onFiltersUpdate.bind(this),this.onTagSelect=this.onTagSelect.bind(this),this.onSortSelect=this.onSortSelect.bind(this),this.onSharingSelect=this.onSharingSelect.bind(this),this.onResponseDataLoaded=this.onResponseDataLoaded.bind(this),this.handleMediaSelection=this.handleMediaSelection.bind(this),l.ProfilePageStore.on("load-author-data",this.authorDataLoad)}componentDidMount(){d.ProfilePageActions.load_author_data()}authorDataLoad(){const e=l.ProfilePageStore.get("author-data");let t=this.state.requestUrl;if(e){const a=(0,y.isShareMediaDisabled)()?"&exclude_lti_embed=1":"";t=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+e.id+"&show=shared_with_me&q="+encodeURIComponent(this.state.query)+a+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+e.id+"&show=shared_with_me"+a+this.state.filterArgs}this.setState({author:e,requestUrl:t})}onAuthorPreviewItemsCountCallback(e){this.setState({uploadsPreviewItemsCount:e})}getCountFunc(e){this.setState({channelMediaCount:e},(()=>{if(this.state.query){let t="";t=e?1===e?'1 result for "'+this.state.query+'"':e+' results for "'+this.state.query+'"':'No results for "'+this.state.query+'"',this.setState({title:t})}}))}changeRequestQuery(e){if(!this.state.author)return;let t;t=e?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_with_me&q="+encodeURIComponent(e)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_with_me"+this.state.filterArgs;let a=this.state.title;""===e&&(a=this.props.title),this.setState({requestUrl:t,query:e,title:a})}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!0})}onToggleTagsClick(){this.setState({hiddenFilters:!0,hiddenTags:!this.state.hiddenTags,hiddenSorting:!0,hiddenSharing:!0})}onToggleSortingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!this.state.hiddenSorting,hiddenSharing:!0})}onToggleSharingClick(){this.setState({hiddenFilters:!0,hiddenTags:!0,hiddenSorting:!0,hiddenSharing:!this.state.hiddenSharing})}onTagSelect(e){this.setState({selectedTag:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:this.state.selectedSort,tag:e,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSortSelect(e){this.setState({selectedSort:e},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:e,tag:this.state.selectedTag,sharing_type:this.state.selectedSharingType,sharing_value:this.state.selectedSharingValue})}))}onSharingSelect(e,t){this.setState({selectedSharingType:e,selectedSharingValue:t},(()=>{this.onFiltersUpdate({media_type:this.state.filterArgs.match(/media_type=([^&]+)/)?.[1],upload_date:this.state.filterArgs.match(/upload_date=([^&]+)/)?.[1],duration:this.state.filterArgs.match(/duration=([^&]+)/)?.[1],publish_state:this.state.filterArgs.match(/publish_state=([^&]+)/)?.[1],sort_by:this.state.selectedSort,tag:this.state.selectedTag,sharing_type:e,sharing_value:t})}))}onFiltersUpdate(e){const t={media_type:null,upload_date:null,duration:null,publish_state:null,sort_by:null,ordering:null,t:null,shared_user:null,shared_group:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.duration&&"all"!==e.duration&&(t.duration=e.duration),e.publish_state&&"all"!==e.publish_state&&(t.publish_state=e.publish_state),e.sort_by){case"date_added_desc":break;case"date_added_asc":t.ordering="asc";break;case"alphabetically_asc":t.sort_by="title_asc";break;case"alphabetically_desc":t.sort_by="title_desc";break;case"plays_least":t.sort_by="views_asc";break;case"plays_most":t.sort_by="views_desc";break;case"likes_least":t.sort_by="likes_asc";break;case"likes_most":t.sort_by="likes_desc"}e.tag&&"all"!==e.tag&&(t.t=e.tag),"user"===e.sharing_type&&e.sharing_value?t.shared_user=e.sharing_value:"group"===e.sharing_type&&e.sharing_value&&(t.shared_group=e.sharing_value);const a=[];for(let e in t)null!==t[e]&&a.push(e+"="+t[e]);this.setState({filterArgs:a.length?"&"+a.join("&"):""},(function(){if(!this.state.author)return;let e;e=this.state.query?o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_with_me&q="+encodeURIComponent(this.state.query)+this.state.filterArgs:o.ApiUrlContext._currentValue.media+"?author="+this.state.author.id+"&show=shared_with_me"+this.state.filterArgs,this.setState({requestUrl:e})}))}onResponseDataLoaded(e){if(e&&e.tags){const t=e.tags.split(",").map((e=>e.trim())).filter((e=>e));this.setState({availableTags:t})}e&&void 0!==e.shared_users&&this.setState({sharedUsers:e.shared_users||[],sharedGroups:e.shared_groups||[]})}handleMediaSelection(e,t){const a=(0,y.inSelectMediaEmbedMode)();this.setState((s=>{const i=new Set;if(a){if(t&&(i.add(e),b.log("Selected media item:",e),window.parent!==window)){const t=`${window.location.origin}/embed?m=${e}`;window.parent.postMessage({type:"videoSelected",embedUrl:t,videoId:e},"*"),b.log("Sent postMessage to parent:",{embedUrl:t,videoId:e})}}else i.clear(),s.selectedMedia.forEach((e=>i.add(e))),t?i.add(e):i.delete(e);return{selectedMedia:i}}))}pageContent(){const e=l.ProfilePageStore.get("author-data"),t=e&&e.username===o.MemberContext._currentValue.username,a=(0,y.inSelectMediaEmbedMode)(),s=this.state.filterArgs&&(this.state.filterArgs.includes("media_type=")||this.state.filterArgs.includes("upload_date=")||this.state.filterArgs.includes("duration=")||this.state.filterArgs.includes("publish_state="));return[this.state.author?i.createElement(c.A,{key:"ProfilePagesHeader",author:this.state.author,type:"shared_with_me",onQueryChange:this.changeRequestQuery,onToggleFiltersClick:this.onToggleFiltersClick,onToggleTagsClick:this.onToggleTagsClick,onToggleSortingClick:this.onToggleSortingClick,onToggleSharingClick:this.onToggleSharingClick,hasActiveFilters:s,hasActiveTags:"all"!==this.state.selectedTag,hasActiveSort:"date_added_desc"!==this.state.selectedSort,hasActiveSharing:!!this.state.selectedSharingValue,hideChannelBanner:(0,y.inEmbeddedApp)()}):null,this.state.author?i.createElement(u.A,{key:"ProfilePagesContent"},i.createElement(h.MediaListWrapper,{title:(0,y.inEmbeddedApp)()?void 0:this.state.title,className:"items-list-ver",style:(0,y.inEmbeddedApp)()?{marginTop:"24px"}:void 0},i.createElement(m.F,{hidden:this.state.hiddenFilters,tags:this.state.availableTags,onFiltersUpdate:this.onFiltersUpdate}),i.createElement(p.L,{hidden:this.state.hiddenTags,tags:this.state.availableTags,onTagSelect:this.onTagSelect}),i.createElement(f.s,{hidden:this.state.hiddenSorting,onSortSelect:this.onSortSelect}),i.createElement(S.W,{hidden:this.state.hiddenSharing,mode:"shared_with_me",sharedUsers:this.state.sharedUsers,sharedGroups:this.state.sharedGroups,onSharingSelect:this.onSharingSelect,selectedSharingType:this.state.selectedSharingType,selectedSharingValue:this.state.selectedSharingValue}),i.createElement(g.LazyLoadItemListAsync,{key:this.state.requestUrl,requestUrl:this.state.requestUrl,hideAuthor:!0,itemsCountCallback:this.state.requestUrl?this.getCountFunc:null,hideViews:!l.PageStore.get("config-media-item").displayViews,hideDate:!l.PageStore.get("config-media-item").displayPublishDate,canEdit:!1,onResponseDataLoaded:this.onResponseDataLoaded,showSelection:a,hasAnySelection:this.state.selectedMedia.size>0,selectedMedia:this.state.selectedMedia,onMediaSelection:this.handleMediaSelection}),t&&0===this.state.channelMediaCount&&!this.state.query?i.createElement(w,{name:this.state.author.name}):null)):null]}}v.propTypes={title:r().string.isRequired},v.defaultProps={title:"Shared with me"},(0,s.C)("page-profile-shared-with-me",v)},977:function(e,t,a){"use strict";a.d(t,{A:function(){return i}});var s=a(7143);function i(e,t){return s.register(e[t].bind(e)),e}},1702:function(e,t,a){"use strict";a.d(t,{R:function(){return i},e:function(){return n}});var s=a(6403);const i=function(e,t,a){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>=0?null:(0,s.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(a||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var i},n=function(e,t,a){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>0?null:(0,s.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(a||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var i}},1936:function(e,t,a){"use strict";a.d(t,{PageHeader:function(){return s.z},PageMain:function(){return i.P},PageSidebar:function(){return n.E}});var s=a(1254),i=a(3212),n=a(795);a(1470)},4853:function(e,t,a){"use strict";a.r(t),a.d(t,{useBulkActions:function(){return r}});var s=a(9471),i=a(6014),n=a(5742);function r(){const[e,t]=(0,s.useState)(new Set),[a,r]=(0,s.useState)([]),[o,l]=(0,s.useState)(!1),[d,h]=(0,s.useState)(null),[c,u]=(0,s.useState)(""),[g,m]=(0,s.useState)(0),[p,S]=(0,s.useState)(""),[f,y]=(0,s.useState)(!1),[_,b]=(0,s.useState)("success"),[w,v]=(0,s.useState)(!1),[C,T]=(0,s.useState)(null),[k,A]=(0,s.useState)(!1),[M,P]=(0,s.useState)(!1),[E,F]=(0,s.useState)(!1),[U,O]=(0,s.useState)(!1),[q,R]=(0,s.useState)(!1),[j,I]=(0,s.useState)(!1),[L,x]=(0,s.useState)(!1);(0,s.useEffect)((()=>{(0,n.inEmbeddedApp)()&&fetch("/api/v1/categories/contributor?lms_courses_only=true").then((e=>e.ok?e.json():null)).then((e=>{if(!e)return;const t=e.results||e;x(Array.isArray(t)&&t.length>0)})).catch((()=>{}))}),[]);const D=()=>{let e=null;if(document.cookie&&""!==document.cookie){const t=document.cookie.split(";");for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:"success";S(e),y(!0),b(t),setTimeout((()=>{y(!1)}),5e3)},V=()=>{t(new Set)},$=()=>{t(new Set),m((e=>e+1))};return{selectedMedia:e,availableMediaIds:a,listKey:g,showConfirmModal:o,confirmMessage:c,notificationMessage:p,showNotification:f,notificationType:_,showPermissionModal:w,permissionType:C,showPlaylistModal:k,showChangeOwnerModal:M,showPublishStateModal:E,showCategoryModal:U,showTagModal:q,showCourseCleanupModal:j,hasContributorCourses:L,handleMediaSelection:(e,a)=>{t((t=>{const s=new Set(t);return a?s.add(e):s.delete(e),s}))},handleItemsUpdate:e=>{const t=e.map((e=>e.friendly_token||e.uid||e.id));r(t)},handleSelectAll:()=>{t(new Set(a))},handleDeselectAll:()=>{t(new Set)},handleBulkAction:t=>{const a=e.size;"course-cleanup"!==t?0!==a&&("delete-media"===t?(l(!0),h(t),u((0,i.translateString)("You are going to delete")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"enable-comments"===t?(l(!0),h(t),u((0,i.translateString)("You are going to enable comments to")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"disable-comments"===t?(l(!0),h(t),u((0,i.translateString)("You are going to disable comments to")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"delete-comments"===t?(l(!0),h(t),u((0,i.translateString)("You are going to delete all comments from")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"enable-download"===t?(l(!0),h(t),u((0,i.translateString)("You are going to enable download for")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"disable-download"===t?(l(!0),h(t),u((0,i.translateString)("You are going to disable download for")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"copy-media"===t?(l(!0),h(t),u((0,i.translateString)("You are going to copy")+` ${a} `+(0,i.translateString)("media, are you sure?"))):"add-remove-coviewers"===t?(v(!0),T("viewer")):"add-remove-coeditors"===t?(v(!0),T("editor")):"add-remove-coowners"===t?(v(!0),T("owner")):"add-remove-playlist"===t?A(!0):"change-owner"===t?P(!0):"publish-state"===t?F(!0):"add-remove-category"===t?O(!0):"add-remove-tags"===t&&R(!0)):I(!0)},handleConfirmCancel:()=>{l(!1),h(null),u("")},handleConfirmProceed:()=>{const t=d;l(!1),h(null),u(""),"delete-media"===t?(()=>{const t=Array.from(e),a=t.length;fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"delete_media",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to delete media");return e.json()})).then((e=>{const t=1===a?(0,i.translateString)("The media was deleted successfully."):(0,i.translateString)("Successfully deleted")+` ${a} `+(0,i.translateString)("media.");N(t),$()})).catch((e=>{N((0,i.translateString)("Failed to delete media. Please try again."),"error"),$()}))})():"enable-comments"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"enable_comments",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to enable comments");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Enabled comments")),V()})).catch((e=>{N((0,i.translateString)("Failed to enable comments."),"error"),V()}))})():"disable-comments"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"disable_comments",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to disable comments");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Disabled comments")),V()})).catch((e=>{N((0,i.translateString)("Failed to disable comments."),"error"),V()}))})():"delete-comments"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"delete_comments",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to delete comments");return e.json()})).then((e=>{N((0,i.translateString)("Successfully deleted comments")),V()})).catch((e=>{N((0,i.translateString)("Failed to delete comments."),"error"),V()}))})():"enable-download"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"enable_download",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to enable download");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Enabled Download")),V()})).catch((e=>{N((0,i.translateString)("Failed to enable download."),"error"),V()}))})():"disable-download"===t?(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"disable_download",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to disable download");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Disabled Download")),V()})).catch((e=>{N((0,i.translateString)("Failed to disable download."),"error"),V()}))})():"copy-media"===t&&(()=>{const t=Array.from(e);fetch("/api/v1/media/user/bulk_actions",{method:"POST",headers:{"Content-Type":"application/json","X-CSRFToken":D()},body:JSON.stringify({action:"copy_media",media_ids:t})}).then((e=>{if(!e.ok)throw new Error("Failed to copy media");return e.json()})).then((e=>{N((0,i.translateString)("Successfully Copied")),$()})).catch((e=>{N((0,i.translateString)("Failed to copy media."),"error"),V()}))})()},handlePermissionModalCancel:()=>{v(!1),T(null)},handlePermissionModalSuccess:e=>{N(e),V(),v(!1),T(null)},handlePermissionModalError:e=>{N(e,"error"),v(!1),T(null)},handlePlaylistModalCancel:()=>{A(!1)},handlePlaylistModalSuccess:e=>{N(e),V(),A(!1)},handlePlaylistModalError:e=>{N(e,"error"),A(!1)},handleChangeOwnerModalCancel:()=>{P(!1)},handleChangeOwnerModalSuccess:e=>{N(e),$(),P(!1)},handleChangeOwnerModalError:e=>{N(e,"error"),P(!1)},handlePublishStateModalCancel:()=>{F(!1)},handlePublishStateModalSuccess:e=>{N(e),$(),F(!1)},handlePublishStateModalError:e=>{N(e,"error"),F(!1)},handleCategoryModalCancel:()=>{O(!1)},handleCategoryModalSuccess:e=>{N(e),V(),O(!1)},handleCategoryModalError:e=>{N(e,"error"),O(!1)},handleTagModalCancel:()=>{R(!1)},handleTagModalSuccess:e=>{N(e),V(),R(!1)},handleTagModalError:e=>{N(e,"error"),R(!1)},handleCourseCleanupModalCancel:()=>{I(!1)},handleCourseCleanupModalSuccess:e=>{N(e),$(),I(!1)},handleCourseCleanupModalError:e=>{N(e,"error"),I(!1)},getCsrfToken:D,clearSelection:V,clearSelectionAndRefresh:$}}},6403:function(e,t,a){"use strict";a.d(t,{g:function(){return r},m:function(){return n}});var s=a(8004);function i(e,t,a){let s;switch(a){case TypeError:case RangeError:case SyntaxError:case ReferenceError:s=new a(t[0]);break;default:s=new Error(t[0])}return e(s.message,...t.slice(1)),s}function n(e,t){return i(s.z,e,t)}function r(e,t){return i(s.R,e,t)}},7143:function(e,t,a){const s=a(2063).Dispatcher;e.exports=new s},7731:function(e,t,a){"use strict";a.d(t,{LazyLoadItemListAsync:function(){return c}});var s=a(9471),i=a(7460),n=a(5338),r=a(4685),o=a(2495),l=a(4433),d=a(5633);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t(c(new d.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,g,m,e.onResponseDataLoaded)),i.PageStore.on("window_scroll",p),i.PageStore.on("document_visibility_change",S),p(),()=>{i.PageStore.removeListener("window_scroll",p),i.PageStore.removeListener("document_visibility_change",S),r&&(r.cancelAll(),c(null))})),[]),(0,s.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),a?t.length?s.createElement("div",{className:u.listOuter},_(),s.createElement("div",{ref:f,className:"items-list-wrap"},s.createElement("div",{ref:y,className:u.list},t.map(((t,a)=>s.createElement(l.c,h({key:a},(0,l.k)(e,t,a),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),b()):null:s.createElement(o.e,{className:u.listOuter})}c.propTypes={...r.ItemListAsync.propTypes},c.defaultProps={...r.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,a){"use strict";a.d(t,{R:function(){return n},z:function(){return r}});var s=a(8974);const i=function(){for(var e=arguments.length,t=new Array(e),a=0;a=n)&&Object.keys(s.O).every((function(e){return s.O[e](a[l])}))?a.splice(l--,1):(o=!1,n0&&e[h-1][2]>n;h--)e[h]=e[h-1];e[h]=[a,i,n]},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.j=92,function(){var e={92:0};s.O.j=function(t){return 0===e[t]};var t=function(t,a){var i,n,r=a[0],o=a[1],l=a[2],d=0;if(r.some((function(t){return 0!==e[t]}))){for(i in o)s.o(o,i)&&(s.m[i]=o[i]);if(l)var h=l(s)}for(t&&t(a);d=0?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var i},o=function(e,t,n){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>0?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var i}},1936:function(e,t,n){"use strict";n.r(t),n.d(t,{PageHeader:function(){return r.z},PageMain:function(){return i.P},PageSidebar:function(){return o.E},PageSidebarContentOverlay:function(){return u.B}});var r=n(1254),i=n(3212),o=n(795),u=n(1470)},3746:function(e,t,n){"use strict";var r=n(2985),i=n(9664);(0,r.C)("page-recommended",i.RecommendedMediaPage)},4685:function(e,t,n){"use strict";n.d(t,{ItemListAsync:function(){return d}});var r=n(9471),i=n(8713),o=n.n(i),u=n(5338),a=n(4737),c=n(2495),s=n(4433),l=n(5633);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t(o(new l.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,p,g)),()=>{i&&(i.cancelAll(),o(null))})),[]),t?n.length?r.createElement("div",{className:a.listOuter},v(),r.createElement("div",{ref:d,className:"items-list-wrap"},r.createElement("div",{ref:m,className:a.list},n.map(((t,n)=>r.createElement(s.c,f({key:n},(0,s.k)(e,t,n))))))),y()):null:r.createElement(c.e,{className:a.listOuter})}d.propTypes={...a.k.propTypes,items:o().array,requestUrl:o().string.isRequired,firstItemRequestUrl:o().string},d.defaultProps={...a.k.defaultProps,requestUrl:null,firstItemRequestUrl:null,pageItems:24}},6403:function(e,t,n){"use strict";n.d(t,{g:function(){return u},m:function(){return o}});var r=n(8004);function i(e,t,n){let r;switch(n){case TypeError:case RangeError:case SyntaxError:case ReferenceError:r=new n(t[0]);break;default:r=new Error(t[0])}return e(r.message,...t.slice(1)),r}function o(e,t){return i(r.z,e,t)}function u(e,t){return i(r.R,e,t)}},7143:function(e,t,n){const r=n(2063).Dispatcher;e.exports=new r},7664:function(e,t,n){"use strict";n.r(t),n.d(t,{CircleIconButton:function(){return r.i},FilterOptions:function(){return i.P},FiltersToggleButton:function(){return o.I},MaterialIcon:function(){return u.Z},NavigationContentApp:function(){return a.V},NavigationMenuList:function(){return c.S},Notifications:function(){return s.$},NumericInputWithUnit:function(){return l._},PopupMain:function(){return f.AP},PopupTop:function(){return f.cp},SpinnerLoader:function(){return d.x},UserThumbnail:function(){return m.c}});var r=n(5321),i=n(7256),o=n(3135),u=n(2828),a=n(5305),c=n(7201),s=n(6089),l=n(3818),f=n(2901),d=n(6568),m=n(878)},7731:function(e,t,n){"use strict";n.r(t),n.d(t,{LazyLoadItemListAsync:function(){return f}});var r=n(9471),i=n(7460),o=n(5338),u=n(4685),a=n(2495),c=n(4433),s=n(5633);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t(f(new s.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,m,p,e.onResponseDataLoaded)),i.PageStore.on("window_scroll",g),i.PageStore.on("document_visibility_change",v),g(),()=>{i.PageStore.removeListener("window_scroll",g),i.PageStore.removeListener("document_visibility_change",v),u&&(u.cancelAll(),f(null))})),[]),(0,r.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),n?t.length?r.createElement("div",{className:d.listOuter},b(),r.createElement("div",{ref:y,className:"items-list-wrap"},r.createElement("div",{ref:h,className:d.list},t.map(((t,n)=>r.createElement(c.c,l({key:n},(0,c.k)(e,t,n),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),P()):null:r.createElement(a.e,{className:d.listOuter})}f.propTypes={...u.ItemListAsync.propTypes},f.defaultProps={...u.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,n){"use strict";n.d(t,{R:function(){return o},z:function(){return u}});var r=n(8974);const i=function(){for(var e=arguments.length,t=new Array(e),n=0;n=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[c])}))?n.splice(c--,1):(a=!1,o0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[n,i,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=260,function(){var e={260:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,u=n[0],a=n[1],c=n[2],s=0;if(u.some((function(t){return 0!==e[t]}))){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(c)var l=c(r)}for(t&&t(n);s=0?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var i},o=function(e,t,n){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>0?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var i}},1936:function(e,t,n){"use strict";n.r(t),n.d(t,{PageHeader:function(){return r.z},PageMain:function(){return i.P},PageSidebar:function(){return o.E},PageSidebarContentOverlay:function(){return u.B}});var r=n(1254),i=n(3212),o=n(795),u=n(1470)},3746:function(e,t,n){"use strict";var r=n(2985),i=n(9664);(0,r.C)("page-recommended",i.RecommendedMediaPage)},4685:function(e,t,n){"use strict";n.d(t,{ItemListAsync:function(){return d}});var r=n(9471),i=n(8713),o=n.n(i),u=n(5338),a=n(4737),c=n(2495),s=n(4433),l=n(5633);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t(o(new l.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,p,g)),()=>{i&&(i.cancelAll(),o(null))})),[]),t?n.length?r.createElement("div",{className:a.listOuter},v(),r.createElement("div",{ref:d,className:"items-list-wrap"},r.createElement("div",{ref:m,className:a.list},n.map(((t,n)=>r.createElement(s.c,f({key:n},(0,s.k)(e,t,n))))))),y()):null:r.createElement(c.e,{className:a.listOuter})}d.propTypes={...a.k.propTypes,items:o().array,requestUrl:o().string.isRequired,firstItemRequestUrl:o().string},d.defaultProps={...a.k.defaultProps,requestUrl:null,firstItemRequestUrl:null,pageItems:24}},6403:function(e,t,n){"use strict";n.d(t,{g:function(){return u},m:function(){return o}});var r=n(8004);function i(e,t,n){let r;switch(n){case TypeError:case RangeError:case SyntaxError:case ReferenceError:r=new n(t[0]);break;default:r=new Error(t[0])}return e(r.message,...t.slice(1)),r}function o(e,t){return i(r.z,e,t)}function u(e,t){return i(r.R,e,t)}},7143:function(e,t,n){const r=n(2063).Dispatcher;e.exports=new r},7664:function(e,t,n){"use strict";n.r(t),n.d(t,{CircleIconButton:function(){return r.i},FilterOptions:function(){return i.P},FiltersToggleButton:function(){return o.I},MaterialIcon:function(){return u.Z},NavigationContentApp:function(){return a.V},NavigationMenuList:function(){return c.S},Notifications:function(){return s.$},NumericInputWithUnit:function(){return l._},PopupMain:function(){return f.AP},PopupTop:function(){return f.cp},SpinnerLoader:function(){return d.x},UserThumbnail:function(){return m.c}});var r=n(5321),i=n(7256),o=n(3135),u=n(2828),a=n(5305),c=n(7201),s=n(6089),l=n(3818),f=n(2901),d=n(6568),m=n(878)},7731:function(e,t,n){"use strict";n.r(t),n.d(t,{LazyLoadItemListAsync:function(){return f}});var r=n(9471),i=n(7460),o=n(5338),u=n(4685),a=n(2495),c=n(4433),s=n(5633);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t(f(new s.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,m,p,e.onResponseDataLoaded)),i.PageStore.on("window_scroll",g),i.PageStore.on("document_visibility_change",v),g(),()=>{i.PageStore.removeListener("window_scroll",g),i.PageStore.removeListener("document_visibility_change",v),u&&(u.cancelAll(),f(null))})),[]),(0,r.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),n?t.length?r.createElement("div",{className:d.listOuter},b(),r.createElement("div",{ref:y,className:"items-list-wrap"},r.createElement("div",{ref:h,className:d.list},t.map(((t,n)=>r.createElement(c.c,l({key:n},(0,c.k)(e,t,n),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),P()):null:r.createElement(a.e,{className:d.listOuter})}f.propTypes={...u.ItemListAsync.propTypes},f.defaultProps={...u.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,n){"use strict";n.d(t,{R:function(){return o},z:function(){return u}});var r=n(8974);const i=function(){for(var e=arguments.length,t=new Array(e),n=0;n=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[c])}))?n.splice(c--,1):(a=!1,o0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[n,i,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=260,function(){var e={260:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,u=n[0],a=n[1],c=n[2],s=0;if(u.some((function(t){return 0!==e[t]}))){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(c)var l=c(r)}for(t&&t(n);s=0?null:(0,n.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(i||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var s},r=function(e,t,i){return void 0===e[t]||(s=e[t])===Math.trunc(s)&&s>0?null:(0,n.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(i||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var s}},1936:function(e,t,i){"use strict";i.d(t,{PageHeader:function(){return n.z},PageMain:function(){return s.P},PageSidebar:function(){return r.E}});var n=i(1254),s=i(3212),r=i(795);i(1470)},4685:function(e,t,i){"use strict";i.d(t,{ItemListAsync:function(){return m}});var n=i(9471),s=i(8713),r=i.n(s),a=i(5338),l=i(4737),o=i(2495),c=i(4433),u=i(5633);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t(r(new u.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,p,h)),()=>{s&&(s.cancelAll(),r(null))})),[]),t?i.length?n.createElement("div",{className:l.listOuter},g(),n.createElement("div",{ref:m,className:"items-list-wrap"},n.createElement("div",{ref:f,className:l.list},i.map(((t,i)=>n.createElement(c.c,d({key:i},(0,c.k)(e,t,i))))))),y()):null:n.createElement(o.e,{className:l.listOuter})}m.propTypes={...l.k.propTypes,items:r().array,requestUrl:r().string.isRequired,firstItemRequestUrl:r().string},m.defaultProps={...l.k.defaultProps,requestUrl:null,firstItemRequestUrl:null,pageItems:24}},5245:function(e,t,i){"use strict";var n=i(2985),s=i(9471),r=i(8790),a=i(7460),l=i(7664),o=i(2855),c=i(7731),u=i(5338);function d(e){return s.createElement("div",{className:"media-filter-option"},s.createElement("button",{className:e.selected?"active":"",onClick:function(){e.onSelect(e.id)}},e.label))}function m(e){const[t,i]=(0,s.useState)(e.default);function n(t){i(t),"function"==typeof e.onSelect&&e.onSelect(t)}return s.createElement("div",{className:"media-filter-option-list"},function(t){const i=[];let r=0;for(;r{if(r.current.tryToHide(),e.updateTriggerButtonOnChange){let t=0;for(;t{r.current.tryToHide(),"function"==typeof e.onSelect&&e.onSelect(i)}),[i]),s.createElement("div",{ref:t,className:"media-filter"},s.createElement(o,{contentRef:r},s.createElement("button",{className:"popup-trigger","aria-label":"Filter"},s.createElement(l.MaterialIcon,{type:"sort"}),s.createElement("span",{className:"filter-button-label"},s.createElement("span",{className:"filter-button-label-text"},e.label)))),s.createElement(a,{contentRef:r},s.createElement("div",{className:"main-options"},s.createElement(l.PopupMain,null,s.createElement(m,{items:e.options,default:i,onSelect:n})))))}const h=[{id:"all",label:"All media types"},{id:"video",label:"Video"},{id:"audio",label:"Audio"},{id:"image",label:"Images"},{id:"pdf",label:"Pdf"}],g=[{id:"date_added_desc",label:"Upload date (newest)"},{id:"date_added_asc",label:"Upload date (oldest)"},{id:"most_views",label:"View count"},{id:"most_likes",label:"Like count"}];function y(e){const[t,i]=(0,s.useState)("all"),[n,r]=(0,s.useState)("date_added_desc"),[a,l]=(0,s.useState)({sort_by:null,ordering:null,media_type:null});function o(){const e={...a,media_type:null,sort_by:null,ordering:null};switch(t){case"video":e.media_type="video";break;case"audio":e.media_type="audio";break;case"image":e.media_type="image";break;case"pdf":e.media_type="pdf"}switch(n){case"most_views":e.sort_by="views",e.ordering=null;break;case"most_likes":e.sort_by="likes",e.ordering=null;break;case"date_added_asc":e.sort_by=null,e.ordering="asc"}l(e)}return(0,s.useEffect)((()=>{o()}),[t,n]),(0,s.useEffect)((()=>{"function"==typeof e.onFiltersUpdate&&e.onFiltersUpdate(a)}),[a]),(0,s.useEffect)((()=>{o()}),[]),s.createElement("div",{className:"media-filters-row"},s.createElement("div",{className:"media-filters-row-inner"},s.createElement("div",{className:"media-type-filters"},s.createElement(f,{label:h[0].label,default:h[0].id,options:h,onSelect:function(e){i(e)},updateTriggerButtonOnChange:!0,hideOptionOnSelect:!0})),s.createElement("div",{className:"media-filters-sort"},s.createElement(p,{label:"SORT BY",default:g[0].id,options:g,onSelect:function(e){r(e)},updateTriggerButtonOnChange:!1,hideOptionOnSelect:!1}))))}var v=i(8713),b=i.n(v);const _={media_type:[{id:"all",title:"All"},{id:"video",title:"Video"},{id:"audio",title:"Audio"},{id:"image",title:"Image"},{id:"pdf",title:"Pdf"}],upload_date:[{id:"all",title:"All"},{id:"today",title:"Today"},{id:"this_week",title:"This week"},{id:"this_month",title:"This month"},{id:"this_year",title:"This year"}],sort_by:[{id:"date_added_desc",title:"Upload date (newest)"},{id:"date_added_asc",title:"Upload date (oldest)"},{id:"most_views",title:"View count"},{id:"most_likes",title:"Like count"}]};function E(e){const[t,i]=(0,s.useState)(e.hidden),[n,r]=(0,s.useState)("all"),[o,c]=(0,s.useState)("all"),[u,d]=(0,s.useState)("date_added_desc"),m=(0,s.useRef)(null),f=(0,s.useRef)(null);function p(){t||(m.current.style.height=24+f.current.offsetHeight+"px")}function h(t){const i={media_type:n,upload_date:o,sort_by:u};switch(t.currentTarget.getAttribute("filter")){case"media_type":i.media_type=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(i),r(i.media_type);break;case"upload_date":i.upload_date=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(i),c(i.upload_date);break;case"sort_by":i.sort_by=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(i),d(i.sort_by)}}return(0,s.useEffect)((()=>{i(e.hidden),p()}),[e.hidden]),(0,s.useEffect)((()=>(a.PageStore.on("window_resize",p),()=>a.PageStore.removeListener("window_resize",p))),[]),s.createElement("div",{ref:m,className:"mi-filters-row"+(t?" hidden":"")},s.createElement("div",{ref:f,className:"mi-filters-row-inner"},s.createElement("div",{className:"mi-filter"},s.createElement("div",{className:"mi-filter-title"},"MEDIA TYPE"),s.createElement("div",{className:"mi-filter-options"},s.createElement(l.FilterOptions,{id:"media_type",options:_.media_type,selected:n,onSelect:h}))),s.createElement("div",{className:"mi-filter"},s.createElement("div",{className:"mi-filter-title"},"UPLOAD DATE"),s.createElement("div",{className:"mi-filter-options"},s.createElement(l.FilterOptions,{id:"upload_date",options:_.upload_date,selected:o,onSelect:h}))),s.createElement("div",{className:"mi-filter"},s.createElement("div",{className:"mi-filter-title"},"SORT BY"),s.createElement("div",{className:"mi-filter-options"},s.createElement(l.FilterOptions,{id:"sort_by",options:_.sort_by,selected:u,onSelect:h})))))}E.propTypes={hidden:b().bool},E.defaultProps={hidden:!1};var S=i(9479),w=i(9200);class k extends S.Y{constructor(e){super(e,"search-results"),this.state={validQuery:!1,requestUrl:null,filterArgs:"",resultsTitle:null,resultsCount:null,searchQuery:a.SearchFieldStore.get("search-query"),searchCategories:a.SearchFieldStore.get("search-categories"),searchTags:a.SearchFieldStore.get("search-tags"),hiddenFilters:!0},this.getCountFunc=this.getCountFunc.bind(this),this.updateRequestUrl=this.updateRequestUrl.bind(this),this.onFilterArgsUpdate=this.onFilterArgsUpdate.bind(this),this.onToggleFiltersClick=this.onToggleFiltersClick.bind(this),this.onFiltersUpdate=this.onFiltersUpdate.bind(this),this.didMount=!1,this.updateRequestUrl()}componentDidMount(){this.didMount=!0}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters})}onFiltersUpdate(e){const t={media_type:null,upload_date:null,sort_by:null,ordering:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.sort_by){case"most_views":t.sort_by="views";break;case"most_likes":t.sort_by="likes";break;case"date_added_asc":t.ordering="asc"}const i=[];for(let e in t)null!==t[e]&&i.push(e+"="+t[e]);this.setState({filterArgs:i.length?"&"+i.join("&"):""},(function(){this.updateRequestUrl()}))}updateRequestUrl(){const e=this.state.searchQuery||this.state.searchCategories||this.state.searchTags;let t=null;null!==this.state.resultsCount&&(e?this.state.searchCategories?(t=null===this.state.resultsCount||0===this.state.resultsCount?"No":this.state.resultsCount,t+=" "+(0,w.translateString)((0,w.inEmbeddedApp)()?"media in course":"media in category")+' "'+this.state.searchCategories+'"'):this.state.searchTags?(t=null===this.state.resultsCount||0===this.state.resultsCount?"No":this.state.resultsCount,t+=" "+(0,w.translateString)("media in tag")+' "'+this.state.searchTags+'"'):t=null===this.state.resultsCount||0===this.state.resultsCount?(0,w.translateString)("No results for")+' "'+this.state.searchQuery+'"':this.state.resultsCount+" result"+(1(d(new c.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,f,p,e.onResponseDataLoaded)),s.PageStore.on("window_scroll",h),s.PageStore.on("document_visibility_change",g),h(),()=>{s.PageStore.removeListener("window_scroll",h),s.PageStore.removeListener("document_visibility_change",g),a&&(a.cancelAll(),d(null))})),[]),(0,n.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),i?t.length?n.createElement("div",{className:m.listOuter},b(),n.createElement("div",{ref:y,className:"items-list-wrap"},n.createElement("div",{ref:v,className:m.list},t.map(((t,i)=>n.createElement(o.c,u({key:i},(0,o.k)(e,t,i),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),_()):null:n.createElement(l.e,{className:m.listOuter})}d.propTypes={...a.ItemListAsync.propTypes},d.defaultProps={...a.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,i){"use strict";i.d(t,{R:function(){return r},z:function(){return a}});var n=i(8974);const s=function(){for(var e=arguments.length,t=new Array(e),i=0;i=r)&&Object.keys(n.O).every((function(e){return n.O[e](i[o])}))?i.splice(o--,1):(l=!1,r0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[i,s,r]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=187,function(){var e={187:0};n.O.j=function(t){return 0===e[t]};var t=function(t,i){var s,r,a=i[0],l=i[1],o=i[2],c=0;if(a.some((function(t){return 0!==e[t]}))){for(s in l)n.o(l,s)&&(n.m[s]=l[s]);if(o)var u=o(n)}for(t&&t(i);c=0?null:(0,n.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(i||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var s},r=function(e,t,i){return void 0===e[t]||(s=e[t])===Math.trunc(s)&&s>0?null:(0,n.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(i||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var s}},1936:function(e,t,i){"use strict";i.d(t,{PageHeader:function(){return n.z},PageMain:function(){return s.P},PageSidebar:function(){return r.E}});var n=i(1254),s=i(3212),r=i(795);i(1470)},4685:function(e,t,i){"use strict";i.d(t,{ItemListAsync:function(){return m}});var n=i(9471),s=i(8713),r=i.n(s),a=i(5338),l=i(4737),o=i(2495),c=i(4433),u=i(5633);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t(r(new u.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,p,h)),()=>{s&&(s.cancelAll(),r(null))})),[]),t?i.length?n.createElement("div",{className:l.listOuter},g(),n.createElement("div",{ref:m,className:"items-list-wrap"},n.createElement("div",{ref:f,className:l.list},i.map(((t,i)=>n.createElement(c.c,d({key:i},(0,c.k)(e,t,i))))))),y()):null:n.createElement(o.e,{className:l.listOuter})}m.propTypes={...l.k.propTypes,items:r().array,requestUrl:r().string.isRequired,firstItemRequestUrl:r().string},m.defaultProps={...l.k.defaultProps,requestUrl:null,firstItemRequestUrl:null,pageItems:24}},5245:function(e,t,i){"use strict";var n=i(2985),s=i(9471),r=i(8790),a=i(7460),l=i(7664),o=i(2855),c=i(7731),u=i(5338);function d(e){return s.createElement("div",{className:"media-filter-option"},s.createElement("button",{className:e.selected?"active":"",onClick:function(){e.onSelect(e.id)}},e.label))}function m(e){const[t,i]=(0,s.useState)(e.default);function n(t){i(t),"function"==typeof e.onSelect&&e.onSelect(t)}return s.createElement("div",{className:"media-filter-option-list"},function(t){const i=[];let r=0;for(;r{if(r.current.tryToHide(),e.updateTriggerButtonOnChange){let t=0;for(;t{r.current.tryToHide(),"function"==typeof e.onSelect&&e.onSelect(i)}),[i]),s.createElement("div",{ref:t,className:"media-filter"},s.createElement(o,{contentRef:r},s.createElement("button",{className:"popup-trigger","aria-label":"Filter"},s.createElement(l.MaterialIcon,{type:"sort"}),s.createElement("span",{className:"filter-button-label"},s.createElement("span",{className:"filter-button-label-text"},e.label)))),s.createElement(a,{contentRef:r},s.createElement("div",{className:"main-options"},s.createElement(l.PopupMain,null,s.createElement(m,{items:e.options,default:i,onSelect:n})))))}const h=[{id:"all",label:"All media types"},{id:"video",label:"Video"},{id:"audio",label:"Audio"},{id:"image",label:"Images"},{id:"pdf",label:"Pdf"}],g=[{id:"date_added_desc",label:"Upload date (newest)"},{id:"date_added_asc",label:"Upload date (oldest)"},{id:"most_views",label:"View count"},{id:"most_likes",label:"Like count"}];function y(e){const[t,i]=(0,s.useState)("all"),[n,r]=(0,s.useState)("date_added_desc"),[a,l]=(0,s.useState)({sort_by:null,ordering:null,media_type:null});function o(){const e={...a,media_type:null,sort_by:null,ordering:null};switch(t){case"video":e.media_type="video";break;case"audio":e.media_type="audio";break;case"image":e.media_type="image";break;case"pdf":e.media_type="pdf"}switch(n){case"most_views":e.sort_by="views",e.ordering=null;break;case"most_likes":e.sort_by="likes",e.ordering=null;break;case"date_added_asc":e.sort_by=null,e.ordering="asc"}l(e)}return(0,s.useEffect)((()=>{o()}),[t,n]),(0,s.useEffect)((()=>{"function"==typeof e.onFiltersUpdate&&e.onFiltersUpdate(a)}),[a]),(0,s.useEffect)((()=>{o()}),[]),s.createElement("div",{className:"media-filters-row"},s.createElement("div",{className:"media-filters-row-inner"},s.createElement("div",{className:"media-type-filters"},s.createElement(f,{label:h[0].label,default:h[0].id,options:h,onSelect:function(e){i(e)},updateTriggerButtonOnChange:!0,hideOptionOnSelect:!0})),s.createElement("div",{className:"media-filters-sort"},s.createElement(p,{label:"SORT BY",default:g[0].id,options:g,onSelect:function(e){r(e)},updateTriggerButtonOnChange:!1,hideOptionOnSelect:!1}))))}var v=i(8713),b=i.n(v);const _={media_type:[{id:"all",title:"All"},{id:"video",title:"Video"},{id:"audio",title:"Audio"},{id:"image",title:"Image"},{id:"pdf",title:"Pdf"}],upload_date:[{id:"all",title:"All"},{id:"today",title:"Today"},{id:"this_week",title:"This week"},{id:"this_month",title:"This month"},{id:"this_year",title:"This year"}],sort_by:[{id:"date_added_desc",title:"Upload date (newest)"},{id:"date_added_asc",title:"Upload date (oldest)"},{id:"most_views",title:"View count"},{id:"most_likes",title:"Like count"}]};function E(e){const[t,i]=(0,s.useState)(e.hidden),[n,r]=(0,s.useState)("all"),[o,c]=(0,s.useState)("all"),[u,d]=(0,s.useState)("date_added_desc"),m=(0,s.useRef)(null),f=(0,s.useRef)(null);function p(){t||(m.current.style.height=24+f.current.offsetHeight+"px")}function h(t){const i={media_type:n,upload_date:o,sort_by:u};switch(t.currentTarget.getAttribute("filter")){case"media_type":i.media_type=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(i),r(i.media_type);break;case"upload_date":i.upload_date=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(i),c(i.upload_date);break;case"sort_by":i.sort_by=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(i),d(i.sort_by)}}return(0,s.useEffect)((()=>{i(e.hidden),p()}),[e.hidden]),(0,s.useEffect)((()=>(a.PageStore.on("window_resize",p),()=>a.PageStore.removeListener("window_resize",p))),[]),s.createElement("div",{ref:m,className:"mi-filters-row"+(t?" hidden":"")},s.createElement("div",{ref:f,className:"mi-filters-row-inner"},s.createElement("div",{className:"mi-filter"},s.createElement("div",{className:"mi-filter-title"},"MEDIA TYPE"),s.createElement("div",{className:"mi-filter-options"},s.createElement(l.FilterOptions,{id:"media_type",options:_.media_type,selected:n,onSelect:h}))),s.createElement("div",{className:"mi-filter"},s.createElement("div",{className:"mi-filter-title"},"UPLOAD DATE"),s.createElement("div",{className:"mi-filter-options"},s.createElement(l.FilterOptions,{id:"upload_date",options:_.upload_date,selected:o,onSelect:h}))),s.createElement("div",{className:"mi-filter"},s.createElement("div",{className:"mi-filter-title"},"SORT BY"),s.createElement("div",{className:"mi-filter-options"},s.createElement(l.FilterOptions,{id:"sort_by",options:_.sort_by,selected:u,onSelect:h})))))}E.propTypes={hidden:b().bool},E.defaultProps={hidden:!1};var S=i(9479),w=i(6014);class k extends S.Y{constructor(e){super(e,"search-results"),this.state={validQuery:!1,requestUrl:null,filterArgs:"",resultsTitle:null,resultsCount:null,searchQuery:a.SearchFieldStore.get("search-query"),searchCategories:a.SearchFieldStore.get("search-categories"),searchTags:a.SearchFieldStore.get("search-tags"),hiddenFilters:!0},this.getCountFunc=this.getCountFunc.bind(this),this.updateRequestUrl=this.updateRequestUrl.bind(this),this.onFilterArgsUpdate=this.onFilterArgsUpdate.bind(this),this.onToggleFiltersClick=this.onToggleFiltersClick.bind(this),this.onFiltersUpdate=this.onFiltersUpdate.bind(this),this.didMount=!1,this.updateRequestUrl()}componentDidMount(){this.didMount=!0}onToggleFiltersClick(){this.setState({hiddenFilters:!this.state.hiddenFilters})}onFiltersUpdate(e){const t={media_type:null,upload_date:null,sort_by:null,ordering:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.sort_by){case"most_views":t.sort_by="views";break;case"most_likes":t.sort_by="likes";break;case"date_added_asc":t.ordering="asc"}const i=[];for(let e in t)null!==t[e]&&i.push(e+"="+t[e]);this.setState({filterArgs:i.length?"&"+i.join("&"):""},(function(){this.updateRequestUrl()}))}updateRequestUrl(){const e=this.state.searchQuery||this.state.searchCategories||this.state.searchTags;let t=null;null!==this.state.resultsCount&&(e?this.state.searchCategories?(t=null===this.state.resultsCount||0===this.state.resultsCount?"No":this.state.resultsCount,t+=" "+(0,w.translateString)((0,w.inEmbeddedApp)()?"media in course":"media in category")+' "'+this.state.searchCategories+'"'):this.state.searchTags?(t=null===this.state.resultsCount||0===this.state.resultsCount?"No":this.state.resultsCount,t+=" "+(0,w.translateString)("media in tag")+' "'+this.state.searchTags+'"'):t=null===this.state.resultsCount||0===this.state.resultsCount?(0,w.translateString)("No results for")+' "'+this.state.searchQuery+'"':this.state.resultsCount+" result"+(1(d(new c.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,f,p,e.onResponseDataLoaded)),s.PageStore.on("window_scroll",h),s.PageStore.on("document_visibility_change",g),h(),()=>{s.PageStore.removeListener("window_scroll",h),s.PageStore.removeListener("document_visibility_change",g),a&&(a.cancelAll(),d(null))})),[]),(0,n.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),i?t.length?n.createElement("div",{className:m.listOuter},b(),n.createElement("div",{ref:y,className:"items-list-wrap"},n.createElement("div",{ref:v,className:m.list},t.map(((t,i)=>n.createElement(o.c,u({key:i},(0,o.k)(e,t,i),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),_()):null:n.createElement(l.e,{className:m.listOuter})}d.propTypes={...a.ItemListAsync.propTypes},d.defaultProps={...a.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,i){"use strict";i.d(t,{R:function(){return r},z:function(){return a}});var n=i(8974);const s=function(){for(var e=arguments.length,t=new Array(e),i=0;i=r)&&Object.keys(n.O).every((function(e){return n.O[e](i[o])}))?i.splice(o--,1):(l=!1,r0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[i,s,r]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=187,function(){var e={187:0};n.O.j=function(t){return 0===e[t]};var t=function(t,i){var s,r,a=i[0],l=i[1],o=i[2],c=0;if(a.some((function(t){return 0!==e[t]}))){for(s in l)n.o(l,s)&&(n.m[s]=l[s]);if(o)var u=o(n)}for(t&&t(i);c=0?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var i},o=function(e,t,n){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>0?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var i}},1936:function(e,t,n){"use strict";n.r(t),n.d(t,{PageHeader:function(){return r.z},PageMain:function(){return i.P},PageSidebar:function(){return o.E},PageSidebarContentOverlay:function(){return u.B}});var r=n(1254),i=n(3212),o=n(795),u=n(1470)},4685:function(e,t,n){"use strict";n.d(t,{ItemListAsync:function(){return d}});var r=n(9471),i=n(8713),o=n.n(i),u=n(5338),a=n(4737),c=n(2495),s=n(4433),l=n(5633);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t(o(new l.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,g,m)),()=>{i&&(i.cancelAll(),o(null))})),[]),t?n.length?r.createElement("div",{className:a.listOuter},v(),r.createElement("div",{ref:d,className:"items-list-wrap"},r.createElement("div",{ref:p,className:a.list},n.map(((t,n)=>r.createElement(s.c,f({key:n},(0,s.k)(e,t,n))))))),y()):null:r.createElement(c.e,{className:a.listOuter})}d.propTypes={...a.k.propTypes,items:o().array,requestUrl:o().string.isRequired,firstItemRequestUrl:o().string},d.defaultProps={...a.k.defaultProps,requestUrl:null,firstItemRequestUrl:null,pageItems:24}},6403:function(e,t,n){"use strict";n.d(t,{g:function(){return u},m:function(){return o}});var r=n(8004);function i(e,t,n){let r;switch(n){case TypeError:case RangeError:case SyntaxError:case ReferenceError:r=new n(t[0]);break;default:r=new Error(t[0])}return e(r.message,...t.slice(1)),r}function o(e,t){return i(r.z,e,t)}function u(e,t){return i(r.R,e,t)}},7128:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TagsPage=void 0;var i=r(n(9471)),o=n(8790),u=n(2855),a=n(7731),c=n(9287),s=n(9200);t.TagsPage=function(e){var t=e.id,n=void 0===t?"tags":t,r=e.title,l=void 0===r?(0,s.translateString)("Tags"):r;return i.default.createElement(c.Page,{id:n},i.default.createElement(o.ApiUrlConsumer,null,(function(e){return i.default.createElement(u.MediaListWrapper,{title:l,className:"items-list-ver"},i.default.createElement(a.LazyLoadItemListAsync,{singleLinkContent:!0,inTagsList:!0,requestUrl:e.archive.tags}))})))}},7143:function(e,t,n){const r=n(2063).Dispatcher;e.exports=new r},7664:function(e,t,n){"use strict";n.r(t),n.d(t,{CircleIconButton:function(){return r.i},FilterOptions:function(){return i.P},FiltersToggleButton:function(){return o.I},MaterialIcon:function(){return u.Z},NavigationContentApp:function(){return a.V},NavigationMenuList:function(){return c.S},Notifications:function(){return s.$},NumericInputWithUnit:function(){return l._},PopupMain:function(){return f.AP},PopupTop:function(){return f.cp},SpinnerLoader:function(){return d.x},UserThumbnail:function(){return p.c}});var r=n(5321),i=n(7256),o=n(3135),u=n(2828),a=n(5305),c=n(7201),s=n(6089),l=n(3818),f=n(2901),d=n(6568),p=n(878)},7680:function(e,t,n){"use strict";var r=n(2985),i=n(7128);(0,r.C)("page-tags",i.TagsPage)},7731:function(e,t,n){"use strict";n.r(t),n.d(t,{LazyLoadItemListAsync:function(){return f}});var r=n(9471),i=n(7460),o=n(5338),u=n(4685),a=n(2495),c=n(4433),s=n(5633);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t(f(new s.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,p,g,e.onResponseDataLoaded)),i.PageStore.on("window_scroll",m),i.PageStore.on("document_visibility_change",v),m(),()=>{i.PageStore.removeListener("window_scroll",m),i.PageStore.removeListener("document_visibility_change",v),u&&(u.cancelAll(),f(null))})),[]),(0,r.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),n?t.length?r.createElement("div",{className:d.listOuter},b(),r.createElement("div",{ref:y,className:"items-list-wrap"},r.createElement("div",{ref:h,className:d.list},t.map(((t,n)=>r.createElement(c.c,l({key:n},(0,c.k)(e,t,n),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),P()):null:r.createElement(a.e,{className:d.listOuter})}f.propTypes={...u.ItemListAsync.propTypes},f.defaultProps={...u.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,n){"use strict";n.d(t,{R:function(){return o},z:function(){return u}});var r=n(8974);const i=function(){for(var e=arguments.length,t=new Array(e),n=0;n=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[c])}))?n.splice(c--,1):(a=!1,o0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[n,i,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=192,function(){var e={192:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,u=n[0],a=n[1],c=n[2],s=0;if(u.some((function(t){return 0!==e[t]}))){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(c)var l=c(r)}for(t&&t(n);s=0?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer or zero` ("+e[t]+")."]);var i},o=function(e,t,n){return void 0===e[t]||(i=e[t])===Math.trunc(i)&&i>0?null:(0,r.m)(["Invalid prop `"+t+"` of type `"+typeof e[t]+"` supplied to `"+(n||"N/A")+"`, expected `positive integer` ("+e[t]+")."]);var i}},1936:function(e,t,n){"use strict";n.r(t),n.d(t,{PageHeader:function(){return r.z},PageMain:function(){return i.P},PageSidebar:function(){return o.E},PageSidebarContentOverlay:function(){return u.B}});var r=n(1254),i=n(3212),o=n(795),u=n(1470)},4685:function(e,t,n){"use strict";n.d(t,{ItemListAsync:function(){return d}});var r=n(9471),i=n(8713),o=n.n(i),u=n(5338),a=n(4737),c=n(2495),s=n(4433),l=n(5633);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t(o(new l.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,g,m)),()=>{i&&(i.cancelAll(),o(null))})),[]),t?n.length?r.createElement("div",{className:a.listOuter},v(),r.createElement("div",{ref:d,className:"items-list-wrap"},r.createElement("div",{ref:p,className:a.list},n.map(((t,n)=>r.createElement(s.c,f({key:n},(0,s.k)(e,t,n))))))),y()):null:r.createElement(c.e,{className:a.listOuter})}d.propTypes={...a.k.propTypes,items:o().array,requestUrl:o().string.isRequired,firstItemRequestUrl:o().string},d.defaultProps={...a.k.defaultProps,requestUrl:null,firstItemRequestUrl:null,pageItems:24}},6403:function(e,t,n){"use strict";n.d(t,{g:function(){return u},m:function(){return o}});var r=n(8004);function i(e,t,n){let r;switch(n){case TypeError:case RangeError:case SyntaxError:case ReferenceError:r=new n(t[0]);break;default:r=new Error(t[0])}return e(r.message,...t.slice(1)),r}function o(e,t){return i(r.z,e,t)}function u(e,t){return i(r.R,e,t)}},7128:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TagsPage=void 0;var i=r(n(9471)),o=n(8790),u=n(2855),a=n(7731),c=n(9287),s=n(6014);t.TagsPage=function(e){var t=e.id,n=void 0===t?"tags":t,r=e.title,l=void 0===r?(0,s.translateString)("Tags"):r;return i.default.createElement(c.Page,{id:n},i.default.createElement(o.ApiUrlConsumer,null,(function(e){return i.default.createElement(u.MediaListWrapper,{title:l,className:"items-list-ver"},i.default.createElement(a.LazyLoadItemListAsync,{singleLinkContent:!0,inTagsList:!0,requestUrl:e.archive.tags}))})))}},7143:function(e,t,n){const r=n(2063).Dispatcher;e.exports=new r},7664:function(e,t,n){"use strict";n.r(t),n.d(t,{CircleIconButton:function(){return r.i},FilterOptions:function(){return i.P},FiltersToggleButton:function(){return o.I},MaterialIcon:function(){return u.Z},NavigationContentApp:function(){return a.V},NavigationMenuList:function(){return c.S},Notifications:function(){return s.$},NumericInputWithUnit:function(){return l._},PopupMain:function(){return f.AP},PopupTop:function(){return f.cp},SpinnerLoader:function(){return d.x},UserThumbnail:function(){return p.c}});var r=n(5321),i=n(7256),o=n(3135),u=n(2828),a=n(5305),c=n(7201),s=n(6089),l=n(3818),f=n(2901),d=n(6568),p=n(878)},7680:function(e,t,n){"use strict";var r=n(2985),i=n(7128);(0,r.C)("page-tags",i.TagsPage)},7731:function(e,t,n){"use strict";n.r(t),n.d(t,{LazyLoadItemListAsync:function(){return f}});var r=n(9471),i=n(7460),o=n(5338),u=n(4685),a=n(2495),c=n(4433),s=n(5633);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t(f(new s.B(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,p,g,e.onResponseDataLoaded)),i.PageStore.on("window_scroll",m),i.PageStore.on("document_visibility_change",v),m(),()=>{i.PageStore.removeListener("window_scroll",m),i.PageStore.removeListener("document_visibility_change",v),u&&(u.cancelAll(),f(null))})),[]),(0,r.useEffect)((()=>{e.onItemsUpdate&&t.length>0&&e.onItemsUpdate(t)}),[t]),n?t.length?r.createElement("div",{className:d.listOuter},b(),r.createElement("div",{ref:y,className:"items-list-wrap"},r.createElement("div",{ref:h,className:d.list},t.map(((t,n)=>r.createElement(c.c,l({key:n},(0,c.k)(e,t,n),{showSelection:e.showSelection,hasAnySelection:e.hasAnySelection,isSelected:e.selectedMedia&&e.selectedMedia.has(t.friendly_token||t.uid||t.id),onSelectionChange:e.onMediaSelection,mediaId:t.friendly_token||t.uid||t.id})))))),P()):null:r.createElement(a.e,{className:d.listOuter})}f.propTypes={...u.ItemListAsync.propTypes},f.defaultProps={...u.ItemListAsync.defaultProps,pageItems:2}},8004:function(e,t,n){"use strict";n.d(t,{R:function(){return o},z:function(){return u}});var r=n(8974);const i=function(){for(var e=arguments.length,t=new Array(e),n=0;n=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[c])}))?n.splice(c--,1):(a=!1,o0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[n,i,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=192,function(){var e={192:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,u=n[0],a=n[1],c=n[2],s=0;if(u.some((function(t){return 0!==e[t]}))){for(i in a)r.o(a,i)&&(r.m[i]=a[i]);if(c)var l=c(r)}for(t&&t(n);sHi in sn?i5(sn,Hi,{enumerable:!0,configurable:!0,writable:!0,value:Oa}):sn[Hi]=Oa;var km=(sn,Hi,Oa)=>(s5(sn,typeof Hi!="symbol"?Hi+"":Hi,Oa),Oa);(function(){"use strict";var sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Oa(n){if(n.__esModule)return n;var A=n.default;if(typeof A=="function"){var t=function s(){return this instanceof s?Reflect.construct(A,arguments,this.constructor):A.apply(this,arguments)};t.prototype=A.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(s){var r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return n[s]}})}),t}var Bb={exports:{}},sc={},Rb={exports:{}},nc={exports:{}};/** +var s5=Object.defineProperty;var n5=(sn,Hi,Oa)=>Hi in sn?s5(sn,Hi,{enumerable:!0,configurable:!0,writable:!0,value:Oa}):sn[Hi]=Oa;var km=(sn,Hi,Oa)=>(n5(sn,typeof Hi!="symbol"?Hi+"":Hi,Oa),Oa);(function(){"use strict";var sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hi(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Oa(n){if(n.__esModule)return n;var A=n.default;if(typeof A=="function"){var t=function s(){return this instanceof s?Reflect.construct(A,arguments,this.constructor):A.apply(this,arguments)};t.prototype=A.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(s){var r=Object.getOwnPropertyDescriptor(n,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return n[s]}})}),t}var Bb={exports:{}},sc={},Rb={exports:{}},nc={exports:{}};/** * @license React * react.development.js * @@ -6,7 +6,7 @@ var i5=Object.defineProperty;var s5=(sn,Hi,Oa)=>Hi in sn?i5(sn,Hi,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */nc.exports;var Ub;function NL(){return Ub||(Ub=1,function(n,A){(function(){function t(L,G){Object.defineProperty(o.prototype,L,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",G[0],G[1])}})}function s(L){return L===null||typeof L!="object"?null:(L=Ks&&L[Ks]||L["@@iterator"],typeof L=="function"?L:null)}function r(L,G){L=(L=L.constructor)&&(L.displayName||L.name)||"ReactClass";var H=L+"."+G;gn[H]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",G,L),gn[H]=!0)}function o(L,G,H){this.props=L,this.context=G,this.refs=yn,this.updater=H||es}function u(){}function h(L,G,H){this.props=L,this.context=G,this.refs=yn,this.updater=H||es}function f(L){return""+L}function y(L){try{f(L);var G=!1}catch{G=!0}if(G){G=console;var H=G.error,sA=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return H.call(G,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",sA),f(L)}}function b(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===ne?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case oA:return"Fragment";case EA:return"Profiler";case kA:return"StrictMode";case te:return"Suspense";case As:return"SuspenseList";case di:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case se:return"Portal";case Me:return(L.displayName||"Context")+".Provider";case me:return(L._context.displayName||"Context")+".Consumer";case be:var G=L.render;return L=L.displayName,L||(L=G.displayName||G.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case Fe:return G=L.displayName||null,G!==null?G:b(L.type)||"Memo";case gt:G=L._payload,L=L._init;try{return b(L(G))}catch{}}return null}function x(L){if(L===oA)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===gt)return"<...>";try{var G=b(L);return G?"<"+G+">":"<...>"}catch{return"<...>"}}function D(){var L=dA.A;return L===null?null:L.getOwner()}function M(){return Error("react-stack-top-frame")}function I(L){if(ae.call(L,"key")){var G=Object.getOwnPropertyDescriptor(L,"key").get;if(G&&G.isReactWarning)return!1}return L.key!==void 0}function v(L,G){function H(){kt||(kt=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",G))}H.isReactWarning=!0,Object.defineProperty(L,"key",{get:H,configurable:!0})}function q(){var L=b(this.type);return Xt[L]||(Xt[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function O(L,G,H,sA,gA,UA,wA,vA){return H=UA.ref,L={$$typeof:IA,type:L,key:G,props:UA,_owner:gA},(H!==void 0?H:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:q}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:wA}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:vA}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function U(L,G){return G=O(L.type,G,void 0,void 0,L._owner,L.props,L._debugStack,L._debugTask),L._store&&(G._store.validated=L._store.validated),G}function Z(L){return typeof L=="object"&&L!==null&&L.$$typeof===IA}function J(L){var G={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(H){return G[H]})}function P(L,G){return typeof L=="object"&&L!==null&&L.key!=null?(y(L.key),J(""+L.key)):G.toString(36)}function rA(){}function _(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(rA,rA):(L.status="pending",L.then(function(G){L.status==="pending"&&(L.status="fulfilled",L.value=G)},function(G){L.status==="pending"&&(L.status="rejected",L.reason=G)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function hA(L,G,H,sA,gA){var UA=typeof L;(UA==="undefined"||UA==="boolean")&&(L=null);var wA=!1;if(L===null)wA=!0;else switch(UA){case"bigint":case"string":case"number":wA=!0;break;case"object":switch(L.$$typeof){case IA:case se:wA=!0;break;case gt:return wA=L._init,hA(wA(L._payload),G,H,sA,gA)}}if(wA){wA=L,gA=gA(wA);var vA=sA===""?"."+P(wA,0):sA;return OA(gA)?(H="",vA!=null&&(H=vA.replace(ye,"$&/")+"/"),hA(gA,G,H,"",function(JA){return JA})):gA!=null&&(Z(gA)&&(gA.key!=null&&(wA&&wA.key===gA.key||y(gA.key)),H=U(gA,H+(gA.key==null||wA&&wA.key===gA.key?"":(""+gA.key).replace(ye,"$&/")+"/")+vA),sA!==""&&wA!=null&&Z(wA)&&wA.key==null&&wA._store&&!wA._store.validated&&(H._store.validated=2),gA=H),G.push(gA)),1}if(wA=0,vA=sA===""?".":sA+":",OA(L))for(var RA=0;RA";if(typeof L=="object"&&L!==null&&L.$$typeof===gt)return"<...>";try{var G=b(L);return G?"<"+G+">":"<...>"}catch{return"<...>"}}function D(){var L=dA.A;return L===null?null:L.getOwner()}function M(){return Error("react-stack-top-frame")}function I(L){if(ae.call(L,"key")){var G=Object.getOwnPropertyDescriptor(L,"key").get;if(G&&G.isReactWarning)return!1}return L.key!==void 0}function v(L,G){function H(){kt||(kt=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",G))}H.isReactWarning=!0,Object.defineProperty(L,"key",{get:H,configurable:!0})}function q(){var L=b(this.type);return Xt[L]||(Xt[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function O(L,G,H,sA,fA,vA,CA,LA){return H=vA.ref,L={$$typeof:IA,type:L,key:G,props:vA,_owner:fA},(H!==void 0?H:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:q}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:CA}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:LA}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function U(L,G){return G=O(L.type,G,void 0,void 0,L._owner,L.props,L._debugStack,L._debugTask),L._store&&(G._store.validated=L._store.validated),G}function Z(L){return typeof L=="object"&&L!==null&&L.$$typeof===IA}function J(L){var G={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(H){return G[H]})}function P(L,G){return typeof L=="object"&&L!==null&&L.key!=null?(y(L.key),J(""+L.key)):G.toString(36)}function rA(){}function _(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(rA,rA):(L.status="pending",L.then(function(G){L.status==="pending"&&(L.status="fulfilled",L.value=G)},function(G){L.status==="pending"&&(L.status="rejected",L.reason=G)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function hA(L,G,H,sA,fA){var vA=typeof L;(vA==="undefined"||vA==="boolean")&&(L=null);var CA=!1;if(L===null)CA=!0;else switch(vA){case"bigint":case"string":case"number":CA=!0;break;case"object":switch(L.$$typeof){case IA:case se:CA=!0;break;case gt:return CA=L._init,hA(CA(L._payload),G,H,sA,fA)}}if(CA){CA=L,fA=fA(CA);var LA=sA===""?"."+P(CA,0):sA;return OA(fA)?(H="",LA!=null&&(H=LA.replace(ye,"$&/")+"/"),hA(fA,G,H,"",function(JA){return JA})):fA!=null&&(Z(fA)&&(fA.key!=null&&(CA&&CA.key===fA.key||y(fA.key)),H=U(fA,H+(fA.key==null||CA&&CA.key===fA.key?"":(""+fA.key).replace(ye,"$&/")+"/")+LA),sA!==""&&CA!=null&&Z(CA)&&CA.key==null&&CA._store&&!CA._store.validated&&(H._store.validated=2),fA=H),G.push(fA)),1}if(CA=0,LA=sA===""?".":sA+":",OA(L))for(var UA=0;UA import('./MyComponent')) @@ -18,7 +18,7 @@ Your code should look like: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app -See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),L}function MA(){}function SA(L){if(VA===null)try{var G=("require"+Math.random()).slice(0,7);VA=(n&&n[G]).call(n,"timers").setImmediate}catch{VA=function(sA){je===!1&&(je=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var gA=new MessageChannel;gA.port1.onmessage=sA,gA.port2.postMessage(void 0)}}return VA(L)}function NA(L){return 1 ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(RA,JA){gA=!0,wA.then(function(lt){if(ZA(G,H),H===0){try{yA(sA),SA(function(){return cA(lt,RA,JA)})}catch(qe){dA.thrownErrors.push(qe)}if(0 ...)"))}),dA.actQueue=null),0dA.recentlyCreatedOwnerStacks++;return O(L,gA,void 0,void 0,D(),sA,RA?Error("react-stack-top-frame"):Ot,RA?we(x(L)):Qe)},A.createRef=function(){var L={current:null};return Object.seal(L),L},A.forwardRef=function(L){L!=null&&L.$$typeof===Fe?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof L!="function"?console.error("forwardRef requires a render function but was given %s.",L===null?"null":typeof L):L.length!==0&&L.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",L.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),L!=null&&L.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var G={$$typeof:be,render:L},H;return Object.defineProperty(G,"displayName",{enumerable:!1,configurable:!0,get:function(){return H},set:function(sA){H=sA,L.name||L.displayName||(Object.defineProperty(L,"name",{value:sA}),L.displayName=sA)}}),G},A.isValidElement=Z,A.lazy=function(L){return{$$typeof:gt,_payload:{_status:-1,_result:L},_init:KA}},A.memo=function(L,G){L==null&&console.error("memo: The first argument must be a component. Instead received: %s",L===null?"null":typeof L),G={$$typeof:Fe,type:L,compare:G===void 0?null:G};var H;return Object.defineProperty(G,"displayName",{enumerable:!1,configurable:!0,get:function(){return H},set:function(sA){H=sA,L.name||L.displayName||(Object.defineProperty(L,"name",{value:sA}),L.displayName=sA)}}),G},A.startTransition=function(L){var G=dA.T,H={};dA.T=H,H._updatedFibers=new Set;try{var sA=L(),gA=dA.S;gA!==null&&gA(H,sA),typeof sA=="object"&&sA!==null&&typeof sA.then=="function"&&sA.then(MA,Be)}catch(UA){Be(UA)}finally{G===null&&H._updatedFibers&&(L=H._updatedFibers.size,H._updatedFibers.clear(),10"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var fA=new MessageChannel;fA.port1.onmessage=sA,fA.port2.postMessage(void 0)}}return VA(L)}function NA(L){return 1 ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(UA,JA){fA=!0,CA.then(function(lt){if(ZA(G,H),H===0){try{yA(sA),SA(function(){return cA(lt,UA,JA)})}catch(qe){dA.thrownErrors.push(qe)}if(0 ...)"))}),dA.actQueue=null),0dA.recentlyCreatedOwnerStacks++;return O(L,fA,void 0,void 0,D(),sA,UA?Error("react-stack-top-frame"):Ot,UA?we(x(L)):Qe)},A.createRef=function(){var L={current:null};return Object.seal(L),L},A.forwardRef=function(L){L!=null&&L.$$typeof===Fe?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof L!="function"?console.error("forwardRef requires a render function but was given %s.",L===null?"null":typeof L):L.length!==0&&L.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",L.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),L!=null&&L.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var G={$$typeof:be,render:L},H;return Object.defineProperty(G,"displayName",{enumerable:!1,configurable:!0,get:function(){return H},set:function(sA){H=sA,L.name||L.displayName||(Object.defineProperty(L,"name",{value:sA}),L.displayName=sA)}}),G},A.isValidElement=Z,A.lazy=function(L){return{$$typeof:gt,_payload:{_status:-1,_result:L},_init:KA}},A.memo=function(L,G){L==null&&console.error("memo: The first argument must be a component. Instead received: %s",L===null?"null":typeof L),G={$$typeof:Fe,type:L,compare:G===void 0?null:G};var H;return Object.defineProperty(G,"displayName",{enumerable:!1,configurable:!0,get:function(){return H},set:function(sA){H=sA,L.name||L.displayName||(Object.defineProperty(L,"name",{value:sA}),L.displayName=sA)}}),G},A.startTransition=function(L){var G=dA.T,H={};dA.T=H,H._updatedFibers=new Set;try{var sA=L(),fA=dA.S;fA!==null&&fA(H,sA),typeof sA=="object"&&sA!==null&&typeof sA.then=="function"&&sA.then(BA,Be)}catch(vA){Be(vA)}finally{G===null&&H._updatedFibers&&(L=H._updatedFibers.size,H._updatedFibers.clear(),10";if(typeof oA=="object"&&oA!==null&&oA.$$typeof===hA)return"<...>";try{var kA=n(oA);return kA?"<"+kA+">":"<...>"}catch{return"<...>"}}function r(){var oA=bA.A;return oA===null?null:oA.getOwner()}function o(){return Error("react-stack-top-frame")}function u(oA){if(MA.call(oA,"key")){var kA=Object.getOwnPropertyDescriptor(oA,"key").get;if(kA&&kA.isReactWarning)return!1}return oA.key!==void 0}function h(oA,kA){function EA(){ZA||(ZA=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",kA))}EA.isReactWarning=!0,Object.defineProperty(oA,"key",{get:EA,configurable:!0})}function f(){var oA=n(this.type);return cA[oA]||(cA[oA]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),oA=this.props.ref,oA!==void 0?oA:null}function y(oA,kA,EA,me,Me,be,te,As){return EA=be.ref,oA={$$typeof:M,type:oA,key:kA,props:be,_owner:Me},(EA!==void 0?EA:null)!==null?Object.defineProperty(oA,"ref",{enumerable:!1,get:f}):Object.defineProperty(oA,"ref",{enumerable:!1,value:null}),oA._store={},Object.defineProperty(oA._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(oA,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(oA,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(oA,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:As}),Object.freeze&&(Object.freeze(oA.props),Object.freeze(oA)),oA}function b(oA,kA,EA,me,Me,be,te,As){var Fe=kA.children;if(Fe!==void 0)if(me)if(SA(Fe)){for(me=0;me";if(typeof oA=="object"&&oA!==null&&oA.$$typeof===hA)return"<...>";try{var kA=n(oA);return kA?"<"+kA+">":"<...>"}catch{return"<...>"}}function r(){var oA=bA.A;return oA===null?null:oA.getOwner()}function o(){return Error("react-stack-top-frame")}function u(oA){if(BA.call(oA,"key")){var kA=Object.getOwnPropertyDescriptor(oA,"key").get;if(kA&&kA.isReactWarning)return!1}return oA.key!==void 0}function h(oA,kA){function EA(){ZA||(ZA=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",kA))}EA.isReactWarning=!0,Object.defineProperty(oA,"key",{get:EA,configurable:!0})}function f(){var oA=n(this.type);return cA[oA]||(cA[oA]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),oA=this.props.ref,oA!==void 0?oA:null}function y(oA,kA,EA,me,Me,be,te,As){return EA=be.ref,oA={$$typeof:M,type:oA,key:kA,props:be,_owner:Me},(EA!==void 0?EA:null)!==null?Object.defineProperty(oA,"ref",{enumerable:!1,get:f}):Object.defineProperty(oA,"ref",{enumerable:!1,value:null}),oA._store={},Object.defineProperty(oA._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(oA,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(oA,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(oA,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:As}),Object.freeze&&(Object.freeze(oA.props),Object.freeze(oA)),oA}function b(oA,kA,EA,me,Me,be,te,As){var Fe=kA.children;if(Fe!==void 0)if(me)if(SA(Fe)){for(me=0;me React keys must be passed directly to JSX without using spread: let props = %s; - <%s key={someKey} {...props} />`,me,Fe,gt,Fe),se[Fe+me]=!0)}if(Fe=null,EA!==void 0&&(t(EA),Fe=""+EA),u(kA)&&(t(kA.key),Fe=""+kA.key),"key"in kA){EA={};for(var di in kA)di!=="key"&&(EA[di]=kA[di])}else EA=kA;return Fe&&h(EA,typeof oA=="function"?oA.displayName||oA.name||"Unknown":oA),y(oA,Fe,be,Me,r(),EA,te,As)}function x(oA){typeof oA=="object"&&oA!==null&&oA.$$typeof===M&&oA._store&&(oA._store.validated=1)}var D=ke,M=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),rA=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),hA=Symbol.for("react.lazy"),uA=Symbol.for("react.activity"),KA=Symbol.for("react.client.reference"),bA=D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,MA=Object.prototype.hasOwnProperty,SA=Array.isArray,NA=console.createTask?console.createTask:function(){return null};D={"react-stack-bottom-frame":function(oA){return oA()}};var ZA,cA={},yA=D["react-stack-bottom-frame"].bind(D,o)(),IA=NA(s(o)),se={};sc.Fragment=v,sc.jsx=function(oA,kA,EA,me,Me){var be=1e4>bA.recentlyCreatedOwnerStacks++;return b(oA,kA,EA,!1,me,Me,be?Error("react-stack-top-frame"):yA,be?NA(s(oA)):IA)},sc.jsxs=function(oA,kA,EA,me,Me){var be=1e4>bA.recentlyCreatedOwnerStacks++;return b(oA,kA,EA,!0,me,Me,be?Error("react-stack-top-frame"):yA,be?NA(s(oA)):IA)}}()),sc}Bb.exports=FL();var Ge=Bb.exports,Nb={exports:{}},Om={exports:{}},jm={};/** + <%s key={someKey} {...props} />`,me,Fe,gt,Fe),se[Fe+me]=!0)}if(Fe=null,EA!==void 0&&(t(EA),Fe=""+EA),u(kA)&&(t(kA.key),Fe=""+kA.key),"key"in kA){EA={};for(var di in kA)di!=="key"&&(EA[di]=kA[di])}else EA=kA;return Fe&&h(EA,typeof oA=="function"?oA.displayName||oA.name||"Unknown":oA),y(oA,Fe,be,Me,r(),EA,te,As)}function x(oA){typeof oA=="object"&&oA!==null&&oA.$$typeof===M&&oA._store&&(oA._store.validated=1)}var D=ke,M=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),rA=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),hA=Symbol.for("react.lazy"),uA=Symbol.for("react.activity"),KA=Symbol.for("react.client.reference"),bA=D.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,BA=Object.prototype.hasOwnProperty,SA=Array.isArray,NA=console.createTask?console.createTask:function(){return null};D={"react-stack-bottom-frame":function(oA){return oA()}};var ZA,cA={},yA=D["react-stack-bottom-frame"].bind(D,o)(),IA=NA(s(o)),se={};sc.Fragment=v,sc.jsx=function(oA,kA,EA,me,Me){var be=1e4>bA.recentlyCreatedOwnerStacks++;return b(oA,kA,EA,!1,me,Me,be?Error("react-stack-top-frame"):yA,be?NA(s(oA)):IA)},sc.jsxs=function(oA,kA,EA,me,Me){var be=1e4>bA.recentlyCreatedOwnerStacks++;return b(oA,kA,EA,!0,me,Me,be?Error("react-stack-top-frame"):yA,be?NA(s(oA)):IA)}}()),sc}Bb.exports=FL();var Ge=Bb.exports,Nb={exports:{}},Om={exports:{}},jm={};/** * @license React * scheduler.development.js * @@ -39,7 +39,7 @@ React keys must be passed directly to JSX without using spread: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Fb;function QL(){return Fb||(Fb=1,function(n){(function(){function A(){if(P=!1,uA){var cA=n.unstable_now();MA=cA;var yA=!0;try{A:{Z=!1,J&&(J=!1,_(KA),KA=-1),U=!0;var IA=O;try{e:{for(u(cA),q=s(M);q!==null&&!(q.expirationTime>cA&&f());){var se=q.callback;if(typeof se=="function"){q.callback=null,O=q.priorityLevel;var oA=se(q.expirationTime<=cA);if(cA=n.unstable_now(),typeof oA=="function"){q.callback=oA,u(cA),yA=!0;break e}q===s(M)&&r(M),u(cA)}else r(M);q=s(M)}if(q!==null)yA=!0;else{var kA=s(I);kA!==null&&y(h,kA.startTime-cA),yA=!1}}break A}finally{q=null,O=IA,U=!1}yA=void 0}}finally{yA?SA():uA=!1}}}function t(cA,yA){var IA=cA.length;cA.push(yA);A:for(;0>>1,oA=cA[se];if(0>>1;seo(me,IA))Meo(be,me)?(cA[se]=be,cA[Me]=IA,se=Me):(cA[se]=me,cA[EA]=IA,se=EA);else if(Meo(be,IA))cA[se]=be,cA[Me]=IA,se=Me;else break A}}return yA}function o(cA,yA){var IA=cA.sortIndex-yA.sortIndex;return IA!==0?IA:cA.id-yA.id}function u(cA){for(var yA=s(I);yA!==null;){if(yA.callback===null)r(I);else if(yA.startTime<=cA)r(I),yA.sortIndex=yA.expirationTime,t(M,yA);else break;yA=s(I)}}function h(cA){if(J=!1,u(cA),!Z)if(s(M)!==null)Z=!0,uA||(uA=!0,SA());else{var yA=s(I);yA!==null&&y(h,yA.startTime-cA)}}function f(){return P?!0:!(n.unstable_now()-MAcA||125se?(cA.sortIndex=IA,t(I,cA),s(M)===null&&cA===s(I)&&(J?(_(KA),KA=-1):J=!0,y(h,IA-se))):(cA.sortIndex=oA,t(M,cA),Z||U||(Z=!0,uA||(uA=!0,SA()))),cA},n.unstable_shouldYield=f,n.unstable_wrapCallback=function(cA){var yA=O;return function(){var IA=O;O=yA;try{return cA.apply(this,arguments)}finally{O=IA}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()}(jm)),jm}var Qb;function qL(){return Qb||(Qb=1,Om.exports=QL()),Om.exports}var Km={exports:{}},oi={};/** + */var Fb;function QL(){return Fb||(Fb=1,function(n){(function(){function A(){if(P=!1,uA){var cA=n.unstable_now();BA=cA;var yA=!0;try{A:{Z=!1,J&&(J=!1,_(KA),KA=-1),U=!0;var IA=O;try{e:{for(u(cA),q=s(M);q!==null&&!(q.expirationTime>cA&&f());){var se=q.callback;if(typeof se=="function"){q.callback=null,O=q.priorityLevel;var oA=se(q.expirationTime<=cA);if(cA=n.unstable_now(),typeof oA=="function"){q.callback=oA,u(cA),yA=!0;break e}q===s(M)&&r(M),u(cA)}else r(M);q=s(M)}if(q!==null)yA=!0;else{var kA=s(I);kA!==null&&y(h,kA.startTime-cA),yA=!1}}break A}finally{q=null,O=IA,U=!1}yA=void 0}}finally{yA?SA():uA=!1}}}function t(cA,yA){var IA=cA.length;cA.push(yA);A:for(;0>>1,oA=cA[se];if(0>>1;seo(me,IA))Meo(be,me)?(cA[se]=be,cA[Me]=IA,se=Me):(cA[se]=me,cA[EA]=IA,se=EA);else if(Meo(be,IA))cA[se]=be,cA[Me]=IA,se=Me;else break A}}return yA}function o(cA,yA){var IA=cA.sortIndex-yA.sortIndex;return IA!==0?IA:cA.id-yA.id}function u(cA){for(var yA=s(I);yA!==null;){if(yA.callback===null)r(I);else if(yA.startTime<=cA)r(I),yA.sortIndex=yA.expirationTime,t(M,yA);else break;yA=s(I)}}function h(cA){if(J=!1,u(cA),!Z)if(s(M)!==null)Z=!0,uA||(uA=!0,SA());else{var yA=s(I);yA!==null&&y(h,yA.startTime-cA)}}function f(){return P?!0:!(n.unstable_now()-BAcA||125se?(cA.sortIndex=IA,t(I,cA),s(M)===null&&cA===s(I)&&(J?(_(KA),KA=-1):J=!0,y(h,IA-se))):(cA.sortIndex=oA,t(M,cA),Z||U||(Z=!0,uA||(uA=!0,SA()))),cA},n.unstable_shouldYield=f,n.unstable_wrapCallback=function(cA){var yA=O;return function(){var IA=O;O=yA;try{return cA.apply(this,arguments)}finally{O=IA}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()}(jm)),jm}var Qb;function qL(){return Qb||(Qb=1,Om.exports=QL()),Om.exports}var Km={exports:{}},oi={};/** * @license React * react-dom.development.js * @@ -59,7 +59,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ob;function jL(){return Ob||(Ob=1,function(){function n(e,i){for(e=e.memoizedState;e!==null&&0=i.length)return l;var c=i[a],p=si(e)?e.slice():ue({},e);return p[c]=A(e[c],i,a+1,l),p}function t(e,i,a){if(i.length!==a.length)console.warn("copyWithRename() expects paths of the same length");else{for(var l=0;lwa?console.error("Unexpected pop."):(i!==fT[wa]&&console.error("Unexpected Fiber popped."),e.current=pT[wa],pT[wa]=null,fT[wa]=null,wa--)}function MA(e,i,a){wa++,pT[wa]=e.current,fT[wa]=a,e.current=i}function SA(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}function NA(e,i){MA(Tr,i,e),MA(Hh,e,e),MA(yr,null,e);var a=i.nodeType;switch(a){case 9:case 11:a=a===9?"#document":"#fragment",i=(i=i.documentElement)&&(i=i.namespaceURI)?B2(i):Qa;break;default:if(a=i.tagName,i=i.namespaceURI)i=B2(i),i=R2(i,a);else switch(a){case"svg":i=tc;break;case"math":i=Rm;break;default:i=Qa}}a=a.toLowerCase(),a=Oi(null,a),a={context:i,ancestorInfo:a},bA(yr,e),MA(yr,a,e)}function ZA(e){bA(yr,e),bA(Hh,e),bA(Tr,e)}function cA(){return SA(yr.current)}function yA(e){e.memoizedState!==null&&MA(Gf,e,e);var i=SA(yr.current),a=e.type,l=R2(i.context,a);a=Oi(i.ancestorInfo,a),l={context:l,ancestorInfo:a},i!==l&&(MA(Hh,e,e),MA(yr,l,e))}function IA(e){Hh.current===e&&(bA(yr,e),bA(Hh,e)),Gf.current===e&&(bA(Gf,e),Ud._currentValue=Xo)}function se(e){return typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}function oA(e){try{return kA(e),!1}catch{return!0}}function kA(e){return""+e}function EA(e,i){if(oA(e))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",i,se(e)),kA(e)}function me(e,i){if(oA(e))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",i,se(e)),kA(e)}function Me(e){if(oA(e))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",se(e)),kA(e)}function be(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var i=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(i.isDisabled)return!0;if(!i.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{xu=i.inject(e),fi=i}catch(a){console.error("React instrumentation encountered an error: %s.",a)}return!!i.checkDCE}function te(e){if(typeof wQ=="function"&&EQ(e),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(xu,e)}catch(i){jn||(jn=!0,console.error("React instrumentation encountered an error: %s",i))}}function As(e){DA=e}function Fe(){DA!==null&&typeof DA.markCommitStopped=="function"&&DA.markCommitStopped()}function gt(e){DA!==null&&typeof DA.markComponentRenderStarted=="function"&&DA.markComponentRenderStarted(e)}function di(){DA!==null&&typeof DA.markComponentRenderStopped=="function"&&DA.markComponentRenderStopped()}function Ks(e){DA!==null&&typeof DA.markRenderStarted=="function"&&DA.markRenderStarted(e)}function gn(){DA!==null&&typeof DA.markRenderStopped=="function"&&DA.markRenderStopped()}function es(e,i){DA!==null&&typeof DA.markStateUpdateScheduled=="function"&&DA.markStateUpdateScheduled(e,i)}function ia(e){return e>>>=0,e===0?32:31-(DQ(e)/vQ|0)|0}function yn(e){if(e&1)return"SyncHydrationLane";if(e&2)return"Sync";if(e&4)return"InputContinuousHydration";if(e&8)return"InputContinuous";if(e&16)return"DefaultHydration";if(e&32)return"Default";if(e&128)return"TransitionHydration";if(e&4194048)return"Transition";if(e&62914560)return"Retry";if(e&67108864)return"SelectiveHydration";if(e&134217728)return"IdleHydration";if(e&268435456)return"Idle";if(e&536870912)return"Offscreen";if(e&1073741824)return"Deferred"}function fA(e){var i=e&42;if(i!==0)return i;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),e}}function BA(e,i,a){var l=e.pendingLanes;if(l===0)return 0;var c=0,p=e.suspendedLanes,C=e.pingedLanes;e=e.warmLanes;var E=l&134217727;return E!==0?(l=E&~p,l!==0?c=fA(l):(C&=E,C!==0?c=fA(C):a||(a=E&~e,a!==0&&(c=fA(a))))):(E=l&~p,E!==0?c=fA(E):C!==0?c=fA(C):a||(a=l&~e,a!==0&&(c=fA(a)))),c===0?0:i!==0&&i!==c&&!(i&p)&&(p=c&-c,a=i&-i,p>=a||p===32&&(a&4194048)!==0)?i:c}function OA(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function ne(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function dA(){var e=Zf;return Zf<<=1,!(Zf&4194048)&&(Zf=256),e}function ae(){var e=Hf;return Hf<<=1,!(Hf&62914560)&&(Hf=4194304),e}function we(e){for(var i=[],a=0;31>a;a++)i.push(e);return i}function kt(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _A(e,i,a,l,c,p){var C=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var E=e.entanglements,R=e.expirationTimes,F=e.hiddenUpdates;for(a=C&~a;0Xh&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function ge(e){if(CT===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);CT=i&&i[1]||"",pD=-1=i.length)return l;var c=i[a],p=si(e)?e.slice():ue({},e);return p[c]=A(e[c],i,a+1,l),p}function t(e,i,a){if(i.length!==a.length)console.warn("copyWithRename() expects paths of the same length");else{for(var l=0;lwa?console.error("Unexpected pop."):(i!==fT[wa]&&console.error("Unexpected Fiber popped."),e.current=pT[wa],pT[wa]=null,fT[wa]=null,wa--)}function BA(e,i,a){wa++,pT[wa]=e.current,fT[wa]=a,e.current=i}function SA(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}function NA(e,i){BA(Tr,i,e),BA(Zh,e,e),BA(yr,null,e);var a=i.nodeType;switch(a){case 9:case 11:a=a===9?"#document":"#fragment",i=(i=i.documentElement)&&(i=i.namespaceURI)?B2(i):Qa;break;default:if(a=i.tagName,i=i.namespaceURI)i=B2(i),i=R2(i,a);else switch(a){case"svg":i=tc;break;case"math":i=Rm;break;default:i=Qa}}a=a.toLowerCase(),a=Oi(null,a),a={context:i,ancestorInfo:a},bA(yr,e),BA(yr,a,e)}function ZA(e){bA(yr,e),bA(Zh,e),bA(Tr,e)}function cA(){return SA(yr.current)}function yA(e){e.memoizedState!==null&&BA(Gf,e,e);var i=SA(yr.current),a=e.type,l=R2(i.context,a);a=Oi(i.ancestorInfo,a),l={context:l,ancestorInfo:a},i!==l&&(BA(Zh,e,e),BA(yr,l,e))}function IA(e){Zh.current===e&&(bA(yr,e),bA(Zh,e)),Gf.current===e&&(bA(Gf,e),Rd._currentValue=Xo)}function se(e){return typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}function oA(e){try{return kA(e),!1}catch{return!0}}function kA(e){return""+e}function EA(e,i){if(oA(e))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",i,se(e)),kA(e)}function me(e,i){if(oA(e))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",i,se(e)),kA(e)}function Me(e){if(oA(e))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",se(e)),kA(e)}function be(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var i=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(i.isDisabled)return!0;if(!i.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{xu=i.inject(e),fi=i}catch(a){console.error("React instrumentation encountered an error: %s.",a)}return!!i.checkDCE}function te(e){if(typeof EQ=="function"&&DQ(e),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(xu,e)}catch(i){jn||(jn=!0,console.error("React instrumentation encountered an error: %s",i))}}function As(e){DA=e}function Fe(){DA!==null&&typeof DA.markCommitStopped=="function"&&DA.markCommitStopped()}function gt(e){DA!==null&&typeof DA.markComponentRenderStarted=="function"&&DA.markComponentRenderStarted(e)}function di(){DA!==null&&typeof DA.markComponentRenderStopped=="function"&&DA.markComponentRenderStopped()}function Ks(e){DA!==null&&typeof DA.markRenderStarted=="function"&&DA.markRenderStarted(e)}function gn(){DA!==null&&typeof DA.markRenderStopped=="function"&&DA.markRenderStopped()}function es(e,i){DA!==null&&typeof DA.markStateUpdateScheduled=="function"&&DA.markStateUpdateScheduled(e,i)}function ia(e){return e>>>=0,e===0?32:31-(vQ(e)/LQ|0)|0}function yn(e){if(e&1)return"SyncHydrationLane";if(e&2)return"Sync";if(e&4)return"InputContinuousHydration";if(e&8)return"InputContinuous";if(e&16)return"DefaultHydration";if(e&32)return"Default";if(e&128)return"TransitionHydration";if(e&4194048)return"Transition";if(e&62914560)return"Retry";if(e&67108864)return"SelectiveHydration";if(e&134217728)return"IdleHydration";if(e&268435456)return"Idle";if(e&536870912)return"Offscreen";if(e&1073741824)return"Deferred"}function mA(e){var i=e&42;if(i!==0)return i;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),e}}function RA(e,i,a){var l=e.pendingLanes;if(l===0)return 0;var c=0,p=e.suspendedLanes,C=e.pingedLanes;e=e.warmLanes;var E=l&134217727;return E!==0?(l=E&~p,l!==0?c=mA(l):(C&=E,C!==0?c=mA(C):a||(a=E&~e,a!==0&&(c=mA(a))))):(E=l&~p,E!==0?c=mA(E):C!==0?c=mA(C):a||(a=l&~e,a!==0&&(c=mA(a)))),c===0?0:i!==0&&i!==c&&!(i&p)&&(p=c&-c,a=i&-i,p>=a||p===32&&(a&4194048)!==0)?i:c}function OA(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function ne(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function dA(){var e=Zf;return Zf<<=1,!(Zf&4194048)&&(Zf=256),e}function ae(){var e=Hf;return Hf<<=1,!(Hf&62914560)&&(Hf=4194304),e}function we(e){for(var i=[],a=0;31>a;a++)i.push(e);return i}function kt(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _A(e,i,a,l,c,p){var C=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var E=e.entanglements,R=e.expirationTimes,F=e.hiddenUpdates;for(a=C&~a;0Jh&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function ge(e){if(CT===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);CT=i&&i[1]||"",pD=-1)":-1"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function xt(e){return e.replace(UQ,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ze(e,i){i.checked===void 0||i.defaultChecked===void 0||mD||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",Kt()||"A component",i.type),mD=!0),i.value===void 0||i.defaultValue===void 0||fD||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",Kt()||"A component",i.type),fD=!0)}function Ol(e,i,a,l,c,p,C,E){e.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?(EA(C,"type"),e.type=C):e.removeAttribute("type"),i!=null?C==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+_t(i)):e.value!==""+_t(i)&&(e.value=""+_t(i)):C!=="submit"&&C!=="reset"||e.removeAttribute("value"),i!=null?Gc(e,C,_t(i)):a!=null?Gc(e,C,_t(a)):l!=null&&e.removeAttribute("value"),c==null&&p!=null&&(e.defaultChecked=!!p),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?(EA(E,"name"),e.name=""+_t(E)):e.removeAttribute("name")}function _r(e,i,a,l,c,p,C,E){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(EA(p,"type"),e.type=p),i!=null||a!=null){if(!(p!=="submit"&&p!=="reset"||i!=null))return;a=a!=null?""+_t(a):"",i=i!=null?""+_t(i):a,E||i===e.value||(e.value=i),e.defaultValue=i}l=l??c,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=E?e.checked:!!l,e.defaultChecked=!!l,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(EA(C,"name"),e.name=C)}function Gc(e,i,a){i==="number"&&kl(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Vp(e,i){i.value==null&&(typeof i.children=="object"&&i.children!==null?oT.Children.forEach(i.children,function(a){a==null||typeof a=="string"||typeof a=="number"||typeof a=="bigint"||yD||(yD=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to