import { ref as s, computed as i, unref as l, openBlock as c, createElementBlock as u, createElementVNode as o, toDisplayString as d, createCommentVNode as m } from "vue";
const p = ["href"], h = { class: "mr-1px ml-8px" }, _ = /* @__PURE__ */ o("div", { class: "i-la-external-link-alt mx-1" }, null, -1), k = {
  __name: "UiLink",
  props: {
    url: { type: [String, Object], default: "" },
    icon: { type: [Boolean, String], default: !0 }
  },
  setup(a) {
    const r = a, e = s(!1), n = i(() => {
      if (r.url)
        try {
          let t = new URL(r.url);
          return e.value = t, t.hostname;
        } catch {
          return e.value = null, "incorrect link";
        }
      else
        return "";
    });
    return (t, f) => l(n) ? (c(), u("a", {
      key: 0,
      class: "underline flex items-center bg-light-300 dark-bg-dark-300 rounded-xl p-1 shadow-sm hover-shadow-lg transition duration-200ms hover-bg-light-5",
      href: e.value,
      target: "_blank"
    }, [
      o("div", h, d(l(n)), 1),
      _
    ], 8, p)) : m("", !0);
  }
};
export {
  k as default
};
//# sourceMappingURL=UiLink-d1ff1051.js.map
