function c(e) {
  return !!(e.addonBefore || e.addonAfter);
}
function n(e) {
  return !!(e.prefix || e.suffix || e.allowClear);
}
function o(e, a, f, u) {
  if (f) {
    var r = a;
    if (a.type === "click") {
      var t = e.cloneNode(!0);
      r = Object.create(a, {
        target: {
          value: t
        },
        currentTarget: {
          value: t
        }
      }), t.value = "", f(r);
      return;
    }
    if (u !== void 0) {
      var i = e.cloneNode(!0);
      r = Object.create(a, {
        target: {
          value: i
        },
        currentTarget: {
          value: i
        }
      }), i.type !== "file" && (i.value = u), f(r);
      return;
    }
    f(r);
  }
}
function v(e, a) {
  if (e) {
    e.focus(a);
    var f = a || {}, u = f.cursor;
    if (u) {
      var r = e.value.length;
      switch (u) {
        case "start":
          e.setSelectionRange(0, 0);
          break;
        case "end":
          e.setSelectionRange(r, r);
          break;
        default:
          e.setSelectionRange(0, r);
      }
    }
  }
}
export {
  c as hasAddon,
  n as hasPrefixSuffix,
  o as resolveOnChange,
  v as triggerFocus
};
