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

import { i as isFunction_1 } from '../../_chunks/dep-6b22dd27.mjs';
import { i as isString_1 } from '../../_chunks/dep-1cf2b129.mjs';
import '../../_chunks/dep-a0b4a044.mjs';
import '../../_chunks/dep-c959a6fb.mjs';
import '../../_chunks/dep-b4041200.mjs';
import '../../_chunks/dep-0f0c89ff.mjs';
import '../../_chunks/dep-e3b14d70.mjs';
import '../../_chunks/dep-66d6733b.mjs';
import '../../_chunks/dep-c31e1d9e.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
