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,WAAWC,MAAM,QAG/BN,GAFAA,EAAQE,KAAKH,KAAQC,EAAM,GAAK,KAAOA,EAAM,IAAOA,EAAM,GAAKC,GAAQA,MAEzDI,WAAWC,MAAM,MAChB,GAAK,KAAON,EAAM,IAAOA,EAAM,GAAKC,EAAOA,MAG5DM,mBAAmBC,GACjB,YAAqB,IAAVA,GAAkC,MAATA,GAC7BA,EAAMC,QAAQ,MAAO,IAAIC,OAAS,gDA7IhChD,GAAkBH,4BAgDnBC,iCAhDCE,EAAkBiD,+mDDd/BpD,uBAkBAA,uBAcAA,uBAcAA,uBAYAA,uBAaAA,uBAaAA,8BApFMA,oCAkBAA,0CAcAA,wCAcAA,0CAYAA,2CAaAA,+CAaAA,i7ECtEOG,GAAb","names":["AuthGuard","constructor","router","storageService","platformId","this","canActivate","route","state","isPlatformBrowser","isAuthenticated","authorizeSubject","next","authorize","url","data","navigateByUrl","i0","PLATFORM_ID","factory","StuSelectComponent","dataService","stuSelectService","EventEmitter","prices","sendNowControl","FormControl","selectControl","ngAfterViewInit","ngOnInit","loadBootsrtapNative","selectedPriceSubject","subscribe","price","priceSelected","itemsSubject","item","id","stuSelectValues","items","t","stuSelectMonths","stuSelectYears","stuSelectOfferts","selectedItem","selectedMonth","selectedYear","selectedOffert","changePrice","change","emit","changeSelectedItem","changeItem","getPriceBySms","decimalAdjust","rechargePrice","rechargeAmount","type","value","exp","Math","isNaN","NaN","toString","split","isNullOrWhiteSpace","input","replace","length","selectors"],"sources":["webpack:///src/app/guards/auth.guard.ts","webpack:///src/app/shared/components/stu-select/stu-select.component.html","webpack:///src/app/shared/components/stu-select/stu-select.component.ts"],"sourcesContent":["/**\r\n * Created by Elaine Lopez on 4/19/2019.\r\n */\r\n\r\nimport { Injectable, Inject, PLATFORM_ID } from '@angular/core';\r\nimport { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\r\nimport { StorageService } from '@app/services/storage.service';\r\nimport { isPlatformBrowser } from '@angular/common';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthGuard implements CanActivate {\r\n constructor(private router: Router,\r\n private storageService: StorageService,\r\n @Inject(PLATFORM_ID) private platformId) { }\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {\r\n if (isPlatformBrowser(this.platformId)) {\r\n if (this.storageService.isAuthenticated()) {\r\n // logged in so return true\r\n return true;\r\n }\r\n // not logged in so redirect to home page\r\n this.storageService.authorizeSubject.next({ 'authorize': false, 'url': route.data.route });\r\n this.router.navigateByUrl(this.router.url);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n}\r\n","
\r\n \r\n
\r\n 0 ? '
<span class="show-discount-1"><span class="bold">' + price?.titleText + '</span>
' + (price?.subtitleToShow || price?.subtitleText) + (price?.deliveryTextToShow || price?.deliveryText) + ' </span>' +\r\n '' + price?.rechargePriceText + ' </span>
' + ' <span\r\n class="discount">(' + price?.rechargePriceOldText + ')</span>
' :\r\n '<span><span class="bold">' + price?.titleText + '</span> ' + price?.rechargePriceText + ' </span>
' + (price?.subtitleToShow || price?.subtitleText) + (price?.deliveryTextToShow || price?.deliveryText) + '
</span>'\">
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n <span class="bold">' + price?.titleText + '</span> / ' + price?.rechargePriceText + ' </span>
' + (price?.subtitleToShow || price?.subtitleText) + (price?.deliveryTextToShow || price?.deliveryText) + '
</span>'\">
\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n ' + price.rechargePriceText + ' / ' + price.subtitleText + '
PRECIO x SMS: ' + getPriceBySms(price) + ''\">
\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n","import { Component, OnInit, Input, Output, EventEmitter, AfterViewInit, Inject, PLATFORM_ID } from '@angular/core';\r\nimport { PriceModel, PriceModelDetails } from '@app/models/price.model';\r\nimport { FormControl } from '@angular/forms';\r\nimport { DataService } from '@app/services/data.service';\r\nimport { StuSelectServiceService } from './stu-select.service';\r\nimport { StuSelectModel, StuSelectItemModel } from './stu-select.model';\r\nimport { isPlatformBrowser } from '@angular/common';\r\ndeclare let loadBootsrtapNative: Function;\r\n\r\n@Component({\r\n selector: 'app-stu-select',\r\n templateUrl: './stu-select.component.html',\r\n styleUrls: ['./stu-select.component.css']\r\n})\r\nexport class StuSelectComponent implements OnInit, AfterViewInit {\r\n\r\n\r\n /*RECHARGE and NAUTA*/\r\n @Input()\r\n prices: PriceModelDetails[];\r\n @Input()\r\n sendNowControl: FormControl;\r\n @Input()\r\n selectControl: FormControl;\r\n //@Input()\r\n //isPromotionMode: boolean;\r\n @Input()\r\n isExclusive: boolean;\r\n @Input()\r\n service: string;\r\n\r\n /* CARDS */\r\n @Input()\r\n stuSelectValues: StuSelectItemModel[];\r\n @Input()\r\n selectedItem: StuSelectItemModel;\r\n\r\n /* OFFERTS */\r\n @Input()\r\n stuSelectOfferts: StuSelectItemModel[];\r\n @Input()\r\n selectedOffert: StuSelectItemModel;\r\n\r\n /* EXPIRE DATE */\r\n @Input()\r\n stuSelectMonths: StuSelectItemModel[];\r\n @Input()\r\n selectedMonth: StuSelectItemModel;\r\n @Input()\r\n stuSelectYears: StuSelectItemModel[];\r\n @Input()\r\n selectedYear: StuSelectItemModel;\r\n\r\n\r\n @Output()\r\n change: EventEmitter = new EventEmitter();\r\n @Output()\r\n changeItem: EventEmitter = new EventEmitter();\r\n\r\n priceSelected: PriceModelDetails;\r\n\r\n constructor(private dataService: DataService, private stuSelectService: StuSelectServiceService,\r\n @Inject(PLATFORM_ID) private platformId) {\r\n this.prices = [];\r\n this.sendNowControl = new FormControl(false);\r\n this.selectControl = new FormControl();\r\n }\r\n ngAfterViewInit(): void {\r\n if (isPlatformBrowser(this.platformId)) {\r\n //const dropdownMenu = document.querySelector('.dropdown-menu');\r\n // dropdownMenu.setAttribute('style', 'width:' + dropdownMenu.clientWidth + 'px');\r\n }\r\n\r\n }\r\n\r\n ngOnInit() {\r\n if (isPlatformBrowser(this.platformId)) {\r\n loadBootsrtapNative();\r\n }\r\n this.dataService.selectedPriceSubject\r\n .subscribe((price: PriceModelDetails) => {\r\n if (price) {\r\n this.priceSelected = price;\r\n }\r\n });\r\n\r\n /*this.dataService.isExclusiveSubject\r\n .subscribe(result => {\r\n console.log(result);\r\n this.isExclusive = result;\r\n });*/\r\n\r\n this.stuSelectService.itemsSubject\r\n .subscribe((item: StuSelectModel) => {\r\n if (item.id == 'cards') {\r\n this.stuSelectValues = item.items;\r\n } else if (item.id == 'expireDate') {\r\n this.stuSelectMonths = item.items;\r\n } else if (item.id == 'expireDateYear') {\r\n this.stuSelectYears = item.items;\r\n } else if (item.id == 'offert') {\r\n this.stuSelectOfferts = item.items;\r\n }\r\n });\r\n this.stuSelectService.selectedItem\r\n .subscribe((item: StuSelectModel) => {\r\n\r\n if (item.id == 'cards') {\r\n this.selectedItem = item.selectedItem;\r\n } else if (item.id == 'expireDate') {\r\n this.selectedMonth = item.selectedItem;\r\n } else if (item.id == 'expireDateYear') {\r\n this.selectedYear = item.selectedItem;\r\n } else if (item.id == 'offert') {\r\n this.selectedOffert = item.selectedItem;\r\n }\r\n });\r\n\r\n\r\n }\r\n\r\n changePrice(id: number) {\r\n this.change.emit(id);\r\n }\r\n\r\n changeSelectedItem(item) {\r\n this.changeItem.emit(item);\r\n }\r\n\r\n getPriceBySms(price: PriceModelDetails) {\r\n const cents = (price.rechargePrice / price.rechargeAmount) * 100;\r\n return this.decimalAdjust('floor', cents, -1);\r\n }\r\n\r\n decimalAdjust(type, value, exp) {\r\n // Si el exp no está definido o es cero...\r\n if (typeof exp === 'undefined' || +exp === 0) {\r\n return Math[type](value);\r\n }\r\n value = +value;\r\n exp = +exp;\r\n // Si el valor no es un número o el exp no es un entero...\r\n if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {\r\n return NaN;\r\n }\r\n // Shift\r\n value = value.toString().split('e');\r\n value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp)));\r\n // Shift back\r\n value = value.toString().split('e');\r\n return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));\r\n }\r\n\r\n isNullOrWhiteSpace(input) {\r\n if (typeof input === 'undefined' || input == null) { return true; }\r\n return input.replace(/\\s/g, '').length < 1;\r\n }\r\n}\r\n"]}