1import{_ as N}from"./BFE_pyP7.js";import{z as V,a as C,A as E,B as L,k as n,m as a,j as s,e as R,v as c,O as y,t as o,R as K,r as W,a6 as Y,ak as Q,Y as X,ac as x,ae as T,L as Z,J as ee,M as se,b as te,w as oe,a2 as ne,f as A,_ as ae,E as re,aG as ce,aC as ie,l as t,x as u,F as B,V as de,q as le,y as f}from"./mEzNQUA2.js";import{_ as ue}from"./CA7uey8z.js";import{_ as _e}from"./D6-abTFg.js";import{_ as me}from"./C07Bvf6I.js";import{u as pe}from"./BceMUvbb.js";import"./BKiTnmA2.js";import"./_02Ei6BK.js";import"./_IojVz0O.js";const ve=["disabled"],he=V({__name:"renewBtn",props:{order:{type:Object,required:!0}},setup(O){const _=O,{t:p,locale:w}=C(),k=E(L),i=W(!1),g=async()=>{const d=_.order.cart;if(d&&d.cartItems.length>0){i.value=!0;const{addToCart:l}=Y(),v=Q(),m=d.cartItems.map(e=>({id:e.code,title:e.label,categoryTitle:"categoryTitle"in e?e.categoryTitle[w.value]??"":"",brandName:"manufacturer"in e?e.manufacturer?.title[w.value]??"":"",amount:e.amount,price:k?.value?.vat_on_default_cash??!0?e.price.discounted.valueWithVat:e.price.discounted.value,currency:e.price.currency,type:"product"}));m.length>0?(await l(m),i.value=!1,await X(v("/cart/"))):(x().add(p("v1.views.user.OrderHistory.renewingOrderError"),T.DANGER),i.value=!1)}else x().add(p("v1.views.user.OrderHistory.renewingOrderError"),T.DANGER)};return(d,l)=>{const v=N;return n(),a("button",{class:"btn btn-primary btn-block",type:"button",disabled:s(i),onClick:K(g,["prevent"])},[s(i)?(n(),R(v,{key:0})):c("",!0),y(" "+o(d.$t("renew")),1)],8,ve)}}}),fe={key:0,class:"alert alert-info"},ye={id:"order-details",class:"container pb-5"},we={class:"row border-bottom py-3"},ge={class:"col"},be={class:"row"},ke={class:"col-sm-2 os-font-weight-semibold"},$e={class:"col-sm-10"},Ce={key:0,class:"row border-bottom py-3"},Oe={key:0,class:"col-12 col-sm-6 pb-2 pb-sm-0"},Se={class:"row"},xe={class:"col-sm-4 os-font-weight-semibold"},Te={class:"col-sm-8 d-flex flex-column"},Ae={key:0},Be={class:"col-12 col-sm-6"},Ne={class:"row"},Ve={class:"col-sm-4 os-font-weight-semibold"},Ee={class:"col-sm-8 d-flex flex-column"},Le={key:0},Re={class:"row py-3"},Ie={class:"col-12 col-sm-6 pb-2 pb-sm-0"},Me={key:0,class:"row"},De={class:"col-sm-4 os-font-weight-semibold"},je={class:"col-sm-8"},Fe={key:1,class:"row"},He={class:"col-sm-4 os-font-weight-semibold"},qe={class:"col-sm-8"},ze={class:"col-12 col-sm-6"},Ge={key:0,class:"row mb-3"},Pe={class:"col-sm-4 os-font-weight-semibold"},Ue={class:"col-sm-8 d-flex flex-column"},Je={key:0},Ke={key:1},We={class:"row"},Ye={class:"col-sm-4 os-font-weight-semibold"},Qe={class:"col-sm-8 d-flex flex-column"},Xe={key:0},Ze={key:1},es={key:2},ss={key:0,class:"row justify-content-end"},ts={class:"col-12 col-sm-6 mt-3"},os={class:"row py-4 px-3 d-flex justify-content-between"},ns={key:0,class:"ml-2"},ps=V({__name:"[id]",async setup(O){let _,p;const w=E(L),{user:k,isSalesperson:i}=Z(ee()),g=f(()=>C().t("v1.views.user.orderHistory.pageTitle",{ordernumber:l.params.id})),{locale:d}=C(),l=se();te({title:g});const{formatDate:v}=pe(),m=l.query.key,{data:e,status:I,error:h}=([_,p]=oe(()=>re(`${m}/${l.params.id}`,()=>m!=null?ce(m):ie(parseInt(l.params.id)))),_=await _,p(),_);if(h.value&&h.value.statusCode!==404){const r=h.value.message,b=h.value.statusCode;h.value=null,ne({message:r,statusCode:b})}const S=f(()=>e.value?.events.filter(r=>r.type==="confirmed")[0]?.date),M=f(()=>w?.value?.owninfo_order_renew_enabled??!1),D=f(()=>i.value&&k.value.sales?.rights?.canOrder),j=f(()=>e.value&&M.value&&(!i.value||D.value));return(r,b)=>{const F=N,$=de,H=ue,q=_e,z=me,G=he,P=ae;return n(),R(P,null,{default:A(()=>[t("h1",null,o(s(g)),1),s(I)==="pending"?(n(),a("div",fe,[u(F),y(" "+o(r.$t("loading"))+"... ",1)])):(n(),a(B,{key:1},[t("div",ye,[t("div",we,[t("div",ge,[t("div",be,[t("div",ke,o(r.$t("order_date"))+": ",1),t("div",$e,o(s(S)?s(v)(s(S)):""),1)])])]),s(e)?.customers?(n(),a("div",Ce,[s(e)&&s(e).customers.invoicing?(n(),a("div",Oe,[t("div",Se,[t("div",xe,o(r.$t("customer"))+": ",1),t("div",Te,[t("span",null,o(s(e).customers.invoicing.name),1),t("span",null,o(s(e).customers.invoicing.address.street),1),t("span",null,o(s(e).customers.invoicing.address.zipcode)+" "+o(s(e).customers.invoicing.address.city),1),s(e).customers.invoicing.address.country!=="FI"?(n(),a("span",Ae,o(s(e).customers.invoicing.address.country),1)):c("",!0)])])])):c("",!0),t("div",Be,[t("div",Ne,[t("div",Ve,o(r.$t("delivery"))+": ",1),t("div",Ee,[t("span",null,o(s(e)?.customers.delivery.name),1),t("span",null,o(s(e)?.customers.delivery.address.street),1),t("span",null,o(s(e)?.customers.delivery.address.zipcode)+" "+o(s(e)?.customers.delivery.address.city),1),s(e)?.customers.delivery.address.country!=="FI"?(n(),a("span",Le,o(s(e)?.customers.delivery.address.country),1)):c("",!0)])])])])):c("",!0),t("div",Re,[t("div",Ie,[s(e)?.deliveryMethod?(n(),a("div",Me,[t("div",De,o(r.$t("delivery_method"))+": ",1),t("div",je,o(s(e)?.deliveryMethod.title[s(d)]),1)])):c("",!0),s(e)?.paymentMethod?(n(),a("div",Fe,[t("div",He,o(r.$t("payment_method"))+": ",1),t("div",qe,o(s(e)?.paymentMethod.title[s(d)]),1)])):c("",!0)]),t("div",ze,[s(e)?.phone||s(e)?.email?(n(),a("div",Ge,[t("div",Pe,o(r.$t("contact_info"))+": ",1),t("div",Ue,[s(e).phone?(n(),a("span",Je,[u($,{icon:"fa fa-phone"}),y(" "+o(s(e)?.phone),1)])):c("",!0),s(e).email?(n(),a("span",Ke,[u($,{icon:"fa fa-envelope"}),y(" "+o(s(e)?.email),1)])):c("",!0)])])):c("",!0),t("div",We,[t("div",Ye,o(r.$t("additional_information"))+": ",1),t("div",Qe,[s(e)?.markings?(n(),a("span",Xe,o(r.$t("markings"))+": "+o(s(e)?.markings),1)):c("",!0),s(e)?.reference?(n(),a("span",Ze,o(r.$t("reference"))+": "+o(s(e)?.reference),1)):c("",!0),(n(!0),a(B,null,le(s(e)?.comments,(U,J)=>(n(),a("span",{key:J},o(U),1))),128)),s(e)?.message?(n(),a("span",es,o(s(e)?.message),1)):c("",!0)])])])])]),u(H,{cart:s(e)?.cart,"vat-on":s(e)?.paymentVatOn,"show-totals":!1,"show-coming-info":!1},null,8,["cart","vat-on"]),s(e)?(n(),a("div",ss,[t("div",ts,[u(q,{order:s(e)},null,8,["order"])])])):c("",!0),t("div",os,[t("div",null,[u(z,{to:"/user/",class:"btn btn-secondary"},{default:A(()=>[u($,{icon:"fa fa-angle-left"}),y(" "+o(r.$t("back")),1)]),_:1})]),b[0]||(b[0]=t("div",{class:"d-flex"},[t("div",{id:"browse-orders"})],-1)),s(j)?(n(),a("div",ns,[u(G,{order:s(e)},null,8,["order"])])):c("",!0)])],64))]),_:1})}}});
1export{ps 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.