1import{a as ze}from"./chunk-GIIMJHN6.js";import{a as $e}from"./chunk-EY3EI5WB.js";import{a as He,f as De}from"./chunk-B3QJM2RM.js";import"./chunk-M6OZBIKI.js";import"./chunk-XQLXGKEK.js";import"./chunk-IXD6ECVB.js";import"./chunk-RRCBQ55K.js";import"./chunk-DQRROS2B.js";import"./chunk-EONF3GVN.js";import"./chunk-5LMG4TVJ.js";import"./chunk-Z2TVBXTG.js";import{a as Fe}from"./chunk-QIOURN4K.js";import{a as Oe,b as Ne}from"./chunk-KYVCMV2E.js";import"./chunk-HWZZ5RQT.js";import"./chunk-ZNR7QNVV.js";import"./chunk-WGAXTYG2.js";import"./chunk-U3Z5BGA7.js";import{a as Ge,b as Ve}from"./chunk-M6YDMVQ7.js";import{a as Be}from"./chunk-OTMVSU27.js";import{a as Ee}from"./chunk-EB6TJ75L.js";import"./chunk-QI7CEGT6.js";import{b as ke}from"./chunk-6ND7557V.js";import{D as Pe,g as Se,l as Ae}from"./chunk-FOJCKIWO.js";import{a as Te}from"./chunk-NBMUSEX4.js";import{b as Me}from"./chunk-3AIY57KH.js";import"./chunk-AB6CKZTE.js";import{b as Ue,c as Le}from"./chunk-H66TAOKK.js";import"./chunk-Z64D265S.js";import"./chunk-K5O3OQFW.js";import"./chunk-2DRXLVRR.js";import{c as we,d as Re,e as Ie}from"./chunk-RQJZECR4.js";import"./chunk-G3G5OK6Q.js";import"./chunk-AERMLNF3.js";import"./chunk-QHMYZ6SM.js";import"./chunk-PJPLTBJX.js";import"./chunk-DLIVM562.js";import"./chunk-CV2ZWZQE.js";import{c as be}from"./chunk-H4HD3LNW.js";import{aa as ye,ja as F,ka as z}from"./chunk-AQEWHUN5.js";import{c as fe,d as Ce,e as xe}from"./chunk-YQZAETCE.js";import{s as ve,x as ge}from"./chunk-EO42E46J.js";import"./chunk-3QVSKJ3X.js";import{C as ue,D as _e,H as he,I as B,r as G,s as V,z as de}from"./chunk-ERUCNOOT.js";import{$b as U,Cc as q,Dc as K,Ec as Y,Fc as se,Gc as D,Hc as A,Ib as E,Jb as c,Kb as j,Lb as ae,Mb as M,Nb as T,Qb as f,Qc as s,Rb as re,Rc as m,Sc as k,Tb as W,Tc as ce,Ub as Q,Uc as me,Vb as r,Wb as a,Xb as h,Yb as oe,Z as ee,Zb as le,_ as te,_a as b,_b as N,da as x,db as n,f as Z,fc as L,gc as d,la as P,lc as w,ma as y,nc as R,oc as I,pa as $,sb as O,sc as pe,tb as ie,tc as o,uc as v,vc as u,wb as ne,wc as H,yb as _}from"./chunk-DBE7WQEG.js";import{g as S}from"./chunk-W7GRJBO5.js";var Ye=["content"],Je=["opposite"],Xe=["marker"],J=e=>({$implicit:e});function Ze(e,i){e&1&&N(0)}function et(e,i){e&1&&N(0)}function tt(e,i){if(e&1&&(oe(0),_(1,et,1,0,"ng-container",4),le()),e&2){let t=d().$implicit,l=d();n(),c("ngTemplateOutlet",l.markerTemplate||l._markerTemplate)("ngTemplateOutletContext",A(2,J,t))}}function it(e,i){e&1&&h(0,"div",9),e&2&&E("data-pc-section","marker")}function nt(e,i){e&1&&h(0,"div",10)}function at(e,i){e&1&&N(0)}function rt(e,i){if(e&1&&(r(0,"div",2)(1,"div",3),_(2,Ze,1,0,"ng-container",4),a(),r(3,"div",5),_(4,tt,2,4,"ng-container",6)(5,it,1,1,"ng-template",null,0,me)(7,nt,1,0,"div",7),a(),r(8,"div",8),_(9,at,1,0,"ng-container",4),a()()),e&2){let t=i.$implicit,l=i.last,p=pe(6),g=d();E("data-pc-section","event"),n(),E("data-pc-section","opposite"),n(),c("ngTemplateOutlet",g.oppositeTemplate||g._oppositeTemplate)("ngTemplateOutletContext",A(11,J,t)),n(),E("data-pc-section","separator"),n(),c("ngIf",g.markerTemplate||g._markerTemplate)("ngIfElse",p),n(3),c("ngIf",!l),n(),E("data-pc-section","content"),n(),c("ngTemplateOutlet",g.contentTemplate||g._contentTemplate)("ngTemplateOutletContext",A(13,J,t))}}var ot=({dt:e})=>` 2.p-timeline { 3 display: flex; 4 flex-grow: 1; 5 flex-direction: column; 6 direction: ltr; 7} 8 9.p-timeline-left .p-timeline-event-opposite { 10 text-align: right; 11} 12 13.p-timeline-left .p-timeline-event-content { 14 text-align: left; 15} 16 17.p-timeline-right .p-timeline-event { 18 flex-direction: row-reverse; 19} 20 21.p-timeline-right .p-timeline-event-opposite { 22 text-align: left; 23} 24 25.p-timeline-right .p-timeline-event-content { 26 text-align: right; 27} 28 29.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) { 30 flex-direction: row-reverse; 31} 32 33.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-opposite { 34 text-align: right; 35} 36 37.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(odd) .p-timeline-event-content { 38 text-align: left; 39} 40 41.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-opposite { 42 text-align: left; 43} 44 45.p-timeline-vertical.p-timeline-alternate .p-timeline-event:nth-child(even) .p-timeline-event-content { 46 text-align: right; 47} 48 49.p-timeline-vertical .p-timeline-event-opposite, 50.p-timeline-vertical .p-timeline-event-content { 51 padding: ${e("timeline.vertical.event.content.padding")}; 52} 53 54.p-timeline-vertical .p-timeline-event-connector { 55 width: ${e("timeline.event.connector.size")}; 56} 57 58.p-timeline-event { 59 display: flex; 60 position: relative; 61 min-height: ${e("timeline.event.min.height")}; 62} 63 64.p-timeline-event:last-child { 65 min-height: 0; 66} 67 68.p-timeline-event-opposite { 69 flex: 1; 70} 71 72.p-timeline-event-content { 73 flex: 1; 74} 75 76.p-timeline-event-separator { 77 flex: 0; 78 display: flex; 79 align-items: center; 80 flex-direction: column; 81} 82 83.p-timeline-event-marker { 84 display: inline-flex; 85 align-items: center; 86 justify-content: center; 87 position: relative;
88 align-self: baseline; 89 border-width: ${e("timeline.event.marker.border.width")}; 90 border-style: solid; 91 border-color: ${e("timeline.event.marker.border.color")}; 92 border-radius: ${e("timeline.event.marker.border.radius")}; 93 width: ${e("timeline.event.marker.size")}; 94 height: ${e("timeline.event.marker.size")}; 95 background: ${e("timeline.event.marker.background")}; 96} 97 98.p-timeline-event-marker::before { 99 content: " "; 100 border-radius: ${e("timeline.event.marker.content.border.radius")}; 101 width: ${e("timeline.event.marker.content.size")}; 102 height:${e("timeline.event.marker.content.size")}; 103 background: ${e("timeline.event.marker.content.background")}; 104} 105 106.p-timeline-event-marker::after { 107 content: " "; 108 position: absolute; 109 width: 100%; 110 height: 100%; 111 border-radius: ${e("timeline.event.marker.border.radius")}; 112 box-shadow: ${e("timeline.event.marker.content.inset.shadow")}; 113} 114 115.p-timeline-event-connector { 116 flex-grow: 1; 117 background: ${e("timeline.event.connector.color")}; 118} 119 120.p-timeline-horizontal { 121 flex-direction: row; 122} 123 124.p-timeline-horizontal .p-timeline-event { 125 flex-direction: column; 126 flex: 1; 127} 128 129.p-timeline-horizontal .p-timeline-event:last-child { 130 flex: 0; 131} 132 133.p-timeline-horizontal .p-timeline-event-separator { 134 flex-direction: row; 135} 136 137.p-timeline-horizontal .p-timeline-event-connector { 138 width: 100%; 139 height: ${e("timeline.event.connector.size")}; 140} 141 142.p-timeline-horizontal .p-timeline-event-opposite, 143.p-timeline-horizontal .p-timeline-event-content { 144 padding: ${e("timeline.horizontal.event.content.padding")}; 145} 146 147.p-timeline-horizontal.p-timeline-alternate .p-timeline-event:nth-child(even) { 148 flex-direction: column-reverse; 149} 150 151.p-timeline-bottom .p-timeline-event { 152 flex-direction: column-reverse; 153} 154`,lt={root:({props:e})=>["p-timeline p-component","p-timeline-"+e.align,"p-timeline-"+e.layout],event:"p-timeline-event",eventOpposite:"p-timeline-event-opposite",eventSeparator:"p-timeline-event-separator",eventMarker:"p-timeline-event-marker",eventConnector:"p-timeline-event-connector",eventContent:"p-timeline-event-content"},je=(()=>{class e extends ye{name="timeline";theme=ot;classes=lt;static \u0275fac=(()=>{let t;return function(p){return(t||(t=$(e)))(p||e)}})();static \u0275prov=ee({token:e,factory:e.\u0275fac})}return e})();var X=(()=>{class e extends be{value;style;styleClass;align="left";layout="vertical";contentTemplate;oppositeTemplate;markerTemplate;templates;_contentTemplate;_oppositeTemplate;_markerTemplate;_componentStyle=x(je);get hostClass(){return this.styleClass}getBlockableElement(){return this.el.nativeElement.children[0]}
154ngAfterContentInit(){this.templates.forEach(t=>{switch(t.getType()){case"content":this._contentTemplate=t.template;break;case"opposite":this._oppositeTemplate=t.template;break;case"marker":this._markerTemplate=t.template;break}})}static \u0275fac=(()=>{let t;return function(p){return(t||(t=$(e)))(p||e)}})();static \u0275cmp=O({type:e,selectors:[["p-timeline"]],contentQueries:function(l,p,g){if(l&1&&(w(g,Ye,4),w(g,Je,4),w(g,Xe,4),w(g,F,4)),l&2){let C;R(C=I())&&(p.contentTemplate=C.first),R(C=I())&&(p.oppositeTemplate=C.first),R(C=I())&&(p.markerTemplate=C.first),R(C=I())&&(p.templates=C)}},hostVars:24,hostBindings:function(l,p){l&2&&(E("data-pc-section","root")("data-pc-name","timeline"),M(p.style),T(p.hostClass),ae("p-timeline",!0)("p-component",!0)("p-timeline-left",p.align==="left")("p-timeline-right",p.align==="right")("p-timeline-top",p.align==="top")("p-timeline-bottom",p.align==="bottom")("p-timeline-alternate",p.align==="alternate")("p-timeline-vertical",p.layout==="vertical")("p-timeline-horizontal",p.layout==="horizontal"))},inputs:{value:"value",style:"style",styleClass:"styleClass",align:"align",layout:"layout"},features:[se([je]),ne],decls:1,vars:1,consts:[["marker",""],["class","p-timeline-event",4,"ngFor","ngForOf"],[1,"p-timeline-event"],[1,"p-timeline-event-opposite"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-timeline-event-separator"],[4,"ngIf","ngIfElse"],["class","p-timeline-event-connector",4,"ngIf"],[1,"p-timeline-event-content"],[1,"p-timeline-event-marker"],[1,"p-timeline-event-connector"]],template:function(l,p){l&1&&_(0,rt,10,15,"div",1),l&2&&c("ngForOf",p.value)},dependencies:[B,G,V,de,z],encapsulation:2,changeDetection:0})}return e})(),We=(()=>{class e{static \u0275fac=function(l){return new(l||e)};static \u0275mod=ie({type:e});static \u0275inj=te({imports:[X,z,z]})}return e})();var st=()=>({width:"700px",maxWidth:"95vw"}),ct=()=>({minWidth:"200px"}),mt=()=>[10,20,50],dt=e=>["/studio/purchases",e],ut=(e,i)=>i.label;function _t(e,i){e&1&&h(0,"app-widget-loading")}function ht(e,i){if(e&1){let t=U();r(0,"app-widget-api-error",10),L("retry",function(){P(t);let p=d();return y(p.loadPurchases())}),a()}}function vt(e,i){e&1&&(r(0,"div",7)(1,"div",11)(2,"div",12),h(3,"i",13),a(),r(4,"h2",14),o(5),s(6,"translate"),a(),r(7,"p",15),o(8),s(9,"translate"),a(),r(10,"a",16),h(11,"i",17),o(12),s(13,"translate"),a()()()),e&2&&(n(5),u(" ",m(6,3,"MANAGER.PURCHASES.WELCOME_TITLE")," "),n(3),u(" ",m(9,5,"MANAGER.PURCHASES.WELCOME_DESC")," "),n(4),u(" ",m(13,7,"MANAGER.PURCHASES.WELCOME_CTA")," "))}
154function gt(e,i){if(e&1&&(r(0,"div",24)(1,"div",25),h(2,"i"),a(),r(3,"div",26)(4,"div",27),o(5),a(),r(6,"div",28),o(7),s(8,"translate"),a()()()),e&2){let t=i.$implicit;j("--kpi-color",t.color)("--kpi-bg",t.bgColor),n(2),T(t.icon),n(3),v(t.value),n(2),u(" ",m(8,8,t.label)," ")}}function ft(e,i){if(e&1&&(r(0,"div",18),W(1,gt,9,10,"div",23,ut),a()),e&2){let t=d(2);n(),Q(t.kpiCards)}}function Ct(e,i){e&1&&(r(0,"div",21),h(1,"i",29),r(2,"p",30),o(3),s(4,"translate"),a()()),e&2&&(n(3),u(" ",m(4,1,"MANAGER.PURCHASES.EMPTY")," "))}function xt(e,i){e&1&&(r(0,"tr")(1,"th"),o(2),s(3,"translate"),a(),r(4,"th"),o(5),s(6,"translate"),a(),r(7,"th"),o(8),s(9,"translate"),a(),r(10,"th"),o(11),s(12,"translate"),a(),r(13,"th"),o(14),s(15,"translate"),a()()),e&2&&(n(2),v(m(3,5,"MANAGER.PURCHASES.COL_DATE")),n(3),u(" ",m(6,7,"MANAGER.PURCHASES.COL_SELLER")," "),n(3),v(m(9,9,"MANAGER.PURCHASES.COL_ITEMS")),n(3),v(m(12,11,"MANAGER.PURCHASES.COL_TOTAL")),n(3),u(" ",m(15,13,"MANAGER.PURCHASES.COL_STATUS")," "))}function Et(e,i){if(e&1&&h(0,"img",38),e&2){let t=d().$implicit;c("src",t.sellerInfo.avatarUrl,b)("alt",t.sellerInfo.displayName)}}function St(e,i){if(e&1&&(r(0,"div",39),o(1),s(2,"uppercase"),a()),e&2){let t=d().$implicit;n(),u(" ",m(2,1,((t.sellerInfo==null?null:t.sellerInfo.displayName)||t.bioPageUsername).charAt(0))," ")}}function At(e,i){if(e&1&&h(0,"img",48),e&2){let t=d().$implicit;c("src",t.imageUrl,b)("alt",t.title)}}function Pt(e,i){e&1&&(r(0,"div",49),h(1,"i",50),a())}function yt(e,i){if(e&1&&_(0,At,1,2,"img",48)(1,Pt,2,0,"div",49),e&2){let t=i.$implicit;f(t.imageUrl?0:1)}}function bt(e,i){if(e&1&&(r(0,"div",43),o(1),a()),e&2){let t=d().$implicit;n(),u(" +",t.lineItems.length-3," ")}}function Mt(e,i){if(e&1&&(r(0,"div",47),h(1,"i",51),o(2),s(3,"translate"),s(4,"date"),a()),e&2){let t=d().$implicit;n(2),H(" ",m(3,2,"MANAGER.PURCHASES.OPEN_UNTIL")," ",k(4,4,t.openUntil,"dd/MM HH:mm")," ")}}function Tt(e,i){if(e&1&&(r(0,"tr",34)(1,"td")(2,"span",35),o(3),s(4,"date"),a(),r(5,"span",36),o(6),s(7,"date"),a()(),r(8,"td")(9,"div",37),_(10,Et,1,2,"img",38)(11,St,3,3,"div",39),r(12,"span",40),o(13),a()()(),r(14,"td")(15,"div",41)(16,"div",42),W(17,yt,2,1,null,null,re),s(19,"slice"),_(20,bt,2,1,"div",43),a(),r(21,"span",44),o(22),s(23,"translate"),a()()(),r(24,"td",45),o(25),a(),r(26,"td"),h(27,"p-tag",46),s(28,"translate"),_(29,Mt,5,7,"div",47),a()()),e&2){let t=i.$implicit,l=d(3);c("routerLink",A(26,dt,t.id)),n(3),u(" ",k(4,12,t.createdAt,"dd/MM/yyyy")," "),n(3),u(" ",k(7,15,t.createdAt,"HH:mm")," "),n(4),f(t.sellerInfo!=null&&t.sellerInfo.avatarUrl?10:11),n(3),v((t.sellerInfo==null?null:t.sellerInfo.displayName)||t.bioPageUsername),n(4),Q(ce(19,18,t.lineItems,0,3)),n(3),f(t.lineItems&&t.lineItems.length>3?20:-1),n(2),H(" ",t.itemsCount," ",m(23,22,t.itemsCount>1?"MANAGER.PURCHASES.ITEMS_PLURAL":"MANAGER.PURCHASES.ITEMS_SINGULAR")," "),n(3),u(" ",l.formatPrice(t.totalCents,t.currency)," "),n(2),c("value",m(28,24,"MANAGER.PURCHASES.STATUS_"+t.status.toUpperCase()))("severity",l.getStatusSeverity(t.status)),n(2),f(t.status==="open_cart"&&t.openUntil?29:-1)}}function wt(e,i){if(e&1){let t=U();r(0,"p-table",31),L("onLazyLoad",function(p){P(t);let g=d(2);return y(g.onPageChange(p))}),_(1,xt,16,15,"ng-template",32)(2,Tt,30,28,"ng-template",33),a()}if(e&2){let t=d(2);c("value",t.purchases)("lazy",!0)("paginator",!0)("rows",t.limit)("totalRecords",t.totalPurchases)("rowsPerPageOptions",D(7,mt))("showCurrentPageReport",!0)}}function Rt(e,i){if(e&1){let t=U();_(0,ft,3,0,"div",18),r(1,"div",19)(2,"p-select",20),s(3,"translate"),Y("ngModelChange",function(p){P(t);let g=d();return K(g.statusFilter,p)||(g.statusFilter=p),y(p)}),L("onChange",function(){P(t);let p=d();return y(p.onStatusFilter())}),a()(),_(4,Ct,5,3,"div",21)(5,wt,3,8,"p-table",22)}if(e&2){let t=d();f(t.counts&&t.counts.total?0:-1),n(2),M(D(10,ct)),q("ngModel",t.statusFilter),c("options",t.statusOptions)("placeholder",m(3,8,"MANAGER.PURCHASES.FILTER_STATUS")),n(2),f(t.purchases.length===0?4:-1),n(),f(t.purchases.length>0?5:-1)}}function It(e,i){if(e&1&&(r(0,"span",66),h(1,"i",67),a()),e&2){let t=i.$implicit;j("background-color",t.color),n(),T(t.icon)}}function kt(e,i){if(e&1&&(r(0,"small",62),o(1),s(2,"date"),a()),e&2){let t=d().$implicit;n(),u(" ",k(2,1,t.date,"dd/MM HH:mm")," ")}}function Ot(e,i){e&1&&(r(0,"small",62),o(1,"-"),a())}function Nt(e,i){if(e&1&&(r(0,"div",68)(1,"small",45),o(2),s(3,"translate"),a(),h(4,"br"),_(5,kt,3,4,"small",69)(6,Ot,2,0,"small",69),a()),e&2){let t=i.$implicit;n(2),v(m(3,3,t.status)),n(3),c("ngIf",t.date),n(),c("ngIf",!t.date)}}function Ut(e,i){if(e&1&&(r(0,"a",75),h(1,"p-button",76),a()),e&2){let t=d(3);c("href",t.selectedPurchase.trackingUrl,b),n(),c("text",!0)("rounded",!0)}}function Lt(e,i){if(e&1&&(r(0,"div",70)(1,"h6",71),h(2,"i",72),o(3),s(4,"translate"),a(),r(5,"div",73)(6,"span",45),o(7),a(),r(8,"span"),o(9," - "),a(),r(10,"span"),o(11),a(),_(12,Ut,2,3,"a",74),a()()),e&2){let t=d(2);n(3),u("",m(4,4,"MANAGER.PURCHASES.TRACKING")," "),n(4),v(t.selectedPurchase.carrier||""),n(4),v(t.selectedPurchase.trackingNumber),n(),c("ngIf",t.selectedPurchase.trackingUrl)}}function Ht(e,i){if(e&1&&h(0,"img",78),e&2){let t=d().$implicit;c("src",t.imageUrl,b)}}function Dt(e,i){if(e&1&&(r(0,"tr")(1,"td"),_(2,Ht,1,1,"img",77),a(),r(3,"td"),o(4),a(),r(5,"td",59),o(6),a(),r(7,"td",59),o(8),a(),r(9,"td",59),o(10),a()()),e&2){let t=i.$implicit,l=d(2);n(2),c("ngIf",t.imageUrl),n(2),v(t.title),n(2),v(t.quantity),n(2),u(" ",l.formatPrice(t.unitPriceCents,l.selectedPurchase.currency)," "),n(2),u(" ",l.formatPrice(t.totalCents,l.selectedPurchase.currency)," ")}}function Gt(e,i){if(e&1&&(r(0,"div")(1,"span",62),o(2),s(3,"translate"),a(),r(4,"span",79),o(5),a()()),e&2){let t=d(2);n(2),v(m(3,2,"MANAGER.PURCHASES.DISCOUNT")),n(3),u("-",t.formatPrice(t.selectedPurchase.discountCents,t.selectedPurchase.currency),"")}}function Vt(e,i){if(e&1&&(r(0,"div")(1,"span",62),o(2),s(3,"translate"),a(),r(4,"span",63),o(5),a()()),e&2){let t=d(2);n(2),v(m(3,2,"MANAGER.PURCHASES.SHIPPING")),n(3),v(t.formatPrice(t.selectedPurchase.shippingCents,t.selectedPurchase.currency))}}function Bt(e,i){if(e&1&&(r(0,"div"),o(1),a()),e&2){let t=d(3);n(),u(" ",t.selectedPurchase.shippingAddress.line2," ")}}function Ft(e,i){if(e&1&&(r(0,"div"),o(1),a()),e&2){let t=d(3);n(),u(" ",t.getCountryName(t.selectedPurchase.shippingAddress.country)," ")}}
154function zt(e,i){if(e&1&&(r(0,"div",80)(1,"h6",71),h(2,"i",81),o(3),s(4,"translate"),a(),r(5,"div"),o(6),a(),r(7,"div"),o(8),a(),_(9,Bt,2,1,"div",9),r(10,"div"),o(11),a(),_(12,Ft,2,1,"div",9),a()),e&2){let t=d(2);n(3),u("",m(4,7,"MANAGER.PURCHASES.SHIPPING_ADDRESS")," "),n(3),v(t.selectedPurchase.shippingAddress.name),n(2),v(t.selectedPurchase.shippingAddress.line1),n(),c("ngIf",t.selectedPurchase.shippingAddress.line2),n(2),H(" ",t.selectedPurchase.shippingAddress.postalCode," ",t.selectedPurchase.shippingAddress.city," "),n(),c("ngIf",t.selectedPurchase.shippingAddress.country)}}function $t(e,i){if(e&1&&(r(0,"div")(1,"h5",52),o(2),s(3,"translate"),a(),r(4,"p-timeline",53),_(5,It,2,4,"ng-template",54)(6,Nt,7,5,"ng-template",55),a(),_(7,Lt,13,6,"div",56),r(8,"h5",52),o(9),s(10,"translate"),a(),r(11,"div",57)(12,"table",58)(13,"thead")(14,"tr"),h(15,"th"),r(16,"th"),o(17),s(18,"translate"),a(),r(19,"th",59),o(20),s(21,"translate"),a(),r(22,"th",59),o(23),s(24,"translate"),a(),r(25,"th",59),o(26),s(27,"translate"),a()()(),r(28,"tbody"),_(29,Dt,11,5,"tr",60),a()()(),r(30,"div",61)(31,"div")(32,"span",62),o(33),s(34,"translate"),a(),r(35,"span",63),o(36),a()(),_(37,Gt,6,4,"div",9)(38,Vt,6,4,"div",9),r(39,"div",64)(40,"span"),o(41),s(42,"translate"),a(),r(43,"span",63),o(44),a()()(),_(45,zt,13,9,"div",65),a()),e&2){let t=d();n(2),u(" ",m(3,16,"MANAGER.PURCHASES.TIMELINE_TITLE")," "),n(2),c("value",t.timeline),n(3),c("ngIf",t.selectedPurchase.trackingNumber),n(2),v(m(10,18,"MANAGER.PURCHASES.ITEMS_TITLE")),n(8),u(" ",m(18,20,"MANAGER.PURCHASES.COL_PRODUCT")," "),n(3),u(" ",m(21,22,"MANAGER.PURCHASES.COL_QTY")," "),n(3),u(" ",m(24,24,"MANAGER.PURCHASES.COL_UNIT_PRICE")," "),n(3),u(" ",m(27,26,"MANAGER.PURCHASES.COL_TOTAL")," "),n(3),c("ngForOf",t.selectedPurchase.lineItems),n(4),v(m(34,28,"MANAGER.PURCHASES.SUBTOTAL")),n(3),v(t.formatPrice(t.selectedPurchase.subtotalCents,t.selectedPurchase.currency)),n(),c("ngIf",t.selectedPurchase.discountCents>0),n(),c("ngIf",t.selectedPurchase.shippingCents>0),n(3),v(m(42,30,"MANAGER.PURCHASES.TOTAL_LABEL")),n(3),v(t.formatPrice(t.selectedPurchase.totalCents,t.selectedPurchase.currency)),n(),c("ngIf",t.selectedPurchase.shippingAddress)}}var Qe=class e{shopService=x(ze);toastService=x(Ee);confirmService=x(Fe);t=x(fe);destroy$=new Z;getCountryName=$e;loading=!0;error=null;purchases=[];totalPurchases=0;page=1;limit=20;counts={};initialLoadDone=!1;statusFilter=null;statusOptions=[];showDetail=!1;selectedPurchase=null;timeline=[];ngOnInit(){this.statusOptions=[{label:this.t.instant("MANAGER.PURCHASES.ALL"),value:null},{label:this.t.instant("MANAGER.PURCHASES.STATUS_OPEN_CART"),value:"open_cart"},{label:this.t.instant("MANAGER.PURCHASES.STATUS_PAID"),value:"paid"},{label:this.t.instant("MANAGER.PURCHASES.STATUS_PROCESSING"),value:"processing"},{label:this.t.instant("MANAGER.PURCHASES.STATUS_SHIPPED"),value:"shipped"},{label:this.t.instant("MANAGER.PURCHASES.STATUS_DELIVERED"),value:"delivered"},{label:this.t.instant("MANAGER.PURCHASES.STATUS_RETURN_IN_TRANSIT"),value:"return_in_transit"},{label:this.t.instant("MANAGER.PURCHASES.STATUS_RETURNED"),value:"returned"},{label:this.t.instant("MANAGER.PURCHASES.STATUS_CANCELLED"),value:"cancelled"},{label:this.t.instant("MANAGER.PURCHASES.STATUS_REFUNDED"),value:"refunded"}],this.loadPurchases(),this.loadCounts()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}loadPurchases(){return S(this,null,function*(){this.loading=!0,this.error=null;try{let i=yield this.shopService.listPurchases({page:this.page,limit:this.limit,status:this.statusFilter||void 0});this.purchases=i.data,this.totalPurchases=i.total}catch(i){this.error=i?.error?.message||"Error loading purchases"}finally{this.loading=!1}})}loadCounts(){return S(this,null,function*(){try{this.counts=yield this.shopService.getPurchaseCounts()}catch{}})}onStatusFilter(){this.page=1,this.loadPurchases()}onPageChange(i){if(!this.initialLoadDone){this.initialLoadDone=!0;return}this.page=Math.floor(i.first/i.rows)+1,this.limit=i.rows,this.loadPurchases()}openDetail(i){this.selectedPurchase=i,this.buildTimeline(i),this.showDetail=!0}buildTimeline(i){this.timeline=[{status:"MANAGER.PURCHASES.TIMELINE_ORDERED",date:new Date(i.createdAt),icon:"pi pi-shopping-cart",color:"#6366f1"},{status:"MANAGER.PURCHASES.TIMELINE_PAID",date:i.paidAt?new Date(i.paidAt):null,icon:"pi pi-credit-card",color:i.paidAt?"#22c55e":"#9ca3af"},{status:"MANAGER.PURCHASES.TIMELINE_SHIPPED",date:i.shippedAt?new Date(i.shippedAt):null,icon:"pi pi-truck",color:i.shippedAt?"#3b82f6":"#9ca3af"},{status:"MANAGER.PURCHASES.TIMELINE_DELIVERED",date:i.deliveredAt?new Date(i.deliveredAt):null,icon:"pi pi-check-circle",color:i.deliveredAt?"#22c55e":"#9ca3af"}],i.cancelledAt&&this.timeline.push({status:"MANAGER.PURCHASES.TIMELINE_CANCELLED",date:new Date(i.cancelledAt),icon:"pi pi-times-circle",color:"#ef4444"}),i.refundedAt&&this.timeline.push({status:"MANAGER.PURCHASES.TIMELINE_REFUNDED",date:new Date(i.refundedAt),icon:"pi pi-replay",color:"#f59e0b"})}getStatusSeverity(i){switch(i){case"open_cart":return"secondary";case"paid":return"info";case"processing":return"warn";case"shipped":return"info";case"delivered":return"success";case"cancelled":return"danger";case"abandoned":return"danger";case"refunded":return"danger";case"partially_refunded":return"danger";case"return_in_transit":case"returned":return"warn";default:return"secondary"}}get kpiCards(){return[{icon:"pi pi-shopping-bag",label:"MANAGER.PURCHASES.TOTAL",value:this.counts.total||0,color:"#3b82f6",bgColor:"rgba(59, 130, 246, 0.1)"},{icon:"pi pi-hourglass",label:"MANAGER.PURCHASES.IN_PROGRESS",value:(this.counts.shipped||0)+(this.counts.processing||0),color:"#f59e0b",bgColor:"rgba(245, 158, 11, 0.1)"},{icon:"pi pi-check-circle",label:"MANAGER.PURCHASES.DELIVERED_COUNT",value:this.counts.delivered||0,color:"#22c55e",bgColor:"rgba(34, 197, 94, 0.1)"},{icon:"pi pi-replay",label:"MANAGER.PURCHASES.REFUNDED_COUNT",value:this.counts.refunded||0,color:"#ef4444",bgColor:"rgba(239, 68, 68, 0.1)"}]}canDownloadReceipt(i){return["shipped","delivered"].includes(i.status)}downloadReceipt(i){return S(this,null,function*(){try{let t=yield this.shopService.getPurchaseReceiptUrl(i);t.receiptUrl?window.open(t.receiptUrl,"_blank"):this.toastService.warn(this.t.instant("MANAGER.PURCHASES.NO_RECEIPT"))}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}downloadInvoice(i){return S(this,null,function*(){try{let t=yield this.shopService.downloadPurchaseInvoice(i),l=URL.createObjectURL(t),p=document.createElement("a");p.href=l,p.download=`facture-${i.substring(0,8)}.pdf`,p.click(),URL.revokeObjectURL(l)}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}formatPrice(i,t="EUR"){return(i/100).toFixed(2)+" "+t.toUpperCase()}closeCart(i){return S(this,null,function*(){if(yield this.confirmService.confirm({message:this.t.instant("MANAGER.PURCHASES.CLOSE_CART_CONFIRM"),header:this.t.instant("MANAGER.PURCHASES.CLOSE_CART_TITLE"),severity:"info",acceptLabel:this.t.instant("MANAGER.PURCHASES.CLOSE_CART_ACCEPT"),rejectLabel:this.t.instant("COMMON.CANCEL")}))try{yield this.shopService.closePurchaseCart(i.id),this.toastService.success(this.t.instant("MANAGER.PURCHASES.CLOSE_CART_SUCCESS")),this.loadPurchases(),this.loadCounts()}catch{this.toastService.error(this.t.instant("COMMON.ERROR"))}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=O({type:e,selectors:[["app-view-manager-purchases"]],decls:18,vars:18,consts:[[1,"container-fluid","py-4"],["routerLink","/studio/account",1,"d-inline-flex","align-items-center","text-decoration-none","text-muted","mb-3","back-link"],[1,"pi","pi-arrow-left","me-2"],[1,"d-flex","justify-content-between","align-items-center","mb-4","flex-wrap","gap-2"],[1,"d-flex","align-items-center"],[1,"text-light","fs-6"],[1,"pi","pi-shopping-bag","me-2"],[1,"card"],[3,"visibleChange","header","visible","modal","closeOnEscape","dismissableMask"],[4,"ngIf"],[3,"retry"],[1,"card-body","text-center","py-5"],[1,"welcome-icon","mb-3","mx-auto"],[1,"pi","pi-shopping-bag"],[1,"fs-5","fw-semibold","mb-2"],[1,"text-muted","mb-4",2,"max-width","440px","margin","0 auto"],["routerLink","/","pButton","",1,"p-button-primary","p-button-sm"],[1,"pi","pi-search","me-2"],[1,"kpi-grid","mb-4"],[1,"d-flex","align-items-center","gap-3","mb-4"],["o
154ptionLabel","label","optionValue","value",3,"ngModelChange","onChange","ngModel","options","placeholder"],[1,"text-center","py-5"],["styleClass","p-datatable-sm purchases-table",3,"value","lazy","paginator","rows","totalRecords","rowsPerPageOptions","showCurrentPageReport"],[1,"kpi-card",3,"--kpi-color","--kpi-bg"],[1,"kpi-card"],[1,"kpi-icon"],[1,"kpi-content"],[1,"kpi-value"],[1,"kpi-label"],[1,"pi","pi-filter-slash","text-muted",2,"font-size","2.5rem"],[1,"mt-3","text-muted"],["styleClass","p-datatable-sm purchases-table",3,"onLazyLoad","value","lazy","paginator","rows","totalRecords","rowsPerPageOptions","showCurrentPageReport"],["pTemplate","header"],["pTemplate","body"],[1,"purchase-row",3,"routerLink"],[1,"purchase-date"],[1,"purchase-time","text-muted"],[1,"seller-cell"],["width","28","height","28",1,"rounded-circle","seller-avatar",2,"object-fit","cover",3,"src","alt"],[1,"rounded-circle","d-flex","align-items-center","justify-content-center","seller-avatar-placeholder"],[1,"seller-name"],[1,"items-cell"],[1,"items-thumbs"],[1,"item-thumb","item-thumb--more"],[1,"items-count","text-muted"],[1,"fw-semibold"],[3,"value","severity"],[1,"text-muted","mt-1",2,"font-size","0.75em"],[1,"item-thumb",3,"src","alt"],[1,"item-thumb","item-thumb--placeholder"],[1,"pi","pi-box"],[1,"pi","pi-clock","me-1"],[1,"mb-3"],["layout","horizontal","align","bottom",1,"mb-4",3,"value"],["pTemplate","marker"],["pTemplate","content"],["class","mb-4 p-3 border rounded",4,"ngIf"],[1,"table-responsive","mb-4"],[1,"table","table-sm"],[1,"text-end"],[4,"ngFor","ngForOf"],[1,"d-flex","flex-column","align-items-end","gap-1","mb-3"],[1,"text-muted"],[1,"ms-3"],[1,"fw-bold","fs-5","mt-1"],["class","p-3 border rounded",4,"ngIf"],[1,"d-flex","align-items-center","justify-content-center","rounded-circle",2,"width","2rem","height","2rem","color","white"],[2,"font-size","0.85rem"],[1,"text-center"],["class","text-muted",4,"ngIf"],[1,"mb-4","p-3","border","rounded"],[1,"mb-2"],[1,"pi","pi-truck","me-2"],[1,"d-flex","align-items-center","gap-2"],["target","_blank","class","ms-2",3,"href",4,"ngIf"],["target","_blank",1,"ms-2",3,"href"],["icon","pi pi-external-link","severity","info",3,"text","rounded"],["alt","","width","40","height","40","class","rounded","style","object-fit: cover",3,"src",4,"ngIf"],["alt","","width","40","height","40",1,"rounded",2,"object-fit","cover",3,"src"],[1,"ms-3","text-success"],[1,"p-3","border","rounded"],[1,"pi","pi-map-marker","me-2"]],template:function(t,l){t&1&&(r(0,"div",0)(1,"a",1),h(2,"i",2),o(3),s(4,"translate"),a(),r(5,"div",3)(6,"div",4)(7,"span",5),h(8,"i",6),o(9),s(10,"translate"),a()()(),_(11,_t,1,0,"app-widget-loading")(12,ht,1,0,"app-widget-api-error")(13,vt,14,9,"div",7)(14,Rt,6,11),a(),r(15,"p-dialog",8),s(16,"translate"),Y("visibleChange",function(g){return K(l.showDetail,g)||(l.showDetail=g),g}),_(17,$t,46,32,"div",9),a()),t&2&&(n(3),u(" ",m(4,11,"MANAGER.PURCHASES.BACK_TO_ACCOUNT")," "),n(6),u(" ",m(10,13,"MANAGER.PURCHASES.TITLE")," "),n(2),f(l.loading&&l.purchases.length===0?11:l.error?12:l.purchases.length===0&&!l.statusFilter?13:14),n(4),M(D(17,st)),c("header",m(16,15,"MANAGER.PURCHASES.DETAIL_TITLE")),q("visible",l.showDetail),c("modal",!0)("closeOnEscape",!0)("dismissableMask",!0),n(2),c("ngIf",l.selectedPurchase))},dependencies:[B,G,V,ue,he,_e,ge,ve,Pe,Se,Ae,xe,Ce,Ie,we,Re,F,Ve,Ge,De,He,Le,Ue,Ne,Oe,Me,We,X,ke,Te,Be],styles:["[_nghost-%COMP%]{display:block}.back-link[_ngcontent-%COMP%]{font-size:.875rem;transition:color .2s}.back-link[_ngcontent-%COMP%]:hover{color:var(--p-primary-color)!important}.kpi-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.kpi-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:16px;border-radius:12px;background:var(--kpi-bg);transition:transform .2s ease,box-shadow .2s ease}.kpi-card[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 4px 12px #00000014}.kpi-icon[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:10px;background:var(--kpi-color);display:flex;align-items:center;justify-content:center;flex-shrink:0}.kpi-icon[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff;font-size:1rem}.kpi-content[_ngcontent-%COMP%]{min-width:0}.kpi-value[_ngcontent-%COMP%]{font-size:1.4rem;font-weight:700;color:#1e293b;line-height:1.2}.kpi-label[_ngcontent-%COMP%]{font-size:.72rem;color:#64748b;text-transform:uppercase;letter-spacing:.3px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.welcome-icon[_ngcontent-%COMP%]{width:72px;height:72px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--p-primary-50);color:var(--p-primary-color);font-size:2rem}.seller-cell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}
154.seller-avatar[_ngcontent-%COMP%]{transition:box-shadow .2s ease;flex-shrink:0}.seller-avatar-placeholder[_ngcontent-%COMP%]{width:28px;height:28px;background:var(--p-primary-100);color:var(--p-primary-600);font-weight:600;font-size:.75rem;flex-shrink:0}.seller-name[_ngcontent-%COMP%]{font-size:.85rem;color:var(--p-text-color, #374151);font-weight:500;line-height:1.2;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.purchase-row[_ngcontent-%COMP%]{cursor:pointer;transition:background .15s ease}.purchase-row[_ngcontent-%COMP%]:hover{background:var(--p-highlight-background, rgba(59, 130, 246, .04))!important}.purchase-date[_ngcontent-%COMP%]{display:block;font-size:.85rem;font-weight:500}.purchase-time[_ngcontent-%COMP%]{display:block;font-size:.75rem}.items-cell[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.items-thumbs[_ngcontent-%COMP%]{display:flex;gap:4px}.item-thumb[_ngcontent-%COMP%]{width:36px;height:36px;border-radius:6px;object-fit:cover;border:1px solid var(--p-surface-200, #e5e7eb)}.item-thumb--placeholder[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background:var(--p-surface-100, #f3f4f6);color:var(--p-surface-400, #9ca3af);font-size:.85rem}.item-thumb--more[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;background:var(--p-surface-100, #f3f4f6);color:var(--p-surface-500, #6b7280);font-size:.7rem;font-weight:600;border:1px solid var(--p-surface-200, #e5e7eb)}.items-count[_ngcontent-%COMP%]{font-size:.75rem}"]})};export{Qe as ViewManagerPurchasesComponent};
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.