/**
 * A not-very-interesting service to coordinate navigational state management into a singleton.
 * This is a nepal-based implementation of AlRoutingHost.
 *
 * @author McNielsen <knielsen@alertlogic.com>
 *
 */
import { AlActingAccountChangedEvent, AlActingAccountResolvedEvent, AlBehaviorPromise, AlConduitClient, AlDatacenterSessionErrorEvent, AlExternalTrackableEvent, AlEntitlementCollection, AlExperienceMapping, AlLocationContext, AlNavigationSchema, AlParamPreservationRule, AlRoute, AlRouteCondition, AlRouteDefinition, AlRouteAction, AlRoutingHost, AlSessionEndedEvent, AlSessionStartedEvent, AlStopwatch, AlSubscriptionGroup, AlTriggerStream } from '@al/core';
import { EventEmitter, NgZone } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { NavigationEnd, NavigationExtras, Router } from '@angular/router';
import { ConfirmationService } from 'primeng-lts/api';
import { AlDatacenterOptionsSummary, AlNavigateOptions } from '../types';
import { AlExperiencePreferencesService } from './al-experience-preferences.service';
import { AlExternalContentManagerService, AlGoogleTagManagerService, AlTrackingMetricEventName } from '@al/ng-generic-components';
import * as i0 from "@angular/core";
export declare class AlNavigationService implements AlRoutingHost {
    router: Router;
    ngZone: NgZone;
    experiencePreference: AlExperiencePreferencesService;
    externalContent: AlExternalContentManagerService;
    private titleService;
    private alGTMService;
    private confirmationService;
    schema: AlNavigationSchema;
    currentUrl: string;
    authenticationRequisites: number;
    get routeData(): {
        [k: string]: any;
    };
    get routeParams(): {
        [k: string]: string;
    };
    get queryParams(): {
        [k: string]: string;
    };
    tertiaryMenu: AlRoute;
    conduit: AlConduitClient;
    /**
     *  `activatedRoutes` refers to the hierarchy of menu items of the deepest activated menu item, if any.
     *  It will be updated each time the AlNavigationContextChanged event is emitted.
     *  The deepest item in this hierarchy can be retrieved using the `activatedRoute` getter.
     */
    activatedRoutes: AlRoute[];
    get activatedRoute(): AlRoute | null;
    /**
     * Navigation triggers (named events referenced by menu data) emit through this event channel.
     */
    events: AlTriggerStream;
    /**
     * Acting and primary entitlement snapshots
     */
    authenticated: boolean;
    primaryAccountId: string;
    actingAccountId: string;
    environment: string;
    entitlements: AlEntitlementCollection;
    primaryEntitlements: AlEntitlementCollection;
    experienceFlags: {
        [experienceId: string]: boolean;
    };
    routeParameters: {
        [parameter: string]: string;
    };
    layoutOptions: {
        [option: string]: string | boolean;
    };
    globalExperience: string;
    isNavigationAllowed: boolean;
    /**
     * EventEmitter to pass a css class to tertiary-content (al-archipeligo17-tertiary-menu)
     */
    tertiaryContentClass$: EventEmitter<string | string[] | {
        [i: string]: boolean;
    }>;
    /**
     * EventEmitter to indicate when the authentication requirements of the current route have changed.
     */
    authRequirementsChanged$: EventEmitter<number>;
    /**
     * EventEmitter for when layout options have changed
     */
    layoutOptionsChanged$: EventEmitter<{
        [option: string]: string | boolean;
    }>;
    /**
     * This cluster of methods supports imperative navigation of different types.
     * Note that each method accepts an optional `params` parameter bag.  This parameters will be used
     * to satisfy a given route or target's route parameters (if any); any *remaining* parameters will be
     * added as query parameters to the route.
     */
    navigate: {
        /**
         * Determines the best type of navigation strategy to use based on a given input, using generous type
         * interpretation for the sake of simplicity :)
         */
        to: (target: string | any[] | AlRoute | string[] | {
            location: string;
            path: string;
        }, parameters?: {
            [p: string]: string;
        }, options?: AlNavigateOptions) => Promise<void>;
        /**
         * Navigates to a new URL based on a named route, like "cd17:overview" or "cd19:dashboards:settings".
         */
        byNamedRoute: (namedRouteId: string, parameters?: {
            [p: string]: string;
        }, options?: AlNavigateOptions) => Promise<void>;
        /**
         * Navigates to a new URL based on a literal route.
         */
        byRoute: (route: AlRoute, parameters?: {
            [p: string]: string;
        }, options?: AlNavigateOptions) => Promise<void>;
        /**
         * Navigates to a new URL based on location/path.
         */
        byLocation: (locTypeId: string, path?: string, parameters?: {
            [p: string]: string;
        }, options?: AlNavigateOptions) => Promise<void>;
        /**
         * Navigates to a new URL
         */
        byURL: (url: string, parameters?: {
            [p: string]: string;
        }, options?: AlNavigateOptions) => Promise<void>;
        /**
         * Navigates to a new location in the current route using an array of angular commands.
         */
        byNgRoute: (commands: any[], extras?: NavigationExtras) => Promise<void>;
    };
    protected _routeData: {
        [k: string]: any;
    };
    protected _routeParams: {
        [k: string]: string;
    };
    protected _queryParams: {
        [k: string]: string;
    };
    protected navigationSchemaId: string;
    protected pendingResourceCount: number;
    protected navigationReady: AlBehaviorPromise<boolean>;
    protected schemas: {
        [schema: string]: Promise<AlNavigationSchema>;
    };
    protected loadedMenus: {
        [fullMenuId: string]: AlRoute;
    };
    protected bookmarks: {
        [bookmarkId: string]: AlRoute;
    };
    protected namedRouteDictionary: {
        [routeId: string]: AlRouteDefinition;
    };
    protected conditionDictionary: {
        [conditionId: string]: AlRouteCondition;
    };
    protected conditionCache: {
        [conditionId: string]: boolean[];
    };
    protected forcedSchema: boolean;
    protected forcedExperience: boolean;
    protected identified: boolean;
    protected initialTrackingMetric: boolean;
    protected frameNotifier: AlStopwatch;
    protected contextNotifier: AlStopwatch;
    protected sessionMonitor: AlStopwatch;
    protected subscriptions: AlSubscriptionGroup;
    protected rawExperienceMappings: unknown;
    protected experienceMappings: AlBehaviorPromise<unknown>;
    protected warnings: {
        [key: string]: boolean;
    };
    protected parameterPreservationRule: AlParamPreservationRule | null;
    protected useExpirationUI: boolean;
    protected inIdleWarning: boolean;
    protected inReauthentication: boolean;
    constructor(router: Router, ngZone: NgZone, experiencePreference: AlExperiencePreferencesService, externalContent: AlExternalContentManagerService, titleService: Title, alGTMService: AlGoogleTagManagerService, confirmationService: ConfirmationService);
    /**
     * Returns a promise(-like object) that resolves when the navigation service is ready to navigate.
     */
    ready(): Promise<boolean>;
    /**
     * In lieu of a deconstructor/destroyer or consistent garbage collection, this provides a way to detach an instance of AlNavigationService
     * from all of its subscriptions and listeners.
     */
    detach(): void;
    /**
     * Returns the experience
     */
    getExperience(): string;
    /**
     * Returns the navigation schema id
     */
    getSchema(): string;
    /**
     * Whether the experience was forced
     */
    getForcedExperience(): boolean;
    /**
     * Whether the experience was forced
     */
    getForcedSchema(): boolean;
    setForceSchema(force: boolean): void;
    setForceExperience(force: boolean): void;
    /**
     * Sets the desired experience and notifies the navigation components of the changed setting.
     */
    setExperience(experience: string, force?: boolean): void;
    /**
     * Sets the desired schema and notifies the navigation components of the changed setting.
     */
    setSchema(schemaId: string, force?: boolean): void;
    setTertiaryMenu(menu: AlRoute): void;
    /**
     * Changes the acting account.
     *
     * @param accountId The new acting account ID.
     * @param profileId If provided, the profile will "stick" to the correct session.
     * @param preventRedirection If provided and true, will prevent the function from triggering redirection if
     *                          the residency/domain changes.
     */
    setActingAccount(accountId: string, profileId?: string, preventRedirection?: boolean): Promise<boolean>;
    /**
     * This method calls a legacy endpoint in the defender stack to tell it which customer is currently the active or "preferred" one.
     * It will log errors and return false in case of failure, but is not treated as a blocking failure for `setActingAccount()`.
     */
    setDefenderPreferredCustomer(): Promise<boolean>;
    rewriteUrlToAccountAndLocation(url: string, originalActingAccountId: string, originalDatacenterId: string): string;
    /**
     * Retrieves a navigation schema (or resolves with the already-loaded schema).
     *
     * @param schemaId The identifier of the schema, currently either 'cie-plus2' or 'siemless' (although that is subject to change).
     *
     * The method will first attempt to retrieve the schema from conduit, and then fall back to retrieving a local copy using http.
     */
    getNavigationSchema(schemaId: string): Promise<AlNavigationSchema>;
    /**
     * Retrieves an "experience mapping" for a given experience identifier (a string formatted as path.to.feature#variant)
     */
    getExperienceMapping(experienceId: string): Promise<AlExperienceMapping | null>;
    getExperienceMappings(): Promise<unknown>;
    getRouteByName(routeName: string): AlRouteDefinition;
    getConditionById(conditionId: string): AlRouteCondition | boolean;
    /**
     * @deprecated
     *
     * Routes with ids are now referred to as 'named routes'; use getRouteByName instead.
     */
    getRouteById(routeId: string): AlRouteDefinition;
    /**
     * Gets a menu by schema and ID (async)
     */
    getMenu(schemaId: string, menuId: string): Promise<AlRoute>;
    /**
     * Gets a menu by schema and ID (syncronous)
     */
    getLoadedMenu(schemaId: string, menuId: string): AlRoute;
    setBookmark(bookmarkId: string, menuItem: AlRoute): void;
    getBookmark(bookmarkId: string): AlRoute;
    /**
     * Handles user dispatch of a given route.
     */
    dispatch: (route: AlRoute, params?: {
        [param: string]: string;
    }) => Promise<void>;
    refreshMenus(): void;
    /**
     * Determine whether or not a given experience flag is available in this context.
     */
    isExperienceAvailable(xpId: string): boolean;
    /**
     * Evaluates a route condition.  Please note that this method will only be called for conditionals that cannot already be intuited by data from this service's
     * AlRoutingHost implementation.
     */
    evaluate(condition: AlRouteCondition): boolean[];
    /**
     * Extends the above evaluation function by reducing all of the results to a final value
     */
    evaluateCondition(condition: AlRouteCondition): boolean;
    /**
     * Convenience method to evaluate currently installed entitlements against a logic entitlement expression.
     * See @al/core AlEntitlementCollection for more information on these expressions and how they are evaluated.
     */
    evaluateEntitlementExpression(expression: string): boolean;
    /**
     * @deprecated
     * Alias of evaluateEntitlementExpression
     */
    evaluateEntitlement(expression: string): boolean;
    /**
     * Sets a route parameter and schedules notification of child components.
     */
    setRouteParameter(parameter: string, value: string): void;
    /**
     * Deletes a route parameter and schedules notification of child components.
     */
    deleteRouteParameter(parameter: string): void;
    /**
      ** Sets a layout option, emitting an event if there is any change to state
      */
    setLayoutOption(option: string, value: string | boolean | undefined): void;
    /**
     * A workhorse method to resolve target locations, based on a variety of inputs, that includes route parameter substitution and session state query
     * parameters (aaid and locid).  It can accept a literal URL, a locTypeId/path pair, or an AlRoute as inputs.
     */
    resolveURL(url: string | {
        locTypeId: string;
        path?: string;
    } | AlRoute, parameters?: {
        [p: string]: string;
    }, context?: AlLocationContext): string;
    /**
     * Implements `AlRoutingHost`'s decorateHref method, which allows it to manipulate the URLs generated
     * by @al/core.
     */
    decorateHref(route: AlRoute): void;
    /**
     * Black magic function that, given a url with :variable placeholder, consumes provided parameters as route parameters
     * and compiles any remainders into a query string.
     *
     * @param url The input url, with route parameter placeholder -- e.g., https://console.overview.alertlogic.com/#/remediations-scan-status/:accountId/:deploymentId
     * @param parameters The list of parameters to consume
     * @param rewriteQueryString If true (default), applies unused keys/values from the `parameters` input to generate a query string, and appends that to the result.
     * @param identityParameters If true (default) or a navigation options structure, applies acting account and location parameters to the query string.
     *
     * @returns The compiled URL.
     */
    applyParameters(url: string, parameters: {
        [p: string]: string;
    }, rewriteQueryString?: boolean, identityParameters?: boolean | AlNavigateOptions): string;
    /**
     *  Generates the available data center menu structure.
     *
     *  A note on history: the reason this code is so unduly complicated is because, when the data center selector was introduced during 2017's "Universal Navigation"
     *  project (a time period when it was necessary to manage seperate user accounts and logins for different datacenters, if you can imagine that) the decision was made
     *  to conflate defender and insight locations into composites "us-west-1", "us-east-1", and "uk-west-1".  The problem, of course, is that the defender and insight
     *  datacenters of the US are asymmetrical.  It was assumed that the number of datacenters would inevitably increase and span further regions, so abstraction
     *  was preferred over a simpler enumeration of the possible permutations.
     *
     *  This expansion has not yet occurred, but the code is ready for it...  :)
     */
    generateDatacenterMenu(currentLocationId: string, accessible: string[], activationCallback: {
        (insightLocationId: string, $event: any): void;
    }): AlDatacenterOptionsSummary;
    /**
     * Forces the user to login.  Greetings and salutations!
     */
    forceAuthentication(returnURL?: string): Promise<void>;
    /**
     * Forces the user to logout.  Goodbye!
     */
    forceDeauthentication(): Promise<void>;
    incrementAuthenticationRequisite(): void;
    decrementAuthenticationRequisite(): void;
    /**
     * Detect if the current browser is either IE 10 or older (msie) or IE 11 (trident)
     */
    isIEBrowser(): boolean;
    /**
     * Dispatches an arbitrary event/properties to our analytics provider(s).
     * Please note the the acting and primary account, user, and application will be populated automatically.
     */
    track(eventName: AlTrackingMetricEventName | string, properties?: {
        [k: string]: any;
    }): void;
    /**
     * Dispatches a specifically configured usage tracking event to our analytics provider(s) - most suited for Google Analytics.
     */
    trackUsageEvent(properties: {
        category: string;
        action: string;
        label?: string;
    }): void;
    /**
     * @deprecated
     * Sends an identification call to our analytics provider(s).
     */
    identify(): Promise<void>;
    /**
     * Handles session persistence errors (aka "third party cookies are disabled and you can't log in").
     * If the current application instance is in an iframe, it communicates the error to the parent document.
     * If the current application is the top level document, it will redirect to the appropriate error page on console.account.
     */
    onDatacenterSessionError: (error: AlDatacenterSessionErrorEvent) => void;
    /**
     * Handles external trackable events (these are javascript events communicated from our legacy datacenters via conduit/postMessage)
     */
    onExternalTrackableEvent: (event: AlExternalTrackableEvent) => void;
    /**
     * Convenience method to retrieve a query parameter, optionally providing a default value
     */
    queryParam(parameterName: string, defaultValue?: string): string;
    /**
     * Convenience method to retrieve a route parameter, optionally providing a default value
     */
    routeParam(parameterName: string, defaultValue?: string): string;
    /**
     * Force confirmation before navigate away from the current page.
     */
    setNavigationBlock(): void;
    /**
     * Remove requirement of confirmation before navigate away from the current page.
     */
    clearNavigationBlock(): void;
    /**
     * Determine whether or not navigate away from the page is allowed.
     */
    canNavigateAway(): Promise<boolean>;
    showNavigationConfirmDialog(): Promise<boolean>;
    /**
     * Registers a listener for the Navigation.User.Signout trigger, which should prompt local session destruction and a redirect to
     * console.account's logout route.
     */
    protected listenForSignout(): void;
    /**
     * If applicable, uses the idleService to detect when/if the user's session should be terminated due to idleness.
     *
     * NOTE: this idle-based expiration is an initial implementation of a more complex feature.  Essentially, if the interval of time expires,
     * logout will be triggered immediately and without warning.  In the future, timeToIdle and timeToTimeout (below) should be reconfigured
     * to prompt the user to continue working.
     *
     * When we get there, we should implement "prompt to reauthenticate when the token is about to expire" at the same time -- two birds, one stone.
     */
    protected listenForIdle(): void;
    protected startIdleService(idleTimeout: number): void;
    /**
     * Listens for router complete/cancel events from angular
     */
    protected onNavigationComplete: (event: NavigationEnd) => void;
    /**
     * Listens for session start triggers from @al/core
     */
    protected onSessionStarted: (event: AlSessionStartedEvent) => void;
    /**
     * Listens for acting account changed triggers from @al/core
     */
    protected onActingAccountChanged: (event: AlActingAccountChangedEvent) => void;
    /**
     * Listens for acting account resolution triggers from @al/core
     */
    protected onActingAccountResolved: (event: AlActingAccountResolvedEvent) => void;
    /**
     * Listens for session ended triggers from @al/core
     */
    protected onSessionEnded: (event: AlSessionEndedEvent) => void;
    /**
     * Monitor session lifespan.
     * When the session is within 6 minutes of expiration, trigger the "reauthenticate now" modal.
     * When the session is within 1 minute of expiring, force deauthentication to occur.
     */
    protected onSessionMonitor: () => Promise<void>;
    /**
     * Internal handler for navigation by named route.
     */
    protected navigateByNamedRoute(namedRouteId: string, parameters?: {
        [p: string]: string;
    }, options?: AlNavigateOptions): void;
    /**
     * Internal handler for navigation by route.
     */
    protected navigateByRoute(route: AlRoute, parameters?: {
        [p: string]: string;
    }, options?: AlNavigateOptions): void;
    protected isLocalRoute(action: AlRouteAction): boolean;
    /**
     * Converts a location/path pair into an angular Router.navigate call.
     * Sadly, "local location" is both redundant and unpoetic -- the adjective and noun both derive from the latin 'loc', or 'place', and the whole
     * business of navigation of riddled with redundant, overlapping, and incongruous constructs of place and movement.  It really bothers me.
     * But at the same time, this function does exactly what the name says, so I'm gonna get over it.
     */
    protected navigateByLocalLocation(target: AlRouteAction, rawParameters?: {
        [p: string]: string;
    }): void;
    /**
     * Internal handler for navigation based on location/path.
     */
    protected navigateByLocation(locTypeId: string, path?: string, parameters?: {
        [p: string]: string;
    }, options?: AlNavigateOptions): void;
    /**
     * Internal handler for navigation by raw URL
     */
    protected navigateByURL(url: string, parameters?: {
        [p: string]: string;
    }, options?: AlNavigateOptions): void;
    /**
     *  Method to actually, you know, change the URL.  This is separated by the imperative mechanism above so that unit testing
     *  can easily intercept navigation events.
     */
    protected goToURL(url: string, options?: AlNavigateOptions): void;
    /**
     * Internal handler for navigation using angular router
     */
    protected navigateByNgRoute(commands: any[], initialExtras?: NavigationExtras): void;
    protected commandsToPath(commands: any[]): string;
    /**
     *  Notifies the navigation componentry that the schema or experience has changed, after loading the selected schema.
     *  This change is communicated via an AlNavigationFrameChanged event emitted through AlNavigationService's `events` channel.
     */
    protected emitFrameChanges: () => void;
    /**
     * Notifies the navigation componentry that one (or more) of the following things has changed:
     *      - Authentication status
     *      - Acting account/entitlements
     *      - Route parameters
     *      - Current route
     *  This change is communicated via an AlNavigationContextChanged event emitted through AlNavigationService's `events` channel.
     */
    protected emitContextChanges: () => void;
    /**
     * Processes a schema when it is loaded for the first time -- hydrates its menus, stores its named routes, etc.
     */
    protected ingestNavigationSchema(schemaId: string, schema: AlNavigationSchema | undefined): AlNavigationSchema;
    /**
     * Enumerates through all experience mappings and calculates experience availability
     */
    protected evaluateExperienceMappings(mappings: unknown): void;
    protected evaluateExperienceMapping(xpId: string, mapping: AlExperienceMapping): boolean;
    protected dateToUTCTimestamp(value: string | number): number;
    protected claimPendingResource(): void;
    protected releasePendingResource(): void;
    protected warnOnce(key: string, message: string, data?: any): void;
    protected exposeGlobals(): void;
    static ɵfac: i0.ɵɵFactoryDef<AlNavigationService, never>;
    static ɵprov: i0.ɵɵInjectableDef<AlNavigationService>;
}
