{"version":3,"file":"krai-tech-web-api.mjs","sources":["../../../../projects/web-api/tokens/src/window.api.ts","../../../../projects/web-api/tokens/src/local-storage.api.ts","../../../../projects/web-api/tokens/src/location.api.ts","../../../../projects/web-api/tokens/src/navigator.api.ts","../../../../projects/web-api/tokens/src/user-agent.api.ts","../../../../projects/web-api/tokens/src/session-storage.api.ts","../../../../projects/web-api/tokens/src/history.api.ts","../../../../projects/web-api/tokens/src/animation-frame.api.ts","../../../../projects/web-api/tokens/src/page-visibility.api.ts","../../../../projects/web-api/tokens/src/crypto.api.ts","../../../../projects/web-api/tokens/src/screen.api.ts","../../../../projects/web-api/krai-tech-web-api.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { inject, InjectionToken } from '@angular/core';\n\n/**\n * Injection token for the global window object.\n *\n * This token provides an abstraction over the global window object, allowing it to be injected\n * into Angular services or components. It uses the Angular DOCUMENT token to access the defaultView,\n * which represents the window object.\n *\n * Throws an error if the window object is not available.\n */\nexport const WINDOW = new InjectionToken<Window>(\n  'An abstraction over global window object',\n  {\n    factory: () => {\n      const {defaultView} = inject(DOCUMENT);\n\n      if (!defaultView) {\n        throw new Error('Window is not available');\n      }\n\n      return defaultView;\n    },\n  },\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { WINDOW } from './window.api';\n\n/**\n * Injection token for the global localStorage object.\n *\n * This token provides an abstraction over the window.localStorage object, allowing it to be injected\n * into Angular services or components. It utilizes the WINDOW injection token to access the localStorage\n * property of the global window object.\n */\nexport const LOCAL_STORAGE = new InjectionToken<Storage>(\n  'An abstraction over window.localStorage object',\n  {\n    factory: () => inject(WINDOW).localStorage,\n  },\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { WINDOW } from './window.api';\n\n/**\n * Injection token for the global location object.\n *\n * This token provides an abstraction over the window.location object, allowing it to be injected\n * into Angular services or components. It utilizes the WINDOW injection token to access the location\n * property of the global window object.\n */\nexport const LOCATION = new InjectionToken<Location>(\n  'An abstraction over window.location object',\n  {\n    factory: () => inject(WINDOW).location,\n  },\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { WINDOW } from './window.api';\n\n/**\n * Injection token for the global navigator object.\n *\n * This token provides an abstraction over the window.navigator object, allowing it to be injected\n * into Angular services or components. It utilizes the WINDOW injection token to access the navigator\n * property of the global window object.\n */\nexport const NAVIGATOR = new InjectionToken<Navigator>(\n  'An abstraction over window.navigator object',\n  {\n    factory: () => inject(WINDOW).navigator,\n  },\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { NAVIGATOR } from './navigator.api';\n\n/**\n * Injection token for the global userAgent string.\n *\n * This token provides an abstraction over the window.navigator.userAgent property, allowing it to be injected\n * into Angular services or components. It utilizes the NAVIGATOR injection token to access the userAgent\n * property of the global navigator object.\n */\nexport const USER_AGENT = new InjectionToken<string>(\n  'An abstraction over window.navigator.userAgent object',\n  {\n    factory: () => inject(NAVIGATOR).userAgent,\n  },\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { WINDOW } from './window.api';\n\n/**\n * Injection token for the global sessionStorage object.\n *\n * This token provides an abstraction over the window.sessionStorage object, allowing it to be injected\n * into Angular services or components. It utilizes the WINDOW injection token to access the sessionStorage\n * property of the global window object.\n */\nexport const SESSION_STORAGE = new InjectionToken<Storage>(\n  'An abstraction over window.sessionStorage object',\n  {\n    factory: () => inject(WINDOW).sessionStorage,\n  },\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { WINDOW } from './window.api';\n\n/**\n * Injection token for the global history object.\n *\n * This token provides an abstraction over the window.history object, allowing it to be injected\n * into Angular services or components. It utilizes the WINDOW injection token to access the history\n * property of the global window object.\n */\nexport const HISTORY = new InjectionToken<History>(\n  'An abstraction over window.history object',\n  {\n    factory: () => inject(WINDOW).history,\n  },\n);\n","import {inject, InjectionToken} from '@angular/core';\nimport {Observable, share} from 'rxjs';\nimport { WINDOW } from './window.api';\n\n/**\n * Injection token for an Observable based on `window.requestAnimationFrame`.\n *\n * This token provides an Observable that emits timestamps on each animation frame.\n * It utilizes the WINDOW injection token to access the requestAnimationFrame and cancelAnimationFrame\n * methods of the global window object. The Observable is shared to ensure multiple subscribers\n * receive the same animation frame updates.\n */\nexport const ANIMATION_FRAME = new InjectionToken<Observable<DOMHighResTimeStamp>>(\n  'Shared Observable based on `window.requestAnimationFrame`',\n  {\n    factory: () => {\n      const { requestAnimationFrame, cancelAnimationFrame } = inject(WINDOW);\n      const animationFrame$ = new Observable<DOMHighResTimeStamp>(subscriber => {\n        let id = NaN;\n        const callback = (timestamp: DOMHighResTimeStamp): void => {\n          subscriber.next(timestamp);\n          id = requestAnimationFrame(callback);\n        };\n\n        id = requestAnimationFrame(callback);\n\n        return () => {\n          cancelAnimationFrame(id);\n        };\n      });\n\n      return animationFrame$.pipe(share());\n    },\n  },\n);\n","import {DOCUMENT} from '@angular/common';\nimport {inject, InjectionToken} from '@angular/core';\nimport type {Observable} from 'rxjs';\nimport {distinctUntilChanged, fromEvent, map, shareReplay, startWith} from 'rxjs';\n\n/**\n * Injection token for an Observable that emits the visibility state of the document.\n *\n * This token provides an Observable that emits a boolean value indicating whether the document\n * is visible or hidden. It uses the `visibilitychange` event of the document to detect changes\n * in visibility state. The Observable is shared and replayed, ensuring that subscribers receive\n * the latest visibility state.\n */\nexport const PAGE_VISIBILITY = new InjectionToken<Observable<boolean>>(\n  'Shared Observable based on `document visibility changed`',\n  {\n    factory: () => {\n      const documentRef = inject(DOCUMENT);\n\n      return fromEvent(documentRef, 'visibilitychange').pipe(\n        startWith(0),\n        map(() => documentRef.visibilityState !== 'hidden'),\n        distinctUntilChanged(),\n        shareReplay({refCount: false, bufferSize: 1}),\n      );\n    },\n  },\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { WINDOW } from './window.api';\n\n/**\n * Injection token for the global Crypto object.\n *\n * This token provides an abstraction over the window.crypto object, allowing it to be injected\n * into Angular services or components. It utilizes the WINDOW injection token to access the crypto\n * property of the global window object.\n */\nexport const CRYPTO = new InjectionToken<Crypto>(\n  'An abstraction over window.crypto object',\n  {\n    factory: () => inject(WINDOW).crypto,\n  },\n);\n","import { inject, InjectionToken } from '@angular/core';\nimport { WINDOW } from './window.api';\n\n/**\n * Injection token for the global Screen object.\n *\n * This token provides an abstraction over the window.screen object, allowing it to be injected\n * into Angular services or components. It utilizes the WINDOW injection token to access the screen\n * property of the global window object.\n */\nexport const SCREEN = new InjectionToken<Screen>(\n  'An abstraction over window.screen object',\n  {\n    factory: () => inject(WINDOW).screen,\n  },\n);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;AAQG;MACU,MAAM,GAAG,IAAI,cAAc,CACtC,0CAA0C,EAC1C;IACE,OAAO,EAAE,MAAK;QACZ,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEvC,IAAI,CAAC,WAAW,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC5C;AAED,QAAA,OAAO,WAAW,CAAC;KACpB;AACF,CAAA;;ACrBH;;;;;;AAMG;MACU,aAAa,GAAG,IAAI,cAAc,CAC7C,gDAAgD,EAChD;IACE,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY;AAC3C,CAAA;;ACXH;;;;;;AAMG;MACU,QAAQ,GAAG,IAAI,cAAc,CACxC,4CAA4C,EAC5C;IACE,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ;AACvC,CAAA;;ACXH;;;;;;AAMG;MACU,SAAS,GAAG,IAAI,cAAc,CACzC,6CAA6C,EAC7C;IACE,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS;AACxC,CAAA;;ACXH;;;;;;AAMG;MACU,UAAU,GAAG,IAAI,cAAc,CAC1C,uDAAuD,EACvD;IACE,OAAO,EAAE,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS;AAC3C,CAAA;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