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OAAS0B,KAAK/C,cACvBW,IAAAA,cAAC2G,EAAkB,CACjBvH,YAAagD,KAAKhB,KAAKV,OACvBrB,aAAc+C,KAAK/C,aACnBC,eAAgB8C,KAAK9C,eACrBC,gBAAiB6C,KAAKH,oBACtBzC,YAAa4C,KAAKjB,MAAM3B,YACxBC,MAAO2C,KAAKb,WAAWC,MAAMC,mBAMzC,I,4FAAC,CArNc,CAASzB,IAAAA,WAwN1B,GAAe4G,EAAAA,EAAAA,IAAmB/F,GC7N9BgG,EAAgB,IAAI,KAAmB,aAC3CA,EAAcC,SAAW,EACzBD,EAAcE,K","sources":["webpack://sonic/./js/feature/blog/blog-list/blog-list-pagination/blog-list-pagination.jsx","webpack://sonic/./js/feature/blog/blog-list/react-blog-list.jsx","webpack://sonic/./js/feature/blog/blog-list/component-blog-list.js"],"sourcesContent":["import React from 'react';\n\nconst BlogListPagination = ({ postsNumber, postsPerPage, setCurrentPage, onNextPageClick, currentPage, title }) => {\n\n const pageNumbers = [];\n const numberOfPages = Math.ceil(postsNumber / postsPerPage);\n\n for (let i = 1; i <= numberOfPages; i++) {\n pageNumbers.push(i);\n }\n\n return (\n
\n \n
\n );\n};\n\nexport default BlogListPagination;\n","import React from \"react\";\nimport { withReactBootstrap } from \"@demant/wdh-react-bootstrap\";\nimport BlogListPagination from \"./blog-list-pagination/blog-list-pagination.jsx\";\nimport { resolveImageSrc } from \"@demant/wdh\";\n\nconst DGS = window.DGS;\n\nclass BlogListApp extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n currentPage: 1,\n };\n\n this.list = this.props.settings.blogList;\n this.postsPerPage = 7;\n\n this.dictionary = {\n Blogs: {\n PaginationTitle: \"Page\",\n SocialMediaConfiguration: \"facebook, twitter, linkedin\",\n },\n };\n\n this.socialMediaShareLinks = {\n facebook: \"https://www.facebook.com/sharer/sharer.php?u=\",\n linkedin: \"https://www.linkedin.com/shareArticle?mini=true&url=\",\n twitter: \"http://twitter.com/share?url=\",\n };\n\n this.getDictionary();\n this.setCurrentPage = this.setCurrentPage.bind(this);\n this.handleNextPageClick = this.handleNextPageClick.bind(this);\n }\n\n componentDidMount() {\n this.props.$component[0].classList.add(\"loaded\");\n }\n\n getDictionary() {\n const dictionary = {\n Blogs: {\n PaginationTitle: \"Page\",\n SocialMediaConfiguration: \"facebook, twitter, linkedin\",\n },\n };\n const theLang = $(\"html\").attr(\"lang\");\n const that = this;\n DGS.Dictionary.getInstance().getTexts(\n dictionary,\n () => {\n that.dictionary = dictionary;\n },\n theLang\n );\n }\n\n getItemImage(item) {\n return { backgroundImage: `url(${resolveImageSrc(item.image)})` };\n }\n\n getLogo(index) {\n const bareLogoPath =\n \"/-/media/sonic/main/logos/sonic_logo_without_tagline.png\";\n const logoWithTaglinePath = \"/-/media/sonic/main/sonic_logo_160x58px.png\";\n const logoPath = index === 0 ? logoWithTaglinePath : bareLogoPath;\n return \"Sonic;\n }\n\n setHeightForImageContainer(element, item) {\n if (element) {\n const ratio = (item.image.height / item.image.width).toFixed(2);\n const containerWidth = element.getBoundingClientRect().width;\n const containerHeight = (containerWidth * ratio).toFixed(2);\n element.style.height = containerHeight + \"px\";\n }\n }\n\n setCurrentPage(page) {\n this.setState({ currentPage: page });\n }\n\n handleNextPageClick() {\n const currentPageIsLast =\n this.state.currentPage * this.postsPerPage >= this.list.length;\n if (!currentPageIsLast) {\n this.setState((prevState) => ({\n currentPage: prevState.currentPage + 1,\n }));\n }\n }\n\n getSocialMedia(postLink) {\n const configuration = this.dictionary.Blogs.SocialMediaConfiguration;\n const socialMediaItems = configuration.split(\", \");\n const items = [];\n socialMediaItems.map((socialMediaItem) => {\n const shareLink = this.socialMediaShareLinks[socialMediaItem] + postLink;\n const item = (\n \n );\n items.push(item);\n });\n return items;\n }\n\n handlePostClick(link) {\n window.open(link, \"_self\");\n }\n\n blockClick(e) {\n e.stopPropagation();\n }\n\n getPrimaryCategory(item) {\n const categories = item.link.dataset.categories;\n return categories.split(\";\")[0];\n }\n\n getAllCategories() {\n const links = document.querySelectorAll(\n \".blog-categories.component .blog-category > a\"\n );\n const categories = [];\n links.forEach((value, index) => {\n const category = links[index].innerText;\n if (!categories.includes(category) && category !== \"\") {\n categories.push(category);\n }\n });\n categories.shift();\n return categories;\n }\n\n setClassForCategory(item) {\n const category = this.getPrimaryCategory(item);\n const categories = this.getAllCategories();\n const index = categories.indexOf(category) + 1;\n return \"category-\" + index;\n }\n\n render() {\n const lastPost = this.state.currentPage * this.postsPerPage;\n const firstPost = lastPost - this.postsPerPage;\n const currentPosts = this.list.slice(firstPost, lastPost);\n return (\n \n
\n {currentPosts.map((item, index) => (\n {\n e.preventDefault();\n this.handlePostClick(item.link.href);\n }}\n >\n
\n {\n this.setHeightForImageContainer(el, item);\n }}\n style={this.getItemImage(item, index)}\n >\n this.blockClick(e)}\n >\n {this.getSocialMedia(item.link.href)}\n
\n
{this.getLogo(index)}
\n
\n
\n
\n {this.getPrimaryCategory(item) !== \"\" && (\n \n {this.getPrimaryCategory(item)}\n
\n )}\n
{item.date}
\n
\n {item.link.dataset.readingtime}\n
\n
\n

{item.title}

\n \n {item.newsLink}\n \n \n \n \n ))}\n {this.list.length > this.postsPerPage && (\n \n )}\n \n
\n );\n }\n}\n\nexport default withReactBootstrap(BlogListApp);\n","import { ComponentBootstrap } from '@demant/wdh-react-bootstrap';\nimport BlogListApp from './react-blog-list.jsx';\nvar ReactBlogList = new ComponentBootstrap('blog-list');\nReactBlogList.reactApp = BlogListApp;\nReactBlogList.run();"],"names":["_ref","postsNumber","postsPerPage","setCurrentPage","onNextPageClick","currentPage","title","pageNumbers","numberOfPages","Math","ceil","i","push","React","className","map","number","key","concat","href","onClick","e","preventDefault","length","DGS","window","BlogListApp","_React$Component","props","_this","_classCallCheck","_callSuper","state","list","settings","blogList","dictionary","Blogs","PaginationTitle","SocialMediaConfiguration","socialMediaShareLinks","facebook","linkedin","twitter","getDictionary","bind","handleNextPageClick","_inherits","value","this","$component","classList","add","theLang","$","attr","that","Dictionary","getInstance","getTexts","item","backgroundImage","resolveImageSrc","image","index","logoPath","src","alt","width","height","element","ratio","toFixed","containerHeight","getBoundingClientRect","style","page","setState","prevState","postLink","_this2","socialMediaItems","split","items","socialMediaItem","shareLink","target","link","open","stopPropagation","dataset","categories","links","document","querySelectorAll","forEach","category","innerText","includes","shift","getPrimaryCategory","getAllCategories","indexOf","_this3","lastPost","firstPost","currentPosts","slice","setClassForCategory","handlePostClick","ref","el","setHeightForImageContainer","getItemImage","blockClick","getSocialMedia","getLogo","date","readingtime","newsLink","BlogListPagination","withReactBootstrap","ReactBlogList","reactApp","run"],"sourceRoot":""}