{"version":3,"file":"ngx-com-components-dialog.mjs","sources":["../../../projects/com/components/dialog/dialog-ref.ts","../../../projects/com/components/dialog/dialog-container-ref.token.ts","../../../projects/com/components/dialog/dialog.variants.ts","../../../projects/com/components/dialog/dialog.utils.ts","../../../projects/com/components/dialog/dialog-container.component.ts","../../../projects/com/components/dialog/dialog.providers.ts","../../../projects/com/components/dialog/dialog.models.ts","../../../projects/com/components/dialog/dialog.service.ts","../../../projects/com/components/dialog/dialog-title.directive.ts","../../../projects/com/components/dialog/dialog-content.directive.ts","../../../projects/com/components/dialog/dialog-actions.directive.ts","../../../projects/com/components/dialog/dialog-close.directive.ts","../../../projects/com/components/dialog/index.ts","../../../projects/com/components/dialog/ngx-com-components-dialog.ts"],"sourcesContent":["import { Observable, Subject } from 'rxjs';\nimport type { OverlayRef } from '@angular/cdk/overlay';\n\n/**\n * Reference to an open dialog instance.\n * Returned by `ComDialog.open()` for programmatic control.\n */\nexport class ComDialogRef<R = unknown> {\n  private readonly afterClosedSubject = new Subject<R | undefined>();\n  private readonly backdropClickSubject = new Subject<MouseEvent>();\n  private closed = false;\n\n  /** @internal */\n  _overlayRef: OverlayRef | null = null;\n\n  /** @internal */\n  _closeFn: ((result?: R) => void) | null = null;\n\n  /**\n   * Close the dialog, optionally passing a result value.\n   */\n  close(result?: R): void {\n    if (this.closed) return;\n    this._closeFn?.(result);\n  }\n\n  /**\n   * Emits the result once after the dialog is fully closed and disposed.\n   */\n  afterClosed(): Observable<R | undefined> {\n    return this.afterClosedSubject.asObservable();\n  }\n\n  /**\n   * Emits each time the backdrop is clicked.\n   */\n  backdropClick(): Observable<MouseEvent> {\n    return this.backdropClickSubject.asObservable();\n  }\n\n  /**\n   * Proxies keydown events from the overlay.\n   */\n  keydownEvents(): Observable<KeyboardEvent> {\n    return this._overlayRef?.keydownEvents() ?? new Observable();\n  }\n\n  /** @internal Called by the service after exit animation completes. */\n  _notifyClosed(result?: R): void {\n    if (this.closed) return;\n    this.closed = true;\n    this.afterClosedSubject.next(result);\n    this.afterClosedSubject.complete();\n    this.backdropClickSubject.complete();\n  }\n\n  /** @internal Forward backdrop click from overlay. */\n  _notifyBackdropClick(event: MouseEvent): void {\n    this.backdropClickSubject.next(event);\n  }\n}\n","import { InjectionToken } from '@angular/core';\n\n/** Interface for the dialog container that directives can register with. */\nexport interface DialogContainerRef {\n  registerTitleId(id: string): void;\n  registerContentId(id: string): void;\n}\n\n/**\n * Injection token allowing dialog directives to register their element IDs\n * with the container for ARIA binding.\n * @internal\n */\nexport const COM_DIALOG_CONTAINER_REF: InjectionToken<DialogContainerRef> =\n  new InjectionToken<DialogContainerRef>('COM_DIALOG_CONTAINER_REF');\n","import { cva } from 'class-variance-authority';\nimport type { VariantProps } from 'class-variance-authority';\n\n/**\n * CVA variants for the dialog backdrop.\n *\n * @tokens `--color-backdrop`\n */\nexport const dialogBackdropVariants: (props?: {\n  visible?: boolean;\n}) => string = cva(\n  [\n    'fixed',\n    'inset-0',\n    'z-50',\n    'bg-backdrop',\n    'backdrop-blur-sm',\n  ],\n  {\n    variants: {\n      visible: {\n        true: 'animate-in fade-in-0',\n        false: 'animate-out fade-out-0',\n      },\n    },\n    defaultVariants: {\n      visible: true,\n    },\n  },\n);\n\n/**\n * CVA variants for the dialog panel container.\n *\n * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`,\n *         `--shadow-dialog`, `--radius-overlay`\n */\nexport const dialogPanelVariants: (props?: {\n  size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';\n  visible?: boolean;\n}) => string = cva(\n  [\n    'com-dialog-panel',\n    'fixed',\n    'left-1/2',\n    'top-1/2',\n    '-translate-x-1/2',\n    '-translate-y-1/2',\n    'z-50',\n    'flex',\n    'flex-col',\n    'border',\n    'border-border',\n    'bg-popover',\n    'text-popover-foreground',\n    'shadow-dialog',\n    'rounded-overlay',\n    'outline-none',\n  ],\n  {\n    variants: {\n      size: {\n        sm: 'w-full max-w-sm max-h-[85vh] p-6',\n        md: 'w-full max-w-lg max-h-[85vh] p-6',\n        lg: 'w-full max-w-2xl max-h-[85vh] p-6',\n        xl: 'w-full max-w-4xl max-h-[85vh] p-6',\n        full: 'w-screen h-screen max-w-none max-h-none rounded-none border-none p-6',\n      },\n      visible: {\n        true: 'animate-in fade-in-0 zoom-in-95',\n        false: 'animate-out fade-out-0 zoom-out-95',\n      },\n    },\n    defaultVariants: {\n      size: 'md',\n      visible: true,\n    },\n  },\n);\n\n/** Type helper for dialog panel variant props. */\nexport type DialogPanelVariantProps = VariantProps<typeof dialogPanelVariants>;\n\n/**\n * CVA variants for the dialog title.\n *\n * @tokens `--color-foreground`\n */\nexport const dialogTitleVariants: () => string = cva([\n  'font-heading',\n  'text-lg',\n  'font-semibold',\n  'tracking-tight',\n  'text-foreground',\n]);\n\n/**\n * CVA variants for the dialog content area.\n *\n * @tokens `--color-muted-foreground`\n */\nexport const dialogContentVariants: () => string = cva([\n  'flex-1',\n  'overflow-y-auto',\n  'py-4',\n  'text-sm',\n  'text-muted-foreground',\n]);\n\n/**\n * CVA variants for the dialog actions area.\n */\nexport const dialogActionsVariants: () => string = cva([\n  'flex',\n  'flex-col-reverse',\n  'sm:flex-row',\n  'sm:justify-end',\n  'gap-2',\n  'pt-4',\n]);\n","export { mergeClasses } from 'ngx-com/utils';\n\nlet dialogIdCounter = 0;\n\n/** Generate a unique ID for a dialog title element. */\nexport function generateDialogTitleId(): string {\n  return `com-dialog-title-${++dialogIdCounter}`;\n}\n\n/** Generate a unique ID for a dialog content element. */\nexport function generateDialogContentId(): string {\n  return `com-dialog-content-${++dialogIdCounter}`;\n}\n","import {\n  ChangeDetectionStrategy,\n  Component,\n  computed,\n  ElementRef,\n  forwardRef,\n  inject,\n  Injector,\n  signal,\n  viewChild,\n} from '@angular/core';\nimport type { AfterViewInit, Signal, TemplateRef, WritableSignal } from '@angular/core';\nimport { NgComponentOutlet, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';\nimport type { ComponentType } from '@angular/cdk/portal';\nimport { ComDialogRef } from './dialog-ref';\n\nimport { COM_DIALOG_CONTAINER_REF, type DialogContainerRef } from './dialog-container-ref.token';\nimport { dialogBackdropVariants, dialogPanelVariants } from './dialog.variants';\nimport { mergeClasses } from './dialog.utils';\nimport type {\n  ComDialogResolvedConfig,\n  ComDialogTemplateContext,\n} from './dialog.models';\n\n/** Fallback timeout for exit animation when animationend doesn't fire. */\nconst ANIMATION_FALLBACK_MS = 200;\n\n/** Convert a dimension value to a CSS string. Numbers default to pixels. */\nfunction toCssValue(value: string | number): string {\n  return typeof value === 'number' ? `${value}px` : value;\n}\n\n/**\n * Internal dialog container component rendered inside the CDK overlay.\n * Hosts the user's component or template and manages focus trap, animation, and ARIA.\n *\n * @internal Not exported in public API\n *\n * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`,\n *         `--color-foreground`, `--color-muted-foreground`, `--color-backdrop`,\n *         `--shadow-dialog`, `--radius-overlay`, `--font-heading`\n */\n@Component({\n  selector: 'com-dialog-container',\n  template: `\n    @if (config()?.hasBackdrop) {\n      <div\n        [class]=\"backdropClasses()\"\n        [attr.data-state]=\"visible() ? 'open' : 'closed'\"\n        aria-hidden=\"true\"\n        (click)=\"onBackdropClick($event)\"\n      ></div>\n    }\n    <div\n      #panelElement\n      [class]=\"panelClasses()\"\n      [ngStyle]=\"panelStyles()\"\n      [attr.role]=\"config()?.role ?? 'dialog'\"\n      aria-modal=\"true\"\n      [attr.aria-labelledby]=\"titleId() || null\"\n      [attr.aria-describedby]=\"contentId() || null\"\n      [attr.aria-label]=\"!titleId() && config()?.ariaLabel ? config()!.ariaLabel : null\"\n      [attr.data-state]=\"visible() ? 'open' : 'closed'\"\n      tabindex=\"-1\"\n      (animationend)=\"onAnimationEnd()\"\n    >\n      @if (isTemplate()) {\n        <ng-container\n          [ngTemplateOutlet]=\"templateContent()!\"\n          [ngTemplateOutletContext]=\"templateContext()\"\n          [ngTemplateOutletInjector]=\"hostInjector\"\n        />\n      } @else if (componentContent(); as comp) {\n        @if (contentInjector(); as inj) {\n          <ng-container\n            *ngComponentOutlet=\"comp; injector: inj\"\n          />\n        }\n      }\n    </div>\n  `,\n  styles: `\n    :host {\n      display: contents;\n    }\n\n    [data-state='open'] {\n      --tw-enter-opacity: 0;\n      --tw-enter-scale: 0.95;\n    }\n\n    [data-state='closed'] {\n      --tw-exit-opacity: 0;\n      --tw-exit-scale: 0.95;\n    }\n\n    @media (prefers-reduced-motion: reduce) {\n      [data-state='open'],\n      [data-state='closed'] {\n        animation: none;\n      }\n    }\n  `,\n  imports: [NgTemplateOutlet, NgComponentOutlet, NgStyle],\n  providers: [\n    { provide: COM_DIALOG_CONTAINER_REF, useExisting: forwardRef(() => ComDialogContainerComponent) },\n  ],\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ComDialogContainerComponent implements AfterViewInit, DialogContainerRef {\n  /** @internal Injector for template outlet so directives can resolve container tokens. */\n  protected readonly hostInjector: Injector = inject(Injector);\n  private readonly focusTrapFactory = inject(FocusTrapFactory);\n  private focusTrap: FocusTrap | null = null;\n  private animationFallback: ReturnType<typeof setTimeout> | null = null;\n  private closing = false;\n  private pendingResult: unknown = undefined;\n\n  private readonly panelElement = viewChild<ElementRef<HTMLElement>>('panelElement');\n\n  /** Resolved dialog configuration, set by the service. */\n  readonly config: WritableSignal<ComDialogResolvedConfig | null> = signal(null);\n\n  /** Whether the panel is visible (for animation state). */\n  readonly visible: WritableSignal<boolean> = signal(false);\n\n  /** The dialog ref for this instance, set by the service. */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  readonly dialogRef: WritableSignal<ComDialogRef<any> | null> = signal(null);\n\n  /** Injector for content component, set by the service. */\n  readonly contentInjector: WritableSignal<Injector | null> = signal(null);\n\n  // ─── Content signals (set by service) ───\n\n  /** Whether the content is a TemplateRef. */\n  readonly isTemplate: WritableSignal<boolean> = signal(false);\n\n  /** Template ref content (when isTemplate is true). */\n  readonly templateContent: WritableSignal<TemplateRef<unknown> | null> = signal(null);\n\n  /** Component type content (when isTemplate is false). */\n  readonly componentContent: WritableSignal<ComponentType<unknown> | null> = signal(null);\n\n  // ─── ARIA ID registration ───\n\n  /** ID of the title directive for aria-labelledby. */\n  readonly titleId: WritableSignal<string> = signal('');\n\n  /** ID of the content directive for aria-describedby. */\n  readonly contentId: WritableSignal<string> = signal('');\n\n  /** Register a title element ID (called by ComDialogTitle directive). */\n  registerTitleId(id: string): void {\n    this.titleId.set(id);\n  }\n\n  /** Register a content element ID (called by ComDialogContent directive). */\n  registerContentId(id: string): void {\n    this.contentId.set(id);\n  }\n\n  // ─── Computed classes ───\n\n  protected readonly backdropClasses: Signal<string> = computed(() =>\n    mergeClasses(\n      dialogBackdropVariants({ visible: this.visible() }),\n      this.config()?.backdropClass ?? '',\n    ),\n  );\n\n  protected readonly panelClasses: Signal<string> = computed(() =>\n    mergeClasses(\n      dialogPanelVariants({\n        size: this.config()?.size ?? 'md',\n        visible: this.visible(),\n      }),\n      this.config()?.panelClass ?? '',\n    ),\n  );\n\n  /**\n   * Inline styles for dimension overrides on the panel element.\n   * When set, these override CVA size variant dimensions via CSS specificity.\n   */\n  protected readonly panelStyles: Signal<Record<string, string> | null> = computed(() => {\n    const c = this.config();\n    if (!c) return null;\n    const styles: Record<string, string> = {};\n    if (c.width != null) styles['width'] = c.width;\n    if (c.height != null) styles['height'] = c.height;\n    if (c.minWidth != null) styles['min-width'] = toCssValue(c.minWidth);\n    if (c.minHeight != null) styles['min-height'] = toCssValue(c.minHeight);\n    if (c.maxWidth != null) styles['max-width'] = toCssValue(c.maxWidth);\n    if (c.maxHeight != null) styles['max-height'] = toCssValue(c.maxHeight);\n    return Object.keys(styles).length > 0 ? styles : null;\n  });\n\n  /** Template context for TemplateRef-based dialogs. */\n  protected readonly templateContext: Signal<ComDialogTemplateContext> = computed(() => ({\n    $implicit: this.dialogRef()!,\n    data: this.config()?.data,\n  }));\n\n  ngAfterViewInit(): void {\n    this.setupFocusTrap();\n  }\n\n  /** Handle backdrop click. */\n  protected onBackdropClick(event: MouseEvent): void {\n    const ref = this.dialogRef();\n    if (ref) {\n      ref._notifyBackdropClick(event);\n    }\n    if (!this.config()?.disableClose) {\n      this.dialogRef()?.close();\n    }\n  }\n\n  /** Start the close animation sequence. */\n  startClose(result?: unknown): void {\n    if (this.closing) return;\n    this.closing = true;\n    this.pendingResult = result;\n    this.visible.set(false);\n\n    // Fallback in case animationend doesn't fire\n    this.animationFallback = setTimeout(() => this.finishClose(), ANIMATION_FALLBACK_MS);\n  }\n\n  /** Handle animation end on the panel. */\n  protected onAnimationEnd(): void {\n    if (this.closing) {\n      this.finishClose();\n    }\n  }\n\n  /** Clean up focus trap. */\n  destroyFocusTrap(): void {\n    this.focusTrap?.destroy();\n    this.focusTrap = null;\n  }\n\n  private finishClose(): void {\n    if (this.animationFallback !== null) {\n      clearTimeout(this.animationFallback);\n      this.animationFallback = null;\n    }\n    this.destroyFocusTrap();\n    this.dialogRef()?._notifyClosed(this.pendingResult);\n  }\n\n  private setupFocusTrap(): void {\n    const panelEl = this.panelElement()?.nativeElement;\n    if (!panelEl) return;\n\n    this.focusTrap = this.focusTrapFactory.create(panelEl);\n\n    const autoFocus = this.config()?.autoFocus ?? 'first-tabbable';\n    if (autoFocus === 'first-tabbable') {\n      this.focusTrap.focusInitialElementWhenReady();\n    } else if (autoFocus === 'dialog') {\n      panelEl.focus();\n    }\n    // autoFocus === false: don't move focus\n  }\n}\n","import { InjectionToken } from '@angular/core';\nimport type { Provider } from '@angular/core';\nimport type { ComDialogConfig } from './dialog.models';\n\n/**\n * Injection token for data passed to a dialog component.\n *\n * @example\n * ```typescript\n * readonly data = inject<MyData>(COM_DIALOG_DATA);\n * ```\n */\nexport const COM_DIALOG_DATA: InjectionToken<unknown> =\n  new InjectionToken<unknown>('COM_DIALOG_DATA');\n\n/**\n * Injection token for global dialog configuration defaults.\n * @internal\n */\nexport const COM_DIALOG_CONFIG: InjectionToken<ComDialogConfig> =\n  new InjectionToken<ComDialogConfig>('COM_DIALOG_CONFIG');\n\n/**\n * Provides global dialog configuration defaults.\n *\n * @example\n * ```typescript\n * bootstrapApplication(AppComponent, {\n *   providers: [\n *     provideComDialogConfig({ size: 'lg', hasBackdrop: true }),\n *   ],\n * });\n * ```\n */\nexport function provideComDialogConfig(config: ComDialogConfig): Provider {\n  return { provide: COM_DIALOG_CONFIG, useValue: config };\n}\n","import type { Injector, StaticProvider, TemplateRef, ViewContainerRef } from '@angular/core';\nimport type { PositionStrategy, ScrollStrategy } from '@angular/cdk/overlay';\nimport type { ComponentType } from '@angular/cdk/portal';\n\n/** Available dialog size variants. */\nexport type ComDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';\n\n/** ARIA role for the dialog panel. */\nexport type ComDialogRole = 'dialog' | 'alertdialog';\n\n/** Where to restore focus after the dialog closes. */\nexport type ComRestoreFocusTarget = boolean | string | HTMLElement;\n\n/** Configuration for opening a dialog. */\nexport interface ComDialogConfig<D = unknown> {\n  /** Data to inject via COM_DIALOG_DATA. */\n  data?: D;\n  /** Dialog panel width variant. */\n  size?: ComDialogSize;\n  /** Prevent Escape and backdrop click from closing. */\n  disableClose?: boolean;\n  /** Show backdrop overlay. */\n  hasBackdrop?: boolean;\n  /** Additional CSS class(es) on the backdrop. */\n  backdropClass?: string | string[];\n  /** Additional CSS class(es) on the container panel. */\n  panelClass?: string | string[];\n  /** Where to send focus on open. */\n  autoFocus?: 'first-tabbable' | 'dialog' | false;\n  /**\n   * Controls focus restoration after the dialog closes.\n   * - `true`: restore focus to the previously focused element (default).\n   * - `false`: do not restore focus.\n   * - `string`: CSS selector — the first matching element receives focus.\n   * - `HTMLElement`: the specific element receives focus.\n   */\n  restoreFocus?: ComRestoreFocusTarget;\n  /** Fallback aria-label if no comDialogTitle is projected. */\n  ariaLabel?: string;\n  /** ARIA role on the dialog panel. Use `'alertdialog'` for confirmations/destructive actions. */\n  role?: ComDialogRole;\n  /**\n   * Custom parent injector for dialog content.\n   * Takes precedence over `viewContainerRef` injector.\n   */\n  injector?: Injector;\n  /**\n   * Determines logical Angular tree placement for DI resolution.\n   * Its injector is used as parent when `injector` is not set.\n   */\n  viewContainerRef?: ViewContainerRef;\n  /** Additional providers injected into the dialog content's injector. */\n  providers?: StaticProvider[];\n  /** Custom CDK position strategy. Defaults to globally centered. */\n  positionStrategy?: PositionStrategy;\n  /** Custom CDK scroll strategy. Defaults to block scroll. */\n  scrollStrategy?: ScrollStrategy;\n  /** Explicit CSS width on the panel (e.g. `'600px'`, `'80vw'`). Overrides size variant width. */\n  width?: string;\n  /** Explicit CSS height on the panel. */\n  height?: string;\n  /** CSS min-width on the panel. Numbers are treated as pixels. */\n  minWidth?: string | number;\n  /** CSS min-height on the panel. Numbers are treated as pixels. */\n  minHeight?: string | number;\n  /** CSS max-width on the panel. Numbers are treated as pixels. Overrides size variant max-width. */\n  maxWidth?: string | number;\n  /** CSS max-height on the panel. Numbers are treated as pixels. Overrides size variant max-height. */\n  maxHeight?: string | number;\n}\n\n/** Resolved config with defaults applied. Strategy/injector/dimension fields remain optional. */\nexport interface ComDialogResolvedConfig<D = unknown> {\n  data: D | undefined;\n  size: ComDialogSize;\n  disableClose: boolean;\n  hasBackdrop: boolean;\n  backdropClass: string | string[];\n  panelClass: string | string[];\n  autoFocus: 'first-tabbable' | 'dialog' | false;\n  restoreFocus: ComRestoreFocusTarget;\n  ariaLabel: string;\n  role: ComDialogRole;\n  injector?: Injector;\n  viewContainerRef?: ViewContainerRef;\n  providers?: StaticProvider[];\n  positionStrategy?: PositionStrategy;\n  scrollStrategy?: ScrollStrategy;\n  width?: string;\n  height?: string;\n  minWidth?: string | number;\n  minHeight?: string | number;\n  maxWidth?: string | number;\n  maxHeight?: string | number;\n}\n\n/** Default dialog configuration values. */\nexport const COM_DIALOG_DEFAULTS: ComDialogResolvedConfig = {\n  data: undefined,\n  size: 'md',\n  disableClose: false,\n  hasBackdrop: true,\n  backdropClass: '',\n  panelClass: '',\n  autoFocus: 'first-tabbable',\n  restoreFocus: true,\n  ariaLabel: '',\n  role: 'dialog',\n};\n\n/** Content that can be opened in a dialog. */\nexport type ComDialogContent<T = unknown> = ComponentType<T> | TemplateRef<T>;\n\n/** Template context when opening a TemplateRef dialog. */\nexport interface ComDialogTemplateContext<R = unknown, D = unknown> {\n  $implicit: import('./dialog-ref').ComDialogRef<R>;\n  data: D;\n}\n\n/** @internal Data passed to the dialog container. */\nexport interface ComDialogContainerData<D = unknown> {\n  content: ComDialogContent;\n  config: ComDialogResolvedConfig<D>;\n  isTemplate: boolean;\n}\n","import {\n  inject,\n  Injectable,\n  Injector,\n  PLATFORM_ID,\n  TemplateRef,\n} from '@angular/core';\nimport type { ComponentType } from '@angular/cdk/portal';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { Overlay } from '@angular/cdk/overlay';\n\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { filter, takeUntil } from 'rxjs/operators';\nimport { ComDialogRef } from './dialog-ref';\nimport { ComDialogContainerComponent } from './dialog-container.component';\nimport { COM_DIALOG_CONFIG, COM_DIALOG_DATA } from './dialog.providers';\nimport { COM_DIALOG_DEFAULTS } from './dialog.models';\nimport type {\n  ComDialogConfig,\n  ComDialogContent,\n  ComDialogResolvedConfig,\n} from './dialog.models';\n\n/**\n * Service for opening dialog modals imperatively.\n *\n * @example\n * ```typescript\n * const dialog = inject(ComDialog);\n *\n * // Open a component\n * const ref = dialog.open<boolean>(ConfirmComponent, { data: { id: 123 } });\n * ref.afterClosed().subscribe(result => {\n *   if (result) performAction();\n * });\n *\n * // Open a template\n * dialog.open(templateRef, { size: 'sm' });\n * ```\n */\n@Injectable({ providedIn: 'root' })\nexport class ComDialog {\n  private readonly overlay = inject(Overlay);\n  private readonly injector = inject(Injector);\n  private readonly platformId = inject(PLATFORM_ID);\n  private readonly document = inject(DOCUMENT);\n  private readonly globalConfig = inject(COM_DIALOG_CONFIG, { optional: true });\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private readonly openDialogs: ComDialogRef<any>[] = [];\n\n  /**\n   * Open a dialog with the given component or template.\n   *\n   * @param content - The component class or TemplateRef to render inside the dialog.\n   * @param config - Optional dialog configuration.\n   * @returns A reference to the opened dialog.\n   */\n  open<R = unknown, D = unknown>(\n    content: ComDialogContent,\n    config?: ComDialogConfig<D>,\n  ): ComDialogRef<R> {\n    if (!isPlatformBrowser(this.platformId)) {\n      return new ComDialogRef<R>();\n    }\n\n    const resolvedConfig = this.resolveConfig(config);\n    const previouslyFocused = this.document.activeElement as HTMLElement | null;\n\n    // Create the dialog ref\n    const dialogRef = new ComDialogRef<R>();\n\n    // Create a child injector with dialog-specific providers\n    const isTemplate = content instanceof TemplateRef;\n\n    // Resolve parent injector: config.injector > config.viewContainerRef.injector > service injector\n    const parentInjector =\n      resolvedConfig.injector ??\n      resolvedConfig.viewContainerRef?.injector ??\n      this.injector;\n\n    const contentInjector = Injector.create({\n      providers: [\n        ...(resolvedConfig.providers ?? []),\n        { provide: ComDialogRef, useValue: dialogRef },\n        { provide: COM_DIALOG_DATA, useValue: resolvedConfig.data },\n      ],\n      parent: parentInjector,\n    });\n\n    // Create CDK overlay\n    const positionStrategy = resolvedConfig.positionStrategy ??\n      this.overlay\n        .position()\n        .global()\n        .centerHorizontally()\n        .centerVertically();\n\n    const overlayRef = this.overlay.create({\n      positionStrategy,\n      scrollStrategy: resolvedConfig.scrollStrategy ?? this.overlay.scrollStrategies.block(),\n      hasBackdrop: false, // We handle backdrop ourselves for animation control\n      panelClass: 'com-dialog-overlay',\n      disposeOnNavigation: false,\n    });\n\n    dialogRef._overlayRef = overlayRef;\n\n    // Attach the container component\n    const portal = new ComponentPortal(\n      ComDialogContainerComponent,\n      null,\n      contentInjector,\n    );\n    const containerComponentRef = overlayRef.attach(portal);\n    const container = containerComponentRef.instance;\n\n    // Configure the container\n    container.config.set(resolvedConfig);\n    container.dialogRef.set(dialogRef);\n    container.isTemplate.set(isTemplate);\n\n    if (isTemplate) {\n      container.templateContent.set(content as TemplateRef<unknown>);\n    } else {\n      container.componentContent.set(content as ComponentType<unknown>);\n      container.contentInjector.set(contentInjector);\n    }\n\n    // Wire up the close function\n    dialogRef._closeFn = (result?: R) => {\n      container.startClose(result);\n    };\n\n    // Subscribe to Escape key\n    overlayRef\n      .keydownEvents()\n      .pipe(\n        filter((event) => event.key === 'Escape'),\n        takeUntil(dialogRef.afterClosed()),\n      )\n      .subscribe((event) => {\n        if (!resolvedConfig.disableClose) {\n          event.preventDefault();\n          event.stopPropagation();\n          dialogRef.close();\n        }\n      });\n\n    // Track open dialog\n    this.openDialogs.push(dialogRef);\n\n    // Clean up after close\n    dialogRef.afterClosed().subscribe(() => {\n      const idx = this.openDialogs.indexOf(dialogRef);\n      if (idx !== -1) {\n        this.openDialogs.splice(idx, 1);\n      }\n      overlayRef.dispose();\n\n      // Restore focus\n      const { restoreFocus } = resolvedConfig;\n      if (restoreFocus === true && previouslyFocused) {\n        previouslyFocused.focus();\n      } else if (typeof restoreFocus === 'string') {\n        (this.document.querySelector(restoreFocus) as HTMLElement | null)?.focus();\n      } else if (restoreFocus instanceof HTMLElement) {\n        restoreFocus.focus();\n      }\n    });\n\n    // Show panel after a microtask to allow initial styles to apply\n    requestAnimationFrame(() => {\n      container.visible.set(true);\n    });\n\n    return dialogRef;\n  }\n\n  /** Close all open dialogs. */\n  closeAll(): void {\n    for (const ref of [...this.openDialogs]) {\n      ref.close();\n    }\n  }\n\n  /** Number of currently open dialogs. */\n  get openDialogCount(): number {\n    return this.openDialogs.length;\n  }\n\n  private resolveConfig<D>(config?: ComDialogConfig<D>): ComDialogResolvedConfig<D> {\n    return {\n      ...COM_DIALOG_DEFAULTS,\n      ...this.globalConfig,\n      ...config,\n    } as ComDialogResolvedConfig<D>;\n  }\n}\n","import { Directive, inject, signal } from '@angular/core';\nimport type { OnInit, WritableSignal } from '@angular/core';\nimport { generateDialogTitleId } from './dialog.utils';\nimport { COM_DIALOG_CONTAINER_REF } from './dialog-container-ref.token';\nimport { dialogTitleVariants } from './dialog.variants';\nimport { mergeClasses } from './dialog.utils';\n\n/**\n * Marks an element as the dialog title. Sets up aria-labelledby\n * binding on the dialog container.\n *\n * @example\n * ```html\n * <h2 comDialogTitle>Delete item</h2>\n * ```\n *\n * @tokens `--color-foreground`\n */\n@Directive({\n  selector: '[comDialogTitle]',\n  exportAs: 'comDialogTitle',\n  host: {\n    '[id]': 'id()',\n    '[class]': 'classes()',\n  },\n})\nexport class ComDialogTitle implements OnInit {\n  private readonly containerRef = inject(COM_DIALOG_CONTAINER_REF, { optional: true });\n\n  /** Unique ID for aria-labelledby binding. */\n  readonly id: WritableSignal<string> = signal(generateDialogTitleId());\n\n  /** Computed CSS classes. */\n  readonly classes: WritableSignal<string> = signal(mergeClasses(dialogTitleVariants()));\n\n  ngOnInit(): void {\n    this.containerRef?.registerTitleId(this.id());\n  }\n}\n","import { Directive, inject, signal } from '@angular/core';\nimport type { OnInit, WritableSignal } from '@angular/core';\nimport { generateDialogContentId } from './dialog.utils';\nimport { COM_DIALOG_CONTAINER_REF } from './dialog-container-ref.token';\nimport { dialogContentVariants } from './dialog.variants';\nimport { mergeClasses } from './dialog.utils';\n\n/**\n * Marks an element as the dialog content area. Sets up aria-describedby\n * binding on the dialog container.\n *\n * @example\n * ```html\n * <div comDialogContent>\n *   <p>Are you sure you want to delete this item?</p>\n * </div>\n * ```\n *\n * @tokens `--color-muted-foreground`\n */\n@Directive({\n  selector: '[comDialogContent]',\n  exportAs: 'comDialogContent',\n  host: {\n    '[id]': 'id()',\n    '[class]': 'classes()',\n  },\n})\nexport class ComDialogContent implements OnInit {\n  private readonly containerRef = inject(COM_DIALOG_CONTAINER_REF, { optional: true });\n\n  /** Unique ID for aria-describedby binding. */\n  readonly id: WritableSignal<string> = signal(generateDialogContentId());\n\n  /** Computed CSS classes. */\n  readonly classes: WritableSignal<string> = signal(mergeClasses(dialogContentVariants()));\n\n  ngOnInit(): void {\n    this.containerRef?.registerContentId(this.id());\n  }\n}\n","import { Directive, signal } from '@angular/core';\nimport type { WritableSignal } from '@angular/core';\nimport { dialogActionsVariants } from './dialog.variants';\nimport { mergeClasses } from './dialog.utils';\n\n/**\n * Marks an element as the dialog actions area (footer with buttons).\n *\n * @tokens none\n *\n * @example\n * ```html\n * <div comDialogActions>\n *   <button comButton variant=\"outline\" [comDialogClose]=\"false\">Cancel</button>\n *   <button comButton [comDialogClose]=\"true\">Confirm</button>\n * </div>\n * ```\n */\n@Directive({\n  selector: '[comDialogActions]',\n  exportAs: 'comDialogActions',\n  host: {\n    '[class]': 'classes()',\n  },\n})\nexport class ComDialogActions {\n  /** Computed CSS classes. */\n  readonly classes: WritableSignal<string> = signal(mergeClasses(dialogActionsVariants()));\n}\n","import { Directive, inject, input } from '@angular/core';\nimport type { InputSignal } from '@angular/core';\nimport { ComDialogRef } from './dialog-ref';\n\n/**\n * Closes the nearest dialog when the host element is clicked.\n * Optionally passes a result value.\n *\n * @tokens none\n *\n * @example\n * ```html\n * <button comButton [comDialogClose]=\"false\">Cancel</button>\n * <button comButton [comDialogClose]=\"true\">Confirm</button>\n * ```\n */\n@Directive({\n  selector: '[comDialogClose]',\n  exportAs: 'comDialogClose',\n  host: {\n    '(click)': 'onClick()',\n  },\n})\nexport class ComDialogClose {\n  private readonly dialogRef = inject(ComDialogRef);\n\n  /** The result value to pass when closing the dialog. */\n  readonly comDialogClose: InputSignal<unknown> = input<unknown>(undefined);\n\n  protected onClick(): void {\n    this.dialogRef.close(this.comDialogClose());\n  }\n}\n","// Public API for the dialog system\n\n// Service\nexport { ComDialog } from './dialog.service';\n\n// Ref\nexport { ComDialogRef } from './dialog-ref';\n\n// Directives\nexport { ComDialogTitle } from './dialog-title.directive';\nexport { ComDialogContent } from './dialog-content.directive';\nexport { ComDialogActions } from './dialog-actions.directive';\nexport { ComDialogClose } from './dialog-close.directive';\n\n// Types\nexport type {\n  ComDialogConfig,\n  ComDialogSize,\n  ComDialogRole,\n  ComRestoreFocusTarget,\n  ComDialogTemplateContext,\n} from './dialog.models';\n\n// Providers\nexport { COM_DIALOG_DATA, COM_DIALOG_CONFIG, provideComDialogConfig } from './dialog.providers';\n\n// Variants (for advanced customization)\nexport {\n  dialogBackdropVariants,\n  dialogPanelVariants,\n  dialogTitleVariants,\n  dialogContentVariants,\n  dialogActionsVariants,\n} from './dialog.variants';\nexport type { DialogPanelVariantProps } from './dialog.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAGA;;;AAGG;MACU,YAAY,CAAA;AACN,IAAA,kBAAkB,GAAG,IAAI,OAAO,EAAiB;AACjD,IAAA,oBAAoB,GAAG,IAAI,OAAO,EAAc;IACzD,MAAM,GAAG,KAAK;;IAGtB,WAAW,GAAsB,IAAI;;IAGrC,QAAQ,GAAkC,IAAI;AAE9C;;AAEG;AACH,IAAA,KAAK,CAAC,MAAU,EAAA;QACd,IAAI,IAAI,CAAC,MAAM;YAAE;AACjB,QAAA,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;IACzB;AAEA;;AAEG;IACH,WAAW,GAAA;AACT,QAAA,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE;IAC/C;AAEA;;AAEG;IACH,aAAa,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,oBAAoB,CAAC,YAAY,EAAE;IACjD;AAEA;;AAEG;IACH,aAAa,GAAA;QACX,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,IAAI,IAAI,UAAU,EAAE;IAC9D;;AAGA,IAAA,aAAa,CAAC,MAAU,EAAA;QACtB,IAAI,IAAI,CAAC,MAAM;YAAE;AACjB,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI;AAClB,QAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC;AACpC,QAAA,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE;AAClC,QAAA,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE;IACtC;;AAGA,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