1import{aV as F,bn as R,bE as A,br as d,by as b,bQ as B,bv as n,bw as u,bu as m,b2 as w,bR as C,bx as $,bL as L,bt as M,bB as z,bz as O,b6 as P,bF as j,a$ as T,bJ as y,b9 as J,bC as x}from"./EBpBARSw.js";import G from"./VPJxLRZs.js";import{N as v}from"./H6LrtRk3.js";import{V as U}from"./DrRg1rd5.js";import{u as Y}from"./DL71b4LM.js";import"./1HUvpwnI.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new r.Error().stack;p&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[p]="df3e123c-f1d3-471f-978b-f84f6c3f4dbd",r._sentryDebugIdIdentifier="sentry-dbid-df3e123c-f1d3-471f-978b-f84f6c3f4dbd")}catch{}})();const q=["value"],H=["disabled"],Q=F({__name:"NewsletterSubscription",setup(r){const p=R(),h=Y(),i=T(""),a=T(""),s={[v.all]:y({checked:!0,label:"ÐÑе ÑÑазÑ",type:"all"}),[v.everyweek]:y({checked:!1,label:"ÐженеделÑнаÑ",type:"everyweek"}),[v.everyday]:y({checked:!1,label:"ÐжедневнаÑ",type:"everyday"}),[v.games]:y({checked:!1,label:"ÐовоÑÑи Forbes Games",type:"games"})},k=J(()=>{const[e]=Object.entries(s)?.find(([t,{type:c}])=>c==="all")||[];return e}),l=new Set;for(const e in s){const{checked:t}=s[e];l[t?"add":"delete"](e)}const _=A(function*(){return p.pub.subscribe({email:i.value,listIds:JSON.stringify(Array.from(l))}).then(()=>{h.open("infoDialog",{componentAttrs:{title:"ÐÑлиÑно! ÐÑ Ð¿Ð¾Ð´Ð¿Ð¸ÑалиÑÑ Ð½Ð° ÑаÑÑÑлки forbes.ru",text:"Ðа ÑказаннÑй вами email бÑдÑÑ Ð¿ÑиÑ
одиÑÑ Ñвежие новоÑÑи и ÑаÑÑÑлки.",button:"ХоÑоÑо"}}),D()}).catch(e=>{h.open("infoDialog",{componentAttrs:{title:"ЧÑо-Ñо поÑло не Ñак",text:'ÐопÑобÑйÑе подпиÑаÑÑÑÑ Ð¿Ð¾Ð·Ð´Ð½ÐµÐµ или напиÑиÑе нам на <a href="mailto:[email protected]?subject=ÐÑÐ¾Ð±Ð»ÐµÐ¼Ñ Ñ Ð¿Ð¾Ð´Ð¿Ð¸Ñкой в подвале ÑайÑа" target="_blank">[email protected]</a>',button:"ÐакÑÑÑÑ"}}),console.error("[NewsletterSubscription]",e)})});function E(e,t){const{dataset:{value:c=""}}=t.target,f=s[c];if(a.value="",l[e?"add":"delete"](c),f.checked)if(f.type==="all"){for(const g in s){const o=s[g];o.type!=="all"&&(o.checked=!1)}l.clear(),l.add(k.value)}else s[k.value].checked=!1,l.delete(k.value)}function V(e){const t=e.target;i.value=t.value,a.value=""}function S(){if(a.value="",i.value.length===0)return a.value="ÐеобÑ
одимо ÑказаÑÑ Ð¿Ð¾ÑÑÑ";if(!U.email({value:i.value}))return a.value="ÐевеÑнÑй ÑоÑÐ¼Ð°Ñ ÑлекÑÑонной поÑÑÑ";if(l.size===0)return a.value="ÐеобÑ
одимо вÑбÑаÑÑ Ñ
оÑÑ Ð±Ñ Ð¾Ð´Ð½Ñ ÑаÑÑÑлкÑ";_.perform()}function D(){i.value="";for(const e in s){const t=s[e];t.checked=t.type==="all"}}return(e,t)=>{const c=C,f=L,g=G;return d(),b("form",{class:n({[e.$style.root]:!0,[e.$style.withError]:u(a)}),onSubmit:B(S,["prevent"])},[m("div",{class:n(e.$style.field)},[m("label",{class:n(e.$style.label)},[m("input",{class:n(e.$style.input),name:"subscription-email",placeholder:"ÐаÑа поÑÑа",type:"text",value:u(i),onInput:V},null,42,q),e.$viewport.isLessThan("tablet")?(d(),b("button",{key:0,"aria-label":"ÐодпиÑаÑÑÑÑ",class:n(e.$style.submitIcon),disabled:u(_).isRunning,type:"submit"},[w(c,{name:"chevron"})],10,H)):$("",!0)],2),e.$viewport.isGreaterThan("tablet")?(d(),b("div",{key:0,class:n(e.$style.submit)},[w(f,{"is-disabled":u(_).isRunning,theme:"dark-alternate",type:"submit"},{default:M(()=>[...t[0]||(t[0]=[z(" ÐодпиÑаÑÑÑÑ ",-1)])]),_:1},8,["is-disabled"])],2)):$("",!0)],2),u(a)?(d(),b("div",{key:0,class:n(e.$style.error)},O(u(a)),3)):$("",!0),m("div",{class:n(e.$style.types)},[(d(),b(P,null,j(s,(o,I)=>w(g,{key:I,modelValue:o.checked,"onUpdate:modelValue":N=>o.checked=N,checked:o.checked,class:n(e.$style.type),"data-value":I,label:o.label,"label-position":e.$viewport.isLessThan("tablet")?"left":"right",name:"newsletter-subscription",theme:"dark",onInput:E},null,8,["modelValue","onUpdate:modelValue","checked","class","data-value","label","label-position"])),64))],2)],34)}}}),W="xndx7",Z="DYdsT",K="_1qRyF",X="gtjNR",ee="-AgFz",te="ZSJ-T",se="E-uFO",ae="gP4yV",ne="cPakE",le="PorHn",oe={root:W,field:Z,label:K,withError:X,input:ee,submitIcon:te,submit:se,error:ae,types:ne,type:le},re={$style:oe},fe=x(Q,[["__cssModules",re]]);export{fe as default};
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.