Your IP : 216.73.216.189


Current Path : /var/www/pms.test.indaco.store/www/
Upload File :
Current File : /var/www/pms.test.indaco.store/www/808.js

"use strict";(self.webpackChunkpms_frontend=self.webpackChunkpms_frontend||[]).push([[808],{808:(V,w,l)=>{l.r(w),l.d(w,{AdminModule:()=>An});var m=l(6895),s=l(4006),d=l(4859),b=l(6709),D=l(5412),g=l(9549),f=l(7392),M=l(4144),ee=l(6338),k=l(8739),C=l(1572),O=l(4385),y=l(6308),c=l(671),P=l(3848),h=l(3683),_=l(1266),x=l(6630),te=l(2198),e=l(4650);let p=(()=>{class n{}return n.admin="admin",n.partners="partners",n.partnerDetail="partner",n.users="users",n.userDetail="user",n.plans="plans",n.planDetail="plan-detail",n.indacoModules="indaco-modules",n.indacoModuleDetail="indaco-module-detail",n.apiKeys="api-keys",n.apiKeyDetail="api-key-detail",n.channels="channels",n})(),Z=(()=>{class n{constructor(t){this.router=t,this.currentChildState="",this.router.events.pipe((0,te.h)(a=>a instanceof x.m2)).subscribe(()=>this.routeChanged())}get partnersRoutingLink(){return`/${p.admin}/${p.partners}`}get usersRoutingLink(){return`/${p.admin}/${p.users}`}get subscriptionPlansRoutingLink(){return`/${p.admin}/${p.plans}`}get indacoModulesRoutingLink(){return`/${p.admin}/${p.indacoModules}`}get apiKeysRoutingLink(){return`/${p.admin}/${p.apiKeys}`}get channelsRoutingLink(){return`/${p.admin}/${p.channels}`}goToPartners(){this.navigateTo(p.partners)}goToPartnerDetail(t){t?this.navigateTo(p.partnerDetail,t):this.navigateTo(p.partnerDetail)}goToUsers(){this.navigateTo(p.users)}goToUserDetail(t,a){this.navigateTo(p.userDetail,t??"null",a??"")}goToPlans(){this.navigateTo(p.plans)}goToSubscriptionPlanDetail(t){t?this.navigateTo(p.planDetail,t):this.navigateTo(p.planDetail)}goToModules(){this.navigateTo(p.indacoModules)}goToModuleDetail(t){t?this.navigateTo(p.indacoModuleDetail,t):this.navigateTo(p.indacoModuleDetail)}goToApiKeys(){this.navigateTo(p.apiKeys)}goToApiKeyDetail(t){t?this.navigateTo(p.apiKeyDetail,t):this.navigateTo(p.apiKeyDetail)}goToChannels(t){t?this.navigateTo(p.channels,t):this.navigateTo(p.channels)}navigateTo(t,...a){let i="";a?.length>0&&a.forEach(r=>i=i.concat(`/${r}`)),this.router.navigate([`/${p.admin}/${t}${i}`])}routeChanged(){this.currentChildState=this.router.parseUrl(this.router.url).root.children.primary.segments[1]?.path??""}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(x.F0))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"any"}),n})(),ne=(()=>{class n{constructor(){}convertToAdminUser(t){return JSON.parse(JSON.stringify({_id:t._id,username:t.username,email:t.email,userType:t.userType,partnerId:t.partner?._id,password:t._id?"":void 0,userModuleAccessibleFeatures:t.userModuleAccessibleFeatures,plan:t.partner?.subscriptionPlan}))}convertToUser(t){return{_id:t._id,username:t.username,email:t.email,userType:t.userType,partner:{_id:t.partnerId,companyName:"",subscriptionPlan:t.plan},userModuleAccessibleFeatures:t.userModuleAccessibleFeatures}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"any"}),n})();var U=l(4850),A=l(3078),F=l(3098);let R=(()=>{class n{constructor(t){this.apollo=t}generateNewApiKey(){return F.i.create().toString()}generateNewApiKeyPrefix(){return F.i.create().toString().split("-")[0]}getAllApiKeys(){const t=A.Ps`
      query {
        apiKeyMany {
          _id,
          keyPrefix,
          name,
          scopes,
          enabled,
        }
      }
    `;return this.apollo.query({query:t,fetchPolicy:"network-only"}).pipe((0,U.U)(a=>a.data.apiKeyMany))}getApiKey(t){const a=A.Ps`
      query ($apiKeyId: MongoID!) {
        apiKeyById (_id: $apiKeyId) {
          _id,
          keyPrefix,
          name,
          scopes,
          enabled,
        }
      }
    `;return this.apollo.query({query:a,fetchPolicy:"network-only",variables:{apiKeyId:t}}).pipe((0,U.U)(i=>i.data.apiKeyById))}saveApiKey(t){const a=this.getSaveMutation(t),i={...t};return this.sanitizeRecord(i),this.apollo.mutate({mutation:a,fetchPolicy:"network-only",variables:{apiKeyId:t._id,apiKeyRecord:i}}).pipe((0,U.U)(r=>t._id?r.data.apiKeyUpdateById.recordId:r.data.apiKeyCreateOne.recordId))}getSaveMutation(t){return t._id?A.Ps`
        mutation ($apiKeyId: MongoID!, $apiKeyRecord: UpdateByIdApiKeyInput!) {
          apiKeyUpdateById (_id: $apiKeyId, record: $apiKeyRecord) {
            recordId
          }
        }
      `:A.Ps`
        mutation($apiKeyRecord: CreateOneApiKeyInput!) {
          apiKeyCreateOne (record: $apiKeyRecord) {
            recordId
          }
        }
      `}sanitizeRecord(t){for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&a.startsWith("_")&&delete t[a]}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(A._M))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"any"}),n})();var q=l(220),T=l(7009);const ae=["*"];let S=(()=>{class n{constructor(t){this.navigationService=t}get partnersRoutingLink(){return this.navigationService.partnersRoutingLink}get usersRoutingLink(){return this.navigationService.usersRoutingLink}get subscriptionPlansRoutingLink(){return this.navigationService.subscriptionPlansRoutingLink}get indacoModulesRoutingLink(){return this.navigationService.indacoModulesRoutingLink}get apiKeysRoutingLink(){return this.navigationService.apiKeysRoutingLink}get channelsRoutingLink(){return this.navigationService.channelsRoutingLink}ngOnInit(){}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Z))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-admin"]],ngContentSelectors:ae,decls:43,vars:33,consts:[["mat-tab-nav-bar",""],["mat-tab-link","","routerLinkActive","",3,"routerLink","active"],["partnersla","routerLinkActive"],[1,"mat-18"],["susbscriptionplansla","routerLinkActive"],["indacomodulesla","routerLinkActive"],["usersla","routerLinkActive"],["apikeysla","routerLinkActive"],["channelsla","routerLinkActive"]],template:function(t,a){if(1&t&&(e.F$t(),e.TgZ(0,"mat-toolbar")(1,"mat-icon"),e._uU(2,"settings"),e.qZA(),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"nav",0)(6,"a",1,2)(8,"mat-icon",3),e._uU(9,"business"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"a",1,4)(14,"mat-icon",3),e._uU(15,"ballot"),e.qZA(),e._uU(16),e.ALo(17,"translate"),e.qZA(),e.TgZ(18,"a",1,5)(20,"mat-icon",3),e._uU(21,"notes"),e.qZA(),e._uU(22),e.ALo(23,"translate"),e.qZA(),e.TgZ(24,"a",1,6)(26,"mat-icon",3),e._uU(27,"group"),e.qZA(),e._uU(28),e.ALo(29,"translate"),e.qZA(),e.TgZ(30,"a",1,7)(32,"mat-icon",3),e._uU(33,"vpn_key"),e.qZA(),e._uU(34),e.ALo(35,"translate"),e.qZA(),e.TgZ(36,"a",1,8)(38,"mat-icon",3),e._uU(39,"signpost"),e.qZA(),e._uU(40),e.ALo(41,"translate"),e.qZA()(),e.Hsn(42)),2&t){const i=e.MAs(7),r=e.MAs(13),u=e.MAs(19),v=e.MAs(25),I=e.MAs(31),L=e.MAs(37);e.xp6(3),e.hij(" ",e.lcZ(4,19,"shared.admin"),"\n"),e.xp6(3),e.Q6J("routerLink",a.partnersRoutingLink)("active",i.isActive),e.xp6(4),e.hij(" ",e.lcZ(11,21,"app.admin.partners.title")," "),e.xp6(2),e.Q6J("routerLink",a.subscriptionPlansRoutingLink)("active",r.isActive),e.xp6(4),e.hij(" ",e.lcZ(17,23,"app.admin.subscriptionPlans.title")," "),e.xp6(2),e.Q6J("routerLink",a.indacoModulesRoutingLink)("active",u.isActive),e.xp6(4),e.hij(" ",e.lcZ(23,25,"app.admin.modules.title")," "),e.xp6(2),e.Q6J("routerLink",a.usersRoutingLink)("active",v.isActive),e.xp6(4),e.hij(" ",e.lcZ(29,27,"app.admin.users.title")," "),e.xp6(2),e.Q6J("routerLink",a.apiKeysRoutingLink)("active",I.isActive),e.xp6(4),e.hij(" ",e.lcZ(35,29,"app.admin.apiKeys.title")," "),e.xp6(2),e.Q6J("routerLink",a.channelsRoutingLink)("active",L.isActive),e.xp6(4),e.hij(" ",e.lcZ(41,31,"app.channels.title")," ")}},dependencies:[x.rH,x.Od,f.Hw,P.BU,P.Nj,h.Ye,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}"]}),n})();const ie=["partnersPaginator"],oe=["partnersSort"];function re(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function se(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.companyName")," "))}function le(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.companyName," ")}}function ce(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.seller")," "))}function pe(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.seller," ")}}function de(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.email")," "))}function ue(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.email," ")}}function me(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.status")," "))}function _e(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,t.active?"app.admin.partners.enabled":"app.admin.partners.disabled")," ")}}function ge(n,o){1&n&&(e.TgZ(0,"th",24),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.partners.vatNumber")," "))}function fe(n,o){if(1&n&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.vatNumber," ")}}function he(n,o){1&n&&(e.TgZ(0,"th",26),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"shared.buttons.actions")," "))}function ve(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"td",25)(1,"button",27),e.NdJ("click",function(){const r=e.CHM(t).$implicit,u=e.oxw(2);return e.KtG(u.openPartnerDetail(r))}),e.TgZ(2,"mat-icon"),e._uU(3,"info"),e.qZA()()()}}function Ce(n,o){1&n&&e._UZ(0,"tr",28)}function Ze(n,o){1&n&&e._UZ(0,"tr",29)}const xe=function(){return[10,20,30]};function be(n,o){if(1&n&&(e.TgZ(0,"div",7)(1,"div",8)(2,"table",9,10),e.ynx(4,11),e.YNc(5,se,3,3,"th",12),e.YNc(6,le,2,1,"td",13),e.BQk(),e.ynx(7,14),e.YNc(8,ce,3,3,"th",12),e.YNc(9,pe,2,1,"td",13),e.BQk(),e.ynx(10,15),e.YNc(11,de,3,3,"th",12),e.YNc(12,ue,2,1,"td",13),e.BQk(),e.ynx(13,16),e.YNc(14,me,3,3,"th",12),e.YNc(15,_e,3,3,"td",13),e.BQk(),e.ynx(16,17),e.YNc(17,ge,3,3,"th",12),e.YNc(18,fe,2,1,"td",13),e.BQk(),e.ynx(19,18),e.YNc(20,he,3,3,"th",19),e.YNc(21,ve,4,0,"td",13),e.BQk(),e.YNc(22,Ce,1,0,"tr",20),e.YNc(23,Ze,1,0,"tr",21),e.qZA(),e._UZ(24,"mat-paginator",22,23),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("dataSource",t.partnersDataSource),e.xp6(20),e.Q6J("matHeaderRowDef",t.partnersDisplayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.partnersDisplayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,xe))}}let Ae=(()=>{class n{constructor(t,a,i){this.partnerService=t,this.navigationService=a,this.snackBar=i,this.partners=[],this.partnersDataSource=new c.by(this.partners),this.partnersDisplayedColumns=["companyName","seller","email","vatNumber","actions"],this.loading=!1}ngOnInit(){this.fetchPartners()}openPartnerDetail(t){this.navigationService.goToPartnerDetail(t._id)}createNewPartner(){this.navigationService.goToPartnerDetail()}fetchPartners(){this.loading=!0,this.partnerService.getAllPartners().subscribe(t=>{this.partners=t,this.partnersDataSource.data=this.partners,setTimeout(()=>{this.partnersDataSource.sort=this.partnersSort,this.partnersDataSource.paginator=this.partnersPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(q.b),e.Y36(Z),e.Y36(T.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-partners"]],viewQuery:function(t,a){if(1&t&&(e.Gf(ie,5),e.Gf(oe,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.partnersPaginator=i.first),e.iGM(i=e.CRH())&&(a.partnersSort=i.first)}},decls:14,vars:8,consts:[[1,"mat-18"],[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],["class","container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[1,"container"],[1,"text-center"],["mat-table","","matSort","",1,"mat-elevation-z8","full-width",3,"dataSource"],["partnersSort","matSort"],["matColumnDef","companyName"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","seller"],["matColumnDef","email"],["matColumnDef","active"],["matColumnDef","vatNumber"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["partnersPaginator",""],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin")(1,"mat-toolbar")(2,"mat-icon",0),e._uU(3,"business"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e._UZ(6,"span",1),e.TgZ(7,"button",2),e.NdJ("click",function(){return a.createNewPartner()}),e.TgZ(8,"mat-icon"),e._uU(9,"add"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA()(),e.YNc(12,re,2,0,"div",3),e.YNc(13,be,26,5,"div",4),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"app.admin.partners.title")," "),e.xp6(6),e.hij(" ",e.lcZ(11,6,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.O5,d.lW,d.RK,f.Hw,k.NW,C.Ou,y.YE,y.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.ge,c.ev,c.XQ,c.Gk,h.Ye,S,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}#partners-list[_ngcontent-%COMP%]{padding:30px}"]}),n})();var Te=l(5254);let J=(()=>{class n{constructor(t){this.apollo=t}getAllSubscriptionPlans(){const t=A.Ps`
    query {
      subscriptionPlanMany {
        _id,
        name,
        indacoModules {
          _id,
          code,
          name,
        },
      }
    }
    `;return this.apollo.query({query:t,fetchPolicy:"network-only"}).pipe((0,U.U)(a=>a.data.subscriptionPlanMany))}getSubscriptionPlan(t){const a=A.Ps`
    query ($subscriptionPlanId: MongoID!) {
      subscriptionPlanById (_id: $subscriptionPlanId) {
        _id,
        name,
        indacoModulesIds,
        indacoModules {
          _id,
          code,
          name
        },
      }
    }
    `;return this.apollo.query({query:a,fetchPolicy:"network-only",variables:{subscriptionPlanId:t}}).pipe((0,U.U)(i=>i.data.subscriptionPlanById))}saveSubscriptionPlan(t){const a=this.getSaveMutation(t),i={...t};for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&r.startsWith("_")&&delete i[r];return i.indacoModulesIds=t.indacoModules.map(r=>r._id),delete i.indacoModules,this.apollo.mutate({mutation:a,fetchPolicy:"network-only",variables:{subscriptionPlanId:t._id,subscriptionPlanRecord:i}}).pipe((0,U.U)(r=>t._id?r.data.subscriptionPlanUpdateById.recordId:r.data.subscriptionPlanCreateOne.recordId))}getSaveMutation(t){return t._id?A.Ps`
      mutation ($subscriptionPlanId: MongoID!, $subscriptionPlanRecord: UpdateByIdSubscriptionPlanInput!) {
        subscriptionPlanUpdateById (_id: $subscriptionPlanId, record: $subscriptionPlanRecord) {
          recordId
        }
      }
      `:A.Ps`
      mutation ($subscriptionPlanRecord: CreateOneSubscriptionPlanInput!) {
        subscriptionPlanCreateOne (record: $subscriptionPlanRecord) {
          recordId
        }
      }
      `}}return n.\u0275fac=function(t){return new(t||n)(e.LFG(A._M))},n.\u0275prov=e.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var H=l(3238);function ye(n,o){1&n&&(e.TgZ(0,"div",2),e._UZ(1,"mat-spinner",3),e.qZA())}function Pe(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.partner.companyName="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function Me(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.partner.seller="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function Ue(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.partner.email="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function ke(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.partner.address="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function Se(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.partner.phone="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function Ie(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.partner.vatNumber="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function we(n,o){if(1&n&&(e.TgZ(0,"mat-option",13),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.Q6J("value",t._id),e.xp6(1),e.Oqu(t.name)}}function De(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",4)(1,"mat-form-field",5)(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",6),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.companyName=i)}),e.qZA(),e.YNc(6,Pe,3,0,"button",7),e.qZA(),e.TgZ(7,"mat-form-field",5)(8,"mat-label"),e._uU(9),e.ALo(10,"translate"),e.qZA(),e.TgZ(11,"input",8),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.seller=i)}),e.qZA(),e.YNc(12,Me,3,0,"button",7),e.qZA(),e.TgZ(13,"mat-form-field",5)(14,"mat-label"),e._uU(15),e.ALo(16,"translate"),e.qZA(),e.TgZ(17,"input",8),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.email=i)}),e.qZA(),e.YNc(18,Ue,3,0,"button",7),e.qZA(),e.TgZ(19,"mat-form-field",5)(20,"mat-label"),e._uU(21),e.ALo(22,"translate"),e.qZA(),e.TgZ(23,"input",8),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.address=i)}),e.qZA(),e.YNc(24,ke,3,0,"button",7),e.qZA(),e.TgZ(25,"mat-form-field",5)(26,"mat-label"),e._uU(27),e.ALo(28,"translate"),e.qZA(),e.TgZ(29,"input",8),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.phone=i)}),e.qZA(),e.YNc(30,Se,3,0,"button",7),e.qZA(),e.TgZ(31,"mat-form-field",5)(32,"mat-label"),e._uU(33),e.ALo(34,"translate"),e.qZA(),e.TgZ(35,"input",6),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.vatNumber=i)}),e.qZA(),e.YNc(36,Ie,3,0,"button",7),e.qZA(),e.TgZ(37,"mat-form-field",5)(38,"mat-label"),e._uU(39),e.ALo(40,"translate"),e.qZA(),e.TgZ(41,"mat-select",9),e.NdJ("valueChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.subscriptionPlanId=i)}),e.YNc(42,we,2,2,"mat-option",10),e.qZA()(),e.TgZ(43,"mat-checkbox",11),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.active=i)}),e._uU(44),e.ALo(45,"translate"),e.qZA(),e.TgZ(46,"mat-checkbox",11),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partner.enabled=i)}),e._uU(47),e.ALo(48,"translate"),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,25,"app.admin.partners.companyName")),e.xp6(2),e.Q6J("ngModel",t.partner.companyName),e.xp6(1),e.Q6J("ngIf",t.partner.companyName),e.xp6(3),e.Oqu(e.lcZ(10,27,"app.admin.partners.seller")),e.xp6(2),e.Q6J("ngModel",t.partner.seller),e.xp6(1),e.Q6J("ngIf",t.partner.seller),e.xp6(3),e.Oqu(e.lcZ(16,29,"app.admin.partners.email")),e.xp6(2),e.Q6J("ngModel",t.partner.email),e.xp6(1),e.Q6J("ngIf",t.partner.email),e.xp6(3),e.Oqu(e.lcZ(22,31,"app.admin.partners.address")),e.xp6(2),e.Q6J("ngModel",t.partner.address),e.xp6(1),e.Q6J("ngIf",t.partner.address),e.xp6(3),e.Oqu(e.lcZ(28,33,"app.admin.partners.phone")),e.xp6(2),e.Q6J("ngModel",t.partner.phone),e.xp6(1),e.Q6J("ngIf",t.partner.phone),e.xp6(3),e.Oqu(e.lcZ(34,35,"app.admin.partners.vatNumber")),e.xp6(2),e.Q6J("ngModel",t.partner.vatNumber),e.xp6(1),e.Q6J("ngIf",t.partner.vatNumber),e.xp6(3),e.Oqu(e.lcZ(40,37,"app.admin.partners.subscriptionPlan")),e.xp6(2),e.Q6J("value",t.partner.subscriptionPlanId),e.xp6(1),e.Q6J("ngForOf",t.plans),e.xp6(1),e.Q6J("ngModel",t.partner.active),e.xp6(1),e.Oqu(e.lcZ(45,39,"app.admin.partners.active")),e.xp6(2),e.Q6J("ngModel",t.partner.enabled),e.xp6(1),e.Oqu(e.lcZ(48,41,"app.admin.partners.enabled"))}}let G=(()=>{class n{constructor(t,a,i,r){this.snackBar=t,this.partnerService=a,this.planService=i,this.translateService=r,this.partnerSaved=new e.vpe,this.loading=!1,this.plans=[]}get partner(){return this._partner||this.emtpyPartner(),this._partner??this.createEmptyPartner()}ngOnInit(){this.initPage()}save(){this.validateInput()&&(this.loading=!0,this.partnerService.savePartner(this.partner).subscribe(t=>{this.snackBar.open(this.translateService.instant("app.admin.shared.dataSuccessfullySaved"),void 0,{duration:3e3}),this.fetchPartner(t,!1),this.partnerSaved.emit(t)},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}refresh(){this.partner._id?this.fetchPartner(this.partner._id):this.emtpyPartner()}initPage(){this.planService.getAllSubscriptionPlans().subscribe(t=>this.plans=t).add(()=>{this.partnerId&&this.fetchPartner(this.partnerId)})}fetchPartner(t,a=!0){return a&&(this.loading=!0),(0,Te.D)(this.partnerService.getPartner(t)).subscribe(i=>this._partner={...i}).add(()=>{a&&(this.loading=!1)})}emtpyPartner(){this._partner=this.createEmptyPartner()}createEmptyPartner(){return{_id:"",companyName:"",email:"",address:"",phone:"",active:!1,enabled:!1,forcePasswordChange:!0,subscriptionPlanId:"",vatNumber:"",seller:""}}validateInput(){return""!==this.partner.companyName&&""!==this.partner.vatNumber}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T.ux),e.Y36(q.b),e.Y36(J),e.Y36(_.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["partner-info"]],inputs:{partnerId:"partnerId"},outputs:{partnerSaved:"partnerSaved"},decls:2,vars:2,consts:[["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","required","","type","text",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],["matInput","","type","text",3,"ngModel","ngModelChange"],[3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],[1,"example-margin",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[3,"value"]],template:function(t,a){1&t&&(e.YNc(0,ye,2,0,"div",0),e.YNc(1,De,49,43,"div",1)),2&t&&(e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.sg,m.O5,s.Fj,s.JJ,s.Q7,s.On,d.RK,b.oG,g.KE,g.hX,g.R9,f.Hw,M.Nt,C.Ou,O.gD,H.ey,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}"]}),n})();var Ke=l(8192),Ne=l(2306),Oe=l(9350),$=l(1041),qe=l(7712),Je=l(38),Y=l(4961),j=l(8732);function Ye(n,o){1&n&&(e.TgZ(0,"div",4),e._UZ(1,"mat-spinner",5),e.qZA())}function Qe(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"users-grid",6),e.NdJ("openClicked",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.openUserDetail(i))})("deleteUserClicked",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.deleteUser(i))})("resetPasswordClicked",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.resetPassword(i))}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("users",t.users)}}let Le=(()=>{class n{constructor(t,a,i){this.userService=t,this.navigationService=a,this.snackBar=i,this.users=[],this.loading=!1}ngOnInit(){this.fetchUsers()}openUserDetail(t){this.navigationService.goToUserDetail(t._id,this.partnerId)}createNewUser(){this.navigationService.goToUserDetail(void 0,this.partnerId)}deleteUser(t){t._id&&(this.loading=!0,this.userService.deleteUser(t._id).subscribe(()=>{this.fetchUsers()},a=>{this.snackBar.open(a.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}resetPassword(t){this.loading=!0,this.userService.resetPassword(t.user,t.newPassword,t.passwordConfirm,t.oldPassword).subscribe(()=>{this.fetchUsers()},a=>{this.snackBar.open(a.message,"OK",{panelClass:["error-snackbar"],duration:3e3})}).add(()=>this.loading=!1)}fetchUsers(){this.loading=!0,this.partnerId&&this.userService.getPartnerUsers(this.partnerId).subscribe(t=>{this.users=t}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Y.f),e.Y36(Z),e.Y36(T.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["partner-users"]],inputs:{partnerId:"partnerId"},decls:9,vars:5,consts:[[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],[3,"users","openClicked","deleteUserClicked","resetPasswordClicked",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[3,"users","openClicked","deleteUserClicked","resetPasswordClicked"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar"),e._UZ(1,"span",0),e.TgZ(2,"button",1),e.NdJ("click",function(){return a.createNewUser()}),e.TgZ(3,"mat-icon"),e._uU(4,"add"),e.qZA(),e._uU(5),e.ALo(6,"translate"),e.qZA()(),e.YNc(7,Ye,2,0,"div",2),e.YNc(8,Qe,1,1,"users-grid",3)),2&t&&(e.xp6(5),e.hij(" ",e.lcZ(6,3,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.O5,d.lW,f.Hw,C.Ou,h.Ye,j.Y,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}"]}),n})();function Fe(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"info"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.info")," "))}function Re(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"partner-info",8),e.NdJ("partnerSaved",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.partnerSaved(i))}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("partnerId",t.partnerId)}}function He(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"group"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.users")," "))}function Ge(n,o){if(1&n&&e._UZ(0,"partner-users",6),2&n){const t=e.oxw(2);e.Q6J("partnerId",t.partnerId)}}function $e(n,o){1&n&&(e.TgZ(0,"mat-tab"),e.YNc(1,He,4,3,"ng-template",3),e.YNc(2,Ge,1,1,"ng-template",4),e.qZA())}function je(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"inventory_2"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.catalog")," "))}function Ee(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"price_check"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.priceList")," "))}function Be(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"inventory_2"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.warehouse")," "))}function ze(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"format_list_bulleted"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.orders.title")," "))}function Xe(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"format_list_bulleted"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.listings")," "))}function We(n,o){1&n&&(e.TgZ(0,"mat-icon",7),e._uU(1,"signpost"),e.qZA(),e._uU(2),e.ALo(3,"translate")),2&n&&(e.xp6(2),e.hij(" ",e.lcZ(3,1,"app.admin.partners.channels")," "))}let E=(()=>{class n{constructor(t,a){this.navigationService=t,this.route=a,this.partnerId=this.route.snapshot.paramMap.get("id")}get isNewPartner(){return!this.partnerId}ngOnInit(){}partnerSaved(t){this.partnerId=t}back(){this.navigationService.goToPartners()}save(){this.partnerInfoComponent.save()}refresh(){this.partnerInfoComponent.refresh()}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Z),e.Y36(x.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-partner-detail"]],viewQuery:function(t,a){if(1&t&&e.Gf(G,5),2&t){let i;e.iGM(i=e.CRH())&&(a.partnerInfoComponent=i.first)}},decls:43,vars:19,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["mat-tab-label",""],["matTabContent",""],[4,"ngIf"],[3,"partnerId"],[1,"mat-18"],[3,"partnerId","partnerSaved"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar")(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",2),e.NdJ("click",function(){return a.save()}),e.TgZ(16,"mat-icon"),e._uU(17,"save"),e.qZA(),e._uU(18),e.ALo(19,"translate"),e.qZA()(),e.TgZ(20,"mat-tab-group")(21,"mat-tab"),e.YNc(22,Fe,4,3,"ng-template",3),e.YNc(23,Re,1,1,"ng-template",4),e.qZA(),e.YNc(24,$e,3,0,"mat-tab",5),e.TgZ(25,"mat-tab"),e.YNc(26,je,4,3,"ng-template",3),e._UZ(27,"app-references",6),e.qZA(),e.TgZ(28,"mat-tab"),e.YNc(29,Ee,4,3,"ng-template",3),e._UZ(30,"app-price-list",6),e.qZA(),e.TgZ(31,"mat-tab"),e.YNc(32,Be,4,3,"ng-template",3),e._UZ(33,"app-warehouses",6),e.qZA(),e.TgZ(34,"mat-tab"),e.YNc(35,ze,4,3,"ng-template",3),e._UZ(36,"app-orders",6),e.qZA(),e.TgZ(37,"mat-tab"),e.YNc(38,Xe,4,3,"ng-template",3),e._UZ(39,"app-listings",6),e.qZA(),e.TgZ(40,"mat-tab"),e.YNc(41,We,4,3,"ng-template",3),e._UZ(42,"app-channels",6),e.qZA()()),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,11,"app.admin.partners.partner")),e.xp6(6),e.hij(" ",e.lcZ(9,13,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,15,"shared.buttons.close")," "),e.xp6(5),e.hij(" ",e.lcZ(19,17,"shared.buttons.save")," "),e.xp6(6),e.Q6J("ngIf",!a.isNewPartner),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId),e.xp6(3),e.Q6J("partnerId",a.partnerId))},dependencies:[m.O5,d.lW,f.Hw,P.Vc,P.uD,P.uX,P.SP,h.Ye,Ke.x,Ne.b,Oe.D,$.J,qe.O,Je.b,Le,G,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}"]}),n})();const Ve=["usersPaginator"],et=["usersSort"];function tt(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function nt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"users-grid",7),e.NdJ("openClicked",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.openUserDetail(i))})("deleteUserClicked",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.deleteUser(i))})("resetPasswordClicked",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.resetPassword(i))}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("users",t.users)}}let at=(()=>{class n{constructor(t,a,i){this.userService=t,this.navigationService=a,this.snackBar=i,this.users=[],this.usersDataSource=new c.by,this.loading=!1,this.usersDisplayedColumns=["username","email","actions"]}ngOnInit(){this.fetchUsers()}openUserDetail(t){this.navigationService.goToUserDetail(t._id)}createNewUser(){this.navigationService.goToUserDetail()}deleteUser(t){t._id&&(this.loading=!0,this.userService.deleteUser(t._id).subscribe(()=>{this.fetchUsers()},a=>{this.snackBar.open(a.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}resetPassword(t){this.loading=!0,this.userService.resetPassword(t.user,t.newPassword,t.passwordConfirm,t.oldPassword).subscribe(()=>{this.fetchUsers()},a=>{this.snackBar.open(a.message,"OK",{panelClass:["error-snackbar"],duration:3e3})}).add(()=>this.loading=!1)}fetchUsers(){this.loading=!0,this.userService.getAllSuperAdmins().subscribe(t=>{this.users=t,this.usersDataSource=new c.by(this.users),setTimeout(()=>{this.usersDataSource.sort=this.usersSort,this.usersDataSource.paginator=this.usersPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(Y.f),e.Y36(Z),e.Y36(T.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-users"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Ve,5),e.Gf(et,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.usersPaginator=i.first),e.iGM(i=e.CRH())&&(a.usersSort=i.first)}},decls:14,vars:8,consts:[[1,"mat-18"],[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],[3,"users","openClicked","deleteUserClicked","resetPasswordClicked",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[3,"users","openClicked","deleteUserClicked","resetPasswordClicked"]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin")(1,"mat-toolbar")(2,"mat-icon",0),e._uU(3,"group"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e._UZ(6,"span",1),e.TgZ(7,"button",2),e.NdJ("click",function(){return a.createNewUser()}),e.TgZ(8,"mat-icon"),e._uU(9,"add"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA()(),e.YNc(12,tt,2,0,"div",3),e.YNc(13,nt,1,1,"users-grid",4),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"app.admin.users.title")," "),e.xp6(6),e.hij(" ",e.lcZ(11,6,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.O5,d.lW,f.Hw,C.Ou,h.Ye,j.Y,S,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}"]}),n})();var B=l(8790),K=l(1942);function it(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function ot(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",15),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.user.username="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function rt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",15),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.user.email="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function st(n,o){if(1&n&&(e.TgZ(0,"div",16)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(t.isPasswordValid())}}function lt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",15),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(3);return e.KtG(i.user.password="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function ct(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",8)(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"input",17),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw(2);return e.KtG(r.user.password=i)}),e.qZA(),e.YNc(5,lt,3,0,"button",10),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,3,"app.admin.users.password")),e.xp6(2),e.Q6J("ngModel",t.user.password),e.xp6(1),e.Q6J("ngIf",t.user.password)}}function pt(n,o){if(1&n&&(e.TgZ(0,"mat-option",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n){const t=o.$implicit;e.Q6J("value",t.value),e.xp6(1),e.Oqu(e.lcZ(2,2,"app.admin.users."+t.key.toLowerCase()))}}function dt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",8)(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"mat-select",18),e.NdJ("valueChange",function(i){e.CHM(t);const r=e.oxw(2);return e.KtG(r.user.userType=i)}),e.YNc(5,pt,3,4,"mat-option",19),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,3,"app.admin.users.userType")),e.xp6(2),e.Q6J("value",t.user.userType),e.xp6(1),e.Q6J("ngForOf",t.userTypes)}}function ut(n,o){if(1&n&&(e.TgZ(0,"mat-option",20),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.Q6J("value",t._id),e.xp6(1),e.Oqu(t.companyName)}}function mt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",8)(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"mat-select",21),e.NdJ("valueChange",function(i){e.CHM(t);const r=e.oxw(2);return e.KtG(r.user.partnerId=i)})("valueChange",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.partnerChanged())}),e.YNc(5,ut,2,2,"mat-option",19),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,4,"app.admin.users.partner")),e.xp6(2),e.Q6J("value",t.user.partnerId)("disabled",t.predeterminedPartnerId),e.xp6(1),e.Q6J("ngForOf",t.partners)}}function _t(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"mat-checkbox",25),e.NdJ("change",function(i){const u=e.CHM(t).$implicit,v=e.oxw().$implicit,I=e.oxw(3);return e.KtG(I.featureActiveChanged(i,v,u))}),e._uU(2),e.qZA()()}if(2&n){const t=o.$implicit,a=e.oxw().$implicit,i=e.oxw(3);e.xp6(1),e.Q6J("disabled",i.isModuleDisabled(a))("checked",i.isFeatureActive(a,t)),e.xp6(1),e.hij(" ",t.name," ")}}function gt(n,o){if(1&n&&(e.TgZ(0,"div",23)(1,"h3"),e._uU(2),e.qZA(),e.YNc(3,_t,3,3,"div",24),e.qZA()),2&n){const t=o.$implicit;e.xp6(2),e.Oqu(t.name),e.xp6(1),e.Q6J("ngForOf",t.moduleAccessibleFeatures)}}function ft(n,o){if(1&n&&(e.TgZ(0,"div")(1,"h2"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.YNc(4,gt,4,2,"div",22),e.qZA()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,2,"app.admin.users.features")),e.xp6(2),e.Q6J("ngForOf",t.modules)}}function ht(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.user.username=i)}),e.qZA(),e.YNc(6,ot,3,0,"button",10),e.qZA(),e.TgZ(7,"mat-form-field",8)(8,"mat-label"),e._uU(9),e.ALo(10,"translate"),e.qZA(),e.TgZ(11,"input",11),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.user.email=i)}),e.qZA(),e.YNc(12,rt,3,0,"button",10),e.qZA(),e.YNc(13,st,3,1,"div",12),e.YNc(14,ct,6,5,"mat-form-field",13),e.YNc(15,dt,6,5,"mat-form-field",13),e.YNc(16,mt,6,6,"mat-form-field",13),e.YNc(17,ft,5,4,"div",14),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,11,"app.admin.users.username")),e.xp6(2),e.Q6J("ngModel",t.user.username),e.xp6(1),e.Q6J("ngIf",t.user.username),e.xp6(3),e.Oqu(e.lcZ(10,13,"app.admin.users.email")),e.xp6(2),e.Q6J("ngModel",t.user.email),e.xp6(1),e.Q6J("ngIf",t.user.email),e.xp6(1),e.Q6J("ngIf",null!==t.isPasswordValid()&&t.isNewUser),e.xp6(1),e.Q6J("ngIf",t.isNewUser),e.xp6(1),e.Q6J("ngIf",!t.isSuperAdminCreation),e.xp6(1),e.Q6J("ngIf",!t.isSuperAdminCreation),e.xp6(1),e.Q6J("ngIf",!t.isSuperAdminCreation)}}let Q=(()=>{class n{constructor(t,a,i,r,u,v,I,L,Tn,yn){this.adminUserService=t,this.indacoModuleService=a,this.keyValuePipe=i,this.navigationService=r,this.partnerService=u,this.route=v,this.snackBar=I,this.translateService=L,this.userService=Tn,this.translate=yn,this.loading=!1,this.partners=[],this.modules=[]}get user(){return this._user||this.emptyUser(),this._user??this.createEmptyUser()}get isNewUser(){return!this._user?._id}get userTypes(){let t=this.keyValuePipe.transform(B.E);return this.predeterminedPartnerId&&(t=t.filter(a=>a.value!==B.E.Admin)),t}get isSuperAdminCreation(){return!this.predeterminedPartnerId}isPasswordValid(){return this.user.password&&""!==this.user.password?-1!==this.user.password.search(/[^a-zA-Z0-9\ \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~]/)?this.translate.instant("app.users.passwordInvalidCharacter"):0===this.user.password.length?this.translate.instant("app.users.passwordRequired"):this.user.password.length<12?this.translate.instant("app.users.passwordMinLength"):this.user.password.length>50?this.translate.instant("app.users.passwordMaxLength"):-1===this.user.password.search(/\d/)?this.translate.instant("app.users.passwordNumber"):-1===this.user.password.search(/[a-z]/)?this.translate.instant("app.users.passwordLowercase"):-1===this.user.password.search(/[A-Z]/)?this.translate.instant("app.users.passwordUppercase"):-1===this.user.password.search(/[\ \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~]/)?this.translate.instant("app.users.passwordSpecialCharacter"):null:this.translate.instant("app.users.passwordRequired")}ngOnInit(){this.initPage()}back(){this.predeterminedPartnerId?this.navigationService.goToPartnerDetail(this.predeterminedPartnerId):this.navigationService.goToUsers()}save(){this.validateInput()&&(this.loading=!0,this.userService.saveUser(this.adminUserService.convertToUser(this.user),this.user.partnerId,this.isNewUser?this.user.password:null).subscribe(t=>{this.snackBar.open(this.translateService.instant("app.admin.shared.dataSuccessfullySaved"),void 0,{duration:3e3}),this.fetchUser(t,!1)},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>{this.loading=!1}))}refresh(){this.user._id?this.fetchUser(this.user._id):this.emptyUser()}isFeatureActive(t,a){return!!this.user.userModuleAccessibleFeatures.find(i=>i[0]==t.code&&i[1]==a.code)}featureActiveChanged(t,a,i){t.checked?this.user.userModuleAccessibleFeatures.push([a.code,i.code]):this.user.userModuleAccessibleFeatures=this.user.userModuleAccessibleFeatures.filter(r=>r[0]!=a.code||r[1]!=i.code)}isModuleDisabled(t){return!this.user.plan?.indacoModules?.find(a=>a._id==t._id)}partnerChanged(){this.assignUserSubscriptionPlan(this.user)}initPage(){this.loading=!0,this.fetchPartners().add(()=>this.fetchAllModules()).add(()=>{const t=this.route.snapshot.paramMap.get("id");return this.predeterminedPartnerId=this.route.snapshot.paramMap.get("partnerId"),t&&"null"!=t?this.fetchUser(t,!1):this.emptyUser()}).add(()=>this.loading=!1)}emptyUser(){this._user=this.createEmptyUser()}createEmptyUser(){const t={username:"",email:"",userType:this.predeterminedPartnerId?"STD":"ADMIN",partnerId:this.predeterminedPartnerId??null,userModuleAccessibleFeatures:[],plan:{}};return this.assignUserSubscriptionPlan(t),t}assignUserSubscriptionPlan(t){""!==t.partnerId&&(t.plan=this.partners?.find(a=>a._id===t.partnerId)?.subscriptionPlan??{})}fetchUser(t,a=!0){return a&&(this.loading=!0),this.userService.getUser(t).subscribe(i=>{this._user=this.adminUserService.convertToAdminUser(i),this.predeterminedPartnerId&&(this._user.partnerId=this.predeterminedPartnerId)}).add(()=>{a&&(this.loading=!1)})}fetchAllModules(){return this.indacoModuleService.getAllModules().subscribe(t=>this.modules=t.filter(a=>a.moduleAccessibleFeatures.length>0))}fetchPartners(){return this.partnerService.getAllPartners().subscribe(t=>this.partners=t)}validateInput(){return""!==this.user.username&&""!==this.user.email&&/\S+@\S+\.\S+/.test(this.user.email)&&(""!==this.user.password||!this.isNewUser)&&""!==this.user.userType}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(ne),e.Y36(K.M),e.Y36(m.Nd),e.Y36(Z),e.Y36(q.b),e.Y36(x.gz),e.Y36(T.ux),e.Y36(_.sK),e.Y36(Y.f),e.Y36(_.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-user-detail"]],decls:22,vars:14,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","required","","type","text",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],["matInput","","required","","type","email","email","",3,"ngModel","ngModelChange"],["style","color: red",4,"ngIf"],["class","full-width","appearance","fill",4,"ngIf"],[4,"ngIf"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[2,"color","red"],["matInput","","required","","required","","type","password",3,"ngModel","ngModelChange"],["required","",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],[3,"value","disabled","valueChange"],["class","service-feature-container",4,"ngFor","ngForOf"],[1,"service-feature-container"],[4,"ngFor","ngForOf"],[3,"disabled","checked","change"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar")(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",2),e.NdJ("click",function(){return a.save()}),e.TgZ(16,"mat-icon"),e._uU(17,"save"),e.qZA(),e._uU(18),e.ALo(19,"translate"),e.qZA()(),e.YNc(20,it,2,0,"div",3),e.YNc(21,ht,18,15,"div",4)),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,6,"app.admin.users.user")),e.xp6(6),e.hij(" ",e.lcZ(9,8,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,10,"shared.buttons.close")," "),e.xp6(5),e.hij(" ",e.lcZ(19,12,"shared.buttons.save")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.sg,m.O5,s.Fj,s.JJ,s.Q7,s.on,s.On,d.lW,d.RK,b.oG,g.KE,g.hX,g.R9,f.Hw,M.Nt,C.Ou,O.gD,H.ey,h.Ye,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}.service-feature-container[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:0}"]}),n})();function vt(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function Ct(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.plan.name="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function Zt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"mat-checkbox",15),e.NdJ("change",function(i){const u=e.CHM(t).$implicit,v=e.oxw(2);return e.KtG(v.moduleActiveChanged(i,u))}),e._uU(2),e.qZA()()}if(2&n){const t=o.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("checked",a.isModuleActive(t)),e.xp6(1),e.hij(" ",t.name," ")}}function xt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.plan.name=i)}),e.qZA(),e.YNc(6,Ct,3,0,"button",10),e.qZA(),e.TgZ(7,"div",11)(8,"div",12)(9,"h2"),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.YNc(12,Zt,3,2,"div",13),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,5,"app.admin.subscriptionPlans.name")),e.xp6(2),e.Q6J("ngModel",t.plan.name),e.xp6(1),e.Q6J("ngIf",t.plan.name),e.xp6(4),e.Oqu(e.lcZ(11,7,"app.admin.subscriptionPlans.modules")),e.xp6(2),e.Q6J("ngForOf",t.modules)}}let z=(()=>{class n{constructor(t,a,i,r,u,v){this.subscriptionPlanService=t,this.indacoModuleService=a,this.navigationService=i,this.route=r,this.snackBar=u,this.translateService=v,this.loading=!1,this.modules=[]}get plan(){return this._plan||this.emptyPlan(),this._plan??this.createEmptyPlan()}ngOnInit(){this.initPage()}back(){this.navigationService.goToPlans()}save(){this.validateInput()&&(this.loading=!0,this.subscriptionPlanService.saveSubscriptionPlan(this.plan).subscribe(t=>{this.snackBar.open(this.translateService.instant("app.admin.shared.dataSuccessfullySaved"),void 0,{duration:3e3}),this.fetchPlan(t,!1)},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}refresh(){this.plan._id?this.fetchPlan(this.plan._id):this.emptyPlan()}isModuleActive(t){return!!this.plan.indacoModules.find(a=>a._id==t._id)}moduleActiveChanged(t,a){t.checked?this.plan.indacoModules.push(a):this.plan.indacoModules=this.plan.indacoModules.filter(i=>i._id!=a._id)}initPage(){this.loading=!0,this.fetchAllModules().add(()=>{const t=this.route.snapshot.paramMap.get("id");if(t)return this.fetchPlan(t,!1)}).add(()=>this.loading=!1)}fetchPlan(t,a=!0){return a&&(this.loading=!0),this.subscriptionPlanService.getSubscriptionPlan(t).subscribe(i=>this._plan=JSON.parse(JSON.stringify(i))).add(()=>{a&&(this.loading=!1)})}fetchAllModules(){return this.indacoModuleService.getAllModules().subscribe(t=>this.modules=t)}emptyPlan(){this._plan=this.createEmptyPlan()}createEmptyPlan(){return{_id:"",name:"",indacoModules:[],royaltyRate:0}}validateInput(){return""!==this.plan.name}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J),e.Y36(K.M),e.Y36(Z),e.Y36(x.gz),e.Y36(T.ux),e.Y36(_.sK))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-plan-detail"]],decls:22,vars:14,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","required","","type","text",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],[1,"modules-container"],[1,"module-child-container"],[4,"ngFor","ngForOf"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],[3,"checked","change"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar")(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",2),e.NdJ("click",function(){return a.save()}),e.TgZ(16,"mat-icon"),e._uU(17,"save"),e.qZA(),e._uU(18),e.ALo(19,"translate"),e.qZA()(),e.YNc(20,vt,2,0,"div",3),e.YNc(21,xt,13,9,"div",4)),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,6,"app.admin.subscriptionPlans.plan")),e.xp6(6),e.hij(" ",e.lcZ(9,8,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,10,"shared.buttons.close")," "),e.xp6(5),e.hij(" ",e.lcZ(19,12,"shared.buttons.save")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.sg,m.O5,s.Fj,s.JJ,s.Q7,s.On,d.lW,d.RK,b.oG,g.KE,g.hX,g.R9,f.Hw,M.Nt,C.Ou,h.Ye,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}.modules-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:flex-start}.module-child-container[_ngcontent-%COMP%]{margin:5px;padding:5px}"]}),n})();const bt=["plansPaginator"],At=["plansSort"];function Tt(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function yt(n,o){1&n&&(e.TgZ(0,"th",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.subscriptionPlans.name")," "))}function Pt(n,o){if(1&n&&(e.TgZ(0,"td",21),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.name," ")}}function Mt(n,o){1&n&&(e.TgZ(0,"th",22),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"shared.buttons.actions")," "))}function Ut(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"td",21)(1,"button",23),e.NdJ("click",function(){const r=e.CHM(t).$implicit,u=e.oxw(2);return e.KtG(u.openSubscriptionPlanDetail(r))}),e.TgZ(2,"mat-icon"),e._uU(3,"info"),e.qZA()()()}}function kt(n,o){1&n&&e._UZ(0,"tr",24)}function St(n,o){1&n&&e._UZ(0,"tr",25)}const It=function(){return[5,10,20]};function wt(n,o){if(1&n&&(e.TgZ(0,"div",7)(1,"div",8)(2,"table",9,10),e.ynx(4,11),e.YNc(5,yt,3,3,"th",12),e.YNc(6,Pt,2,1,"td",13),e.BQk(),e.ynx(7,14),e.YNc(8,Mt,3,3,"th",15),e.YNc(9,Ut,4,0,"td",13),e.BQk(),e.YNc(10,kt,1,0,"tr",16),e.YNc(11,St,1,0,"tr",17),e.qZA(),e._UZ(12,"mat-paginator",18,19),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("dataSource",t.plansDataSource),e.xp6(8),e.Q6J("matHeaderRowDef",t.plansDisplayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.plansDisplayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,It))}}let Dt=(()=>{class n{constructor(t,a,i){this.subscriptionPlanService=t,this.navigationService=a,this.snackBar=i,this.plans=[],this.plansDataSource=new c.by(this.plans),this.plansDisplayedColumns=["name","actions"],this.loading=!1}ngOnInit(){this.fetchSubscriptionPlans()}openSubscriptionPlanDetail(t){this.navigationService.goToSubscriptionPlanDetail(t._id)}createNewSubscriptionPlan(){this.navigationService.goToSubscriptionPlanDetail()}fetchSubscriptionPlans(){this.loading=!0,this.subscriptionPlanService.getAllSubscriptionPlans().subscribe(t=>{this.plans=t,this.plansDataSource.data=this.plans,setTimeout(()=>{this.plansDataSource.sort=this.plansSort,this.plansDataSource.paginator=this.plansPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J),e.Y36(Z),e.Y36(T.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-plans"]],viewQuery:function(t,a){if(1&t&&(e.Gf(bt,5),e.Gf(At,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.plansPaginator=i.first),e.iGM(i=e.CRH())&&(a.plansSort=i.first)}},decls:14,vars:8,consts:[[1,"mat-18"],[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],["class","container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[1,"container"],[1,"text-center"],["mat-table","","matSort","",1,"mat-elevation-z8","full-width",3,"dataSource"],["plansSort","matSort"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["plansPaginator",""],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin")(1,"mat-toolbar")(2,"mat-icon",0),e._uU(3,"ballot"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e._UZ(6,"span",1),e.TgZ(7,"button",2),e.NdJ("click",function(){return a.createNewSubscriptionPlan()}),e.TgZ(8,"mat-icon"),e._uU(9,"add"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA()(),e.YNc(12,Tt,2,0,"div",3),e.YNc(13,wt,14,5,"div",4),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"app.admin.subscriptionPlans.title")," "),e.xp6(6),e.hij(" ",e.lcZ(11,6,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.O5,d.lW,d.RK,f.Hw,k.NW,C.Ou,y.YE,y.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.ge,c.ev,c.XQ,c.Gk,h.Ye,S,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}"]}),n})();const Kt=["modulesPaginator"],Nt=["modulesSort"];function Ot(n,o){1&n&&(e.TgZ(0,"div",3),e._UZ(1,"mat-spinner",4),e.qZA())}function qt(n,o){1&n&&(e.TgZ(0,"th",18),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.modules.name")," "))}function Jt(n,o){if(1&n&&(e.TgZ(0,"td",19),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.name," ")}}function Yt(n,o){1&n&&(e.TgZ(0,"th",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"shared.buttons.actions")," "))}function Qt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"td",19)(1,"button",21),e.NdJ("click",function(){const r=e.CHM(t).$implicit,u=e.oxw(2);return e.KtG(u.openModuleDetail(r))}),e.TgZ(2,"mat-icon"),e._uU(3,"info"),e.qZA()()()}}function Lt(n,o){1&n&&e._UZ(0,"tr",22)}function Ft(n,o){1&n&&e._UZ(0,"tr",23)}const Rt=function(){return[5,10,20]};function Ht(n,o){if(1&n&&(e.TgZ(0,"div",5)(1,"div",6)(2,"table",7,8),e.ynx(4,9),e.YNc(5,qt,3,3,"th",10),e.YNc(6,Jt,2,1,"td",11),e.BQk(),e.ynx(7,12),e.YNc(8,Yt,3,3,"th",13),e.YNc(9,Qt,4,0,"td",11),e.BQk(),e.YNc(10,Lt,1,0,"tr",14),e.YNc(11,Ft,1,0,"tr",15),e.qZA(),e._UZ(12,"mat-paginator",16,17),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("dataSource",t.modulesDataSource),e.xp6(8),e.Q6J("matHeaderRowDef",t.modulesDisplayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.modulesDisplayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,Rt))}}let Gt=(()=>{class n{constructor(t,a,i){this.indacoModuleService=t,this.navigationService=a,this.snackBar=i,this.modules=[],this.modulesDataSource=new c.by(this.modules),this.modulesDisplayedColumns=["name","actions"],this.loading=!1}ngOnInit(){this.fetchModules()}openModuleDetail(t){this.navigationService.goToModuleDetail(t._id)}fetchModules(){this.loading=!0,this.indacoModuleService.getAllModules().subscribe(t=>{this.modules=t,this.modulesDataSource.data=this.modules,setTimeout(()=>{this.modulesDataSource.sort=this.modulesSort,this.modulesDataSource.paginator=this.modulesPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(K.M),e.Y36(Z),e.Y36(T.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-indaco-modules"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Kt,5),e.Gf(Nt,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.modulesPaginator=i.first),e.iGM(i=e.CRH())&&(a.modulesSort=i.first)}},decls:8,vars:5,consts:[[1,"mat-18"],["id","loading-container",4,"ngIf"],["class","container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[1,"container"],[1,"text-center"],["mat-table","","matSort","",1,"mat-elevation-z8","full-width",3,"dataSource"],["modulesSort","matSort"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["modulesPaginator",""],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin")(1,"mat-toolbar")(2,"mat-icon",0),e._uU(3,"notes"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.YNc(6,Ot,2,0,"div",1),e.YNc(7,Ht,14,5,"div",2),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,3,"app.admin.modules.title")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.O5,d.RK,f.Hw,k.NW,C.Ou,y.YE,y.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.ge,c.ev,c.XQ,c.Gk,h.Ye,S,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}"]}),n})();function $t(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function jt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"mat-form-field",12)(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){const u=e.CHM(t).$implicit;return e.KtG(u.code=i)}),e.qZA()(),e.TgZ(6,"mat-form-field",13)(7,"mat-label"),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"input",9),e.NdJ("ngModelChange",function(i){const u=e.CHM(t).$implicit;return e.KtG(u.name=i)}),e.qZA()()()}if(2&n){const t=o.$implicit;e.xp6(3),e.Oqu(e.lcZ(4,4,"app.admin.modules.code")),e.xp6(2),e.Q6J("ngModel",t.code),e.xp6(3),e.Oqu(e.lcZ(9,6,"app.admin.modules.name")),e.xp6(2),e.Q6J("ngModel",t.name)}}function Et(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.module.code=i)}),e.qZA()(),e.TgZ(6,"mat-form-field",8)(7,"mat-label"),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"input",9),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.module.name=i)}),e.qZA()(),e.TgZ(11,"mat-toolbar")(12,"span"),e._uU(13),e.ALo(14,"translate"),e.qZA()(),e.YNc(15,jt,11,8,"div",10),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,6,"app.admin.modules.code")),e.xp6(2),e.Q6J("ngModel",t.module.code),e.xp6(3),e.Oqu(e.lcZ(9,8,"app.admin.modules.name")),e.xp6(2),e.Q6J("ngModel",t.module.name),e.xp6(3),e.Oqu(e.lcZ(14,10,"app.admin.modules.features")),e.xp6(2),e.Q6J("ngForOf",t.module.moduleAccessibleFeatures)}}let X=(()=>{class n{constructor(t,a,i){this.indacoModuleService=t,this.navigationService=a,this.route=i,this.module={},this.loading=!1}ngOnInit(){this.getRouteParams()}back(){this.navigationService.goToModules()}refresh(){this.module?._id&&this.fetchModule(this.module._id)}getRouteParams(){const t=this.route.snapshot.paramMap.get("id");t&&this.fetchModule(t)}fetchModule(t,a=!0){a&&(this.loading=!0),this.indacoModuleService.getModule(t).subscribe(i=>{this.module=JSON.parse(JSON.stringify(i))}).add(()=>{a&&(this.loading=!1)})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(K.M),e.Y36(Z),e.Y36(x.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-indaco-module-detail"]],decls:17,vars:11,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","type","text","disabled","",3,"ngModel","ngModelChange"],["class","feature-container",4,"ngFor","ngForOf"],[1,"feature-container"],["appearance","fill",1,"feature-code"],["appearance","fill",1,"feature-name"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar")(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA()(),e.YNc(15,$t,2,0,"div",3),e.YNc(16,Et,16,12,"div",4)),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,5,"app.admin.modules.service")),e.xp6(6),e.hij(" ",e.lcZ(9,7,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,9,"shared.buttons.cancel")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.sg,m.O5,s.Fj,s.JJ,s.On,d.lW,g.KE,g.hX,f.Hw,M.Nt,C.Ou,h.Ye,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}.feature-container[_ngcontent-%COMP%]{margin-top:5px;margin-bottom:5px;width:100%;display:flex;flex-direction:row}.feature-code[_ngcontent-%COMP%]{margin-right:5px;flex:6;align-self:flex-start center}.feature-name[_ngcontent-%COMP%]{margin-left:5px;flex:6;align-self:flex-start center}.feature-button[_ngcontent-%COMP%]{margin-left:5px;flex:1;align-self:flex-end center}"]}),n})();var N=(()=>{return(n=N||(N={})).ModuleRegistration="MODULE_REGISTRATION",n.CheckServiceStatus="CHECK_SERVICE_STATUS",N;var n})();function Bt(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function zt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",14),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.apiKey.name="")}),e.TgZ(1,"mat-icon"),e._uU(2,"close"),e.qZA()()}}function Xt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",8)(1,"mat-label"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"input",15,16),e.TgZ(6,"button",14),e.NdJ("click",function(){e.CHM(t);const i=e.MAs(5),r=e.oxw(2);return e.KtG(r.copyKeyToClipboard(i))}),e.TgZ(7,"mat-icon"),e._uU(8,"file_copy"),e.qZA()(),e.TgZ(9,"span",17),e._uU(10),e.ALo(11,"translate"),e.qZA()()}if(2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(e.lcZ(3,3,"app.admin.apiKeys.key")),e.xp6(2),e.Q6J("ngModel",t.apiKeyString),e.xp6(6),e.Oqu(e.lcZ(11,5,"app.admin.apiKeys.notice"))}}function Wt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"mat-checkbox",18),e.NdJ("change",function(i){const u=e.CHM(t).$implicit,v=e.oxw(2);return e.KtG(v.scopeActiveChanged(i,u.value))}),e._uU(2),e.qZA()()}if(2&n){const t=o.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("checked",a.isScopeActive(t.value)),e.xp6(1),e.hij(" ",t.key," ")}}function Vt(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",7)(1,"mat-form-field",8)(2,"mat-label"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.apiKey.name=i)}),e.qZA(),e.YNc(6,zt,3,0,"button",10),e.qZA(),e.YNc(7,Xt,12,7,"mat-form-field",11),e.TgZ(8,"div")(9,"mat-checkbox",12),e.NdJ("ngModelChange",function(i){e.CHM(t);const r=e.oxw();return e.KtG(r.apiKey.enabled=i)}),e._uU(10),e.ALo(11,"translate"),e.qZA()(),e.TgZ(12,"h3"),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.YNc(15,Wt,3,2,"div",13),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,8,"app.admin.apiKeys.name")),e.xp6(2),e.Q6J("ngModel",t.apiKey.name),e.xp6(1),e.Q6J("ngIf",t.apiKey.name),e.xp6(1),e.Q6J("ngIf",t.isNewApiKey),e.xp6(2),e.Q6J("ngModel",t.apiKey.enabled),e.xp6(1),e.hij(" ",e.lcZ(11,10,"app.admin.apiKeys.enabled")," "),e.xp6(3),e.Oqu(e.lcZ(14,12,"app.admin.apiKeys.scopes")),e.xp6(2),e.Q6J("ngForOf",t.scopes)}}let W=(()=>{class n{constructor(t,a,i,r,u,v){this.apiKeyService=t,this.navigationService=a,this.snackBar=i,this.translateService=r,this.route=u,this.keyValuePipe=v,this.loading=!1}get apiKey(){return this._apiKey||this.emptyApiKey(),this._apiKey??this.createEmptyApiKey()}get isNewApiKey(){return!this.apiKey._id}get apiKeyString(){return this.isNewApiKey?`${this.apiKey.keyPrefix}.${this.apiKey.key}`:""}get scopes(){return this.keyValuePipe.transform(N)}ngOnInit(){this.initPage()}back(){this.navigationService.goToApiKeys()}save(){this.validateInput()&&(this.loading=!0,this.apiKeyService.saveApiKey(this.apiKey).subscribe(t=>{this.snackBar.open(this.translateService.instant("app.admin.shared.dataSuccessfullySaved"),void 0,{duration:3e3}),this.fetchApiKey(t,!1)},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1))}refresh(){this.apiKey._id?this.fetchApiKey(this.apiKey._id):this.emptyApiKey()}copyKeyToClipboard(t){const a=document.createElement("textarea");a.style.position="fixed",a.style.top=0,a.style.left=0,a.style.width="2em",a.style.height="2em",a.style.padding=0,a.style.border="none",a.style.outline="none",a.style.boxShadow="none",a.style.background="transparent",a.value=this.apiKeyString,document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy"),this.snackBar.open(this.translateService.instant("app.admin.apiKeys.keyCopied"),void 0,{duration:3e3})}finally{document.body.removeChild(a)}}isScopeActive(t){return!!this.apiKey.scopes.find(a=>a===t)}scopeActiveChanged(t,a){t.checked?this.apiKey.scopes.push(a):this.apiKey.scopes=this.apiKey.scopes.filter(i=>i!==a)}initPage(){const t=this.route.snapshot.paramMap.get("id");t&&this.fetchApiKey(t)}fetchApiKey(t,a=!0){a&&(this.loading=!0),this.apiKeyService.getApiKey(t).subscribe(i=>{this._apiKey=JSON.parse(JSON.stringify(i))}).add(()=>{a&&(this.loading=!1)})}emptyApiKey(){this._apiKey=this.createEmptyApiKey()}createEmptyApiKey(){return{_id:"",keyPrefix:this.apiKeyService.generateNewApiKeyPrefix(),key:this.apiKeyService.generateNewApiKey(),name:"",scopes:[],enabled:!1}}validateInput(){return""!==this.apiKey.name}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(R),e.Y36(Z),e.Y36(T.ux),e.Y36(_.sK),e.Y36(x.gz),e.Y36(m.Nd))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-api-key-detail"]],decls:22,vars:14,consts:[[1,"fill-space"],["mat-raised-button","",1,"detail-button",3,"click"],["mat-raised-button","","color","primary",1,"detail-button",3,"click"],["id","loading-container",4,"ngIf"],["id","detail-container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],["id","detail-container"],["appearance","fill",1,"full-width"],["matInput","","required","","type","text",3,"ngModel","ngModelChange"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click",4,"ngIf"],["class","full-width","appearance","fill",4,"ngIf"],[3,"ngModel","ngModelChange"],[4,"ngFor","ngForOf"],["matSuffix","","mat-icon-button","","aria-label","Clear",3,"click"],["matInput","","type","text","disabled","",3,"ngModel"],["apiKeyFieldInput",""],[1,"api-key-notice"],[3,"checked","change"]],template:function(t,a){1&t&&(e.TgZ(0,"mat-toolbar")(1,"span"),e._uU(2),e.ALo(3,"translate"),e.qZA(),e._UZ(4,"span",0),e.TgZ(5,"button",1),e.NdJ("click",function(){return a.refresh()}),e.TgZ(6,"mat-icon"),e._uU(7,"refresh"),e.qZA(),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"button",2),e.NdJ("click",function(){return a.back()}),e.TgZ(11,"mat-icon"),e._uU(12,"cancel"),e.qZA(),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",2),e.NdJ("click",function(){return a.save()}),e.TgZ(16,"mat-icon"),e._uU(17,"save"),e.qZA(),e._uU(18),e.ALo(19,"translate"),e.qZA()(),e.YNc(20,Bt,2,0,"div",3),e.YNc(21,Vt,16,14,"div",4)),2&t&&(e.xp6(2),e.Oqu(e.lcZ(3,6,"app.admin.apiKeys.apiKey")),e.xp6(6),e.hij(" ",e.lcZ(9,8,"shared.buttons.reset")," "),e.xp6(5),e.hij(" ",e.lcZ(14,10,"shared.buttons.close")," "),e.xp6(5),e.hij(" ",e.lcZ(19,12,"shared.buttons.save")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.sg,m.O5,s.Fj,s.JJ,s.Q7,s.On,d.lW,d.RK,b.oG,g.KE,g.hX,g.R9,f.Hw,M.Nt,C.Ou,h.Ye,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}.api-key-notice[_ngcontent-%COMP%]{color:#00000061;font-size:small}"]}),n})();const en=["apiKeysPaginator"],tn=["apiKeysSort"];function nn(n,o){1&n&&(e.TgZ(0,"div",5),e._UZ(1,"mat-spinner",6),e.qZA())}function an(n,o){1&n&&(e.TgZ(0,"th",20),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"app.admin.apiKeys.name")," "))}function on(n,o){if(1&n&&(e.TgZ(0,"td",21),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.name," ")}}function rn(n,o){1&n&&(e.TgZ(0,"th",22),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"shared.buttons.actions")," "))}function sn(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"td",21)(1,"button",23),e.NdJ("click",function(){const r=e.CHM(t).$implicit,u=e.oxw(2);return e.KtG(u.openApiKeyDetail(r))}),e.TgZ(2,"mat-icon"),e._uU(3,"info"),e.qZA()()()}}function ln(n,o){1&n&&e._UZ(0,"tr",24)}function cn(n,o){1&n&&e._UZ(0,"tr",25)}const pn=function(){return[5,10,20]};function dn(n,o){if(1&n&&(e.TgZ(0,"div",7)(1,"div",8)(2,"table",9,10),e.ynx(4,11),e.YNc(5,an,3,3,"th",12),e.YNc(6,on,2,1,"td",13),e.BQk(),e.ynx(7,14),e.YNc(8,rn,3,3,"th",15),e.YNc(9,sn,4,0,"td",13),e.BQk(),e.YNc(10,ln,1,0,"tr",16),e.YNc(11,cn,1,0,"tr",17),e.qZA(),e._UZ(12,"mat-paginator",18,19),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("dataSource",t.apiKeysDataSource),e.xp6(8),e.Q6J("matHeaderRowDef",t.apiKeysDisplayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.apiKeysDisplayedColumns),e.xp6(1),e.Q6J("pageSizeOptions",e.DdM(4,pn))}}let un=(()=>{class n{constructor(t,a,i){this.apiKeyService=t,this.navigationService=a,this.snackBar=i,this.apiKeys=[],this.apiKeysDataSource=new c.by(this.apiKeys),this.apiKeysDisplayedColumns=["name","actions"],this.loading=!1}ngOnInit(){this.fetchApiKeys()}openApiKeyDetail(t){this.navigationService.goToApiKeyDetail(t._id)}createNewApiKey(){this.navigationService.goToApiKeyDetail()}fetchApiKeys(){this.loading=!0,this.apiKeyService.getAllApiKeys().subscribe(t=>{this.apiKeys=t,this.apiKeysDataSource.data=this.apiKeys,setTimeout(()=>{this.apiKeysDataSource.sort=this.apiKeysSort,this.apiKeysDataSource.paginator=this.apiKeysPaginator})},t=>{this.snackBar.open(t.message,"OK",{panelClass:["error-snackbar"]})}).add(()=>this.loading=!1)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(R),e.Y36(Z),e.Y36(T.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["app-api-keys"]],viewQuery:function(t,a){if(1&t&&(e.Gf(en,5),e.Gf(tn,5)),2&t){let i;e.iGM(i=e.CRH())&&(a.apiKeysPaginator=i.first),e.iGM(i=e.CRH())&&(a.apiKeysSort=i.first)}},decls:14,vars:8,consts:[[1,"mat-18"],[1,"fill-space"],["mat-raised-button","",3,"click"],["id","loading-container",4,"ngIf"],["class","container",4,"ngIf"],["id","loading-container"],["id","loading-spinner"],[1,"container"],[1,"text-center"],["mat-table","","matSort","",1,"mat-elevation-z8","full-width",3,"dataSource"],["apiKeysSort","matSort"],["matColumnDef","name"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["showFirstLastButtons","",3,"pageSizeOptions"],["apiKeysPaginator",""],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"app-admin")(1,"mat-toolbar")(2,"mat-icon",0),e._uU(3,"vpn_key"),e.qZA(),e._uU(4),e.ALo(5,"translate"),e._UZ(6,"span",1),e.TgZ(7,"button",2),e.NdJ("click",function(){return a.createNewApiKey()}),e.TgZ(8,"mat-icon"),e._uU(9,"add"),e.qZA(),e._uU(10),e.ALo(11,"translate"),e.qZA()(),e.YNc(12,nn,2,0,"div",3),e.YNc(13,dn,14,5,"div",4),e.qZA()),2&t&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"app.admin.apiKeys.title")," "),e.xp6(6),e.hij(" ",e.lcZ(11,6,"shared.buttons.add")," "),e.xp6(2),e.Q6J("ngIf",a.loading),e.xp6(1),e.Q6J("ngIf",!a.loading))},dependencies:[m.O5,d.lW,d.RK,f.Hw,k.NW,C.Ou,y.YE,y.nU,c.BZ,c.fO,c.as,c.w1,c.Dz,c.nj,c.ge,c.ev,c.XQ,c.Gk,h.Ye,S,_.X$],styles:[".full-width[_ngcontent-%COMP%], #loading-container[_ngcontent-%COMP%]{width:100%}#loading-container[_ngcontent-%COMP%]{padding:30px;margin:auto}#loading-spinner[_ngcontent-%COMP%]{margin:auto}#detail-container[_ngcontent-%COMP%]{padding:30px}.detail-button[_ngcontent-%COMP%]{margin-left:5px}  snack-bar-container.error-snackbar{background-color:red;color:#fff}  .mat-mdc-snack-bar-action{color:#fff}"]}),n})();var mn=l(4866),_n=l(2156),gn=l(2109),fn=l(874),hn=l(9468),vn=l(3267);const Cn=[{path:"createReference",component:mn.l},{path:"editReference",component:_n.T},{path:"listing",component:gn.Y},{path:"reference",component:fn.C},{path:"warehouse",component:hn.d},{path:"warehouse-details",component:vn.k},{path:p.partners,component:Ae},{path:`${p.partnerDetail}/:id`,component:E},{path:p.partnerDetail,component:E},{path:p.users,component:at},{path:`${p.userDetail}/:id/:partnerId`,component:Q},{path:`${p.userDetail}/:id`,component:Q},{path:p.userDetail,component:Q},{path:p.plans,component:Dt},{path:`${p.planDetail}/:id`,component:z},{path:p.planDetail,component:z},{path:p.indacoModules,component:Gt},{path:`${p.indacoModuleDetail}/:id`,component:X},{path:p.indacoModuleDetail,component:X},{path:p.apiKeys,component:un},{path:`${p.apiKeyDetail}/:id`,component:W},{path:p.apiKeyDetail,component:W},{path:p.channels,component:$.J},{path:"",redirectTo:p.partners,pathMatch:"full"}];let Zn=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({imports:[x.Bz.forChild(Cn),x.Bz]}),n})();var xn=l(4466),bn=l(3546);let An=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n}),n.\u0275inj=e.cJS({providers:[m.Nd],imports:[Zn,m.ez,s.u5,d.ot,bn.QW,b.p9,D.Is,g.lN,f.Ps,M.c,ee.ie,k.TU,C.Cq,O.LD,y.JX,c.p0,P.Nh,h.g0,_.aw,xn.m]}),n})()},3098:(V,w)=>{var m=function(){function s(d){if(!d)throw new TypeError("Invalid argument; `value` has no value.");this.value=s.EMPTY,d&&s.isGuid(d)&&(this.value=d)}return s.isGuid=function(d){var b=d.toString();return d&&(d instanceof s||s.validator.test(b))},s.create=function(){return new s([s.gen(2),s.gen(1),s.gen(1),s.gen(1),s.gen(3)].join("-"))},s.createEmpty=function(){return new s("emptyguid")},s.parse=function(d){return new s(d)},s.raw=function(){return[s.gen(2),s.gen(1),s.gen(1),s.gen(1),s.gen(3)].join("-")},s.gen=function(d){for(var b="",D=0;D<d;D++)b+=(65536*(1+Math.random())|0).toString(16).substring(1);return b},s.prototype.equals=function(d){return s.isGuid(d)&&this.value===d.toString()},s.prototype.isEmpty=function(){return this.value===s.EMPTY},s.prototype.toString=function(){return this.value},s.prototype.toJSON=function(){return{value:this.value}},s.validator=new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$","i"),s.EMPTY="00000000-0000-0000-0000-000000000000",s}();w.i=m}}]);