import { CSSGen } from '../services/css-gen/css-gen' ; import generateStylesJS from './generateStylesJS' ; const windowObj = window ; const customConfig = windowObj ?. __STYLED_WIND_CUSTOM_CONFIG__ || { } ; const config = generateStylesJS ( customConfig ) ; const cssGen = new CSSGen ( config ) ; export const getHydratedTemplateString = ( strings ) : any => { const sanitizedStyles = strings . map ( ( stringsPart ) => { return stringsPart . split ( ';' ) . map ( ( style ) => { if ( style . trim ( ) . startsWith ( '.' ) || style . trim ( ) . startsWith ( 'swind' ) ) { return cssGen . genCSS ( style . trim ( ) ) . trim ( ) . replace ( ';' , '' ) ; } return style ; } ) . join ( ';' ) ; } ) ; return sanitizedStyles ; } ;