import { defineComponent as x, useBrowserLocation as h, ref as y, useClipboard as k, useShare as C, computed as b, openBlock as o, createElementBlock as l, createBaseVNode as t, renderSlot as S, createVNode as c, withCtx as g, unref as s, toDisplayString as w, createCommentVNode as d } from "./composables-Ci32s3jE.js";
import { QrShow as $, UiLayer as B } from "./components.js";
const L = { class: "flex" }, N = /* @__PURE__ */ t("div", { class: "i-ion-share-outline" }, null, -1), V = { class: "flex flex-col items-center mb-4" }, Q = { class: "text-md mx-4 my-2 break-all max-w-420px" }, j = { class: "flex text-lg mt-2" }, A = {
  key: 0,
  class: "button text-lg font-normal items-center"
}, D = {
  key: 0,
  class: "ml-2"
}, E = {
  key: 1,
  class: "ml-2"
}, U = {
  key: 1,
  class: "button text-lg font-normal items-center"
}, q = /* @__PURE__ */ t("div", { class: "ml-2" }, "Send", -1), I = /* @__PURE__ */ x({
  __name: "QrShare",
  setup(z) {
    const r = h(), n = y(!1), { text: F, copy: u, copied: m, isSupported: p } = k(), { share: v, isSupported: f } = C(), a = b(() => r.value.href + r.value.search);
    return (_, e) => (o(), l("div", L, [
      t("button", {
        class: "button p-4 transition shadow-lg flex items-center justify-center",
        onClick: e[0] || (e[0] = (i) => n.value = !n.value)
      }, [
        N,
        S(_.$slots, "default")
      ]),
      c(s(B), {
        class: "text-center",
        open: n.value,
        onClose: e[3] || (e[3] = (i) => n.value = !1)
      }, {
        default: g(() => [
          c(s($), {
            class: "max-w-full",
            data: a.value
          }, null, 8, ["data"]),
          t("div", V, [
            t("div", Q, w(a.value), 1),
            t("div", j, [
              s(p) ? (o(), l("button", A, [
                t("div", {
                  class: "i-la-copy",
                  onClick: e[1] || (e[1] = (i) => s(u)(a.value))
                }),
                s(m) ? (o(), l("div", D, "Copied!")) : (o(), l("div", E, "Copy"))
              ])) : d("", !0),
              s(f) ? (o(), l("button", U, [
                t("div", {
                  class: "i-la-share",
                  onClick: e[2] || (e[2] = (i) => s(v)({ title: "Look at this", text: "A gun-vue page", url: a.value }))
                }),
                q
              ])) : d("", !0)
            ])
          ])
        ]),
        _: 1
      }, 8, ["open"])
    ]));
  }
});
export {
  I as default
};
//# sourceMappingURL=QrShare-m4v4fb-R.js.map
