
		import { Core as _autoloadCSSCore } from '../core/app.js';
		const fileNames = ['../assets/project.css'].map(fileName => import.meta.resolve(fileName));
		_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
	
import { defineComponent as R, mergeModels as V, useModel as T, computed as M, createElementBlock as A, openBlock as h, createBlock as C, unref as v, withCtx as B, Fragment as Y, renderList as me, normalizeClass as X, createElementVNode as oe, toDisplayString as b, createVNode as P, createTextVNode as J, toValue as ye, ref as K, watch as E, createCommentVNode as O, reactive as be, isRef as he, withModifiers as U, mergeProps as Ve, withKeys as Ie, nextTick as Re, resolveDirective as Pe, withDirectives as Ne, resolveDynamicComponent as qe, renderSlot as De, shallowRef as Fe, createSlots as Ue } from "vue";
import { u as w, C as z, e as Q, q as ce, d as ze } from "../.chunks/forms-BAUgA7Ct.es.js";
import { _ as we, b as ve, a as Je } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-BIWw5zUX.es.js";
import { a as We, _ as Me, b as Ee, c as $e, I as ue } from "../.chunks/policy.vue_vue_type_style_index_0_lang-LkyBILW6.es.js";
import { u as _e } from "../.chunks/utils-BYaZxGC1.es.js";
import { getSearcherGIcon as Ye, getLangLabel as Qe, getDeviceGIcon as He } from "../utils/searchers.js";
import "../.chunks/core-BE_-rKvW.es.js";
import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-DMhcuiHP.es.js";
import { g as Se } from "../.chunks/field-CyyFzM-Y.es.js";
import { storage as W } from "../utils/dom.js";
import { TopPopupWorker as Xe } from "../popup/worker.js";
const Ze = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" }, Rt = /* @__PURE__ */ R({
  __name: "competitorSelector",
  props: /* @__PURE__ */ V({
    modelValue: {},
    items: {},
    showSelectAllItem: { type: Boolean, default: !0 }
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(e) {
    const a = e, o = T(e, "modelValue"), t = M(() => {
      if (a.showSelectAllItem)
        return {
          icon: "",
          title: w().Common.Select_all,
          value: "all",
          content: ""
        };
    });
    return (r, l) => (h(), A("div", Ze, [
      v(z).state.isMobile ? (h(), C(we, { key: 0 }, {
        opener: B(() => [
          P(Q, {
            class: "top-competitorSelector_opener",
            color: "theme",
            icon: "",
            icon2: ""
          }, {
            default: B(() => [
              J(b(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
            ]),
            _: 1
          })
        ]),
        contentList: B(() => [
          (h(!0), A(Y, null, me(e.items, (n) => (h(), C(ve, {
            class: X({
              "top-active": o.value?.includes(n.value)
            }),
            "data-top-icon": n.icon,
            title: n.title,
            onClick: () => o.value = [n.value]
          }, {
            default: B(() => [
              oe("span", et, b(n.content), 1)
            ]),
            _: 2
          }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
        ]),
        _: 1
      })) : (h(), C(We, {
        key: 1,
        modelValue: o.value,
        "onUpdate:modelValue": l[0] || (l[0] = (n) => o.value = n),
        items: e.items,
        isMultiple: !0,
        styling: "bar",
        canBeEmptyMultiple: !1,
        selectAllItem: t.value
      }, null, 8, ["modelValue", "items", "selectAllItem"]))
    ]));
  }
}), Pt = (e, a) => M(() => ye(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
  value: r.id,
  title: r.url + ` [${r.id}]`,
  icon: r.id === ye(a) ? "" : "",
  content: r.name
}))), L = -1, y = -2, le = -1, tt = {
  0: "Yandex",
  1: "Google",
  4: "YouTube",
  5: "Bing",
  7: "Seznam",
  8: "AppStore",
  9: "GoogleStore",
  20: "Yandex.com",
  21: "Yandex.com.tr"
}, xe = {
  key: y,
  name: "--",
  index: y
}, Ge = {
  key: y,
  name: "--",
  regions: [xe],
  regionByIndex: /* @__PURE__ */ new Map([[y, xe]])
}, ae = {
  key: y,
  name: "Autoselect",
  index: y
}, se = {
  key: y,
  name: "Autoselect",
  regions: [ae],
  regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
}, ke = {
  countryCode: "00",
  depth: 1,
  device: 0,
  key: le,
  index: le,
  lang: "ru",
  name: "Without region"
}, ot = () => (ae.name = w().Common.Autoselect, ae), lt = () => (ot(), se.name = w().Common.Autoselect, console.log(se), se), at = () => (ke.name = w().Keywords.Without_region, ke), Ke = (e = !1, a = !1, o = []) => {
  let t;
  return e ? t = nt(o) : t = Oe(o), a && t.set(y, lt()), t.size || t.set(y, Ge), t;
}, Oe = (e, a = !0, o = [], t = !1) => {
  const r = /* @__PURE__ */ new Map();
  return e.forEach((l) => {
    if (!l.enabled || t && typeof l.key == "number" && l.key > 1) return;
    const n = { ...l };
    n.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((u) => {
      if (a && !u.enabled) return;
      const f = { ...u };
      n.regionByIndex.set(f.index, f);
    }), !n.regionByIndex.size && o.length, // режим вывода ПС без регионов
    (!l.regions || // есть включенные регионы
    n.regionByIndex.size || // запрошен вывод конкретных ПС
    o.length) && r.set(n.key, n);
  }), o.forEach((l) => {
    if (r.has(l)) return;
    const n = {
      key: l,
      name: tt[l],
      regions: [],
      regionByIndex: /* @__PURE__ */ new Map()
    };
    r.set(n.key, n);
  }), r;
}, nt = (e) => {
  const a = Oe(e, !1, [0, 1], !0);
  if (a.has(2)) {
    const o = a.get(2);
    o && (o.regionByIndex = /* @__PURE__ */ new Map());
  }
  return a.forEach((o) => {
    if (!o.regionByIndex) return;
    const t = { ...at() };
    o.regionByIndex.set(t.index, t);
  }), a;
}, rt = (e, a, o = []) => {
  const t = Ke(e, !1, o);
  let r;
  return t.forEach((l) => {
    if (!(a.searcher_key !== void 0 && a.searcher_key != l.key) && l.regions && (l.regions.forEach((n) => {
      if (!r && !(a.key !== void 0 && a.key != n.key) && !(a.index !== void 0 && a.index != n.index) && !(!e && (a.lang !== void 0 && a.lang != n.lang || a.device !== void 0 && a.device != n.device)))
        return n.searcher_key = l.key, r = n, !1;
    }), r))
      return !1;
  }), r;
}, it = _e(() => import("../.chunks/dialog_regionSelectorRegions-Btp9cfmF.es.js")), dt = (e, a) => {
  const o = w(), t = K(a.value.keys().next().value ?? y), r = M(() => {
    const l = /* @__PURE__ */ new Map();
    if (a.value.forEach((n) => {
      let u = {
        value: n.key,
        title: n.name
      };
      e.addSearcherIcon && (u.icon = Ye(n.key)), l.set(n.key, u);
    }), e.addCompare && !l.has(y)) {
      const n = {
        value: "",
        title: "--------------------",
        disabled: !0
      };
      l.set(n.value, n);
      const u = {
        value: L,
        title: o.Common.Compare
      };
      l.set(u.value, u);
    }
    return l;
  });
  return {
    searcherKey: t,
    optionBySearcherKey: r
  };
}, ut = (e, a) => {
  const o = w(), t = K(y);
  e.modelValue.length === 1 && (t.value = e.modelValue[0]), t.value === y && (e.forFrequency ? t.value = a.value?.regionByIndex.values().next().value?.key ?? y : t.value = a.value?.regionByIndex.keys().next().value ?? y);
  const r = M(() => {
    const l = /* @__PURE__ */ new Map();
    return a.value.regionByIndex?.forEach((n) => {
      let u = n.name;
      if (e.forFrequency) {
        const x = {
          value: n.key,
          title: u
        };
        l.has(n.key) || l.set(n.key, x);
        return;
      }
      n.device && (u += " (" + o.Common["Device_" + n.device] + ")");
      const f = Qe(a.value.key || 0, n.lang ?? "");
      f && (u += " / " + f);
      const c = {
        value: n.index,
        title: u,
        icon: n.device ? He(n.device) : void 0
      };
      l.set(n.index, c);
    }), l;
  });
  return E(r, (l, n) => {
    if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
      return;
    let u = l.keys().next().value;
    if (t.value === y || u === y) {
      t.value = u;
      return;
    }
    let f = n?.get(t.value)?.title || "", c = -1;
    for (const [x, i] of l.entries()) {
      const m = i.title;
      if (typeof m != "string" || typeof x == "string")
        break;
      if (m === f) {
        u = x;
        break;
      }
      const d = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
      let s = f, g = 3;
      m.indexOf(s) === -1 && (s = f.replace(/^[^a-zа-я]/i, "").replace(d, ""), g--), m.indexOf(s) === -1 && (s = f.replace(/ \/.*/, ""), g--), m.indexOf(s) === -1 && (s = f.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(d, ""), g--), m.indexOf(s) !== -1 && (g <= c || (c = g, u = x));
    }
    t.value = u;
  }), {
    regionIndex: t,
    optionByRegionIndex: r
  };
}, st = (e, a, o) => {
  const t = K([]), r = () => {
    if (e.onlySearcher && a.value) {
      t.value = Array.from(a.value.keys());
      return;
    }
    let n = [];
    if (e.modelValue.length > 1)
      n = [...e.modelValue];
    else
      try {
        n = JSON.parse(
          localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
        ) ?? [];
      } catch {
      }
    n.length && (n = n.filter((u) => o.value.has(u))), n.length || (n = Array.from(o.value)), t.value = [...n];
  }, l = () => {
    t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
  };
  return E(t, () => {
    l();
  }), e.addCompare && r(), {
    regionsIndexes: t
  };
}, ct = (e) => {
  const a = M(() => Ke(e.forFrequency, e.autoRegion, e.searchers)), o = M(() => a.value.get(r.searcherKey.value) || Ge), t = M(() => {
    const i = /* @__PURE__ */ new Set();
    return a.value.forEach((m) => {
      m.regionByIndex.forEach((d) => {
        d.index !== le && d.index !== y && i.add(d.index);
      });
    }), i;
  }), r = dt(e, a), l = ut(e, o), n = st(e, a, t);
  E(a, () => {
    if (e.onlySearcher ? n.regionsIndexes.value = Array.from(a.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((m) => t.value.has(m)), r.searcherKey.value === L) return;
    let i = a.value.keys().next().value;
    a.value.forEach((m) => {
      if (e.onlySearcher && m.key === r.searcherKey.value) {
        i = r.searcherKey.value;
        return;
      }
      if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (i = m.key), !e.onlySearcher) {
        let d;
        i !== void 0 && (d = a.value.get(i)?.regionByIndex);
        const s = a.value.get(m.key)?.regionByIndex;
        d?.has(y) && !s?.has(y) && (i = m.key);
      }
    }), i !== void 0 && (r.searcherKey.value = i), l.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = o.value?.regions?.keys().next().value);
  }, { immediate: !0 });
  const u = () => {
    if (!(r.searcherKey.value === L || r.searcherKey.value === y))
      return r.searcherKey.value;
  }, f = () => {
    if (e.onlySearcher || l.regionIndex.value === y) return;
    let i = l.regionIndex.value;
    if (e.forFrequency) {
      const m = l.regionIndex.value;
      i = rt(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
    }
    return i;
  }, c = () => {
    const i = u();
    if (i !== void 0)
      return a.value.get(i);
  };
  return {
    selectSearcher: r,
    selectRegion: l,
    compare: n,
    searcherByKey: a,
    allRegionsIndexes: t,
    getSearcher: c,
    getRegion: () => {
      const i = f();
      if (i !== void 0)
        return c()?.regionByIndex?.get(i);
    }
  };
}, Nt = /* @__PURE__ */ R({
  __name: "regionSelector",
  props: /* @__PURE__ */ V({
    projectId: {},
    searchers: { default: () => [] },
    modelValue: {},
    modelValueSingle: {},
    addCompare: { type: Boolean },
    forFrequency: { type: Boolean },
    autoRegion: { type: Boolean },
    onlySearcher: { type: Boolean },
    addChanger: { type: Boolean, default: !0 },
    addSearcherIcon: { type: Boolean, default: !0 },
    addRegionIcon: { type: Boolean, default: !0 }
  }, {
    modelValue: { required: !0 },
    modelModifiers: {},
    modelValueSingle: {},
    modelValueSingleModifiers: {}
  }),
  emits: ["update:modelValue", "update:modelValueSingle"],
  setup(e, { expose: a }) {
    const o = e, t = T(e, "modelValue"), r = T(e, "modelValueSingle"), {
      selectSearcher: l,
      selectRegion: n,
      compare: u,
      searcherByKey: f,
      allRegionsIndexes: c,
      getSearcher: x,
      getRegion: i
    } = ct(o), m = () => {
      const d = [];
      f.value.forEach((s) => {
        s.enabled && s.regions.forEach((g) => {
          g.enabled && d.push(g);
        });
      }), it.open("regions", {
        regions: d,
        regionsIndexes: u.regionsIndexes.value,
        "@update:regionsIndexes": (s) => u.regionsIndexes.value = s
      });
    };
    return E([n.regionIndex, l.searcherKey, u.regionsIndexes], () => {
      if (l.searcherKey.value === L && u.regionsIndexes.value.length) {
        if (JSON.stringify(t.value) === JSON.stringify(u.regionsIndexes.value))
          return;
        t.value = [...u.regionsIndexes.value];
      } else
        o.onlySearcher ? (t.value = [l.searcherKey.value], l.searcherKey.value === y && !o.autoRegion && (t.value.length = 0)) : (t.value = [n.regionIndex.value], n.regionIndex.value === y && !o.autoRegion && (t.value.length = 0));
      !o.onlySearcher && !c.value.size && (l.searcherKey.value = y);
    }), r.value && E(r, () => {
      r.value && (t.value = [r.value]);
    }, { immediate: !0 }), E(t, () => {
      if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
        if (!t.value.length || t.value.length === 1 && !f.value.has(t.value[0]) || t.value.length === 1 && t.value[0] === y && !o.autoRegion) {
          let d = f.value.keys().next().value;
          d === y && !o.autoRegion && (d = void 0, r.value = y), d !== void 0 ? t.value = [d] : t.value.length = 0;
          return;
        }
        if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(u.regionsIndexes.value)) {
          t.value = [...u.regionsIndexes.value];
          return;
        }
      } else {
        let d = [...new Set(t.value)], s = f.value.values().next().value?.regionByIndex?.keys().next().value;
        if (o.forFrequency && (s = f.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, r.value = y), !d.length)
          s !== void 0 && d.push(s);
        else if (d.length === 1) {
          let g = c.value;
          o.forFrequency && (g = /* @__PURE__ */ new Set(), f.value.forEach((Z) => {
            Z.regionByIndex.forEach((N) => {
              N.index !== le && N.index !== y && g.add(N.key);
            });
          })), g.has(d[0]) || (d = [], s !== void 0 && d.push(s));
        } else
          d = d.filter((g) => c.value.has(g)), !d.length && s !== void 0 && d.push(s);
        if (JSON.stringify(t.value) !== JSON.stringify(d)) {
          t.value = d;
          return;
        }
      }
      if (!(t.value.length === 1 && t.value[0] === (o.onlySearcher ? l.searcherKey.value : n.regionIndex.value)))
        if (o.onlySearcher) {
          if (t.value.length === 1) {
            l.searcherKey.value = t.value[0];
            return;
          }
          l.searcherKey.value = L;
          return;
        } else {
          if (!t.value.length)
            return;
          if (t.value.length === 1 && l.searcherKey.value !== L) {
            n.regionIndex.value = t.value[0];
            let d;
            for (const s of f.value.values()) {
              for (const g of s.regionByIndex.values())
                if ((o.forFrequency ? g.key : g.index) === n.regionIndex.value) {
                  d = s.key;
                  break;
                }
              if (d !== void 0)
                break;
            }
            d !== void 0 && (l.searcherKey.value = d);
          } else
            l.searcherKey.value = L, u.regionsIndexes.value = [...t.value];
        }
    }, { immediate: !0 }), a({
      getSearcher: x,
      getRegion: i
    }), (d, s) => (h(), A("div", {
      class: X({
        "top-selectorRegion": !0,
        "top-selectorRegion-onlySearcher": e.onlySearcher
      })
    }, [
      P(ce, {
        options: v(l).optionBySearcherKey.value,
        modelValue: v(l).searcherKey.value,
        "onUpdate:modelValue": s[0] || (s[0] = (g) => v(l).searcherKey.value = g),
        name: "searcher_key",
        addChanger: e.addChanger
      }, null, 8, ["options", "modelValue", "addChanger"]),
      !e.onlySearcher && v(l).searcherKey.value !== v(L) ? (h(), C(ce, {
        key: 0,
        class: "top-select-region",
        options: v(n).optionByRegionIndex.value,
        modelValue: v(n).regionIndex.value,
        "onUpdate:modelValue": s[1] || (s[1] = (g) => v(n).regionIndex.value = g),
        name: e.forFrequency ? "region_key" : "region_index",
        addChanger: e.addChanger,
        "data-top-icon": e.addRegionIcon ? "" : void 0
      }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : O("", !0),
      e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(L) ? (h(), C(Q, {
        key: 1,
        name: "compare",
        onClick: m,
        "data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
      }, {
        default: B(() => [
          J(b(d.$i18n.Common.Selected_regions), 1)
        ]),
        _: 1
      }, 8, ["data-count-compare-regions-indexes"])) : O("", !0)
    ], 2));
  }
}), j = {
  id: 0,
  name: "/",
  path: "/"
};
function gt(e) {
  return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
}
const pe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (t.childsIds = [], t.id && (t.countAllGroupsActive = t.count_groups_active), e[t.id] && e[t.id].forEach((l) => {
  l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = gt(a));
  const n = r > 1 ? "-".repeat(r - 1) + " " : "";
  n && !l.name.startsWith(n) && (l.name = n + l.name), o.set(l.id, l), pe(e, a, o, l, r + 1), t.childsIds = t.childsIds.concat(l.childsIds), t.id && l.count_groups_active && (t.countAllGroupsActive += l.count_groups_active);
}), o), ft = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
function ge(e, a, o) {
  const t = Object.keys(e), r = t.map((l) => e[l]);
  return E(r, (l, n, u) => {
    const f = {};
    l.forEach((c, x) => {
      if (!Object.is(c, n[x])) {
        const i = t[x];
        f[i] = {
          old: n[x],
          new: c
        };
      }
    }), Object.keys(f).length && a(f, u);
  }, o);
}
const mt = /* @__PURE__ */ R({
  __name: "folders",
  props: /* @__PURE__ */ V({
    folderId: {},
    folder: {},
    folders: {},
    projectId: {},
    canSelectAll: { type: Boolean },
    addChanger: { type: Boolean },
    addIcon: { type: Boolean, default: !0 },
    client: {}
  }, {
    folderId: { required: !0 },
    folderIdModifiers: {},
    folder: { default: j },
    folderModifiers: {}
  }),
  emits: ["update:folderId", "update:folder"],
  setup(e) {
    const a = e, o = T(e, "folderId"), t = T(e, "folder"), r = a.client && !a.folders ? ft(a.client) : void 0, l = K(null);
    E(() => a.projectId, () => {
      r?.changeParams({
        project_id: a.projectId
      }), r?.setOptions({
        checkFingerprint: "TopGroupSelectorFolders:" + a.projectId
      }), l.value?.resetCache();
    }, { immediate: !0 });
    const n = M(() => pe(a.folders ?? { root: [j] }, a.canSelectAll));
    return ge({
      modelFolder: t,
      modelFolderId: o
    }, async (u) => {
      if (o.value === t.value.id)
        return;
      if (u.modelFolder && !u.modelFolderId) {
        o.value = t.value.id;
        return;
      }
      let f = n.value.get(a.folderId);
      f || (f = j), t.value = f, o.value = f.id;
    }, { immediate: !0 }), (u, f) => (h(), C(Me, {
      class: "top-groupSelector_folder",
      modelValue: t.value,
      "onUpdate:modelValue": f[0] || (f[0] = (c) => t.value = c),
      items: e.folders ? [...n.value.values()] : void 0,
      "search-type": "inline",
      icon: e.addIcon ? "" : void 0,
      api: e.folders ? void 0 : v(r),
      apiSetSearchParams: (...c) => v(Ee)(...c, "name"),
      addChanger: e.addChanger,
      useCache: ""
    }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
  }
}), ne = {
  id: -1,
  name: "--",
  folder_id: j.id,
  folder_path: j.path
}, re = {
  id: $e,
  name: "All groups",
  folder_id: j.id,
  folder_path: j.path
}, _ = () => (re.name = w()?.Common.All_groups, re), Le = () => (re.name = w()?.Keywords.Choose_group, re), vt = (e, a, o) => (e = [...e], a !== void 0 && (e = e.filter((t) => t.on == Number(a))), o && o.id && o.childsIds && (e = e.filter((t) => t.folder_id === o.id || o.childsIds.includes(t.folder_id))), e), Ce = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), pt = (e) => e.gen("/add/keywords_2/groups/"), yt = { class: "top-groupSelector_groupItem" }, ht = {
  key: 0,
  class: "top-comment"
}, It = {
  key: 1,
  class: "top-groupSelector_groupItemFolderPath"
}, St = /* @__PURE__ */ R({
  __name: "groups",
  props: /* @__PURE__ */ V({
    groupId: {},
    group: {},
    projectId: {},
    folder: {},
    groups: {},
    on: { type: Boolean, default: void 0 },
    canAdd: { type: [String, Boolean] },
    canSelectAll: { type: [Boolean, String] },
    autoselect: { default: "first" },
    addChanger: { type: Boolean, default: !0 },
    showPath: { type: Boolean },
    addIcon: { type: Boolean, default: !0 },
    client: {}
  }, {
    groupId: { required: !0 },
    groupIdModifiers: {},
    group: { required: !0 },
    groupModifiers: {}
  }),
  emits: /* @__PURE__ */ V(["addGroup"], ["update:groupId", "update:group"]),
  setup(e, { emit: a }) {
    const o = e, t = a, r = T(e, "groupId"), l = T(e, "group"), n = o.client && !o.groups ? Ce(o.client) : void 0, u = o.client ? pt(o.client) : void 0, f = K(null), c = K(void 0), x = Se("folder_id", "EQUALS", [o.folder?.id ?? 0]);
    n?.changeParams({
      project_id: o.projectId,
      folder_id_depth: !0,
      filters: [
        x
      ]
    }), o.on !== void 0 && n?.params.filters?.push(Se("on", "EQUALS", [Number(o.on)]));
    const i = (d) => {
      l.value = d, r.value = d.id;
    };
    ge({
      projectId: () => o.projectId,
      folderId: () => o.folder?.id,
      canSelectAll: () => o.canSelectAll
    }, (d) => {
      if (d.projectId && (n?.changeParams({
        project_id: o.projectId
      }), n?.setOptions({
        checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
      })), d.folderId && (x.values = [
        o.folder?.id ?? 0
      ], o.groups && (c.value = vt(o.groups, o.on, o.folder))), f.value?.resetCache(), (d.folderId?.old !== void 0 || d.canSelectAll?.old !== void 0) && r.value !== ue) {
        let s;
        o.autoselect === "first" && (s = c.value?.[0], o.canSelectAll && (s = be(_()))), (o.autoselect === "placeholder" || !s) && (s = Le()), i(s);
      }
    }, { immediate: !0 }), ge({
      modelGroup: l,
      modelGroupId: r
    }, async (d) => {
      if (r.value !== l.value.id) {
        if (d.modelGroup && !d.modelGroupId) {
          r.value = l.value.id;
          return;
        }
        if (!(o.canAdd && r.value === ue)) {
          if (o.groups) {
            let s = c.value?.find((g) => g.id === r.value);
            if (!s && o.canSelectAll && (s = _()), s)
              i(s);
            else {
              const g = c.value?.[0];
              g && !r.value ? i(g) : i(ne);
            }
          }
          if (o.client && !o.groups && (r.value || r.value === $e && !o.canSelectAll)) {
            const s = Ce(o.client).changeParams({
              project_id: o.projectId,
              id: r.value,
              filters: [
                x
              ]
            });
            s?.setOptions({
              checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
            });
            const g = await s.call();
            if (!g.errors?.length && !g.result) return;
            !g.errors && g.result[0] ? i(g.result[0]) : i(ne);
          }
        }
      }
    }, { immediate: !0 });
    const m = async (d) => {
      if (o.canAdd !== "api" || !u) return;
      const s = l.value, g = await u.changeParams({
        project_id: o.projectId,
        names: [d.name],
        to_id: o.folder?.id ?? j.id,
        to_type: "in_folder_last"
      }).call();
      g.result ? (i(g.result), t("addGroup", g.result)) : i(s), f.value?.resetCache(!0);
    };
    return (d, s) => (h(), C(Me, {
      ref_key: "refSelector",
      ref: f,
      class: "top-groupSelector_group",
      modelValue: l.value,
      "onUpdate:modelValue": s[0] || (s[0] = (g) => l.value = g),
      items: c.value ?? e.groups,
      searchType: "inline",
      icon: e.addIcon ? "" : void 0,
      api: e.groups ? void 0 : v(n),
      apiSetSearchParams: (...g) => v(Ee)(...g, "name"),
      appendSearchToResult: !!e.canAdd,
      useAllItem: e.canSelectAll ? v(_)().name : !1,
      addChanger: e.addChanger,
      useCache: "",
      onAppendItem: m
    }, {
      item: B(({ item: g }) => [
        oe("div", yt, [
          g.id === v(ue) ? (h(), A("div", ht, b(d.$i18n.Common.Add) + ": ", 1)) : O("", !0),
          oe("span", null, b(g.name), 1),
          g.folder_path && e.showPath ? (h(), A("span", It, b(g.folder_path), 1)) : O("", !0)
        ])
      ]),
      _: 1
    }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
  }
}), xt = { class: "top-groupSelector" }, qt = /* @__PURE__ */ R({
  __name: "groupSelector",
  props: /* @__PURE__ */ V({
    folderId: {},
    folder: {},
    groupId: {},
    group: {},
    projectId: {},
    folders: {},
    groups: {},
    on: { type: Boolean, default: void 0 },
    canSelectAllGroups: { type: Boolean },
    canAddGroup: {},
    autoselect: { default: "first" },
    addChanger: { type: Boolean, default: !0 },
    showFolders: { type: Boolean, default: !0 },
    showGroups: { type: Boolean, default: !0 },
    addIcon: { type: Boolean, default: !0 },
    client: {}
  }, {
    folderId: { required: !0 },
    folderIdModifiers: {},
    folder: {},
    folderModifiers: {},
    groupId: { required: !0 },
    groupIdModifiers: {},
    group: { default: ne },
    groupModifiers: {}
  }),
  emits: /* @__PURE__ */ V(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
  setup(e, { emit: a }) {
    const o = e, t = T(e, "folderId"), r = T(e, "folder"), l = T(e, "groupId"), n = T(e, "group"), u = a, f = pe(o.folders ?? { root: [j] }, o.canSelectAllGroups);
    r.value = f.get(t.value);
    let c = o.groups?.find((i) => i.id === l.value);
    l.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = _()), o.canSelectAllGroups && !c && (c = _()), (o.autoselect === "placeholder" || !c) && (c = Le()), c ??= ne, n.value = c;
    const x = (i) => {
      let m;
      o.groups && i && (m = [...o.groups, i]), u("update:groups", m);
    };
    return (i, m) => (h(), A("div", xt, [
      e.showFolders ? (h(), C(mt, {
        key: 0,
        folderId: t.value,
        "onUpdate:folderId": m[0] || (m[0] = (d) => t.value = d),
        folder: r.value,
        "onUpdate:folder": m[1] || (m[1] = (d) => r.value = d),
        projectId: e.projectId,
        folders: e.folders,
        canSelectAll: e.canSelectAllGroups,
        addChanger: e.addChanger,
        addIcon: e.addIcon,
        client: e.client
      }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : O("", !0),
      e.showGroups ? (h(), C(St, {
        key: 1,
        groupId: l.value,
        "onUpdate:groupId": m[2] || (m[2] = (d) => l.value = d),
        group: n.value,
        "onUpdate:group": m[3] || (m[3] = (d) => n.value = d),
        projectId: e.projectId,
        folder: r.value,
        groups: e.groups,
        on: e.on,
        canAdd: e.canAddGroup,
        canSelectAll: e.canSelectAllGroups,
        autoselect: e.autoselect,
        addChanger: e.addChanger,
        showPath: e.showFolders && !!e.folders?.[0],
        addIcon: e.addIcon,
        client: e.client,
        onAddGroup: x
      }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) : O("", !0)
    ]));
  }
}), Be = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, ie = (e, a) => {
  e = H(e);
  const o = a.find((t) => t.id === e);
  if (o)
    return o;
}, Dt = (e, a, o) => {
  a || (a = { id: e.id }), a.id = e.id, a.pos ??= "3", a.notch ??= !0, a.posBy ??= "fixed";
  const t = Xe.genElPopupOpener("div", a);
  return t.classList.add("top-tagSelector"), e.useTopButton && t.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || t.classList.add("top-tagSelector-custom"), e.mode === "filter" && t.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && t.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && t.classList.add("top-tagSelector-setter_several"), t.onclick = (r) => {
    r.preventDefault(), r.stopPropagation(), t.onclick = null;
    const l = K(e.modelValue), n = {
      model: l,
      mode: e.mode,
      targetId: e.targetId,
      filters: e.filters,
      payload: e.payload
    };
    W(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, he(e.modelValue) || E(l, () => {
      e.modelValue = l.value, te(t, e, o);
    }), t.click();
  }, he(e.modelValue) ? E(e.modelValue, () => te(t, e, o)) : W(t, "topTagSelectorRender", (r) => {
    e.modelValue = r;
    const l = W(t, "topTagSelectorTarget");
    l && (l.model.value = r), te(t, e, o);
  }), te(t, e, o), t;
}, Ft = (e, a) => {
  W(e, "topTagSelectorRender")?.(a);
}, te = (e, a, o) => {
  const t = v(a.modelValue);
  if (e.classList.toggle("top-tagSelector-selectedOne", !t.length || t.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", t.length > 5), a.mode === "setter" && a.filters) {
    e.innerHTML = `<div>${o}</div>`;
    return;
  }
  if (e.innerHTML = "", !t.length && a.mode === "filter") {
    const r = Te({
      id: "all",
      colorId: "",
      name: w().Common?.All_tags ?? "",
      state: ""
    });
    e.append(r);
  }
  t.forEach((r) => {
    const l = Te({
      id: H(r),
      colorId: ie(r, a.tags)?.color_id ?? "",
      name: ie(r, a.tags)?.name ?? "",
      state: H(r) === r ? "selected" : "excluded"
    });
    e.append(l);
  });
}, Te = (e) => {
  const a = document.createElement("div");
  return a.classList.add("top-tagSelector_tagIcon"), a.classList.toggle("top-tagSelector-active", !!e.state), a.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), a.dataset.tag_id = e.id, a.dataset.tag_color_id = e.colorId, a.title = e.name, a;
}, kt = [
  {
    id: "1",
    name: "Without Tag",
    color_id: "1"
  },
  {
    id: "2",
    name: "Red",
    color_id: "2"
  },
  {
    id: "3",
    name: "Orange",
    color_id: "3"
  },
  {
    id: "4",
    name: "Yellow",
    color_id: "4"
  },
  {
    id: "5",
    name: "Blue",
    color_id: "5"
  },
  {
    id: "6",
    name: "Purple",
    color_id: "6"
  },
  {
    id: "7",
    name: "Green",
    color_id: "7"
  },
  {
    id: "8",
    name: "Magenta",
    color_id: "8"
  },
  {
    id: "9",
    name: "Dark blue",
    color_id: "9"
  },
  {
    id: "10",
    name: "Turquoise",
    color_id: "10"
  }
], Ct = ["data-tag_id", "data-tag_color_id", "title"], fe = /* @__PURE__ */ R({
  __name: "tagIcon",
  props: {
    id: {},
    colorId: {},
    name: {},
    state: {}
  },
  setup(e) {
    return (a, o) => (h(), A("div", {
      class: X({
        "top-tagSelector_tagIcon": !0,
        "top-tagSelector-active": !!e.state,
        "top-tagSelector-excluded": e.state === "excluded"
      }),
      "data-tag_id": e.id,
      "data-tag_color_id": e.colorId,
      title: e.name
    }, null, 10, Ct));
  }
}), Bt = ["contenteditable", "onKeydown"], Ae = /* @__PURE__ */ R({
  __name: "tagPopupListItem",
  props: /* @__PURE__ */ V({
    editable: { type: Boolean },
    disabled: { type: Boolean },
    canExclude: { type: Boolean },
    id: {},
    colorId: {},
    name: {},
    state: {}
  }, {
    name: {
      required: !0
    },
    nameModifiers: {}
  }),
  emits: /* @__PURE__ */ V(["update:name", "unselect", "exclude", "select"], ["update:name"]),
  setup(e, { emit: a }) {
    const o = e, t = a, r = T(e, "name"), l = K(null), n = M(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
      contenteditable: u.value,
      onpaste: (m) => m.preventDefault()
    } : {}), u = K(!1), f = async () => {
      u.value = !0, await Re(), l.value?.focus();
    }, c = () => {
      const m = l.value?.innerText;
      if (!m) return x();
      l.value && (l.value.innerText = m), u.value = !1, t("update:name", m);
    }, x = async () => {
      l.value && (l.value.innerText = o.name), u.value = !1;
    }, i = (m) => {
      if (u.value || o.disabled) return;
      let d = "selected";
      o.canExclude && (m.ctrlKey || m.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && t("unselect"), d === "selected" && t("select"), d === "excluded" && t("exclude");
    };
    return (m, d) => (h(), C(ve, {
      class: X({
        "top-tagSelector_tagListItem": !0,
        "top-tagSelector_tagListItem-inEdit": u.value,
        "top-tagSelector_tagListItem-disabled": e.disabled,
        "top-tagSelector_tagListItem-canExclude": e.canExclude,
        "top-tagSelector-active": !!e.state,
        "top-tagSelector-excluded": e.state === "excluded"
      }),
      onClick: U(i, ["stop"])
    }, {
      default: B(() => [
        P(fe, {
          id: e.id,
          name: r.value,
          colorId: e.colorId,
          state: e.state
        }, null, 8, ["id", "name", "colorId", "state"]),
        oe("span", Ve({
          ref_key: "elName",
          ref: l,
          class: "top-tagSelector_tagListItemName",
          contenteditable: u.value ? "plaintext-only" : !1
        }, n.value, {
          onKeydown: [
            Ie(U(c, ["stop"]), ["enter"]),
            Ie(U(x, ["stop"]), ["esc"])
          ]
        }), b(r.value), 17, Bt),
        e.editable ? (h(), A(Y, { key: 0 }, [
          u.value ? (h(), A("span", {
            key: 1,
            "data-top-icon": "",
            class: "top-tagSelector_edit",
            onClick: U(c, ["stop"])
          })) : (h(), A("span", {
            key: 0,
            "data-top-icon": "",
            class: "top-tagSelector_edit",
            onClick: f
          }))
        ], 64)) : O("", !0)
      ]),
      _: 1
    }, 8, ["class"]));
  }
}), Tt = { key: 1 }, At = /* @__PURE__ */ R({
  inheritAttrs: !1,
  __name: "popupOpener",
  props: /* @__PURE__ */ V({
    modelValue: {},
    id: {},
    tags: {},
    mode: {},
    targetId: {},
    filters: {},
    useTopButton: { type: Boolean },
    payload: {},
    styling: {}
  }, {
    modelValue: {
      required: !0
    },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(e) {
    const a = e, o = T(e, "modelValue"), t = a.useTopButton ? Q : "div", r = a.useTopButton ? "html" : "default", l = {
      model: o,
      mode: a.mode,
      targetId: a.targetId,
      filters: a.filters,
      payload: a.payload
    };
    return (n, u) => {
      const f = Pe("top-data");
      return h(), C(Je, { id: e.id }, {
        default: B(() => [
          Ne((h(), C(qe(v(t)), Ve({
            class: {
              "top-tagSelector": !0,
              "top-tagSelector-useTopButton": a.useTopButton,
              "top-tagSelector-custom": !a.useTopButton,
              "top-as-selector": a.useTopButton,
              "top-tagSelector-filter": a.mode === "filter",
              "top-tagSelector-setter_single": a.mode === "setter" && !e.filters,
              "top-tagSelector-setter_several": a.mode === "setter" && e.filters,
              "top-tagSelector-selectedOne": !o.value.length || o.value.length === 1,
              "top-tagSelector-toTwoLine": o.value.length > 5
            },
            color: "theme",
            styling: e.styling
          }, n.$attrs), {
            [v(r)]: B(() => [
              !o.value.length && e.mode === "filter" ? (h(), C(fe, {
                key: 0,
                id: "all",
                colorId: "",
                name: n.$i18n.Common.All_tags ?? "",
                state: ""
              }, null, 8, ["name"])) : O("", !0),
              e.mode === "setter" && e.filters ? (h(), A("div", Tt, [
                De(n.$slots, "default")
              ])) : (h(!0), A(Y, { key: 2 }, me(o.value, (c) => (h(), C(fe, {
                id: v(H)(c),
                colorId: v(ie)(c, e.tags)?.color_id ?? "",
                name: v(ie)(c, e.tags)?.name ?? "",
                state: v(H)(c) === c ? "selected" : "excluded"
              }, null, 8, ["id", "colorId", "name", "state"]))), 256))
            ]),
            _: 2
          }, 1040, ["class", "styling"])), [
            [f, l, "topTagSelectorTarget"]
          ])
        ]),
        _: 3
      }, 8, ["id"]);
    };
  }
}), Ut = /* @__PURE__ */ R({
  __name: "tagSelector",
  props: /* @__PURE__ */ V({
    modelValue: {},
    tags: {},
    tagsEditable: { type: Boolean },
    tagsMax: { default: 10 },
    id: {},
    singleMode: { type: Boolean },
    requiredForSetter: { type: Boolean, default: !0 },
    maxTagsForSetter: {},
    emitDelay: { default: 500 },
    useTopButton: { type: Boolean, default: !0 },
    styling: {}
  }, {
    modelValue: {
      required: !0
    },
    modelModifiers: {},
    tags: {
      default: be(kt)
    },
    tagsModifiers: {}
  }),
  emits: /* @__PURE__ */ V(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
  setup(e, { emit: a }) {
    const o = w(), t = e, r = T(e, "modelValue"), l = T(e, "tags"), n = a, u = ze((p, I) => {
      n(p, I);
    }, t.emitDelay);
    t.singleMode && !r.value.length && (r.value = [l.value[0].id]);
    const f = t.id ?? "top-popup-id-" + Math.random(), c = K("add"), x = () => {
      const p = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
      return I.set("add", { value: "add", title: o.Common.Add + p }), I.set("replace", { value: "replace", title: o.Common.Replace + p }), I.set("delete", { value: "delete", title: o.Common.Delete + p }), I;
    };
    let i = Fe({
      model: r,
      mode: "filter",
      targetId: void 0,
      filters: void 0,
      payload: void 0
    });
    E(r, () => {
      u("selector", r.value);
    });
    const m = M(() => {
      if (i.value.mode === "setter" && t.maxTagsForSetter && !i.value.filters)
        return i.value.model.value.length >= t.maxTagsForSetter;
    }), d = (p) => {
      if (p !== "all") {
        if (i.value.model.value.includes(p)) return "selected";
        if (i.value.model.value.includes(Be(p))) return "excluded";
      }
      return p === "all" && !i.value.model.value.length ? "selected" : "";
    }, s = (p, I) => {
      const S = Be(p);
      let k = i.value.model.value.filter((G) => G !== p && G !== S);
      I === "select" && k.push(p), I === "exclude" && k.push(S), i.value.mode === "setter" && i.value.targetId !== void 0 && t.requiredForSetter && (k.length || k.push("1"), k.length === 2 && i.value.model.value.length === 1 && i.value.model.value[0] === "1" && (k = k.filter((G) => G !== "1"))), t.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((G, ee) => {
        if (!t.tags) return 0;
        const q = t.tags.findIndex((F) => F.id === G), D = t.tags.findIndex((F) => F.id === ee);
        return q - D;
      }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && u("setter", {
        tagsIds: k,
        targetId: i.value.targetId,
        payload: i.value.payload
      });
    }, g = M(() => {
      let p = "top-tagSelector_popup";
      return i.value.mode === "filter" && (p += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (p += " top-tagSelector_popup-setter"), p;
    }), Z = () => {
      const p = prompt("", "New tag");
      if (!p || p === "New tag") return;
      const I = l.value.length + 1;
      l.value.push({
        id: String(I),
        name: p,
        color_id: String((I - 1) % 10 + 1)
      }), n("tagsChanged", l.value);
    }, N = (p) => {
      if (i.value = W(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
      if (i.value.filters && (c.value = "add", i.value.model.value = []), !z.$?.ui.sortable) {
        console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
        return;
      }
      !z.state.isMobile && !z.state.isMobileUA && l.value && $(p.elPopup).sortable({
        items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
        /**
         * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
         */
        cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
        distance: 10,
        stop: function(I, S) {
          if (!l.value) return;
          const k = $(S.item).parent().find("[data-tag_id]"), G = [];
          k.each((ee, q) => {
            if (!l.value) return;
            const D = $(q).attr("data-tag_id");
            G.push(D);
          }), l.value.sort((ee, q) => {
            const D = G.findIndex((de) => de === ee.id), F = G.findIndex((de) => de === q.id);
            return D - F;
          }), u("tagsChanged", l.value);
        }
      });
    }, je = (p) => {
      z.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
    };
    return (p, I) => (h(), A(Y, null, [
      P(At, {
        modelValue: r.value,
        "onUpdate:modelValue": I[0] || (I[0] = (S) => r.value = S),
        id: v(f),
        tags: l.value,
        styling: e.styling,
        mode: "filter",
        useTopButton: e.useTopButton
      }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
      P(we, {
        id: v(f),
        class: X(g.value),
        onOpen: I[4] || (I[4] = (S) => N(S)),
        onClose: I[5] || (I[5] = (S) => je(S)),
        "transition-duration": 50
      }, Ue({
        contentList: B(() => [
          v(i).mode === "filter" && !e.singleMode ? (h(), C(Ae, {
            key: 0,
            id: "all",
            colorId: "",
            name: p.$i18n.Common.All_tags ?? "",
            state: v(i).model.value.length ? "" : "selected",
            onSelect: I[3] || (I[3] = (S) => v(i).model.value = [])
          }, null, 8, ["name", "state"])) : O("", !0),
          (h(!0), A(Y, null, me(l.value, (S) => (h(), C(Ae, {
            key: S.id,
            id: S.id,
            colorId: S.color_id,
            name: S.name,
            state: d(S.id),
            canExclude: v(i).mode === "filter" && !e.singleMode,
            editable: e.tagsEditable,
            disabled: m.value && d(S.id) === "",
            onUnselect: (k) => s(S.id, "unselect"),
            onSelect: (k) => s(S.id, "select"),
            onExclude: (k) => s(S.id, "exclude"),
            "onUpdate:name": (k) => {
              S.name = k, v(u)("tagsChanged", l.value);
            }
          }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
          e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(ve, {
            key: 1,
            "data-top-icon": "",
            onClick: U(Z, ["stop"])
          }, {
            default: B(() => [
              J(b(p.$i18n.Common.Add), 1)
            ]),
            _: 1
          })) : O("", !0)
        ]),
        _: 2
      }, [
        v(i).mode === "setter" && v(i).filters ? {
          name: "header",
          fn: B(() => [
            P(ce, {
              modelValue: c.value,
              "onUpdate:modelValue": I[1] || (I[1] = (S) => c.value = S),
              options: x()
            }, null, 8, ["modelValue", "options"])
          ]),
          key: "0"
        } : void 0,
        v(i).mode === "setter" && v(i).filters ? {
          name: "footer",
          fn: B(() => [
            P(Q, { color: "theme" }, {
              default: B(() => [
                J(b(p.$i18n.Common.Cancel), 1)
              ]),
              _: 1
            }),
            P(Q, {
              onClick: I[2] || (I[2] = (S) => v(u)("setter", {
                tagsIds: v(i).model.value,
                filters: v(i).filters,
                filtersAction: c.value,
                payload: v(i).payload
              }))
            }, {
              default: B(() => [
                J(b(c.value === "add" ? p.$i18n.Common.Add : "") + " " + b(c.value === "replace" ? p.$i18n.Common.Replace : "") + " " + b(c.value === "delete" ? p.$i18n.Common.Delete : ""), 1)
              ]),
              _: 1
            })
          ]),
          key: "1"
        } : void 0
      ]), 1032, ["id", "class"])
    ], 64));
  }
});
export {
  Rt as TopCompetitorSelector,
  qt as TopGroupSelector,
  Nt as TopRegionSelector,
  Ut as TopTagSelector,
  At as TopTagSelectorPopupOpener,
  fe as TopTagSelectorTagIcon,
  it as dialogRegionSelector,
  rt as findRegion,
  Dt as genElTopTagSelectorPopupOpener,
  Ke as genSearcherByKey,
  Ft as renderElTopTagSelectorPopupOpener,
  Pt as useItemsFromCompetitors
};
//# sourceMappingURL=project.js.map
