1import{a as se}from"./chunk-DFWETVRG.js";import{$ as ne,Bc as f,Cc as y,Dc as oe,Ec as le,Fc as re,Z as ee,_ as te,ab as ie,xb as ae}from"./chunk-B6QQTL5U.js";import"./chunk-3YLKWUWH.js";import"./chunk-B3ZX5VU2.js";import"./chunk-DQFPXF55.js";import"./chunk-WQJBBTCI.js";import"./chunk-4CJWBYCB.js";import"./chunk-SURXIWHQ.js";import"./chunk-XA5FCWDS.js";import"./chunk-HI2SFOKG.js";import"./chunk-Q4RKSZPF.js";import"./chunk-EAXXXKJF.js";import"./chunk-TSAGDD3L.js";import"./chunk-2KLHVVXY.js";import"./chunk-57ZE2MFX.js";import{La as Q,Q as K}from"./chunk-2K3OMPC4.js";import"./chunk-Y7RIDXUL.js";import"./chunk-YEGPHGBX.js";import"./chunk-7RCWNHPV.js";import{b as Z}from"./chunk-UVZTK3KN.js";import"./chunk-SHGQQ3FD.js";import"./chunk-V4O2LDMY.js";import"./chunk-2ST2D35A.js";import"./chunk-QM7L3NXF.js";import"./chunk-FQJS5LDW.js";import"./chunk-QNL77YDP.js";import"./chunk-57ZU5LG5.js";import"./chunk-PHLZ3AAU.js";import"./chunk-M6TI2MTM.js";import"./chunk-3X7N74SL.js";import"./chunk-GDVMO23R.js";import{a as J}from"./chunk-L24GWH2F.js";import"./chunk-XZ7DUGPR.js";import{o as H}from"./chunk-DVYNXNTI.js";import"./chunk-4KBURNX4.js";import{d as W}from"./chunk-5HC4BW43.js";import"./chunk-B6STJHB2.js";import{k as G}from"./chunk-PWUAYS4F.js";import"./chunk-YJKRYWMV.js";import{a as X}from"./chunk-ZDR3KJJS.js";import"./chunk-KTIPPCE2.js";import{k as N,o as j,p as V,q as Y,t as q}from"./chunk-IVJ2I5VN.js";import{$b as m,Aa as k,Cb as $,E as g,Ec as l,Fc as M,Gb as w,Gc as _,Hc as E,L as D,Vc as s,Wc as u,Xc as x,Zb as p,ac as F,ba as S,bc as B,cc as O,dc as C,ea as h,ec as i,fc as a,gc as R,kc as A,lc as U,mb as o,nc as z,rc as L,s as v,t as b,tc as d,xb as I,za as P}from"./chunk-EN2B4KZW.js";import"./chunk-4KIXNS7N.js";function de(t,c){t&1&&(i(0,"div",5),R(1,"span",9),i(2,"em"),l(3," loading redemptions..."),a()())}function ce(t,c){if(t&1&&(i(0,"div",5)(1,"h2",2),l(2),s(3,"async"),a()()),t&2){let e=d();o(2),M(u(3,1,e.noResultsMessage$))}}function pe(t,c){if(t&1&&(i(0,"span"),l(1),s(2,"titlecase"),a()),t&2){let e=d().$implicit;o(),E(" ",u(2,2,e==null?null:e.account_type)," account ending in ",e==null?null:e.account_last_4," ")}}function me(t,c){if(t&1&&(i(0,"span",14)(1,"strong"),l(2,"Sent to: "),a(),l(3),a()),t&2){let e=d().$implicit;o(3),_("",e==null?null:e.email," ")}}function ue(t,c){if(t&1&&(i(0,"span"),l(1),s(2,"date"),a()),t&2){let e=d().$implicit;o(),_("Delivered on ",x(2,1,e.estimated_pay_date,"shortDate"))}}function Ce(t,c){t&1&&R(0,"span",24)}function _e(t,c){if(t&1){let e=z();i(0,"button",23),s(1,"async"),L("click",function(){P(e);let r=d().$implicit,T=d(2);return k(T.cancelRedemption(r.id))}),p(2,Ce,1,0,"span",24),s(3,"async"),l(4," Cancel "),a()}if(t&2){let e=d().$implicit,n=d(2);C("disabled",u(1,2,n.cancelPending$)),o(2),m(u(3,4,n.cancelPending$)&&n.currentCancelID===e.id?2:-1)}}function ge(t,c){if(t&1&&(i(0,"tr")(1,"td",13)(2,"span")(3,"strong"),l(4),a()(),p(5,pe,3,4,"span"),p(6,me,4,1,"span",14),i(7,"small",15)(8,"span",16),A(9,17),l(10),s(11,"date"),U(),a()()(),i(12,"td",18),l(13),s(14,"currency"),a(),i(15,"td",19)(16,"span",20),l(17),a()(),i(18,"td",21),p(19,ue,3,4,"span"),p(20,_e,5,6,"button",22),a()()),t&2){let e=c.$implicit,n=d(2);o(4),E(" ",e==null?null:e.method," ",(e==null?null:e.source)==="prizeout"?"Digital Gift Card":""," "),o(),m(e!=null&&e.account_last_4?5:-1),o(),m(e!=null&&e.email&&(e==null?null:e.method)==="Prizeout"?6:-1),o(4),M(x(11,10,e==null?null:e.timestamp,"medium")),o(3),_(" ",x(14,13,e==null?null:e.amount,"USD")," "),o(3),C("ngClass",n.handleTransactionStatusClasses(e==null?null:e.status)),o(),_(" ",e==null?null:e.status," "),o(2),m(e.estimated_pay_date?19:-1),o(),m((e==null?null:e.status)==="Pending"&&(e==null?null:e.method)!=="Prizeout"?20:-1)}}function he(t,c){if(t&1&&(i(0,"div",6)(1,"table",10)(2,"thead")(3,"tr",11)(4,"th",12),l(5,"Details"),a(),i(6,"th",12),l(7,"Amount (USD)"),a(),i(8,"th",12),l(9,"Status"),a(),i(10,"th",12),l(11,"Actions"),a()()(),i(12,"tbody"),B(13,ge,21,16,"tr",null,F),s(15,"async"),a()()()),t&2){let e=d();o(13),O(u(15,0,e.redemptions$))}}var Te=(()=>{class t extends Z{constructor(e){super(),this.store=e,this.redemptions$=this.store.select(f),this.myAccountLink=`/${J.MY_ACCOUNT}`,this.loadingRedemptions$=this.store.select(y),this.cancelPending$=this.store.select(oe),this.noResults$=b([this.store.select(f),this.store.select(y)]).pipe(S(([n,r])=>!n&&!!r),v(([n,r])=>n?.length===0&&!r)),this.noResultsMessage$=b([this.store.select(f),this.store.select(y),this.store.select(le)]).pipe(S(([n,r,T])=>!n&&!!r),v(([,,n])=>n||"No Redemptions Found"))}handleTransactionStatusClasses(e){switch(e){case"Pending":case"Under Review":case"Approved":return"pending";case"Rejected":case"Failed":case"Canceled":return"error";
1case"Processed":return"success";default:return""}}cancelRedemption(e){this.currentCancelID=e,this.store.dispatch(Q({redemptionID:e})),this.store.select(ae).pipe(g(n=>!!n),D(1),h(this.destroyed$)).subscribe(n=>{n?.confirmCancel&&this.store.dispatch(te({redemptionID:n.redemptionID}))})}ngOnInit(){this.store.dispatch(ee()),this.store.select(re).pipe(g(e=>!!e),h(this.destroyed$)).subscribe(e=>{e&&this.store.dispatch(K({zendeskTicketFormId:W.zendesk.ticketFormIds.paymentIneligible,message:"We're sorry, but there was an error while trying to cancel your redemption. Please try again, or contact our Support Team for additional assistance"}))}),this.store.select(ie).pipe(g(e=>!!e),h(this.destroyed$)).subscribe(()=>this.store.dispatch(ne()))}static{this.\u0275fac=function(n){return new(n||t)(I(H))}}static{this.\u0275cmp=$({type:t,selectors:[["app-redemption-management"]],features:[w],decls:16,vars:12,consts:[[3,"useTransparentBg","showCardFooter"],[1,"title"],[1,"h5"],[1,"mb-0","text-left"],[1,"content"],[1,"m-auto"],[1,"table-container"],[1,"buttons"],[1,"ml-auto","mr-auto",3,"routerLink"],["role","status","aria-hidden","true",1,"spinner-border","spinner-border-sm","mr-1"],[1,"responsive-table"],[1,"text-center"],["scope","col"],["data-label","Details",1,"stack-data"],[1,"text-wrap"],[1,"d-inline-flex","align-items-center","gap-xs","text-nowrap"],["icon","","color","var(--c-cool-purple)","name","clock-icon",1,"d-inline-flex"],["content",""],["data-label","Amount (USD)"],["data-label","Status"],[1,"badge",3,"ngClass"],["data-label","Actions"],[1,"block-button","small","secondary",3,"disabled"],[1,"block-button","small","secondary",3,"click","disabled"],["role","status","aria-hidden","true",1,"spinner-border","mr-2"]],template:function(n,r){n&1&&(i(0,"app-display-card",0)(1,"div",1)(2,"h1",2),l(3,"Manage Redemptions"),a(),i(4,"p",3),l(5," Your recent 90 days of redemption requests are below. If a redemption request is eligible to be canceled, a button will appear in the Actions column. Prizeout digital gift card cannot be canceled without contacting the Support Team. "),a()(),i(6,"div",4),p(7,de,4,0,"div",5),s(8,"async"),p(9,ce,4,3,"div",5),s(10,"async"),p(11,he,16,2,"div",6),s(12,"async"),a(),i(13,"div",7)(14,"a",8),l(15,"RETURN TO MY ACCOUNT"),a()()()),n&2&&(C("useTransparentBg",!0)("showCardFooter",!0),o(7),m(u(8,6,r.loadingRedemptions$)?7:-1),o(2),m(u(10,8,r.noResults$)===!0?9:-1),o(2),m(u(12,10,r.noResults$)===!1?11:-1),o(3),C("routerLink",r.myAccountLink))},dependencies:[se,X,N,G,j,V,q,Y],styles:["[_nghost-%COMP%]{display:flex;justify-content:center}app-display-card[_ngcontent-%COMP%]{max-width:50em}app-display-card[_ngcontent-%COMP%] .body{padding-bottom:0}.table-container[_ngcontent-%COMP%]{font-size:.85em;width:100%}.content[_ngcontent-%COMP%]{overflow-y:auto;height:calc(100dvh - var(--site-header-height) * 4.85);display:flex}@media screen and (min-width: 600px){.content[_ngcontent-%COMP%]{height:calc(100dvh - var(--site-header-height) * 3.75)}}.color-dark-purple[_ngcontent-%COMP%]{color:var(--c-dark-purple)}.gap-xs[_ngcontent-%COMP%]{gap:.5em}.spinner-border[_ngcontent-%COMP%]{width:1em;height:1em;border-width:.2em}"],changeDetection:0})}}return t})();export{Te as RedemptionManagementComponent};
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.