1import{_ as L}from"./Cbp8rmw2.js";import{_ as $}from"./CzFoFwZD.js";import{z as S,a5 as d,a as B,I as N,b as A,L as C,a6 as R,o as U,a7 as _,e as m,f as p,r as V,y as f,a8 as h,a9 as W,_ as j,A as q,B as D,k as s,j as n,m as v,t as u,O as y,x as K}from"./DXADahwW.js";import{i as g,k as M}from"./bQCzVlXr.js";const z={key:0,class:"alert alert-danger"},F={key:2,class:"alert alert-info mb-3"},X=S({__name:"ok",setup(G){const a=d("orderId",()=>0),k=d("redirectTarget",()=>""),o=V(!1),T=q(D,null),{t:w,locale:i}=B(),I=N(),b=f(()=>w("v1.views.checkout.payment.handlingPayment"));A({title:b});const{cart:x}=C(R()),l=f(()=>{const e=k.value;return e.length>0&&!e.startsWith("http")&&!e.startsWith("//")?e:`/order/${a.value}`}),P=async()=>{if(!h()&&!g())return;let e;try{e=await _(`/order/id/${a.value}`,{method:"GET"})}catch{return}if(h()){const r=[];e.cart?.cartItems.forEach(t=>{const c={currency:t.price.currency,item_brand:"manufacturer"in t?t.manufacturer?.title[i.value]??"":"",item_category:"categoryTitle"in t?t.categoryTitle[i.value]??"":"",item_id:t.code,item_name:t.label,price:T?.value?.vat_on_default_cash??!0?t.price.discounted.valueWithVat:t.price.discounted.value,quantity:t.amount};r.push(c)}),W(e,r)}g()&&M(e)};return U(async()=>{if(!(a.value<=0)){await P();try{await _("/cart/",{method:"DELETE"})}catch{}x.value=null;try{await I.replace(l.value)&&(o.value=!0)}catch{o.value=!0}}}),(e,r)=>{const t=L,c=$,E=j;return s(),m(E,{name:"nosidenav"},{default:p(()=>[n(a)<=0?(s(),v("div",z,u(e.$t("payment_fail_text")),1)):n(o)?(s(),m(t,{key:1,to:n(l),class:"btn btn-link"},{default:p(()=>[y(u(e.$t("v1.views.checkout.clickToProceed")),1)]),_:1},8,["to"])):(s(),v("div",F,[K(c),y(" "+u(e.$t("v1.views.checkout.payment.handlingPayment")),1)]))]),_:1})}}});
1export{X 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.