@topvisor/ui 1.4.1-projectSelector.1 → 1.4.1-projectSelector.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,21 +3,21 @@
3
3
  const fileNames = ['../assets/project.css'].map(fileName => import.meta.resolve(fileName));
4
4
  _autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
5
5
 
6
- import { defineComponent as G, mergeModels as M, useModel as B, computed as w, createElementBlock as T, openBlock as v, createBlock as j, unref as p, withCtx as C, Fragment as q, renderList as se, normalizeClass as Z, createElementVNode as L, toDisplayString as A, createVNode as E, createTextVNode as N, toValue as ke, ref as V, watch as P, createCommentVNode as _, reactive as _e, resolveComponent as Ee, onMounted as Ue, withModifiers as D, isRef as Ce, mergeProps as Ge, withKeys as je, nextTick as Fe, resolveDirective as We, withDirectives as ze, resolveDynamicComponent as Je, renderSlot as Ye, shallowRef as He, createSlots as Qe } from "vue";
7
- import { u as b, C as J, e as Q, q as fe, d as Xe } from "../.chunks/forms-BAUgA7Ct.es.js";
8
- import { _ as he, b as ye, a as Ze } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-BIWw5zUX.es.js";
9
- import { a as et, _ as Ie, b as Se, c as Ke, I as le } from "../.chunks/policy.vue_vue_type_style_index_0_lang-ClaW4X74.es.js";
6
+ import { defineComponent as L, mergeModels as _, useModel as b, computed as P, createElementBlock as j, openBlock as p, createBlock as T, unref as v, withCtx as C, Fragment as D, renderList as se, normalizeClass as ee, createElementVNode as O, toDisplayString as B, createVNode as E, createTextVNode as q, toValue as xe, ref as M, watch as G, createCommentVNode as V, reactive as _e, resolveComponent as Ee, onMounted as Ue, withModifiers as U, isRef as ke, mergeProps as Ge, withKeys as Ce, nextTick as Fe, resolveDirective as We, withDirectives as ze, resolveDynamicComponent as Je, renderSlot as Ye, shallowRef as He, createSlots as Qe } from "vue";
7
+ import { u as w, C as Y, e as X, q as fe, d as Xe } from "../.chunks/forms-BAUgA7Ct.es.js";
8
+ import { _ as pe, b as he, a as Ze } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-BIWw5zUX.es.js";
9
+ import { a as et, _ as ye, b as Ie, c as Le, I as ne } from "../.chunks/policy.vue_vue_type_style_index_0_lang-ClaW4X74.es.js";
10
10
  import { u as tt } from "../.chunks/utils-BYaZxGC1.es.js";
11
- import { getSearcherGIcon as ot, getLangLabel as lt, getDeviceGIcon as nt } from "../utils/searchers.js";
11
+ import { getSearcherGIcon as ot, getLangLabel as nt, getDeviceGIcon as lt } from "../utils/searchers.js";
12
12
  import "../.chunks/core-BE_-rKvW.es.js";
13
13
  import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-DMhcuiHP.es.js";
14
14
  import { g as Te } from "../.chunks/field-CyyFzM-Y.es.js";
15
- import { validUrl as Ae } from "../utils/check.js";
16
- import { storage as Y } from "../utils/dom.js";
15
+ import { validUrl as je } from "../utils/check.js";
16
+ import { storage as H } from "../utils/dom.js";
17
17
  import { TopPopupWorker as at } from "../popup/worker.js";
18
- const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" }, io = /* @__PURE__ */ G({
18
+ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" }, io = /* @__PURE__ */ L({
19
19
  __name: "competitorSelector",
20
- props: /* @__PURE__ */ M({
20
+ props: /* @__PURE__ */ _({
21
21
  modelValue: {},
22
22
  items: {},
23
23
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -27,33 +27,33 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
27
27
  }),
28
28
  emits: ["update:modelValue"],
29
29
  setup(e) {
30
- const t = e, o = B(e, "modelValue"), l = w(() => {
30
+ const t = e, o = b(e, "modelValue"), n = P(() => {
31
31
  if (t.showSelectAllItem)
32
32
  return {
33
33
  icon: "",
34
- title: b().Common.Select_all,
34
+ title: w().Common.Select_all,
35
35
  value: "all",
36
36
  content: ""
37
37
  };
38
38
  });
39
- return (a, n) => (v(), T("div", rt, [
40
- p(J).state.isMobile ? (v(), j(he, { key: 0 }, {
39
+ return (a, l) => (p(), j("div", rt, [
40
+ v(Y).state.isMobile ? (p(), T(pe, { key: 0 }, {
41
41
  opener: C(() => [
42
- E(Q, {
42
+ E(X, {
43
43
  class: "top-competitorSelector_opener",
44
44
  color: "theme",
45
45
  icon: "",
46
46
  icon2: ""
47
47
  }, {
48
48
  default: C(() => [
49
- N(A(e.items.find((r) => r.value === o.value?.[0])?.content), 1)
49
+ q(B(e.items.find((r) => r.value === o.value?.[0])?.content), 1)
50
50
  ]),
51
51
  _: 1
52
52
  })
53
53
  ]),
54
54
  contentList: C(() => [
55
- (v(!0), T(q, null, se(e.items, (r) => (v(), j(ye, {
56
- class: Z({
55
+ (p(!0), j(D, null, se(e.items, (r) => (p(), T(he, {
56
+ class: ee({
57
57
  "top-active": o.value?.includes(r.value)
58
58
  }),
59
59
  "data-top-icon": r.icon,
@@ -61,30 +61,30 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
61
61
  onClick: () => o.value = [r.value]
62
62
  }, {
63
63
  default: C(() => [
64
- L("span", it, A(r.content), 1)
64
+ O("span", it, B(r.content), 1)
65
65
  ]),
66
66
  _: 2
67
67
  }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
68
68
  ]),
69
69
  _: 1
70
- })) : (v(), j(et, {
70
+ })) : (p(), T(et, {
71
71
  key: 1,
72
72
  modelValue: o.value,
73
- "onUpdate:modelValue": n[0] || (n[0] = (r) => o.value = r),
73
+ "onUpdate:modelValue": l[0] || (l[0] = (r) => o.value = r),
74
74
  items: e.items,
75
75
  isMultiple: !0,
76
76
  styling: "bar",
77
77
  canBeEmptyMultiple: !1,
78
- selectAllItem: l.value
78
+ selectAllItem: n.value
79
79
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
80
80
  ]));
81
81
  }
82
- }), so = (e, t) => w(() => ke(e).filter((a) => a.on >= 0 || a.id === t).map((a) => ({
82
+ }), so = (e, t) => P(() => xe(e).filter((a) => a.on >= 0 || a.id === t).map((a) => ({
83
83
  value: a.id,
84
84
  title: a.url + ` [${a.id}]`,
85
- icon: a.id === ke(t) ? "" : "",
85
+ icon: a.id === xe(t) ? "" : "",
86
86
  content: a.name
87
- }))), O = -1, y = -2, ne = -1, dt = {
87
+ }))), R = -1, y = -2, le = -1, dt = {
88
88
  0: "Yandex",
89
89
  1: "Google",
90
90
  4: "YouTube",
@@ -94,15 +94,15 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
94
94
  9: "GoogleStore",
95
95
  20: "Yandex.com",
96
96
  21: "Yandex.com.tr"
97
- }, Be = {
97
+ }, Ae = {
98
98
  key: y,
99
99
  name: "--",
100
100
  index: y
101
- }, Le = {
101
+ }, Ke = {
102
102
  key: y,
103
103
  name: "--",
104
- regions: [Be],
105
- regionByIndex: /* @__PURE__ */ new Map([[y, Be]])
104
+ regions: [Ae],
105
+ regionByIndex: /* @__PURE__ */ new Map([[y, Ae]])
106
106
  }, ae = {
107
107
  key: y,
108
108
  name: "Autoselect",
@@ -112,35 +112,35 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
112
112
  name: "Autoselect",
113
113
  regions: [ae],
114
114
  regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
115
- }, be = {
115
+ }, Be = {
116
116
  countryCode: "00",
117
117
  depth: 1,
118
118
  device: 0,
119
- key: ne,
120
- index: ne,
119
+ key: le,
120
+ index: le,
121
121
  lang: "ru",
122
122
  name: "Without region"
123
- }, st = () => (ae.name = b().Common.Autoselect, ae), ut = () => (st(), ce.name = b().Common.Autoselect, console.log(ce), ce), ct = () => (be.name = b().Keywords.Without_region, be), Oe = (e = !1, t = !1, o = []) => {
124
- let l;
125
- return e ? l = gt(o) : l = Re(o), t && l.set(y, ut()), l.size || l.set(y, Le), l;
126
- }, Re = (e, t = !0, o = [], l = !1) => {
123
+ }, st = () => (ae.name = w().Common.Autoselect, ae), ut = () => (st(), ce.name = w().Common.Autoselect, console.log(ce), ce), ct = () => (Be.name = w().Keywords.Without_region, Be), Oe = (e = !1, t = !1, o = []) => {
124
+ let n;
125
+ return e ? n = gt(o) : n = Re(o), t && n.set(y, ut()), n.size || n.set(y, Ke), n;
126
+ }, Re = (e, t = !0, o = [], n = !1) => {
127
127
  const a = /* @__PURE__ */ new Map();
128
- return e.forEach((n) => {
129
- if (!n.enabled || l && typeof n.key == "number" && n.key > 1) return;
130
- const r = { ...n };
131
- r.regionByIndex = /* @__PURE__ */ new Map(), n.regions && n.regions.forEach((u) => {
128
+ return e.forEach((l) => {
129
+ if (!l.enabled || n && typeof l.key == "number" && l.key > 1) return;
130
+ const r = { ...l };
131
+ r.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((u) => {
132
132
  if (t && !u.enabled) return;
133
133
  const c = { ...u };
134
134
  r.regionByIndex.set(c.index, c);
135
135
  }), !r.regionByIndex.size && o.length, // режим вывода ПС без регионов
136
- (!n.regions || // есть включенные регионы
136
+ (!l.regions || // есть включенные регионы
137
137
  r.regionByIndex.size || // запрошен вывод конкретных ПС
138
138
  o.length) && typeof r.key == "number" && a.set(r.key, r);
139
- }), o.forEach((n) => {
140
- if (a.has(n)) return;
139
+ }), o.forEach((l) => {
140
+ if (a.has(l)) return;
141
141
  const r = {
142
- key: n,
143
- name: dt[n],
142
+ key: l,
143
+ name: dt[l],
144
144
  regions: [],
145
145
  regionByIndex: /* @__PURE__ */ new Map()
146
146
  };
@@ -154,103 +154,103 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
154
154
  }
155
155
  return t.forEach((o) => {
156
156
  if (!o.regionByIndex) return;
157
- const l = { ...ct() };
158
- o.regionByIndex.set(l.index, l);
157
+ const n = { ...ct() };
158
+ o.regionByIndex.set(n.index, n);
159
159
  }), t;
160
160
  }, ft = (e, t, o = []) => {
161
- const l = Oe(e, !1, o);
161
+ const n = Oe(e, !1, o);
162
162
  let a;
163
- return l.forEach((n) => {
164
- if (!(t.searcher_key !== void 0 && t.searcher_key != n.key) && n.regions && (n.regions.forEach((r) => {
163
+ return n.forEach((l) => {
164
+ if (!(t.searcher_key !== void 0 && t.searcher_key != l.key) && l.regions && (l.regions.forEach((r) => {
165
165
  if (!a && !(t.key !== void 0 && t.key != r.key) && !(t.index !== void 0 && t.index != r.index) && !(!e && (t.lang !== void 0 && t.lang != r.lang || t.device !== void 0 && t.device != r.device)))
166
- return r.searcher_key = n.key, a = r, !1;
166
+ return r.searcher_key = l.key, a = r, !1;
167
167
  }), a))
168
168
  return !1;
169
169
  }), a;
170
- }, mt = tt(() => import("../.chunks/dialog_regionSelectorRegions-Btp9cfmF.es.js")), pt = (e, t) => {
171
- const o = b(), l = V(t.value.keys().next().value ?? y), a = w(() => {
172
- const n = /* @__PURE__ */ new Map();
170
+ }, mt = tt(() => import("../.chunks/dialog_regionSelectorRegions-Btp9cfmF.es.js")), vt = (e, t) => {
171
+ const o = w(), n = M(t.value.keys().next().value ?? y), a = P(() => {
172
+ const l = /* @__PURE__ */ new Map();
173
173
  if (t.value.forEach((r) => {
174
174
  let u = {
175
175
  value: r.key,
176
176
  title: r.name
177
177
  };
178
- e.addSearcherIcon && (u.icon = ot(r.key)), n.set(r.key, u);
179
- }), e.addCompare && !n.has(y)) {
178
+ e.addSearcherIcon && (u.icon = ot(r.key)), l.set(r.key, u);
179
+ }), e.addCompare && !l.has(y)) {
180
180
  const r = {
181
181
  value: "",
182
182
  title: "--------------------",
183
183
  disabled: !0
184
184
  };
185
- n.set(r.value, r);
185
+ l.set(r.value, r);
186
186
  const u = {
187
- value: O,
187
+ value: R,
188
188
  title: o.Common.Compare
189
189
  };
190
- n.set(u.value, u);
190
+ l.set(u.value, u);
191
191
  }
192
- return n;
192
+ return l;
193
193
  });
194
194
  return {
195
- searcherKey: l,
195
+ searcherKey: n,
196
196
  optionBySearcherKey: a
197
197
  };
198
- }, vt = (e, t) => {
199
- const o = b(), l = V(y);
200
- e.modelValue.length === 1 && (l.value = e.modelValue[0]), l.value === y && (e.forFrequency ? l.value = t.value?.regionByIndex.values().next().value?.key ?? y : l.value = t.value?.regionByIndex.keys().next().value ?? y);
201
- const a = w(() => {
202
- const n = /* @__PURE__ */ new Map();
198
+ }, pt = (e, t) => {
199
+ const o = w(), n = M(y);
200
+ e.modelValue.length === 1 && (n.value = e.modelValue[0]), n.value === y && (e.forFrequency ? n.value = t.value?.regionByIndex.values().next().value?.key ?? y : n.value = t.value?.regionByIndex.keys().next().value ?? y);
201
+ const a = P(() => {
202
+ const l = /* @__PURE__ */ new Map();
203
203
  return t.value.regionByIndex?.forEach((r) => {
204
204
  let u = r.name;
205
205
  if (e.forFrequency) {
206
- const S = {
206
+ const I = {
207
207
  value: r.key,
208
208
  title: u
209
209
  };
210
- n.has(r.key) || n.set(r.key, S);
210
+ l.has(r.key) || l.set(r.key, I);
211
211
  return;
212
212
  }
213
213
  r.device && (u += " (" + o.Common["Device_" + r.device] + ")");
214
- const c = lt(t.value.key || 0, r.lang ?? "");
214
+ const c = nt(t.value.key || 0, r.lang ?? "");
215
215
  c && (u += " / " + c);
216
- const f = {
216
+ const g = {
217
217
  value: r.index,
218
218
  title: u,
219
- icon: r.device ? nt(r.device) : void 0
219
+ icon: r.device ? lt(r.device) : void 0
220
220
  };
221
- n.set(r.index, f);
222
- }), n;
221
+ l.set(r.index, g);
222
+ }), l;
223
223
  });
224
- return P(a, (n, r) => {
225
- if (e.onlySearcher || l.value !== void 0 && n.get(l.value))
224
+ return G(a, (l, r) => {
225
+ if (e.onlySearcher || n.value !== void 0 && l.get(n.value))
226
226
  return;
227
- let u = n.keys().next().value;
228
- if (l.value === y || u === y) {
229
- l.value = u;
227
+ let u = l.keys().next().value;
228
+ if (n.value === y || u === y) {
229
+ n.value = u;
230
230
  return;
231
231
  }
232
- let c = r?.get(l.value)?.title || "", f = -1;
233
- for (const [S, i] of n.entries()) {
234
- const g = i.title;
235
- if (typeof g != "string" || typeof S == "string")
232
+ let c = r?.get(n.value)?.title || "", g = -1;
233
+ for (const [I, d] of l.entries()) {
234
+ const m = d.title;
235
+ if (typeof m != "string" || typeof I == "string")
236
236
  break;
237
- if (g === c) {
238
- u = S;
237
+ if (m === c) {
238
+ u = I;
239
239
  break;
240
240
  }
241
- const d = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
242
- let s = c, m = 3;
243
- g.indexOf(s) === -1 && (s = c.replace(/^[^a-zа-я]/i, "").replace(d, ""), m--), g.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), m--), g.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(d, ""), m--), g.indexOf(s) !== -1 && (m <= f || (f = m, u = S));
241
+ const i = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
242
+ let s = c, f = 3;
243
+ m.indexOf(s) === -1 && (s = c.replace(/^[^a-zа-я]/i, "").replace(i, ""), f--), m.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), f--), m.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(i, ""), f--), m.indexOf(s) !== -1 && (f <= g || (g = f, u = I));
244
244
  }
245
- l.value = u;
245
+ n.value = u;
246
246
  }), {
247
- regionIndex: l,
247
+ regionIndex: n,
248
248
  optionByRegionIndex: a
249
249
  };
250
250
  }, ht = (e, t, o) => {
251
- const l = V([]), a = () => {
251
+ const n = M([]), a = () => {
252
252
  if (e.onlySearcher && t.value) {
253
- l.value = Array.from(t.value.keys());
253
+ n.value = Array.from(t.value.keys());
254
254
  return;
255
255
  }
256
256
  let r = [];
@@ -263,72 +263,72 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
263
263
  ) ?? [];
264
264
  } catch {
265
265
  }
266
- r.length && (r = r.filter((u) => o.value.has(u))), r.length || (r = Array.from(o.value)), l.value = [...r];
267
- }, n = () => {
268
- l.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(l.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
266
+ r.length && (r = r.filter((u) => o.value.has(u))), r.length || (r = Array.from(o.value)), n.value = [...r];
267
+ }, l = () => {
268
+ n.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(n.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
269
269
  };
270
- return P(l, () => {
271
- n();
270
+ return G(n, () => {
271
+ l();
272
272
  }), e.addCompare && a(), {
273
- regionsIndexes: l
273
+ regionsIndexes: n
274
274
  };
275
275
  }, yt = (e) => {
276
- const t = w(() => Oe(e.forFrequency, e.autoRegion, e.searchers)), o = w(() => t.value.get(a.searcherKey.value) || Le), l = w(() => {
277
- const i = /* @__PURE__ */ new Set();
278
- return t.value.forEach((g) => {
279
- g.regionByIndex.forEach((d) => {
280
- d.index !== ne && d.index !== y && i.add(d.index);
276
+ const t = P(() => Oe(e.forFrequency, e.autoRegion, e.searchers)), o = P(() => t.value.get(a.searcherKey.value) || Ke), n = P(() => {
277
+ const d = /* @__PURE__ */ new Set();
278
+ return t.value.forEach((m) => {
279
+ m.regionByIndex.forEach((i) => {
280
+ i.index !== le && i.index !== y && d.add(i.index);
281
281
  });
282
- }), i;
283
- }), a = pt(e, t), n = vt(e, o), r = ht(e, t, l);
284
- P(t, () => {
285
- if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((g) => l.value.has(g)), a.searcherKey.value === O) return;
286
- let i = t.value.keys().next().value;
287
- t.value.forEach((g) => {
288
- if (e.onlySearcher && g.key === a.searcherKey.value) {
289
- i = a.searcherKey.value;
282
+ }), d;
283
+ }), a = vt(e, t), l = pt(e, o), r = ht(e, t, n);
284
+ G(t, () => {
285
+ if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((m) => n.value.has(m)), a.searcherKey.value === R) return;
286
+ let d = t.value.keys().next().value;
287
+ t.value.forEach((m) => {
288
+ if (e.onlySearcher && m.key === a.searcherKey.value) {
289
+ d = a.searcherKey.value;
290
290
  return;
291
291
  }
292
- if (n.regionIndex.value && g.regionByIndex?.has(n.regionIndex.value) && (i = g.key), !e.onlySearcher) {
293
- let d;
294
- i !== void 0 && (d = t.value.get(i)?.regionByIndex);
295
- const s = t.value.get(g.key)?.regionByIndex;
296
- d?.has(y) && !s?.has(y) && (i = g.key);
292
+ if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (d = m.key), !e.onlySearcher) {
293
+ let i;
294
+ d !== void 0 && (i = t.value.get(d)?.regionByIndex);
295
+ const s = t.value.get(m.key)?.regionByIndex;
296
+ i?.has(y) && !s?.has(y) && (d = m.key);
297
297
  }
298
- }), i !== void 0 && (a.searcherKey.value = i), n.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(n.regionIndex.value) && (n.regionIndex.value = o.value?.regions?.keys().next().value);
298
+ }), d !== void 0 && (a.searcherKey.value = d), l.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = o.value?.regions?.keys().next().value);
299
299
  }, { immediate: !0 });
300
300
  const u = () => {
301
- if (!(a.searcherKey.value === O || a.searcherKey.value === y))
301
+ if (!(a.searcherKey.value === R || a.searcherKey.value === y))
302
302
  return a.searcherKey.value;
303
303
  }, c = () => {
304
- if (e.onlySearcher || n.regionIndex.value === y) return;
305
- let i = n.regionIndex.value;
304
+ if (e.onlySearcher || l.regionIndex.value === y) return;
305
+ let d = l.regionIndex.value;
306
306
  if (e.forFrequency) {
307
- const g = n.regionIndex.value;
308
- i = ft(e.forFrequency, { searcher_key: u(), key: g }, e.searchers)?.index;
307
+ const m = l.regionIndex.value;
308
+ d = ft(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
309
309
  }
310
- return i;
311
- }, f = () => {
312
- const i = u();
313
- if (i !== void 0)
314
- return t.value.get(i);
310
+ return d;
311
+ }, g = () => {
312
+ const d = u();
313
+ if (d !== void 0)
314
+ return t.value.get(d);
315
315
  };
316
316
  return {
317
317
  selectSearcher: a,
318
- selectRegion: n,
318
+ selectRegion: l,
319
319
  compare: r,
320
320
  searcherByKey: t,
321
- allRegionsIndexes: l,
322
- getSearcher: f,
321
+ allRegionsIndexes: n,
322
+ getSearcher: g,
323
323
  getRegion: () => {
324
- const i = c();
325
- if (i !== void 0)
326
- return f()?.regionByIndex?.get(i);
324
+ const d = c();
325
+ if (d !== void 0)
326
+ return g()?.regionByIndex?.get(d);
327
327
  }
328
328
  };
329
- }, uo = /* @__PURE__ */ G({
329
+ }, uo = /* @__PURE__ */ L({
330
330
  __name: "regionSelector",
331
- props: /* @__PURE__ */ M({
331
+ props: /* @__PURE__ */ _({
332
332
  projectId: {},
333
333
  searchers: { default: () => [] },
334
334
  modelValue: {},
@@ -348,162 +348,162 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
348
348
  }),
349
349
  emits: ["update:modelValue", "update:modelValueSingle"],
350
350
  setup(e, { expose: t }) {
351
- const o = e, l = B(e, "modelValue"), a = B(e, "modelValueSingle"), {
352
- selectSearcher: n,
351
+ const o = e, n = b(e, "modelValue"), a = b(e, "modelValueSingle"), {
352
+ selectSearcher: l,
353
353
  selectRegion: r,
354
354
  compare: u,
355
355
  searcherByKey: c,
356
- allRegionsIndexes: f,
357
- getSearcher: S,
358
- getRegion: i
359
- } = yt(o), g = () => {
360
- const d = [];
356
+ allRegionsIndexes: g,
357
+ getSearcher: I,
358
+ getRegion: d
359
+ } = yt(o), m = () => {
360
+ const i = [];
361
361
  c.value.forEach((s) => {
362
- s.enabled && s.regions.forEach((m) => {
363
- m.enabled && d.push(m);
362
+ s.enabled && s.regions.forEach((f) => {
363
+ f.enabled && i.push(f);
364
364
  });
365
365
  }), mt.open("regions", {
366
- regions: d,
366
+ regions: i,
367
367
  regionsIndexes: u.regionsIndexes.value,
368
368
  "@update:regionsIndexes": (s) => u.regionsIndexes.value = s
369
369
  });
370
370
  };
371
- return P([r.regionIndex, n.searcherKey, u.regionsIndexes], () => {
372
- if (n.searcherKey.value === O && u.regionsIndexes.value.length) {
373
- if (JSON.stringify(l.value) === JSON.stringify(u.regionsIndexes.value))
371
+ return G([r.regionIndex, l.searcherKey, u.regionsIndexes], () => {
372
+ if (l.searcherKey.value === R && u.regionsIndexes.value.length) {
373
+ if (JSON.stringify(n.value) === JSON.stringify(u.regionsIndexes.value))
374
374
  return;
375
- l.value = [...u.regionsIndexes.value];
375
+ n.value = [...u.regionsIndexes.value];
376
376
  } else
377
- o.onlySearcher ? (l.value = [n.searcherKey.value], n.searcherKey.value === y && !o.autoRegion && (l.value.length = 0)) : (l.value = [r.regionIndex.value], r.regionIndex.value === y && !o.autoRegion && (l.value.length = 0));
378
- !o.onlySearcher && !f.value.size && (n.searcherKey.value = y);
379
- }), a.value && P(a, () => {
380
- a.value && (l.value = [a.value]);
381
- }, { immediate: !0 }), P(l, () => {
382
- if (l.value[0] && (a.value = l.value[0]), o.onlySearcher) {
383
- if (!l.value.length || l.value.length === 1 && !c.value.has(l.value[0]) || l.value.length === 1 && l.value[0] === y && !o.autoRegion) {
384
- let d = c.value.keys().next().value;
385
- d === y && !o.autoRegion && (d = void 0, a.value = y), d !== void 0 ? l.value = [d] : l.value.length = 0;
377
+ o.onlySearcher ? (n.value = [l.searcherKey.value], l.searcherKey.value === y && !o.autoRegion && (n.value.length = 0)) : (n.value = [r.regionIndex.value], r.regionIndex.value === y && !o.autoRegion && (n.value.length = 0));
378
+ !o.onlySearcher && !g.value.size && (l.searcherKey.value = y);
379
+ }), a.value && G(a, () => {
380
+ a.value && (n.value = [a.value]);
381
+ }, { immediate: !0 }), G(n, () => {
382
+ if (n.value[0] && (a.value = n.value[0]), o.onlySearcher) {
383
+ if (!n.value.length || n.value.length === 1 && !c.value.has(n.value[0]) || n.value.length === 1 && n.value[0] === y && !o.autoRegion) {
384
+ let i = c.value.keys().next().value;
385
+ i === y && !o.autoRegion && (i = void 0, a.value = y), i !== void 0 ? n.value = [i] : n.value.length = 0;
386
386
  return;
387
387
  }
388
- if (l.value.length > 1 && JSON.stringify(l.value) !== JSON.stringify(u.regionsIndexes.value)) {
389
- l.value = [...u.regionsIndexes.value];
388
+ if (n.value.length > 1 && JSON.stringify(n.value) !== JSON.stringify(u.regionsIndexes.value)) {
389
+ n.value = [...u.regionsIndexes.value];
390
390
  return;
391
391
  }
392
392
  } else {
393
- let d = [...new Set(l.value)], s = c.value.values().next().value?.regionByIndex?.keys().next().value;
394
- if (o.forFrequency && (s = c.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, a.value = y), !d.length)
395
- s !== void 0 && d.push(s);
396
- else if (d.length === 1) {
397
- let m = f.value;
398
- o.forFrequency && (m = /* @__PURE__ */ new Set(), c.value.forEach((ee) => {
399
- ee.regionByIndex.forEach((U) => {
400
- U.index !== ne && U.index !== y && m.add(U.key);
393
+ let i = [...new Set(n.value)], s = c.value.values().next().value?.regionByIndex?.keys().next().value;
394
+ if (o.forFrequency && (s = c.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, a.value = y), !i.length)
395
+ s !== void 0 && i.push(s);
396
+ else if (i.length === 1) {
397
+ let f = g.value;
398
+ o.forFrequency && (f = /* @__PURE__ */ new Set(), c.value.forEach((A) => {
399
+ A.regionByIndex.forEach((F) => {
400
+ F.index !== le && F.index !== y && f.add(F.key);
401
401
  });
402
- })), m.has(d[0]) || (d = [], s !== void 0 && d.push(s));
402
+ })), f.has(i[0]) || (i = [], s !== void 0 && i.push(s));
403
403
  } else
404
- d = d.filter((m) => f.value.has(m)), !d.length && s !== void 0 && d.push(s);
405
- if (JSON.stringify(l.value) !== JSON.stringify(d)) {
406
- l.value = d;
404
+ i = i.filter((f) => g.value.has(f)), !i.length && s !== void 0 && i.push(s);
405
+ if (JSON.stringify(n.value) !== JSON.stringify(i)) {
406
+ n.value = i;
407
407
  return;
408
408
  }
409
409
  }
410
- if (!(l.value.length === 1 && l.value[0] === (o.onlySearcher ? n.searcherKey.value : r.regionIndex.value)))
410
+ if (!(n.value.length === 1 && n.value[0] === (o.onlySearcher ? l.searcherKey.value : r.regionIndex.value)))
411
411
  if (o.onlySearcher) {
412
- if (l.value.length === 1) {
413
- n.searcherKey.value = l.value[0];
412
+ if (n.value.length === 1) {
413
+ l.searcherKey.value = n.value[0];
414
414
  return;
415
415
  }
416
- n.searcherKey.value = O;
416
+ l.searcherKey.value = R;
417
417
  return;
418
418
  } else {
419
- if (!l.value.length)
419
+ if (!n.value.length)
420
420
  return;
421
- if (l.value.length === 1 && n.searcherKey.value !== O) {
422
- r.regionIndex.value = l.value[0];
423
- let d;
421
+ if (n.value.length === 1 && l.searcherKey.value !== R) {
422
+ r.regionIndex.value = n.value[0];
423
+ let i;
424
424
  for (const s of c.value.values()) {
425
- for (const m of s.regionByIndex.values())
426
- if ((o.forFrequency ? m.key : m.index) === r.regionIndex.value) {
427
- d = s.key;
425
+ for (const f of s.regionByIndex.values())
426
+ if ((o.forFrequency ? f.key : f.index) === r.regionIndex.value) {
427
+ i = s.key;
428
428
  break;
429
429
  }
430
- if (d !== void 0)
430
+ if (i !== void 0)
431
431
  break;
432
432
  }
433
- d !== void 0 && (n.searcherKey.value = d);
433
+ i !== void 0 && (l.searcherKey.value = i);
434
434
  } else
435
- n.searcherKey.value = O, u.regionsIndexes.value = [...l.value];
435
+ l.searcherKey.value = R, u.regionsIndexes.value = [...n.value];
436
436
  }
437
437
  }, { immediate: !0 }), t({
438
- getSearcher: S,
439
- getRegion: i
440
- }), (d, s) => (v(), T("div", {
441
- class: Z({
438
+ getSearcher: I,
439
+ getRegion: d
440
+ }), (i, s) => (p(), j("div", {
441
+ class: ee({
442
442
  "top-selectorRegion": !0,
443
443
  "top-selectorRegion-onlySearcher": e.onlySearcher
444
444
  })
445
445
  }, [
446
446
  E(fe, {
447
- options: p(n).optionBySearcherKey.value,
448
- modelValue: p(n).searcherKey.value,
449
- "onUpdate:modelValue": s[0] || (s[0] = (m) => p(n).searcherKey.value = m),
447
+ options: v(l).optionBySearcherKey.value,
448
+ modelValue: v(l).searcherKey.value,
449
+ "onUpdate:modelValue": s[0] || (s[0] = (f) => v(l).searcherKey.value = f),
450
450
  name: "searcher_key",
451
451
  addChanger: e.addChanger
452
452
  }, null, 8, ["options", "modelValue", "addChanger"]),
453
- !e.onlySearcher && p(n).searcherKey.value !== p(O) ? (v(), j(fe, {
453
+ !e.onlySearcher && v(l).searcherKey.value !== v(R) ? (p(), T(fe, {
454
454
  key: 0,
455
455
  class: "top-select-region",
456
- options: p(r).optionByRegionIndex.value,
457
- modelValue: p(r).regionIndex.value,
458
- "onUpdate:modelValue": s[1] || (s[1] = (m) => p(r).regionIndex.value = m),
456
+ options: v(r).optionByRegionIndex.value,
457
+ modelValue: v(r).regionIndex.value,
458
+ "onUpdate:modelValue": s[1] || (s[1] = (f) => v(r).regionIndex.value = f),
459
459
  name: e.forFrequency ? "region_key" : "region_index",
460
460
  addChanger: e.addChanger,
461
461
  "data-top-icon": e.addRegionIcon ? "" : void 0
462
- }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : _("", !0),
463
- e.addCompare && !e.onlySearcher && p(n).searcherKey.value === p(O) ? (v(), j(Q, {
462
+ }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : V("", !0),
463
+ e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(R) ? (p(), T(X, {
464
464
  key: 1,
465
465
  name: "compare",
466
- onClick: g,
467
- "data-count-compare-regions-indexes": p(u).regionsIndexes.value.length
466
+ onClick: m,
467
+ "data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
468
468
  }, {
469
469
  default: C(() => [
470
- N(A(d.$i18n.Common.Selected_regions), 1)
470
+ q(B(i.$i18n.Common.Selected_regions), 1)
471
471
  ]),
472
472
  _: 1
473
- }, 8, ["data-count-compare-regions-indexes"])) : _("", !0)
473
+ }, 8, ["data-count-compare-regions-indexes"])) : V("", !0)
474
474
  ], 2));
475
475
  }
476
- }), R = {
476
+ }), N = {
477
477
  id: 0,
478
478
  name: "/",
479
479
  path: "/"
480
480
  };
481
481
  function It(e) {
482
- return e ? b()?.Common.All_folders : "/ (" + b()?.Keywords.Root_folder + ")";
482
+ return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
483
483
  }
484
- const xe = (e, t, o = /* @__PURE__ */ new Map(), l = { id: "root" }, a = 0) => (l.childsIds = [], l.id && (l.countAllGroupsActive = l.count_groups_active), e[l.id] && e[l.id].forEach((n) => {
485
- n = { ...n }, l.childsIds.push(n.id), n.id === 0 && (n.name = It(t));
484
+ const Se = (e, t, o = /* @__PURE__ */ new Map(), n = { id: "root" }, a = 0) => (n.childsIds = [], n.id && (n.countAllGroupsActive = n.count_groups_active), e[n.id] && e[n.id].forEach((l) => {
485
+ l = { ...l }, n.childsIds.push(l.id), l.id === 0 && (l.name = It(t));
486
486
  const r = a > 1 ? "-".repeat(a - 1) + " " : "";
487
- r && !n.name.startsWith(r) && (n.name = r + n.name), o.set(n.id, n), xe(e, t, o, n, a + 1), l.childsIds = l.childsIds.concat(n.childsIds), l.id && n.count_groups_active && (l.countAllGroupsActive += n.count_groups_active);
487
+ r && !l.name.startsWith(r) && (l.name = r + l.name), o.set(l.id, l), Se(e, t, o, l, a + 1), n.childsIds = n.childsIds.concat(l.childsIds), n.id && l.count_groups_active && (n.countAllGroupsActive += l.count_groups_active);
488
488
  }), o), St = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
489
489
  function me(e, t, o) {
490
- const l = Object.keys(e), a = l.map((n) => e[n]);
491
- return P(a, (n, r, u) => {
490
+ const n = Object.keys(e), a = n.map((l) => e[l]);
491
+ return G(a, (l, r, u) => {
492
492
  const c = {};
493
- n.forEach((f, S) => {
494
- if (!Object.is(f, r[S])) {
495
- const i = l[S];
496
- c[i] = {
497
- old: r[S],
498
- new: f
493
+ l.forEach((g, I) => {
494
+ if (!Object.is(g, r[I])) {
495
+ const d = n[I];
496
+ c[d] = {
497
+ old: r[I],
498
+ new: g
499
499
  };
500
500
  }
501
501
  }), Object.keys(c).length && t(c, u);
502
502
  }, o);
503
503
  }
504
- const xt = /* @__PURE__ */ G({
504
+ const xt = /* @__PURE__ */ L({
505
505
  __name: "folders",
506
- props: /* @__PURE__ */ M({
506
+ props: /* @__PURE__ */ _({
507
507
  folderId: {},
508
508
  folder: {},
509
509
  folders: {},
@@ -515,41 +515,41 @@ const xt = /* @__PURE__ */ G({
515
515
  }, {
516
516
  folderId: { required: !0 },
517
517
  folderIdModifiers: {},
518
- folder: { default: R },
518
+ folder: { default: N },
519
519
  folderModifiers: {}
520
520
  }),
521
521
  emits: ["update:folderId", "update:folder"],
522
522
  setup(e) {
523
- const t = e, o = B(e, "folderId"), l = B(e, "folder"), a = t.client && !t.folders ? St(t.client) : void 0, n = V(null);
524
- P(() => t.projectId, () => {
523
+ const t = e, o = b(e, "folderId"), n = b(e, "folder"), a = t.client && !t.folders ? St(t.client) : void 0, l = M(null);
524
+ G(() => t.projectId, () => {
525
525
  a?.changeParams({
526
526
  project_id: t.projectId
527
527
  }), a?.setOptions({
528
528
  checkFingerprint: "TopGroupSelectorFolders:" + t.projectId
529
- }), n.value?.resetCache();
529
+ }), l.value?.resetCache();
530
530
  }, { immediate: !0 });
531
- const r = w(() => xe(t.folders ?? { root: [R] }, t.canSelectAll));
531
+ const r = P(() => Se(t.folders ?? { root: [N] }, t.canSelectAll));
532
532
  return me({
533
- modelFolder: l,
533
+ modelFolder: n,
534
534
  modelFolderId: o
535
535
  }, async (u) => {
536
- if (o.value === l.value.id)
536
+ if (o.value === n.value.id)
537
537
  return;
538
538
  if (u.modelFolder && !u.modelFolderId) {
539
- o.value = l.value.id;
539
+ o.value = n.value.id;
540
540
  return;
541
541
  }
542
542
  let c = r.value.get(t.folderId);
543
- c || (c = R), l.value = c, o.value = c.id;
544
- }, { immediate: !0 }), (u, c) => (v(), j(Ie, {
543
+ c || (c = N), n.value = c, o.value = c.id;
544
+ }, { immediate: !0 }), (u, c) => (p(), T(ye, {
545
545
  class: "top-groupSelector_folder",
546
- modelValue: l.value,
547
- "onUpdate:modelValue": c[0] || (c[0] = (f) => l.value = f),
546
+ modelValue: n.value,
547
+ "onUpdate:modelValue": c[0] || (c[0] = (g) => n.value = g),
548
548
  items: e.folders ? [...r.value.values()] : void 0,
549
549
  "search-type": "inline",
550
550
  icon: e.addIcon ? "" : void 0,
551
- api: e.folders ? void 0 : p(a),
552
- apiSetSearchParams: (...f) => p(Se)(...f, "name"),
551
+ api: e.folders ? void 0 : v(a),
552
+ apiSetSearchParams: (...g) => v(Ie)(...g, "name"),
553
553
  addChanger: e.addChanger,
554
554
  useCache: ""
555
555
  }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
@@ -557,22 +557,22 @@ const xt = /* @__PURE__ */ G({
557
557
  }), re = {
558
558
  id: -1,
559
559
  name: "--",
560
- folder_id: R.id,
561
- folder_path: R.path
560
+ folder_id: N.id,
561
+ folder_path: N.path
562
562
  }, ie = {
563
- id: Ke,
563
+ id: Le,
564
564
  name: "All groups",
565
- folder_id: R.id,
566
- folder_path: R.path
567
- }, H = () => (ie.name = b()?.Common.All_groups, ie), Ne = () => (ie.name = b()?.Keywords.Choose_group, ie), kt = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((l) => l.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((l) => l.folder_id === o.id || o.childsIds.includes(l.folder_id))), e), $e = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), Ct = (e) => e.gen("/add/keywords_2/groups/"), jt = { class: "top-groupSelector_groupItem" }, Tt = {
565
+ folder_id: N.id,
566
+ folder_path: N.path
567
+ }, Q = () => (ie.name = w()?.Common.All_groups, ie), Ne = () => (ie.name = w()?.Keywords.Choose_group, ie), kt = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((n) => n.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((n) => n.folder_id === o.id || o.childsIds.includes(n.folder_id))), e), be = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), Ct = (e) => e.gen("/add/keywords_2/groups/"), Tt = { class: "top-groupSelector_groupItem" }, jt = {
568
568
  key: 0,
569
569
  class: "top-comment"
570
570
  }, At = {
571
571
  key: 1,
572
572
  class: "top-groupSelector_groupItemFolderPath"
573
- }, Bt = /* @__PURE__ */ G({
573
+ }, Bt = /* @__PURE__ */ L({
574
574
  __name: "groups",
575
- props: /* @__PURE__ */ M({
575
+ props: /* @__PURE__ */ _({
576
576
  groupId: {},
577
577
  group: {},
578
578
  projectId: {},
@@ -592,111 +592,111 @@ const xt = /* @__PURE__ */ G({
592
592
  group: { required: !0 },
593
593
  groupModifiers: {}
594
594
  }),
595
- emits: /* @__PURE__ */ M(["addGroup"], ["update:groupId", "update:group"]),
595
+ emits: /* @__PURE__ */ _(["addGroup"], ["update:groupId", "update:group"]),
596
596
  setup(e, { emit: t }) {
597
- const o = e, l = t, a = B(e, "groupId"), n = B(e, "group"), r = o.client && !o.groups ? $e(o.client) : void 0, u = o.client ? Ct(o.client) : void 0, c = V(null), f = V(void 0), S = Te("folder_id", "EQUALS", [o.folder?.id ?? 0]);
597
+ const o = e, n = t, a = b(e, "groupId"), l = b(e, "group"), r = o.client && !o.groups ? be(o.client) : void 0, u = o.client ? Ct(o.client) : void 0, c = M(null), g = M(void 0), I = Te("folder_id", "EQUALS", [o.folder?.id ?? 0]);
598
598
  r?.changeParams({
599
599
  project_id: o.projectId,
600
600
  folder_id_depth: !0,
601
601
  filters: [
602
- S
602
+ I
603
603
  ]
604
604
  }), o.on !== void 0 && r?.params.filters?.push(Te("on", "EQUALS", [Number(o.on)]));
605
- const i = (d) => {
606
- n.value = d, a.value = d.id;
605
+ const d = (i) => {
606
+ l.value = i, a.value = i.id;
607
607
  };
608
608
  me({
609
609
  projectId: () => o.projectId,
610
610
  folderId: () => o.folder?.id,
611
611
  canSelectAll: () => o.canSelectAll
612
- }, (d) => {
613
- if (d.projectId && (r?.changeParams({
612
+ }, (i) => {
613
+ if (i.projectId && (r?.changeParams({
614
614
  project_id: o.projectId
615
615
  }), r?.setOptions({
616
616
  checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
617
- })), d.folderId && (S.values = [
617
+ })), i.folderId && (I.values = [
618
618
  o.folder?.id ?? 0
619
- ], o.groups && (f.value = kt(o.groups, o.on, o.folder))), c.value?.resetCache(), (d.folderId?.old !== void 0 || d.canSelectAll?.old !== void 0) && a.value !== le) {
619
+ ], o.groups && (g.value = kt(o.groups, o.on, o.folder))), c.value?.resetCache(), (i.folderId?.old !== void 0 || i.canSelectAll?.old !== void 0) && a.value !== ne) {
620
620
  let s;
621
- o.autoselect === "first" && (s = f.value?.[0], o.canSelectAll && (s = _e(H()))), (o.autoselect === "placeholder" || !s) && (s = Ne()), i(s);
621
+ o.autoselect === "first" && (s = g.value?.[0], o.canSelectAll && (s = _e(Q()))), (o.autoselect === "placeholder" || !s) && (s = Ne()), d(s);
622
622
  }
623
623
  }, { immediate: !0 }), me({
624
- modelGroup: n,
624
+ modelGroup: l,
625
625
  modelGroupId: a
626
- }, async (d) => {
627
- if (a.value !== n.value.id) {
628
- if (d.modelGroup && !d.modelGroupId) {
629
- a.value = n.value.id;
626
+ }, async (i) => {
627
+ if (a.value !== l.value.id) {
628
+ if (i.modelGroup && !i.modelGroupId) {
629
+ a.value = l.value.id;
630
630
  return;
631
631
  }
632
- if (!(o.canAdd && a.value === le)) {
632
+ if (!(o.canAdd && a.value === ne)) {
633
633
  if (o.groups) {
634
- let s = f.value?.find((m) => m.id === a.value);
635
- if (!s && o.canSelectAll && (s = H()), s)
636
- i(s);
634
+ let s = g.value?.find((f) => f.id === a.value);
635
+ if (!s && o.canSelectAll && (s = Q()), s)
636
+ d(s);
637
637
  else {
638
- const m = f.value?.[0];
639
- m && !a.value ? i(m) : i(re);
638
+ const f = g.value?.[0];
639
+ f && !a.value ? d(f) : d(re);
640
640
  }
641
641
  }
642
- if (o.client && !o.groups && (a.value || a.value === Ke && !o.canSelectAll)) {
643
- const s = $e(o.client).changeParams({
642
+ if (o.client && !o.groups && (a.value || a.value === Le && !o.canSelectAll)) {
643
+ const s = be(o.client).changeParams({
644
644
  project_id: o.projectId,
645
645
  id: a.value,
646
646
  filters: [
647
- S
647
+ I
648
648
  ]
649
649
  });
650
650
  s?.setOptions({
651
651
  checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
652
652
  });
653
- const m = await s.call();
654
- if (!m.errors?.length && !m.result) return;
655
- !m.errors && m.result[0] ? i(m.result[0]) : i(re);
653
+ const f = await s.call();
654
+ if (!f.errors?.length && !f.result) return;
655
+ !f.errors && f.result[0] ? d(f.result[0]) : d(re);
656
656
  }
657
657
  }
658
658
  }
659
659
  }, { immediate: !0 });
660
- const g = async (d) => {
660
+ const m = async (i) => {
661
661
  if (o.canAdd !== "api" || !u) return;
662
- const s = n.value, m = await u.changeParams({
662
+ const s = l.value, f = await u.changeParams({
663
663
  project_id: o.projectId,
664
- names: [d.name],
665
- to_id: o.folder?.id ?? R.id,
664
+ names: [i.name],
665
+ to_id: o.folder?.id ?? N.id,
666
666
  to_type: "in_folder_last"
667
667
  }).call();
668
- m.result ? (i(m.result), l("addGroup", m.result)) : i(s), c.value?.resetCache(!0);
668
+ f.result ? (d(f.result), n("addGroup", f.result)) : d(s), c.value?.resetCache(!0);
669
669
  };
670
- return (d, s) => (v(), j(Ie, {
670
+ return (i, s) => (p(), T(ye, {
671
671
  ref_key: "refSelector",
672
672
  ref: c,
673
673
  class: "top-groupSelector_group",
674
- modelValue: n.value,
675
- "onUpdate:modelValue": s[0] || (s[0] = (m) => n.value = m),
676
- items: f.value ?? e.groups,
674
+ modelValue: l.value,
675
+ "onUpdate:modelValue": s[0] || (s[0] = (f) => l.value = f),
676
+ items: g.value ?? e.groups,
677
677
  searchType: "inline",
678
678
  icon: e.addIcon ? "" : void 0,
679
- api: e.groups ? void 0 : p(r),
680
- apiSetSearchParams: (...m) => p(Se)(...m, "name"),
679
+ api: e.groups ? void 0 : v(r),
680
+ apiSetSearchParams: (...f) => v(Ie)(...f, "name"),
681
681
  appendSearchToResult: !!e.canAdd,
682
- useAllItem: e.canSelectAll ? p(H)().name : !1,
682
+ useAllItem: e.canSelectAll ? v(Q)().name : !1,
683
683
  addChanger: e.addChanger,
684
684
  useCache: "",
685
- onAppendItem: g
685
+ onAppendItem: m
686
686
  }, {
687
- item: C(({ item: m }) => [
688
- L("div", jt, [
689
- m.id === p(le) ? (v(), T("div", Tt, A(d.$i18n.Common.Add) + ": ", 1)) : _("", !0),
690
- L("span", null, A(m.name), 1),
691
- m.folder_path && e.showPath ? (v(), T("span", At, A(m.folder_path), 1)) : _("", !0)
687
+ item: C(({ item: f }) => [
688
+ O("div", Tt, [
689
+ f.id === v(ne) ? (p(), j("div", jt, B(i.$i18n.Common.Add) + ": ", 1)) : V("", !0),
690
+ O("span", null, B(f.name), 1),
691
+ f.folder_path && e.showPath ? (p(), j("span", At, B(f.folder_path), 1)) : V("", !0)
692
692
  ])
693
693
  ]),
694
694
  _: 1
695
695
  }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
696
696
  }
697
- }), bt = { class: "top-groupSelector" }, co = /* @__PURE__ */ G({
697
+ }), bt = { class: "top-groupSelector" }, co = /* @__PURE__ */ L({
698
698
  __name: "groupSelector",
699
- props: /* @__PURE__ */ M({
699
+ props: /* @__PURE__ */ _({
700
700
  folderId: {},
701
701
  folder: {},
702
702
  groupId: {},
@@ -723,36 +723,36 @@ const xt = /* @__PURE__ */ G({
723
723
  group: { default: re },
724
724
  groupModifiers: {}
725
725
  }),
726
- emits: /* @__PURE__ */ M(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
726
+ emits: /* @__PURE__ */ _(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
727
727
  setup(e, { emit: t }) {
728
- const o = e, l = B(e, "folderId"), a = B(e, "folder"), n = B(e, "groupId"), r = B(e, "group"), u = t, c = xe(o.folders ?? { root: [R] }, o.canSelectAllGroups);
729
- a.value = c.get(l.value);
730
- let f = o.groups?.find((i) => i.id === n.value);
731
- n.value || (f = o.groups?.[0]), o.canSelectAllGroups && !f && (f = H()), o.canSelectAllGroups && !f && (f = H()), (o.autoselect === "placeholder" || !f) && (f = Ne()), f ??= re, r.value = f;
732
- const S = (i) => {
733
- let g;
734
- o.groups && i && (g = [...o.groups, i]), u("update:groups", g);
728
+ const o = e, n = b(e, "folderId"), a = b(e, "folder"), l = b(e, "groupId"), r = b(e, "group"), u = t, c = Se(o.folders ?? { root: [N] }, o.canSelectAllGroups);
729
+ a.value = c.get(n.value);
730
+ let g = o.groups?.find((d) => d.id === l.value);
731
+ l.value || (g = o.groups?.[0]), o.canSelectAllGroups && !g && (g = Q()), o.canSelectAllGroups && !g && (g = Q()), (o.autoselect === "placeholder" || !g) && (g = Ne()), g ??= re, r.value = g;
732
+ const I = (d) => {
733
+ let m;
734
+ o.groups && d && (m = [...o.groups, d]), u("update:groups", m);
735
735
  };
736
- return (i, g) => (v(), T("div", bt, [
737
- e.showFolders ? (v(), j(xt, {
736
+ return (d, m) => (p(), j("div", bt, [
737
+ e.showFolders ? (p(), T(xt, {
738
738
  key: 0,
739
- folderId: l.value,
740
- "onUpdate:folderId": g[0] || (g[0] = (d) => l.value = d),
739
+ folderId: n.value,
740
+ "onUpdate:folderId": m[0] || (m[0] = (i) => n.value = i),
741
741
  folder: a.value,
742
- "onUpdate:folder": g[1] || (g[1] = (d) => a.value = d),
742
+ "onUpdate:folder": m[1] || (m[1] = (i) => a.value = i),
743
743
  projectId: e.projectId,
744
744
  folders: e.folders,
745
745
  canSelectAll: e.canSelectAllGroups,
746
746
  addChanger: e.addChanger,
747
747
  addIcon: e.addIcon,
748
748
  client: e.client
749
- }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : _("", !0),
750
- e.showGroups ? (v(), j(Bt, {
749
+ }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : V("", !0),
750
+ e.showGroups ? (p(), T(Bt, {
751
751
  key: 1,
752
- groupId: n.value,
753
- "onUpdate:groupId": g[2] || (g[2] = (d) => n.value = d),
752
+ groupId: l.value,
753
+ "onUpdate:groupId": m[2] || (m[2] = (i) => l.value = i),
754
754
  group: r.value,
755
- "onUpdate:group": g[3] || (g[3] = (d) => r.value = d),
755
+ "onUpdate:group": m[3] || (m[3] = (i) => r.value = i),
756
756
  projectId: e.projectId,
757
757
  folder: a.value,
758
758
  groups: e.groups,
@@ -764,11 +764,11 @@ const xt = /* @__PURE__ */ G({
764
764
  showPath: e.showFolders && !!e.folders?.[0],
765
765
  addIcon: e.addIcon,
766
766
  client: e.client,
767
- onAddGroup: S
768
- }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) : _("", !0)
767
+ onAddGroup: I
768
+ }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) : V("", !0)
769
769
  ]));
770
770
  }
771
- }), $t = { class: "top-projectSelectorSubmenu_item" }, wt = ["href", "title", "data-top-icon", "data-right"], Mt = { class: "top-projectSelectorSubmenu_item" }, Pt = ["href"], Vt = /* @__PURE__ */ G({
771
+ }), wt = { class: "top-projectSelectorSubmenu_item" }, $t = ["href", "title", "data-top-icon", "data-right"], Pt = { class: "top-projectSelectorSubmenu_item" }, Mt = ["href"], Vt = /* @__PURE__ */ L({
772
772
  __name: "submenu",
773
773
  props: {
774
774
  id: {},
@@ -776,8 +776,8 @@ const xt = /* @__PURE__ */ G({
776
776
  url: {}
777
777
  },
778
778
  setup(e) {
779
- const t = e, o = b();
780
- let l = [
779
+ const t = e, o = w();
780
+ let n = [
781
781
  {
782
782
  href: `/project/keywords/${t.id}/`,
783
783
  title: o.Common.Menu_phrases,
@@ -845,10 +845,10 @@ const xt = /* @__PURE__ */ G({
845
845
  right: "2"
846
846
  }
847
847
  ];
848
- const a = w(() => t.right.includes("0") ? l.filter((n) => t.right[n.right] === "1") : l);
849
- return (n, r) => {
848
+ const a = P(() => t.right.includes("0") ? n.filter((l) => t.right[l.right] === "1") : n);
849
+ return (l, r) => {
850
850
  const u = Ee("TopButton");
851
- return v(), j(p(he), {
851
+ return p(), T(v(pe), {
852
852
  class: "top-projectSelectorSubmenu",
853
853
  notch: !1,
854
854
  pos: "2"
@@ -861,20 +861,20 @@ const xt = /* @__PURE__ */ G({
861
861
  })
862
862
  ]),
863
863
  contentList: C(() => [
864
- (v(!0), T(q, null, se(a.value, (c) => (v(), T("li", $t, [
865
- L("a", {
864
+ (p(!0), j(D, null, se(a.value, (c) => (p(), j("li", wt, [
865
+ O("a", {
866
866
  href: c.href,
867
867
  title: c.title,
868
868
  "data-top-icon": c.icon,
869
869
  "data-right": c.right
870
- }, null, 8, wt)
870
+ }, null, 8, $t)
871
871
  ]))), 256)),
872
- L("li", Mt, [
873
- L("a", {
872
+ O("li", Pt, [
873
+ O("a", {
874
874
  href: e.url,
875
875
  "data-top-icon": "",
876
876
  target: "_blank"
877
- }, null, 8, Pt)
877
+ }, null, 8, Mt)
878
878
  ])
879
879
  ]),
880
880
  _: 1
@@ -888,54 +888,54 @@ const xt = /* @__PURE__ */ G({
888
888
  type: "title"
889
889
  }
890
890
  }), _t = (e) => {
891
- const t = b();
891
+ const t = w();
892
892
  return [
893
- { filter: (l) => l.right.startsWith("1") && l.on > 0, title: ge(t.Projects.Scheduled_update) },
894
- { filter: (l) => l.right.startsWith("1") && l.on === 0, title: ge(t.Projects.Manual_update) },
895
- { filter: (l) => l.right.startsWith("0") && l.on >= 0, title: ge(t.Projects.Guest_projects) }
896
- ].flatMap(({ filter: l, title: a }) => {
897
- const n = e.filter(l);
898
- return n.length ? [a, ...n] : [];
893
+ { filter: (n) => n.right.startsWith("1") && n.on > 0, title: ge(t.Projects.Scheduled_update) },
894
+ { filter: (n) => n.right.startsWith("1") && n.on === 0, title: ge(t.Projects.Manual_update) },
895
+ { filter: (n) => n.right.startsWith("0") && n.on >= 0, title: ge(t.Projects.Guest_projects) }
896
+ ].flatMap(({ filter: n, title: a }) => {
897
+ const l = e.filter(n);
898
+ return l.length ? [a, ...l] : [];
899
899
  });
900
- }, Et = (e) => e.map((t) => ({
901
- ...t,
900
+ }, Et = (e, t) => e.map((o) => ({
901
+ ...o,
902
902
  listItemProps: {
903
903
  class: "top-projectSelector_item",
904
- href: qe(Number(t.id)),
905
- title: t.name
904
+ href: t ? qe(Number(o.id)) : void 0,
905
+ title: o.name
906
906
  }
907
- })), pe = (e, t) => {
908
- if (!e) return;
909
- t && (e = e.filter((l) => l.id !== t));
910
- const o = Et(e);
911
- return _t(o);
912
- }, Gt = (e) => {
907
+ })), Gt = (e, t, o) => {
908
+ if (!e || e.length === 0) return;
909
+ t && (e = e.filter((a) => a.id !== t));
910
+ const n = Et(e, o);
911
+ return _t(n);
912
+ }, Lt = (e) => {
913
913
  if (!e) return "";
914
914
  let t = e;
915
915
  return t = t.replace(/historyView=[^&]*/, ""), t = t.replace(/competitorsIds=[^&]*/, ""), t = t.replace(/searchersKeys=[^&]*/, ""), t = t.replace(/regionIndex=[^&]*/, ""), t = t.replace(/regionsIndexes=[^&]*/, ""), t = t.replace(/folderId=[^&]*/, ""), t = t.replace(/groupId=[^&]*/, ""), t = t.replace(/tags=[^&]*/, ""), window.mo?.getHash && !window.mo.getHash("dataSort").toString().includes("0000-00-00") && (t = t.replace(/dataSort=[^&]*/, "")), t = t.replace(/%22historyView%22:[^,]*,/, ""), t = t.replace(/%22competitorsIds%22:\[[^\]]*\],/, ""), t = t.replace(/%22searchersKeys%22:\[[^\]]*\],/, ""), t = t.replace(/%22regionIndex%22:[^,]*,/, ""), t = t.replace(/%22regionsIndexes%22:\[[^\]]*\],/, ""), t = t.replace(/%22folderId%22:[^,]*,/, ""), t = t.replace(/%22groupId%22:[^,]*,/, ""), t = t.replace(/%22tagsIds%22:\[[^\]]*\],/, ""), /%22dataSort%22:\{[^\}]*0000-00-00[^\}]*\}/.test(t) || (t = t.replace(/%22dataSort%22:\{[^\}]*\},/, "")), t;
916
916
  }, qe = (e) => {
917
917
  const t = location.pathname.split("/");
918
- let o = "project/dynamics/", l = "";
919
- t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (l = t[4] + "/");
920
- let a = "/" + o + e + "/" + l;
921
- const n = Gt(location.hash);
922
- return a += n, a;
918
+ let o = "project/dynamics/", n = "";
919
+ t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (n = t[4] + "/");
920
+ let a = "/" + o + e + "/" + n;
921
+ const l = Lt(location.hash);
922
+ return a += l, a;
923
923
  }, we = (e) => {
924
924
  let t = e.startsWith("http") ? e : "http://" + e;
925
925
  return t = t.replace(/"/g, "%22"), t;
926
- }, Kt = (e, t) => {
927
- const o = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
928
- return o.options.onApiLoaded = (l, a, n) => {
929
- l.result = pe(l.result, t), n?.(l, a);
930
- }, o;
931
- }, Lt = (e) => e.gen("/add/projects_2/projects/"), Ot = { class: "top-projectSelector_itemText" }, Rt = { class: "top-projectSelector_itemName" }, Nt = { class: "top-projectSelector_itemId" }, qt = { key: 1 }, Dt = {
926
+ }, $e = (e, t, o, n) => {
927
+ const a = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
928
+ return a.options.onApiLoaded = (l, r, u) => {
929
+ l.result = Gt(l.result, o, n), u?.(l, r);
930
+ }, t && (a.params.limit = t), a;
931
+ }, Kt = (e) => e.gen("/add/projects_2/projects/"), Ot = { class: "top-projectSelector_itemText" }, Rt = { class: "top-projectSelector_itemName" }, Nt = { class: "top-projectSelector_itemId" }, qt = { key: 1 }, Dt = {
932
932
  key: 0,
933
933
  class: "top-comment"
934
- }, go = /* @__PURE__ */ G({
934
+ }, go = /* @__PURE__ */ L({
935
935
  __name: "projectSelector",
936
- props: /* @__PURE__ */ M({
936
+ props: /* @__PURE__ */ _({
937
937
  project: {},
938
- projects: {},
938
+ addLinksToProjects: { type: Boolean, default: !0 },
939
939
  userId: { default: window.mo?.user?.id },
940
940
  icon: {},
941
941
  excludeProjectId: {},
@@ -946,159 +946,160 @@ const xt = /* @__PURE__ */ G({
946
946
  client: {}
947
947
  }, {
948
948
  project: {
949
- default: { id: le, name: "" }
949
+ default: { id: ne, name: "" }
950
950
  },
951
951
  projectModifiers: {}
952
952
  }),
953
953
  emits: ["update:project"],
954
954
  setup(e) {
955
- const t = b(), o = e, l = w(() => o.placeholder ?? t.Projects.Select_project), a = w(() => o.openerText ?? t.Common.Projects), n = B(e, "project");
956
- n.value.name || (n.value.name = a.value);
957
- const r = o.client ? Kt(o.client, o.excludeProjectId) : void 0, u = o.client ? Lt(o.client) : void 0, c = V(pe(o.projects, o.excludeProjectId)), f = V(null);
958
- P([() => o.projects, () => o.excludeProjectId], () => {
959
- c.value = pe(o.projects, o.excludeProjectId);
960
- });
961
- const S = async (i) => {
955
+ const t = w(), o = e, n = P(() => o.placeholder ?? t.Projects.Select_project), a = P(() => o.openerText ?? t.Common.Projects), l = b(e, "project");
956
+ l.value.name || (l.value.name = a.value);
957
+ const r = o.client ? $e(o.client, 100, o.excludeProjectId, o.addLinksToProjects) : void 0, u = o.client ? Kt(o.client) : void 0, c = M([]), g = M(null), I = M(!1), d = async () => {
958
+ if (!o.client) return;
959
+ const s = await $e(o.client, 1e3, o.excludeProjectId, o.addLinksToProjects).call();
960
+ s.errors || s.total && s.total < 1e3 && (c.value = s.result);
961
+ }, m = async (i) => {
962
962
  if (!u) return;
963
- const g = await u.changeParams({
963
+ const s = await u.changeParams({
964
964
  url: i.name,
965
965
  name: i.name
966
966
  }).call();
967
- if (!g.errors)
968
- if (o.projects) {
969
- const d = {
970
- id: Number(g.result),
967
+ if (!s.errors)
968
+ if (c) {
969
+ const f = {
970
+ id: Number(s.result),
971
971
  url: i.name,
972
972
  name: i.name,
973
973
  user_id: o.userId,
974
974
  on: 0,
975
975
  right: "11111111111111111111",
976
976
  listItemProps: {
977
- class: "top-projectSelector_item",
978
- href: qe(Number(g.result))
977
+ class: "top-projectSelector_item top-active",
978
+ href: o.addLinksToProjects ? qe(Number(s.result)) : void 0
979
979
  }
980
980
  };
981
- c.value?.unshift(d);
981
+ c.value?.unshift(f);
982
982
  } else
983
- f.value?.resetCache(!0);
983
+ g.value?.resetCache(!0);
984
984
  };
985
- return Ue(() => {
986
- n.value.name || (n.value.name = a.value);
987
- }), (i, g) => {
988
- const d = Ee("TopButton");
989
- return v(), j(Ie, {
985
+ return Ue(async () => {
986
+ await d(), I.value = !0, l.value.name || (l.value.name = a.value);
987
+ }), (i, s) => {
988
+ const f = Ee("TopButton");
989
+ return I.value ? (p(), T(ye, {
990
+ key: 0,
990
991
  ref_key: "refSelector",
991
- ref: f,
992
+ ref: g,
992
993
  class: "top-projectSelector",
993
- modelValue: n.value,
994
- "onUpdate:modelValue": g[1] || (g[1] = (s) => n.value = s),
994
+ modelValue: l.value,
995
+ "onUpdate:modelValue": s[1] || (s[1] = (A) => l.value = A),
995
996
  items: c.value,
996
997
  title: i.$i18n.Projects.Search_projects,
997
998
  icon: e.icon,
998
999
  modificator: "projectSelector",
999
- placeholder: l.value,
1000
- api: e.projects ? void 0 : p(r),
1001
- apiSetSearchParams: e.projects ? void 0 : (...s) => p(Se)(...s, "name"),
1000
+ placeholder: n.value,
1001
+ api: c.value.length !== 0 ? void 0 : v(r),
1002
+ apiSetSearchParams: c.value.length !== 0 ? void 0 : (...A) => v(Ie)(...A, "name"),
1002
1003
  useCache: "",
1003
1004
  appendSearchToResult: "",
1004
- appendSearchToResultCond: p(Ae),
1005
+ appendSearchToResultCond: v(je),
1005
1006
  buttonProps: e.buttonProps,
1006
1007
  openerShortcut: e.openerShortcut,
1007
- onAppendItem: S
1008
+ onAppendItem: m
1008
1009
  }, {
1009
1010
  widgetAction: C(() => [
1010
- i.$core.state.isMobile ? _("", !0) : (v(), j(d, {
1011
+ i.$core.state.isMobile ? V("", !0) : (p(), T(f, {
1011
1012
  key: 0,
1012
1013
  class: "top-projectSelector_cancel closer",
1013
1014
  color: "theme"
1014
1015
  }, {
1015
1016
  default: C(() => [
1016
- N(A(i.$i18n.Common.Cancel), 1)
1017
+ q(B(i.$i18n.Common.Cancel), 1)
1017
1018
  ]),
1018
1019
  _: 1
1019
1020
  }))
1020
1021
  ]),
1021
- item: C(({ item: s }) => [
1022
- s.id ? (v(), T(q, { key: 0 }, [
1023
- L("div", Ot, [
1024
- L("span", Rt, A(s.name), 1),
1025
- L("span", Nt, " id " + A(s.id), 1)
1022
+ item: C(({ item: A }) => [
1023
+ A.id ? (p(), j(D, { key: 0 }, [
1024
+ O("div", Ot, [
1025
+ O("span", Rt, B(A.name), 1),
1026
+ O("span", Nt, " id " + B(A.id), 1)
1026
1027
  ]),
1027
- E(d, {
1028
+ E(f, {
1028
1029
  class: "top-projectSelector_itemLink",
1029
- href: p(we)(s.url),
1030
+ href: v(we)(A.url),
1030
1031
  "data-top-icon": "",
1031
1032
  color: "theme",
1032
1033
  target: "_blank",
1033
- onClick: g[0] || (g[0] = D(() => {
1034
+ onClick: s[0] || (s[0] = U(() => {
1034
1035
  }, ["stop"]))
1035
1036
  }, null, 8, ["href"]),
1036
1037
  E(Vt, {
1037
- id: s.id,
1038
- right: s.right ?? void 0,
1039
- url: p(we)(s.url)
1038
+ id: A.id,
1039
+ right: A.right ?? void 0,
1040
+ url: v(we)(A.url)
1040
1041
  }, null, 8, ["id", "right", "url"])
1041
- ], 64)) : (v(), T("div", qt, [
1042
- p(Ae)(s.name) ? (v(), T("div", Dt, A(i.$i18n.Projects.Add_project) + ": ", 1)) : _("", !0),
1043
- N(" " + A(s.name), 1)
1042
+ ], 64)) : (p(), j("div", qt, [
1043
+ v(je)(A.name) ? (p(), j("div", Dt, B(i.$i18n.Projects.Add_project) + ": ", 1)) : V("", !0),
1044
+ q(" " + B(A.name), 1)
1044
1045
  ]))
1045
1046
  ]),
1046
1047
  _: 1
1047
- }, 8, ["modelValue", "items", "title", "icon", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
1048
+ }, 8, ["modelValue", "items", "title", "icon", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"])) : V("", !0);
1048
1049
  };
1049
1050
  }
1050
- }), Me = (e) => "-" + e, X = (e) => e[0] === "-" ? e.substring(1) : e, de = (e, t) => {
1051
- e = X(e);
1052
- const o = t.find((l) => l.id === e);
1051
+ }), Pe = (e) => "-" + e, Z = (e) => e[0] === "-" ? e.substring(1) : e, de = (e, t) => {
1052
+ e = Z(e);
1053
+ const o = t.find((n) => n.id === e);
1053
1054
  if (o)
1054
1055
  return o;
1055
1056
  }, fo = (e, t, o) => {
1056
1057
  t || (t = { id: e.id }), t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
1057
- const l = at.genElPopupOpener("div", t);
1058
- return l.classList.add("top-tagSelector"), e.useTopButton && l.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || l.classList.add("top-tagSelector-custom"), e.mode === "filter" && l.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && l.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && l.classList.add("top-tagSelector-setter_several"), l.onclick = (a) => {
1059
- a.preventDefault(), a.stopPropagation(), l.onclick = null;
1060
- const n = V(e.modelValue), r = {
1061
- model: n,
1058
+ const n = at.genElPopupOpener("div", t);
1059
+ return n.classList.add("top-tagSelector"), e.useTopButton && n.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || n.classList.add("top-tagSelector-custom"), e.mode === "filter" && n.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && n.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && n.classList.add("top-tagSelector-setter_several"), n.onclick = (a) => {
1060
+ a.preventDefault(), a.stopPropagation(), n.onclick = null;
1061
+ const l = M(e.modelValue), r = {
1062
+ model: l,
1062
1063
  mode: e.mode,
1063
1064
  targetId: e.targetId,
1064
1065
  filters: e.filters,
1065
1066
  payload: e.payload
1066
1067
  };
1067
- Y(l, "topTagSelectorTarget", r), delete l.dataset.topPopupDisabled, Ce(e.modelValue) || P(n, () => {
1068
- e.modelValue = n.value, oe(l, e, o);
1069
- }), l.click();
1070
- }, Ce(e.modelValue) ? P(e.modelValue, () => oe(l, e, o)) : Y(l, "topTagSelectorRender", (a) => {
1068
+ H(n, "topTagSelectorTarget", r), delete n.dataset.topPopupDisabled, ke(e.modelValue) || G(l, () => {
1069
+ e.modelValue = l.value, oe(n, e, o);
1070
+ }), n.click();
1071
+ }, ke(e.modelValue) ? G(e.modelValue, () => oe(n, e, o)) : H(n, "topTagSelectorRender", (a) => {
1071
1072
  e.modelValue = a;
1072
- const n = Y(l, "topTagSelectorTarget");
1073
- n && (n.model.value = a), oe(l, e, o);
1074
- }), oe(l, e, o), l;
1073
+ const l = H(n, "topTagSelectorTarget");
1074
+ l && (l.model.value = a), oe(n, e, o);
1075
+ }), oe(n, e, o), n;
1075
1076
  }, mo = (e, t) => {
1076
- Y(e, "topTagSelectorRender")?.(t);
1077
+ H(e, "topTagSelectorRender")?.(t);
1077
1078
  }, oe = (e, t, o) => {
1078
- const l = p(t.modelValue);
1079
- if (e.classList.toggle("top-tagSelector-selectedOne", !l.length || l.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", l.length > 5), t.mode === "setter" && t.filters) {
1079
+ const n = v(t.modelValue);
1080
+ if (e.classList.toggle("top-tagSelector-selectedOne", !n.length || n.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", n.length > 5), t.mode === "setter" && t.filters) {
1080
1081
  e.innerHTML = `<div>${o}</div>`;
1081
1082
  return;
1082
1083
  }
1083
- if (e.innerHTML = "", !l.length && t.mode === "filter") {
1084
- const a = Pe({
1084
+ if (e.innerHTML = "", !n.length && t.mode === "filter") {
1085
+ const a = Me({
1085
1086
  id: "all",
1086
1087
  colorId: "",
1087
- name: b().Common?.All_tags ?? "",
1088
+ name: w().Common?.All_tags ?? "",
1088
1089
  state: ""
1089
1090
  });
1090
1091
  e.append(a);
1091
1092
  }
1092
- l.forEach((a) => {
1093
- const n = Pe({
1094
- id: X(a),
1093
+ n.forEach((a) => {
1094
+ const l = Me({
1095
+ id: Z(a),
1095
1096
  colorId: de(a, t.tags)?.color_id ?? "",
1096
1097
  name: de(a, t.tags)?.name ?? "",
1097
- state: X(a) === a ? "selected" : "excluded"
1098
+ state: Z(a) === a ? "selected" : "excluded"
1098
1099
  });
1099
- e.append(n);
1100
+ e.append(l);
1100
1101
  });
1101
- }, Pe = (e) => {
1102
+ }, Me = (e) => {
1102
1103
  const t = document.createElement("div");
1103
1104
  return t.classList.add("top-tagSelector_tagIcon"), t.classList.toggle("top-tagSelector-active", !!e.state), t.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), t.dataset.tag_id = e.id, t.dataset.tag_color_id = e.colorId, t.title = e.name, t;
1104
1105
  }, Ut = [
@@ -1152,7 +1153,7 @@ const xt = /* @__PURE__ */ G({
1152
1153
  name: "Turquoise",
1153
1154
  color_id: "10"
1154
1155
  }
1155
- ], Ft = ["data-tag_id", "data-tag_color_id", "title"], ve = /* @__PURE__ */ G({
1156
+ ], Ft = ["data-tag_id", "data-tag_color_id", "title"], ve = /* @__PURE__ */ L({
1156
1157
  __name: "tagIcon",
1157
1158
  props: {
1158
1159
  id: {},
@@ -1161,8 +1162,8 @@ const xt = /* @__PURE__ */ G({
1161
1162
  state: {}
1162
1163
  },
1163
1164
  setup(e) {
1164
- return (t, o) => (v(), T("div", {
1165
- class: Z({
1165
+ return (t, o) => (p(), j("div", {
1166
+ class: ee({
1166
1167
  "top-tagSelector_tagIcon": !0,
1167
1168
  "top-tagSelector-active": !!e.state,
1168
1169
  "top-tagSelector-excluded": e.state === "excluded"
@@ -1172,9 +1173,9 @@ const xt = /* @__PURE__ */ G({
1172
1173
  title: e.name
1173
1174
  }, null, 10, Ft));
1174
1175
  }
1175
- }), Wt = ["contenteditable", "onKeydown"], Ve = /* @__PURE__ */ G({
1176
+ }), Wt = ["contenteditable", "onKeydown"], Ve = /* @__PURE__ */ L({
1176
1177
  __name: "tagPopupListItem",
1177
- props: /* @__PURE__ */ M({
1178
+ props: /* @__PURE__ */ _({
1178
1179
  editable: { type: Boolean },
1179
1180
  disabled: { type: Boolean },
1180
1181
  canExclude: { type: Boolean },
@@ -1188,26 +1189,26 @@ const xt = /* @__PURE__ */ G({
1188
1189
  },
1189
1190
  nameModifiers: {}
1190
1191
  }),
1191
- emits: /* @__PURE__ */ M(["update:name", "unselect", "exclude", "select"], ["update:name"]),
1192
+ emits: /* @__PURE__ */ _(["update:name", "unselect", "exclude", "select"], ["update:name"]),
1192
1193
  setup(e, { emit: t }) {
1193
- const o = e, l = t, a = B(e, "name"), n = V(null), r = w(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
1194
+ const o = e, n = t, a = b(e, "name"), l = M(null), r = P(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
1194
1195
  contenteditable: u.value,
1195
- onpaste: (g) => g.preventDefault()
1196
- } : {}), u = V(!1), c = async () => {
1197
- u.value = !0, await Fe(), n.value?.focus();
1198
- }, f = () => {
1199
- const g = n.value?.innerText;
1200
- if (!g) return S();
1201
- n.value && (n.value.innerText = g), u.value = !1, l("update:name", g);
1202
- }, S = async () => {
1203
- n.value && (n.value.innerText = o.name), u.value = !1;
1204
- }, i = (g) => {
1196
+ onpaste: (m) => m.preventDefault()
1197
+ } : {}), u = M(!1), c = async () => {
1198
+ u.value = !0, await Fe(), l.value?.focus();
1199
+ }, g = () => {
1200
+ const m = l.value?.innerText;
1201
+ if (!m) return I();
1202
+ l.value && (l.value.innerText = m), u.value = !1, n("update:name", m);
1203
+ }, I = async () => {
1204
+ l.value && (l.value.innerText = o.name), u.value = !1;
1205
+ }, d = (m) => {
1205
1206
  if (u.value || o.disabled) return;
1206
- let d = "selected";
1207
- o.canExclude && (g.ctrlKey || g.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && l("unselect"), d === "selected" && l("select"), d === "excluded" && l("exclude");
1207
+ let i = "selected";
1208
+ o.canExclude && (m.ctrlKey || m.metaKey) && (i = "excluded"), o.state == i && (i = ""), i === "" && n("unselect"), i === "selected" && n("select"), i === "excluded" && n("exclude");
1208
1209
  };
1209
- return (g, d) => (v(), j(ye, {
1210
- class: Z({
1210
+ return (m, i) => (p(), T(he, {
1211
+ class: ee({
1211
1212
  "top-tagSelector_tagListItem": !0,
1212
1213
  "top-tagSelector_tagListItem-inEdit": u.value,
1213
1214
  "top-tagSelector_tagListItem-disabled": e.disabled,
@@ -1215,7 +1216,7 @@ const xt = /* @__PURE__ */ G({
1215
1216
  "top-tagSelector-active": !!e.state,
1216
1217
  "top-tagSelector-excluded": e.state === "excluded"
1217
1218
  }),
1218
- onClick: D(i, ["stop"])
1219
+ onClick: U(d, ["stop"])
1219
1220
  }, {
1220
1221
  default: C(() => [
1221
1222
  E(ve, {
@@ -1224,38 +1225,38 @@ const xt = /* @__PURE__ */ G({
1224
1225
  colorId: e.colorId,
1225
1226
  state: e.state
1226
1227
  }, null, 8, ["id", "name", "colorId", "state"]),
1227
- L("span", Ge({
1228
+ O("span", Ge({
1228
1229
  ref_key: "elName",
1229
- ref: n,
1230
+ ref: l,
1230
1231
  class: "top-tagSelector_tagListItemName",
1231
1232
  contenteditable: u.value ? "plaintext-only" : !1
1232
1233
  }, r.value, {
1233
1234
  onKeydown: [
1234
- je(D(f, ["stop"]), ["enter"]),
1235
- je(D(S, ["stop"]), ["esc"])
1235
+ Ce(U(g, ["stop"]), ["enter"]),
1236
+ Ce(U(I, ["stop"]), ["esc"])
1236
1237
  ]
1237
- }), A(a.value), 17, Wt),
1238
- e.editable ? (v(), T(q, { key: 0 }, [
1239
- u.value ? (v(), T("span", {
1238
+ }), B(a.value), 17, Wt),
1239
+ e.editable ? (p(), j(D, { key: 0 }, [
1240
+ u.value ? (p(), j("span", {
1240
1241
  key: 1,
1241
1242
  "data-top-icon": "",
1242
1243
  class: "top-tagSelector_edit",
1243
- onClick: D(f, ["stop"])
1244
- })) : (v(), T("span", {
1244
+ onClick: U(g, ["stop"])
1245
+ })) : (p(), j("span", {
1245
1246
  key: 0,
1246
1247
  "data-top-icon": "",
1247
1248
  class: "top-tagSelector_edit",
1248
1249
  onClick: c
1249
1250
  }))
1250
- ], 64)) : _("", !0)
1251
+ ], 64)) : V("", !0)
1251
1252
  ]),
1252
1253
  _: 1
1253
1254
  }, 8, ["class"]));
1254
1255
  }
1255
- }), zt = { key: 1 }, Jt = /* @__PURE__ */ G({
1256
+ }), zt = { key: 1 }, Jt = /* @__PURE__ */ L({
1256
1257
  inheritAttrs: !1,
1257
1258
  __name: "popupOpener",
1258
- props: /* @__PURE__ */ M({
1259
+ props: /* @__PURE__ */ _({
1259
1260
  modelValue: {},
1260
1261
  id: {},
1261
1262
  tags: {},
@@ -1273,7 +1274,7 @@ const xt = /* @__PURE__ */ G({
1273
1274
  }),
1274
1275
  emits: ["update:modelValue"],
1275
1276
  setup(e) {
1276
- const t = e, o = B(e, "modelValue"), l = t.useTopButton ? Q : "div", a = t.useTopButton ? "html" : "default", n = {
1277
+ const t = e, o = b(e, "modelValue"), n = t.useTopButton ? X : "div", a = t.useTopButton ? "html" : "default", l = {
1277
1278
  model: o,
1278
1279
  mode: t.mode,
1279
1280
  targetId: t.targetId,
@@ -1282,9 +1283,9 @@ const xt = /* @__PURE__ */ G({
1282
1283
  };
1283
1284
  return (r, u) => {
1284
1285
  const c = We("top-data");
1285
- return v(), j(Ze, { id: e.id }, {
1286
+ return p(), T(Ze, { id: e.id }, {
1286
1287
  default: C(() => [
1287
- ze((v(), j(Je(p(l)), Ge({
1288
+ ze((p(), T(Je(v(n)), Ge({
1288
1289
  class: {
1289
1290
  "top-tagSelector": !0,
1290
1291
  "top-tagSelector-useTopButton": t.useTopButton,
@@ -1299,35 +1300,35 @@ const xt = /* @__PURE__ */ G({
1299
1300
  color: "theme",
1300
1301
  styling: e.styling
1301
1302
  }, r.$attrs), {
1302
- [p(a)]: C(() => [
1303
- !o.value.length && e.mode === "filter" ? (v(), j(ve, {
1303
+ [v(a)]: C(() => [
1304
+ !o.value.length && e.mode === "filter" ? (p(), T(ve, {
1304
1305
  key: 0,
1305
1306
  id: "all",
1306
1307
  colorId: "",
1307
1308
  name: r.$i18n.Common.All_tags ?? "",
1308
1309
  state: ""
1309
- }, null, 8, ["name"])) : _("", !0),
1310
- e.mode === "setter" && e.filters ? (v(), T("div", zt, [
1310
+ }, null, 8, ["name"])) : V("", !0),
1311
+ e.mode === "setter" && e.filters ? (p(), j("div", zt, [
1311
1312
  Ye(r.$slots, "default")
1312
- ])) : (v(!0), T(q, { key: 2 }, se(o.value, (f) => (v(), j(ve, {
1313
- id: p(X)(f),
1314
- colorId: p(de)(f, e.tags)?.color_id ?? "",
1315
- name: p(de)(f, e.tags)?.name ?? "",
1316
- state: p(X)(f) === f ? "selected" : "excluded"
1313
+ ])) : (p(!0), j(D, { key: 2 }, se(o.value, (g) => (p(), T(ve, {
1314
+ id: v(Z)(g),
1315
+ colorId: v(de)(g, e.tags)?.color_id ?? "",
1316
+ name: v(de)(g, e.tags)?.name ?? "",
1317
+ state: v(Z)(g) === g ? "selected" : "excluded"
1317
1318
  }, null, 8, ["id", "colorId", "name", "state"]))), 256))
1318
1319
  ]),
1319
1320
  _: 2
1320
1321
  }, 1040, ["class", "styling"])), [
1321
- [c, n, "topTagSelectorTarget"]
1322
+ [c, l, "topTagSelectorTarget"]
1322
1323
  ])
1323
1324
  ]),
1324
1325
  _: 3
1325
1326
  }, 8, ["id"]);
1326
1327
  };
1327
1328
  }
1328
- }), po = /* @__PURE__ */ G({
1329
+ }), vo = /* @__PURE__ */ L({
1329
1330
  __name: "tagSelector",
1330
- props: /* @__PURE__ */ M({
1331
+ props: /* @__PURE__ */ _({
1331
1332
  modelValue: {},
1332
1333
  tags: {},
1333
1334
  tagsEditable: { type: Boolean },
@@ -1349,173 +1350,173 @@ const xt = /* @__PURE__ */ G({
1349
1350
  },
1350
1351
  tagsModifiers: {}
1351
1352
  }),
1352
- emits: /* @__PURE__ */ M(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1353
+ emits: /* @__PURE__ */ _(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1353
1354
  setup(e, { emit: t }) {
1354
- const o = b(), l = e, a = B(e, "modelValue"), n = B(e, "tags"), r = t, u = Xe((h, I) => {
1355
- r(h, I);
1356
- }, l.emitDelay);
1357
- l.singleMode && !a.value.length && (a.value = [n.value[0].id]);
1358
- const c = l.id ?? "top-popup-id-" + Math.random(), f = V("add"), S = () => {
1359
- const h = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
1360
- return I.set("add", { value: "add", title: o.Common.Add + h }), I.set("replace", { value: "replace", title: o.Common.Replace + h }), I.set("delete", { value: "delete", title: o.Common.Delete + h }), I;
1355
+ const o = w(), n = e, a = b(e, "modelValue"), l = b(e, "tags"), r = t, u = Xe((h, S) => {
1356
+ r(h, S);
1357
+ }, n.emitDelay);
1358
+ n.singleMode && !a.value.length && (a.value = [l.value[0].id]);
1359
+ const c = n.id ?? "top-popup-id-" + Math.random(), g = M("add"), I = () => {
1360
+ const h = " " + o.Common.Tags?.toLowerCase(), S = /* @__PURE__ */ new Map();
1361
+ return S.set("add", { value: "add", title: o.Common.Add + h }), S.set("replace", { value: "replace", title: o.Common.Replace + h }), S.set("delete", { value: "delete", title: o.Common.Delete + h }), S;
1361
1362
  };
1362
- let i = He({
1363
+ let d = He({
1363
1364
  model: a,
1364
1365
  mode: "filter",
1365
1366
  targetId: void 0,
1366
1367
  filters: void 0,
1367
1368
  payload: void 0
1368
1369
  });
1369
- P(a, () => {
1370
+ G(a, () => {
1370
1371
  u("selector", a.value);
1371
1372
  });
1372
- const g = w(() => {
1373
- if (i.value.mode === "setter" && l.maxTagsForSetter && !i.value.filters)
1374
- return i.value.model.value.length >= l.maxTagsForSetter;
1375
- }), d = (h) => {
1373
+ const m = P(() => {
1374
+ if (d.value.mode === "setter" && n.maxTagsForSetter && !d.value.filters)
1375
+ return d.value.model.value.length >= n.maxTagsForSetter;
1376
+ }), i = (h) => {
1376
1377
  if (h !== "all") {
1377
- if (i.value.model.value.includes(h)) return "selected";
1378
- if (i.value.model.value.includes(Me(h))) return "excluded";
1378
+ if (d.value.model.value.includes(h)) return "selected";
1379
+ if (d.value.model.value.includes(Pe(h))) return "excluded";
1379
1380
  }
1380
- return h === "all" && !i.value.model.value.length ? "selected" : "";
1381
- }, s = (h, I) => {
1382
- const x = Me(h);
1383
- let k = i.value.model.value.filter((K) => K !== h && K !== x);
1384
- I === "select" && k.push(h), I === "exclude" && k.push(x), i.value.mode === "setter" && i.value.targetId !== void 0 && l.requiredForSetter && (k.length || k.push("1"), k.length === 2 && i.value.model.value.length === 1 && i.value.model.value[0] === "1" && (k = k.filter((K) => K !== "1"))), l.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, te) => {
1385
- if (!l.tags) return 0;
1386
- const F = l.tags.findIndex((z) => z.id === K), W = l.tags.findIndex((z) => z.id === te);
1387
- return F - W;
1388
- }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && u("setter", {
1381
+ return h === "all" && !d.value.model.value.length ? "selected" : "";
1382
+ }, s = (h, S) => {
1383
+ const x = Pe(h);
1384
+ let k = d.value.model.value.filter((K) => K !== h && K !== x);
1385
+ S === "select" && k.push(h), S === "exclude" && k.push(x), d.value.mode === "setter" && d.value.targetId !== void 0 && n.requiredForSetter && (k.length || k.push("1"), k.length === 2 && d.value.model.value.length === 1 && d.value.model.value[0] === "1" && (k = k.filter((K) => K !== "1"))), n.singleMode && !d.value.filters && (k.length || (k = d.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, te) => {
1386
+ if (!n.tags) return 0;
1387
+ const W = n.tags.findIndex((J) => J.id === K), z = n.tags.findIndex((J) => J.id === te);
1388
+ return W - z;
1389
+ }), d.value.model.value = k, d.value.mode === "setter" && d.value.targetId !== void 0 && u("setter", {
1389
1390
  tagsIds: k,
1390
- targetId: i.value.targetId,
1391
- payload: i.value.payload
1391
+ targetId: d.value.targetId,
1392
+ payload: d.value.payload
1392
1393
  });
1393
- }, m = w(() => {
1394
+ }, f = P(() => {
1394
1395
  let h = "top-tagSelector_popup";
1395
- return i.value.mode === "filter" && (h += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (h += " top-tagSelector_popup-setter"), h;
1396
- }), ee = () => {
1396
+ return d.value.mode === "filter" && (h += " top-tagSelector_popup-filter"), d.value.mode === "setter" && (h += " top-tagSelector_popup-setter"), h;
1397
+ }), A = () => {
1397
1398
  const h = prompt("", "New tag");
1398
1399
  if (!h || h === "New tag") return;
1399
- const I = n.value.length + 1;
1400
- n.value.push({
1401
- id: String(I),
1400
+ const S = l.value.length + 1;
1401
+ l.value.push({
1402
+ id: String(S),
1402
1403
  name: h,
1403
- color_id: String((I - 1) % 10 + 1)
1404
- }), r("tagsChanged", n.value);
1405
- }, U = (h) => {
1406
- if (i.value = Y(h.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1407
- if (i.value.filters && (f.value = "add", i.value.model.value = []), !J.$?.ui.sortable) {
1404
+ color_id: String((S - 1) % 10 + 1)
1405
+ }), r("tagsChanged", l.value);
1406
+ }, F = (h) => {
1407
+ if (d.value = H(h.elPopupOpener, "topTagSelectorTarget"), !d.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1408
+ if (d.value.filters && (g.value = "add", d.value.model.value = []), !Y.$?.ui.sortable) {
1408
1409
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
1409
1410
  return;
1410
1411
  }
1411
- !J.state.isMobile && !J.state.isMobileUA && n.value && $(h.elPopup).sortable({
1412
+ !Y.state.isMobile && !Y.state.isMobileUA && l.value && $(h.elPopup).sortable({
1412
1413
  items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
1413
1414
  /**
1414
1415
  * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
1415
1416
  */
1416
1417
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
1417
1418
  distance: 10,
1418
- stop: function(I, x) {
1419
- if (!n.value) return;
1419
+ stop: function(S, x) {
1420
+ if (!l.value) return;
1420
1421
  const k = $(x.item).parent().find("[data-tag_id]"), K = [];
1421
- k.each((te, F) => {
1422
- if (!n.value) return;
1423
- const W = $(F).attr("data-tag_id");
1424
- K.push(W);
1425
- }), n.value.sort((te, F) => {
1426
- const W = K.findIndex((ue) => ue === te.id), z = K.findIndex((ue) => ue === F.id);
1427
- return W - z;
1428
- }), u("tagsChanged", n.value);
1422
+ k.each((te, W) => {
1423
+ if (!l.value) return;
1424
+ const z = $(W).attr("data-tag_id");
1425
+ K.push(z);
1426
+ }), l.value.sort((te, W) => {
1427
+ const z = K.findIndex((ue) => ue === te.id), J = K.findIndex((ue) => ue === W.id);
1428
+ return z - J;
1429
+ }), u("tagsChanged", l.value);
1429
1430
  }
1430
1431
  });
1431
1432
  }, De = (h) => {
1432
- J.$?.ui.sortable && $(h.elPopup).data("ui-sortable") && $(h.elPopup).sortable("destroy");
1433
+ Y.$?.ui.sortable && $(h.elPopup).data("ui-sortable") && $(h.elPopup).sortable("destroy");
1433
1434
  };
1434
- return (h, I) => (v(), T(q, null, [
1435
+ return (h, S) => (p(), j(D, null, [
1435
1436
  E(Jt, {
1436
1437
  modelValue: a.value,
1437
- "onUpdate:modelValue": I[0] || (I[0] = (x) => a.value = x),
1438
- id: p(c),
1439
- tags: n.value,
1438
+ "onUpdate:modelValue": S[0] || (S[0] = (x) => a.value = x),
1439
+ id: v(c),
1440
+ tags: l.value,
1440
1441
  styling: e.styling,
1441
1442
  mode: "filter",
1442
1443
  useTopButton: e.useTopButton
1443
1444
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
1444
- E(he, {
1445
- id: p(c),
1446
- class: Z(m.value),
1447
- onOpen: I[4] || (I[4] = (x) => U(x)),
1448
- onClose: I[5] || (I[5] = (x) => De(x)),
1445
+ E(pe, {
1446
+ id: v(c),
1447
+ class: ee(f.value),
1448
+ onOpen: S[4] || (S[4] = (x) => F(x)),
1449
+ onClose: S[5] || (S[5] = (x) => De(x)),
1449
1450
  "transition-duration": 50
1450
1451
  }, Qe({
1451
1452
  contentList: C(() => [
1452
- p(i).mode === "filter" && !e.singleMode ? (v(), j(Ve, {
1453
+ v(d).mode === "filter" && !e.singleMode ? (p(), T(Ve, {
1453
1454
  key: 0,
1454
1455
  id: "all",
1455
1456
  colorId: "",
1456
1457
  name: h.$i18n.Common.All_tags ?? "",
1457
- state: p(i).model.value.length ? "" : "selected",
1458
- onSelect: I[3] || (I[3] = (x) => p(i).model.value = [])
1459
- }, null, 8, ["name", "state"])) : _("", !0),
1460
- (v(!0), T(q, null, se(n.value, (x) => (v(), j(Ve, {
1458
+ state: v(d).model.value.length ? "" : "selected",
1459
+ onSelect: S[3] || (S[3] = (x) => v(d).model.value = [])
1460
+ }, null, 8, ["name", "state"])) : V("", !0),
1461
+ (p(!0), j(D, null, se(l.value, (x) => (p(), T(Ve, {
1461
1462
  key: x.id,
1462
1463
  id: x.id,
1463
1464
  colorId: x.color_id,
1464
1465
  name: x.name,
1465
- state: d(x.id),
1466
- canExclude: p(i).mode === "filter" && !e.singleMode,
1466
+ state: i(x.id),
1467
+ canExclude: v(d).mode === "filter" && !e.singleMode,
1467
1468
  editable: e.tagsEditable,
1468
- disabled: g.value && d(x.id) === "",
1469
+ disabled: m.value && i(x.id) === "",
1469
1470
  onUnselect: (k) => s(x.id, "unselect"),
1470
1471
  onSelect: (k) => s(x.id, "select"),
1471
1472
  onExclude: (k) => s(x.id, "exclude"),
1472
1473
  "onUpdate:name": (k) => {
1473
- x.name = k, p(u)("tagsChanged", n.value);
1474
+ x.name = k, v(u)("tagsChanged", l.value);
1474
1475
  }
1475
1476
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
1476
- e.tagsEditable && n.value.length < e.tagsMax && n.value.length < 20 ? (v(), j(ye, {
1477
+ e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (p(), T(he, {
1477
1478
  key: 1,
1478
1479
  "data-top-icon": "",
1479
- onClick: D(ee, ["stop"])
1480
+ onClick: U(A, ["stop"])
1480
1481
  }, {
1481
1482
  default: C(() => [
1482
- N(A(h.$i18n.Common.Add), 1)
1483
+ q(B(h.$i18n.Common.Add), 1)
1483
1484
  ]),
1484
1485
  _: 1
1485
- })) : _("", !0)
1486
+ })) : V("", !0)
1486
1487
  ]),
1487
1488
  _: 2
1488
1489
  }, [
1489
- p(i).mode === "setter" && p(i).filters ? {
1490
+ v(d).mode === "setter" && v(d).filters ? {
1490
1491
  name: "header",
1491
1492
  fn: C(() => [
1492
1493
  E(fe, {
1493
- modelValue: f.value,
1494
- "onUpdate:modelValue": I[1] || (I[1] = (x) => f.value = x),
1495
- options: S()
1494
+ modelValue: g.value,
1495
+ "onUpdate:modelValue": S[1] || (S[1] = (x) => g.value = x),
1496
+ options: I()
1496
1497
  }, null, 8, ["modelValue", "options"])
1497
1498
  ]),
1498
1499
  key: "0"
1499
1500
  } : void 0,
1500
- p(i).mode === "setter" && p(i).filters ? {
1501
+ v(d).mode === "setter" && v(d).filters ? {
1501
1502
  name: "footer",
1502
1503
  fn: C(() => [
1503
- E(Q, { color: "theme" }, {
1504
+ E(X, { color: "theme" }, {
1504
1505
  default: C(() => [
1505
- N(A(h.$i18n.Common.Cancel2), 1)
1506
+ q(B(h.$i18n.Common.Cancel2), 1)
1506
1507
  ]),
1507
1508
  _: 1
1508
1509
  }),
1509
- E(Q, {
1510
- onClick: I[2] || (I[2] = (x) => p(u)("setter", {
1511
- tagsIds: p(i).model.value,
1512
- filters: p(i).filters,
1513
- filtersAction: f.value,
1514
- payload: p(i).payload
1510
+ E(X, {
1511
+ onClick: S[2] || (S[2] = (x) => v(u)("setter", {
1512
+ tagsIds: v(d).model.value,
1513
+ filters: v(d).filters,
1514
+ filtersAction: g.value,
1515
+ payload: v(d).payload
1515
1516
  }))
1516
1517
  }, {
1517
1518
  default: C(() => [
1518
- N(A(f.value === "add" ? h.$i18n.Common.Add : "") + " " + A(f.value === "replace" ? h.$i18n.Common.Replace : "") + " " + A(f.value === "delete" ? h.$i18n.Common.Delete : ""), 1)
1519
+ q(B(g.value === "add" ? h.$i18n.Common.Add : "") + " " + B(g.value === "replace" ? h.$i18n.Common.Replace : "") + " " + B(g.value === "delete" ? h.$i18n.Common.Delete : ""), 1)
1519
1520
  ]),
1520
1521
  _: 1
1521
1522
  })
@@ -1531,7 +1532,7 @@ export {
1531
1532
  co as TopGroupSelector,
1532
1533
  go as TopProjectSelector,
1533
1534
  uo as TopRegionSelector,
1534
- po as TopTagSelector,
1535
+ vo as TopTagSelector,
1535
1536
  Jt as TopTagSelectorPopupOpener,
1536
1537
  ve as TopTagSelectorTagIcon,
1537
1538
  mt as dialogRegionSelector,