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