import{_ as g,u as $,a as C,f as o,o as d,g as i,h as t,w as a,i as c,t as l,j as k,F as y,k as b,p as w,v as V,l as S}from"./app-ff872a97.js";import{S as O}from"./Summary-0d930377.js";const q={head:{title:"Order Tracking Page"},data:()=>({loading:!1,v$:$(),form:{orderCode:""},order:{}}),components:{Summary:O},validations:{form:{orderCode:{required:C}}},computed:{orderCodeErrors(){const e=[];return this.v$.form.orderCode.$dirty&&!this.v$.form.orderCode.required&&e.push(this.$i18n.t("this_field_is_required")),e}},methods:{async trackOrder(){if(!await this.v$.$validate())return;this.loading=!0;const r=await this.call_api("get",`user/order/${this.form.orderCode}`);r.data.success?this.order=r.data.data:this.snack({message:r.data.message,color:"red"}),this.loading=!1}}},B={class:"pb-6"},F={class:"mb-7 mt-4"},N={class:"mb-1 fs-13 fw-500"};function E(e,r,T,j,x,n){const u=o("v-text-field"),f=o("v-btn"),_=o("v-form"),m=o("v-col"),p=o("Summary"),v=o("v-row"),h=o("v-container");return d(),i("div",B,[t(h,null,{default:a(()=>[t(v,null,{default:a(()=>[t(m,{cols:"12",lg:"6",class:"mx-auto"},{default:a(()=>[c("h1",F,l(e.$t("track_your_order")),1),t(_,{"lazy-validation":"",onSubmit:r[1]||(r[1]=k(s=>n.trackOrder(),["prevent"]))},{default:a(()=>[c("div",N,l(e.$t("order_code")),1),t(u,{placeholder:e.$t("order_code"),type:"text",class:"mb-3 text-field",modelValue:e.form.orderCode,"onUpdate:modelValue":r[0]||(r[0]=s=>e.form.orderCode=s),"error-messages":n.orderCodeErrors,"hide-details":"auto",required:"",variant:"plain"},null,8,["placeholder","modelValue","error-messages"]),(d(!0),i(y,null,b(e.v$.form.orderCode.$errors,s=>(d(),i("p",{key:s.$uid,class:"text-red"},l(s.$message),1))),128)),t(f,{class:"px-16 mb-4",elevation:"0",type:"submit",color:"primary",onClick:n.trackOrder,loading:e.loading,disabled:e.loading},{default:a(()=>[w(l(e.$t("track")),1)]),_:1},8,["onClick","loading","disabled"])]),_:1})]),_:1}),e.is_empty_obj(e.order)?S("",!0):(d(),V(m,{key:0,cols:"12",xl:"8",lg:"10",class:"mx-auto"},{default:a(()=>[t(p,{"order-details":e.order},null,8,["order-details"])]),_:1}))]),_:1})]),_:1})])}const L=g(q,[["render",E]]);export{L as default};
