1import{d as w,G as I,I as R,c as z,X as Y,J as F,e as N,Z as k,o as P,k as U,l as e,n as m,m as o,b as u,w as C,s as q,t as b,q as V,T as E,F as M}from"./index-BOZhynU1.js";import{u as B,r as f}from"./index-C8xBCUk7.js";import{_ as j}from"./TInput.vue_vue_type_script_setup_true_lang-CX6Ekqg9.js";import{T as L}from"./TSignaturePad-x6GHRU9V.js";import{T as O}from"./TCheckbox-DDWerX2w.js";import{T as Q}from"./TDate-BtMW288o.js";import{n as v}from"./notify-BUwJ2z1p.js";import{l as x}from"./loading-B2ifEkql.js";import{d as T}from"./date-C2r27l3C.js";import{A as G}from"./ApplicationApi-9CN8mLfO.js";import{u as J}from"./useApplication-jpzrVHZb.js";import{g as X}from"./formErrors-DwbWMXPU.js";import"./QInput-C9p1zd4M.js";import"./use-key-composition-B5Nsz4qS.js";import"./private.use-form-ByB1znNP.js";import"./QItemLabel-Co7u1Uyd.js";import"./QCheckbox-X2rpYTn6.js";import"./use-checkbox-Cj2Sb0gO.js";import"./option-sizes-BK4hPqjk.js";import"./format-hlGAdIUH.js";import"./QMenu-CvL29YsQ.js";import"./ClosePopup-DZSUjVe2.js";const Z={class:"q-mt-lg main"},K={class:"t-grid t-gap-x-md"},W=e("p",{class:"h4"},"Cancel and refund",-1),ee=[W],te=e("div",{class:"t-col-12"},[e("p",{class:"subtitle"},"Disclosure"),e("p",{class:"body-large"},"I authorize Tenant Evaluation LLC to credit my account. I also understand that the refund will be the total amount paid minus the 10% convenience fee (credit card surcharge). ONLY the Payee/Card Holder can request a refund and sign below.")],-1),ae={class:"t-col-12"},re=e("p",{class:"subtitle"},"Card Holder's signature",-1),se=e("p",{class:"subtitle"},"Refund details",-1),oe={class:""},le=e("div",{class:"row justify-between"},[e("div",{class:""},[e("span",{class:"button-medium"},"Application Fees")]),e("div",{class:""},[e("span",{class:"button-medium text-right"},"Amount")])],-1),ne={class:"row justify-between"},ie=e("ul",{class:"list-none q-px-none"},[e("li",{class:"body-medium"},"Application Fee"),e("li",{class:"body-medium"},"Convenience Fee")],-1),de={class:"list-none q-px-none"},ue={class:"body-medium text-right"},ce={class:"body-medium text-right"},me={class:"row justify-between"},pe=e("span",{class:"button-medium"},"Total to be refunded",-1),fe={class:"button-medium"},ge={class:"full-width row justify-end"},Ve=w({__name:"CancelAndRefund",setup(he){var D,A;const c=I(),$=R(),{fetchApplicationDetail:H}=J(),n=z(()=>Y.data.applicationDetail),r=F({cardHolderName:((D=n.value)==null?void 0:D.paymentDetails[0].payerName)||"",currentDate:T.formatDate((A=n.value)==null?void 0:A.paymentDetails[0].postedDate,"YYYY-MM-DD"),signature:null,agreeAndAuthorize:!1}),i=B({cardHolderName:{required:f},currentDate:{required:f},signature:{required:f},agreeAndAuthorize:{required:f,isTrue:t=>t===!0}},r),p=N(null),g=N(!1);k(()=>n.value,t=>{r.cardHolderName=(t==null?void 0:t.paymentDetails[0].payerName)||"",r.currentDate=T.formatDate(t==null?void 0:t.paymentDetails[0].postedDate,"YYYY-MM-DD")});const S=t=>{var a;r.signature=t?((a=p.value)==null?void 0:a.getData())??null:null},h=t=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(t),y=async()=>{var a,l,d,s;i.value.$touch();const t=X(i.value.$errors);if(t){v.error(t);return}try{r.signature=((a=p.value)==null?void 0:a.getData())||"",x.show("submit-refund"),await G.submitRefundRequest({signature:(l=p.value)==null?void 0:l.getData(),applicationId:((d=n.value)==null?void 0:d.applicationId)??""}),v.success("Refund request submitted successfully"),await H(((s=n.value)==null?void 0:s.applicationId.toString())||""),$.back()}catch{v.error("An error occurred. Please try again later.")}finally{x.hide("submit-refund")}};return(t,a)=>(P(),U(M,null,[e("div",Z,[e("div",K,[e("div",{class:m(["t-col-12",{column:o(c).screen.lt.sm}])},ee,2),u(q,{class:m(["basic-card t-grid t-gap-x-md t-gap-y-md t-col-9",{"t-col-12":o(c).screen.lt.sm}])},{default:C(()=>{var l,d;return[te,u(j,{modelValue:r.cardHolderName,"onUpdate:modelValue":a[0]||(a[0]=s=>r.cardHolderName=s),label:"",name:"cardHolderName",required:"",type:"text",readonly:!0,class:m(["t-col-6",{"t-col-12":o(c).screen.lt.sm}]),error:o(i).cardHolderName.$error,"error-message":(l=o(i).cardHolderName.$errors[0])==null?void 0:l.$message.toString()},null,8,["modelValue","class","error","error-message"]),u(Q,{modelValue:r.currentDate,"onUpdate:modelValue":a[1]||(a[1]=s=>r.currentDate=s),label:"",name:"currentDate",readonly:!0,required:"",class:m(["t-col-6",{"t-col-12":o(c).screen.lt.sm}]),error:o(i).currentDate.$error,"error-message":(d=o(i).currentDate.$errors[0])==null?void 0:d.$message.toString()},null,8,["modelValue","class","error","error-message"]),e("div",ae,[re,u(L,{ref_key:"signaturePadRef",ref:p,text:r.cardHolderName,error:o(i).signature.$error,"error-message":"This field is required",onSigned:S},null,8,["text","error"])]),u(O,{modelValue:r.agreeAndAuthorize,"onUpdate:modelValue":a[2]||(a[2]=s=>r.agreeAndAuthorize=s),label:"I agree and authorize this terms and conditions",name:"agreeAndAuthorize",color:"deep-orange-7",class:"q-mr-md body-medium t-col-12",error:o(i).agreeAndAuthorize.$error,"error-message":"Please agree to continue"},null,8,["modelValue","error"])]}),_:1},8,["class"]),u(q,{class:m(["basic-card t-col-3 h-fit",{"t-col-12":o(c).screen.lt.sm}])},{default:C(()=>{var l,d,s,_;return[se,e("div",oe,[le,e("div",ne,[ie,e("ul",de,[e("li",ue,b(h((((l=n.value)==null?void 0:l.refundAvailable)||0)+(((d=n.value)==null?void 0:d.refundFee)||0))),1),e("li",ce,b(h(-(((s=n.value)==null?void 0:s.refundFee)||0))),1)])]),e("div",me,[pe,e("span",fe,b(h(((_=n.value)==null?void 0:_.refundAvailable)||0)),1)])]),e("div",ge,[u(V,{class:"basic-btn q-mt-md",label:"Refund",unelevated:"",onClick:y}
1)])]}),_:1},8,["class"])])]),u(E,{modelValue:g.value,"onUpdate:modelValue":a[3]||(a[3]=l=>g.value=l),title:"THIS CANNOT BE UNDONE",message:"I understand that the refund will be the total amount paid minus the 10% convenience fee?","show-buttons":!0,onCancel:a[4]||(a[4]=()=>g.value=!1),onConfirm:y},null,8,["modelValue"])],64))}});export{Ve 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.