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