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;;;ACXlC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA","sources":["./src/app/app-routing.module.ts","./src/app/app.component.ts","./src/app/app.module.ts","./src/app/cupons-by-id/cupons-by-id.page.ts","./src/app/graphql.module.ts","./src/app/shared/cupons-service.service.ts","./src/environments/environment.ts","./src/main.ts","./node_modules/@ionic/core/dist/esm|lazy|/^\\.\\/.*\\.entry\\.js$/|include: /\\.entry\\.js$/|exclude: /\\.system\\.entry\\.js$/|groupOptions: {}|namespace object"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { PreloadAllModules, RouterModule, Routes } from '@angular/router';\nimport { CuponsByIdPage } from './cupons-by-id/cupons-by-id.page';\n\nconst routes: Routes = [\n {\n path: 'cupons/:userId',\n component: CuponsByIdPage,\n },\n {\n path: '',\n loadChildren: () =>\n import('./tabs/tabs.module').then((m) => m.TabsPageModule),\n },\n {\n path: 'promotions-by-id',\n loadChildren: () =>\n import('./promotions-by-id/promotions-by-id.module').then(\n (m) => m.PromotionsByIdPageModule\n ),\n },\n {\n path: 'cupons-by-id',\n loadChildren: () =>\n import('./cupons-by-id/cupons-by-id.module').then(\n (m) => m.CuponsByIdPageModule\n ),\n },\n];\n@NgModule({\n imports: [\n RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }),\n ],\n exports: [RouterModule],\n})\nexport class AppRoutingModule {}\n","import { Component, OnInit } from '@angular/core';\nimport { TranslateService } from '@ngx-translate/core';\nimport { ConfirmationService, PrimeNGConfig } from 'primeng/api';\nimport { Subscription } from 'rxjs';\n\n@Component({\n selector: 'app-root',\n templateUrl: 'app.component.html',\n styleUrls: ['app.component.scss'],\n providers: [ConfirmationService],\n})\nexport class AppComponent implements OnInit {\n lang = 'en';\n date: any;\n subscription: Subscription;\n //https://www.ibidemgroup.com/edu/internacionalizacion-i18n-primeng-ngx-translate/\n\n constructor(\n private primengConfig: PrimeNGConfig,\n public translate: TranslateService\n ) {\n this.translate.addLangs(['en', 'es', 'pt']);\n this.translate.setDefaultLang('en');\n\n const browserLang = this.translate.getBrowserLang();\n this.lang = browserLang.match(/en|es|pt/) ? browserLang : 'pt';\n this.changeLang(this.lang);\n\n this.subscription = this.translate.stream('primeng').subscribe((data) => {\n this.primengConfig.setTranslation(data);\n });\n\n //TEST CHANGE LANG\n this.changeLang('pt');\n }\n\n ngOnInit() {\n this.primengConfig.ripple = true;\n }\n\n changeLang(lang: string = null) {\n if (lang) {\n this.translate.use(lang);\n this.lang = lang;\n } else {\n this.translate.use(this.lang);\n }\n }\n}\n","import { registerLocaleData } from '@angular/common';\nimport { HttpClient, HttpClientModule } from '@angular/common/http';\nimport localePt from '@angular/common/locales/pt';\nimport { DEFAULT_CURRENCY_CODE, LOCALE_ID, NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { RouteReuseStrategy } from '@angular/router';\nimport { IonicModule, IonicRouteStrategy } from '@ionic/angular';\nimport { TranslateLoader, TranslateModule } from '@ngx-translate/core';\nimport { TranslateHttpLoader } from '@ngx-translate/http-loader';\nimport { CalendarModule } from 'primeng/calendar';\nimport { DropdownModule } from 'primeng/dropdown';\nimport { RadioButtonModule } from 'primeng/radiobutton';\nimport { TableModule } from 'primeng/table';\nimport { AppRoutingModule } from './app-routing.module';\nimport { AppComponent } from './app.component';\nimport { GraphQLModule } from './graphql.module';\n\n// AoT requires an exported function for factories\n// eslint-disable-next-line prefer-arrow/prefer-arrow-functions\nexport function httpLoaderFactory(httpClient: HttpClient) {\n return new TranslateHttpLoader(httpClient);\n}\n\nregisterLocaleData(localePt, 'pt');\n@NgModule({\n declarations: [AppComponent],\n entryComponents: [],\n imports: [\n BrowserModule,\n BrowserAnimationsModule,\n IonicModule.forRoot(),\n AppRoutingModule,\n GraphQLModule,\n HttpClientModule,\n //nuevo\n FormsModule,\n RadioButtonModule,\n DropdownModule,\n CalendarModule,\n TableModule,\n TranslateModule.forRoot({\n loader: {\n provide: TranslateLoader,\n useFactory: httpLoaderFactory,\n deps: [HttpClient],\n },\n }),\n ],\n providers: [\n { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },\n {\n provide: LOCALE_ID,\n useValue: 'pt-BR',\n },\n {\n provide: DEFAULT_CURRENCY_CODE,\n useValue: 'BRL',\n },\n ],\n bootstrap: [AppComponent],\n})\nexport class AppModule {}\n","import { Component, OnInit } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { Apollo, gql } from 'apollo-angular';\nimport { CuponsService } from '../shared/cupons-service.service';\n\nconst searchById = gql`\n query ($userId: String!) {\n cupons(where: { userId: { eq: $userId } }) {\n nodes {\n id\n status\n updatedAt\n promotion {\n code\n }\n cuponsOptions {\n id\n value\n option {\n id\n code\n name\n }\n }\n }\n }\n }\n`;\n\nclass CuponsById {\n id: string;\n status: string;\n updatedAt: string;\n code: string;\n cuponsOptions: CuponsOptions[];\n}\n\nclass CuponsOptions {\n id: string;\n value: string;\n option: Option;\n}\n\nclass Option {\n id: string;\n code: string;\n name: string;\n}\n\n@Component({\n selector: 'app-cupns-by-id',\n templateUrl: './cupons-by-id.page.html',\n styleUrls: ['./cupons-by-id.page.scss'],\n})\nexport class CuponsByIdPage implements OnInit {\n dataColumns = [\n { header: 'id', field: 'id' },\n { header: 'status', field: 'status' },\n { header: 'last-update', field: 'updatedAt' },\n { header: 'promotion', field: 'code' },\n ];\n cupons: CuponsById[] = [];\n loaded: boolean = false;\n selectedRow: CuponsById;\n\n constructor(\n private apollo: Apollo,\n private router: ActivatedRoute,\n public cuponsService: CuponsService\n ) {\n this.router.params.subscribe((params) => {\n this.apollo\n .watchQuery({\n query: searchById,\n variables: {\n userId: params['userId'],\n },\n })\n .valueChanges.subscribe((result: any) => {\n console.log(result);\n // this.data = [...result.data.cupons.nodes];\n let cupon: CuponsById;\n result.data.cupons.nodes.forEach((element, index) => {\n let datetime = new Date(element.updatedAt);\n // console.log(datetime.toLocaleDateString());\n cupon = {\n id: element.id,\n status: element.status,\n updatedAt: datetime.toLocaleDateString(),\n code: element.promotion.code,\n cuponsOptions: element.cuponsOptions,\n };\n this.cupons.push(cupon);\n this.loaded = true;\n });\n });\n });\n }\n\n ngOnInit() {}\n\n onRowSelect(event) {\n console.log(event.data);\n }\n\n onRowUnselect(event) {\n console.log(event.data);\n }\n}\n","import { environment } from './../environments/environment';\nimport { NgModule } from '@angular/core';\nimport { ApolloClientOptions, InMemoryCache } from '@apollo/client/core';\nimport { ApolloModule, APOLLO_OPTIONS } from 'apollo-angular';\nimport { HttpLink } from 'apollo-angular/http';\n\nconst uri =\n environment.api + '/graphql'; // <-- add the URL of the GraphQL server here\nexport function createApollo(httpLink: HttpLink): ApolloClientOptions {\n return {\n link: httpLink.create({ uri }),\n cache: new InMemoryCache(),\n };\n}\n\n@NgModule({\n exports: [ApolloModule],\n providers: [\n {\n provide: APOLLO_OPTIONS,\n useFactory: createApollo,\n deps: [HttpLink],\n },\n ],\n})\nexport class GraphQLModule {}\n","import { Injectable } from '@angular/core';\nimport { Apollo, gql } from 'apollo-angular';\nconst createCupon = gql`\n mutation createCupon($promotionId: Int!, $userId: String!, $operator: String) {\n createCupon(cupon: { promotionId: $promotionId, userId: $userId, operator: $operator }) {\n id\n promotionId\n userId\n status\n createdAt\n }\n }\n`;\n\nconst updateCupon = gql`\n mutation updateCupon($id: String!, $status: String!) {\n updateCupon(id: $id, update: { status: $status }) {\n status\n id\n }\n }\n`;\n\n@Injectable({\n providedIn: 'root',\n})\nexport class CuponsService {\n states = ['WAITING', 'DELIVERED', 'EXPIRED', 'CANCELED'];\n constructor(private apollo: Apollo) {}\n\n onCreateCupon(cupon: { promotionId: number; userId: string; operator: string }) {\n return this.apollo.mutate({\n mutation: createCupon,\n variables: {\n promotionId: cupon.promotionId,\n userId: cupon.userId,\n operator: cupon.operator\n },\n });\n }\n\n onEditCupon(cupon: any) {\n return this.apollo.mutate({\n mutation: updateCupon,\n variables: {\n id: cupon.id,\n status: cupon.status,\n },\n });\n }\n}\n","// This file can be replaced during build by using the `fileReplacements` array.\n// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.\n// The list of file replacements can be found in `angular.json`.\n\nexport const environment = {\n production: false,\n api: window['env']['api'] || 'http://cupons.playbonds-v2019.147.124.216.139.xip.playbrandsgroup.com'\n};\n\n/*\n * For easier debugging in development mode, you can import the following file\n * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.\n *\n * This import should be commented out in production mode because it will have a negative impact\n * on performance if an error is thrown.\n */\n// import 'zone.js/dist/zone-error'; // Included with Angular CLI.\n","import { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n\nimport { AppModule } from './app/app.module';\nimport { environment } from './environments/environment';\n\nif (environment.production) {\n enableProdMode();\n}\n\nplatformBrowserDynamic().bootstrapModule(AppModule)\n .catch(err => console.log(err));\n","var map = {\n\t\"./ion-accordion_2.entry.js\": [\n\t\t70079,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-accordion_2_entry_js\"\n\t],\n\t\"./ion-action-sheet.entry.js\": [\n\t\t25593,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-action-sheet_entry_js\"\n\t],\n\t\"./ion-alert.entry.js\": [\n\t\t13225,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-alert_entry_js\"\n\t],\n\t\"./ion-app_8.entry.js\": [\n\t\t4812,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-app_8_entry_js\"\n\t],\n\t\"./ion-avatar_3.entry.js\": [\n\t\t86655,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-avatar_3_entry_js\"\n\t],\n\t\"./ion-back-button.entry.js\": [\n\t\t44856,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-back-button_entry_js\"\n\t],\n\t\"./ion-backdrop.entry.js\": [\n\t\t13059,\n\t\t\"node_modules_ionic_core_dist_esm_ion-backdrop_entry_js\"\n\t],\n\t\"./ion-breadcrumb_2.entry.js\": [\n\t\t58648,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-breadcrumb_2_entry_js\"\n\t],\n\t\"./ion-button_2.entry.js\": [\n\t\t98308,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-button_2_entry_js\"\n\t],\n\t\"./ion-card_5.entry.js\": [\n\t\t44690,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-card_5_entry_js\"\n\t],\n\t\"./ion-checkbox.entry.js\": [\n\t\t64090,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-checkbox_entry_js\"\n\t],\n\t\"./ion-chip.entry.js\": [\n\t\t36214,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-chip_entry_js\"\n\t],\n\t\"./ion-col_3.entry.js\": [\n\t\t69447,\n\t\t\"node_modules_ionic_core_dist_esm_ion-col_3_entry_js\"\n\t],\n\t\"./ion-datetime_3.entry.js\": [\n\t\t79689,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-datetime_3_entry_js\"\n\t],\n\t\"./ion-fab_3.entry.js\": [\n\t\t18840,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-fab_3_entry_js\"\n\t],\n\t\"./ion-img.entry.js\": [\n\t\t40749,\n\t\t\"node_modules_ionic_core_dist_esm_ion-img_entry_js\"\n\t],\n\t\"./ion-infinite-scroll_2.entry.js\": [\n\t\t69667,\n\t\t\"node_modules_ionic_core_dist_esm_ion-infinite-scroll_2_entry_js\"\n\t],\n\t\"./ion-input.entry.js\": [\n\t\t83288,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-input_entry_js\"\n\t],\n\t\"./ion-item-option_3.entry.js\": [\n\t\t35473,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-item-option_3_entry_js\"\n\t],\n\t\"./ion-item_8.entry.js\": [\n\t\t53634,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-item_8_entry_js\"\n\t],\n\t\"./ion-loading.entry.js\": [\n\t\t22855,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-loading_entry_js\"\n\t],\n\t\"./ion-menu_3.entry.js\": [\n\t\t495,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-menu_3_entry_js\"\n\t],\n\t\"./ion-modal.entry.js\": [\n\t\t58737,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-modal_entry_js\"\n\t],\n\t\"./ion-nav_2.entry.js\": [\n\t\t99632,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-nav_2_entry_js\"\n\t],\n\t\"./ion-picker-column-internal.entry.js\": [\n\t\t54446,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-picker-column-internal_entry_js\"\n\t],\n\t\"./ion-picker-internal.entry.js\": [\n\t\t32275,\n\t\t\"node_modules_ionic_core_dist_esm_ion-picker-internal_entry_js\"\n\t],\n\t\"./ion-popover.entry.js\": [\n\t\t48050,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-popover_entry_js\"\n\t],\n\t\"./ion-progress-bar.entry.js\": [\n\t\t18994,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-progress-bar_entry_js\"\n\t],\n\t\"./ion-radio_2.entry.js\": [\n\t\t23592,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-radio_2_entry_js\"\n\t],\n\t\"./ion-range.entry.js\": [\n\t\t35454,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-range_entry_js\"\n\t],\n\t\"./ion-refresher_2.entry.js\": [\n\t\t290,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-refresher_2_entry_js\"\n\t],\n\t\"./ion-reorder_2.entry.js\": [\n\t\t92666,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-reorder_2_entry_js\"\n\t],\n\t\"./ion-ripple-effect.entry.js\": [\n\t\t64816,\n\t\t\"node_modules_ionic_core_dist_esm_ion-ripple-effect_entry_js\"\n\t],\n\t\"./ion-route_4.entry.js\": [\n\t\t45534,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-route_4_entry_js\"\n\t],\n\t\"./ion-searchbar.entry.js\": [\n\t\t94902,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-searchbar_entry_js\"\n\t],\n\t\"./ion-segment_2.entry.js\": [\n\t\t91938,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-segment_2_entry_js\"\n\t],\n\t\"./ion-select_3.entry.js\": [\n\t\t78179,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-select_3_entry_js\"\n\t],\n\t\"./ion-slide_2.entry.js\": [\n\t\t90668,\n\t\t\"node_modules_ionic_core_dist_esm_ion-slide_2_entry_js\"\n\t],\n\t\"./ion-spinner.entry.js\": [\n\t\t61624,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-spinner_entry_js\"\n\t],\n\t\"./ion-split-pane.entry.js\": [\n\t\t19989,\n\t\t\"node_modules_ionic_core_dist_esm_ion-split-pane_entry_js\"\n\t],\n\t\"./ion-tab-bar_2.entry.js\": [\n\t\t28902,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-tab-bar_2_entry_js\"\n\t],\n\t\"./ion-tab_2.entry.js\": [\n\t\t70199,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-tab_2_entry_js\"\n\t],\n\t\"./ion-text.entry.js\": [\n\t\t48395,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-text_entry_js\"\n\t],\n\t\"./ion-textarea.entry.js\": [\n\t\t96357,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-textarea_entry_js\"\n\t],\n\t\"./ion-toast.entry.js\": [\n\t\t38268,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-toast_entry_js\"\n\t],\n\t\"./ion-toggle.entry.js\": [\n\t\t15269,\n\t\t\"common\",\n\t\t\"node_modules_ionic_core_dist_esm_ion-toggle_entry_js\"\n\t],\n\t\"./ion-virtual-scroll.entry.js\": [\n\t\t32875,\n\t\t\"node_modules_ionic_core_dist_esm_ion-virtual-scroll_entry_js\"\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(() => {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn Promise.all(ids.slice(1).map(__webpack_require__.e)).then(() => {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = () => (Object.keys(map));\nwebpackAsyncContext.id = 50863;\nmodule.exports = webpackAsyncContext;"],"names":[],"sourceRoot":"webpack:///"}