import * as _angular_core from '@angular/core';
import { TemplateRef, Signal } from '@angular/core';
import { ZIcon } from '@shival99/z-ui/components/z-icon';

interface ZMenuItemTemplateContext {
    $implicit: ZMenuItem;
    close: () => void;
}
type ZMenuOverlayType = 'dark' | 'blur';
interface ZMenuItem {
    id: string;
    name: string;
    icon?: ZIcon;
    iconSvg?: string;
    parent?: string[];
    active?: boolean;
    expanded?: boolean;
    children?: ZMenuItem[];
    permission?: string[];
    path: string;
    level?: number;
    subPaths?: string[];
    projects?: string[];
    menuTemplate?: TemplateRef<ZMenuItemTemplateContext>;
    menuTemplateWidth?: number;
    renderChildren?: boolean;
    renderExpanded?: boolean;
}
type ZMenuV2Item = Omit<ZMenuItem, 'children' | 'menuTemplate' | 'menuTemplateWidth' | 'renderChildren' | 'renderExpanded'> & {
    children?: ZMenuV2Item[];
};
type ZMenuV2ExpandMode = 'accordion' | 'multiple';
interface ZMenuProcessed {
    tree: ZMenuItem[];
    flat: Map<string, ZMenuItem>;
    pathMap: Map<string, ZMenuItem>;
    subPathMap: Map<string, ZMenuItem>;
    parentMap: Map<string, ZMenuItem>;
}
interface ZMenuUser {
    name: string;
    email: string;
    avatar?: string;
}
interface ZMenuUserAction {
    id: string;
    label: string;
    icon?: ZIcon;
    disabled?: boolean;
    hidden?: boolean;
    divide?: 'before' | 'after';
    class?: string;
}
interface ZMenuControl {
    openMobileMenu: () => void;
    closeMobileMenu: () => void;
    toggleMobileMenu: () => void;
    setSelectedMenuItem: (menuId: string) => void;
    clearActiveItem: () => void;
    toggleSidebar: () => void;
    openMobileTemplateDrawer: (parentId: string) => void;
    closeMobileTemplateDrawer: () => void;
    sidebarCollapsed: Signal<boolean>;
    mobileMenuOpen: Signal<boolean>;
    mobileTemplateDrawerOpen: Signal<boolean>;
    selectedMenuItem: Signal<ZMenuItem | null>;
    selectedParent: Signal<ZMenuItem | null>;
    menuProcessed: Signal<ZMenuProcessed>;
}
type ZMenuV2Control = Omit<ZMenuControl, 'openMobileTemplateDrawer' | 'closeMobileTemplateDrawer' | 'mobileTemplateDrawerOpen'>;

declare class ZMenuComponent {
    private readonly _breakpointObserver;
    private readonly _destroyRef;
    private readonly _platformId;
    private readonly _router;
    readonly zOnSelect: _angular_core.OutputEmitterRef<ZMenuItem>;
    readonly zOnMenuAction: _angular_core.OutputEmitterRef<ZMenuUserAction>;
    readonly zControl: _angular_core.OutputEmitterRef<ZMenuControl>;
    readonly zLogo: _angular_core.InputSignal<string>;
    readonly zLogoMobile: _angular_core.InputSignal<string>;
    readonly zMenus: _angular_core.InputSignal<ZMenuItem[]>;
    readonly zUser: _angular_core.InputSignal<ZMenuUser | null>;
    readonly zUserActions: _angular_core.InputSignal<ZMenuUserAction[]>;
    readonly zActionsTemplate: _angular_core.InputSignal<TemplateRef<{
        close: () => void;
    }> | null>;
    readonly zCurrentPath: _angular_core.InputSignal<string>;
    readonly zKey: _angular_core.InputSignal<string>;
    readonly selectedParent: _angular_core.WritableSignal<ZMenuItem | null>;
    readonly selectedMenuItem: _angular_core.WritableSignal<ZMenuItem | null>;
    readonly mobileMenuOpen: _angular_core.WritableSignal<boolean>;
    readonly mobileTemplateDrawerOpen: _angular_core.WritableSignal<boolean>;
    readonly sidebarCollapsed: _angular_core.WritableSignal<boolean>;
    private readonly _templateDrawerParentId;
    protected readonly closeSidebarFn: () => void;
    protected readonly closeMobileDrawerFn: () => void;
    private readonly _isMobile$;
    readonly isMobile: _angular_core.Signal<boolean>;
    protected readonly mobileLogo: _angular_core.Signal<string>;
    private readonly _routerPath;
    private readonly _currentPath;
    protected readonly overlayType: _angular_core.Signal<ZMenuOverlayType>;
    protected readonly menuProcessed: _angular_core.Signal<ZMenuProcessed>;
    protected readonly menuParents: _angular_core.Signal<ZMenuItem[]>;
    protected readonly menuChildren: _angular_core.Signal<ZMenuItem[]>;
    protected readonly selectedParentHasNoChild: _angular_core.Signal<boolean>;
    protected readonly parentWithActiveChild: _angular_core.Signal<ZMenuItem | null>;
    protected isParentOfActiveItem(item: ZMenuItem): boolean;
    protected readonly avatarSrc: _angular_core.Signal<string>;
    protected readonly customDrawerParent: _angular_core.Signal<ZMenuItem | null>;
    private readonly _defaultSidebarChildWidth;
    private readonly _defaultMobileDrawerWidth;
    protected readonly sidebarChildWidth: _angular_core.Signal<number>;
    protected readonly mobileCustomDrawerWidth: _angular_core.Signal<number>;
    constructor();
    private _emitControl;
    openMobileMenu(): void;
    closeMobileMenu(): void;
    toggleMobileMenu(): void;
    openMobileTemplateDrawer(parentId: string): void;
    closeMobileTemplateDrawer(): void;
    setSelectedMenuItem(menuId: string): void;
    clearActiveItem(): void;
    protected selectParent(item: ZMenuItem): void;
    protected onDesktopParentClick(item: ZMenuItem): void;
    protected onMenuItemClick(item: ZMenuItem): void;
    protected onMobileParentClick(item: ZMenuItem): void;
    protected toggleSidebar(): void;
    protected closeSidebar(): void;
    protected onUserActionClick(action: ZMenuUserAction): void;
    protected getVisibleUserActions(): ZMenuUserAction[];
    protected shouldShowDividerBefore(action: ZMenuUserAction, index: number): boolean;
    protected shouldShowDividerAfter(action: ZMenuUserAction, index: number): boolean;
    protected onBackdropClick(): void;
    private _findMenuItemById;
    private _findParentOfMenuItem;
    private _isChildOf;
    private _expandParentsOfItem;
    private _processMenus;
    private _findMenuItemByPath;
    private _getStateMenuCollapsed;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZMenuComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZMenuComponent, "z-menu", never, { "zLogo": { "alias": "zLogo"; "required": false; "isSignal": true; }; "zLogoMobile": { "alias": "zLogoMobile"; "required": false; "isSignal": true; }; "zMenus": { "alias": "zMenus"; "required": false; "isSignal": true; }; "zUser": { "alias": "zUser"; "required": false; "isSignal": true; }; "zUserActions": { "alias": "zUserActions"; "required": false; "isSignal": true; }; "zActionsTemplate": { "alias": "zActionsTemplate"; "required": false; "isSignal": true; }; "zCurrentPath": { "alias": "zCurrentPath"; "required": false; "isSignal": true; }; "zKey": { "alias": "zKey"; "required": false; "isSignal": true; }; }, { "zOnSelect": "zOnSelect"; "zOnMenuAction": "zOnMenuAction"; "zControl": "zControl"; }, never, never, true, never>;
}

declare class ZMenuV2Component {
    private readonly _breakpointObserver;
    private readonly _destroyRef;
    private readonly _platformId;
    private readonly _router;
    readonly zOnSelect: _angular_core.OutputEmitterRef<ZMenuItem>;
    readonly zOnMenuAction: _angular_core.OutputEmitterRef<ZMenuUserAction>;
    readonly zControl: _angular_core.OutputEmitterRef<ZMenuV2Control>;
    readonly zLogo: _angular_core.InputSignal<string>;
    readonly zLogoMobile: _angular_core.InputSignal<string>;
    readonly zMenus: _angular_core.InputSignal<ZMenuV2Item[]>;
    readonly zUser: _angular_core.InputSignal<ZMenuUser | null>;
    readonly zUserActions: _angular_core.InputSignal<ZMenuUserAction[]>;
    readonly zCurrentPath: _angular_core.InputSignal<string>;
    readonly zKey: _angular_core.InputSignal<string>;
    readonly zClass: _angular_core.InputSignal<string>;
    readonly zTitle: _angular_core.InputSignal<string>;
    readonly zCollapsedWidth: _angular_core.InputSignal<number>;
    readonly zExpandedWidth: _angular_core.InputSignal<number>;
    readonly zExpandMode: _angular_core.InputSignal<ZMenuV2ExpandMode>;
    readonly zShowMobileBar: _angular_core.InputSignal<boolean>;
    readonly selectedParent: _angular_core.WritableSignal<ZMenuItem | null>;
    readonly selectedMenuItem: _angular_core.WritableSignal<ZMenuItem | null>;
    readonly mobileMenuOpen: _angular_core.WritableSignal<boolean>;
    readonly sidebarCollapsed: _angular_core.WritableSignal<boolean>;
    private readonly _expandedIds;
    private readonly _collapsedIds;
    private readonly _renderedOpeningIds;
    private readonly _renderedClosingIds;
    private readonly _activeCacheKey;
    private readonly _hasSyncedInitialPath;
    private readonly _openingRenderTimers;
    private readonly _closingRenderTimers;
    protected readonly zClasses: _angular_core.Signal<string>;
    private readonly _isMobile$;
    readonly isMobile: _angular_core.Signal<boolean>;
    protected readonly mobileLogo: _angular_core.Signal<string>;
    protected readonly effectiveTitle: _angular_core.Signal<string>;
    protected readonly avatarSrc: _angular_core.Signal<string>;
    protected readonly visibleUserActions: _angular_core.Signal<ZMenuUserAction[]>;
    private readonly _routerPath;
    private readonly _currentPath;
    protected readonly overlayType: _angular_core.Signal<ZMenuOverlayType>;
    protected readonly menuProcessed: _angular_core.Signal<ZMenuProcessed>;
    protected readonly menuParents: _angular_core.Signal<ZMenuItem[]>;
    protected readonly parentWithActiveChild: _angular_core.Signal<ZMenuItem | null>;
    constructor();
    openMobileMenu(): void;
    closeMobileMenu(): void;
    toggleMobileMenu(): void;
    setSelectedMenuItem(menuId: string): void;
    clearActiveItem(): void;
    protected toggleSidebar(): void;
    protected onMenuItemClick(item: ZMenuItem): void;
    protected onCollapsedLeafClick(item: ZMenuItem, close: () => void): void;
    protected onCollapsedParentClick(item: ZMenuItem): void;
    protected onMobileBackdropClick(): void;
    protected onUserActionClick(action: ZMenuUserAction): void;
    private _emitControl;
    private _selectLeafItem;
    private _toggleExpanded;
    private _startOpeningRender;
    private _keepSubmenuRenderedDuringClose;
    private _stopClosingRender;
    private _expandParentsOfItem;
    private _processMenus;
    private _findMenuItemByPath;
    private _findDeepestPrefixMatch;
    private _getStateMenuCollapsed;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZMenuV2Component, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZMenuV2Component, "z-menu-v2", never, { "zLogo": { "alias": "zLogo"; "required": false; "isSignal": true; }; "zLogoMobile": { "alias": "zLogoMobile"; "required": false; "isSignal": true; }; "zMenus": { "alias": "zMenus"; "required": false; "isSignal": true; }; "zUser": { "alias": "zUser"; "required": false; "isSignal": true; }; "zUserActions": { "alias": "zUserActions"; "required": false; "isSignal": true; }; "zCurrentPath": { "alias": "zCurrentPath"; "required": false; "isSignal": true; }; "zKey": { "alias": "zKey"; "required": false; "isSignal": true; }; "zClass": { "alias": "zClass"; "required": false; "isSignal": true; }; "zTitle": { "alias": "zTitle"; "required": false; "isSignal": true; }; "zCollapsedWidth": { "alias": "zCollapsedWidth"; "required": false; "isSignal": true; }; "zExpandedWidth": { "alias": "zExpandedWidth"; "required": false; "isSignal": true; }; "zExpandMode": { "alias": "zExpandMode"; "required": false; "isSignal": true; }; "zShowMobileBar": { "alias": "zShowMobileBar"; "required": false; "isSignal": true; }; }, { "zOnSelect": "zOnSelect"; "zOnMenuAction": "zOnMenuAction"; "zControl": "zControl"; }, never, never, true, never>;
}

export { ZMenuComponent, ZMenuV2Component };
export type { ZMenuControl, ZMenuItem, ZMenuItemTemplateContext, ZMenuProcessed, ZMenuUser, ZMenuUserAction, ZMenuV2Control, ZMenuV2ExpandMode, ZMenuV2Item };
