import { CdkDrag } from '@angular/cdk/drag-drop';
import * as i0 from '@angular/core';
import { EventEmitter, OnInit, OnDestroy, TemplateRef, ChangeDetectorRef, ElementRef, OnChanges, QueryList, Injector, SimpleChanges, AfterViewInit } from '@angular/core';
import { Nullable, RtlService } from '@fundamental-ngx/cdk/utils';
import { DialogRef, DialogService } from '@fundamental-ngx/core/dialog';
import { GridListItemComponent, GridListComponent, GridListSelectionEvent } from '@fundamental-ngx/core/grid-list';
import { ObjectStatus } from '@fundamental-ngx/core/object-status';
import { ApprovalFlowTeamDataSource, ApprovalFlowUserDataSource, DataProvider } from '@fundamental-ngx/platform/shared';
import { Observable } from 'rxjs';
import { FdDate } from '@fundamental-ngx/core/datetime';
import { MenuComponent } from '@fundamental-ngx/core/menu';
import { ListComponent, StandardListItemComponent, BaseListItem, SelectionChangeEvent } from '@fundamental-ngx/platform/list';

type UserStatus = string;
type ApprovalStatus = 'approved' | 'rejected' | 'in progress' | 'not started' | UserStatus;

interface ApprovalUser {
    id: string;
    teamId: string;
    name: string;
    description?: string;
    imgUrl?: string;
}

interface ApprovalNode {
    id: string;
    name: string;
    description?: string;
    approvers: ApprovalUser[];
    status: ApprovalStatus;
    targets: string[];
    dueDate?: Date;
    createDate?: Date;
    approvalTeamId?: string;
    variousTeams?: boolean;
    isEveryoneApprovalNeeded?: boolean;
    disableActions?: boolean;
    actionsConfig?: ApprovalNodeActionsConfig;
}
/** Blank - node used as connection between common nodes
 * Space - node used to visually represent space in the graph
 */
type ApprovalGraphNode = ApprovalNode & {
    blank?: boolean;
    space?: boolean;
    selected?: boolean;
    colIndex?: number;
};
interface ApprovalGraphNodeMetadata {
    parents: ApprovalGraphNode[];
    isRoot: boolean;
    isFinal: boolean;
    parallelStart: boolean;
    parallelEnd: boolean;
    isLastInParallel?: boolean;
    isFirstInParallel?: boolean;
    columnIndex?: number;
    nodeIndex?: number;
    canAddNodeBefore?: boolean;
    canAddNodeBeforeAll?: boolean;
    canAddNodeAfter?: boolean;
    canAddNodeAfterAll?: boolean;
    canAddParallel?: boolean;
    renderAddNodeAfterButton?: boolean;
    renderVerticalLineBefore?: boolean;
    renderVerticalLineAfter?: boolean;
    isVerticalLineBeforeSolid?: boolean;
    isVerticalLineAfterSolid?: boolean;
    firstOfMultipleRootNodes?: boolean;
    firstOfMultipleFinalNodes?: boolean;
    rootNodesApproved?: boolean;
}
interface ApprovalNodeActionsConfig {
    disableAddBefore?: boolean;
    disableAddAfter?: boolean;
    disableAddParallel?: boolean;
    disableEdit?: boolean;
    disableRemove?: boolean;
}

interface ApprovalProcess {
    watchers: ApprovalUser[];
    nodes: ApprovalNode[];
}

interface ApprovalTeam {
    id: string;
    name: string;
    description: string;
    members: ApprovalUser[];
}

interface SendRemindersData {
    users: ApprovalUser[];
    node: ApprovalNode;
}

interface ApprovalFlowGraph {
    columns: ApprovalGraphColumn[];
    errors?: boolean;
}
interface ApprovalGraphColumn {
    nodes: ApprovalGraphNode[];
    index?: number;
    allNodesApproved?: boolean;
}
interface ApprovalGraphMetadata {
    [key: string]: ApprovalGraphNodeMetadata;
}
/** Algorithm in short:
 * 1. Find all possible paths (longest path length = amount of the columns in the graph)
 * 2. Trim paths (remove blank nodes at the end of the paths)
 * 3. Make all paths the same length (= longest path length) to make every unique node be present at the same index across all paths
 * 4. Sort paths by their likeness between each other to avoid paths crossing
 * 5. Remove "duplicate" nodes in paths (make every unique node be present only once across all paths)
 * 6. Remove empty paths
 * 7. Transform paths into the columns
 * 8. Trim columns (remove space nodes at the end of columns)
 * 9. Remove columns which contain only blank and empty nodes
 * 10. Transform columns into the graph columns
 */
declare function generateApprovalFlowGraph(nodes: ApprovalGraphNode[]): ApprovalFlowGraph;
/** Generate graph metadata */
declare function generateApprovalFlowGraphMetadata(graph: ApprovalFlowGraph): ApprovalGraphMetadata;

/** @hidden */
declare function isNodeApproved(node: ApprovalNode): boolean;
/** @hidden */
declare function isNodeStarted(node: ApprovalNode): boolean;
/** @hidden */
declare function displayTeamFn(team: ApprovalTeam): string;
/** @hidden */
declare function displayUserFn(user: ApprovalUser): string;
/** @hidden */
declare function userValueFn(user: ApprovalUser): string;
/** @hidden */
declare function filterByName(obj: {
    name: string;
}, searchString: string): boolean;
/** @hidden */
declare function trackByFn(index: number, item: {
    id: string;
}): number | string;
/** @hidden */
declare function getGraphNodes(graph: ApprovalFlowGraph): ApprovalGraphNode[];
/** @hidden */
declare function getParentNodes(node: ApprovalNode, nodes: ApprovalNode[]): ApprovalNode[];
/** @hidden */
declare function getBlankApprovalGraphNode(): ApprovalGraphNode;
/** @hidden */
declare function getSpaceApprovalGraphNode(): ApprovalGraphNode;
/** @hidden */
declare function isNodeTargetsIncludeId(node: ApprovalNode, id: string): boolean;

declare enum VIEW_MODES {
    SELECT_TEAM = "SELECT_TEAM",
    SELECT_USER = "SELECT_USER",
    VIEW_TEAM_MEMBERS = "VIEW_TEAM_MEMBERS",
    USER_DETAILS = "USER_DETAILS"
}
declare class ApprovalFlowAddNodeViewService {
    /** @hidden */
    onViewChange: EventEmitter<any>;
    /** @hidden */
    private currentView?;
    /** @hidden */
    private selectedTeam?;
    /** @hidden */
    get isUserDetailsMode(): boolean;
    /** @hidden */
    get isTeamMembersMode(): boolean;
    /** @hidden */
    get isSelectUserMode(): boolean;
    /** @hidden */
    get isSelectTeamMode(): boolean;
    /** @hidden */
    get team(): ApprovalTeam | undefined;
    /** @hidden */
    setCurrentView(view: VIEW_MODES): void;
    /** @hidden */
    resetView(): void;
    /** @hidden */
    selectTeam(team: ApprovalTeam): void;
    /** @hidden */
    resetTeam(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowAddNodeViewService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ApprovalFlowAddNodeViewService>;
}

interface AddNodeDialogRefData {
    isEdit?: boolean;
    showNodeTypeSelect?: boolean;
    node?: ApprovalNode;
    nodeTarget?: ApprovalFlowNodeTarget;
    teamDataSource: ApprovalFlowTeamDataSource<ApprovalTeam>;
    userDataSource: ApprovalFlowUserDataSource<ApprovalUser>;
    userDetailsTemplate: TemplateRef<any>;
    checkDueDate?: boolean;
    rtl: boolean;
}
interface AddNodeDialogFormData {
    node: ApprovalNode;
    nodeType: APPROVAL_FLOW_NODE_TYPES;
    toNextSerial: boolean;
}
type ApprovalFlowNewNodePlacement = 'before' | 'after' | 'before-all' | 'after-all';
type ApprovalFlowNodeTarget = ApprovalFlowNewNodePlacement | 'empty' | 'parallel';
declare enum APPROVAL_FLOW_NODE_TYPES {
    SERIAL = "SERIAL",
    PARALLEL = "PARALLEL"
}
declare enum APPROVAL_FLOW_APPROVER_TYPES {
    SINGLE_USER = "SINGLE_USER",
    ANYONE = "ANYONE",
    EVERYONE = "EVERYONE"
}
/**
 * @deprecated
 * ApprovalFlowAddNode component is deprecated since version 0.40.0
 */
declare class ApprovalFlowAddNodeComponent implements OnInit, OnDestroy {
    dialogRef: DialogRef<AddNodeDialogRefData>;
    viewService: ApprovalFlowAddNodeViewService;
    private _cdr;
    /** @hidden */
    _nodeType: APPROVAL_FLOW_NODE_TYPES;
    /** @hidden */
    _nodeTypes: typeof APPROVAL_FLOW_NODE_TYPES;
    /** @hidden */
    _nodeTypesArray: string[];
    /** @hidden */
    _approverType: APPROVAL_FLOW_APPROVER_TYPES;
    /** @hidden */
    _approverTypes: typeof APPROVAL_FLOW_APPROVER_TYPES;
    /** @hidden */
    _approverTypesArray: string[];
    /** @hidden */
    _dueDate: FdDate;
    /** @hidden */
    _selectMode: boolean;
    /** @hidden */
    _approvers: ApprovalUser[];
    /** @hidden */
    _teams: ApprovalTeam[];
    /** @hidden */
    _selectedApprovers: ApprovalUser[];
    /** @hidden */
    _selectedTeam: Nullable<ApprovalTeam>;
    /** @hidden */
    _selectedTeamArray: ApprovalTeam[];
    /** @hidden */
    _selectedTeamMembers: ApprovalUser[];
    /** @hidden */
    _filteredTeamMembers: ApprovalUser[];
    /** @hidden */
    _userToShowDetails?: ApprovalUser;
    /** @hidden */
    _userToShowDetailsData$?: Observable<any>;
    /** @hidden */
    _checkDueDate: boolean;
    /** @hidden */
    _displayUserFn: typeof displayUserFn;
    /** @hidden */
    _displayTeamFn: typeof displayTeamFn;
    /** @hidden */
    _trackByFn: typeof trackByFn;
    /** @hidden */
    _addToNextSerial: boolean;
    /** @hidden */
    private _viewChangeSub;
    /** @hidden */
    private _dataSourceSub;
    /** @hidden */
    constructor(dialogRef: DialogRef<AddNodeDialogRefData>, viewService: ApprovalFlowAddNodeViewService, _cdr: ChangeDetectorRef);
    /** @hidden */
    get _data(): AddNodeDialogRefData;
    /** @hidden */
    get _isSingleUserMode(): boolean;
    /** @hidden */
    get _isMainSubmitButtonDisabled(): boolean;
    /** @hidden */
    get _headerArrowGlyph(): string;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /** @hidden */
    _goToSelectMode(): void;
    /** @hidden */
    _exitSelectMode(): void;
    /** @hidden */
    _setSelectedApprovers(approvers: ApprovalUser[]): void;
    /** @hidden */
    _confirmSelectedApprovers(): void;
    /** @hidden */
    _setSelectedTeam(team: ApprovalTeam): void;
    /** @hidden */
    _confirmSelectedTeam(): void;
    /** @hidden */
    _seeUserDetails(user: ApprovalUser): void;
    /** @hidden */
    _exitUserDetailsMode(): void;
    /** @hidden */
    _viewTeamMembers(team: ApprovalTeam): void;
    /** @hidden */
    _exitTeamMembersMode(): void;
    /** @hidden */
    _submit(): void;
    /** @hidden */
    _onSearchStringChange(searchString?: string): void;
    /** @hidden */
    _setFilteredTeamMembers(users: ApprovalUser[]): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowAddNodeComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowAddNodeComponent, "fdp-approval-flow-add-node", never, {}, {}, never, never, true, never>;
}

type ApprovalFlowMessageType = 'watchersChangeSuccess' | 'approverAddSuccess' | 'teamAddSuccess' | 'nodeEdit' | 'nodeRemove' | 'nodesRemove' | 'teamRemove' | 'error';
interface ApprovalFlowMessage {
    type: ApprovalFlowMessageType;
}
/**
 * @deprecated
 * ApprovalFlowMessages component is deprecated since version 0.40.0
 */
declare class ApprovalFlowMessagesComponent {
    /** Array of messages */
    messages: ApprovalFlowMessage[];
    /** Whether undo action is available */
    undoLastActionAvailable: boolean;
    /** Event emitted when messages array change */
    messagesChange: EventEmitter<ApprovalFlowMessage[]>;
    /** Event emitted when user click undo button */
    undoLastAction: EventEmitter<void>;
    /** @hidden */
    _trackByFn: typeof trackByFn;
    /** @hidden */
    _dismissMessage(messageIndex: number): void;
    /** @hidden */
    _undoLastAction(messageIndex: number, event: Event): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowMessagesComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowMessagesComponent, "fdp-approval-flow-messages", never, { "messages": { "alias": "messages"; "required": false; }; "undoLastActionAvailable": { "alias": "undoLastActionAvailable"; "required": false; }; }, { "messagesChange": "messagesChange"; "undoLastAction": "undoLastAction"; }, never, never, true, never>;
}

declare class ApprovalFlowDropZoneDirective {
    private readonly elRef;
    /** Approval flow new node placement */
    placement: ApprovalFlowNewNodePlacement;
    /** Whether drop zone is active (pointer with dragged node over the drop zone) */
    active: boolean;
    /** @hidden */
    constructor(elRef: ElementRef);
    /** @hidden */
    _checkIfNodeDraggedInDropZone(nodeRect: DOMRect): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowDropZoneDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<ApprovalFlowDropZoneDirective, "[fdp-approval-flow-drop-zone]", ["fdp-approval-flow-drop-zone"], { "placement": { "alias": "placement"; "required": false; }; }, {}, never, never, true, never>;
}

/**
 * @deprecated
 * ApprovalFlowNode component is deprecated since version 0.40.0
 */
declare class ApprovalFlowNodeComponent implements OnInit, OnChanges, OnDestroy {
    private readonly _elRef;
    private readonly _cdr;
    private readonly _rtlService;
    /** Approval flow graph node */
    node: ApprovalGraphNode;
    /** Node metadata */
    meta: ApprovalGraphNodeMetadata;
    /** Whether node element has arrow on the left side pointing to the node */
    renderArrow: boolean;
    /** Whether to display due date warning in status */
    checkDueDate: boolean;
    /** Number of days before due date when status changes to `warning` with text 'Due in X days'.
     *  Not used if 'checkDueDate' equals false */
    dueDateThreshold: number;
    /** Whether nodes in column in which current node placed are approved
     *  Used to render appropriate vertical line after (dashed/solid)
     */
    allNodesInColumnApproved: boolean;
    /** A reference to the app custom statuses */
    approvalStatusTemplate: TemplateRef<any>;
    /** Custom status to color mapping  */
    statusColorMapping: Record<ApprovalStatus, ObjectStatus>;
    /** Whether the node is in edit mode */
    isEdit: boolean;
    /** Whether the node after is blank */
    isNextNodeBlank: boolean;
    /** @hidden */
    get _blank(): boolean;
    /** @hidden */
    get _space(): boolean;
    /** @hidden */
    get _isRoot(): boolean;
    /** @hidden */
    get _isFinal(): boolean;
    /** @hidden */
    get _renderLineBefore(): boolean;
    /** @hidden */
    get _renderLineAfter(): boolean;
    /** @hidden */
    get _isApproved(): boolean;
    /** @hidden */
    get _isParentApproved(): boolean;
    /** @hidden */
    get _isNodeSelected(): boolean;
    /** @hidden */
    get _isParallelStart(): boolean;
    /** @hidden */
    get _isParallelEnd(): boolean;
    /** @hidden */
    get _isFirstInParallel(): boolean;
    /** @hidden */
    get _isLastInParallel(): boolean;
    /** Whether the node is blank and the final */
    get _lastBlank(): boolean;
    /** @hidden */
    get _isSelected(): boolean;
    /** Event emitted on add node button clicked, value is the placement for the new node */
    onAdd: EventEmitter<ApprovalFlowNodeTarget>;
    /** Event emitted on edit node button clicked */
    onEdit: EventEmitter<void>;
    /** Event emitted on delete node button clicked */
    onDelete: EventEmitter<void>;
    /** @hidden */
    _menu: MenuComponent;
    /** @hidden */
    _overflowMenuButton: TemplateRef<any>;
    /** @hidden */
    _nodeContent: TemplateRef<any>;
    /** @hidden */
    _dropZones: QueryList<ApprovalFlowDropZoneDirective>;
    /** @hidden */
    _gridListItem: GridListItemComponent<ApprovalGraphNode>;
    /** @hidden */
    _objectStatus: ObjectStatus;
    /** @hidden */
    _showDueDateWarning: boolean;
    /** @hidden */
    _dueIn: number;
    /** @hidden */
    readonly approvalFlowNodeId: string;
    /** @hidden */
    private _subscriptions;
    /** @hidden */
    constructor(_elRef: ElementRef, _cdr: ChangeDetectorRef, _rtlService: RtlService);
    /** @hidden */
    get _nativeElement(): HTMLElement;
    /** @hidden */
    get _isNotStarted(): boolean;
    /** @hidden */
    get _isEditActionsAvailable(): boolean;
    /** @hidden */
    get _activeDropZones(): ApprovalFlowDropZoneDirective[];
    /** @hidden */
    get _isAnyDropZoneActive(): boolean;
    /** @hidden */
    get _isVerticalLineBeforeSolid(): boolean;
    /** @hidden */
    get _isVerticalLineAfterSolid(): boolean;
    /** @hidden */
    get _showAddButton(): boolean;
    /** @hidden */
    get _showAfterAllAddButton(): boolean;
    /** @hidden */
    _dropZonePartial(placement: ApprovalFlowNodeTarget): boolean;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnChanges(): void;
    /** @hidden */
    ngOnDestroy(): void;
    /** @hidden */
    _onMenuOpen(): void;
    /** @hidden */
    _focus(options?: FocusOptions): void;
    /** @hidden */
    _deactivateDropZones(): void;
    /** @hidden */
    _checkIfNodeDraggedInDropZone(nodeRect: DOMRect): void;
    /** @hidden */
    private _checkNodeStatus;
    /** @hidden */
    private _getNodeStatusClass;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowNodeComponent, [null, null, { optional: true; }]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowNodeComponent, "fdp-approval-flow-node", never, { "node": { "alias": "node"; "required": false; }; "meta": { "alias": "meta"; "required": false; }; "renderArrow": { "alias": "renderArrow"; "required": false; }; "checkDueDate": { "alias": "checkDueDate"; "required": false; }; "dueDateThreshold": { "alias": "dueDateThreshold"; "required": false; }; "allNodesInColumnApproved": { "alias": "allNodesInColumnApproved"; "required": false; }; "approvalStatusTemplate": { "alias": "approvalStatusTemplate"; "required": false; }; "statusColorMapping": { "alias": "statusColorMapping"; "required": false; }; "isEdit": { "alias": "isEdit"; "required": false; }; "isNextNodeBlank": { "alias": "isNextNodeBlank"; "required": false; }; }, { "onAdd": "onAdd"; "onEdit": "onEdit"; "onDelete": "onDelete"; }, ["_gridListItem"], ["*"], true, never>;
}

/**
 * @deprecated
 * Approval Flow component is deprecated since version 0.40.0
 */
declare class ApprovalFlowComponent implements OnInit, OnChanges, OnDestroy {
    private readonly _dialogService;
    private readonly _cdr;
    private readonly _injector;
    private providers;
    private readonly _rtlService;
    /** Title which is displayed in the header of the Approval Flow component. */
    title: string;
    /** Value of the approval flow component. */
    value: ApprovalProcess;
    /** Data source for the users of Approval Flow component. */
    userDataSource: ApprovalFlowUserDataSource<ApprovalUser>;
    /** Data source for the watchers of Approval Flow component. */
    watcherDataSource: ApprovalFlowUserDataSource<ApprovalUser>;
    /** Data source for the teams of Approval Flow component. */
    teamDataSource: ApprovalFlowTeamDataSource<ApprovalTeam>;
    /** A reference to the user details template */
    userDetailsTemplate: TemplateRef<any>;
    /** A reference to the app custom statuses */
    approvalStatusTemplate: TemplateRef<any>;
    /** Custom status to color mapping  */
    statusColorMapping: Record<ApprovalStatus, ObjectStatus>;
    /** Whether to display due date warning in status */
    checkDueDate: boolean;
    /** Number of days before due date when status changes to `warning` with text 'Due in X days'.
     *  Not used if 'checkDueDate' equals false */
    dueDateThreshold: number;
    /** A list of approval statuses that allow sending reminders to their approvers */
    allowSendRemindersForStatuses: ApprovalStatus[];
    /** Whether the approval flow is editable */
    isEditAvailable: boolean;
    /** Text label for watchers list */
    watchersLabel: string;
    /** Enables or disables ability to add parallel nodes */
    allowAddParallelNodes: boolean;
    /** Disables save button, save button is enabled by default */
    disableSaveButton: boolean;
    /** Disables exit button, exit button is enabled by default */
    disableExitButton: boolean;
    /**
     * Name of the entity for which users DataProvider will be loaded.
     * Internally we should be able to do lookup to some registry
     * and retrieve the best matching DataProvider that is set on application level
     */
    usersDataProviderEntityKey?: string;
    /**
     * Name of the entity for which teams DataProvider will be loaded.
     * Internally we should be able to do lookup to some registry
     * and retrieve the best matching DataProvider that is set on application level
     */
    teamsDataProviderEntityKey?: string;
    /**
     * Name of the entity for which approval flow DataProvider will be loaded.
     * Internally we should be able to do lookup to some registry
     * and retrieve the best matching DataProvider that is set on application level
     */
    watchersDataProviderEntityKey?: string;
    /**
     * Should remove the space node from the graph
     */
    removeSpaceNode?: boolean;
    /** Event emitted on approval flow node click. */
    nodeClick: EventEmitter<ApprovalNode>;
    /** Event emitted on approval flow node add */
    afterNodeAdd: EventEmitter<ApprovalNode>;
    /** Event emitted on approval flow node edit */
    afterNodeEdit: EventEmitter<ApprovalNode>;
    /** Event emitted whenver save is clicked in edit mode  */
    valueChange: EventEmitter<ApprovalProcess>;
    /** Event emitted whenever reminders should be sent */
    sendReminders: EventEmitter<SendRemindersData>;
    /** Event emitted when data loading is started. */
    onDataRequested: EventEmitter<void>;
    /** Event emitted when data loading is finished. */
    onDataReceived: EventEmitter<void>;
    /** @hidden */
    _graphContainerEl: ElementRef<HTMLDivElement>;
    /** @hidden */
    _graphEl: ElementRef<HTMLDivElement>;
    /** @hidden */
    _gridList: GridListComponent<ApprovalGraphNode>;
    /** @hidden */
    _nodeComponents: QueryList<ApprovalFlowNodeComponent>;
    /** @hidden */
    _approvalProcess: ApprovalProcess;
    /** @hidden */
    _initialApprovalProcess?: ApprovalProcess;
    /** @hidden */
    _previousApprovalProcess?: ApprovalProcess;
    /** @hidden */
    _graph: ApprovalFlowGraph;
    /** @hidden */
    _isCarousel: boolean;
    /** @hidden */
    _graphMetadata: ApprovalGraphMetadata;
    /** @hidden */
    _isEditMode: boolean;
    /** @hidden */
    _usersForWatchersList: ApprovalUser[];
    /** @hidden */
    _selectedWatcherIds: ApprovalUser['id'][];
    /** @hidden */
    _messages: ApprovalFlowMessage[];
    /** @hidden */
    _emptyApprovalFlowSpotConfig: {
        spot: {
            url: string;
            id: string;
        };
    };
    /** @hidden */
    _multipleRootNodes: boolean;
    /** @hidden */
    _multipleFinalNodes: boolean;
    /** @hidden */
    _dragDropInProgress: boolean;
    /** Returns snapshot of the current and initial states of approval process */
    get approvalProcess(): ApprovalProcess;
    /** @hidden */
    get _rtl(): boolean;
    /** @hidden */
    get _selectedNodes(): ApprovalGraphNode[];
    /** @hidden */
    _displayUserFn: typeof displayUserFn;
    /** @hidden */
    _userValueFn: typeof userValueFn;
    /** @hidden */
    _trackByFn: typeof trackByFn;
    /** @hidden */
    readonly approvalFlowUniqueId: string;
    /** @hidden */
    private _selectedWatchers;
    /** @hidden */
    private _editModeInitSub;
    /** @hidden */
    private _subscriptions;
    /** @hidden */
    private _dataSourceChanged$;
    /** @hidden */
    constructor(_dialogService: DialogService, _cdr: ChangeDetectorRef, _injector: Injector, providers: Map<string, DataProvider<any>>, _rtlService: RtlService);
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnChanges(changes: SimpleChanges): void;
    /** @hidden */
    ngOnDestroy(): void;
    /** @hidden */
    _isNextNodeBlank(node: ApprovalGraphNode, columnIndex: number, nodeIndex: number): boolean;
    /** @hidden */
    _isCdkDragDisabled(node: ApprovalGraphNode): boolean;
    /** @hidden Node click handler */
    _onNodeClick(node: ApprovalNode): void;
    /** @hidden */
    _onNodeAdd(node: ApprovalNode): void;
    /** @hidden */
    _onNodeEdit(node: ApprovalNode): void;
    /** @hidden */
    _onNodeSelectionChange(event: GridListSelectionEvent<ApprovalGraphNode>): void;
    /** @hidden Watcher's avatar click handler */
    _onWatcherClick(watcher: ApprovalUser, event: Event): void;
    /** Retrive metadata by node id */
    getNodeMetadataByNodeId(nodeId: string): ApprovalGraphNodeMetadata;
    /** Scroll to the next horizontal slide */
    nextSlide(dir?: number): void;
    /** @hidden */
    _setScrollPosition(pos: number): void;
    /** @hidden Handle node keydown and focus other node based on which key is pressed */
    _onNodeKeyDown(event: KeyboardEvent, node: ApprovalGraphNode): void;
    /** @hidden Fetch all necessary data and enter edit mode */
    _enterEditMode(): void;
    /** @hidden Send update approval process calls to DataSource and exit edit mode*/
    _saveEditModeChanges(): void;
    /** @hidden Restore initial approval flow state and exit edit mode */
    _exitEditMode(): void;
    /** @hidden */
    _watchersSelectionChanged(selectedIds: ApprovalUser['id'][]): void;
    /** @hidden Restore previously saved approval process state */
    _undoLastAction(): void;
    /** @hidden Open add node dialog */
    _addNode(source: ApprovalGraphNode, type: ApprovalFlowNodeTarget): void;
    /** @hidden Open edit node dialog */
    _editNode(node: ApprovalNode): void;
    /** @hidden "Delete" button click handler */
    _onNodeDelete(nodeToDelete: ApprovalNode): void;
    /** @hidden */
    _deleteSelectedNodes(): void;
    /** @hidden Node drag move handler, used to check if need to highlight a drop zone rectangle */
    _onNodeDragMoved(node: ApprovalGraphNode): void;
    /** @hidden */
    _focusNode(node: ApprovalGraphNode): void;
    /** @hidden Node drop handler */
    _onNodeDrop(nodeToDrop: ApprovalGraphNode, drag: CdkDrag): void;
    /** @hidden */
    private _moveColInView;
    /** @hidden */
    private _finishDragDropProcess;
    /** @hidden */
    private _showMessage;
    /** @hidden Build Approval Flow graph and render it */
    private _buildView;
    /** @hidden Listen window resize and distribute cards on column change */
    private _listenOnResize;
    /** @hidden Update node object in local approval process data structure */
    private _updateNode;
    /** @hidden Delete node object in local approval process data structure */
    private _deleteNode;
    /** @hidden */
    private _addParallelTargets;
    /** @hidden Replace all occurrences of "idToReplace" in all nodes' "targets" with ones in "replaceWith" array */
    private _replaceTargets;
    /** @hidden Save current state of approval process data to be able to undo an action made in edit mode */
    private _cacheCurrentApprovalProcess;
    /** @hidden */
    private _getNextHorizontalNode;
    /** @hidden */
    private _getNextVerticalNode;
    /** @hidden */
    private get _carouselStepSize();
    /** @hidden */
    get _scrollDiff(): number;
    /** @hidden */
    get _carouselStepsCount(): number;
    /** @hidden */
    get _carouselStepsLeft(): number;
    /** @hidden */
    get _carouselStepsRight(): number;
    /** @hidden */
    private get _defaultDialogOptions();
    /** @hidden */
    private _findSerialNode;
    /** @hidden */
    private _processAddingParallelNode;
    /** @hidden */
    private _setupDataSourceSubscription;
    /** @hidden */
    private removeSpaceNodesFromColumns;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowComponent, [null, null, null, { optional: true; }, { optional: true; }]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowComponent, "fdp-approval-flow", never, { "title": { "alias": "title"; "required": false; }; "value": { "alias": "value"; "required": false; }; "userDataSource": { "alias": "userDataSource"; "required": false; }; "watcherDataSource": { "alias": "watcherDataSource"; "required": false; }; "teamDataSource": { "alias": "teamDataSource"; "required": false; }; "userDetailsTemplate": { "alias": "userDetailsTemplate"; "required": false; }; "approvalStatusTemplate": { "alias": "approvalStatusTemplate"; "required": false; }; "statusColorMapping": { "alias": "statusColorMapping"; "required": false; }; "checkDueDate": { "alias": "checkDueDate"; "required": false; }; "dueDateThreshold": { "alias": "dueDateThreshold"; "required": false; }; "allowSendRemindersForStatuses": { "alias": "allowSendRemindersForStatuses"; "required": false; }; "isEditAvailable": { "alias": "isEditAvailable"; "required": false; }; "watchersLabel": { "alias": "watchersLabel"; "required": false; }; "allowAddParallelNodes": { "alias": "allowAddParallelNodes"; "required": false; }; "disableSaveButton": { "alias": "disableSaveButton"; "required": false; }; "disableExitButton": { "alias": "disableExitButton"; "required": false; }; "usersDataProviderEntityKey": { "alias": "usersDataProviderEntityKey"; "required": false; }; "teamsDataProviderEntityKey": { "alias": "teamsDataProviderEntityKey"; "required": false; }; "watchersDataProviderEntityKey": { "alias": "watchersDataProviderEntityKey"; "required": false; }; "removeSpaceNode": { "alias": "removeSpaceNode"; "required": false; }; }, { "nodeClick": "nodeClick"; "afterNodeAdd": "afterNodeAdd"; "afterNodeEdit": "afterNodeEdit"; "valueChange": "valueChange"; "sendReminders": "sendReminders"; "onDataRequested": "onDataRequested"; "onDataReceived": "onDataReceived"; }, never, never, true, never>;
}

interface ApprovalFlowApproverDetailsDialogRefData {
    node?: ApprovalNode;
    watcher?: ApprovalUser;
    allowSendReminder?: boolean;
    userDataSource: ApprovalFlowUserDataSource<ApprovalUser>;
    userDetailsTemplate: TemplateRef<any>;
    rtl?: boolean;
}
/**
 * @deprecated
 * ApprovalFlowApproverDetails component is deprecated since version 0.40.0
 */
declare class ApprovalFlowApproverDetailsComponent implements OnInit {
    dialogRef: DialogRef<ApprovalFlowApproverDetailsDialogRefData>;
    private _cdr;
    /** @hidden */
    _isListMode: boolean;
    /** @hidden */
    _listItems: ApprovalUser[];
    /** @hidden */
    _selectedUsers: ApprovalUser[];
    /** @hidden */
    _userToShowDetails?: ApprovalUser;
    /** @hidden */
    _userToShowDetailsData$: Observable<any>;
    /** @hidden */
    constructor(dialogRef: DialogRef<ApprovalFlowApproverDetailsDialogRefData>, _cdr: ChangeDetectorRef);
    /** @hidden */
    get _data(): ApprovalFlowApproverDetailsDialogRefData;
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    _setListItems(items?: ApprovalUser[]): void;
    /** @hidden */
    _exitUserDetailsMode(): void;
    /** @hidden */
    _seeUserDetails(user: ApprovalUser): void;
    /** @hidden */
    _sendReminder(): void;
    /** @hidden */
    _onSearchStringChange(searchString: string): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowApproverDetailsComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowApproverDetailsComponent, "fdp-approval-flow-approver-details", never, {}, {}, never, never, true, never>;
}

/**
 * @deprecated
 * ApprovalFlowUserList component is deprecated since version 0.40.0
 */
declare class ApprovalFlowUserListComponent implements AfterViewInit, OnChanges, OnDestroy {
    private _cdr;
    /** Approval flow users */
    users: ApprovalUser[];
    /** Approval flow selected users */
    selectedUsers: ApprovalUser[];
    /** Whether the list is selectable */
    isSelectable: boolean;
    /** Event emitted on user click */
    onUserClick: EventEmitter<ApprovalUser>;
    /** Event emitted on selection change */
    onSelectionChange: EventEmitter<ApprovalUser[]>;
    /** @hidden */
    list: ListComponent<ApprovalUser>;
    /** @hidden */
    listItems: QueryList<StandardListItemComponent>;
    /** @hidden */
    _selectedItems: BaseListItem[];
    /** @hidden */
    _idPrefix: string;
    /** @hidden */
    _trackByFn: typeof trackByFn;
    /** @hidden */
    _displayUsers: ApprovalUser[];
    /** @hidden */
    _allSelectedUsers: ApprovalUser[];
    /** @hidden */
    private _intervalID?;
    /** @hidden */
    private _destroyed$;
    /** @hidden */
    private _dontCallSelection;
    /** @hidden */
    constructor(_cdr: ChangeDetectorRef);
    /** @hidden */
    ngAfterViewInit(): void;
    /** @hidden */
    ngOnChanges(changes: SimpleChanges): void;
    /** @hidden */
    ngOnDestroy(): void;
    /** @hidden */
    _onSelect(event: SelectionChangeEvent): void;
    /** @hidden */
    private _getUsersFromSelectedItems;
    /** @hidden */
    private _collectDataProgressive;
    /** @hidden */
    private _userCollectorIntervalFn;
    /** @hidden */
    private _killInterval;
    /** @hidden */
    private _listenToListItemChange;
    /** @hidden */
    private _selectItems;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowUserListComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowUserListComponent, "fdp-approval-flow-user-list", never, { "users": { "alias": "users"; "required": false; }; "selectedUsers": { "alias": "selectedUsers"; "required": false; }; "isSelectable": { "alias": "isSelectable"; "required": false; }; }, { "onUserClick": "onUserClick"; "onSelectionChange": "onSelectionChange"; }, never, never, true, never>;
}

/**
 * @deprecated
 * ApprovalFlowUserDetails component is deprecated since version 0.40.0
 */
declare class ApprovalFlowUserDetailsComponent {
    /** Approval Flow user */
    user: ApprovalUser;
    /** Approval Flow user details */
    details: Nullable<Observable<any>>;
    /** Approval Flow user details template */
    detailsTemplate: TemplateRef<any>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowUserDetailsComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowUserDetailsComponent, "fdp-approval-flow-user-details", never, { "user": { "alias": "user"; "required": false; }; "details": { "alias": "details"; "required": false; }; "detailsTemplate": { "alias": "detailsTemplate"; "required": false; }; }, {}, never, never, true, never>;
}

/**
 * @deprecated
 * ApprovalFlowTeamList component is deprecated since version 0.40.0
 */
declare class ApprovalFlowTeamListComponent {
    /** Approval flow teams */
    teams: ApprovalTeam[];
    /** Whether in RTL mode */
    isRtl: boolean;
    /** Selected team ID */
    selectedTeamId: Nullable<string>;
    /** Event emitted on team click */
    onTeamClick: EventEmitter<ApprovalTeam>;
    /** Event emitted on team selection change */
    onTeamRadioClick: EventEmitter<ApprovalTeam>;
    /** @hidden */
    _trackByFn: typeof trackByFn;
    /** @hidden */
    _showTeamDetails(team: ApprovalTeam): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowTeamListComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowTeamListComponent, "fdp-approval-flow-team-list", never, { "teams": { "alias": "teams"; "required": false; }; "isRtl": { "alias": "isRtl"; "required": false; }; "selectedTeamId": { "alias": "selectedTeamId"; "required": false; }; }, { "onTeamClick": "onTeamClick"; "onTeamRadioClick": "onTeamRadioClick"; }, never, never, true, never>;
}

interface SelectTypeDialogFormData {
    type: APPROVAL_FLOW_NODE_TYPES;
    toNextSerial: boolean;
}
/**
 * @deprecated
 * ApprovalFlowSelectType component is deprecated since version 0.40.0
 */
declare class ApprovalFlowSelectTypeComponent {
    readonly _dialogRef: DialogRef;
    /** @hidden */
    _nodeType: APPROVAL_FLOW_NODE_TYPES;
    /** @hidden */
    _nodeTypes: typeof APPROVAL_FLOW_NODE_TYPES;
    /** @hidden */
    _toNextSerial: boolean;
    /** @hidden */
    constructor(_dialogRef: DialogRef);
    /** @hidden */
    _submit(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowSelectTypeComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowSelectTypeComponent, "fdp-approval-flow-select-type", never, {}, {}, never, never, true, never>;
}

/**
 * @deprecated
 * ApprovalFlowToolbarActions component is deprecated since version 0.40.0
 */
declare class ApprovalFlowToolbarActionsComponent {
    /** Approval flow graph */
    graph: ApprovalFlowGraph;
    /** Approval flow graph metadata */
    graphMetadata: ApprovalGraphMetadata;
    /** Array of selected approval flow graph nodes */
    set selectedNodes(value: ApprovalGraphNode[]);
    get selectedNodes(): ApprovalGraphNode[];
    /** Whether approval flow in the edit mode */
    isEditMode: boolean;
    /** Event emitted when edit mode toggled */
    enterEditMode: EventEmitter<void>;
    /** Event emitted when node added */
    addNode: EventEmitter<{
        node: ApprovalGraphNode;
        target: ApprovalFlowNodeTarget;
    }>;
    /** Event emitted when selected node edited */
    editSelectedNode: EventEmitter<ApprovalGraphNode>;
    /** Event emitted when selected nodes deleted (bulk) */
    deleteSelectedNodes: EventEmitter<void>;
    /** @hidden */
    _canRemoveSelectedNodes: boolean;
    /** @hidden */
    private _selectedNodes;
    /** @hidden */
    get _notApprovedSelectedNode(): ApprovalGraphNode | null;
    /** @hidden */
    get _canAddBefore(): boolean;
    /** @hidden */
    get _canAddAfter(): boolean;
    /** @hidden */
    get _canAddParallel(): boolean;
    /** @hidden */
    get _canEditNode(): boolean;
    /** @hidden */
    _addNode(target: ApprovalFlowNodeTarget): void;
    /** @hidden */
    _editSelectedNode(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApprovalFlowToolbarActionsComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApprovalFlowToolbarActionsComponent, "fdp-approval-flow-toolbar-actions", never, { "graph": { "alias": "graph"; "required": false; }; "graphMetadata": { "alias": "graphMetadata"; "required": false; }; "selectedNodes": { "alias": "selectedNodes"; "required": false; }; "isEditMode": { "alias": "isEditMode"; "required": false; }; }, { "enterEditMode": "enterEditMode"; "addNode": "addNode"; "editSelectedNode": "editSelectedNode"; "deleteSelectedNodes": "deleteSelectedNodes"; }, never, never, true, never>;
}

declare class PlatformApprovalFlowModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<PlatformApprovalFlowModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<PlatformApprovalFlowModule, never, [typeof ApprovalFlowComponent, typeof ApprovalFlowNodeComponent, typeof ApprovalFlowApproverDetailsComponent, typeof ApprovalFlowAddNodeComponent, typeof ApprovalFlowUserListComponent, typeof ApprovalFlowUserDetailsComponent, typeof ApprovalFlowDropZoneDirective, typeof ApprovalFlowTeamListComponent, typeof ApprovalFlowSelectTypeComponent, typeof ApprovalFlowMessagesComponent, typeof ApprovalFlowToolbarActionsComponent], [typeof ApprovalFlowComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<PlatformApprovalFlowModule>;
}

export { APPROVAL_FLOW_APPROVER_TYPES, APPROVAL_FLOW_NODE_TYPES, ApprovalFlowAddNodeComponent, ApprovalFlowAddNodeViewService, ApprovalFlowApproverDetailsComponent, ApprovalFlowComponent, ApprovalFlowDropZoneDirective, ApprovalFlowMessagesComponent, ApprovalFlowNodeComponent, ApprovalFlowSelectTypeComponent, ApprovalFlowTeamListComponent, ApprovalFlowToolbarActionsComponent, ApprovalFlowUserDetailsComponent, ApprovalFlowUserListComponent, PlatformApprovalFlowModule, VIEW_MODES, displayTeamFn, displayUserFn, filterByName, generateApprovalFlowGraph, generateApprovalFlowGraphMetadata, getBlankApprovalGraphNode, getGraphNodes, getParentNodes, getSpaceApprovalGraphNode, isNodeApproved, isNodeStarted, isNodeTargetsIncludeId, trackByFn, userValueFn };
export type { AddNodeDialogFormData, AddNodeDialogRefData, ApprovalFlowApproverDetailsDialogRefData, ApprovalFlowGraph, ApprovalFlowMessage, ApprovalFlowMessageType, ApprovalFlowNewNodePlacement, ApprovalFlowNodeTarget, ApprovalGraphColumn, ApprovalGraphMetadata, ApprovalGraphNode, ApprovalGraphNodeMetadata, ApprovalNode, ApprovalNodeActionsConfig, ApprovalProcess, ApprovalStatus, ApprovalTeam, ApprovalUser, SelectTypeDialogFormData, SendRemindersData, UserStatus };
