"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "selectText", {
    enumerable: true,
    get: function() {
        return selectText;
    }
});
const _utils = require("../../../utils");
const selectText = (node)=>{
    if (!_utils.canUseDOM) {
        return;
    }
    setTimeout(()=>{
        const body = document.body;
        if (window.getSelection && document.createRange) {
            const range = document.createRange();
            range.selectNodeContents(node);
            const selection = window.getSelection();
            selection?.removeAllRanges();
            selection?.addRange(range);
        } else if (body.createTextRange) {
            const range = body.createTextRange();
            range.moveToElementText(node);
            range.select();
        }
    });
};
