"use strict";
// //#region Imports
// import { CookiesConsentComponent } from './CookiesConsentElement';
// //#endregion
// /**
//  * The `CookiesConsent` class.
//  *
//  * @public
//  */
// export class CookiesConsent {
//     //#region Fields
//     private readonly _cookieService: ICookieService;
//     private readonly _overlay: Overlay;
//     private readonly _overlayPositionBuilder: OverlayPositionBuilder;
//     private _overlayRef: Nullable<OverlayRef>;
//     private _componentRef: Nullable<ComponentRef<CookiesConsentComponent>>;
//     //#endregion
//     //#region Ctor
//     /**
//      * Constructs a new instance of the `CookiesConsentService` class.
//      *
//      * @public
//      */
//     public constructor(cookieService: CookieService, overlay: Overlay, overlayPositionBuilder: OverlayPositionBuilder) {
//         this._cookieService = cookieService;
//         this._overlay = overlay;
//         this._overlayPositionBuilder = overlayPositionBuilder;
//         this._overlayRef = null;
//         this._componentRef = null;
//     }
//     //#endregion
//     //#region Methods
//     public show(options: { delay: number }): void {
//         if (this._cookieService.has('consent')) {
//             return;
//         }
//         once(interval(options.delay).pipe(take(1)), () => {
//             const positionStrategy = this._overlayPositionBuilder
//                 .global()
//                 .right('0px')
//                 .bottom('0px');
//             this._overlayRef = this._overlay.create({
//                 positionStrategy: positionStrategy,
//                 scrollStrategy: this._overlay.scrollStrategies.reposition(),
//                 disposeOnNavigation: false,
//                 hasBackdrop: false,
//             });
//             const portal = new ComponentPortal(CookiesConsentComponent);
//             this._componentRef = this._overlayRef?.attach(portal);
//             once(this._componentRef.instance.accepted, () => {
//                 this._cookieService.set('consent', 'true');
//                 if (this._overlayRef?.hasAttached()) {
//                     this._overlayRef.detach();
//                     this._componentRef?.destroy();
//                     this._overlayRef.dispose();
//                 }
//             });
//         });
//     }
//     //#endregion
// }
//# sourceMappingURL=CookiesConsent.js.map