1import{A as u,aI as o,aJ as d,aK as _}from"./sdk.gen-BbqaFdWU.js";import{bj as p,b_ as g,b$ as m}from"./index-xvZlaxsi.js";const L=[1,2,3,4];function R(a){return L.includes(a)?a:null}class c{static toDomain(t){const e=R(t.tier);return e===null?null:{tier:e,currentPoints:t.current_points,tierPoints:t.target_points}}}function E(a){return{code:a.code,label:a.label,displayValue:a.display_value,displayPoints:a.display_points,status:a.status,helpText:a.help_text??void 0}}class D{static toDomain(t){const e=c.toDomain(t);return e?{...e,pointsCards:t.points_cards.map(E)}:null}}class T{static toDomain(t){return t.map(e=>({code:e.code,iconCode:e.icon_code??void 0,label:e.label,actionTarget:e.action_target??void 0,badges:e.badges.map(r=>({label:r.label,badgeType:r.badge_type??void 0}))}))}}class O{static toDomain(t){return t.map(e=>({id:e.id,label:e.label,displayPoints:e.display_points,status:e.status,displayDate:e.display_date}))}}var n,l,i,y,s;let h=(n=p(),l=function(a,t){return g(m.EnvVars)(a,void 0,0)},i=Reflect.metadata("design:type",Function),y=Reflect.metadata("design:paramtypes",[typeof IEnvVars>"u"?Object:IEnvVars]),n(s=l(s=i(s=y(s=class extends u{constructor(t){super(t.serverUrl,"token")}async getLoyaltySummary(){try{const t=await o({client:this.clientWithAuth});if(t.error)return[null,{code:"LOYALTY_SUMMARY_ERROR",message:"Error getting loyalty summary"}];const e=c.toDomain(t.data);return e?[e,null]:[null,{code:"INVALID_TIER",message:"Received an unsupported loyalty tier"}]}catch{return[null,{code:"LOYALTY_SUMMARY_ERROR",message:"Error getting loyalty summary"}]}}async getLoyaltyDetails(){try{const t=await o({client:this.clientWithAuth});if(t.error)return[null,{code:"LOYALTY_DETAILS_ERROR",message:"Error getting loyalty details"}];const e=D.toDomain(t.data);return e?[e,null]:[null,{code:"INVALID_TIER",message:"Received an unsupported loyalty tier"}]}catch{return[null,{code:"LOYALTY_DETAILS_ERROR",message:"Error getting loyalty details"}]}}async getLoyaltyMovements(){try{const t=await d({client:this.clientWithAuth});return t.error?[null,{code:"LOYALTY_MOVEMENTS_ERROR",message:"Error getting loyalty movements"}]:[O.toDomain(t.data),null]}catch{return[null,{code:"LOYALTY_MOVEMENTS_ERROR",message:"Error getting loyalty movements"}]}}async getLoyaltyGuides(){try{const t=await _({client:this.clientWithAuth});return t.error?[null,{code:"LOYALTY_GUIDES_ERROR",message:"Error getting loyalty guides"}]:[T.toDomain(t.data),null]}catch{return[null,{code:"LOYALTY_GUIDES_ERROR",message:"Error getting loyalty guides"}]}}})||s)||s)||s)||s);export{h as Loyalty_Repository};
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.