{ "version": 3, "sources": ["src/app/shared/services/from-server/from-server.service.ts"], "sourcesContent": ["import { take, filter, skip } from 'rxjs/operators';\r\nimport { Router, NavigationStart } from '@angular/router';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { TransferState, makeStateKey } from '@angular/core';\r\nimport { Platform } from '@angular/cdk/platform';\r\n\r\nexport const STATE_KEY = makeStateKey('expo.state');\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class FromServerService {\r\n platform = inject(Platform);\r\n router = inject(Router);\r\n transferState = inject(TransferState);\r\n constructor(\r\n ) {\r\n if(this.platform.isBrowser) {\r\n this.router.events\r\n .pipe(\r\n filter(e => e instanceof NavigationStart),\r\n skip(1),\r\n take(1)\r\n )\r\n .subscribe(() => {\r\n this.transferState.remove(STATE_KEY);\r\n });\r\n }\r\n }\r\n\r\n get isFromServer(): boolean {\r\n return this.transferState.hasKey(STATE_KEY);\r\n }\r\n\r\n}\r\n"], "mappings": "uKAMO,IAAMA,EAA8B,aAK9BC,GAAiB,IAAA,CAAxB,IAAOA,EAAP,MAAOA,CAAiB,CAI5BC,aAAA,CAHA,KAAAC,SAAWC,EAAOC,CAAQ,EAC1B,KAAAC,OAASF,EAAOG,CAAM,EACtB,KAAAC,cAAgBJ,EAAOK,CAAa,EAG/B,KAAKN,SAASO,WACf,KAAKJ,OAAOK,OACXC,KACCC,EAAOC,GAAKA,aAAaC,CAAe,EACxCC,EAAK,CAAC,EACNC,EAAK,CAAC,CAAC,EAERC,UAAU,IAAK,CACd,KAAKV,cAAcW,OAAOnB,CAAS,CACrC,CAAC,CAEL,CAEA,IAAIoB,cAAY,CACZ,OAAO,KAAKZ,cAAca,OAAYrB,CAAS,CACnD,yCArBWC,EAAiB,wBAAjBA,EAAiBqB,QAAjBrB,EAAiBsB,UAAAC,WAFhB,MAAM,CAAA,EAEd,IAAOvB,EAAPwB,SAAOxB,CAAiB,GAAA", "names": ["STATE_KEY", "FromServerService", "constructor", "platform", "inject", "Platform", "router", "Router", "transferState", "TransferState", "isBrowser", "events", "pipe", "filter", "e", "NavigationStart", "skip", "take", "subscribe", "remove", "isFromServer", "hasKey", "factory", "\u0275fac", "providedIn", "_FromServerService"] }