1"use strict";(self.webpackChunkzaakpay_self_onboarding=self.webpackChunkzaakpay_self_onboarding||[]).push([[73],{7073:(et,P,c)=>{c.r(P),c.d(P,{MerchantConfigurationModule:()=>Qe});var u=c(177),C=c(6154),e=c(7705),E=c(3334),G=c(83),O=c(1626);let g=(()=>{class r{constructor(t,i){this.commonUtils=t,this.http=i,this.defaultConfig={url:"",params:{},data:"",headers:{useAuth:"true"}}}dispatchKey(t){let i={url:`${E.$.apiEndpoints.merchantConfig.dispatchKeys}`,data:t,cache:!1,skipParsing:!0,silent:!1};return i=Object.assign({},this.defaultConfig,i),this.commonUtils.postRequest(i)}generateKey(t){let i={url:`${E.$.apiEndpoints.merchantConfig.generateKeys}`,data:t,cache:!1,skipParsing:!0,silent:!1};return i=Object.assign({},this.defaultConfig,i),this.commonUtils.postRequest(i)}getConfig(t){let i={url:`${E.$.apiEndpoints.merchantConfig.fetchConfig}`,cache:!1,skipParsing:!1,silent:!1,data:t};return i=Object.assign({},this.defaultConfig,i),this.commonUtils.postRequest(i)}setConfig(t){let i={url:`${E.$.apiEndpoints.merchantConfig.updateConfig}`,cache:!1,skipParsing:!1,silent:!1,data:t};return i=Object.assign({},this.defaultConfig,i),this.commonUtils.postRequest(i)}static{this.\u0275fac=function(i){return new(i||r)(e.KVO(G.E),e.KVO(O.Qq))}}static{this.\u0275prov=e.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var A=c(3802),z=c(5772),v=c(5663),y=c(3324),F=c(1458),x=c(2471);let $=(()=>{class r{constructor(t,i,n,s){this.dialogRef=t,this.merchantConfigurationService=i,this.notificationService=n,this.data=s,this.pendingProcess=!1,this.keyTypes=[{viewValue:"Secret",value:"SECRET_KEY"},{viewValue:"API",value:"API_KEY"},{viewValue:"Encryption",value:"ENCRYPTION_KEY"}]}onNoClick(){this.dialogRef.close()}generateKey(t){const i=this.keyTypes.find(s=>s.viewValue===this.data.heading).value;this.pendingProcess=!0,this.merchantConfigurationService.dispatchKey({action:t,keyType:i}).subscribe(s=>{if(console.log("COMPLETED",s),this.pendingProcess=!1,s.success)if("DOWNLOAD"===t){let a=document.createElement("a");a.setAttribute("type","hidden"),a.href=window.URL.createObjectURL(this.b64toBlob(s.data.file,"application/zip")),a.target="_blank",a.download=`${i}.txt`,document.body.appendChild(a),a.click(),a.remove(),this.notificationService.displaySuccess({content:"Key Downloaded Successfully"})}else this.notificationService.displaySuccess({content:"Email Sent Successfully"});else this.notificationService.displayError({content:s.message.text})})}b64toBlob(t,i,n=512){i=i||"",n=n||512;for(var s=atob(t),a=[],m=0;m<s.length;m+=n){for(var f=s.slice(m,m+n),b=new Array(f.length),p=0;p<f.length;p++)b[p]=f.charCodeAt(p);var h=new Uint8Array(b);a.push(h)}return new Blob(a,{type:i})}static{this.\u0275fac=function(i){return new(i||r)(e.rXU(v.RN),e.rXU(g),e.rXU(y.J),e.rXU(v.xh))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-confirm-pop-up"]],decls:17,vars:9,consts:[[1,"pop-up"],[1,"row","justify-content-end","mt-1","mr-2"],["mat-dialog-close","",1,"popUpCloseBtn"],[1,"confirmation-container","d-flex","flex-column","align-items-center"],["src","assets/images/actions/success.png","alt","success"],["mat-dialog-title","",1,"confirmation-heading"],["mat-dialog-content","",1,"w-100","text-center"],["mat-dialog-actions","",1,"d-flex","justify-content-center","mt-2"],["mat-flat-button","","color","primary",1,"px-5",3,"disabled","click"],["mat-flat-button","","color","primary",3,"disabled","click"]],template:function(i,n){1&i&&(e.j41(0,"div",0)(1,"div",1)(2,"mat-icon",2),e.EFF(3,"close"),e.k0s()(),e.j41(4,"div",3),e.nrm(5,"img",4),e.j41(6,"h1",5),e.EFF(7),e.k0s(),e.j41(8,"div",6),e.EFF(9),e.nI1(10,"lowercase"),e.nI1(11,"lowercase"),e.k0s(),e.j41(12,"div",7)(13,"button",8),e.bIt("click",function(){return n.generateKey("DOWNLOAD")}),e.EFF(14,"Download"),e.k0s(),e.j41(15,"button",9),e.bIt("click",function(){return n.generateKey("EMAIL")}),e.EFF(16,"Share it on Email"),e.k0s()()()()),2&i&&(e.R7$(7),e.SpI("",n.data.heading," Key Generated"),e.R7$(2),e.Lme(" Please keep your generated ",e.bMT(10,5,n.data.heading)," key safely. You won't be able to get the same ",e.bMT(11,7,n.data.heading)," key again. "),e.R7$(4),e.Y8G("disabled",n.pendingProcess),e.R7$(2),e.Y8G("disabled",n.pendingProcess))},dependencies:[F.iV,x.An,v.kQ,v.KI,v.PQ,v.$t,u.GH],styles:[".pop-up[_ngcontent-%COMP%]{overflow-x:hidden;height:275px}.confirmation-container[_ngcontent-%COMP%]{background-color:#fff;border-radius:4px;width:421px}.confirmation-container[_ngcontent-%COMP%] .confirmation-heading[_ngcontent-%COMP%]{color:#1
1abc9c;font-family:Roboto;font-size:20px;line-height:24px;width:363px;text-align:center}.confirmation-container[_ngcontent-%COMP%] .button-container[_ngcontent-%COMP%]{margin:15px;text-align:center}"]})}}return r})();var k=c(1116);function U(r,l){1&r&&(e.j41(0,"span"),e.EFF(1,":"),e.k0s())}function N(r,l){if(1&r&&(e.j41(0,"div",37),e.EFF(1),e.k0s()),2&r){const t=e.XpG();e.R7$(1),e.SpI(" Created at : ",null==t.keyConfig?null:t.keyConfig.secretKeyLastUpdated," ")}}function V(r,l){if(1&r){const t=e.RV6();e.j41(0,"button",38),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.reGenerateKey("Secret",!1))}),e.EFF(1," Generate Key "),e.k0s()}}function Y(r,l){if(1&r){const t=e.RV6();e.j41(0,"button",38),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.reGenerateKey("Secret",!0))}),e.EFF(1," Re-Generate Key "),e.k0s()}}function K(r,l){1&r&&(e.j41(0,"span"),e.EFF(1,":"),e.k0s())}const _=function(r){return{"inline-loader":r}};function L(r,l){if(1&r&&(e.j41(0,"div",37),e.EFF(1," Created at : "),e.j41(2,"span",39),e.nrm(3,"span",31),e.EFF(4),e.k0s()()),2&r){const t=e.XpG();e.R7$(2),e.Y8G("ngClass",e.eq3(2,_,t.apiKeyLoader)),e.R7$(2),e.SpI(" ",t.keyConfig.apiKeyLastUpdated," ")}}function D(r,l){if(1&r){const t=e.RV6();e.j41(0,"button",38),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.reGenerateKey("API",!1))}),e.EFF(1," Generate Key "),e.k0s()}}function B(r,l){if(1&r){const t=e.RV6();e.j41(0,"button",38),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.reGenerateKey("API",!0))}),e.EFF(1," Re-Generate Key "),e.k0s()}}function X(r,l){1&r&&(e.j41(0,"span"),e.EFF(1,":"),e.k0s())}function J(r,l){1&r&&(e.j41(0,"span",26),e.EFF(1," Generate Keys for Encryption "),e.k0s())}function q(r,l){1&r&&(e.j41(0,"span",26),e.EFF(1," Generate Keys for Encryption "),e.k0s())}function W(r,l){if(1&r&&(e.j41(0,"div",37)(1,"span"),e.EFF(2,"Created at :"),e.k0s(),e.j41(3,"span",39),e.nrm(4,"span",31),e.EFF(5),e.k0s()()),2&r){const t=e.XpG();e.R7$(3),e.Y8G("ngClass",e.eq3(2,_,t.encryptionKeyLoader)),e.R7$(2),e.SpI(" ",t.keyConfig.encKeyLastUpdated," ")}}function Z(r,l){if(1&r){const t=e.RV6();e.j41(0,"button",38),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.reGenerateKey("Encryption",!1))}),e.EFF(1," Generate Key "),e.k0s()}}function H(r,l){if(1&r){const t=e.RV6();e.j41(0,"button",38),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.reGenerateKey("Encryption",!0))}),e.EFF(1," Re-Generate Key "),e.k0s()}}const M=function(r){return{fadeOut:r}};class Q{}let ee=(()=>{class r{constructor(t,i,n){this.dialog=t,this.notificationService=i,this.merchantConfigurationService=n,this.linkCopied=!1,this.keyConfig=new Q,this.pendingProcess=!1,this.apiKeyLoader=!1,this.encryptionKeyLoader=!1,this.keyTypes=[{viewValue:"Secret",value:"SECRET_KEY"},{viewValue:"API",value:"API_KEY"},{viewValue:"Encryption",value:"ENCRYPTION_KEY"}]}ngOnInit(){this.fetchAPIKeysConfiguration()}fetchAPIKeysConfiguration(){this.pendingProcess=!0,this.merchantConfigurationService.getConfig({sourceArr:["merchantConfiguration.keys"]}).subscribe(i=>{this.pendingProcess=!1,i.success?this.keyConfig=i.data.sourceArr[0]:this.notificationService.displayError({content:i.message.text})})}copyToClipboard(){var t=this.keyConfig.merchantIdentifier,i=document.createElement("textarea");document.body.appendChild(i),i.value=t,i.select(),document.execCommand("copy"),document.body.removeChild(i),this.linkCopied=!0,setTimeout(()=>{this.linkCopied=!1},7e3)}openConfirmationPopUp(t){this.keyTypes.find(s=>s.viewValue===t),this.dialog.open($,{disableClose:!0,data:{heading:`${t}`}}).afterClosed().subscribe(s=>{})}reGenerateKey(t,i){const n=this.keyTypes.find(a=>a.viewValue===t).value;this.dialog.open(z.f,{disableClose:!0,data:{heading:`Are you sure you want to ${i?"Re-":""}generate ${t} key?`,trueKey:"Generate Key",falseKey:"Don't Generate Key"}}).afterClosed().subscribe(a=>{a&&this.generateKey("EMAIL",n,t)})}toggleLoader(t,i){switch(t){case this.keyTypes[0].value:break;case this.keyTypes[1].value:this.apiKeyLoader=i;break;case this.keyTypes[2].value:this.encryptionKeyLoader=i}}generateKey(t,i,n){this.toggleLoader(i,!0),this.merchantConfigurationService.generateKey({action:t,keyType:i}).subscribe(a=>{a.success?(this.updateKeyButton(i,a.data.lastUpdated,a.data.keyMasked),this.openConfirmationPopUp(n)):this.notificationService.displayError({content:a.message.text}),this.toggleLoader(i,!1)})}b64toBlob(t,i,n=512){i=i||"",n=n||512;
1for(var s=atob(t),a=[],m=0;m<s.length;m+=n){for(var f=s.slice(m,m+n),b=new Array(f.length),p=0;p<f.length;p++)b[p]=f.charCodeAt(p);var h=new Uint8Array(b);a.push(h)}return new Blob(a,{type:i})}updateKeyButton(t,i,n){switch(t){case this.keyTypes[0].value:this.keyConfig.secretKeyLastUpdated=i;break;case this.keyTypes[1].value:this.keyConfig.apiKeyMasked=n,this.keyConfig.apiKeyLastUpdated=i;break;case this.keyTypes[2].value:this.keyConfig.encKeyIdMasked=n,this.keyConfig.encKeyLastUpdated=i}}static{this.\u0275fac=function(i){return new(i||r)(e.rXU(v.ef),e.rXU(y.J),e.rXU(g))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-api-keys"]],decls:82,vars:33,consts:[[1,"mar-20",3,"hidden"],[1,"zaak-loader"],[1,"bluebg-02","an-dash","minvhFull",3,"hidden"],[1,"col-12","d-flex","justify-content-center"],[1,"col-12","form-container","mt-4","bg-white"],[1,"row"],[1,"col-9"],[1,"col-12","pl-4"],[1,"header-label","mb-1"],[1,"row","px-4","my-2"],[1,"col-12","key-section"],[1,"row","align-items-center","pl-3"],[1,"col-8","key-label","pl-0"],[4,"ngIf"],[1,"secret-key"],[1,"col-4","text-right"],["mat-stroked-button","","color","primary",1,"bg-white","h48","pl-5","pr-5","m-wdFull","ml-1","w-100","popoverTrig","top","open","leftsd",3,"disableRipple","disabled","click"],[1,"popoverblock","nowrap","success",2,"right","-10px",3,"ngClass"],[1,"align-items-center","d-flex","justify-content-between"],[1,"material-icons-round","success"],[1,"arrow",3,"ngClass"],[1,"row","px-4","my-3"],[1,"col-8","pl-0"],[1,"col-12","key-label"],[1,"row","pl-3","pt-2"],[1,"col-10"],[1,"key-description"],["class","col-12 key-timestamp",4,"ngIf"],[1,"col-4","d-flex","align-items-center"],["mat-flat-button","","color","primary","class","h48 pl-5 pr-5 m-wdFull ml-1 w-100",3,"click",4,"ngIf"],[1,"secret-key",3,"ngClass"],[1,"dot-flashing"],[1,"row","mt-5"],[1,"col-10","pl-4"],[1,"header-label"],[1,"row","px-4"],["class","key-description",4,"ngIf"],[1,"col-12","key-timestamp"],["mat-flat-button","","color","primary",1,"h48","pl-5","pr-5","m-wdFull","ml-1","w-100",3,"click"],[3,"ngClass"]],template:function(i,n){1&i&&(e.j41(0,"div",0),e.nrm(1,"div",1),e.k0s(),e.j41(2,"main",2)(3,"section",3)(4,"mat-card",4)(5,"div",5)(6,"div",6)(7,"div",5)(8,"div",7)(9,"p",8),e.EFF(10," Get your Merchant ID and Secret Key! "),e.k0s()()(),e.j41(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12),e.EFF(15," Merchant Identifier "),e.DNE(16,U,2,0,"span",13),e.j41(17,"span",14),e.EFF(18),e.k0s()(),e.j41(19,"div",15)(20,"button",16),e.bIt("click",function(){return n.copyToClipboard()}),e.j41(21,"div",17)(22,"div",18)(23,"mat-icon",19),e.EFF(24," check_circle "),e.k0s(),e.EFF(25," Copied successfully "),e.k0s(),e.nrm(26,"div",20),e.k0s(),e.EFF(27," Copy Key "),e.k0s()()()()(),e.j41(28,"div",21)(29,"div",10)(30,"div",5)(31,"div",22)(32,"div",23),e.EFF(33," Secret Key "),e.k0s(),e.j41(34,"div",24)(35,"div",25)(36,"span",26),e.EFF(37," This is unique secret key of an account. Use this for checksum calculation "),e.k0s()()(),e.DNE(38,N,2,1,"div",27),e.k0s(),e.j41(39,"div",28),e.DNE(40,V,2,0,"button",29),e.DNE(41,Y,2,0,"button",29),e.k0s()()()(),e.j41(42,"div",21)(43,"div",10)(44,"div",5)(45,"div",22)(46,"div",23),e.EFF(47," API Key "),e.DNE(48,K,2,0,"span",13),e.j41(49,"span",30),e.nrm(50,"span",31),e.EFF(51),e.k0s()(),e.j41(52,"div",24)(53,"div",25)(54,"span",26),e.EFF(55," This is unique Api Key for an account "),e.k0s()()(),e.DNE(56,L,5,4,"div",27),e.k0s(),e.j41(57,"div",28),e.DNE(58,D,2,0,"button",29),e.DNE(59,B,2,0,"button",29),e.k0s()()()(),e.j41(60,"div",32)(61,"div",33)(62,"p",34),e.EFF(63," Encryption Keys "),e.k0s()()(),e.j41(64,"div",35)(65,"div",10)(66,"div",5)(67,"div",22)(68,"div",23),e.EFF(69," Encryption Keys "),e.DNE(70,X,2,0,"span",13),e.j41(71,"span",30),e.nrm(72,"span",31),e.EFF(73),e.k0s()(),e.j41(74,"div",24)(75,"div",25),e.DNE(76,J,2,0,"span",36),e.DNE(77,q,2,0,"span",36),e.k0s()(),e.DNE(78,W,6,4,"div",27),e.k0s(),e.j41(79,"div",28),e.DNE(80,Z,2,0,"button",29),e.DNE(81,H,2,0,"button",29),e.k0s()()()()()()()()()),2&i&&(e.Y8G("hidden",!n.pendingProcess),e.R7$(2),e.Y8G("hidden",n.pendingProcess),e.R7$(14),e.Y8G("ngIf",n.keyConfig.merchantIdentifierMasked),e.R7$(2),e.SpI(" ",n.
1keyConfig.merchantIdentifierMasked," "),e.R7$(2),e.Y8G("disableRipple",!0)("disabled",!n.keyConfig.merchantIdentifierMasked),e.R7$(1),e.Y8G("ngClass",e.eq3(25,M,!n.linkCopied)),e.R7$(5),e.Y8G("ngClass",e.eq3(27,M,!n.linkCopied)),e.R7$(12),e.Y8G("ngIf",n.keyConfig.secretKeyExists),e.R7$(2),e.Y8G("ngIf",!n.keyConfig.secretKeyExists),e.R7$(1),e.Y8G("ngIf",n.keyConfig.secretKeyExists),e.R7$(7),e.Y8G("ngIf",n.keyConfig.apiKeyLastUpdated),e.R7$(1),e.Y8G("ngClass",e.eq3(29,_,n.apiKeyLoader)),e.R7$(2),e.SpI(" ",n.keyConfig.apiKeyMasked," "),e.R7$(5),e.Y8G("ngIf",n.keyConfig.apiKeyLastUpdated),e.R7$(2),e.Y8G("ngIf",!n.keyConfig.apiKeyLastUpdated),e.R7$(1),e.Y8G("ngIf",n.keyConfig.apiKeyLastUpdated),e.R7$(11),e.Y8G("ngIf",n.keyConfig.encKeyIdMasked),e.R7$(1),e.Y8G("ngClass",e.eq3(31,_,n.encryptionKeyLoader)),e.R7$(2),e.SpI(" ",n.keyConfig.encKeyIdMasked," "),e.R7$(3),e.Y8G("ngIf",!n.keyConfig.encKeyIdMasked),e.R7$(1),e.Y8G("ngIf",n.keyConfig.encKeyIdMasked),e.R7$(1),e.Y8G("ngIf",n.keyConfig.encKeyLastUpdated),e.R7$(2),e.Y8G("ngIf",!n.keyConfig.encKeyLastUpdated),e.R7$(1),e.Y8G("ngIf",n.keyConfig.encKeyLastUpdated))},dependencies:[u.YU,u.bT,F.iV,x.An,k._m],styles:[".form-container[_ngcontent-%COMP%]{width:80vw;padding-top:20px;box-shadow:0 2px 10px #cacaca35}.header-label[_ngcontent-%COMP%]{font-size:16px;line-height:30px;font-weight:700}.key-section[_ngcontent-%COMP%]{background-color:#f9f9f9;padding:20px;border-radius:8px;box-shadow:0 2px 4px #00000026}.key-label[_ngcontent-%COMP%]{color:#404040;font-size:16px;line-height:19px}.key-description[_ngcontent-%COMP%]{color:gray;font-family:Roboto;font-size:14px;line-height:17px;text-align:left}.key-timestamp[_ngcontent-%COMP%]{color:gray;font-size:12px;line-height:14px;margin-top:6px}.secret-key[_ngcontent-%COMP%]{color:#3043ce;font-size:16px;line-height:19px;font-weight:700;margin-top:5px}.api-key-bg-container[_ngcontent-%COMP%]{background:url(/assets/images/keys.png) #fafdff no-repeat right bottom -30px;background-size:auto 270px}"]})}}return r})();var o=c(9417),d=c(3319),T=c(8578),w=c(8400);function te(r,l){1&r&&(e.j41(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23)(4,"p",24),e.EFF(5,"Receive webhooks for Meta Transactions"),e.k0s(),e.j41(6,"div",25),e.EFF(7,"You will receive webhook notifications on the current URL itself."),e.k0s()(),e.j41(8,"div",26)(9,"mat-radio-group",27)(10,"mat-radio-button",28),e.EFF(11,"Yes"),e.k0s(),e.j41(12,"mat-radio-button",28),e.EFF(13,"No"),e.k0s()()()()()()),2&r&&(e.R7$(10),e.Y8G("value",!0),e.R7$(2),e.Y8G("value",!1))}let ne=(()=>{class r{constructor(t,i,n){this.merchantConfigurationService=t,this.router=i,this.notificationService=n,this.nextTab=new e.bkB,this.formElements={},this.pendingProcess=!1,this.skipValidationList=[],this.showMeta=!1}ngOnInit(){this.initialiseFormElements(),this.createForm(),this.processDetail
1s(),this.websiteSub=this.customizeForm.controls.websiteUrl.valueChanges.subscribe(t=>{let i=this.validateDomain(t,this.customizeForm.controls.redirectUrl.value);setTimeout(()=>{this.customizeForm.controls.websiteUrl.valid?i?(this.customizeForm.controls.websiteUrl.setErrors(null),this.customizeForm.controls.redirectUrl.setErrors(null)):(this.customizeForm.controls.websiteUrl.setErrors({error:!0}),this.formElements.websiteUrl.errorText="Website URL and Redirect URL should be on same domain"):(this.customizeForm.controls.websiteUrl.setErrors({error:!0}),this.formElements.websiteUrl.errorText="Not a valid URL"),this.customizeForm.controls.websiteUrl.markAsTouched(),this.customizeForm.updateValueAndValidity()},0)}),this.redirectSub=this.customizeForm.controls.redirectUrl.valueChanges.subscribe(t=>{let i=this.validateDomain(this.customizeForm.controls.websiteUrl.value,t);setTimeout(()=>{this.customizeForm.controls.redirectUrl.valid?i?(this.customizeForm.controls.websiteUrl.setErrors(null),this.customizeForm.controls.redirectUrl.setErrors(null)):(this.customizeForm.controls.redirectUrl.setErrors({error:!0}),this.formElements.redirectUrl.errorText="Website URL and Redirect URL should be on same domain"):(this.customizeForm.controls.redirectUrl.setErrors({error:!0}),this.formElements.redirectUrl.errorText="Not a valid URL"),this.customizeForm.controls.redirectUrl.markAsTouched(),this.customizeForm.updateValueAndValidity()},0)})}validateDomain(t,i){let n,s,a,m,f,b;if(!i||!t)return!1;n=i.split("://")[0];let p=(i=i.split("://")[1]?i.split("://")[1].split("/")[0]:[])?i.split("."):[];s=p[p.length-2]?p[p.length-2].split("/")[0]:"",a=p[p.length-1]?p[p.length-1].split("/")[0]:"",m=t.split("://")[0];let h=(t=t.split("://")[1]?t.split("://")[1].split("/")[0]:[])?t.split("."):[];return f=h[h.length-2]?h[h.length-2].split("/")[0]:"",b=h[h.length-1]?h[h.length-1].split("/")[0]:"",m==n&&f==s&&b==a}showMetaWebhook(){this.formElements?.isMetaEnabled?.value&&(this.showMeta=!0),this.customizeForm.addControl("isPlatformWebhookForMerchantEnabled",new o.hs(this.formElements.isPlatformWebhookForMerchantEnabled.value,[o.k0.required]))}markErrors(){for(let t in this.formElements)this.formElements[t].errorText&&this.customizeForm.controls[t]&&(this.customizeForm.controls[t].setErrors({serverError:!0}),this.customizeForm.controls[t].markAsTouched())}removeErrors(){for(let t in this.formElements)this.formElements[t].errorText&&this.customizeForm.controls[t]&&(this.customizeForm.controls[t].setErrors(null),this.formElements[t].errorText="",this.customizeForm.controls[t].markAsTouched());console.log(this.formElements)}initialiseFormElements(){this.formElements={websiteUrl:{value:"",errorText:""},redirectUrl:{value:"",errorText:""},realtimeWebhookUrl:{value:"",errorText:""},nonRealtimeWebhookUrl:{value:"",errorText:""},isMetaEnabled:{value:!1,errorText:""},isPlatformWebhookForMerchantEnabled:{value:!1,errorText:""}}}
1processDetails(){this.pendingProcess=!0,this.merchantConfigurationService.getConfig({sourceArr:["merchantConfiguration.urls"]}).subscribe(i=>{if(i.success){for(let n in i.data.sourceArr)"merchantConfiguration.urls"==i.data.sourceArr[n].source&&(this.config=i.data.sourceArr[n]);this.processFormElements(),this.populateForm(),this.showMetaWebhook(),this.markErrors()}this.pendingProcess=!1})}processFormElements(){for(let t in this.formElements)this.formElements[t].value=this.config[t]}createForm(){const t="^((https?:\\/\\/)(www\\.)?){1}[a-zA-Z0-9]([-]?[a-zA-Z0-9]){1,62}(\\.[a-zA-z]{2,6})+[\\/]?[^\\s]*$";this.customizeForm=new o.J3({websiteUrl:new o.hs("",[o.k0.required,o.k0.pattern(t)]),redirectUrl:new o.hs("",[o.k0.required,o.k0.pattern(t)]),realtimeWebhookUrl:new o.hs("",[o.k0.pattern(t)]),nonRealtimeWebhookUrl:new o.hs("",[o.k0.pattern(t)])})}populateForm(){this.customizeForm.patchValue({websiteUrl:this.formElements.websiteUrl.value,redirectUrl:this.formElements.redirectUrl.value,realtimeWebhookUrl:this.formElements.realtimeWebhookUrl.value,nonRealtimeWebhookUrl:this.formElements.nonRealtimeWebhookUrl.value})}getErrorMessage(t){return this.formElements[t].errorText||"Not a valid URL"}domainValidator(){return t=>(console.log("DOMAIN",t),null)}onSubmit(){this.pendingProcess=!0;let t=Object.assign({source:"merchantConfiguration.urls"},this.customizeForm.value);t={sourceArr:[t]},this.merchantConfigurationService.setConfig(t).subscribe(i=>{if(this.pendingProcess=!1,i.success)this.removeErrors(),this.notificationService.displaySuccess({content:i.message.text}),this.nextTab.next({value:"limits"});else{for(let n in i.data.sourceArr)"merchantConfiguration.urls"==i.data.sourceArr[n].source&&(this.config=i.data.sourceArr[n]);this.initialiseFormElements(),this.processFormElements(),this.populateForm(),this.markErrors()}})}get IsDisabled(){for(let t in this.customizeForm.controls)if(!this.skipValidationList.includes(t)&&this.customizeForm.controls[t].invalid)return!0;return!1}ngOnDestroy(){this.websiteSub.unsubscribe(),this.redirectSub.unsubscribe()}static{this.\u0275fac=function(i){return new(i||r)(e.rXU(g),e.rXU(C.Ix),e.rXU(y.J))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-integration-urls"]],outputs:{nextTab:"nextTab"},decls:50,vars:9,consts:[[1,"mar-20",3,"hidden"],[1,"zaak-loader"],[1,"bluebg-02","an-dash","minvhFull",3,"hidden"],[1,"col-12","d-flex","justify-content-center"],[1,"col-12","form-container","mt-4","px-4"],[1,"col-sm-12","col-md-12","px-0"],[3,"formGroup"],[1,"mat-title"],[1,"row","mb-5"],["appearance","outline",1,"col-md-6","col-12"],["matInput","","formControlName","websiteUrl"],["align","start"],["matInput","","formControlName","redirectUrl"],["matInput","","placeholder","Real time transaction status callback URL","formControlName","realtimeWebhookUrl"],["matInput","","placeholder","Transaction status callback URL","formControlName","nonRealtimeWebhookUrl"],["class","row mb-4",4,"ngIf"],[1,"mt-3","fw-bold"],["href","https://zaakpay.freshdesk.com/support/home","target","_blank"],[1,"col-12","d-flex","mt-5","justify-content-center"],["mat-flat-button","","disabled","","color","primary",1,"h48","pl-5","pr-5",2,"width","260px",3,"disabled","click"],[1,"row","mb-4"],[1,"col-md-6"],[1,"row"],[1,"col-md-8"],[1,"rad-label","tgreydark_i","ft15"],[1,"ft11"],[1,"col-md-4","pl-5"],["formControlName","isPlatformWebhookForMerchantEnabled","color","primary",1,"m_radio-col"],[3,"value"]],template:function(i,n){1&i&&(e.j41(0,"div",0),e.nrm(1,"div",1),e.k0s(),e.j41(2,"main",2)(3,"section",3)(4,"mat-card",4)(5,"div",5)(6,"form",6)(7,"div",7),e.EFF(8,"Transaction endpoints on your side"),e.k0s(),e.j41(9,"div",8)(10,"mat-form-field",9)(11,"mat-label"),e.EFF(12,"Website URL"),e.k0s(),e.nrm(13,"input",10),e.j41(14,"mat-hint",11),e.EFF(15," The domain from which you\u2019re initiating transactions must be the same as this one. Must be https. "),e.k0s(),e.j41(16,"mat-error"),e.EFF(17),e.k0s()(),e.j41(18,"mat-form-field",9)(19,"mat-label"),e.EFF(20,"Redirect URL"),e.k0s(),e.nrm(21,"input",12),e.j41(22,"mat-hint",11),e.EFF(23,"Zaakpay will post the transaction response to this Url. User will redirect to url post transaction."),e.k0s(),e.j41(24,"mat-error"),e.EFF(25),e.k0s()()(),e.j41(26,"div",8)(27,"mat-form-field",9)(28,"mat-label"),e.EFF(29,"Realtime Webhook URL"),e.k0s(),e.nrm(30,"input",13),e.j41(31,"mat-hint",11),e.EFF(32,"Merchant will receive webhooks for realtime transactions."),e.k0s(),e.j41(33,"mat-error"),e.EFF(34),e.k0s()(),e.j41(35,"mat-form-field",9)(36,"mat-label"),e.EFF(37,"Non-Realtime Webhook URL"),e.k0s(),e.nrm(38,"input",14),e.j41(39,"mat-hint",11),e.EFF(40,"Merchant will receive webhooks for non-realtime transactions."),e.k0s(),e.j41(41,"mat-error"),e.EFF(42),e.k0s()()(),e.DNE(43,te,14,2,"div",15),e.j41(44,"div",16)(45,"a",17),e.EFF(46,"Knowledge Base "),e.k0s()(),e.j41(47,"div",18)(48,"button",19),e.bIt("click",function(){return n.onSubmit()}),e.EFF(49,"Save"),e.k0s()()()()()()()),2&i&&(e.Y8G("hidden",!n.pendingProcess),e.R7$(2),e.Y8G("hidden",n.pendingProcess),e.R7$(4),e.Y8G("formGroup",n.customizeForm),e.R7$(11),e.JRh(n.getErrorMessage("websiteUrl")),e.R7$(8),e.JRh(n.getErrorMessage("redirectUrl")),e.R7$(9),e.JRh(n.getErrorMessage("realtimeWebhookUrl")),e.R7$(8),e.JRh(n.getErrorMessage("nonRealtimeWebhookUrl")),e.R7$(1),e.Y8G("ngIf",n.showMeta),e.R7$(5),e.Y8G("disabled",n.IsDisabled||n.pendingProcess))},dependencies:[u.bT,F.iV,d.k5,d.Ky,d.V3,d.aw,T.aL,k._m,w.Ku,w.No,o.qT,o.me,o.BC,o.cb,o.j4,o.JD],styles:[".title[_ngcontent-%COMP%]{text-align:center;font-size:24px}.rad-label[_ngcontent-%COMP%]{font-size:12px;color:gray;margin-bottom:7px}.hint[_ngcontent-%COMP%]{font-size:10px;color:gray}.form-container[_ngcontent-%COMP%]{width:80vw;box-shadow:0 2px 10px #cacaca35}"]}
1)}}return r})();var ie=c(493);let re=(()=>{class r{constructor(t,i,n){this.merchantConfigurationService=t,this.router=i,this.notificationService=n,this.nextTab=new e.bkB,this.formElements={},this.pendingProcess=!1,this.skipValidationList=[],this.maxAmountRegex=/^([1-9][0-9]{0,5}([\.][0-9]{1,2})?|([0][\.][0][1-9])|([0][\.][1-9][0-9]?))$/}ngOnInit(){this.initialiseFormElements(),this.createForm(),this.processDetails(),this.minCtrSub=this.customizeForm.controls.minAmtTxn.valueChanges.subscribe(t=>{this.customizeForm.controls.minAmtTxn.valid?this.customizeForm.controls.maxAmtTxn.value<Number(t)?(this.customizeForm.controls.minAmtTxn.setErrors({error:!0}),this.formElements.minAmtTxn.errorText="Min amount should be lesser than Max amount"):(this.customizeForm.controls.minAmtTxn.setErrors(null),this.customizeForm.controls.maxAmtTxn.setErrors(null)):(this.customizeForm.controls.minAmtTxn.setErrors({error:!0}),this.formElements.minAmtTxn.errorText="Not a valid input"),this.customizeForm.controls.minAmtTxn.markAsTouched(),this.customizeForm.updateValueAndValidity()}),this.maxCtrSub=this.customizeForm.controls.maxAmtTxn.valueChanges.subscribe(t=>{this.customizeForm.controls.maxAmtTxn.valid?this.customizeForm.controls.minAmtTxn.value>Number(t)?(this.customizeForm.controls.maxAmtTxn.setErrors({error:!0}),this.formElements.maxAmtTxn.errorText="Max amount should be greater than Min amount"):(this.customizeForm.controls.maxAmtTxn.setErrors(null),this.customizeForm.controls.minAmtTxn.setErrors(null)):(this.customizeForm.controls.maxAmtTxn.setErrors({error:!0}),this.formElements.maxAmtTxn.errorText="Not a valid input"),this.customizeForm.controls.maxAmtTxn.markAsTouched(),this.customizeForm.updateValueAndValidity()})}markErrors(){for(let t in this.formElements)this.formElements[t].errorText&&this.customizeForm.controls[t]&&(this.customizeForm.controls[t].setErrors({serverError:!0}),this.customizeForm.controls[t].markAsTouched())}removeErrors(){for(let t in this.formElements)this.formElements[t].errorText&&this.customizeForm.controls[t]&&(this.customizeForm.controls[t].setErrors(null),this.formElements[t].errorText="",this.customizeForm.controls[t].markAsTouched());console.log(this.formElements)}initialiseFormElements(){this.formElements={maxAmtTxn:{value:"",errorText:""},minAmtTxn:{value:"",errorText:""},dailyMaxTxnUser:{value:"",errorText:""},dailyMaxTxnCard:{value:"",errorText:""},dailyMaxTxnUserIp:{value:"",errorText:""}}}
1processDetails(){this.pendingProcess=!0,this.merchantConfigurationService.getConfig({sourceArr:["merchantConfiguration.txnLimits"]}).subscribe(i=>{if(i.success){for(let n in i.data.sourceArr)"merchantConfiguration.txnLimits"==i.data.sourceArr[n].source&&(this.config=i.data.sourceArr[n]);this.processFormElements(),this.populateForm(),this.markErrors()}this.pendingProcess=!1})}processFormElements(){for(let t in this.formElements)this.formElements[t].value=this.config[t]}createForm(){this.customizeForm=new o.J3({maxAmtTxn:new o.hs("",[o.k0.required,o.k0.pattern(this.maxAmountRegex)]),minAmtTxn:new o.hs("",[o.k0.required,o.k0.pattern(this.maxAmountRegex)]),dailyMaxTxnUser:new o.hs("",[o.k0.required,o.k0.max(999999),o.k0.min(1)]),dailyMaxTxnCard:new o.hs("",[o.k0.required,o.k0.max(999999),o.k0.min(1)]),dailyMaxTxnUserIp:new o.hs("",[o.k0.required,o.k0.max(999999),o.k0.min(1)])})}populateForm(){this.customizeForm.patchValue({maxAmtTxn:this.formElements.maxAmtTxn.value,minAmtTxn:this.formElements.minAmtTxn.value,dailyMaxTxnUser:this.formElements.dailyMaxTxnUser.value,dailyMaxTxnCard:this.formElements.dailyMaxTxnCard.value,dailyMaxTxnUserIp:this.formElements.dailyMaxTxnUserIp.value})}getErrorMessage(t){return this.formElements[t].errorText||"Not a valid input"}onSubmit(){let t=this.convertIntObj(this.customizeForm.value),n={sourceArr:[Object.assign({source:"merchantConfiguration.txnLimits"},t)]};this.pendingProcess=!0,this.merchantConfigurationService.setConfig(n).subscribe(s=>{if(this.pendingProcess=!1,s.success)this.removeErrors(),this.notificationService.displaySuccess({content:s.message.text}),this.nextTab.next({value:"customize"});else{for(let a in s.data.sourceArr)"merchantConfiguration.txnLimits"==s.data.sourceArr[a].source&&(this.config=s.data.sourceArr[a]);this.initialiseFormElements(),this.processFormElements(),this.populateForm(),this.markErrors()}})}convertIntObj(t){const i={};for(const n in t){const s=+t[n];i[n]=isNaN(s)?t[n]:s}return i}get IsDisabled(){for(let t in this.customizeForm.controls)if(!this.skipValidationList.includes(t)&&this.customizeForm.controls[t].invalid)return!0;return!1}ngOnDestroy(){this.minCtrSub.unsubscribe(),this.maxCtrSub.unsubscribe()}static{this.\u0275fac=function(i){return new(i||r)(e.rXU(g),e.rXU(C.Ix),e.rXU(y.J))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-limits"]],outputs:{nextTab:"nextTab"},decls:45,vars:19,consts:[[1,"mar-20",3,"hidden"],[1,"zaak-loader"],[1,"bluebg-02","an-dash","minvhFull",3,"hidden"],[1,"col-12","d-flex","justify-content-center"],[1,"col-12","form-container","mt-4","px-4"],[1,"col-sm-12","col-md-12","px-0"],[3,"formGroup"],[1,"mat-title"],[1,"row"],["appearance","outline",1,"col-md-6","col-12"],["matInput","","formControlName","minAmtTxn","restrict-type","numberswithdecimal",3,"maxlength","restrictTypeFormName"],["matInput","","formControlName","maxAmtTxn","restrict-type","numberswithdecimal",3,"maxlength","restrictTypeFormName"],["matInput","","formControlName","dailyMaxTxnUser","restrict-type","numbers",3,"maxlength","restrictTypeFormName"],["matInput","","formControlName","dailyMaxTxnCard","restrict-type","numbers",3,"maxlength","restrictTypeFormName"],["matInput","","formControlName","dailyMaxTxnUserIp","restrict-type","numbers",3,"maxlength","restrictTypeFormName"],[1,"col-12","d-flex","mt-5","justify-content-center"],["mat-flat-button","","disabled","","color","primary",1,"h48","pl-5","pr-5",2,"width","260px",3,"disabled","click"]],template:function(i,n){1&i&&(e.j41(0,"div",0),e.nrm(1,"div",1),e.k0s(),e.j41(2,"main",2)(3,"section",3)(4,"mat-card",4)(5,"div",5)(6,"form",6)(7,"div",7),e.EFF(8,"Transaction Limits"),e.k0s(),e.j41(9,"div",8)(10,"mat-form-field",9)(11,"mat-label"),e.EFF(12,"Min. Amount Per Transaction(In Rs.)"),e.k0s(),e.nrm(13,"input",10),e.j41(14,"mat-error"),e.EFF(15),e.k0s()(),e.j41(16,"mat-form-field",9)(17,"mat-label"),e.EFF(18,"Max. Amou
1nt Per Transaction(In Rs.)"),e.k0s(),e.nrm(19,"input",11),e.j41(20,"mat-error"),e.EFF(21),e.k0s()()(),e.j41(22,"div",8)(23,"mat-form-field",9)(24,"mat-label"),e.EFF(25,"Daily Max Number of Transactions Per User"),e.k0s(),e.nrm(26,"input",12),e.j41(27,"mat-error"),e.EFF(28),e.k0s()(),e.j41(29,"mat-form-field",9)(30,"mat-label"),e.EFF(31,"Daily Max Number of Tansactions Per User Per Card"),e.k0s(),e.nrm(32,"input",13),e.j41(33,"mat-error"),e.EFF(34),e.k0s()()(),e.j41(35,"div",8)(36,"mat-form-field",9)(37,"mat-label"),e.EFF(38,"Daily Max Number of Transactions Per User Per IP"),e.k0s(),e.nrm(39,"input",14),e.j41(40,"mat-error"),e.EFF(41),e.k0s()()(),e.j41(42,"div",15)(43,"button",16),e.bIt("click",function(){return n.onSubmit()}),e.EFF(44,"Save"),e.k0s()()()()()()()),2&i&&(e.Y8G("hidden",!n.pendingProcess),e.R7$(2),e.Y8G("hidden",n.pendingProcess),e.R7$(4),e.Y8G("formGroup",n.customizeForm),e.R7$(7),e.Y8G("maxlength",9)("restrictTypeFormName",n.customizeForm),e.R7$(2),e.JRh(n.getErrorMessage("minAmtTxn")),e.R7$(4),e.Y8G("maxlength",9)("restrictTypeFormName",n.customizeForm),e.R7$(2),e.JRh(n.getErrorMessage("maxAmtTxn")),e.R7$(5),e.Y8G("maxlength",6)("restrictTypeFormName",n.customizeForm),e.R7$(2),e.JRh(n.getErrorMessage("dailyMaxTxnUser")),e.R7$(4),e.Y8G("maxlength",6)("restrictTypeFormName",n.customizeForm),e.R7$(2),e.JRh(n.getErrorMessage("dailyMaxTxnCard")),e.R7$(5),e.Y8G("maxlength",6)("restrictTypeFormName",n.customizeForm),e.R7$(2),e.JRh(n.getErrorMessage("dailyMaxTxnUserIp")),e.R7$(2),e.Y8G("disabled",n.IsDisabled||n.pendingProcess))},dependencies:[F.iV,d.k5,d.Ky,d.aw,T.aL,k._m,o.qT,o.me,o.BC,o.cb,o.tU,o.j4,o.JD,ie.m],styles:[".title[_ngcontent-%COMP%]{text-align:center;font-size:24px}.rad-label[_ngcontent-%COMP%]{font-size:12px;color:gray;margin-bottom:7px}.hint[_ngcontent-%COMP%]{font-size:10px;color:gray}.form-container[_ngcontent-%COMP%]{width:80vw;box-shadow:0 2px 10px #cacaca35}"]})}}return r})();var oe=c(7290),se=c(675);function ae(r,l){if(1&r){const t=e.RV6();e.j41(0,"div",3)(1,"span",4),e.EFF(2),e.k0s(),e.j41(3,"div",5)(4,"button",6),e.bIt("click",function(){const s=e.eBV(t).index,a=e.XpG();return e.Njj(a.moveItem(s,s-1))}),e.j41(5,"mat-icon",7),e.EFF(6,"arrow_upward"),e.k0s()()()()}if(2&r){const t=l.$implicit,i=l.index;e.R7$(2),e.JRh(t.text),e.R7$(2),e.Y8G("disabled",0===i)}}let le=(()=>{class r{constructor(){this.items=[],this.updateOrder=new e.bkB}moveItem(t,i){if(this.isValidIndex(t)&&this.isValidIndex(i)){const n=this.items[t];this.items=this.items.filter((s,a)=>a!==t),this.items.splice(i,0,n),this.updateOrder.emit(this.items)}}isValidIndex(t){return t>=0&&t<=this.items.length}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-reorderable-list"]],inputs:{items:"items"},outputs:{updateOrder:"updateOrder"},decls:3,vars:1,consts:[[1,"list-container","m-4"],[1,"list-box"],["class","list-item",4,"ngFor","ngForOf"],[1,"list-item"],[1,"item-text"],[1,"button-group"],[1,"move-btn","bg-success",3,"disabled","click"],[1,"ft22","twhite"]],template:function(i,n){1&i&&(e.j41(0,"div",0)(1,"div",1),e.DNE(2,ae,7,2,"div",2),e.k0s()()),2&i&&(e.R7$(2),e.Y8G("ngForOf",n.items))},dependencies:[x.An,u.Sq],styles:[".list-container[_ngcontent-%COMP%]{width:240px;font-family:Arial,sans-serif}.list-box[_ngcontent-%COMP%]{border:1px solid #D6E0F8;border-radius:8px;overflow:hidden}.list-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px;border-bottom:1px solid #eee;background-color:#fff;transition:background-color .2s;color:#404040}.list-item[_ngcontent-%COMP%]:last-child{border-bottom:none}.list-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.item-text[_ngcontent-%COMP%]{flex-grow:1}.button-group[_ngcontent-%COMP%]{display:flex;gap:4px}.move-btn[_ngcontent-%COMP%]{padding:4px 4px 0;border:1px solid #ccc;background-color:#fff;border-radius:4px;cursor:pointer;transition:all .2s}.move-btn[_ngcontent-%COMP%]:hover:not(:disabled){background-color:#e9ecef;border-color:#adb5bd}.move-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}"]})}}return r})();function ce(r,l){if(1&r&&(e.j41(0,"mat-option",24),e.EFF(1),e.k0s()),2&r){const t=l.$implicit;e.Y8G("value",t),e.R7$(1),e.SpI("",t," ")}}function me(r,l){1&r&&(e.j41(0,"mat-error"),e.EFF(1,"Invalid Time"),e.k0s())}function pe(r,l){if(1&r&&(e.j41(0,"mat-option",24),e.EFF(1),e.k0s()),2&r){const t=l.$implicit;e.Y8G("value",t),e.R7$(1),e.SpI("",t," ")}}function de(r,l){1&r&&(e.j41(0,"mat-error"),e.EFF(1,"Invalid Time"),e.k0s())}function ue(r,l){if(1&r&&(e.j41(0,"mat-option",24),e.EFF(1),e.k0s()),2&r){const t=l.$implicit;e.Y8G("value",t),e.R7$(1),e.SpI("",t," ")}}function he(r,l){if(1&r&&(e.j41(0,"mat-option",24),e.EFF(1),e.k0s()),2&r){const t=l.$implicit;e.Y8G("value",t),e.R7$(1),e.SpI("",t," ")}}function fe(r,l){if(1&r&&(e.j41(0,"mat-option",24),e.EFF(1),e.k0s()),2&r){const t=l.$implicit;e.Y8G("value",t),e.R7$(1),e.SpI("",t," ")}}function ge(r,l){1&r&&(e.j41(0,"mat-error"),e.EFF(1,"Invalid Time"),e.k0s())}function be(r,l){if(1&r&&(e.j41(0,"div",8)(1,"mat-form-field",39)(2,"mat-label"),e.EFF(3,"Email"),e.k0s(),e.nrm(4,"input",40),e.j41(5,"mat-hint",41),e.EFF(6,"Email id on which you wish to receive transaction status emails"),e.k0s(),e.j41(7,"mat-error"),e.EFF(8),e.k0s()()()),2&r){const t=e.XpG();e.R7$(8),e.JRh(t.getErrorMessage("txnEmail"))}}function ve(r,l){if(1&r&&(e.j41(0,"div",8)(1,"mat-form-field",39)(2,"mat-label"),e.EFF(3,"Mobile Number"),e.k0s(),e.nrm(4,"input",42),e.j41(5,"mat-hint",43),e.EFF(6,"Mobile Number on which you wish to receive transaction status SMS"),e.k0s(),e.j41(7,"mat-error"),e.EFF(8),e.k0s()()()),2&r){const t=e.XpG();e.R7$(8),e.JRh(t.getErrorMessage("txnSms"))}}let ye=(()=>
1{class r{constructor(t,i,n){this.merchantConfigurationService=t,this.router=i,this.notificationService=n,this.nextTab=new e.bkB,this.formElements={},this.pendingProcess=!1,this.skipValidationList=[],this.daysAvailable=[...Array(8).keys()],this.hoursAvailable=[...Array(24).keys()],this.minutesAvailable=[...Array(60).keys()],this.sessionMinutesAvailable=[...Array(31).keys()].splice(5),this.secondsAvailable=[...Array(60).keys()],this.items=[{id:"11",text:"Cards"},{id:"12",text:"Netbanking"},{id:"13",text:"Wallet"},{id:"14",text:"UPI"},{id:"23",text:"Pay Later"}]}ngOnInit(){this.initialiseFormElements(),this.createForm(),this.processDetails(),this.emailRadioSubs=this.customizeForm.controls.txnEmailEnabled.valueChanges.subscribe(t=>{this.txnEmail(t)}),this.smsRadioSubs=this.customizeForm.controls.txnSmsEnabled.valueChanges.subscribe(t=>{this.txnSms(t)})}markErrors(){for(let t in this.formElements)this.formElements[t].errorText&&this.customizeForm.controls[t]&&(this.customizeForm.controls[t].setErrors({serverError:!0}),this.customizeForm.controls[t].markAsTouched())}removeErrors(){for(let t in this.formElements)this.formElements[t].errorText&&this.customizeForm.controls[t]&&(this.customizeForm.controls[t].setErrors(null),this.formElements[t].errorText="",this.customizeForm.controls[t].markAsTouched())}initialiseFormElements(){this.formElements={retryPayments:{value:"",errorText:""},txnSessionTime:{value:"",errorText:""},paymentLinkExpiryTime:{value:"",errorText:""},customerTxnEmails:{value:"",errorText:""},tdrMode:{value:"",errorText:""},txnEmailEnabled:{value:"",errorText:""},txnEmail:{value:"",errorText:""},txnSms:{value:"",errorText:""},txnSmsEnabled:{value:"",errorText:""}}}
1processDetails(){this.pendingProcess=!0,this.merchantConfigurationService.getConfig({sourceArr:["merchantConfiguration.custom"]}).subscribe(i=>{if(i.success){for(let n in i.data.sourceArr)"merchantConfiguration.custom"==i.data.sourceArr[n].source&&(this.config=i.data.sourceArr[n]);this.processFormElements(),this.processPaymentOptionOrder(),this.populateForm(),this.markErrors()}this.pendingProcess=!1})}processPaymentOptionOrder(){if(this.concatenatedIds=this.config.paymentOptionOrder,this.concatenatedIds){let t=this.concatenatedIds.split(",");this.items=this.items.sort((i,n)=>{const s=t.indexOf(i.id),a=t.indexOf(n.id);return-1!==s&&-1!==a?s-a:-1!==s?-1:-1!==a?1:0})}else this.paymentModeOrder(this.items)}processFormElements(){for(let t in this.formElements)this.formElements[t].value=this.config[t]}txnEmail(t){t?(this.isTxnEmail=!0,this.customizeForm.addControl("txnEmail",new o.hs(this.formElements.txnEmail.value,[o.k0.required,o.k0.email])),this.formElements.txnEmail.errorText&&setTimeout(()=>{this.customizeForm.controls.txnEmail.setErrors({serverError:!0}),this.customizeForm.controls.txnEmail.markAsTouched()})):(this.isTxnEmail=!1,this.customizeForm.removeControl("txnEmail"))}txnSms(t){t?(this.isTxnSms=!0,this.customizeForm.addControl("txnSms",new o.hs(this.formElements.txnSms.value,[o.k0.required,o.k0.pattern(/^[6789]{1}[0-9]{9}$/)])),this.formElements.txnSms.errorText&&setTimeout(()=>{this.customizeForm.controls.txnSms.setErrors({serverError:!0}),this.customizeForm.controls.txnSms.markAsTouched()})):(this.isTxnSms=!1,this.customizeForm.removeControl("txnSms"))}createForm(){this.customizeForm=new o.J3({retryPayments:new o.hs("",[o.k0.required]),txnSessionTime:new o.J3({minutes:new o.hs(""),seconds:new o.hs("",[o.k0.required])},{validators:this.txnSessionTimeValidator()}),paymentLinkExpiryTime:new o.J3({days:new o.hs(""),hours:new o.hs(""),minutes:new o.hs("",[o.k0.required])},{validators:this.expiryTimeValidator()}),customerTxnEmails:new o.hs("",[o.k0.required]),txnEmailEnabled:new o.hs("",[o.k0.required]),txnEmail:new o.hs("",[o.k0.required,o.k0.email]),txnSmsEnabled:new o.hs("",[o.k0.required]),txnSms:new o.hs("",[o.k0.required,o.k0.pattern(/^[6789]{1}[0-9]{9}$/)])})}populateForm(){this.customizeForm.patchValue({retryPayments:this.formElements.retryPayments.value,txnSessionTime:this.formElements.txnSessionTime.value,paymentLinkExpiryTime:this.formElements.paymentLinkExpiryTime.value,customerTxnEmails:this.formElements.customerTxnEmails.value,tdrMode:this.formElements.tdrMode.value,txnEmailEnabled:this.formElements.txnEmailEnabled.value,txnEmail:this.formElements.txnEmail.value,txnSmsEnabled:this.formElements.txnSmsEnabled.value,txnSms:this.formElements.txnSms.value})}getErrorMessage(t){return this.formElements[t].errorText||"Not a valid input"}onSubmit(){this.pendingProcess=!0;let t=Object.assign({source:"merchantConfiguration.custom",paymentOptionOrder:this.concatenatedIds},this.customizeForm.value);t={sourceArr:[t]},this.merchantConfigurationService.setConfig(t).subscribe(i=>{if(this.pendingProcess=!1,i.success)this.removeErrors(),this.notificationService.displaySuccess({content:i.message.text}),this.nextTab.next({value:"appearance"});else{for(let n in i.data.sourceArr)"merchantConfiguration.custom"==i.data.sourceArr[n].source&&(this.config=i.data.sourceArr[n]);this.initialiseFormElements(),this.processFormElements(),this.populateForm(),this.markErrors()}})}get IsDisabled(){for(let t in this.customizeForm.controls)if(!this.skipValidationList.includes(t)&&this.customizeForm.controls[t].invalid)return!0;return!1}expiryTimeValidator(){return t=>{const i=t.get("minutes");let{days:n,hours:s,minutes:a}=t.value;return 0===n&&0===s&&0===a?(i.setErrors({error:!0}),{error:!0}):(i.setErrors(null),null)}}txnSessionTimeValidator(){return t=>{const i=t.get("seconds");let{minutes:n,seconds:s}=t.value;return 30===n&&0!==s?(i.setErrors({error:!0}),{error:!0}):(i.setErrors(null),null)}}paymentModeOrder(t){this.concatenatedIds=t.map(i=>i.id).join(",")}ngOnDestroy(){this.emailRadioSubs.unsubscribe(),this.smsRadioSubs.unsubscribe()}static{this.\u0275fac=function(i){return new(i||r)(e.rXU(g),e.rXU(C.Ix),e.rXU(y.J))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-customize"]],outputs:{nextTab:"nextTab"},decls:107,vars:23,consts:[[1,"mar-20",3,"hidden"],[1,"zaak-loader"],[1,"bluebg-02","an-dash","minvhFull",3,"hidden"],[1,"col-12","d-flex","justify-content-center"],[1,"col-12","form-container","mt-4","px-4"],[1,"col-sm-12","col-md-12","px-0"],[3,"formGroup"],[1,"mat-title"],[1,"row","mb-4"],[1,"col-md-6"],[1,"rad-label","mt-4"],["formGroupName","txnSessionTime",1,"col-md-6","pl-5",2,"height","70px"],["appearance","outline",1,"mr-2",2,"width","75px"],[1,"rad-label"],["formControlName","minutes",3,"selectionChange"],["minutesSelector",""],[3,"value",4,"ngFor","ngForOf"],[4,"ngIf"],["appearance","outline",1,"mr-2","posrel",2,"width","75px","white-space","nowrap"],["formControlName","seconds","required","",3,"selectionChange"],["secondsSelector",""],[1,"hint"],[1,"col-md-6","pl-5"],["formControlName","retryPayments","color","primary",1,"m_radio-col"],[3,"value"],["formGroupName","paymentLinkExpiryTime",1,"col-md-6","pl-5",2,"height","70px"],["formControlName","days",3,"selectionChange"],["daysSelector",""],["formControlName","hours",3,"selectionChange"],["hoursSelector",""],["formControlName","minutes","required","",3,"selectionChange"],[1,"col-md-6","pl-4"],[3,"items","updateOrder"],["formControlName","customerTxnEmails","color","primary",1,"m_radio-col"],["formControlName","txnEmailEnabled","color","primary",1,"m_radio-col"],["class","row mb-4",4,"ngIf"],["formControlName","txnSmsEnabled","color","primary",1,"m_radio-col"],[1,"col-12","d-flex","mt-5","justify-content-center"],["mat-flat-button","","disabled","","color","primary",1,"h48","pl-5","pr-5",2,"width","260px",3,"disabled","click"],["appearance","outline",1,"col-md-6","col-12"],["matInput","","formControlName","txnEmail"],["align","start",1,"hint"],["matInput","","formControlName","txnSms","maxlength","10"],["align","start",1,"hint","p-0"]],template:function(i,n){if(1&i){const s=e.RV6();e.j41(0,"div",0),e.nrm(1,"div",1),e.k0s(),e.j41(2,"main",2)(3,"section",3)(4,"mat-card",4)(5,"div",5)(6,"form",6)(7,"div",7),e.EFF(8,"Additional configurations"),e.k0s(),e.j41(9,"div",8)(10,"div",9)(11,"p",10),e.EFF(12,"Expiry time for payment page"),e.k0s()(),e.j41(13,"div",11)(14,"mat-form-field",12)(15,"mat-label",13),e.EFF(16,"Minutes"),e.k0s(),e.j41(17,"mat-select",14,15),e.bIt("selectionChange",function(){e.eBV(s);const m=e.sdS(18);return e.Njj(m.close())}),e.DNE(19,ce,2,2,"mat-option",16),e.k0s(),e.DNE(20,me,2,0,"mat-error",17),e.k0s(),e.j41(21,"mat-form-field",18)(22,"mat-label",13),e.EFF(23,"Seconds"),e.k0s(),e.j41(24,"mat-select",19,20),e.bIt("selectionChange",function(){e.eBV(s);const m=e.sdS(25);return e.Njj(m.close())}),e.DNE(26,pe,2,2,"mat-option",16),e.k0s(),e.DNE(27,de,2,0,"mat-error",17),e.k0s()()(),e.j41(28,"div",8)(29,"div",9)(30,"p",13),e.EFF(31,"Retry Payments"),e.k0s(),e.j41(32,"div",21),e.EFF(33,"If transaction fails at bank's side we'll ask the user to try another payment mode"),e.k0s()(),e.j41(34,"div",22)(35,"mat-radio-group",23)(36,"mat-radio-button",24),e.EFF(37,"Yes"),e.k0s(),e.j41(38,"mat-radio-button",24),e.EFF(39,"No"),e.k0s()()()(),e.j41(40,"div",8)(41,"div",9)(42,"p",10),e.EFF(43,"Default expiry time for payment links"),e.k0s()(),e.j41(44,"div",25)(45,"mat-form-field",12)(46,"mat-label",13),e.EFF(47,"Days"),e.k0s(),e.j41(48,"mat-select",26,27),e.bIt("selectionChange",function(){e.eBV(s);const m=e.sdS(49);return e.Njj(m.close())}),e.DNE(50,ue,2,2,"mat-option",16),e.k0s()(),e.j41(51,"mat-form-field",12)(52,"mat-label",13),e.EFF(53,"Hours"),e.k0s(),e.j41(54,"mat-select",28,29),e.bIt("selectionChange",function(){e.eBV(s);const m=e.sdS(55);return e.Njj(m.close())}),e.DNE(56,he,2,2,"mat-option",16),e.k0s()(),e.j41(57,"mat-form-field",18)(58,"mat-label",13),e.EFF(59,"Minutes"),e.k0s(),e.j41(60,"mat-select",30,15),e.bIt("selectionChange",function(){e.eBV(s);const m=e.sdS(18);return e.Njj(m.close())}),e.DNE(62,fe,2,2,"mat-option",16),e.k0s(),e.DNE(63,ge,2,0,"mat-error",17),e.k0s()()(),e.j41(64,"div",8)(65,"div",9)(66,"p",13),e.EFF(67,"Payment Mode Order"),e.k0s(),e.j41(68,"div",21),e.EFF(69,"Set order of payment mode on payment page"),e.k0s()(),e.j41(70,"div",31)(71,"app-reorderable-list",32),e.bIt("updateOrder",function(m){return n.paymentModeOrder(m)}),e.k0s()()(),e.j41(72,"div",8)(73,"div",9)(74,"p",13),e.EFF(75,"Send Transactional Email to your Customers"),e.k0s()(),e.j41(76,"div",22)(77,"mat-radio-group",33)(78,"mat-radio-button",24),e.EFF(79,"Yes"),e.k0s(),e.j41(80,"mat-radio-button",24),e.EFF(81,"No"),e.k0s()()()(),e.j41(82,"div",8)(83,"div",9)(84,"mat-label"),e.EFF(85,"Receive Transaction Emails from Zaakpay"),e.k0s()(),e.j41(86,"div",22)(87,"mat-radio-group",34)(88,"mat-radio-button",24),e.EFF(89,"Yes"),e.k0s(),e.j41(90,"mat-radio-button",24),e.EFF(91,"No"),e.k0s()()()(),e.DNE(92,be,9,1,"div",35),e.j41(93,"div",8)(94,"div",9)(95,"mat-label"),e.EFF(96,"Receive Transaction SMS from Zaakpay"),e.k0s()(),e.j41(97,"div",22)(98,"mat-radio-group",36)(99,"mat-radio-button",24),e.EFF(100,"Yes"),e.k0s(),e.j41(101,"mat-radio-button",24),e.EFF(102,"No"),e.k0s()()()(),e.DNE(103,ve,9,1,"div",35),e.j41(104,"div",37)(105,"button",38),e.bIt("click",function(){return n.onSubmit()}),e.EFF(106,"Save"),e.k0s()()()()()()()}2&i&&(e.Y8G("hidden",!n.pendingProcess),e.R7$(2),e.Y8G("hidden",n.pendingProcess),e.R7$(4),e.Y8G("formGroup",n.customizeForm),e.R7$(13),e.Y8G("ngForOf",n.sessionMinutesAvailable),e.R7$(1),e.Y8G("ngIf",n.customizeForm.controls.txnSessionTime.errors),e.R7$(6),e.Y8G("ngForOf",n.secondsAvailable),e.R7$(1),e.Y8G("ngIf",n.customizeForm.controls.txnSessionTime.errors),e.R7$(9),e.Y8G("value",!0),e.R7$(2),e.Y8G("value",!1),e.R7$(12),e.Y8G("ngForOf",n.daysAvailable),e.R7$(6),e.Y8G("ngForOf",n.hoursAvailable),e.R7$(6),e.Y8G("ngForOf",n.minutesAvailable),e.R7$(1),e.Y8G("ngIf",n.customizeForm.controls.paymentLinkExpiryTime.errors),e.R7$(8),e.Y8G("items",n.items),e.R7$(7),e.Y8G("value",!0),e.R7$(2),e.Y8G("value",!1),e.R7$(8),e.Y8G("value",!0),e.R7$(2),e.Y8G("value",!1),e.R7$(2),e.Y8G("ngIf",n.isTxnEmail),e.R7$(7),e.Y8G("value",!0),e.R7$(2),e.Y8G("value",!1),e.R7$(2),e.Y8G("ngIf",n.isTxnSms),e.R7$(2),e.Y8G("disabled",n.IsDisabled||n.pendingProcess))},dependencies:[u.Sq,u.bT,F.iV,d.k5,d.Ky,d.V3,d.aw,T.aL,k._m,oe.cu,se.d1,w.Ku,w.No,o.qT,o.me,o.BC,o.cb,o.YS,o.tU,o.j4,o.JD,o.$R,le],styles:[".title[_ngcontent-%COMP%]{text-align:center;font-size:24px}.rad-label[_ngcontent-%COMP%]{font-size:15px;margin-bottom:7px}.hint[_ngcontent-%COMP%]{font-size:13px;color:gray}.form-container[_ngcontent-%COMP%]{width:80vw;box-shadow:0 2px 10px #cacaca35}.expiry-err[_ngcontent-%COMP%]{top:65px;position:absolute;font-size:12px}"]})}}return r})();function Fe(r,l){1&r&&e.nrm(0,"img",40)}function ke(r,l){1&r&&(e.j41(0,"span",41),e.EFF(1,"Your Logo"),e.k0s())}function Ce(r,l){if(1&r&&(e.j41(0,"div",42),e.nrm(1,"img",43),e.k0s()),2&r){const t=e.XpG();e.R7$(1),e.Y8G("src",t.previewSrc,e.B4B)}}function xe(r,l){1&r&&e.nrm(0,"img",44)}function Ee(r,l){if(1&r&&e.nrm(0,"img",45),2&r){const t=e.XpG();e.Y8G("src",t.previewSrc,e.B4B)}}function _e(r,l){if(1&r&&(e.j41(0,"mat-error",46),e.EFF(1),e.k0s()),2&r){const t=e.XpG();
1e.R7$(1),e.JRh(t.invalidMessage)}}function Te(r,l){if(1&r){const t=e.RV6();e.j41(0,"a",50),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,s=e.XpG();return e.Njj(s.cancelFile(n))}),e.j41(1,"mat-icon",51),e.EFF(2,"cancel"),e.k0s()()}}function we(r,l){if(1&r&&(e.j41(0,"li")(1,"span",47)(2,"span",48),e.EFF(3),e.k0s(),e.DNE(4,Te,3,0,"a",49),e.k0s()()),2&r){const t=l.$implicit;e.R7$(3),e.JRh(t.data.name),e.R7$(1),e.Y8G("ngIf",t.canRetry)}}const Re=function(r){return{"background-color":r}},je=function(r){return{"upload-error":r}},Pe=function(r,l){return{"upload-error":r,hasFile:l}};let Ae=(()=>{class r{constructor(t,i){this.notificationService=t,this.merchantConfigurationService=i,this.pendingProcess=!1,this.files=[],this.accept="image/png, image/jpeg, image/jpg",this.invalidFile=!1,this.invalidMessage=""}ngOnInit(){this.createForm(),this.fetchAppearanceDetails()}createForm(){this.appearenceForm=new o.J3({brandName:new o.hs("",[o.k0.required]),logoFileName:new o.hs("",[o.k0.required]),brandLogo:new o.hs("",[o.k0.required]),brandColor:new o.hs("#ffffff",[o.k0.required])})}fetchAppearanceDetails(){this.pendingProcess=!0,this.merchantConfigurationService.getConfig({sourceArr:["merchantConfiguration.appearance"]}).subscribe(i=>{this.pendingProcess=!1,i.success?(this.setDefaultForm(i.data.sourceArr[0]),console.log("data",i.data.sourceArr[0])):this.notificationService.displayError({content:i.message.text})})}setDefaultForm(t){let{brandName:i,logoFileName:n,brandLogo:s,brandColor:a}=t;this.appearenceForm.patchValue({brandName:i,logoFileName:n,brandLogo:s,brandColor:a||""}),this.previewSrc=s}onClick(t){t.preventDefault(),this.files=[];const i=document.getElementById("fileUpload");i.onchange=n=>{for(let s=0;s<i.files.length;s++){const a=i.files[s];console.log("FILE",a),a.size<=512e3&&("image/png"===a.type||"image/jpeg"===a.type||"image/jpg"===a.type)?(this.invalidFile=!1,this.appearenceForm.controls.logoFileName.setValue(a.name),this.appearenceForm.updateValueAndValidity(),this.onSelectFile(n),this.files.push({data:a,state:"in",inProgress:!1,progress:0,canRetry:!0,canCancel:!0}),this.uploadFiles()):(this.invalidFile=!0,a.size>512e3&&(this.invalidMessage="Image size should be less than 512KB"),"image/png"===a.type||"image/jpeg"===a.type||"image/jpg"===a.type||(this.invalidMessage="Allowed formats are jpg, jpeg, png"))}},i.click()}validateFile(){}cancelFile(t){this.removeFileFromArray(t)}retryFile(t){this.uploadFile(t),t.canRetry=!1}uploadFiles(){document.getElementById("fileUpload").value="",this.files.forEach(i=>{this.uploadFile(i)})}removeFileFromArray(t){const i=this.files.indexOf(t);i>-1&&this.files.splice(i,1),this.previewSrc="",this.appearenceForm.controls.brandLogo.setValue(""),this.appearenceForm.controls.logoFileName.setValue(""),this.appearenceForm.updateValueAndValidity()}uploadFile(t){this.previewSrc=t.data.name}onSelectFile(t){if(t.target.files&&t.target.files[0]){var i=new FileReader;i.readAsDataURL(t.target.files[0]),i.onload=n=>{this.previewSrc=n.target.result,this.appearenceForm.controls.brandLogo.setValue(this.previewSrc),this.appearenceForm.updateValueAndValidity()}}}onSubmit(){this.pendingProcess=!0;let t=Object.assign({source:"merchantConfiguration.appearance"},this.appearenceForm.value);t={sourceArr:[t]},this.merchantConfigurationService.setConfig(t).subscribe(i=>{this.pendingProcess=!1,i.success?this.notificationService.displaySuccess({content:i.message.text}):this.notificationService.displayError({content:i.message.text})})}static{this.\u0275fac=function(i){return new(i||r)(e.rXU(y.J),e.rXU(g))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-appearance"]],decls:55,vars:28,consts:[[1,"mar-20",3,"hidden"],[1,"zaak-loader"],[1,"bluebg-02","an-dash","minvhFull",3,"hidden"],[1,"col-12","d-flex","justify-content-center"],[1,"col-12","form-container","mt-4"],[1,"row"],[1,"col-12","pl-4"],[1,"header-label"],[1,"col-12","px-4"],[1,"header-preview","d-flex","justify-content-center","align-items-center",3,"ngStyle"],["class","pr-4","src","assets/images/Shape.png","alt","preview-image",4,"ngIf"],["class","preview-placeholder",4,"ngIf"],["class","bg-white preview-img-wrapper",4,"ngIf"],[1,"row","mt-5"],[1,"col-sm-12","col-md-10","col-lg-8","pl-4"],[3,"formGroup"],[1,"row","mb-1"],["appearance","outline",1,"col-md-6","col-12"],["matInput","","formControlName","brandName","required",""],[1,"posrel","col-md-6","col-12"],["matPrefix","",2,"position","absolute","top","0px","right","25px","z-index","1","line-height","46px","opacity","0"],["type","color","matInput","","formControlName","brandColor","required","",3,"value"],["appearance","outline",1,"wdFull"],["matInput","","formControlName","brandColor","required","",3,"value"],["matSuffix","",1,"color-box-input"],["align","start"],[1,"row","mt-3","flex-column"],[1,"col-12","pb-3","logo-label"],[1,"col-md-4","col-12","m-wdFull"],[1,"logo-preview","d-flex","justify-content-center","align-items-center"],["src","assets/images/Shape.png","alt","preview-image",4,"ngIf"],["alt","preview-image","class","preview-img",3,"src",4,"ngIf"],[1,"row","mt-3"],[1,"col-md-4","col-12","m-wdFull","upload-field-wrapper",3,"ngClass"],["mat-button","","color","primary",1,"h49","upload-btn","wdFull",3,"ngClass","click"],["class","ft12",4,"ngIf"],[4,"ngFor","ngForOf"],["type","file","id","fileUpload","name","fileUpload",2,"display","none",3,"accept"],[1,"col-12","d-flex","mt-5","justify-content-center"],["mat-flat-button","","disabled","","color","primary",1,"h48","pl-5","pr-5",2,"width","260px",3,"disabled","click"],["src","assets/images/Shape.png","alt","preview-image",1,"pr-4"],[1,"preview-placeholder"],[1,"bg-white","preview-img-wrapper"],["alt","",1,"preview-img",3,"src"],["src","assets/images/Shape.png","alt","preview-image"],["alt","preview-image",1,"preview-img",3,"src"],[1,"ft12"],["id","file-label",1,"d-flex","justify-content-center","align-items-center","ft12"],[1,"ellipsis"],["title","Cancel",3,"click",4,"ngIf"],["title","Cancel",3,"click"],[1,"tgreyteel","ft20","csrPtr"]],template:function(i,n){1&i&&(e.j41(0,"div",0),e.nrm(1,"div",1),e.k0s(),e.j41(2,"main",2)(3,"section",3)(4,"mat-card",4)(5,"div",5)(6,"div",6)(7,"p",7),e.EFF(8,"Customize your payment page on Zaakpay"),e.k0s()()(),e.j41(9,"div",5)(10,"div",8)(11,"div",9),e.DNE(12,Fe,1,0,"img",10),e.DNE(13,ke,2,0,"span",11),e.DNE(14,Ce,2,1,"div",12),e.k0s()()(),e.j41(15,"div",13)(16,"div",14)(17,"form",15)(18,"div",16)(19,"mat-form-field",17)(20,"mat-label"),e.EFF(21,"Brand Name:"),e.k0s(),e.nrm(22,"input",18),e.k0s(),e.j41(23,"div",19)(24,"span",20),e.nrm(25,"input",21),e.k0s(),e.j41(26,"mat-form-field",22)(27,"mat-label"),e.EFF(28,"Primary Brand Color:"),e.k0s(),e.nrm(29,"input",23)(30,"span",24),e.j41(31,"mat-hint",25),e.EFF(32," We\u2019ll use this to further customize the checkout page and the transaction emails sent to customers. "),e.k0s()()()(),e.j41(33,"div",26)(34,"div",27),e.EFF(35,"Upload Logo (max-height:60px,max-width:160px): "),e.k0s(),e.j41(36,"div",28)(37,"div",29),e.DNE(38,xe,1,0,"img",30),e.DNE(39,Ee,1,1,"img",31),e.k0s()()(),e.j41(40,"div",32)(41,"div",33)(42,"button",34),e.bIt("click",function(a){return n.onClick(a)}),e.EFF(43," Upload Logo "),e.j41(44,"mat-icon"),e.EFF(45,"file_upload"),e.k0s()(),e.DNE(46,_e,2,1,"mat-error",35),e.nrm(47,"br"),e.j41(48,"ul"),e.DNE(49,we,5,2,"li",36),e.k0s(),e.nrm(50,"input",37),e.k0s()()()()(),e.j41(51,"div",5)(52,"div",38)(53,"button",39),e.bIt("click",function(){return n.onSubmit()}),e.EFF(54,"Save"),e.k0s()()()()()()),2&i&&(e.Y8G("hidden",!n.pendingProcess),e.R7$(2),e.Y8G("hidden",n.pendingProcess),e.R7$(9),e.Y8G("ngStyle",e.eq3(21,Re,n.appearenceForm.controls.brandColor.value)),e.R7$(1),e.Y8G("ngIf",!n.previewSrc),e.R7$(1),e.Y8G("ngIf",!n.previewSrc),e.R7$(1),e.Y8G("ngIf",n.previewSrc),e.R7$(3),e.Y8G("formGroup",n.appearenceForm),e.R7$(8),e.Y8G("value",n.appearenceForm.value.brandColor),e.R7$(4),e.Y8G("value",n.appearenceForm.value.brandColor),e.R7$(1),e.xc7("background-color",n.appearenceForm.value.brandColor),e.AVh("white-color-box","#ffffff"===n.appearenceForm.value.brandColor),e.R7$(8),e.Y8G("ngIf",!n.previewSrc),e.R7$(1),e.Y8G("ngIf",n.previewSrc),e.R7$(2),e.Y8G("ngClass",e.eq3(23,je,n.invalidFile)),e.R7$(1),e.Y8G("ngClass",e.l_i(25,Pe,n.invalidFile,n.files.length>0)),e.R7$(4),e.Y8G("ngIf",n.invalidFile),e.R7$(3),e.Y8G("ngForOf",n.files),e.R7$(1),e.FS9("accept",n.accept),e.R7$(3),e.Y8G("disabled",!n.appearenceForm.valid))},dependencies:[u.YU,u.Sq,u.bT,u.B3,F.iV,x.An,d.k5,d.Ky,d.V3,d.aw,d.av,d.xZ,T.aL,k._m,o.qT,o.me,o.BC,o.cb,o.YS,o.j4,o.JD],styles:["input[type=color i]{width:25px!important}.form-container[_ngcontent-%COMP%]{width:80vw;padding-top:20px;box-shadow:0 2px 10px #cacaca35}.header-label[_ngcontent-%COMP%]{font-size:16px;line-height:30px;font-weight:700}.header-preview[_ngcontent-%COMP%]{box-shadow:0 2px 4px #00000026;height:70px}.preview-placeholder[_ngcontent-%COMP%]{color:#ccc;font-size:16px;font-weight:700;line-height:19px}.logo-label[_ngcontent-%COMP%]{color:gray;font-size:12px;line-height:14px}.logo-preview[_ngcontent-%COMP%]{border:2px dashed #CCCCCC;border-radius:8px;height:80px}.preview-img[_ngcontent-%COMP%]{max-width:160px;max-height:60px;object-fit:contain}.color-box-input[_ngcontent-%COMP%]{height:20px;width:20px;border-radius:4px;display:block;box-shadow:0 2px 4px #0000001a}.white-color-box[_ngcontent-%COMP%]{border:1px solid #EAEAEA}.preview-img-wrapper[_ngcontent-%COMP%]{height:60px;border-radius:8px;display:inline-flex;align-items:center}"]})}}return r})();var Me=c(8359),Ie=c(8654);function Se(r,l){if(1&r&&(e.j41(0,"div",21)(1,"span"),e.EFF(2),e.k0s()()),2&r){const t=e.XpG();e.R7$(2),e.JRh(t.partnerInitial)}}function Ge(r,l){if(1&r&&e.nrm(0,"img",22),2&r){const t=e.XpG();e.Y8G("src",t.partnerLogoUrl,e.B4B)}}function Oe(r,l){if(1&r&&(e.j41(0,"span",23)(1,"mat-icon",24),e.EFF(2,"email"),e.k0s(),e.EFF(3),e.k0s()),2&r){const t=e.XpG();e.R7$(3),e.SpI(" ",t.partnerEmail," ")}}function ze(r,l){if(1&r&&(e.j41(0,"span",23)(1,"mat-icon",24),e.EFF(2,"phone"),e.k0s(),e.EFF(3),e.k0s()),2&r){const t=e.XpG();e.R7$(3),e.SpI(" ",t.partnerPhone," ")}}function $e(r,l){if(1&r&&(e.j41(0,"div",25)(1,"div",26),e.EFF(2),e.k0s(),e.j41(3,"mat-checkbox",27),e.EFF(4),e.k0s()()),2&r){const t=l.$implicit,i=e.XpG();
1e.R7$(2),e.JRh(t.label),e.R7$(1),e.Y8G("formControlName",t.key)("disabled",i.isPermissionDisabled(t)),e.R7$(1),e.SpI(" ",t.actionLabel," ")}}let Ue=(()=>{class r{constructor(t,i){this.merchantConfigurationService=t,this.notificationService=i,this.pendingProcess=!1,this.partnerName="",this.partnerEmail="",this.partnerPhone="",this.partnerLogoUrl="",this.formSubscriptions=new Me.yU,this.permissionItems=[{key:"transactionsView",label:"Transactions",actionLabel:"View"},{key:"refundsModify",label:"Refunds",actionLabel:"Modify",requires:"transactionsView"},{key:"settlementsView",label:"Settlements",actionLabel:"View"},{key:"settlementReportsDownloadView",label:"Settlement Reports Download",actionLabel:"View",requires:"settlementsView"},{key:"settingsView",label:"Settings",actionLabel:"View"}]}ngOnInit(){this.createForm(),this.setupPermissionDependencies(),this.fetchPartnerAccessDetails()}ngOnDestroy(){this.formSubscriptions.unsubscribe()}createForm(){this.partnerAccessForm=new o.J3({transactionsView:new o.hs(!1),refundsModify:new o.hs(!1),settlementsView:new o.hs(!1),settlementReportsDownloadView:new o.hs(!1),settingsView:new o.hs(!1)})}setupPermissionDependencies(){this.formSubscriptions.add(this.partnerAccessForm.get("transactionsView").valueChanges.subscribe(t=>{t||this.partnerAccessForm.get("refundsModify").setValue(!1,{emitEvent:!1}),this.updateDependentControlState("refundsModify","transactionsView")})),this.formSubscriptions.add(this.partnerAccessForm.get("settlementsView").valueChanges.subscribe(t=>{t||this.partnerAccessForm.get("settlementReportsDownloadView").setValue(!1,{emitEvent:!1}),this.updateDependentControlState("settlementReportsDownloadView","settlementsView")})),this.updateDependentControlState("refundsModify","transactionsView"),this.updateDependentControlState("settlementReportsDownloadView","settlementsView")}updateDependentControlState(t,i){const n=this.partnerAccessForm.get(t);this.partnerAccessForm.get(i)?.value?n?.enable({emitEvent:!1}):n?.disable({emitEvent:!1})}isPermissionDisabled(t){return!!t.requires&&!this.partnerAccessForm.get(t.requires)?.value}fetchPartnerAccessDetails(){this.pendingProcess=!0,this.merchantConfigurationService.getConfig({sourceArr:["merchantConfiguration.partnerAccess"]}).subscribe(i=>{if(this.pendingProcess=!1,i.success){const n=i.data.sourceArr.find(s=>"merchantConfiguration.partnerAccess"===s.source);if(n){this.setPartnerDetails(n);const s=n.transactionsView??!1,a=n.settlementsView??!1;this.partnerAccessForm.patchValue({transactionsView:s,refundsModify:!!s&&(n.refundsModify??!1),settlementsView:a,settlementReportsDownloadView:!!a&&(n.settlementReportsDownloadView??!1),settingsView:n.settingsView??!1}),this.updateDependentControlState("refundsModify","transactionsView"),this.updateDependentControlState("settlementReportsDownloadView","settlementsView")}}else this.notificationService.displayError({content:i.message.text})})}setPartnerDetails(t){this.partnerName=t.partnerName||"",this.partnerEmail=t.partnerEmail||"",this.partnerPhone=t.partnerPhone||"",this.partnerLogoUrl=t.partnerLogoUrl||""}get partnerInitial(){return this.partnerName?this.partnerName.charAt(0).toUpperCase():"P"}onSubmit(){this.pendingProcess=!0;const t={sourceArr:[Object.assign({source:"merchantConfiguration.partnerAccess"},this.partnerAccessForm.getRawValue())]};this.merchantConfigurationService.setConfig(t).subscribe(i=>{this.pendingProcess=!1,i.success?this.notificationService.displaySuccess({content:i.message.text}):this.notificationService.displayError({content:i.message.text})})}static{this.\u0275fac=function(i){return new(i||r)(e.rXU(g),e.rXU(y.J))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-partner-access"]],decls:28,vars:10,consts:[[1,"mar-20",3,"hidden"],[1,"zaak-loader"],[1,"bluebg-02","an-dash","minvhFull",3,"hidden"],[1,"col-12","d-flex","justify-content-center"],[1,"col-12","form-container","mt-4","px-4"],[1,"section-block"],[1,"section-title"],[1,"partner-details-card","d-flex","align-items-center"],["class","partner-avatar",4,"ngIf"],["alt","Partner logo","class","partner-avatar-img",3,"src",4,"ngIf"],[1,"partner-info"],[1,"partner-name"],[1,"partner-contact","d-flex","flex-wrap","align-items-center"],["class","contact-item",4,"ngIf"],[1,"section-block","mt-4"],[1,"section-subtitle"],[3,"formGroup"],[1,"permissions-grid"],["class","permission-card",4,"ngFor","ngForOf"],[1,"col-12","d-flex","mt-5","justify-content-center"],["mat-flat-button","","color","primary",1,"h48","pl-5","pr-5","save-btn",3,"disabled","click"],[1,"partner-avatar"],["alt","Partner logo",1,"partner-avatar-img",3,"src"],[1,"contact-item"],[1,"contact-icon"],[1,"permission-card"],[1,"permission-label"],["color","primary",3,"formControlName","disabled"]],template:function(i,n){1&i&&(e.j41(0,"div",0),e.nrm(1,"div",1),e.k0s(),e.j41(2,"main",2)(3,"section",3)(4,"mat-card",4)(5,"div",5)(6,"div",6),e.EFF(7,"Partner Details"),e.k0s(),e.j41(8,"div",7),e.DNE(9,Se,3,1,"div",8),e.DNE(10,Ge,1,1,"img",9),e.j41(11,"div",10)(12,"div",11),e.EFF(13),e.k0s(),e.j41(14,"div",12),e.DNE(15,Oe,4,1,"span",13),e.DNE(16,ze,4,1,"span",13),e.k0s()()()(),e.j41(17,"div",14)(18,"div",6),e.EFF(19,"Permissions"),e.k0s(),e.j41(20,"p",15),e.EFF(21,"Configure what access the partner has to your account."),e.k0s(),e.j41(22,"form",16)(23,"div",17),e.DNE(24,$e,5,4,"div",18),e.k0s(),e.j41(25,"div",19)(26,"button",20),e.bIt("click",function(){return n.onSubmit()}),e.EFF(27,"Save"),e.k0s()()()()()()()),2&i&&(e.Y8G("hidden",!n.pendingProcess),e.R7$(2),e.Y8G("hidden",n.pendingProcess),e.R7$(7),e.Y8G("ngIf",!n.partnerLogoUrl),e.R7$(1),e.Y8G("ngIf",n.partnerLogoUrl),e.R7$(3),e.JRh(n.partnerName||"\u2014"),e.R7$(2),e.Y8G("ngIf",n.partnerEmail),e.R7$(1),e.Y8G("ngIf",n.partnerPhone),e.R7$(6),e.Y8G("formGroup",n.partnerAccessForm),e.R7$(2),e.Y8G("ngForOf",n.permissionItems),e.R7$(2),e.Y8G("disabled",n.pendingProcess))},dependencies:[u.Sq,u.bT,F.iV,x.An,k._m,Ie.NZ,o.qT,o.BC,o.cb,o.j4,o.JD],styles:[".form-container[_ngcontent-%COMP%]{width:80vw;padding-top:20px;box-shadow:0 2px 10px #cacaca35}.section-title[_ngcontent-%COMP%]{font-size:16px;font-weight:700;line-height:24px;margin-bottom:16px}.section-subtitle[_ngcontent-%COMP%]{font-size:14px;color:gray;margin-bottom:20px}.partner-details-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #eaeaea;border-radius:8px;padding:20px 24px;gap:16px}
1.partner-avatar[_ngcontent-%COMP%]{width:48px;height:48px;min-width:48px;border-radius:50%;background:#e8f5e9;color:#2e7d32;display:flex;align-items:center;justify-content:center;font-size:20px;font-weight:700}.partner-avatar-img[_ngcontent-%COMP%]{width:48px;height:48px;min-width:48px;border-radius:50%;object-fit:cover}.partner-name[_ngcontent-%COMP%]{font-size:16px;font-weight:700;line-height:24px;margin-bottom:4px}.partner-contact[_ngcontent-%COMP%]{gap:24px}.contact-item[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-size:14px;color:#666}.contact-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:#999}.permissions-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.permission-card[_ngcontent-%COMP%]{background:#f7f7f7;border-radius:8px;padding:16px 12px;min-height:84px}.permission-label[_ngcontent-%COMP%]{font-size:14px;font-weight:600;margin-bottom:12px}.save-btn[_ngcontent-%COMP%]{width:260px}@media (max-width: 1200px){.permissions-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (max-width: 992px){.permissions-grid[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 576px){.permissions-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}.partner-contact[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start;gap:8px}}"]})}}return r})();function Ne(r,l){if(1&r){const t=e.RV6();e.j41(0,"a",7),e.bIt("click",function(){const s=e.eBV(t).$implicit,a=e.XpG();return e.Njj(a.changeLinkType(s))}),e.EFF(1),e.k0s()}if(2&r){const t=l.$implicit,i=e.XpG();e.Y8G("active",i.activeLink==t),e.R7$(1),e.SpI(" ",t.viewValue," ")}}function Ve(r,l){if(1&r){const t=e.RV6();e.j41(0,"app-api-keys",8),e.bIt("nextTab",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.changeLinkType(n))}),e.k0s()}}function Ye(r,l){if(1&r){const t=e.RV6();e.j41(0,"app-integration-urls",8),e.bIt("nextTab",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.changeLinkType(n))}),e.k0s()}}function Ke(r,l){if(1&r){const t=e.RV6();e.j41(0,"app-limits",8),e.bIt("nextTab",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.changeLinkType(n))}),e.k0s()}}function Le(r,l){if(1&r){const t=e.RV6();e.j41(0,"app-customize",8),e.bIt("nextTab",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.changeLinkType(n))}),e.k0s()}}function De(r,l){if(1&r){const t=e.RV6();e.j41(0,"app-appearance",8),e.bIt("nextTab",function(n){e.eBV(t);const s=e.XpG();return e.Njj(s.changeLinkType(n))}),e.k0s()}}function Be(r,l){1&r&&e.nrm(0,"app-partner-access")}const I="merchantConfiguration.partnerAccess",R=[{value:"keys",viewValue:"API Keys"},{value:"urls",viewValue:"Integration Urls"},{value:"limits",viewValue:"Transaction Limits"},{value:"customize",viewValue:"Customization"},{value:"appearance",viewValue:"Appearance"}],Xe={value:"partnerAccess",viewValue:"Partner Access"},Je=[{path:"",component:(()=>{class r{constructor(t){this.merchantConfigurationService=t,this.currentTab="keys",this.links=[...R],this.activeLink=this.links[0]}ngOnInit(){this.loadPartnerAccessTabVisibility()}loadPartnerAccessTabVisibility(){this.merchantConfigurationService.getConfig({sourceArr:[I]}).subscribe(t=>{const i=t.success&&this.isPartnerMapped(t.data?.sourceArr);this.links=i?[...R,Xe]:[...R],"partnerAccess"!==this.currentTab||i?this.links.some(n=>n.value===this.activeLink?.value)||(this.activeLink=this.links[0]):(this.currentTab="keys",this.activeLink=this.links[0])})}isPartnerMapped(t){return!!t?.length&&!0===t.find(n=>n.source===I)?.partnerMapped}changeLinkType(t){this.currentTab=t.value,this.activeLink=t}static{this.\u0275fac=function(i){return new(i||r)(e.rXU(g))}}static{this.\u0275cmp=e.VBU({type:r,selectors:[["app-merchant-configuration"]],decls:13,vars:7,consts:[[1,"current-account-component-header"],[1,"an-dash"],[1,"col-12","bg-white"],["mat-tab-nav-bar",""],["mat-tab-link","",3,"active","click",4,"ngFor","ngForOf"],[3,"nextTab",4,"ngIf"],[4,"ngIf"],["mat-tab-link","",3,"active","click"],[3,"nextTab"]],template:function(i,n){1&i&&(e.j41(0,"div",0),e.EFF(1," Configurations\n"),e.k0s(),e.j41(2,"main",1)(3,"div",2)(4,"nav",3),e.DNE(
15,Ne,2,2,"a",4),e.k0s()(),e.j41(6,"section"),e.DNE(7,Ve,1,0,"app-api-keys",5),e.DNE(8,Ye,1,0,"app-integration-urls",5),e.DNE(9,Ke,1,0,"app-limits",5),e.DNE(10,Le,1,0,"app-customize",5),e.DNE(11,De,1,0,"app-appearance",5),e.DNE(12,Be,1,0,"app-partner-access",6),e.k0s()()),2&i&&(e.R7$(5),e.Y8G("ngForOf",n.links),e.R7$(2),e.Y8G("ngIf","keys"===n.currentTab),e.R7$(1),e.Y8G("ngIf","urls"===n.currentTab),e.R7$(1),e.Y8G("ngIf","limits"===n.currentTab),e.R7$(1),e.Y8G("ngIf","customize"===n.currentTab),e.R7$(1),e.Y8G("ngIf","appearance"===n.currentTab),e.R7$(1),e.Y8G("ngIf","partnerAccess"===n.currentTab))},dependencies:[u.Sq,u.bT,A.et,A.BW,ee,ne,re,ye,Ae,Ue],styles:[".mat-tab-link[_ngcontent-%COMP%]{min-width:100px}.top-filter-sec[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;z-index:1;position:fixed;background-color:#fdfdff}.top-filter-sec[_ngcontent-%COMP%] .pay-type-nav[_ngcontent-%COMP%]{margin:30px 0;flex:1;border:0}.top-filter-sec[_ngcontent-%COMP%] .pay-type-nav[_ngcontent-%COMP%] .paymode[_ngcontent-%COMP%]{margin-right:20px;font-size:16px;cursor:pointer;display:inline-flex;overflow:hidden;align-items:center;color:gray;border-radius:8px;border:0;background:transparent}.top-filter-sec[_ngcontent-%COMP%] .pay-type-nav[_ngcontent-%COMP%] .paymode[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{height:20px;width:17px;margin-right:5px}.top-filter-sec[_ngcontent-%COMP%] .pay-type-nav[_ngcontent-%COMP%] .paymode[_ngcontent-%COMP%]:hover, .top-filter-sec[_ngcontent-%COMP%] .pay-type-nav[_ngcontent-%COMP%] .paymode.mat-button-toggle-checked[_ngcontent-%COMP%]{color:#3043ce;box-shadow:inset 0 1px 2px #00000026;background-color:#fdfdff}.top-filter-sec[_ngcontent-%COMP%] .pay-type-nav[_ngcontent-%COMP%] .paymode[_ngcontent-%COMP%]:hover{font-weight:400}.top-filter-sec[_ngcontent-%COMP%] .pay-type-nav[_ngcontent-%COMP%] .paymode.mat-button-toggle-checked[_ngcontent-%COMP%], .top-filter-sec[_ngcontent-%COMP%] .pay-type-nav[_ngcontent-%COMP%] .paymode.mat-button-toggle-checked[_ngcontent-%COMP%]:hover{font-weight:700}.top-filter-sec[_ngcontent-%COMP%] .duration-filter[_ngcontent-%COMP%]{width:150px}.pt-70[_ngcontent-%COMP%]{padding-top:70px}.mat-tab-link[_ngcontent-%COMP%]{padding:0 20px}"]})}}return r})()}];let qe=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275mod=e.$C({type:r})}static{this.\u0275inj=e.G2t({imports:[C.iI.forChild(Je),C.iI]})}}return r})();var We=c(9148),S=c(4533),Ze=c(48),He=c(3887);let Qe=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275mod=e.$C({type:r})}static{this.\u0275inj=e.G2t({imports:[u.MD,qe,We.G,S.Vg,Ze.XP,o.X1,He.G,o.YN,S.Vg]})}}return r})()}}]);
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.