7301* Декодирует текст от символов7302* Например, ", <, > будут декодированы в их текстовые аналоги (", <, > и т.д.).7303* Важно! Не использовать полученную строку в уязвимых методах вставки (innerHtml)7304* @param {string} html7305* @returns7306*/7307function tcart__decodeHtml(html) {7308const tempDiv = document.createElement('div');7309tempDiv.innerHTML = html;7310return tempDiv.textContent;7311}7312
/** * Вызывает обновление для lazyload элементов. */function tcart__updateLazyload() { // TODO ST-2949_3: null / undefined (TS18047, TS18048, TS2531, TS2722, TS2454, TS2538) // @ts-expect-error ST-2949_3 if (window.lazy === 'y' || document.querySelector('#allrecords').getAttribute('data-tilda-lazy') === 'yes') { tcart__onFuncLoad('t_lazyload_update', function () { // TODO ST-2949_4: cannot find name / missing jQuery types (TS2304, TS2592) // @ts-expect-error ST-2949_4 t_lazyload_update(); }); }}function t706_onSuccessCallback() { var products = document.querySelector('.t706__cartwin-products'); var cartBottom = document.querySelector('.t706__cartwin-bottom'); var cartForm = document.querySelector('.t706 .t-form__inputsbox'); if (products) t706_slideUp(products, 10); if (cartBottom) t706_slideUp(cartBottom, 10); if (cartForm) { /* для мобильной корзины после сабмита заменяем блок "Сумма" на блок "Итого" */ // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) if (window.tcart_isMobile) { var totalAmount = cartForm.querySelector('.t706__cartwin-totalamount-wrap'); var prodamount = document.querySelector('.t706__cartpage-prodamount'); if (prodamount && totalAmount) prodamount.outerHTML = totalAmount.outerHTML; } t706_slideUp(cartForm, 700); } try { /*fix IOS11 cursor bug + general IOS background scroll*/ tcart__unlockScroll(); } catch (error) {}}// 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 t706_slideUp(target, duration) { if (!target) return; var animationDuration = duration; if (!animationDuration && animationDuration !== 0) animationDuration = 500; target.style.transitionProperty = 'height, margin, padding'; target.style.transitionDuration = animationDuration + 'ms'; target.style.boxSizing = 'border-box'; target.style.height = target.offsetHeight + 'px'; target.style.overflow = 'hidden'; target.style.height = '0'; target.style.paddingTop = '0'; target.style.paddingBottom = '0'; target.style.marginTop = '0'; target.style.marginBottom = '0'; setTimeout(function () { target.style.display = 'none'; target.style.height = ''; target.style.paddingTop = ''; target.style.paddingBottom = ''; target.style.marginTop = ''; target.style.marginBottom = ''; target.style.overflow = ''; target.style.transitionDuration = ''; target.style.transitionProperty = ''; }, duration);}// Функция временно продублирована из tilda-scrits для избежания проблем с кэшем// 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_triggerEvent(el, eventName) { var event; if (document.createEvent) { event = document.createEvent('HTMLEvents'); event.initEvent(eventName, true, false); // TODO ST-2949_1: missing properties on Window/DOM/data objects (TS2339, TS2551) // @ts-expect-error ST-2949_1 } else if (document.createEventObject) { // @ts-expect-error ST-2949_1 event = document.createEventObject(); event.eventType = eventName; } event.eventName = eventName; if (el.dispatchEvent) {