import { LAYER } from '@cainiaofe/cn-domain-popup';
import { isBirda } from './env/index.js';
/**
 * Unified z-index for page-level floating layers (CnPopup, CnTooltip, etc.).
 *
 * Sourced from `@cainiaofe/cn-domain-popup` LAYER tokens so the value stays in
 * sync with the Popup library.  The number must be:
 *   - above Grid header sticky (~10) and Sender schema dropdowns (~1050)
 *   - below LAYER.modal (legacy cn-ui Dialog/Modal range)
 *
 * SCSS files that hardcode `z-index` should reference the same numeric value.
 */
export const FLOATING_LAYER_Z_INDEX = LAYER.popup;
/** Popup / CnPopup container – Birda mounts to scroll wrapper, others to body */
export function getPopupContainer() {
    return isBirda()
        ? document.querySelector('#cn-ui-page-scroll-container') || document.body
        : document.body;
}
/**
 * Legacy helper for CnPopup (cn-ui overlay system).
 * Kept for backward compatibility with ConditionPanel / CnAiFilter.
 */
export const cnPopupFloatingLayerOverlayProps = {
    overlayProps: { style: { zIndex: FLOATING_LAYER_Z_INDEX } },
};
