4401'</span></a>';4402if (isListStyle) str += '</div>';4403}4404str += '</div>';4405return str;4406}44074408// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)4409// @ts-expect-error ST-2949_24410function t_catalog_get_productCard_link(link, product, isRelevantsShow, rec) {4411if (rec[0]) {4412
var isSnippet = document.getElementById('allrecords') !== document.querySelector('.t-catalog__product-snippet') && // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 document.getElementById('allrecords').contains(document.querySelector('.t-catalog__product-snippet')); if (isSnippet && link === 'popup') { return t_catalog_generateUrl(product); } } if (link === 'order') { return '#order'; } if (isRelevantsShow) { return product.buttonlink ? product.buttonlink : '#prodpopup'; } if (link === 'popup') { if (product.buttonlink) { var url = product.buttonlink; if (url.indexOf('//') === -1 && url.slice(0, 1) !== '/' && url.slice(0, 1) !== '#') { url = 'http://' + url; } return url; } else { return '#prodpopup'; } } return '#prodpopup';}// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_get_productCard_targetAttr(link, product) { if (link === 'popup' && product.buttonlink && product.buttontarget === '_blank') { return 'target="_blank"'; } return '';}/** * Создает HTML для видимого горизонтального разделителя между товарами в сетке * * @return {string} */function t_catalog_get_horizSeparator_html() { var str = '<div class="t-catalog__grid-separator"></div>'; return str;}// TODO ST-2949_2: implicit any on params, vars, this, and index access (TS7006, TS7005, TS7008, TS7034, TS2683, TS7053, TS7015)// @ts-expect-error ST-2949_2function t_catalog_unifyCardsWidth(recid) { var rec = document.getElementById('rec' + recid); if (!rec) return; if (window.getComputedStyle(rec).display === 'none') return; var wrapper = rec.querySelector('.t-catalog__card-list_style_list'); if (!wrapper) return; var items = wrapper.querySelectorAll('.js-product'); if (!items || !items.length) return; var cardClassList = items[0].classList; var hasFixedWidth = cardClassList.contains('t-catalog__card_fixed-width'); var hasUnderDescrClass = cardClassList.contains('t-catalog__card_under-description'); // ST-2522: у карточки из нового шаблона цена и кнопки лежат внутри textwrapper. // Старая вёрстка этой структуры не имеет, проверку hasUnderDescrClass оставляем до перепубликации. var hasPriceBtnUnderDescr = items[0].querySelector('.t-catalog__card__textwrapper .t-catalog__card__price-buttons'); var shouldSkipWidthUnification = hasFixedWidth || hasUnderDescrClass || hasPriceBtnUnderDescr; if (shouldSkipWidthUnification) { return; } var maxWidth = 0; var maxPriceWidth = 0; var maxButtonsWidth = 0; Array.prototype.forEach.call(items, function (item) { var col = item.querySelector('.t-catalog__card__price-buttons'); if (col) { if (col.classList.contains('t-catalog__card__price-buttons_in-row')) { var price = col.querySelector('.t-catalog__card__price-wrapper'); var buttons = col.querySelector('.t-catalog__card__btns-wrapper'); if (price) price.style.width = null;