1"use strict";(self.webpackChunkqp_manager_app=self.webpackChunkqp_manager_app||[]).push([[2086],{55354:(Z,v,n)=>{n.r(v),n.d(v,{AdminResellersModule:()=>he});var u=n(7530),t=n(63549),d=n(62403),E=n(76428),D=n(44369),M=n(39865),C=n(61731),P=n(74299),r=n(21298),a=n(26463),i=n(82169),g=n(63756),h=n(89723),p=n(76889),f=n(95339),e=n(94604),x=n(99686),B=n(56840),I=n(20332),y=n(34605),J=n(50442),O=n(40071),S=n(46228),K=n(76025),U=n(50288),Q=n(40902),L=n(83442),T=n(49421),W=n(11141),b=n(23273),N=n(64779),z=n(96693);function Y(s,c){1&s&&e._UZ(0,"mat-progress-bar",34)}function F(s,c){1&s&&(e.TgZ(0,"th",35),e._uU(1,"ID"),e.qZA())}function G(s,c){if(1&s&&(e.TgZ(0,"td",36),e._uU(1),e.qZA()),2&s){const o=c.$implicit;e.xp6(),e.Oqu(o.id)}}function j(s,c){1&s&&(e.TgZ(0,"th",37),e._uU(1,"Customer name"),e.qZA())}function $(s,c){if(1&s&&(e.TgZ(0,"td",36),e._uU(1),e.qZA()),2&s){const o=c.$implicit;e.xp6(),e.Oqu(o.customer_address.name)}}function H(s,c){1&s&&(e.TgZ(0,"th",37),e._uU(1,"Customer country"),e.qZA())}function w(s,c){if(1&s&&(e.TgZ(0,"td",36),e._uU(1),e.qZA()),2&s){const o=c.$implicit,m=e.oxw();e.xp6(),e.Oqu(m.getResellerCountry(o))}}function q(s,c){1&s&&(e.TgZ(0,"th",38),e._uU(1,"Merchants"),e.qZA())}function X(s,c){if(1&s&&(e.TgZ(0,"td",36),e._uU(1),e.qZA()),2&s){const o=c.$implicit;e.xp6(),e.Oqu(o.merchants_count)}}function V(s,c){1&s&&(e.TgZ(0,"th",37),e._uU(1,"Flags"),e.qZA())}function k(s,c){1&s&&(e.TgZ(0,"mat-icon",40),e._uU(1," warning "),e.qZA())}function ee(s,c){if(1&s&&(e.TgZ(0,"td",36),e.YNc(1,k,2,0,"mat-icon",39),e.qZA()),2&s){const o=c.$implicit;e.xp6(),e.Q6J("ngIf",o.suspended_at)}}function te(s,c){1&s&&(e.TgZ(0,"th",37),e._uU(1,"Created at"),e.qZA())}function ne(s,c){if(1&s&&(e.TgZ(0,"td",36),e._UZ(1,"qp-date-field",41),e.qZA()),2&s){const o=c.$implicit;e.xp6(),e.Q6J("date",o.created_at)}}function se(s,c){1&s&&(e.TgZ(0,"th",37),e._uU(1,"Deleted at"),e.qZA())}function oe(s,c){if(1&s&&(e.TgZ(0,"td",36),e._UZ(1,"qp-date-field",41),e.qZA()),2&s){const o=c.$implicit;e.xp6(),e.Q6J("date",o.deleted_at)}}function ae(s,c){1&s&&(e.TgZ(0,"th",37),e._uU(1,"Actions"),e.qZA())}const ie=s=>["../reseller",s];function re(s,c){if(1&s&&(e.TgZ(0,"td",42),e.NdJ("click",function(m){return m.stopPropagation()}),e.TgZ(1,"button",43)(2,"mat-icon",7),e._uU(3,"zoom_in"),e.qZA()()()),2&s){const o=c.$implicit;e.xp6(),e.Q6J("routerLink",e.VKq(1,ie,o.id))}}function le(s,c){1&s&&e._UZ(0,"tr",44)}function ce(s,c){if(1&s){const o=e.EpF();e.TgZ(0,"tr",45),e.NdJ("click",function(){const _=e.CHM(o).$implicit,R=e.oxw();return e.KtG(R.suReseller(_.id))}),e.qZA()}}function me(s,c){if(1&s){const o=e.EpF();e.TgZ(0,"qp-no-results",46),e.NdJ("searchChange",function(l){e.CHM(o);const _=e.oxw();return e.KtG(_.search=l)})("getPage",function(){e.CHM(o);const l=e.oxw();return e.KtG(l.getResellers())}),e.qZA()}if(2&s){const o=e.oxw();e.Q6J("search",o.search)}}const de=()=>["../reseller-details"],ue=()=>[10,100],_e=[{path:"",component:(()=>{class s{constructor(o,m,l,_,R,ge,fe){this.countryService=o,this.exporterService=m,this.paramService=l,this.resellerRepo=_,this.searchService=R,this.suService=ge,this.activatedRoute=fe,this.displayColumns=[],this.resellerParser={parse:(A,Ae)=>({Id:A.id,Company_name:A.customer_address?.name,Company_street:A.customer_address?.street,Company_city:A.customer_address?.city,Company_zipcode:A.customer_address?.zip_code,Company_region:A.customer_address?.region,Company_country_code:A.customer_address?.country_code,Company_vat_no:A.customer_address?.vat_no,Created_at:A.created_at,Merchants_count:A.merchants_count,Contact_email:A.contact_email})}}ngOnInit(){this.resellers=[];const o=Number(this.activatedRoute.snapshot.queryParams.page);this.search=decodeURIComponent(this.activatedRoute.snapshot.queryParams.search),"undefined"===this.search&&(this.search=void 0),this.search&&(this.autoFocus=!0),this.paginator.pageIndex=o?o-1:0,this.paginator.pageSize=Number(this.activatedRoute.snapshot.queryParams.page_size)||10,this.isDeleted=this.activatedRoute.snapshot.queryParams.deleted||"false",this.searching=""!==this.search,this.sort.active=this.activatedRoute.snapshot.queryParams.sort_by||"id",this.sort.direction=this.activatedRoute.snapshot.queryParams.sort_dir||"desc",this.search&&(this.autoFocus=!0),this.getResellers()}suReseller(o){this.suService.suReseller(o,"/account",{account_id:o}).subscribe()}changeSort(){this.paginator.pageIndex=0,this.getResellers()}exportResellers(){this.exporterService.exportObjects(this.resellerRepo,{page_size:100},["Id","Company name","Company street","Company city","Company zipcode","Company region","Company country code","Company vat no","Created at","Merchants count","Contact email"],{},"Export",this.resellerParser)}onSearch(o){this.searching=!0,this.search=o,this.paginator.pageIndex=0,this.getResellers()}setTableColumns(){this.displayColumns=["id","name","country","merchants_count","flags"],this.displayColumns=this.displayColumns.concat("true"===this.isDeleted?["deleted_at","actions"]:["created_at","actions"])}getResellers(){this.setTableColumns(),this.gettingResellers=!0;const o={page:this.paginator.pageIndex+1,page_size:this.paginator.pageSize,sort_by:this.sort.active,sort_dir:this.sort.direction,deleted:this.isDeleted};this.search&&(this.search=this.searchService.queryReplace(this.search),o.search=this.search),this.paramService.setParams({search:null,deleted:this.isDeleted||"false",...o},this.activatedRoute),this.resellerRepo.getAll(o).pipe((0,p.K)(m=>{throw this.resellers=[],m}),(0,f.x)(()=>{this.gettingResellers=!1,this.searching=!1})).subscribe(m=>{this.resellers=m})}getResellerCountry(o){return this.countryService.getCountryFromCode(o?.customer_address?.country_code??"")?.name??""}static{this.\u0275fac=function(m){return new(m||s)(e.Y36(g.T),e.Y36(x.M),e.Y36(B.t),e.Y36(I.J),e.Y36(y.o),e.Y36(h.R),e.Y36(d.gz))}}static{this.\u0275cmp=e.Xpm({type:s,selectors:[["qp-admin-resellers"]],viewQuery:function(m,l){if(1&m&&(e.Gf(a.NW,7),e.Gf(i.YE,7)),2&m){let _;e.iGM(_=e.CRH())&&(l.paginator=_.first),e.iGM(_=e.CRH())&&(l.sort=_.first)}},decls:52,vars:16,consts:[[1,"wide-content"],[1,"flex-row","cg8","toolbar",3,"ngModel","ngModelChange","change"],["value","false"],["value","true"],[1,"flex-1"],["placeholder","Search...",3,"autoFocus","search","searchInvoked","searchChange"],["mat-icon-button","","aria-label","Export resellers","matTooltip","Export resellers",3,"click"],["color","primary"],["xPosition","before"],["merchantMenu","matMenu"],["mat-menu-item","",3,"routerLink"],["mat-icon-button","",3,"matMenuTriggerFor"],["color","primary","aria-label","Get reseller info","matTooltip","Get reseller info"],["color","accent","mode","indeterminate",4,"ngIf"],["mat-card-image","",1,"flex-col","margin-negative"],["mat-table","","matSort","","matSortDisableClear","",3,"dataSource","matSortChange"],["table",""],["matColumnDef","id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["matColumnDef","country"],["matColumnDef","merchants_count"],["mat-header-cell","","mat-numeric","",4,"matHeaderCellDef"],["matColumnDef","flags"],["matColumnDef","created_at"],["matColumnDef","deleted_at"],["matColumnDef","actions"],["mat-cell","","colspan","2","class","icon-cell",3,"click",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","","class","pointer",3,"click",4,"matRowDef","matRowDefColumns"],["type","resellers",3,"search","searchChange","getPage",4,"ngIf"],["color","accent",3,"length","pageSizeOptions","page"],["color","accent","mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-header-cell","","mat-numeric",""],["matTooltip","Re
1seller is suspended","class","text-yellow s18",4,"ngIf"],["matTooltip","Reseller is suspended",1,"text-yellow","s18"],[3,"date"],["mat-cell","","colspan","2",1,"icon-cell",3,"click"],["mat-icon-button","","matTooltip","Details",1,"s18","cursor",3,"routerLink"],["mat-header-row",""],["mat-row","",1,"pointer",3,"click"],["type","resellers",3,"search","searchChange","getPage"]],template:function(m,l){if(1&m&&(e.TgZ(0,"mat-card",0)(1,"mat-toolbar")(2,"mat-toolbar-row")(3,"mat-radio-group",1),e.NdJ("ngModelChange",function(R){return l.isDeleted=R})("change",function(){return l.changeSort()}),e.TgZ(4,"mat-radio-button",2),e._uU(5,"Active"),e.qZA(),e.TgZ(6,"mat-radio-button",3),e._uU(7,"Deleted"),e.qZA()(),e._UZ(8,"span",4),e.TgZ(9,"qp-search-field-small",5),e.NdJ("searchInvoked",function(R){return l.onSearch(R.search)})("searchChange",function(R){return l.search=R}),e.qZA(),e.TgZ(10,"button",6),e.NdJ("click",function(){return l.exportResellers()}),e.TgZ(11,"mat-icon",7),e._uU(12,"cloud_download"),e.qZA()(),e.TgZ(13,"mat-menu",8,9)(15,"button",10),e._uU(16,"Get reseller info"),e.qZA()(),e.TgZ(17,"button",11)(18,"mat-icon",12),e._uU(19,"more_vert"),e.qZA()()()(),e.YNc(20,Y,1,0,"mat-progress-bar",13),e.TgZ(21,"mat-card-content",14)(22,"table",15,16),e.NdJ("matSortChange",function(){return l.changeSort()}),e.ynx(24,17),e.YNc(25,F,2,0,"th",18)(26,G,2,1,"td",19),e.BQk(),e.ynx(27,20),e.YNc(28,j,2,0,"th",21)(29,$,2,1,"td",19),e.BQk(),e.ynx(30,22),e.YNc(31,H,2,0,"th",21)(32,w,2,1,"td",19),e.BQk(),e.ynx(33,23),e.YNc(34,q,2,0,"th",24)(35,X,2,1,"td",19),e.BQk(),e.ynx(36,25),e.YNc(37,V,2,0,"th",21)(38,ee,2,1,"td",19),e.BQk(),e.ynx(39,26),e.YNc(40,te,2,0,"th",21)(41,ne,2,1,"td",19),e.BQk(),e.ynx(42,27),e.YNc(43,se,2,0,"th",21)(44,oe,2,1,"td",19),e.BQk(),e.ynx(45,28),e.YNc(46,ae,2,0,"th",21)(47,re,4,3,"td",29),e.BQk(),e.YNc(48,le,1,0,"tr",30)(49,ce,1,0,"tr",31),e.qZA(),e.YNc(50,me,1,1,"qp-no-results",32),e.TgZ(51,"mat-paginator",33),e.NdJ("page",function(){return l.getResellers()}),e.qZA()()()),2&m){const _=e.MAs(14);e.xp6(3),e.Q6J("ngModel",l.isDeleted),e.xp6(6),e.Q6J("autoFocus",l.autoFocus)("search",l.search),e.xp6(6),e.Q6J("routerLink",e.DdM(14,de)),e.xp6(2),e.Q6J("matMenuTriggerFor",_),e.xp6(3),e.Q6J("ngIf",l.searching),e.xp6(2),e.Q6J("dataSource",l.resellers),e.xp6(26),e.Q6J("matHeaderRowDef",l.displayColumns),e.xp6(),e.Q6J("matRowDefColumns",l.displayColumns),e.xp6(),e.Q6J("ngIf",0===l.resellers.length),e.xp6(),e.ekj("hide",0===l.paginator.pageIndex&&l.resellers.length<l.paginator.pageSize),e.Q6J("length",(l.paginator.pageIndex+1)*l.resellers.length+1)("pageSizeOptions",e.DdM(15,ue))}},dependencies:[d.rH,u.O5,J.Z,t.JJ,t.On,O.RK,S.a8,S.dn,S.G2,K.Hw,U.VK,U.OP,U.p6,a.NW,Q.pW,L.VQ,L.U0,i.YE,i.nU,T.BZ,T.fO,T.as,T.w1,T.Dz,T.nj,T.ge,T.ev,T.XQ,T.Gk,W.Ye,W.rD,b.gM,N.S,z.j],styles:["table[_ngcontent-%COMP%]{width:100%}"]})}}return s})()}];let pe=(()=>{class s{static{this.\u0275fac=function(m){return new(m||s)}}static{this.\u0275mod=e.oAB({type:s})}static{this.\u0275inj=e.cJS({imports:[d.Bz.forChild(_e),d.Bz]})}}return s})(),he=(()=>{class s{static{this.\u0275fac=function(m){return new(m||s)}}static{this.\u0275mod=e.oAB({type:s})}static{this.\u0275inj=e.cJS({imports:[pe,D.A,u.ez,M.l,t.u5,C.x,P.b,E.D,r.u,d.Bz]})}}return s})()},75100:(Z,v,n)=>{n.d(v,{G:()=>M});var u=n(67205),t=n(80461),d=n(94604),E=n(6464),D=n(35382);let M=(()=>{class C{constructor(r,a){this.apiClient=r,this.base64=a}getAll(r){return this.apiClient.get("/merchants",{params:r}).pipe((0,u.U)(a=>a.map(i=>Object.assign(new t.J,i))))}get(r){return this.apiClient.get(`/merchants/${r}`).pipe((0,u.U)(a=>Object.assign(new t.J,a)))}getSupportAgreement(r){return this.apiClient.get(`/merchants/${r}/agreements`,{params:{me:"true"}}).pipe((0,u.U)(a=>a.length?Object.assign(a[0]):null))}createSupportAgreement(r,a){const i={};return a&&(i.headers={Authorization:"Basic "+this.base64.encodeUnicode(":"+a)}),this.apiClient.post(`/merchants/${r}/agreements`,null,i).pipe((0,u.U)(g=>Object.assign(g)))}updateAcquirerSettings(r,a){return this.apiClient.patch(`/merchants/${r.id}`,{acquirer_settings:{[a]:r.acquirer_settings[a]}}).pipe((0,u.U)(g=>Object.assign(new t.J,g)))}create(r){return this.apiClient.post("/merchants",r=r||{}).pipe((0,u.U)(a=>Object.assign(new t.J,a)))}moveToReseller(r,a){return this.apiClient.patch(`/merchants/${r}/move-to-reseller`,{reseller_id:a})}suspend(r,a){const i={};return a&&(i.headers={Authorization:"Basic "+this.base64.encodeUnicode(":"+a)}),this.apiClient.post(`/merchants/${r}/suspend`,null,i).pipe((0,u.U)(g=>Object.assign(new t.J,g)))}unsuspend(r,a){const i={};return a&&(i.headers={Authorization:"Basic "+this.base64.encodeUnicode(":"+a)}),this.apiClient.delete(`/merchants/${r}/suspend`,i).pipe((0,u.U)(g=>Object.assign(new t.J,g)))}destroy(r,a){const i={};return a&&(i.headers={Authorization:"Basic "+this.base64.encodeUnicode(":"+a)}),this.apiClient.delete(`/merchants/${r}`,i).pipe((0,u.U)(g=>Object.assign(new t.J,g)))}undestroy(r,a){return this.apiClient.patch(`/merchants/${r}`,a).pipe((0,u.U)(i=>
1Object.assign(new t.J,i)))}static{this.\u0275fac=function(a){return new(a||C)(d.LFG(E.S),d.LFG(D.D))}}static{this.\u0275prov=d.Yz7({token:C,factory:C.\u0275fac,providedIn:"root"})}}return C})()},80461:(Z,v,n)=>{n.d(v,{J:()=>u});class u{}},89993:(Z,v,n)=>{n.d(v,{O:()=>a});var u=n(7530),t=n(94604),d=n(63549),E=n(40071),D=n(62594),M=n(1348);function C(i,g){1&i&&(t.TgZ(0,"p",3),t._uU(1," There is no specific plan set up for this reseller. The reseller will receive the default discount of 65%\n"),t.qZA())}function P(i,g){if(1&i){const h=t.EpF();t.TgZ(0,"div",4)(1,"div"),t._uU(2),t.qZA(),t.TgZ(3,"button",5),t.NdJ("click",function(){t.CHM(h);const f=t.oxw();return t.KtG(f.show_discount_form.set(!f.show_discount_form()))}),t._uU(4," Change discount "),t.qZA()()}if(2&i){const h=t.oxw();let p;t.xp6(2),t.Oqu(null!==(p=null==(p=h.plan())||null==p.attributes?null:p.attributes.discount)&&void 0!==p?p:"0.65"),t.xp6(),t.Q6J("hidden",h.show_discount_form())}}function r(i,g){if(1&i){const h=t.EpF();t.TgZ(0,"form",6),t.NdJ("ngSubmit",function(){t.CHM(h);const f=t.oxw();return t.KtG(f.saveDiscount())}),t.TgZ(1,"mat-form-field")(2,"mat-label"),t._uU(3,"Discount (between 0.00 - 1.00)"),t.qZA(),t._UZ(4,"input",7),t.qZA(),t.TgZ(5,"div",8)(6,"button",9),t.NdJ("click",function(){t.CHM(h);const f=t.oxw();return t.KtG(f.show_discount_form.set(!f.show_discount_form()))}),t._uU(7," Cancel "),t.qZA(),t.TgZ(8,"button",10),t._uU(9,"Save discount"),t.qZA()()()}if(2&i){const h=t.oxw();t.Q6J("formGroup",h.discount_form),t.xp6(6),t.Q6J("hidden",!h.show_discount_form()),t.xp6(2),t.Q6J("disabled",h.discount_form.invalid)}}let a=(()=>{class i{constructor(){this.plan=(0,t.qHZ)(),this.customer=(0,t.qHZ)(),this.show_discount_form=(0,t.tdS)(!1),this.discount_form=new d.cw({discount:new d.NI(0,{validators:[d.kI.required]})}),this.save_discount=new t.vpe}ngOnInit(){this.discount_form.setValue({discount:this.plan()?.attributes?.discount??.65})}saveDiscount(){this.save_discount.emit({...this.plan(),type:this.plan()?.type??"reseller-plans",attributes:{...this.plan()?.attributes,discount:this.discount_form.value.discount??void 0}}),this.show_discount_form.set(!1)}static{this.\u0275fac=function(p){return new(p||i)}}static{this.\u0275cmp=t.Xpm({type:i,selectors:[["qp-admin-billing-discount"]],inputs:{plan:[t.lbL.SignalBased,"plan"],customer:[t.lbL.SignalBased,"customer"]},outputs:{save_discount:"save_discount"},standalone:!0,features:[t.jDz],decls:3,vars:3,consts:[["class","mat-caption note",4,"ngIf"],["class","flex-row items-center cg8",4,"ngIf"],["class","flex-col rg16 discount-form",3,"formGroup","ngSubmit",4,"ngIf"],[1,"mat-caption","note"],[1,"flex-row","items-center","cg8"],["mat-raised-button","",3,"hidden","click"],[1,"flex-col","rg16","discount-form",3,"formGroup","ngSubmit"],["matInput","","placeholder","Discount","formControlName","discount"],[1,"flex-row","space-around","items-center"],["type","button","mat-raised-button","",3,"hidden","click"],["type","submit","mat-raised-button","","color","accent",3,"disabled"]],template:function(p,f){if(1&p&&t.YNc(0,C,2,0,"p",0)(1,P,5,2,"div",1)(2,r,10,3,"form",2),2&p){let e;t.Q6J("ngIf",!(null!=(e=f.plan())&&e.id)),t.xp6(),t.Q6J("ngIf",!f.show_discount_form()),t.xp6(),t.Q6J("ngIf",f.show_discount_form())}},dependencies:[u.ez,u.O5,D.lN,D.KE,D.hX,M.c,M.Nt,E.ot,E.lW,d.UX,d._Y,d.Fj,d.JJ,d.JL,d.sg,d.u],changeDetection:0})}}return i})()},44369:(Z,v,n)=>{n.d(v,{A:()=>J});var u=n(7530),t=n(63549),d=n(40071),E=n(46228),D=n(3973),M=n(95167),C=n(62594),P=n(76025),r=n(1348),a=n(26463),i=n(14497),g=n(58960),h=n(48382),p=n(49421),f=n(62403),e=n(76428),x=n(39865),B=n(51029),I=n(89993),y=n(94604);let J=(()=>{class O{static{this.\u0275fac=function(U){return new(U||O)}}static{this.\u0275mod=y.oAB({type:O})}static{this.\u0275inj=y.cJS({imports:[u.ez,x.l,t.u5,B.b,d.ot,E.QW,M.FA,C.lN,P.Ps,r.c,D.XK,a.TU,i.Cq,g.LD,h.rP,p.p0,e.D,I.O,f.Bz]})}}return O})()}}]);
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.