import { ref as o, watchEffect as _, openBlock as f, createElementBlock as m, createBaseVNode as e, normalizeClass as x, createVNode as k, withCtx as b, withDirectives as h, vModelText as w, unref as C, pushScopeId as y, popScopeId as I } from "./composables-Ci32s3jE.js";
import { UiLayer as L } from "./components.js";
import { _export_sfc as V } from "./_plugin-vue_export-helper-DueaC3du.js";
const c = (n) => (y("data-v-d9417bae"), n = n(), I(), n), $ = { class: "flex flex-wrap" }, g = /* @__PURE__ */ c(() => /* @__PURE__ */ e("div", { class: "i-la-link" }, null, -1)), B = [
  g
], S = { class: "p-4 max-w-600px" }, U = { class: "flex items-center gap-4" }, E = /* @__PURE__ */ c(() => /* @__PURE__ */ e("div", { class: "i-la-link text-2xl" }, null, -1)), F = /* @__PURE__ */ c(() => /* @__PURE__ */ e("div", { class: "text-lg" }, "Add a link", -1)), N = { class: "button text-xl" }, z = { class: "button text-xl" }, A = {
  __name: "FormLink",
  emits: ["update"],
  setup(n, { emit: r }) {
    const l = o(), s = o(), i = o(), v = o(!1), d = o(), p = r;
    return _(() => {
      var u;
      s.value ? (v.value = (u = i == null ? void 0 : i.value) == null ? void 0 : u.checkValidity(), v.value && (d.value = s.value, p("update", s.value))) : d.value = null;
    }), (u, t) => (f(), m("div", $, [
      e("button", {
        class: x(["button m-1", { active: d.value }]),
        onClick: t[0] || (t[0] = (a) => l.value = !l.value)
      }, B, 2),
      k(C(L), {
        class: "mt-20",
        open: l.value,
        onClose: t[4] || (t[4] = (a) => l.value = !1)
      }, {
        default: b(() => [
          e("div", S, [
            e("div", U, [
              E,
              F,
              e("button", N, [
                e("div", {
                  class: "i-la-check",
                  onClick: t[1] || (t[1] = (a) => l.value = !1)
                })
              ]),
              e("button", z, [
                e("div", {
                  class: "i-la-trash-alt",
                  onClick: t[2] || (t[2] = (a) => {
                    s.value = null, l.value = !1;
                  })
                })
              ])
            ]),
            h(e("input", {
              class: "text-sm p-4 my-4 dark-bg-dark-200",
              ref_key: "input",
              ref: i,
              "onUpdate:modelValue": t[3] || (t[3] = (a) => s.value = a),
              type: "url",
              placeholder: "Paste a URL"
            }, null, 512), [
              [w, s.value]
            ])
          ])
        ]),
        _: 1
      }, 8, ["open"])
    ]));
  }
}, R = /* @__PURE__ */ V(A, [["__scopeId", "data-v-d9417bae"]]);
export {
  R as default
};
//# sourceMappingURL=FormLink-DgL6FRx7.js.map
