UNPKG

23.8 kBJavaScriptView Raw
1import { Injectable, ɵɵdefineInjectable, ɵɵinject, Component, Input, NgModule } from '@angular/core';
2import { get, each, union, find, includes } from 'lodash';
3import { of } from 'rxjs';
4import { mergeMap, map, delay } from 'rxjs/operators';
5import { __assign } from 'tslib';
6import { HttpHeaders, HttpClient, HttpClientModule } from '@angular/common/http';
7import * as momentJS from 'moment';
8import { CommonModule } from '@angular/common';
9import { StackModule, SearchModule, IconModule, FrameModule, TopbarModule, NavigationModule, ButtonModule, PageModule, BadgeModule, AvatarModule } from '@kushki/ng-suka';
10
11/**
12 * @fileoverview added by tsickle
13 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
14 */
15/** @enum {string} */
16var PermissionsEnum = {
17 VIEWUSERS: 'viewUsers',
18 VIEWTRANSACTIONS: 'viewTransactions',
19 VIEWSMARTLINKS: 'viewSmartLinks',
20 LISTSMARTLINKS: 'listSmartLinks',
21 VIEWBANK: 'viewBank',
22 CREATEALLUSERS: 'createAllUsers',
23 VOIDANDREFUND: 'voidAndRefund',
24 PROCESSORSCRUD: 'processorsCrud',
25 ACCESSUSERMASTER: 'accessUserMaster',
26 ACCESSUSERMAKER: 'accessUserMaker',
27 ACCESSUSERREADER: 'accessUserReader',
28 ACCESSADMIN: 'accessAdmin',
29 AGENTSNR: 'agentSnr',
30 COORDINATORSNR: 'coordinatorSnr',
31 REVIEWERMGUAYAQUIL: 'reviewerMguayaquil',
32 ADMINCONCILIATION: 'adminConciliation',
33};
34/** @type {?} */
35var HOME = {
36 title: 'Inicio',
37 icon: 'home',
38 link: '/dashboard',
39 home: true,
40};
41/** @type {?} */
42var MERCHANTS = {
43 title: 'Comercios',
44 icon: 'shopping-bag',
45 link: '/merchants',
46 home: true,
47};
48/** @type {?} */
49var TRANSACTIONS = {
50 title: 'Transacciones',
51 icon: 'dollar-sign',
52 link: '/transactions',
53 home: true,
54};
55/** @type {?} */
56var DISPERSION = {
57 title: 'Dispersión',
58 icon: 'maximize',
59 link: '/dispersion',
60 home: true,
61};
62/** @type {?} */
63var USERS = {
64 title: 'Usuarios',
65 icon: 'user',
66 link: '/users',
67 home: true,
68};
69/** @type {?} */
70var ALLIES = {
71 title: 'Aliados',
72 icon: 'users',
73 link: '/resellers',
74 home: true,
75};
76/** @type {?} */
77var SUBSCRIPTIONS = {
78 title: 'Suscripciones',
79 icon: 'repeat',
80 link: '/subscriptions',
81 home: true,
82};
83/** @type {?} */
84var SMARTLINKS = {
85 title: 'Smartlinks',
86 icon: 'columns',
87 link: '/smartlinks',
88 home: true,
89};
90/** @type {?} */
91var BILLING_DASHBOARD = {
92 title: 'Facturación',
93 icon: 'book-open',
94 link: '/billing-dashboard',
95 home: true,
96};
97/** @type {?} */
98var SNR = {
99 title: 'SNR',
100 icon: 'file-minus',
101 link: '/snr',
102 home: true,
103};
104/** @type {?} */
105var MGUAYAQUIL = {
106 title: 'Municipio de Guayaquil',
107 icon: 'file-minus',
108 link: '/municipio-guayaquil',
109 home: true,
110};
111/** @type {?} */
112var CONCILIATION_DASHBOARD = {
113 title: 'Informes',
114 icon: 'file-text',
115 link: '/reports',
116 home: true,
117};
118/** @type {?} */
119var MENU_BACKOFFICE_ADMIN = [
120 HOME,
121 MERCHANTS,
122 TRANSACTIONS,
123 BILLING_DASHBOARD,
124 DISPERSION,
125 USERS,
126 ALLIES,
127 CONCILIATION_DASHBOARD
128];
129/** @type {?} */
130var MENU_BACKOFFICE_USER_MASTER = [
131 HOME,
132 MERCHANTS,
133 TRANSACTIONS,
134 USERS,
135 SUBSCRIPTIONS,
136 CONCILIATION_DASHBOARD
137];
138/** @type {?} */
139var MENU_BACKOFFICE_USER_MAKER = [
140 HOME,
141 USERS,
142 SUBSCRIPTIONS
143];
144/** @type {?} */
145var MENU_BACKOFFICE_USER_READER = [
146 HOME,
147 TRANSACTIONS
148];
149/** @type {?} */
150var MENU_WEBCHECKOUT_BASIC = [
151 SMARTLINKS
152];
153/** @type {?} */
154var MENU_WEBCHECKOUT_MASTER = [
155 SMARTLINKS
156];
157/** @type {?} */
158var MENU_BACKOFFICE_BANK = [
159 HOME
160];
161/** @type {?} */
162var MENU_SNR = [
163 SNR
164];
165/** @type {?} */
166var MENU_MGUAYAQUIL = [
167 MGUAYAQUIL
168];
169/** @type {?} */
170var MENU_BACKOFFICE_RESELLER = [];
171/** @type {?} */
172var PERMISSIONS_BACKOFFICE_ADMIN = [
173 PermissionsEnum.VIEWUSERS,
174 PermissionsEnum.CREATEALLUSERS,
175 PermissionsEnum.PROCESSORSCRUD,
176 PermissionsEnum.ACCESSADMIN,
177 PermissionsEnum.ADMINCONCILIATION
178];
179/** @type {?} */
180var PERMISSIONS_BACKOFFICE_BANK = [
181 PermissionsEnum.VIEWBANK
182];
183/** @type {?} */
184var PERMISSIONS_BACKOFFICE_USER_MASTER = [
185 PermissionsEnum.VIEWUSERS,
186 PermissionsEnum.VIEWTRANSACTIONS,
187 PermissionsEnum.VOIDANDREFUND,
188 PermissionsEnum.ACCESSUSERMASTER,
189 PermissionsEnum.ADMINCONCILIATION
190];
191/** @type {?} */
192var PERMISSIONS_BACKOFFICE_USERMAKER = [
193 PermissionsEnum.VIEWTRANSACTIONS,
194 PermissionsEnum.VOIDANDREFUND,
195];
196/** @type {?} */
197var PERMISSIONS_BACKOFFICE_USER_READER = [
198 PermissionsEnum.VIEWTRANSACTIONS
199];
200/** @type {?} */
201var PERMISSIONS_WEBCHECKOUT_BASIC = [
202 PermissionsEnum.VIEWSMARTLINKS
203];
204/** @type {?} */
205var PERMISSIONS_WEBCHECKOUT_MASTER = [
206 PermissionsEnum.VIEWSMARTLINKS,
207 PermissionsEnum.LISTSMARTLINKS
208];
209/** @type {?} */
210var PERMISSIONS_SNR_AGENT = [
211 PermissionsEnum.AGENTSNR
212];
213/** @type {?} */
214var PERMISSIONS_SNR_COORDINATOR = [
215 PermissionsEnum.COORDINATORSNR,
216 PermissionsEnum.AGENTSNR
217];
218/** @type {?} */
219var PERMISSIONS_MGUAYAQUIL_REVIEWER = [
220 PermissionsEnum.REVIEWERMGUAYAQUIL
221];
222/** @type {?} */
223var PERMISSIONS_RESELLER = [];
224/** @type {?} */
225var ROL_BACKOFFICE_ADMIN = {
226 name: 'KSH_ADMIN',
227 cognito_group: 'BackofficeAdmin',
228 permissions: PERMISSIONS_BACKOFFICE_ADMIN,
229 menu: MENU_BACKOFFICE_ADMIN,
230};
231/** @type {?} */
232var ROLL_BACKOFICCE_USER_MASTER = {
233 name: 'KSH_USER_MASTER',
234 cognito_group: 'BackofficeUserMaster',
235 permissions: PERMISSIONS_BACKOFFICE_USER_MASTER,
236 menu: MENU_BACKOFFICE_USER_MASTER,
237};
238/** @type {?} */
239var ROL_BACKOFFICE_USER_MAKER = {
240 name: 'KSH_USER_MAKER',
241 cognito_group: 'BackofficeUserMaker',
242 permissions: PERMISSIONS_BACKOFFICE_USERMAKER,
243 menu: MENU_BACKOFFICE_USER_MAKER,
244};
245/** @type {?} */
246var ROL_BACKOFFICE_USER_READER = {
247 name: 'KSH_USER_READER',
248 cognito_group: 'BackofficeUserReader',
249 permissions: PERMISSIONS_BACKOFFICE_USER_READER,
250 menu: MENU_BACKOFFICE_USER_READER,
251};
252/** @type {?} */
253var ROL_WEBCHECKOUT_BASIC = {
254 name: 'KSH_WEBCHECKOUT',
255 cognito_group: 'WebcheckoutBasic',
256 permissions: PERMISSIONS_WEBCHECKOUT_BASIC,
257 menu: MENU_WEBCHECKOUT_BASIC,
258};
259/** @type {?} */
260var ROL_WEBCHECKOUT_MASTER = {
261 name: 'KSH_WEBCHECKOUT_MASTER',
262 cognito_group: 'WebcheckoutMaster',
263 permissions: PERMISSIONS_WEBCHECKOUT_MASTER,
264 menu: MENU_WEBCHECKOUT_MASTER,
265};
266/** @type {?} */
267var ROL_SNR_AGENT = {
268 name: 'KSH_SNR_AGENT',
269 cognito_group: 'SnrAgent',
270 permissions: PERMISSIONS_SNR_AGENT,
271 menu: MENU_SNR,
272};
273/** @type {?} */
274var ROL_SNR_COORDINATOR = {
275 name: 'KSH_SNR_COORDINATOR',
276 cognito_group: 'SnrCoordinator',
277 permissions: PERMISSIONS_SNR_COORDINATOR,
278 menu: MENU_SNR,
279};
280/** @type {?} */
281var ROL_MGUAYAQUIL_REVIEWER = {
282 name: 'KSH_MGUAYAQUIL_REVIEWER',
283 cognito_group: 'MguayaquilReviewer',
284 permissions: PERMISSIONS_MGUAYAQUIL_REVIEWER,
285 menu: MENU_MGUAYAQUIL,
286};
287/** @type {?} */
288var ROL_BACKOFFICE_BANK = {
289 name: 'KSH_BANK',
290 cognito_group: 'BackofficeBank',
291 permissions: PERMISSIONS_BACKOFFICE_BANK,
292 menu: MENU_BACKOFFICE_BANK,
293};
294/** @type {?} */
295var SYSTEM_ROLES = [
296 ROL_BACKOFFICE_ADMIN,
297 ROLL_BACKOFICCE_USER_MASTER,
298 ROL_WEBCHECKOUT_BASIC,
299 ROL_WEBCHECKOUT_MASTER,
300 ROL_BACKOFFICE_USER_READER,
301 ROL_BACKOFFICE_USER_MAKER,
302 ROL_BACKOFFICE_BANK,
303 ROL_SNR_AGENT,
304 ROL_SNR_COORDINATOR,
305 ROL_MGUAYAQUIL_REVIEWER
306];
307/**
308 * Implementation
309 */
310var RoleService = /** @class */ (function () {
311 function RoleService(_http) {
312 this._http = _http;
313 this.kushkiRoles = SYSTEM_ROLES;
314 this._cognitoGroups = '[cognito:groups]';
315 if (this.hasPayload())
316 this.payload = JSON.parse(localStorage.getItem("payload"));
317 }
318 /**
319 * @return {?}
320 */
321 RoleService.prototype.hasPayload = /**
322 * @return {?}
323 */
324 function () {
325 return localStorage.getItem("payload") !== null;
326 };
327 /**
328 * @return {?}
329 */
330 RoleService.prototype.getEmail = /**
331 * @return {?}
332 */
333 function () {
334 return get(this.payload, 'email', '');
335 };
336 /**
337 * @return {?}
338 */
339 RoleService.prototype.getTimeZone = /**
340 * @return {?}
341 */
342 function () {
343 if (this.hasTimeZone())
344 return localStorage.getItem("time-zone");
345 return "UTC-05 (Bogota, Quito, Lima)";
346 };
347 /**
348 * @return {?}
349 */
350 RoleService.prototype.hasTimeZone = /**
351 * @return {?}
352 */
353 function () {
354 return localStorage.getItem("time-zone") !== null;
355 };
356 /**
357 * @return {?}
358 */
359 RoleService.prototype.hasSystemTimeZone = /**
360 * @return {?}
361 */
362 function () {
363 return this.payload.zoneinfo !== undefined;
364 };
365 /**
366 * @return {?}
367 */
368 RoleService.prototype.isJWTExpired = /**
369 * @return {?}
370 */
371 function () {
372 // tslint:disable:typedef
373 /** @type {?} */
374 var moment = momentJS;
375 /** @type {?} */
376 var now_date = moment();
377 /** @type {?} */
378 var expire = this._getExpiration();
379 return now_date.isAfter(expire);
380 };
381 /**
382 * @return {?}
383 */
384 RoleService.prototype.getUsername = /**
385 * @return {?}
386 */
387 function () {
388 return get(this.payload, '[cognito:username]', '');
389 };
390 /**
391 * @return {?}
392 */
393 RoleService.prototype.getCompleteUserName = /**
394 * @return {?}
395 */
396 function () {
397 return get(this.payload, '[name]', '').concat(" ").concat(get(this.payload, '[family_name]', ''));
398 };
399 /**
400 * @return {?}
401 */
402 RoleService.prototype.getJWTLeftTime = /**
403 * @return {?}
404 */
405 function () {
406 // tslint:disable:typedef
407 /** @type {?} */
408 var moment = momentJS;
409 /** @type {?} */
410 var now_date = moment();
411 /** @type {?} */
412 var expire = this._getExpiration();
413 return moment.duration(expire.diff(now_date)).asMilliseconds();
414 };
415 /**
416 * @param {?} envName
417 * @return {?}
418 */
419 RoleService.prototype.getMerchant = /**
420 * @param {?} envName
421 * @return {?}
422 */
423 function (envName) {
424 var _this = this;
425 return of(1).pipe(mergeMap((/**
426 * @return {?}
427 */
428 function () {
429 /** @type {?} */
430 var url = envName === 'primary' ? 'https://api.kushkipagos.com' : "https://api-" + envName + ".kushkipagos.com";
431 /** @type {?} */
432 var headers = new HttpHeaders({
433 Authorization: localStorage.getItem('jwt')
434 });
435 return _this._http
436 .get(url + "/merchant/v1/merchant", { headers: headers }).pipe(map((/**
437 * @param {?} rs
438 * @return {?}
439 */
440 function (rs) { return rs; })));
441 })));
442 };
443 /**
444 * @return {?}
445 */
446 RoleService.prototype.isAdmin = /**
447 * @return {?}
448 */
449 function () {
450 return get(this.payload, this._cognitoGroups, []).includes("BackofficeAdmin");
451 };
452 /**
453 * @param {?} rol
454 * @return {?}
455 */
456 RoleService.prototype.checkRol = /**
457 * @param {?} rol
458 * @return {?}
459 */
460 function (rol) {
461 return get(this.payload, this._cognitoGroups, []).includes(rol);
462 };
463 /**
464 * @return {?}
465 */
466 RoleService.prototype.getRoles = /**
467 * @return {?}
468 */
469 function () {
470 return get(this.payload, this._cognitoGroups, []);
471 };
472 /**
473 * @return {?}
474 */
475 RoleService.prototype.getMerchantId = /**
476 * @return {?}
477 */
478 function () {
479 return get(this.payload, 'preferred_username', '');
480 };
481 /**
482 * @return {?}
483 */
484 RoleService.prototype.getMenus = /**
485 * @return {?}
486 */
487 function () {
488 /** @type {?} */
489 var roles = this._getRolByArrayofNames(get(this.payload, this._cognitoGroups, []));
490 return get(roles, 'menu', []);
491 };
492 /**
493 * @param {?} country
494 * @return {?}
495 */
496 RoleService.prototype.setTimeZone = /**
497 * @param {?} country
498 * @return {?}
499 */
500 function (country) {
501 if (!this.hasTimeZone())
502 this.setSystemTimeZone(country);
503 };
504 /**
505 * @param {?} country
506 * @return {?}
507 */
508 RoleService.prototype.setSystemTimeZone = /**
509 * @param {?} country
510 * @return {?}
511 */
512 function (country) {
513 if (!this.hasSystemTimeZone())
514 localStorage.setItem("time-zone", RoleService._getZoneCountry(country));
515 else
516 localStorage.setItem("time-zone", get(this.payload, "zoneinfo", RoleService._getZoneCountry(country)));
517 };
518 /**
519 * @private
520 * @param {?} rolName
521 * @return {?}
522 */
523 RoleService.prototype._getRolByArrayofNames = /**
524 * @private
525 * @param {?} rolName
526 * @return {?}
527 */
528 function (rolName) {
529 var _this = this;
530 /** @type {?} */
531 var rols = {
532 name: null,
533 menu: [],
534 permissions: [],
535 rols: null,
536 };
537 each(rolName, (/**
538 * @param {?} rol
539 * @return {?}
540 */
541 function (rol) {
542 var _a;
543 /** @type {?} */
544 var rol_selected = _this._getRolByName(rol);
545 if (rol_selected === undefined)
546 return;
547 rols.permissions = union(rol_selected.permissions, rols.permissions);
548 rols.menu = _this._mergeMenuItems(rol_selected.menu, rols.menu);
549 rols.rols = __assign({}, rols.rols, (_a = {}, _a[rol_selected.name] = rol_selected.permissions, _a));
550 }));
551 return rols;
552 };
553 /**
554 * @private
555 * @return {?}
556 */
557 RoleService.prototype._getExpiration = /**
558 * @private
559 * @return {?}
560 */
561 function () {
562 /** @type {?} */
563 var moment = momentJS;
564 /** @type {?} */
565 var expiration_field = "exp";
566 return moment(Number(JSON.parse(localStorage.getItem("payload"))[expiration_field]) * 1000);
567 };
568 /**
569 * @private
570 * @param {?} query
571 * @return {?}
572 */
573 RoleService.prototype._getRolByName = /**
574 * @private
575 * @param {?} query
576 * @return {?}
577 */
578 function (query) {
579 return find(this.kushkiRoles, (/**
580 * @param {?} rol
581 * @return {?}
582 */
583 function (rol) {
584 return rol.cognito_group === query;
585 }));
586 };
587 /**
588 * @private
589 * @param {?} first
590 * @param {?} second
591 * @return {?}
592 */
593 RoleService.prototype._mergeMenuItems = /**
594 * @private
595 * @param {?} first
596 * @param {?} second
597 * @return {?}
598 */
599 function (first, second) {
600 /** @type {?} */
601 var menus = first;
602 /** @type {?} */
603 var selected_menu = null;
604 each(second, (/**
605 * @param {?} menu
606 * @return {?}
607 */
608 function (menu) {
609 selected_menu = find(menus, { title: menu.title });
610 if (selected_menu === undefined)
611 menus.push(menu);
612 }));
613 return menus;
614 };
615 /**
616 * @private
617 * @param {?} country
618 * @return {?}
619 */
620 RoleService._getZoneCountry = /**
621 * @private
622 * @param {?} country
623 * @return {?}
624 */
625 function (country) {
626 switch (country) {
627 case "Brazil":
628 return "UTC-03 (SaoPaulo)";
629 case "Chile":
630 return "UTC-04 (Santiago)";
631 case "Mexico":
632 return "UTC-06 (Ciudad de México)";
633 default:
634 return "UTC-05 (Bogota, Quito, Lima)";
635 }
636 };
637 RoleService.decorators = [
638 { type: Injectable, args: [{ providedIn: 'root' },] }
639 ];
640 /** @nocollapse */
641 RoleService.ctorParameters = function () { return [
642 { type: HttpClient }
643 ]; };
644 /** @nocollapse */ RoleService.ngInjectableDef = ɵɵdefineInjectable({ factory: function RoleService_Factory() { return new RoleService(ɵɵinject(HttpClient)); }, token: RoleService, providedIn: "root" });
645 return RoleService;
646}());
647
648/**
649 * @fileoverview added by tsickle
650 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
651 */
652/**
653 * Implementation
654 */
655var NavComponent = /** @class */ (function () {
656 function NavComponent(_roleService) {
657 this._roleService = _roleService;
658 this.testEnvironments = ['ci', 'qa', 'uat'];
659 this.menus = [];
660 this.merchantName = '';
661 this.isAdmin = false;
662 this.merchantId = '';
663 }
664 /**
665 * @return {?}
666 */
667 NavComponent.prototype.ngOnInit = /**
668 * @return {?}
669 */
670 function () {
671 var _this = this;
672 this.initializeValues();
673 if (!this._roleService.hasPayload() || this._roleService.isJWTExpired())
674 this.logout();
675 /** @type {?} */
676 var time_left = this._roleService.getJWTLeftTime();
677 this.subscription = of(1).pipe(delay(time_left)).subscribe((/**
678 * @return {?}
679 */
680 function () { return _this.logout(); }));
681 };
682 /**
683 * @return {?}
684 */
685 NavComponent.prototype.initializeValues = /**
686 * @return {?}
687 */
688 function () {
689 var _this = this;
690 this.name = this._roleService.getCompleteUserName();
691 this.testMode = includes(this.testEnvironments, this.environment);
692 this.menus = this._roleService.getMenus();
693 this.isAdmin = this._roleService.isAdmin();
694 this.merchantName = this.isAdmin ? "Admin" : "";
695 if (!this.isAdmin) {
696 this.merchantId = this._roleService.getMerchantId();
697 this._roleService.getMerchant(this.environment).subscribe((/**
698 * @param {?} merchant
699 * @return {?}
700 */
701 function (merchant) {
702 _this.merchantName = merchant.name;
703 _this._roleService.setTimeZone(merchant.country);
704 }));
705 }
706 else
707 this._roleService.setTimeZone("Ecuador");
708 this.loadZendeskWidget();
709 };
710 /**
711 * @return {?}
712 */
713 NavComponent.prototype.ngOnDestroy = /**
714 * @return {?}
715 */
716 function () {
717 this.removeWidget();
718 if (this.subscription !== undefined)
719 this.subscription.unsubscribe();
720 };
721 /**
722 * @return {?}
723 */
724 NavComponent.prototype.logout = /**
725 * @return {?}
726 */
727 function () {
728 localStorage.clear();
729 window.location.href = "/auth";
730 };
731 /**
732 * @return {?}
733 */
734 NavComponent.prototype.profile = /**
735 * @return {?}
736 */
737 function () {
738 window.location.href = "/users/profile";
739 };
740 /**
741 * @return {?}
742 */
743 NavComponent.prototype.removeWidget = /**
744 * @return {?}
745 */
746 function () {
747 /** @type {?} */
748 var body = (/** @type {?} */ (document.body));
749 /** @type {?} */
750 var widget = document.getElementById('ze-snippet');
751 if (widget !== null)
752 body.removeChild(widget);
753 };
754 /**
755 * @return {?}
756 */
757 NavComponent.prototype.loadZendeskWidget = /**
758 * @return {?}
759 */
760 function () {
761 /** @type {?} */
762 var body = (/** @type {?} */ (document.body));
763 /** @type {?} */
764 var script = document.createElement('script');
765 script.id = 'ze-snippet';
766 script.src = 'https://static.zdassets.com/ekr/snippet.js?key=e56c3e14-8e11-434f-a50e-f2a91186d6c7';
767 script.async = false;
768 script.defer = true;
769 body.appendChild(script);
770 };
771 NavComponent.decorators = [
772 { type: Component, args: [{
773 selector: 'backoffice-nav',
774 template: "<suka-frame>\n <suka-topbar\n [logoSrc]=\"'https://kushki-static.s3.amazonaws.com/spa-backoffice/logo_ksh.png'\"\n >\n <suka-topbar-navigation>\n <suka-topbar-item> {{ merchantName }} </suka-topbar-item>\n <suka-topbar-item *ngIf=\"testMode\"> <suka-badge type=\"attention\"> Modo Prueba </suka-badge> </suka-topbar-item>\n </suka-topbar-navigation>\n <suka-topbar-global>\n <suka-topbar-menu>\n <suka-avatar\n [name]=\"name\"\n size=\"md\"\n color=\"cyan\"\n ></suka-avatar>&nbsp; {{ name }}\n <suka-topbar-item (click)=\"profile()\" icon=\"user\">Mi Perfil</suka-topbar-item>\n <suka-topbar-item (click)=\"logout()\" icon=\"log-out\">Log Out</suka-topbar-item>\n </suka-topbar-menu>\n </suka-topbar-global>\n </suka-topbar>\n\n <suka-navigation>\n <suka-navigation-item\n *ngFor=\"let menu of menus\"\n [href]=\"(menu.link === '/merchants' && !isAdmin) ? (menu.link + '/profile/' + merchantId) : menu.link\"\n [active]=\"menu.link === activeRoute\"\n >\n <suka-icon [icon]=\"menu.icon\"></suka-icon>\n {{ (menu.title === 'Comercios' && !isAdmin) ? \"Perfil\" : menu.title }}\n </suka-navigation-item>\n </suka-navigation>\n\n <suka-page\n [breadcrumb]=\"false\"\n >\n <ng-content></ng-content>\n </suka-page>\n</suka-frame>\n<script id=\"ze-snippet\" src=\"https://static.zdassets.com/ekr/snippet.js?key=e56c3e14-8e11-434f-a50e-f2a91186d6c7\"> </script>\n",
775 styles: [""]
776 }] }
777 ];
778 /** @nocollapse */
779 NavComponent.ctorParameters = function () { return [
780 { type: RoleService }
781 ]; };
782 NavComponent.propDecorators = {
783 environment: [{ type: Input }],
784 activeRoute: [{ type: Input }]
785 };
786 return NavComponent;
787}());
788
789/**
790 * @fileoverview added by tsickle
791 * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
792 */
793var BackofficeNavigationModule = /** @class */ (function () {
794 function BackofficeNavigationModule() {
795 }
796 BackofficeNavigationModule.decorators = [
797 { type: NgModule, args: [{
798 declarations: [NavComponent],
799 imports: [
800 StackModule,
801 SearchModule,
802 IconModule,
803 FrameModule,
804 TopbarModule,
805 NavigationModule,
806 ButtonModule,
807 PageModule,
808 BadgeModule,
809 AvatarModule,
810 CommonModule,
811 HttpClientModule
812 ],
813 exports: [NavComponent]
814 },] }
815 ];
816 return BackofficeNavigationModule;
817}());
818
819export { BackofficeNavigationModule, MENU_BACKOFFICE_ADMIN, MENU_BACKOFFICE_BANK, MENU_BACKOFFICE_RESELLER, MENU_BACKOFFICE_USER_MAKER, MENU_BACKOFFICE_USER_MASTER, MENU_BACKOFFICE_USER_READER, MENU_MGUAYAQUIL, MENU_SNR, MENU_WEBCHECKOUT_BASIC, MENU_WEBCHECKOUT_MASTER, NavComponent, PERMISSIONS_BACKOFFICE_ADMIN, PERMISSIONS_BACKOFFICE_BANK, PERMISSIONS_BACKOFFICE_USERMAKER, PERMISSIONS_BACKOFFICE_USER_MASTER, PERMISSIONS_BACKOFFICE_USER_READER, PERMISSIONS_MGUAYAQUIL_REVIEWER, PERMISSIONS_RESELLER, PERMISSIONS_SNR_AGENT, PERMISSIONS_SNR_COORDINATOR, PERMISSIONS_WEBCHECKOUT_BASIC, PERMISSIONS_WEBCHECKOUT_MASTER, PermissionsEnum, ROLL_BACKOFICCE_USER_MASTER, ROL_BACKOFFICE_ADMIN, ROL_BACKOFFICE_BANK, ROL_BACKOFFICE_USER_MAKER, ROL_BACKOFFICE_USER_READER, ROL_MGUAYAQUIL_REVIEWER, ROL_SNR_AGENT, ROL_SNR_COORDINATOR, ROL_WEBCHECKOUT_BASIC, ROL_WEBCHECKOUT_MASTER, RoleService, SYSTEM_ROLES };
820//# sourceMappingURL=kushki-spa-backoffice-navigation.js.map