1import{d as O,u as U,b as A,B as D,au as T,O as j,bC as x,e as c,m as g,g as e,f as w,i,t as o,q as h,a0 as G,k as n,p,R as $,j as N,N as z,w as H,bp as J,x as K,r as f}from"./BnP3yFtX.js";import{F as Q}from"./NEDTZjAS.js";import{S as X}from"./PYpVGRAx.js";import{u as Y,g as Z,F as b}from"./DqMAMcUi.js";import{u as ee}from"./UsFH8bhU.js";import{u as ae}from"./DZqdp8zj.js";import"./BkWntfrE.js";import"./CiSTc8YG.js";import"./BCNrfv72.js";import"./DlAUqK2U.js";const le={"data-rel":"fallback-registration-wall"},te={key:2,class:"fallback-registration-wall"},re={class:"fallback-registration-wall__header"},ie={class:"fallback-registration-wall__headline"},se={key:0,class:"fallback-registration-wall__description"},oe={class:"fallback-registration-wall__content"},ne={class:"fallback-registration-wall__required-note"},de={key:0,class:"fallback-registration-wall__error"},ue={class:"fallback-registration-wall__footer"},ce={class:"fallback-registration-wall__login"},me={class:"fallback-registration-wall__privacy"},ge=O({__name:"FallbackRegistrationWall",props:{newsletterIds:{}},setup(y){const S=y,{d:a}=ae("forms"),{t:V}=U(),F=A(),I=D(),W=T(),C=j("leadSignupSuccess",()=>!1),L=K(()=>!!I.query.registrationToken),{submit:R}=x(),k=Y(Z),r=f({gender:"",firstName:"",lastName:"",email:""}),d=f({gender:"",firstName:"",lastName:"",email:""}),u=f(!1),m=f(""),q=[{value:"Female",label:a("registration.field.gender.options.female")},{value:"Male",label:a("registration.field.gender.options.male")},{value:"Other",label:a("registration.field.gender.options.undefined")}],{transactionId:E,trackFallbackRegistrationClick:B}=ee({templateId:"2",templateName:"Lead: Register-Wall",containerSelector:".fallback-registration-wall"});function P(){F.isLoginModalVisible.value=!0}async function M(){if(u.value)return;u.value=!0,m.value="",k.resetErrors(d.value);const{success:t,data:l,errors:_}=k.validate(r);if(!t){k.setErrors(d.value,_),u.value=!1;return}try{await R({email:l.email,firstName:l.firstName,lastName:l.lastName,gender:l.gender,marketingConsent:!1,nlSelection:S.newsletterIds,uniqueEventId:E.value})||(m.value=a("registration.responseErrorMessage"),u.value=!1)}catch{m.value=a("registration.responseErrorMessage"),u.value=!1}}return(t,l)=>{const _=z,v=J;return c(),g("div",le,[e(L)?(c(),w(X,{key:0,"article-url":e(W)?.metadata?.canonicalUrl},null,8,["article-url"])):e(C)?(c(),w(Q,{key:1})):(c(),g("section",te,[i("div",re,[i("b",ie,o(e(a)("registrationWall.title")),1),e(a)("registrationWall.description")?(c(),g("p",se,o(e(a)("registrationWall.description",{lineName:e(V)("lineConfig.lineName")})),1)):h("",!0)]),i("div",oe,[i("form",{class:"fallback-registration-wall__form",novalidate:"",onSubmit:G(M,["prevent"])},[n(b,{id:("useId"in t?t.useId:e(p))(),modelValue:e(r).email,"onUpdate:modelValue":l[0]||(l[0]=s=>e(r).email=s),label:e(a)("registration.field.email.label"),type:"email",placeholder:e(a)("registration.field.email.placeholder"),required:!0,error:e(d).email,"input-attributes":{name:"email"}},null,8,["id","modelValue","label","placeholder","error"]),n(b,{id:("useId"in t?t.useId:e(p))(),modelValue:e(r).gender,"onUpdate:modelValue":l[1]||(l[1]=s=>e(r).gender=s),label:e(a)("registration.field.gender.label"),type:"select",options:q,placeholder:e(a)("registration.field.gender.placeholder"),required:!0,error:e(d).gender,"input-attributes":{name:"gender"}},null,8,["id","modelValue","label","placeholder","error"]),n(b,{id:("useId"in t?t.useId:e(p))(),modelValue:e(r).firstName,"onUpdate:modelValue":l[2]||(l[2]=s=>e(r).firstName=s),label:e(a)("registration.field.firstName.label"),type:"text",placeholder:e(a)("registration.field.firstName.placeholder"),required:!0,error:e(d).firstName,"input-attributes":{name:"firstName"}},null,8,["id","modelValue","label","placeholder","error"]),n(b,{id:("useId"in t?t.useId:e(p))(),modelValue:e(r).lastName,"onUpdate:modelValue":l[3]||(l[3]=s=>e(r).lastName=s),label:e(a)("registration.field.lastName.label"),type:"text",placeholder:e(a)("registration.field.lastName.placeholder"),required:!0,error:e(d).lastName,"input-attributes":{name:"lastName"}},null,8,["id","modelValue","label","placeholder","error"]),i("div",ne,o(e(a)("general.requiredField")),1),e(m)?(c(),g("p",de,o(e(m)),1)):h("",!0),n($,{class:"fallback-registration-wall__submit",type:"submit",label:e(a)("registrationWall.submitLabel"),disabled:e(u),onClick:e(B)},null,8,["label","disabled","onClick"])],32)]),i("div",ue,[i("p",ce,[N(o(e(a)("registrationWall.loginPrompt"))+" ",1),l[4]||(l[4]=i("br",null,null,-1)),n(_,{class:"fallback-registration-wall__to-login fallback-registration-wall__login-link",text:e(a)("registrationWall.loginLinkLabel"),onClick:P},null,8,["text"])]),i("p",me,[N(o(e(a)("registrationWall.privacyNote"))+" ",1),n(v,{to:t.$t("paths.privacyPolicy")},{default:H(()=>[N(o(e(a)("registrationWall.privacyLinkLabel")),1)]),_:1},8,["to"])])])]))])}}}),Se=Object.assign(ge,{__name:"OrganismsGeneralFallbackRegistrationWall"});export{Se 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.