1import{f as $,m as q,e as L,a7 as W,_ as D,Q as E}from"./bS0gHfOR.js";import H from"./BBGJQ671.js";import M from"./m5FEckKE.js";import O from"./C5FRBZ6m.js";import j from"./DgwhhO5m.js";import A from"./BKLYNXci.js";import{v as G,a9 as K,y as r,I as c,$ as h,B as e,G as n,C as t,H as m,F as i,z as y,a7 as x,A as Q,D as b,K as w,O as J}from"./qHTv0qqf.js";import"./ga_jkbhe.js";const X={class:"grid grid-cols-12 gap-5"},Y=G({__name:"WithdrawalForm",props:{privacyPolicyPath:{}},setup(g){const{t:a}=$(),d=w(!1),_=w(!1),f=w(!1),l=J({firstName:"",lastName:"",orderReference:"",email:"",comment:""}),{apiClient:N}=q(),V=async()=>{d.value=!0;const v={firstName:l.firstName||void 0,lastName:l.lastName||void 0,orderReference:l.orderReference,email:l.email,comment:l.comment||void 0,consent:!0};f.value=!1;try{await N.invoke("submitWithdrawal post /reifen1plus/withdrawal",{body:v}),_.value=!0}catch(o){f.value=!0,console.error("Withdrawal submission failed",null,o)}finally{d.value=!1}},k=E()({slots:{formClasses:"flex flex-col w-full lg:min-w-[30rem] max-h-[calc(100vh-7rem)] max-h-[calc(100svh-7rem)] max-h-[calc(100dvh-7rem)] lg:max-h-[calc(100vh-8rem)] lg:max-h-[calc(100svh-8rem)] lg:max-h-[calc(100dvh-8rem)] overflow-y-auto overscroll-contain pr-2",headingClasses:"mb-6",buttonClasses:"mt-8 w-full lg:w-auto lg:ml-auto"}}),{formClasses:C,headingClasses:U,buttonClasses:B}=k();return(v,o)=>{const P=L,R=H,u=W,p=M,z=O,T=j,I=K("i18n-t"),F=D,S=A;return r(),c(S,{onSubmit:V,class:h(e(C)()),id:"withdrawal-form"},{default:n(()=>[t(P,{id:"modal-headline",tag:"h2",size:"sm",class:h(e(U)())},{default:n(()=>[m(i(e(a)("withdrawal.modalTitle")),1)]),_:1},8,["class"]),e(d)?(r(),c(R,{key:0,class:"my-12"})):(r(),y(x,{key:1},[e(_)?(r(),c(u,{key:0,size:"md"},{default:n(()=>[m(i(e(a)("withdrawal.successMessage")),1)]),_:1})):(r(),y(x,{key:1},[Q("div",X,[t(p,{modelValue:e(l).firstName,"onUpdate:modelValue":o[0]||(o[0]=s=>e(l).firstName=s),label:e(a)("form.firstName"),placeholder:e(a)("form.firstNamePlaceholder"),validation:"required",name:"firstName","outer-class":"col-span-12 lg:col-span-6"},null,8,["modelValue","label","placeholder"]),t(p,{modelValue:e(l).lastName,"onUpdate:modelValue":o[1]||(o[1]=s=>e(l).lastName=s),label:e(a)("form.lastName"),placeholder:e(a)("form.lastNamePlaceholder"),validation:"required",name:"lastName","outer-class":"col-span-12 lg:col-span-6"},null,8,["modelValue","label","placeholder"]),t(p,{modelValue:e(l).orderReference,"onUpdate:modelValue":o[2]||(o[2]=s=>e(l).orderReference=s),label:e(a)("withdrawal.orderReference"),placeholder:e(a)("withdrawal.orderReferencePlaceholder"),validation:"required",name:"orderReference","outer-class":"col-span-12"},null,8,["modelValue","label","placeholder"]),t(p,{modelValue:e(l).email,"onUpdate:modelValue":o[3]||(o[3]=s=>e(l).email=s),type:"email",label:e(a)("form.email"),placeholder:e(a)("form.emailPlaceholder"),validation:"required|email",name:"email","outer-class":"col-span-12"},null,8,["modelValue","label","placeholder"]),t(z,{modelValue:e(l).comment,"onUpdate:modelValue":o[4]||(o[4]=s=>e(l).comment=s),label:e(a)("withdrawal.comment"),placeholder:e(a)("withdrawal.commentPlaceholder"),name:"comment","outer-class":"col-span-12"},null,8,["modelValue","label","placeholder"])]),t(u,{size:"sm",class:"mt-6 text-secondary-500"},{default:n(()=>[t(I,{keypath:"withdrawal.mandatoryNote"},{privacyLink:n(()=>[t(T,{to:g.privacyPolicyPath,class:"underline"},{default:n(()=>[m(i(e(a)("withdrawal.privacyLinkText")),1)]),_:1},8,["to"])]),_:1})]),_:1}),t(u,{size:"sm",class:"mt-2 text-secondary-500"},{default:n(()=>[m(i(e(a)("withdrawal.consentNote")),1)]),_:1})],64))],64)),e(f)?(r(),c(u,{key:2,size:"sm",class:"mt-6 text-red-600"},{default:n(()=>[m(i(e(a)("withdrawal.errorMessage")),1)]),_:1})):b("",!0),e(_)?b("",!0):(r(),c(F,{key:3,type:"submit",form:"withdrawal-form",variant:"primary",disabled:e(d),class:h(e(B)())},{default:n(()=>[m(i(e(a)("withdrawal.submit")),1)]),_:1},8,["disabled","class"]))]),_:1},8,["class"])}}}),me=Object.assign(Y,{__name:"WithdrawalForm"});export{me 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.