/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

import { i as isFunction_1 } from '../../_chunks/dep-5717e263.mjs';
import { i as isString_1 } from '../../_chunks/dep-876fb3ec.mjs';
import '../../_chunks/dep-eba0ea6e.mjs';
import '../../_chunks/dep-469b4ae0.mjs';
import '../../_chunks/dep-255303ba.mjs';
import '../../_chunks/dep-a8bcacea.mjs';
import '../../_chunks/dep-b57180d0.mjs';
import '../../_chunks/dep-c8d7b6b4.mjs';
import '../../_chunks/dep-3da99438.mjs';

function getTargetElm(elm) {
  if (elm) {
    var _process, _process$env;
    var targetElement = null;
    if (isString_1(elm)) targetElement = document.querySelector(elm);else if (isFunction_1(elm)) targetElement = elm();else throw new Error("elm should be string or function");
    if (targetElement) return targetElement;
    if (((_process = process) === null || _process === void 0 ? void 0 : (_process$env = _process.env) === null || _process$env === void 0 ? void 0 : _process$env.NODE_ENV) !== "test") throw new Error("There is no element with given.");
  } else {
    return document.body;
  }
}

export { getTargetElm as default };
//# sourceMappingURL=getTargetElm.mjs.map
