import { _ as b } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js";
import { b as G, a as J } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js";
import { _ as O } from "../.chunks/widgetInput.vue_vue_type_script_setup_true_lang-Dy8jWadl.es.js";
import { defineComponent as T, createBlock as L, openBlock as P, mergeProps as k, createSlots as S, withCtx as t, renderSlot as l, createVNode as y, createTextVNode as B, toDisplayString as v, unref as C, ref as I, watch as g, resolveDirective as F, withDirectives as w } from "vue";
import { e as c, f as A } from "../.chunks/forms-BpbQYyEQ.es.js";
const U = /* @__PURE__ */ T({
  __name: "popupAlert",
  props: {
    submitText: {},
    id: {},
    class: {},
    transitionDuration: {},
    footerSupportLink: {},
    pos: {},
    notch: { type: Boolean },
    openByFocusInput: { type: Boolean },
    openByHover: { type: Boolean },
    disabled: { type: Boolean },
    posBy: {},
    data: {}
  },
  emits: ["open", "close", "scrollContentList"],
  setup(d) {
    const f = d, {
      submitText: r,
      ...i
    } = f;
    return (o, e) => (P(), L(b, k({ class: "top-popupAlert" }, i, {
      onOpen: e[0] || (e[0] = (s) => o.$emit("open", s)),
      onClose: e[1] || (e[1] = (s) => o.$emit("close", s)),
      onScrollContentList: e[2] || (e[2] = (...s) => o.$emit("scrollContentList", ...s))
    }), S({
      opener: t(() => [
        l(o.$slots, "opener")
      ]),
      footer: t(() => [
        l(o.$slots, "footer"),
        y(c, null, {
          default: t(() => [
            B(v(C(r) || o.$i18n.Common.Close), 1)
          ]),
          _: 1
        })
      ]),
      _: 2
    }, [
      o.$slots.header ? {
        name: "header",
        fn: t(() => [
          l(o.$slots, "header")
        ]),
        key: "0"
      } : void 0,
      o.$slots.default ? {
        name: "content",
        fn: t(() => [
          l(o.$slots, "default")
        ]),
        key: "1"
      } : void 0
    ]), 1040));
  }
}), h = /* @__PURE__ */ T({
  __name: "popupConfirm",
  props: {
    cancelText: {},
    submitText: {},
    isWarning: { type: Boolean },
    id: {},
    class: {},
    transitionDuration: {},
    footerSupportLink: {},
    pos: {},
    notch: { type: Boolean },
    openByFocusInput: { type: Boolean },
    openByHover: { type: Boolean },
    disabled: { type: Boolean },
    posBy: {},
    data: {}
  },
  emits: ["open", "close", "scrollContentList", "submit"],
  setup(d, { emit: f }) {
    const r = d, i = f, o = I(!1), e = () => {
      o.value = !0, i("submit");
    }, s = (p) => {
      if (o.value) {
        o.value = !1;
        return;
      }
      i("close", p);
    }, {
      submitText: a,
      cancelText: V,
      isWarning: H,
      ...D
    } = r;
    return (p, u) => (P(), L(b, k({ class: "top-popupConfirm" }, D, {
      onOpen: u[0] || (u[0] = (n) => p.$emit("open", n)),
      onClose: u[1] || (u[1] = (n) => s(n)),
      onScrollContentList: u[2] || (u[2] = (...n) => p.$emit("scrollContentList", ...n))
    }), S({
      opener: t(() => [
        l(p.$slots, "opener")
      ]),
      footer: t(() => [
        l(p.$slots, "footer"),
        y(c, { color: "theme" }, {
          default: t(() => [
            B(v(C(V) || p.$i18n.Common.Cancel), 1)
          ]),
          _: 1
        }),
        y(c, {
          onClick: e,
          color: C(H) ? "red" : "blue"
        }, {
          default: t(() => [
            B(v(C(a) || p.$i18n.Common.Continue), 1)
          ]),
          _: 1
        }, 8, ["color"])
      ]),
      _: 2
    }, [
      p.$slots.header ? {
        name: "header",
        fn: t(() => [
          l(p.$slots, "header")
        ]),
        key: "0"
      } : void 0,
      p.$slots.default ? {
        name: "content",
        fn: t(() => [
          l(p.$slots, "default")
        ]),
        key: "1"
      } : void 0
    ]), 1040));
  }
}), j = /* @__PURE__ */ T({
  __name: "popupPrompt",
  props: {
    submitText: {},
    cancelText: {},
    defaultValue: {},
    id: {},
    class: {},
    transitionDuration: {},
    footerSupportLink: {},
    pos: {},
    notch: { type: Boolean },
    openByFocusInput: { type: Boolean },
    openByHover: { type: Boolean },
    disabled: { type: Boolean },
    posBy: {},
    data: {}
  },
  emits: ["open", "close", "scrollContentList", "submit"],
  setup(d, { emit: f }) {
    const r = d, i = f, o = () => s.value = r.defaultValue ?? "", e = I(!1), s = I();
    g(() => r.defaultValue, () => o(), { immediate: !0 });
    const a = () => {
      e.value = !0;
    }, V = (n) => {
      if (e.value) {
        e.value = !1, i("submit", s.value), o();
        return;
      }
      o(), i("close", n);
    }, {
      submitText: H,
      cancelText: D,
      defaultValue: p,
      ...u
    } = r;
    return (n, m) => (P(), L(b, k({ class: "top-popupPrompt" }, u, {
      onOpen: m[1] || (m[1] = ($) => n.$emit("open", $)),
      onClose: m[2] || (m[2] = ($) => V($)),
      onScrollContentList: m[3] || (m[3] = (...$) => n.$emit("scrollContentList", ...$))
    }), S({
      opener: t(() => [
        l(n.$slots, "opener")
      ]),
      footer: t(() => [
        l(n.$slots, "footer"),
        y(c, { color: "theme" }, {
          default: t(() => [
            B(v(C(D) || n.$i18n.Common.Cancel), 1)
          ]),
          _: 1
        }),
        y(c, { onClick: a }, {
          default: t(() => [
            B(v(C(H) || n.$i18n.Common.OK), 1)
          ]),
          _: 1
        })
      ]),
      _: 2
    }, [
      n.$slots.header ? {
        name: "header",
        fn: t(() => [
          l(n.$slots, "header")
        ]),
        key: "0"
      } : void 0,
      n.$slots.default ? {
        name: "content",
        fn: t(() => [
          l(n.$slots, "default"),
          y(O, {
            modelValue: s.value,
            "onUpdate:modelValue": m[0] || (m[0] = ($) => s.value = $),
            modelModifiers: { trim: !0 }
          }, null, 8, ["modelValue"])
        ]),
        key: "1"
      } : void 0
    ]), 1040));
  }
}), q = /* @__PURE__ */ T({
  __name: "popupHint",
  props: {
    hint: {},
    id: {},
    class: {},
    transitionDuration: {},
    footerSupportLink: {},
    pos: {},
    notch: { type: Boolean },
    openByFocusInput: { type: Boolean },
    openByHover: { type: Boolean },
    disabled: { type: Boolean },
    posBy: {},
    data: {}
  },
  setup(d) {
    const f = d, {
      hint: r,
      ...i
    } = f;
    return (o, e) => {
      const s = F("top-tooltip");
      return P(), L(b, k({ class: "top-popupHint" }, i, {
        onOpen: e[0] || (e[0] = (a) => o.$emit("open", a)),
        onClose: e[1] || (e[1] = (a) => o.$emit("close", a)),
        onScrollContentList: e[2] || (e[2] = (...a) => o.$emit("scrollContentList", ...a))
      }), S({
        opener: t(() => [
          w(y(A, {
            hint: C(r),
            class: "top-popupHint_opener"
          }, null, 8, ["hint"]), [
            [s]
          ])
        ]),
        _: 2
      }, [
        o.$slots.default ? {
          name: "content",
          fn: t(() => [
            l(o.$slots, "default")
          ]),
          key: "0"
        } : void 0
      ]), 1040);
    };
  }
});
export {
  b as TopPopup,
  U as TopPopupAlert,
  h as TopPopupConfirm,
  q as TopPopupHint,
  G as TopPopupListItem,
  J as TopPopupOpener,
  j as TopPopupPrompt,
  O as TopPopupWidgetInput
};
//# sourceMappingURL=popup.js.map
