1501function t_zeroForms__createPhoneInput(recid, elementObj, inputStyles, inputPreferences) {1502var maskType = elementObj.li_masktype;1503var input = document.createElement('input');1504if (!elementObj.li_title && !elementObj.li_subtitle) {1505input.ariaLabel = 'phone';1506} else {1507input.id = 'input_' + elementObj.lid;1508}1509t_zeroForms__appendMainSettingToField(input, inputPreferences, 'tel', '');1510if (maskType === 'a') {1511input.classList.add('js-phonemask-input');
} else if (elementObj.li_mask) input.classList.add('js-tilda-mask'); if (maskType === 'a') { var browserLangCode = window.t_zeroForms__browserLang === 'RU' ? '+7' : '+1'; input.placeholder = browserLangCode + '(000)000-0000'; input.setAttribute('data-phonemask-init', 'no'); input.setAttribute('data-phonemask-id', recid); input.setAttribute('data-phonemask-lid', elementObj.lid); if (elementObj.li_maskcountry) input.setAttribute('data-phonemask-maskcountry', elementObj.li_maskcountry); if (inputPreferences.secondaryClassName) input.classList.add(inputPreferences.secondaryClassName); if (inputPreferences.require) input.setAttribute('data-tilda-req', '1'); } else { t_zeroForms__appendAttributes(input, inputPreferences); input.setAttribute('data-tilda-rule', 'phone'); if (inputPreferences.mask) input.setAttribute('data-tilda-mask', inputPreferences.mask); } t_zeroForms__appendStylesToField(input, inputStyles); return input;}/* ============= contact method field ============= */// Разметка повторяет tpl_input_contact_method.tpl, логика поля находится в tilda-contact-method-1.0.js/** * @typedef {{ * type: string, * title: string, * hasPhone: boolean, * hasText: boolean, * placeholder?: string, * }} ContactMethod *//** * Настройки способов связи: * - hasPhone – есть поле для ввода телефона, * - hasText – есть текстовое поле. Если есть оба поля, способ связи гибридный (см. tilda-contact-method-1.0.js), * - placeholder – плейсхолдер текстового поля. Переводится скриптом tilda-contact-method после инициализации. * @returns {Record<string, Omit<ContactMethod, 'type'>>} */function t_zeroForms__getContactMethodsConfig() { return { phone: { title: 'Phone', hasPhone: true, hasText: false }, whatsapp: { title: 'WhatsApp', hasPhone: true, hasText: false }, viber: { title: 'Viber', hasPhone: true, hasText: false }, telegram: { title: 'Telegram', hasPhone: true, hasText: true, placeholder: 'Username or phone number' }, max_messenger: { title: 'Max', hasPhone: true, hasText: true, placeholder: 'Link or phone number' }, vk: { title: 'VK', hasPhone: false, hasText: true, placeholder: 'Username, ID or link' }, fb_messenger: { title: 'Messenger', hasPhone: false, hasText: true, placeholder: 'Username, ID or link' }, skype: { title: 'Skype', hasPhone: false, hasText: true, placeholder: 'Username, email or phone number' }, };}/** * Возвращает разметку иконки способа связи. Иконки взяты из tpl_socials_*.tpl * (iconshape="circle-filled-logo", размер 18px, цвета из tpl_socials_colors.tpl) * @param {string} type * @returns {string} */function t_zeroForms__getContactMethodIcon(type) { // prettier-ignore const icons = { phone: '<svg class="t-sociallinks__svg" role="presentation" width="18" height="18" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3733_932)"><mask id="mask0_3733_932" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path d="M0 0H100V100H0V0Z" fill="white"/></mask><g mask="url(#mask0_3733_932)"><path fill-rule="evenodd" clip-rule="evenodd" d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100ZM32.3668 30.3616C33.8958 28.835 34.6798 28.1875 35.1534 28.0601C35.715 27.909 36.2052 28.0405 36.7168 28.4797C37.1497 28.8512 38.2438 29.9713 38.9927 30.8096C41.1931 33.2729 43.8747 36.6359 44.2503 37.4031C44.3639 37.6353 44.375 37.701 44.3558 38.0323C44.3204 38.643 44.196 38.8343 43.3793 39.5344C42.0767 40.6509 40.0803 42.739 39.3824 43.7149C38.9257 44.3535 38.9126 44.7536 39.3248 45.483C39.675 46.1027 41.378 48.345 42.5783 49.7667C44.5875 52.1467 46.9159 54.3696 49.1773 56.0669C50.8579 57.3283 53.2214 58.7821 54.8035 59.5275C55.9343 60.0603 56.2878 60.0303 57.0122 59.3401C57.7069 58.6782 58.5246 57.6102 59.8946 55.5759C60.3408 54.9132 60.7739 54.3136 60.857 54.2434C61.1104 54.0293 61.3967 53.9282 61.8141 53.9055C62.0813 53.891 62.2608 53.9062 62.4057 53.9555C62.6843 54.0504 63.4107 54.5045 66.36 56.4276C67.7285 57.32 69.2454 58.3032 69.7309 58.6125C72.4818 60.3651 72.7871 60.6005 72.9291 61.0781C73.1185 61.7157 72.9605 62.1254 72.063 63.3233C70.9487 64.8107 69.0734 66.8197 67.674 68.0252C66.5388 69.0032 65.0797 69.9865 63.6409 70.743L63.0188 71.0701L62.389 71.0696C60.5532 71.0685 58.822 70.7024 56.1724 69.7552C49.967 67.5366 44.465 64.2895 39.647 60.0025C38.7431 59.1981 36.6429 57.0816 35.8606 56.1866C33.2537 53.2039 31.2905 50.2948 29.5948 46.9021C28.373 44.4575 27.2502 41.6203 27.0609 40.4995C26.7835 38.8572 27.4592 36.7086 28.9757 34.4108C29.8832 33.0359 30.8773 31.8488 32.3668 30.3616Z" fill="#000"/><path d="M32.3668 30 … vk: '<svg class="t-sociallinks__svg" role="presentation" width="18" height="18" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3733_948)"><path fill-rule="evenodd" clip-rule="evenodd" d="M50 100C77.614 100 100 77.614 100 50C100 22.386 77.614 0 50 0C22.386 0 0 22.386 0 50C0 77.614 22.386 100 50 100ZM25 34C25.406 53.488 35.15 65.2 52.233 65.2H53.201V54.05C59.479 54.675 64.225 59.266 66.131 65.2H75C72.564 56.33 66.162 51.427 62.164 49.553C66.162 47.242 71.783 41.62 73.126 34H65.068C63.319 40.184 58.136 45.805 53.201 46.336V34H45.144V55.611C40.147 54.362 33.838 48.304 33.556 34H25Z" fill="#0077ff"/><path d="M25 34C25.406 53.488 35.15 65.2 52.233 65.2H53.201V54.05C59.479 54.675 64.225 59.266 66.131 65.2H75C72.564 56.33 66.162 51.427 62.164 49.553C66.162 47.242 71.783 41.62 73.126 34H65.068C63.319 40.184 58.136 45.805 53.201 46.336V34H45.144V55.611C40.147 54.362 33.838 48.304 33.556 34H25Z" fill="#ffffff"/></g><defs><clipPath id="clip0_3733_948"><rect width="100" height="100" rx="50" fill="white"/></clipPath></defs></svg>', telegram: '<svg class="t-sociallinks__svg" role="presentation" width="18" height="18" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3733_946)"><path fill-rule="evenodd" clip-rule="evenodd" d="M50 100C77.614 100 100 77.614 100 50C100 22.386 77.614 0 50 0C22.386 0 0 22.386 0 50C0 77.614 22.386 100 50 100ZM71.977 31.944C72.363 27.564 67.737 29.368 67.737 29.368C64.3991 30.7501 60.9589 32.1532 57.481 33.5717C57.4007 33.6045 57.3203 33.6372 57.24 33.67C46.2 38.173 34.796 42.825 25.081 47.404C19.813 49.336 22.897 51.268 22.897 51.268L31.248 53.845C35.103 55.005 37.158 53.716 37.158 53.716L55.146 41.478C61.57 37.098 60.028 40.705 58.486 42.251L44.996 55.133C42.94 56.937 43.968 58.483 44.867 59.256C47.417 61.505 53.687 65.62 56.424 67.416C57.136 67.883 57.609 68.194 57.716 68.274C58.358 68.789 61.827 71.108 64.14 70.593C66.453 70.077 66.71 67.114 66.71 67.114L69.793 46.888C70.2539 43.385 70.7836 40.0174 71.2071 37.3245C71.2081 37.3183 71.209 37.3122 71.21 37.306C71.2119 37.2938 71.2138 37.2817 71.2157 37.2696C71.6129 34.7415 71.9153 32.8168 71.977 31.944Z" fill="#1d98dc"/><path d="M71.977 31.944C72.363 27.564 67.737 29.368 67.737 29.368C64.3991 30.7501 60.9589 32.1532 57.481 33.5717L57.24 33.67C46.2 38.173 34.796 42.825 25.081 47.404C19.813 49.336 22.897 51.268 22.897 51.268L31.248 53.845C35.103 55.005 37.158 53.716 37.158 53.716L55.146 41.478C61.57 37.098 60.028 40.705 58.486 42.251L44.996 55.133C42.94 56.937 43.968 58.483 44.867 59.256C47.417 61.505 53.687 65.62 56.424 67.416C57.136 67.883 57.609 68.194 57.716 68.274C58.358 68.789 61.827 71.108 64.14 70.593C66.453 70.077 66.71 67.114 66.71 67.114L69.793 46.888C70.2539 43.385 70.7836 40.0174 71.2071 37.3245L71.21 37.306L71.2157 37.2696C71.6129 34.7415 71.9153 32.8168 71.977 31.944Z" fill="#ffffff"/></g><defs><clipPath id="clip0_3733_946"><rect width="100" height="100" rx="50" fill="white"/></clipPath></defs></svg>', whatsapp: '<svg class="t-sociallinks__svg" role="presentation" width="18" height="18" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3733_942)"><path fill-rule="evenodd" clip-rule="evenodd" d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100ZM69.7626 28.9928C64.6172 23.841 57.7739 21.0027 50.4832 21C35.4616 21 23.2346 33.2252 23.2292 48.2522C23.2274 53.0557 24.4823 57.7446 26.8668 61.8769L23 76L37.4477 72.2105C41.4282 74.3822 45.9107 75.5262 50.4714 75.528H50.4823C65.5029 75.528 77.7299 63.301 77.7363 48.2749C77.7408 40.9915 74.9089 34.1446 69.7626 28.9928ZM62.9086 53.9588C62.2274 53.6178 58.8799 51.9708 58.2551 51.7435C57.6313 51.5161 57.1766 51.4024 56.7228 52.0845C56.269 52.7666 54.964 54.2998 54.5666 54.7545C54.1692 55.2092 53.7718 55.2656 53.0915 54.9246C52.9816 54.8695 52.8321 54.8047 52.648 54.7248C52.6456 54.7237 52.6433 54.7227 52.6409 54.7217C51.6819 54.3057 49.7905 53.4855 47.6151 51.5443C45.5907 49.7382 44.2239 47.5084 43.8265 46.8272C43.4291 46.1452 43.7837 45.7769 44.1248 45.4376C44.3288 45.2341 44.5632 44.9488 44.7975 44.6635L44.7987 44.662C44.9157 44.5194 45.0328 44.3768 45.146 44.2445C45.4342 43.9078 45.5597 43.6521 45.7297 43.306L45.7302 43.3049C45.7607 43.2427 45.7926 43.1776 45.8272 43.1087C46.0545 42.654 45.9409 42.2565 45.7708 41.9155C45.658 41.6893 45.0207 40.1383 44.4386 38.7218C44.4346 38.712 44.4305 38.7021 44.4265 38.6923C44.423 38.6839 44.4196 38.6755 44.4161 38.667C44.1289 37.968 43.8572 37.3065 43.671 36.8592C43.1828 35.687 42.6883 35.69 42.2913 35.6924C42.2386 35.6928 42.1876 35.6931 42.1386 35.6906C41.7421 35.6706 41.2874 35.667 40.8336 35.667C40.3798 35.667 39.6423 35.837 39.0175 36.5191C38.9773 36.5631 38.9323 36.6111 38.8834 36.6633C38.1738 37.4209 36.634 39.0648 36.634 42.2002C36.634 45.544 39.062 48.7748 39.4124 49.2411L39.415 49.2444C39.4362 49.2728 39.4735 49.3264 39.5266 49.4024C39.5288 49.4056 39.531 49.4088 39.5333 … viber: '<svg class="t-sociallinks__svg" role="presentation" width="18" height="18" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3733_944)"><path fill-rule="evenodd" clip-rule="evenodd" d="M50 100C77.614 100 100 77.614 100 50C100 22.386 77.614 0 50 0C22.386 0 0 22.386 0 50C0 77.614 22.386 100 50 100ZM69.546 28.82C68.242 27.636 62.614 24.1 50.872 24.048C50.872 24.048 36.967 23.135 30.217 29.248C26.46 32.958 25.195 38.474 25.056 45.205L25.04 45.896L25.0399 45.8998C24.8839 52.7855 24.6092 64.9096 36.51 68.216L36.457 78.602C36.457 79.189 36.55 79.59 36.885 79.673C37.126 79.732 37.487 79.607 37.795 79.301C39.763 77.323 46.066 69.719 46.066 69.719C54.523 70.272 61.252 68.602 61.976 68.365C62.1368 68.3139 62.3646 68.2602 62.6468 68.1936C62.663 68.1898 62.6794 68.1859 62.696 68.182C65.448 67.541 73.066 65.765 74.472 54.409C76.085 41.406 73.878 32.529 69.546 28.82ZM48.664 31.51C48.6659 31.2694 48.7632 31.0393 48.9345 30.8703C49.1059 30.7014 49.3374 30.6074 49.578 30.609C54.163 30.641 58.046 32.169 61.162 35.206C64.308 38.273 65.858 42.446 65.898 47.61C65.9028 47.7316 65.8831 47.853 65.8401 47.9668C65.7971 48.0807 65.7316 48.1847 65.6476 48.2728C65.5636 48.3609 65.4627 48.4311 65.351 48.4794C65.2392 48.5277 65.1189 48.553 64.9972 48.5539C64.8755 48.5548 64.7549 48.5312 64.6424 48.4845C64.53 48.4378 64.4282 48.369 64.3429 48.2821C64.2576 48.1953 64.1906 48.0922 64.146 47.979C64.1013 47.8657 64.0799 47.7447 64.083 47.623C64.046 42.833 62.622 39.165 59.895 36.506C57.138 33.818 53.715 32.453 49.565 32.424C49.3245 32.4219 49.0947 32.3245 48.926 32.1531C48.7573 31.9818 48.6624 31.7505 48.664 31.51ZM51.038 34.442C50.7338 34.4197 50.4332 34.5192 50.2023 34.7186C49.9715 34.9179 49.8293 35.2008 49.807 35.505C49.7847 35.8092 49.8842 36.1098 50.0836 36.3407C50.2829 36.5715 50.5658 36.7137 50.87 36.736C53.788 36.949 55.937 37.92 57.467 39.59C59.008 41.274 59.771 43.374 59.715 45.979C59.7084 46.284 59.8232 46.5791 60.0341 46.7995C60.2451 47.0199 … max_messenger: '<svg class="t-sociallinks__svg" role="presentation" width="18" height="18" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_5670_11)"><path fill-rule="evenodd" clip-rule="evenodd" d="M24 0C37.2548 0 48 10.7452 48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24C0 10.7452 10.7452 0 24 0ZM24.2314 12.5C17.8663 12.5 12.4942 17.4255 12.4941 23.9727C12.4941 26.714 13.0015 28.6059 13.4482 30.3047C13.8233 31.6836 14.1543 32.9467 14.1543 34.4414C14.3143 36.4326 17.9823 35.2685 19.1406 33.7793C20.9718 35.1031 22.0251 35.4346 24.292 35.4346C30.5586 35.4011 35.6151 30.2999 35.5938 24.0332C35.5937 17.6682 30.602 12.5 24.2314 12.5ZM24.3857 18.1592V18.165C27.5981 18.349 30.0709 21.0719 29.9453 24.2871C29.7296 27.4955 26.9854 29.9406 23.7734 29.7861C22.768 29.7055 21.8016 29.3614 20.9717 28.7881C20.4699 29.2899 19.6648 29.9402 19.3447 29.8633C18.6774 29.6868 17.8938 26.2951 18.335 23.5098C18.87 20.1452 21.2859 17.9993 24.3857 18.1592Z" fill="#4db7ff"/></g><defs><clipPath id="clip0_5670_11"><rect width="48" height="48" rx="50" fill="white"/></clipPath></defs></svg>', skype: '<svg class="t-sociallinks__svg" role="presentation" width="18" height="18" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3733_930)"><path fill-rule="evenodd" clip-rule="evenodd" d="M50 100C77.614 100 100 77.614 100 50C100 22.386 77.614 0 50 0C22.386 0 0 22.386 0 50C0 77.614 22.386 100 50 100ZM73.303 54.439C73.3125 54.3942 73.3193 54.3485 73.326 54.3036C73.3263 54.3014 73.3267 54.2992 73.327 54.297L73.347 54.174C74.509 56.2579 75.1196 58.604 75.121 60.99C75.121 64.733 73.664 68.252 71.017 70.897C69.7196 72.2023 68.176 73.237 66.4758 73.9414C64.7755 74.6457 62.9524 75.0055 61.112 75C58.689 75 56.315 74.37 54.219 73.184L54.3274 73.1662L54.342 73.164C54.3581 73.1616 54.3747 73.1591 54.3909 73.1566C54.4217 73.1519 54.4526 73.1469 54.484 73.141H54.481C54.4508 73.1466 54.4209 73.1519 54.3909 73.1566C54.3747 73.1591 54.3581 73.1616 54.342 73.164C54.3372 73.1647 54.3323 73.1655 54.3274 73.1662C54.2918 73.1715 54.255 73.177 54.219 73.184C54.189 73.167 54.159 73.15 54.127 73.134L53.98 73.054L53.978 73.053L54.108 73.124L54.219 73.184C52.8508 73.428 51.4638 73.5514 50.074 73.553C46.88 73.553 43.78 72.927 40.862 71.69C38.0491 70.5036 35.4937 68.7817 33.338 66.62C31.1765 64.4645 29.4546 61.9095 28.268 59.097C27.0334 56.1827 26.4004 53.049 26.407 49.884C26.407 48.515 26.529 47.145 26.763 45.804C25.6084 43.7263 25.0016 41.3889 25 39.012C25 35.27 26.459 31.752 29.104 29.105C30.4018 27.7996 31.9457 26.7646 33.6462 26.06C35.3468 25.3553 37.1702 24.9951 39.011 25C41.303 25 43.568 25.572 45.581 26.642L45.589 26.641H45.593C47.0699 26.3585 48.5703 26.2166 50.074 26.217C53.1822 26.2128 56.2606 26.823 59.1322 28.0125C62.0039 29.202 64.6121 30.9472 66.807 33.148C68.9696 35.3032 70.6925 37.8583 71.88 40.671C73.115 43.5852 73.7484 46.7189 73.742 49.884C73.742 51.324 73.606 52.766 73.347 54.174C73.3398 54.2149 73.3331 54.2559 73.327 54.297C73.3267 54.2992 73.3263 54.3014 73.326 54.3036C73.3192 54.3489 73.3115 54.394 73.303 54.439ZM38 57.147C38 … fb_messenger: '<svg class="t-sociallinks__svg" role="presentation" width="18" height="18" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_3733_938)"><path fill-rule="evenodd" clip-rule="evenodd" d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100ZM37.7393 25.758C40.5411 24.4308 43.0412 23.7044 46.4083 23.2392C53.1444 22.3089 60.5591 24.1252 66.2884 28.1094C68.3304 29.5294 71.4791 32.7366 72.8435 34.7865C75.6862 39.0576 77.005 43.3927 77.005 48.4656C77.005 55.0329 74.4787 60.8983 69.5403 65.7967C65.0127 70.2875 59.0097 72.999 52.3118 73.5785C49.2 73.8476 46.2969 73.6156 43.104 72.8425L43.102 72.842C42.9851 72.8137 42.8897 72.7907 42.7931 72.7822C42.3631 72.745 41.9078 72.9996 39.4235 74.3886C39.4189 74.3912 39.4143 74.3938 39.4096 74.3964C38.9161 74.6724 37.2607 75.596 35.7308 76.4492L32.9493 78L32.9016 73.0893L32.8539 68.1784L30.5502 65.8988C27.9473 63.3229 26.2166 60.8983 25.0649 58.2137C24.6889 57.3374 24.3108 56.459 24.2245 56.2616C24.1384 56.0642 23.8545 55.0952 23.5935 54.1082C23.1903 52.5825 23.1063 51.8259 23.0329 49.0575C22.957 46.192 22.994 45.5705 23.3403 43.8792C24.332 39.0366 26.3153 35.2172 29.689 31.6523C32.196 29.0034 34.5929 27.2484 37.7393 25.758ZM52.863 47.6927C52.2918 47.0759 50.7893 45.5012 49.5238 44.1934C47.3242 41.9204 46.9617 41.6217 46.827 41.9707C46.7941 42.0559 45.5082 43.4488 43.9693 45.0663C37.3594 52.0132 33.0609 56.6126 33.1218 56.6733C33.1862 56.7379 33.6298 56.5017 37.2562 54.4728C39.4401 53.2509 40.9818 52.4034 41.0208 52.4034C41.0439 52.4034 41.7646 51.9996 42.6222 51.5061C43.4798 51.0126 44.2199 50.6088 44.2667 50.6088C44.3134 50.6088 44.6733 50.4059 45.0663 50.1577L45.7811 49.7065L48.545 52.5372C50.0652 54.0942 51.609 55.7105 51.9758 56.1288C52.3426 56.5473 52.7067 56.8897 52.7851 56.8897C52.8636 56.8897 54.6585 55.0524 56.774 52.8071C58.8894 50.5618 62.0144 47.2464 63.7183 45.4399C65.4224 43.6331 66.769 42.1076 66.7111 42.04 … }; return icons[type] || '';}/** * Возвращает имя поля для data-field-name. У способа связи две переменные: тип и значение, они записываются через `;` * @param {FormObjectEl} elementObj * @returns {string} */function t_zeroForms__getFieldName(elementObj) {Длинные строки сокращены. Полная версия доступна по ссылке «Полный текст».