
		import { Core as _autoloadCSSCore } from '../core/app.js';
		const fileNames = ['../assets/popupHint.css'].map(fileName => import.meta.resolve(fileName));
		_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
	
import { defineComponent as k, onUpdated as D, createElementBlock as i, openBlock as n, Fragment as C, createElementVNode as $, renderSlot as u, ref as h, toRef as L, watch as F, onUnmounted as H, resolveDirective as T, createBlock as b, createCommentVNode as r, unref as M, withCtx as S, Teleport as A, withDirectives as g, toDisplayString as N, createVNode as R, normalizeClass as V, resolveDynamicComponent as E, mergeProps as U } from "vue";
import { f as W } from "./forms-BpbQYyEQ.es.js";
import { TopPopupWorker as v } from "../popup/worker.js";
const q = /* @__PURE__ */ k({
  __name: "opener",
  props: {
    id: {},
    pos: { default: "3" },
    notch: { type: Boolean, default: !0 },
    openByFocusInput: { type: Boolean },
    openByHover: { type: Boolean },
    disabled: { type: Boolean },
    posBy: { default: "fixed" },
    data: {}
  },
  setup(s) {
    const t = s, p = t.id || Math.random() + "";
    let a;
    function B(e) {
      setTimeout(() => {
        a = e.nextElementSibling, a && d(a);
      });
    }
    D(() => {
      a && d(a);
    });
    function d(e) {
      e.dataset.topPopup = "#" + p;
      const c = !!e.dataset.topPopupDisabled;
      if (e.dataset.topPopupId = p, e.dataset.topPopupPos = t.pos, e.dataset.topPopupPosBy = t.posBy, e.dataset.topPopupNotch = t.notch ? "true" : "", e.dataset.topPopupOpenByHover = t.openByHover ? "true" : "", e.dataset.topPopupDisabled = t.disabled ? "true" : "", e.__TopPopupOpenerProps = t, t.openByFocusInput && e.classList.contains("top-input")) {
        const f = e.querySelector("input");
        if (f.onfocus = () => {
          e.dataset.topPopupDisabled || v.openByOpener(e);
        }, t.disabled !== c && f === document.activeElement) {
          const l = v.getPopupFromOpener(e);
          !t.disabled && !l && v.openByOpener(e), t.disabled && l && l.close();
        }
      }
    }
    return (e, c) => (n(), i(C, null, [
      $("template", { ref: B }),
      u(e.$slots, "default")
    ], 64));
  }
}), z = {
  key: 0,
  class: "top-popup_header"
}, j = {
  key: 0,
  class: "top-as-a closer"
}, G = {
  key: 1,
  class: "top-popup_widget"
}, J = {
  key: 2,
  class: "top-popup_content"
}, K = {
  key: 4,
  class: "top-popup_footer"
}, O = ["href"], to = /* @__PURE__ */ k({
  __name: "popup",
  props: {
    id: { default: "" },
    class: {},
    transitionDuration: {},
    footerSupportLink: {},
    pos: { default: "3" },
    notch: { type: Boolean, default: !0 },
    openByFocusInput: { type: Boolean },
    openByHover: { type: Boolean },
    disabled: { type: Boolean },
    posBy: { default: "fixed" },
    data: {}
  },
  emits: ["open", "close", "scrollContentList"],
  setup(s, { expose: t, emit: p }) {
    const a = s, B = p, d = a.id || "top-popup-id-" + Math.random(), e = {
      id: d,
      popup: void 0
    };
    t(e);
    const c = h(null), f = h(null), l = h(), y = {
      onOpen: async (o) => {
        o.elPopup && (c.value = o.elPopup), o.elPopupInner && (o.elPopupInner.innerText = "", f.value = o.elPopupInner), y.opened = !0, y.popup = o, e.popup = o, l.value = o.el.__TopPopupOpenerProps.data, B("open", { elPopup: o.elPopup, elPopupOpener: o.el, data: l.value });
      },
      onClose: (o) => {
        f.value = null, y.opened = !1, y.popup = void 0, l.value = void 0, B("close", { elPopup: o.elPopup, elPopupOpener: o.el, data: o.el.__TopPopupOpenerProps.data });
      },
      classRef: L(a, "class"),
      opened: !1,
      popup: void 0,
      transitionDurationRef: L(a, "transitionDuration")
    };
    return F(() => a.class, (o, P) => {
      if (!c.value) return;
      const m = o?.split(" ") ?? [], _ = (P?.split(" ") ?? []).filter((w) => !m.includes(w));
      c.value.classList.remove(..._), c.value.classList.add(...m);
    }), v.regVueComponent(d, y), H(() => {
      v.unregVueComponent(d);
    }), (o, P) => {
      const m = T("top-scroll-shadow");
      return n(), i(C, null, [
        o.$slots.opener ? (n(), b(q, {
          key: 0,
          id: M(d),
          pos: s.pos,
          posBy: s.posBy,
          notch: s.notch,
          openByFocusInput: s.openByFocusInput,
          openByHover: o.$core.state.isMobile || o.$core.state.isMobileUA ? !1 : s.openByHover,
          disabled: s.disabled
        }, {
          default: S(() => [
            u(o.$slots, "opener")
          ]),
          _: 3
        }, 8, ["id", "pos", "posBy", "notch", "openByFocusInput", "openByHover", "disabled"])) : r("", !0),
        f.value ? (n(), b(A, {
          key: 1,
          to: f.value
        }, [
          o.$slots.header || o.$core.state.isMobile ? (n(), i("div", z, [
            o.$core.state.isMobile ? (n(), i("span", j, N(o.$i18n.Common.Close), 1)) : r("", !0),
            u(o.$slots, "header", { data: l.value })
          ])) : r("", !0),
          o.$slots.widget ? (n(), i("div", G, [
            u(o.$slots, "widget")
          ])) : r("", !0),
          o.$slots.content ? g((n(), i("div", J, [
            u(o.$slots, "content", { data: l.value })
          ])), [
            [m]
          ]) : r("", !0),
          o.$slots.contentList ? g((n(), i("ul", {
            key: 3,
            class: "top-popup_content",
            onScroll: P[0] || (P[0] = (I) => o.$emit("scrollContentList", I))
          }, [
            u(o.$slots, "contentList", { data: l.value })
          ], 32)), [
            [m]
          ]) : r("", !0),
          o.$slots.footer || s.footerSupportLink ? (n(), i("div", K, [
            s.footerSupportLink ? (n(), i("a", {
              key: 0,
              class: "top-popup_footerSupportLink",
              href: s.footerSupportLink,
              target: "_blank"
            }, [
              R(W, { hint: "" })
            ], 8, O)) : r("", !0),
            u(o.$slots, "footer", { data: l.value })
          ])) : r("", !0)
        ], 8, ["to"])) : r("", !0)
      ], 64);
    };
  }
}), Q = { class: "top-popup_listItemActionsLabel top-ellipsis1" }, X = { class: "top-popup_listItemActions" }, so = /* @__PURE__ */ k({
  inheritAttrs: !1,
  __name: "listItem",
  props: {
    type: { default: "button" },
    closeByClick: { type: Boolean, default: !0 },
    attrs: {}
  },
  setup(s) {
    const t = s;
    return (p, a) => (n(), i("li", {
      class: V({
        "top-popup_liNoSelectable": t.type !== "button"
      })
    }, [
      (n(), b(E(p.$attrs.href ? "a" : "div"), U({
        class: {
          "top-popup_listItem": !0,
          ["top-popup_listItem-" + t.type]: !!t.type,
          "top-popup_liastItem-withActions": p.$slots.actions,
          "top-popup-noCloser": !s.closeByClick,
          a: t.type === "button"
          // оформления кнопки, deprecated
        }
      }, { ...p.$attrs, ...s.attrs }), {
        default: S(() => [
          p.$slots.actions ? (n(), i(C, { key: 0 }, [
            $("div", Q, [
              u(p.$slots, "default")
            ]),
            $("div", X, [
              u(p.$slots, "actions")
            ])
          ], 64)) : u(p.$slots, "default", { key: 1 })
        ]),
        _: 3
      }, 16, ["class"])),
      u(p.$slots, "buttons")
    ], 2));
  }
});
export {
  to as _,
  q as a,
  so as b
};
//# sourceMappingURL=popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js.map
