1import{j as s,m as i,a as B,b as w,G as A,c as C,r as o,ef as d,bl as D,av as F,eg as P,L as y,B as O,aC as Y,ci as G,dP as R,ac as m,aP as U}from"./index-DsQ0uOw8.js";import{I as $}from"./InfoBanner-jBEPjmKh.js";const z=({label:n,checked:e,onChange:l,disabled:r=!1})=>s.jsxs("label",{className:i("flex items-center justify-between w-full select-none",r?"opacity-50 cursor-not-allowed":"cursor-pointer"),children:[s.jsx("span",{className:"text-text text-sm md:text-base font-normal pr-4",children:n}),s.jsxs("div",{className:"relative inline-flex items-center",children:[s.jsx("input",{type:"checkbox",checked:e,onChange:l,disabled:r,className:"sr-only peer"}),s.jsx("div",{className:i("w-[50px] h-[30px] bg-gray-300 dark:bg-gray-600 rounded-full transition-colors duration-300 ","peer-checked:bg-accent","peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-blue-500")}),s.jsx("div",{className:i("absolute left-[2px] top-[3px] w-6 h-6 bg-white rounded-full shadow","transition-all duration-300 ease-[cubic-bezier(0.4,0,0.2,1)]","peer-checked:translate-x-[22px]","peer-active:scale-90 peer-active:shadow-none")})]})]}),H=()=>{var h,g,b,u,v,N;const n=B(),e=w(A),l=w(C),r=l==null?void 0:l.link,[c,x]=o.useState(()=>({...d,advert:(e==null?void 0:e.advert_messages_agreement)!==void 0?!!(e!=null&&e.advert_messages_agreement):d.advert})),[p,f]=o.useState(!1),_=e&&((h=e==null?void 0:e.main)==null?void 0:h.name),I=e&&((g=e==null?void 0:e.main)==null?void 0:g.email),S=(b=e==null?void 0:e.main)==null?void 0:b.birthdate,T=e&&((u=e==null?void 0:e.dates[0])==null?void 0:u.date),E=e&&((v=e==null?void 0:e.dates[1])==null?void 0:v.date),L=a=>{x(t=>({...t,[a]:!t[a]}))},k=a=>{a.preventDefault(),f(!0),n(G()).then(()=>n(R({name:_,email:I,birthdate:S,birthdate_2:T,birthdate_3:E,advert_messages_agreement:c==null?void 0:c.advert}))).then(t=>{var j;((j=t.payload)==null?void 0:j.status)===200?m.success("ÐаÑÑÑойки Ñведомлений ÑоÑ
ÑаненÑ!"):m.tryAgainError()}).then(()=>{n(U())}).catch(t=>{console.error("ÐÑибка:",t),m.tryAgainError()}).finally(()=>{f(!1)})};return o.useEffect(()=>{e&&x(a=>({...a,advert:!!((e==null?void 0:e.advert_messages_agreement)??d.advert)}))},[e]),s.jsx("div",{className:i(D,""),children:s.jsxs("div",{className:"flex flex-col-reverse md:flex-row items-start w-full gap-5",children:[s.jsx(F,{className:"py-2 md:py-4 px-2 md:px-4 flex-shrink-0 w-full max-w-full md:max-w-[430px]",children:s.jsxs("form",{onSubmit:k,className:"space-y-3 md:space-y-5 w-full",children:[(N=P)==null?void 0:N.map(({key:a,label:t})=>s.jsx(z,{label:t,checked:c[a],onChange:()=>L(a)},a)),s.jsxs("p",{className:"text-sm text-text !mt-6 leading-relaxed",children:["ÐÐ°Ð¶Ð¸Ð¼Ð°Ñ Ð½Ð°Â ÐºÐ½Ð¾Ð¿ÐºÑ Â«Ð¡Ð¾Ñ
ÑаниÑÑ», вÑ подÑвеÑждаеÑе ознакомление и ÑоглаÑие Ñ ",s.jsx(y,{to:`/${r}/politics`,className:"text-accent hover:underline",children:"ÐолÑзоваÑелÑÑким ÑоглаÑением"})," ","и ",s.jsx(y,{to:`/${r}/soglasie-obrabotka-pers-dannyh`,className:"text-accent hover:underline",children:"ÐолиÑикой конÑиденÑиалÑноÑÑи"})]}),s.jsx(O,{type:"submit",isBgAccent:!0,className:"w-full",children:s.jsx("span",{className:p?"animate-spin":"",children:p?s.jsx(Y,{}):"СоÑ
ÑаниÑÑ"})})]})}),s.jsx($,{title:"ÐÑÐ´Ñ Ð² кÑÑÑе!",description:"С помоÑÑÑ Ñведомлений Ñдобно ÑледиÑÑ Ð·Ð° ÑÑаÑÑÑом заказа, а Ñакже ÑзанаваÑÑ Ð¾ новÑÑ
ÑкидкаÑ
",descClassName:"md:max-w-full"})]})})};export{H as Notifications};
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.