1import ae from"./BwKVxoeK.js";import{u as re,_ as ne,a as se}from"./BMhiYmeA.js";import ie from"./Chuu49nG.js";import{X as le,ab as ce,Z as de,al as me,a9 as ue,aV as pe,r as fe,w as _e,$ as he,o as ve,d as m,e as n,a1 as e,i as a,k as r,p as x,q as i,F as M,g,h as f,az as ge,y as _,m as ye,a2 as be,H as U,ae as G}from"./Dyf_xAow.js";import{_ as Ce}from"./BOxuH9_I.js";import xe from"./C7AeHgzN.js";import{u as we,_ as ke}from"./MWjb6-9-.js";import $e from"./C1XZo3Ll.js";import{_ as W}from"./Dbf2897v.js";import{b as Ie}from"./C7zGYq-6.js";import{_ as Se}from"./BnZpq8z1.js";import{_ as ze}from"./BZ-Z0cF3.js";import{_ as De}from"./CtRyXGJV.js";import"./CCSoGc9z.js";import"./CJaJske3.js";import"./BpudoXgo.js";import"./DjZCEhS4.js";import"./D1BiYLB2.js";import"./BABgNUSN.js";import"./B-bwQ1N-.js";import"./DQHQ7WgW.js";import"./BTI4qVLq.js";import"./DdQCOSs5.js";import"./BaBzAF0S.js";import"./Baep3svV.js";import"./BU4z3Z6e.js";import"./BlEZsjkq.js";import"./B9iCpJMs.js";import"./ufeul_5o.js";import"./BcqNZOj4.js";import"./CF6IYzhS.js";import"./CY9fiztf.js";import"./JIOSjsUD.js";import"./DuJ46VkG.js";import"./DWAC_R1A.js";import"./MusTj6Ir.js";import"./CkpXtkNu.js";const Pe={key:0},Ve={key:0,class:"flex flex-col items-center justify-center gap-4"},Fe=["textContent"],Le={class:"text-balance"},Te={key:0,class:"flex flex-col gap-2 text-secondary lg:items-end"},Ne=["href"],Oe=le({__name:"InvoicesOverview",setup(q){const z=ce(),y=de(),w=me(),{t:k,te:H}=ue(),D=we(),{overviewLoading:b,overviewError:P,invoices:V,invoiceSearchOptions:u,totalPageCount:$,searchIsActive:C,pageNr:s,pageSize:c,pageSizeOptions:F,resultsOnCurrentPage:L}=pe(D),{fetchInvoices:h,clearSearchOptions:K}=D,T=fe(),{scrollToElement:N}=re(T),O=async(t,p)=>{t==="prev"&&s.value>1?s.value--:t==="next"&&s.value<($.value||0)&&s.value++,await h({pageNr:s,pageSize:c}),await U(),p&&N()},j=t=>O("prev",t),B=t=>O("next",t),E=async(t,p)=>{c.value=t,s.value=1,t&&typeof t=="number"&&t>0&&(await h({pageNr:s,pageSize:c}),await U(),p&&N())},I=()=>{K(),h({pageNr:s,pageSize:c})},S=()=>{C.value?h():h({pageNr:s,pageSize:c})};function X(t){return Array.from(new Set(t))}return _e([()=>u.value.from,()=>u.value.to],()=>{S()},{immediate:!1}),he(()=>u.value.search,()=>{S()},{debounce:500,immediate:!1}),ve(()=>{S()}),(t,p)=>{var A;const Z=ae,J=ne,R=se,Q=ie,Y=be,ee=Ce,l=xe,te=ke,oe=$e;return n(),m("div",{class:"invoice-overview",ref_key:"wrapper",ref:T},[e(P)?(n(),m("div",Pe,[a(Z,{severity:"error",closable:!1},{default:r(()=>[x("strong",null,i(t.$t("General.Error"))+":",1),x("span",null,i(e(P)),1)]),_:1})])):(n(),m(M,{key:1},[a(J,{class:"flex flex-col lg:flex-row lg:justify-between lg:items-center gap-8 border p-4 shadow-sm bg-neutral-50",modelValue:e(u),"onUpdate:modelValue":p[0]||(p[0]=o=>ge(u)?u.value=o:null)},null,8,["modelValue"]),e(y)&&e(w).isDesktopOrTablet?(n(),g(R,{key:0,"results-count":e(L),"search-active":e(C),"page-size":e(c),"page-size-options":e(F),"page-nr":e(s),"total-page-count":e($),loading:e(b),onClear:I,onPrev:j,onNext:B,onUpdatePageSize:E,position:"start",class:"my-6"},null,8,["results-count","search-active","page-size","page-size-options","page-nr","total-page-count","loading"])):f("",!0),a(oe,{value:e(V),dataKey:"invoiceId",class:"text-sm mb-5",rows:e(c),loading:e(b),scrollable:"","sort-field":"invoiceDate","sort-order":-1},{loading:r(()=>[a(Q,{"aria-label":t.$t("General.Loading"),style:{width:"3rem",height:"3rem"}},null,8,["aria-label"])]),empty:r(()=>[e(b)?f("",!0):(n(),m("div",Ve,[x("p",{class:"text-base italic",textContent:i(t.$t("General.NoResultsLabel"))},null,8,Fe),e(C)?(n(),g(Y,{key:0,label:t.$t("Filter.ClearAll"),onClick:I,icon:"pi pi-refresh",severity:"secondary",size:"small"},null,8,["label"])):f("",!0)]))]),default:r(()=>[a(l,{field:"orderId",header:t.$t("Customercenter.Fields.InvoiceNo")},{body:r(o=>[a(ee,{to:e(z)({name:"customer-center-invoices-invoiceId",params:{invoiceId:o.data.invoiceId}}),class:"text-sm text-secondary font-semibold line-height-2 mb-2 sm:mb-1 block",underline:""},{default:r(()=>[_(i(o.data.invoiceId),1)]),_:2},1032,["to"])]),_:1},8,["header"]),a(l,{field:"invoiceDate",header:t.$t("Customercenter.Fields.InvoiceDate"),sortable:""},{body:r(o=>[_(i(e(Ie)(o.data.invoiceDate)),1)]),_:1},8,["header"]),a(l,{field:"reference",header:t.$t("Customercenter.Fields.Reference")},{body:r(o=>[x("span",Le,i(e(Se)(o.data.reference,15)),1)]),_:1},8,["header"]),a(l,{field:"orderId",header:t.$t("Customercenter.Fields.OrderNo")},{body:r(o=>[_(i(o.data.orderId),1)]),_:1},8,["header"]),a(l,{field:"status",header:t.$t("Customercenter.Fields.Status"),class:"text-center",pt:{headerContent:{class:"flex justify-center"}}},{body:r(o=>{var d,v;return[_(i(e(H)(`Customercenter.Detail.Status.${(d=o.data.status)==null?void 0:d.toLowerCase()}`)?e(k)(`Customercenter.Detail.Status.${(v=o.data.status)==null?void 0:v.toLowerCase()}`):o.data.status),1)]}),_:1},8,["header"]),a(l,{field:"Tracking",header:t.$t("Customercenter.Fields.ShipmentLinks"),class:"text-center",pt:{headerContent:{class:"flex justify-center"}}},{body:r(o=>{var d;return[(d=o.data.trackingLinks)!=null&&d.length?(n(),m("div",Te,[(n(!0),m(M,null,ye(X(o.data.trackingLinks),v=>(n(),m("a",{key:v,href:v,target:"_blank",rel:"noopener noreferrer",class:"underline underline-offset-2 hover:underline-offset-[3px] hover:text-secondary-light transition-all"},i(t.$t("Customercenter.Detail.ShipmentLink")),9,Ne))),128))])):f("",!0)]}),_:1},8,["header"]),a(l,{field:"totalPrice.priceWithVat",header:t.$t("Customercenter.Fields.TotalPriceInclVAT"),class:"text-right",pt:{headerContent:{class:"flex justify-end"}},sortable:""},{body:r(o=>[_(i(e(W)(o.data.totalPrice.priceWithVat)),1)]),_:1},8,["header"]),a(l,{field:"totalPrice.priceWithoutVat",header:t.$t("Customercenter.Fields.TotalPriceExVAT"),class:"text-right",pt:{headerContent:{class:"flex justify-end"}},sortable:""},{body:r(o=>[_(i(e(W)(o.data.totalPrice.priceWithoutVat)),1)]),_:1},8,["header"]),a(l,{field:"download",class:"text-right",pt:{headerContent:{class:"flex justify-end"}}},{body:r(o=>{var d;return[(d=o.data)!=null&&d.invoiceId?(n(),g(te,{key:0,"invoice-id":o.data.invoiceId,text:"PDF",class:"w-full !py-1"},null,8,["invoice-id"])):f("",!0)]}),_:1})]),_:1},8,["value","rows","loading"]),e(y)&&((A=e(V))!=null&&A.length)?(n(),g(R,{key:1,"results-count":e(L),"search-active":e(C),"page-size":e(c),"page-size-options":e(F),"page-nr":e(s),"total-page-count":e($),loading:e(b),onClear:I,onPrev:j,onNext:B,onUpdatePageSize:E,position:"end",class:"my-6"},null,8,["results-count","search-active","page-size","page-size-options","page-nr","total-page-count","loading"])):f("",!0)],64))],512)}}}),je=G(Oe,[["__scopeId","data-v-ecbb8bbd"]]),Be={};function Ee(q,z){const y=je,w=ze,k=De;return n(),g(k,null,{default:r(()=>[a(w,{defaultShowSidebar:!0,defaultShowBreadcrumb:!0,"is-customer-center-page":!0},{default:r(()=>[a(y)]),_:1})]),_:1})}const wt=G(Be,[["render",Ee]]);export{wt 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.