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