{"version":3,"file":"index.ByxXi11l.js","sources":["../../../../../../../node_modules/@babylon/ui-kit-common/esm/components/others/text-html/views/mobile/styled.mjs","../../../../../../../node_modules/@babylon/ui-kit-common/esm/components/others/text-html/views/mobile/index.mjs"],"sourcesContent":["import { Button } from '@babylon/ui-kit-base/components/buttons/button';\nimport InnerMarkdownHTML from '@babylon/ui-kit-base/components/text/inner-markdown-HTML';\nimport Title from '@babylon/ui-kit-base/components/text/title';\nimport Modal from '@babylon/ui-kit-structures/components/others/modal';\nimport { ModalHeader, ModalHeaderText, ModalContent } from '@babylon/ui-kit-structures/components/others/modal/styled';\nimport { FlexMixin, FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport { Padding } from '@babylon/ui-kit-styles/common/mixins/logical.styled';\nimport { linearGradient, rgba } from 'polished';\nimport styled from 'styled-components';\n\nconst MobileTextHTML = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"MobileTextHTML\",\n componentId: \"sc-1a51f956-0\"\n})([\n \"\",\n \" \",\n \"{align-self:center;margin-top:16px;}\"\n], FlexMixin({\n direction: 'column'\n}), Button);\nconst MobileContent = /*#__PURE__*/ styled.div.withConfig({\n displayName: \"MobileContent\",\n componentId: \"sc-1a51f956-1\"\n})([\n \"position:relative;max-height:300px;overflow:hidden;&::after{\",\n \" background-repeat:repeat-x;content:'';position:absolute;bottom:0;left:0;right:0;height:72px;}h2{\",\n \" padding:5px 0;}\",\n \"\"\n], ({ theme })=>linearGradient({\n colorStops: [\n `${rgba(theme.colors.white.base, 0)} 0`,\n `${rgba(theme.colors.white.base, 0.4)} 40%`,\n `${rgba(theme.colors.white.base, 0.98)} 80%`\n ],\n toDirection: '180deg'\n }), FontMixin({\n size: 'base',\n weight: 'semiBold'\n}), Padding({\n x: '16px',\n y: '0'\n}));\nconst MobileTitle = /*#__PURE__*/ styled(Title).withConfig({\n displayName: \"MobileTitle\",\n componentId: \"sc-1a51f956-2\"\n})([\n \"&,p{color:\",\n \";\",\n \" margin-bottom:8px;\",\n \" text-align:left;}\"\n], ({ theme })=>theme.colors.text.dark, FontMixin({\n size: 'base',\n height: 'base',\n weight: 'medium'\n}), Padding({\n all: '0'\n}));\nconst MobileMarkdown = /*#__PURE__*/ styled(InnerMarkdownHTML).withConfig({\n displayName: \"MobileMarkdown\",\n componentId: \"sc-1a51f956-3\"\n})([\n \"color:\",\n \";margin-bottom:4px;\",\n \" strong{\",\n \"}ol{list-style:decimal;padding-left:20px;}\"\n], ({ theme })=>theme.colors.text.dark, FontMixin({\n size: 'medium',\n height: 'base',\n weight: 'light'\n}), FontMixin({\n weight: 'medium'\n}));\nconst MobileModal = /*#__PURE__*/ styled(Modal).withConfig({\n displayName: \"MobileModal\",\n componentId: \"sc-1a51f956-4\"\n})([\n \"\",\n \"{\",\n \" \",\n \"{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:86%;}}\",\n \"{\",\n \"}\"\n], ModalHeader, FlexMixin({\n justify: 'center'\n}), ModalHeaderText, ModalContent, Padding({\n x: '16px',\n y: '20px'\n}));\n\nexport { MobileContent, MobileMarkdown, MobileModal, MobileTextHTML, MobileTitle };\n","import { jsxs, Fragment, jsx } from 'react/jsx-runtime';\nimport { Button } from '@babylon/ui-kit-base/components/buttons/button';\nimport { InnerHTML } from '@babylon/ui-kit-base/components/text/inner-HTML';\nimport { Title } from '@babylon/ui-kit-base/components/text/title';\nimport { useRef, useEffect, Children } from 'react';\nimport { useBoolean } from 'usehooks-ts';\nimport { initLazy } from '../../utils/index.mjs';\nimport { MobileTitle, MobileMarkdown, MobileTextHTML, MobileContent, MobileModal } from './styled.mjs';\n\nconst MobileTextHTMLView = ({ config, title = false, items = [], hasNoMarkdown = false })=>{\n const { value: isVisible, toggle: toggleVisibility } = useBoolean();\n const inputRef = useRef(null);\n useEffect(()=>{\n if (inputRef) initLazy(inputRef);\n }, [\n items,\n inputRef\n ]);\n const renderedItems = Children.toArray(items.map(({ title, content })=>/*#__PURE__*/ jsxs(Fragment, {\n children: [\n title && /*#__PURE__*/ jsx(MobileTitle, {\n title: title\n }),\n hasNoMarkdown ? /*#__PURE__*/ jsx(InnerHTML, {\n content: content\n }) : /*#__PURE__*/ jsx(MobileMarkdown, {\n content: content\n })\n ]\n })));\n return /*#__PURE__*/ jsxs(MobileTextHTML, {\n \"data-testid\": \"TextHTML\",\n ref: inputRef,\n children: [\n title && /*#__PURE__*/ jsx(Title, {\n \"data-testid\": \"TextHTMLTitle\",\n title: title\n }),\n /*#__PURE__*/ jsx(MobileContent, {\n \"data-testid\": \"Content\",\n children: renderedItems\n }),\n /*#__PURE__*/ jsx(Button, {\n \"data-testid\": \"ShowMore\",\n onClick: toggleVisibility,\n variant: \"negative\",\n height: \"auto\",\n children: config?.literals?.viewMore\n }),\n /*#__PURE__*/ jsx(MobileModal, {\n content: renderedItems,\n header: config?.literals?.modalTitle,\n visible: isVisible,\n hide: toggleVisibility\n })\n ]\n });\n};\n\nexport { MobileTextHTMLView, MobileTextHTMLView as default };\n"],"names":["MobileTextHTML","styled","FlexMixin","Button","MobileContent","theme","linearGradient","rgba","FontMixin","Padding","MobileTitle","Title","MobileMarkdown","InnerMarkdownHTML","MobileModal","Modal","ModalHeader","ModalHeaderText","ModalContent","MobileTextHTMLView","config","title","items","hasNoMarkdown","isVisible","toggleVisibility","useBoolean","inputRef","useRef","useEffect","initLazy","renderedItems","Children","content","jsxs","Fragment","jsx","InnerHTML","_a","_b"],"mappings":"iMAUA,MAAMA,EAA+BC,EAAO,IAAI,WAAW,CACvD,YAAa,iBACb,YAAa,eACjB,CAAC,EAAE,CACC,GACA,IACA,sCACJ,EAAGC,EAAU,CACT,UAAW,QACf,CAAC,EAAGC,CAAM,EACJC,EAA8BH,EAAO,IAAI,WAAW,CACtD,YAAa,gBACb,YAAa,eACjB,CAAC,EAAE,CACC,+DACA,oGACA,mBACA,EACJ,EAAG,CAAC,CAAE,MAAAI,CAAO,IAAGC,EAAe,CACvB,WAAY,CACR,GAAGC,EAAKF,EAAM,OAAO,MAA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