4201}42024203event.eventName = eventName;42044205if (el.dispatchEvent) {4206el.dispatchEvent(event);4207} else if (el.fireEvent) {4208el.fireEvent('on' + event.eventType, event);4209} else if (el[eventName]) {4210el[eventName]();4211} else if (el['on' + eventName]) {4212el['on' + eventName]();
}}function t_forms__processFormsInPopup(popup, form) { if (popup.style.backgroundColor) { const styleElement = document.createElement('style'); styleElement.className = 't-success-popup'; const cssRule = ` #tildaformsuccesspopup-new { background-color: ${popup.style.backgroundColor}; }`; styleElement.textContent = cssRule; document.head.appendChild(styleElement); } const rec = form.closest('.t-rec'); // если форма в попапе, скрываем его, после отправки формы let blockId = rec.getAttribute('data-parenttplid') || rec.getAttribute('data-record-type'); if (blockId === '121') { // если попап находится внутри alias-блока, выбираем атрибут с id внутри попапа const popupContainer = popup.querySelector('.t-popup__container'); blockId = popupContainer.getAttribute('data-popup-type') || '121'; } const closePopupFuncName = `t${blockId}_closePopup`; const recId = rec.id.replace('rec', ''); const closeFunction = window[closePopupFuncName]; if (typeof closeFunction === 'function') { closeFunction(recId); }}function t_forms__drawNewSuccessPopup() { return ` <div class="t-form-success-popup t-form-success-popup_new" style="display:none;" id="tildaformsuccesspopup-new" role="dialog" aria-modal="true" tabindex="-1" aria-label="Success" > <div class="t-form-success-popup__wrapper"> <button type="button" class="t-form-success-popup__close-icon" id="tildaformsuccesspopupclose-new" aria-label="Закрыть диалоговое окно"> <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none"> <path fill="#000" fill-rule="evenodd" d="M7 5.863 1.138 0 0 1.138 5.862 7 0 12.862 1.137 14 7 8.137 12.863 14 14 12.862 8.138 7 14 1.138 12.863 0 7.001 5.863Z" clip-rule="evenodd" opacity=".4"/> </svg> </button> <svg class="t-form-success-popup__content-icon" xmlns="http://www.w3.org/2000/svg" width="41" height="41" fill="none" viewBox="0 0 210 210"> <path class="t-form-success-popup__content-icon-background" d="M 86.0696 10.2777 C 97.7443 -0.973851 116.104 -0.973851 127.779 10.2777 L 127.779 10.2777 C 133.881 16.1585 142.136 19.1954 150.551 18.6547 L 150.551 18.6547 C 166.65 17.6203 180.714 29.5482 182.502 45.7521 L 182.502 45.7521 C 183.436 54.2214 187.829 61.9111 194.619 66.9636 L 194.619 66.9636 C 207.609 76.6302 210.798 94.9049 201.862 108.479 L 201.862 108.479 C 197.191 115.574 195.665 124.318 197.653 132.6 L 197.653 132.6 C 201.457 148.445 192.277 164.515 176.799 169.108 L 176.799 169.108 C 168.709 171.509 161.979 177.216 158.235 184.852 L 158.235 184.852 C 151.072 199.461 133.819 205.807 119.041 199.27 L 119.041 199.27 C 111.317 195.853 102.532 195.853 94.8075 199.27 L 94.8075 199.27 C 80.0294 205.807 62.7766 199.461 55.6135 184.852 L 55.6135 184.852 C 51.8695 177.216 45.1396 171.509 37.0495 169.108 L 37.0495 169.108 C 21.5714 164.515 12.3913 148.445 16.1948 132.6 L 16.1948 132.6 C 18.1828 124.318 16.6573 115.574 11.9867 108.479 L 11.9867 108.479 C 3.05084 94.9049 6.23902 76.6302 19.2295 66.9636 L 19.2295 66.9636 C 26.0194 61.9111 30.4119 54.2214 31.3462 45.7521 L 31.3462 45.7521 C 33.1339 29.5482 47.1984 17.6203 63.2976 18.6547 L 63.2976 18.6547 C 71.7122 19.1954 79.9676 16.1585 86.0696 10.2777 L 86.0696 10.2777 Z" fill="#30C546"> </path> <path class="t-form-success-popup__content-icon-check" d="M 66.7645 107.258 L 90.6617 129.843 L 143.235 80.157" stroke="white" stroke-width="14.7059" stroke-linecap="round" stroke-linejoin="round" fill="none" pathLength="1"> </path> </svg> <div class="t-form-success-popup__title t-title" id="tildaformsuccesspopuptitle-new"></div> <div class="t-form-success-popup__text t-text" id="tildaformsuccesspopuptext-new"></div> <a href="" class="t-form-success-popup__button t-btn t-form-success-popup_hidden" id="tildaformsuccesspopuplink-new"></a> <button type="button" class="t-form-success-popup__button t-btn t-form-success-popup_hidden" id="tildaformsuccesspopupbtn-new"></button> <div class="t-form-success-popup__info t-form-success-popup_hidden" id="tildaformsuccesspopupinfo-new"> <span class="t-form-success-popup__info-text t-text" id="tildaformsuccesspopupinfotext-new"></span> <span class="t-form-success-popup__info-timer t-text"> <span class="t-form-success-popup__info-digit" id="tildaformsuccesspopupinfodigit-new"></span> <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M9 0.6C7.33864 0.6 5.71458 1.09265 4.33321 2.01566C2.95184 2.93866 1.87519 4.25056 1.23941 5.78546C0.603636 7.32036 0.437288 9.00932 0.761404 10.6388C1.08552 12.2682 1.88554 13.7649 3.0603 14.9397C4.23506 16.1145 5.7318 16.9145 7.36124 17.2386C8.99068 17.5627 10.6796 17.3964 12.2145 16.7606C13.7494 16.1248 15.0613 15.0482 15.9843 13.6668C16.9073 12.2854 17.4 10.6614 17.4 9" stroke="black" stroke-width="1.2"/> </svg> </span> </div> </div> </div>`;}function t_forms__trapFocus(popup) { const focusableElements = popup.querySelectorAll( 'a, button, input:not([type="hidden"]):not(.js-form-spec-comments), select, textarea, embed, video, iframe, [tabindex="0"]'