PageSourceSearch

https://gut39.ru/assets/PersonalDataConsent-BW1xfm7z.js

js gut39.ru collected 2026-10-09 22:41:34 UTC 2,695 bytes, 1 lines download raw bytes

1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n}from"./framework-C-kvl5Nm.js";import{t as r}from"./yandex-DfB91BCY.js";import{n as i}from"./utm-DvKuJSKC.js";import{t as a}from"./link-DMTbWfdQ.js";var o=e(t(),1);function s(e){let t={};for(let[n,r]of e.entries())typeof r==`string`&&![`name`,`phone`,`email`,`contact`,`comment`,`honeypot`,`direction`,`service`].includes(n)&&(t[n]=r);return t}function c(e,t){let n=e.get(t);return typeof n==`string`&&n.trim()?n.trim():void 0}async function l(e,t){let n=new FormData(e),r={...t,direction:t.direction??c(n,`direction`),service:t.service??c(n,`service`),name:c(n,`name`),phone:c(n,`phone`),email:c(n,`email`),contact:c(n,`contact`),comment:c(n,`comment`),honeypot:c(n,`honeypot`),fields:s(n),page:{url:window.location.href,title:document.title,referrer:document.referrer},utm:i()},a=n.get(`photo`),o=a instanceof File&&a.size>0,l=new FormData;o&&(l.set(`payload`,JSON.stringify(r)),l.set(`photo`,a));let u=await fetch(`/api/leads`,{method:`POST`,...o?{}:{headers:{"content-type":`application/json`}},body:o?l:JSON.stringify(r)}),d=null;try{d=await u.json()}catch{}if(!u.ok||!d?.ok)throw Error(`lead_submission_failed`);return d.leadId}function u(e,t={}){let[n,i]=(0,o.useState)(!1),[a,s]=(0,o.useState)(!1),[c,u]=(0,o.useState)(!1),d=(0,o.useRef)(!1);async function f(n){if(n.preventDefault(),!d.current){d.current=!0,s(!0),u(!1);try{await l(n.currentTarget,e),t.successGoal&&r(t.successGoal),i(!0)}catch{u(!0)}finally{d.current=!1,s(!1)}}}return{sent:n,submitting:a,error:c,submit:f,reset:()=>i(!1)}}var d=n();function f(){return(0,d.jsx)(`div`,{hidden:!0,"aria-hidden":`true`,children:(0,d.jsxs)(`label`,{children:[`Не заполняйте это поле`,(0,d.jsx)(`input`,{name:`honeypot`,type:`text`,tabIndex:-1,autoComplete:`off`})]})})}function p(){return(0,d.jsx)(`p`,{className:`form-submission-error`,role:`alert`,children:`Не удалось отправить заявку. Проверьте соединение и попробуйте ещё раз.`})}var m=`2026-08-19`,h=`personal_data_consent`;function g(){return(0,d.jsxs)(`div`,{className:`personal-data-consent`,children:[(0,d.jsxs)(`label`,{children:[(0,d.jsx)(`input`,{type:`checkbox`,name:h,value:m,required:!0}),(0,d.jsx)(`span`,{children:`Даю согласие на обработку персональных данных.`})]}),(0,d.jsxs)(`p`,{children:[(0,d.jsx)(a,{href:`/soglasie-na-obrabotku-personalnyh-dannyh`,children:`Текст согласия`}),` · `,(0,d.jsx)(a,{href:`/politika-obrabotki-dannyh`,children:`Политика обработки персональных данных`})]})]})}export{u as i,p as n,f as r,g as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.