{ "version": 3, "sources": ["src/app/shared/services/shared.service.ts"], "sourcesContent": ["import { HttpClient } from '@angular/common/http';\r\nimport { isPlatformBrowser } from '@angular/common';\r\nimport { Injectable, Inject, PLATFORM_ID } from '@angular/core';\r\nimport { LangChangeEvent, TranslateService } from '@ngx-translate/core';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { ICountry } from '@interfaces/common/country.interface';\r\nimport { IMessenger } from '@interfaces/common/messenger.interface';\r\nimport { IInterest } from '@interfaces/common/interest.interface';\r\nimport { ILanguage } from '@interfaces/common/language.interface';\r\n\r\nimport { baseURL } from '@env';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharedService {\r\n isBrowser: boolean = true;\r\n\r\n constructor(\r\n @Inject(PLATFORM_ID) private _platformId: Object,\r\n private http: HttpClient,\r\n private translate: TranslateService\r\n ) {\r\n this.isBrowser = isPlatformBrowser(this._platformId);\r\n }\r\n\r\n contentModal!: any;\r\n\r\n invokeModal(id: string) {\r\n if (!this.isBrowser) {\r\n return null!;\r\n }\r\n \r\n return new window.bootstrap.Modal(\r\n document.getElementById(id) as HTMLElement\r\n );\r\n }\r\n\r\n getAllInterests(): Observable {\r\n return this.http.get(`${baseURL}interests/all`);\r\n }\r\n\r\n getAllLanguages(): Observable {\r\n return this.http.get(`${baseURL}languages/all`);\r\n }\r\n\r\n getAllCountries(): Observable {\r\n return this.http.get(`${baseURL}countries/all`);\r\n }\r\n\r\n getAllMessengers(): Observable {\r\n return this.http.get(`${baseURL}messengers/all`);\r\n }\r\n\r\n getCurrentLanguage(): Observable {\r\n return this.translate.onLangChange;\r\n }\r\n}\r\n"], "mappings": ";;;;;;;;;;;;;AAgBM,IAAO,gBAAP,MAAO,eAAa;EAGxB,YAC+B,aACrB,MACA,WAA2B;AAFN,SAAA,cAAA;AACrB,SAAA,OAAA;AACA,SAAA,YAAA;AALV,SAAA,YAAqB;AAOnB,SAAK,YAAY,kBAAkB,KAAK,WAAW;EACrD;EAIA,YAAY,IAAU;AACpB,QAAI,CAAC,KAAK,WAAW;AACnB,aAAO;IACT;AAEA,WAAO,IAAI,OAAO,UAAU,MAC1B,SAAS,eAAe,EAAE,CAAgB;EAE9C;EAEA,kBAAe;AACb,WAAO,KAAK,KAAK,IAAiB,GAAG,OAAO,eAAe;EAC7D;EAEA,kBAAe;AACb,WAAO,KAAK,KAAK,IAAiB,GAAG,OAAO,eAAe;EAC7D;EAEA,kBAAe;AACb,WAAO,KAAK,KAAK,IAAgB,GAAG,OAAO,eAAe;EAC5D;EAEA,mBAAgB;AACd,WAAO,KAAK,KAAK,IAAkB,GAAG,OAAO,gBAAgB;EAC/D;EAEA,qBAAkB;AAChB,WAAO,KAAK,UAAU;EACxB;;;uBAzCW,gBAAa,mBAId,WAAW,GAAA,mBAAA,UAAA,GAAA,mBAAA,gBAAA,CAAA;IAAA;EAAA;;4EAJV,gBAAa,SAAb,eAAa,WAAA,YAFZ,OAAM,CAAA;EAAA;;", "names": [] }