{"version":3,"file":"FoldersLayer-C1LEQ3W-.js","sources":["../../../node_modules/@mui/icons-material/esm/Block.js","../../../node_modules/@mui/icons-material/esm/LiveTv.js","../../../frontend/src/Utils/getVideoProviderFromEmbed.ts","../../../frontend/src/Components/DesignSystem/VideoEmbed/VideoEmbed.tsx","../../../frontend/src/Components/Entities/FoldersLayer.tsx"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8\"\n}), 'Block');","\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M21 6h-7.59l3.29-3.29L16 2l-4 4-4-4-.71.71L10.59 6H3c-1.1 0-2 .89-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.11-.9-2-2-2m0 14H3V8h18zM9 10v8l7-4z\"\n}), 'LiveTv');","const getVideoProviderFromEmbed = (embed: any) => {\n if (embed.includes('player.vimeo')) {\n return 'vimeo';\n }\n\n return 'youtube';\n};\n\nexport default getVideoProviderFromEmbed;\n","import React, { useEffect, useState } from 'react';\nimport { Box, BoxProps, Button, Typography, Stack } from '@mui/material';\nimport { styled } from '@mui/material/styles';\nimport { Block as BlockIcon, LiveTv as LiveTvIcon } from '@mui/icons-material';\nimport { FormattedMessage } from 'react-intl';\n\nimport useCookieSettings from '../../../Hooks/useCookieSettings';\nimport getVideoProviderFromEmbed from '../../../Utils/getVideoProviderFromEmbed';\n\nconst RATIO_16_9 = 56.25;\n\ntype StyledContainerProps = T & BoxProps & { rounded: boolean };\n\nconst StyledContainer = styled>(Box, {\n shouldForwardProp: (prop: string) => prop !== 'rounded',\n})(({ theme: { palette, shape }, rounded }) => ({\n backgroundColor: palette.primary.main,\n color: palette.primary.contrastText,\n position: 'relative',\n paddingBottom: `${RATIO_16_9}%`,\n height: 0,\n textAlign: 'center',\n ...(rounded && { borderRadius: shape.borderRadius * 2 }),\n overflow: 'hidden',\n}));\n\nconst StyledIframe = styled>('iframe', {\n shouldForwardProp: (prop: string) => prop !== 'size',\n})(({ size }) => ({\n position: 'absolute',\n top: 0,\n left: 0,\n width: size,\n height: size,\n border: 0,\n}));\n\nfunction VideoEmbed({ title, src, size = '100%', rounded = false }: any) {\n const { settings, update } = useCookieSettings();\n const srcWithParams = new URL(src);\n const provider = getVideoProviderFromEmbed(src);\n const isCookieApproved = settings[provider];\n const [forcePlay, setForcePlay] = useState(false);\n const [showError, setShowError] = useState(false);\n\n const enableCookie = () => {\n update({ ...settings, [provider]: true });\n setForcePlay(true);\n };\n\n useEffect(() => {\n if (isCookieApproved) {\n setTimeout(() => {\n setShowError(true);\n }, 1000);\n }\n }, [showError, isCookieApproved]);\n\n if (forcePlay) {\n // Works at least for Youtube and Vimeo\n srcWithParams.searchParams.append('autoplay', '1');\n }\n\n return (\n \n \n {isCookieApproved ? (\n <>\n \n\n {showError && (\n <>\n \n \n \n )}\n \n ) : (\n <>\n \n\n \n \n \n \n \n )}\n \n \n );\n}\n\nexport default VideoEmbed;\n","import React from 'react';\n\nimport { Box, Grid2 as Grid } from '@mui/material';\nimport { PostTypes, PostVisibilities } from '../../Utils/Types';\n\nimport PostCard from '../DesignSystem/PostCard';\nimport usePostsQuery from '../../Hooks/usePostsQuery';\n\nexport default function FoldersLayer({ space, parentId }: any) {\n const homePageView = !parentId;\n const { posts } = usePostsQuery(parentId ? 'subfolder' : 'folders', {\n space,\n limit: 100, // should be enough??\n parentId,\n types: [PostTypes.FOLDER],\n extraParams: {\n filter: homePageView ? { has_parent: true } : {},\n },\n sort: '-dates',\n visibilities: [PostVisibilities.PUBLISHED],\n });\n\n if (!posts.length) {\n return null;\n }\n\n return (\n \n \n {posts.map((post: any) => (\n \n \n \n ))}\n \n \n );\n}\n"],"names":["BlockIcon","createSvgIcon","_jsx","LiveTvIcon","getVideoProviderFromEmbed","embed","includes","RATIO_16_9","StyledContainer","styled","Box","shouldForwardProp","prop","_ref","_ref$theme","theme","palette","shape","rounded","_objectSpread","backgroundColor","primary","main","color","contrastText","position","paddingBottom","concat","height","textAlign","borderRadius","overflow","StyledIframe","_ref2","size","top","left","width","border","VideoEmbed","_ref3","title","src","_ref3$size","_ref3$rounded","_useCookieSettings","useCookieSettings","settings","update","srcWithParams","URL","provider","isCookieApproved","_useState","useState","_useState2","_slicedToArray","forcePlay","setForcePlay","_useState3","_useState4","showError","setShowError","enableCookie","_defineProperty","useEffect","setTimeout","searchParams","append","React","createElement","px","Stack","spacing","sx","justifyContent","alignItems","display","mt","Fragment","toString","FormattedMessage","id","Typography","toUpperCase","Button","variant","onClick","FoldersLayer","space","parentId","homePageView","_usePostsQuery","usePostsQuery","limit","types","PostTypes","FOLDER","extraParams","filter","has_parent","sort","visibilities","PostVisibilities","PUBLISHED","posts","length","wordBreak","Grid","container","map","post","key","xs","sm","md","PostCard","entity","direction"],"mappings":"0SAIA,MAAAA,EAAeC,EAA2BC,EAAI,IAAC,OAAQ,CACrD,EAAG,wOACL,CAAC,EAAG,OAAO,ECFXC,EAAeF,EAA2BC,EAAI,IAAC,OAAQ,CACrD,EAAG,qJACL,CAAC,EAAG,QAAQ,ECNZ,IAAME,EAA4B,SAACC,EAAe,CAC5CA,OAAAA,EAAMC,SAAS,cAAc,EACxB,QAGF,SACT;6zDCGA,IAAMC,EAAa,MAIbC,GAAkBC,EAAkCC,EAAK,CAC7DC,kBAAmB,SAACC,EAAY,CAAA,OAAKA,IAAS,SAAA,CAChD,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