{"ast":null,"code":"import { Subject } from '../Subject';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { noop } from '../util/noop';\nimport { innerFrom } from '../observable/innerFrom';\nexport function window(windowBoundaries) {\n  return operate((source, subscriber) => {\n    let windowSubject = new Subject();\n    subscriber.next(windowSubject.asObservable());\n    const errorHandler = err => {\n      windowSubject.error(err);\n      subscriber.error(err);\n    };\n    source.subscribe(createOperatorSubscriber(subscriber, value => windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.next(value), () => {\n      windowSubject.complete();\n      subscriber.complete();\n    }, errorHandler));\n    innerFrom(windowBoundaries).subscribe(createOperatorSubscriber(subscriber, () => {\n      windowSubject.complete();\n      subscriber.next(windowSubject = new Subject());\n    }, noop, errorHandler));\n    return () => {\n      windowSubject === null || windowSubject === void 0 ? void 0 : windowSubject.unsubscribe();\n      windowSubject = null;\n    };\n  });\n}\n//# sourceMappingURL=window.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}