@topvisor/ui 1.5.0-updates.0 → 1.5.0-updates.5

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 (305) 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 +1666 -1643
  142. package/project/project.js.map +1 -1
  143. package/src/src/components/project/groupSelector/folders/types.d.ts +1 -1
  144. package/src/src/components/project/groupSelector/folders/utils.d.ts +35 -400
  145. package/src/src/components/project/groupSelector/groupSelector.vue.d.ts +1 -1
  146. package/src/src/components/project/groupSelector/groups/types.d.ts +1 -1
  147. package/src/src/components/project/groupSelector/groups/utils.d.ts +44 -757
  148. package/src/src/components/project/projectSelector/utils.d.ts +40 -39
  149. package/tabs/tabs.amd.js +2 -2
  150. package/tabs/tabs.amd.js.map +1 -1
  151. package/tabs/tabs.js +63 -77
  152. package/tabs/tabs.js.map +1 -1
  153. package/tabsView/tabsView.amd.js +2 -2
  154. package/tabsView/tabsView.amd.js.map +1 -1
  155. package/tabsView/tabsView.js +245 -288
  156. package/tabsView/tabsView.js.map +1 -1
  157. package/utils/check.amd.js +2 -2
  158. package/utils/check.amd.js.map +1 -1
  159. package/utils/check.js +15 -19
  160. package/utils/check.js.map +1 -1
  161. package/utils/clipboard.amd.js +6 -6
  162. package/utils/clipboard.amd.js.map +1 -1
  163. package/utils/clipboard.js +26 -31
  164. package/utils/clipboard.js.map +1 -1
  165. package/utils/date.amd.js +2 -2
  166. package/utils/date.amd.js.map +1 -1
  167. package/utils/date.js +2 -12
  168. package/utils/device.amd.js +2 -2
  169. package/utils/device.amd.js.map +1 -1
  170. package/utils/device.js +2 -15
  171. package/utils/dom.amd.js +2 -2
  172. package/utils/dom.amd.js.map +1 -1
  173. package/utils/dom.js +53 -67
  174. package/utils/dom.js.map +1 -1
  175. package/utils/image.amd.js +3 -3
  176. package/utils/image.amd.js.map +1 -1
  177. package/utils/image.js +12 -22
  178. package/utils/image.js.map +1 -1
  179. package/utils/keyboard.amd.js +2 -2
  180. package/utils/keyboard.amd.js.map +1 -1
  181. package/utils/keyboard.js +10 -11
  182. package/utils/keyboard.js.map +1 -1
  183. package/utils/lodash.amd.js +2 -2
  184. package/utils/lodash.amd.js.map +1 -1
  185. package/utils/lodash.js +2 -9
  186. package/utils/number.amd.js +2 -2
  187. package/utils/number.amd.js.map +1 -1
  188. package/utils/number.js +12 -12
  189. package/utils/number.js.map +1 -1
  190. package/utils/price.amd.js +2 -2
  191. package/utils/price.amd.js.map +1 -1
  192. package/utils/price.js +14 -9
  193. package/utils/price.js.map +1 -1
  194. package/utils/route.amd.js +2 -2
  195. package/utils/route.amd.js.map +1 -1
  196. package/utils/route.js +33 -37
  197. package/utils/route.js.map +1 -1
  198. package/utils/scroll.amd.js +2 -2
  199. package/utils/scroll.amd.js.map +1 -1
  200. package/utils/scroll.js +39 -43
  201. package/utils/scroll.js.map +1 -1
  202. package/utils/searchers.amd.js +2 -2
  203. package/utils/searchers.amd.js.map +1 -1
  204. package/utils/searchers.js +128 -133
  205. package/utils/searchers.js.map +1 -1
  206. package/utils/store.amd.js +2 -2
  207. package/utils/store.amd.js.map +1 -1
  208. package/utils/store.js +2 -7
  209. package/utils/string.amd.js +2 -2
  210. package/utils/string.amd.js.map +1 -1
  211. package/utils/string.js +120 -147
  212. package/utils/string.js.map +1 -1
  213. package/utils/system.amd.js +2 -2
  214. package/utils/system.amd.js.map +1 -1
  215. package/utils/system.js +25 -28
  216. package/utils/system.js.map +1 -1
  217. package/utils/url.amd.js +3 -3
  218. package/utils/url.amd.js.map +1 -1
  219. package/utils/url.js +36 -47
  220. package/utils/url.js.map +1 -1
  221. package/.chunks/core-Dgj_YGWh.es.js +0 -268
  222. package/.chunks/core-Dgj_YGWh.es.js.map +0 -1
  223. package/.chunks/core-DzDFXOdI.amd.js +0 -2
  224. package/.chunks/core-DzDFXOdI.amd.js.map +0 -1
  225. package/.chunks/datepicker-oa8ZwRhq.amd.js +0 -2
  226. package/.chunks/datepicker-oa8ZwRhq.amd.js.map +0 -1
  227. package/.chunks/datepicker-qToxk2nN.es.js +0 -41
  228. package/.chunks/datepicker-qToxk2nN.es.js.map +0 -1
  229. package/.chunks/dialog_regionSelectorRegions-CZ0tMVSq.amd.js +0 -2
  230. package/.chunks/dialog_regionSelectorRegions-CZ0tMVSq.amd.js.map +0 -1
  231. package/.chunks/dialog_regionSelectorRegions-qDW2Ejsv.es.js +0 -180
  232. package/.chunks/dialog_regionSelectorRegions-qDW2Ejsv.es.js.map +0 -1
  233. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-BBix_8WK.amd.js +0 -2
  234. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-BBix_8WK.amd.js.map +0 -1
  235. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CJ97l1ST.es.js +0 -323
  236. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CJ97l1ST.es.js.map +0 -1
  237. package/.chunks/field-Cvv0SRcJ.amd.js +0 -2
  238. package/.chunks/field-Cvv0SRcJ.amd.js.map +0 -1
  239. package/.chunks/field-CyyFzM-Y.es.js +0 -16
  240. package/.chunks/field-CyyFzM-Y.es.js.map +0 -1
  241. package/.chunks/forms-DDNzqU6o.amd.js +0 -3
  242. package/.chunks/forms-DDNzqU6o.amd.js.map +0 -1
  243. package/.chunks/forms-DtC-EKJL.es.js +0 -2053
  244. package/.chunks/forms-DtC-EKJL.es.js.map +0 -1
  245. package/.chunks/index-DLUtoTUg.amd.js +0 -2
  246. package/.chunks/index-DLUtoTUg.amd.js.map +0 -1
  247. package/.chunks/index-DkQWJkMc.es.js +0 -54
  248. package/.chunks/index-DkQWJkMc.es.js.map +0 -1
  249. package/.chunks/lazy-DDNqYkXn.amd.js +0 -2
  250. package/.chunks/lazy-DDNqYkXn.amd.js.map +0 -1
  251. package/.chunks/lazy-HKSyLh72.es.js +0 -75
  252. package/.chunks/lazy-HKSyLh72.es.js.map +0 -1
  253. package/.chunks/notice-BvQl911b.es.js +0 -191
  254. package/.chunks/notice-BvQl911b.es.js.map +0 -1
  255. package/.chunks/notice-CJ3WOTCM.amd.js +0 -4
  256. package/.chunks/notice-CJ3WOTCM.amd.js.map +0 -1
  257. package/.chunks/page.vue_vue_type_script_setup_true_lang-Dd5-B4Ss.es.js +0 -139
  258. package/.chunks/page.vue_vue_type_script_setup_true_lang-Dd5-B4Ss.es.js.map +0 -1
  259. package/.chunks/page.vue_vue_type_script_setup_true_lang-fl6-Ql4d.amd.js +0 -2
  260. package/.chunks/page.vue_vue_type_script_setup_true_lang-fl6-Ql4d.amd.js.map +0 -1
  261. package/.chunks/policy.vue_vue_type_style_index_0_lang-Bv3LwNDC.es.js +0 -519
  262. package/.chunks/policy.vue_vue_type_style_index_0_lang-Bv3LwNDC.es.js.map +0 -1
  263. package/.chunks/policy.vue_vue_type_style_index_0_lang-Da7rztT5.amd.js +0 -2
  264. package/.chunks/policy.vue_vue_type_style_index_0_lang-Da7rztT5.amd.js.map +0 -1
  265. package/.chunks/popup-OuDglAOF.es.js +0 -470
  266. package/.chunks/popup-OuDglAOF.es.js.map +0 -1
  267. package/.chunks/popup-yXIpyok3.amd.js +0 -2
  268. package/.chunks/popup-yXIpyok3.amd.js.map +0 -1
  269. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Bu_HvFoW.amd.js +0 -2
  270. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Bu_HvFoW.amd.js.map +0 -1
  271. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DAQIAxvu.es.js +0 -209
  272. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DAQIAxvu.es.js.map +0 -1
  273. package/.chunks/punycode.es6-CNOnFR2-.amd.js +0 -2
  274. package/.chunks/punycode.es6-CNOnFR2-.amd.js.map +0 -1
  275. package/.chunks/punycode.es6-CgGegfA_.es.js +0 -134
  276. package/.chunks/store-CX_6ZXhO.es.js +0 -29
  277. package/.chunks/store-YRW59xEF.amd.js +0 -2
  278. package/.chunks/store-YRW59xEF.amd.js.map +0 -1
  279. package/.chunks/utils-BNzP9anP.es.js +0 -78
  280. package/.chunks/utils-BNzP9anP.es.js.map +0 -1
  281. package/.chunks/utils-CWn_G7OO.amd.js +0 -2
  282. package/.chunks/utils-CWn_G7OO.amd.js.map +0 -1
  283. package/.chunks/utils-DIviuVEw.amd.js +0 -2
  284. package/.chunks/utils-DIviuVEw.amd.js.map +0 -1
  285. package/.chunks/utils-Dma85ehT.es.js +0 -288
  286. package/.chunks/utils-Dma85ehT.es.js.map +0 -1
  287. package/.chunks/widgetInput.vue_vue_type_script_setup_true_lang-CX_BOcVY.es.js +0 -39
  288. package/.chunks/widgetInput.vue_vue_type_script_setup_true_lang-CX_BOcVY.es.js.map +0 -1
  289. package/.chunks/widgetInput.vue_vue_type_script_setup_true_lang-CkOmb3VD.amd.js +0 -2
  290. package/.chunks/widgetInput.vue_vue_type_script_setup_true_lang-CkOmb3VD.amd.js.map +0 -1
  291. package/api/index.js.map +0 -1
  292. package/assets/policy.css +0 -1
  293. package/assets/popupHint.css +0 -1
  294. package/core/app.js.map +0 -1
  295. package/dialog/dialog.js.map +0 -1
  296. package/forms/forms.js.map +0 -1
  297. package/forms/helpers.js.map +0 -1
  298. package/formsExt/formsExt.js.map +0 -1
  299. package/popup/popup.js.map +0 -1
  300. package/popup/worker.js.map +0 -1
  301. package/src/src/components/project/groupSelector/utils.d.ts +0 -37
  302. package/utils/date.js.map +0 -1
  303. package/utils/device.js.map +0 -1
  304. package/utils/lodash.js.map +0 -1
  305. package/utils/store.js.map +0 -1
@@ -1,1653 +1,1676 @@
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 = {
468
+ id: 0,
469
+ name: "/",
470
+ path: "/"
492
471
  };
493
- function _t(e) {
494
- return e ? B()?.Common.All_folders : "/ (" + B()?.Keywords.Root_folder + ")";
472
+ function Le(t) {
473
+ return t ? e()?.Common.All_folders : "/ (" + e()?.Keywords.Root_folder + ")";
495
474
  }
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;
505
- };
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);
475
+ var Re = (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) => {
476
+ a = { ...a }, r.childsIds.push(a.id), a.id === 0 && (a.name = Le(t));
477
+ let o = i > 1 ? "-".repeat(i - 1) + " " : "";
478
+ o && !a.name.startsWith(o) && (a.name = o + a.name), n.set(a.id, a), Re(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);
479
+ }), n), ze = (e, t) => e.gen(`/get/${t}/folders/`, [
480
+ "id",
481
+ "parent_id",
482
+ "name",
483
+ "path"
484
+ ]).changeParams({
485
+ orders: ["ord_path"],
486
+ limit: 100
487
+ });
488
+ //#endregion
489
+ //#region src/core/utils/composables/useWatch.ts
490
+ function Be(e, t, n) {
491
+ let r = Object.keys(e);
492
+ return R(r.map((t) => e[t]), (e, n, i) => {
493
+ let a = {};
494
+ e.forEach((e, t) => {
495
+ if (!Object.is(e, n[t])) {
496
+ let i = r[t];
497
+ a[i] = {
498
+ old: n[t],
499
+ new: e
500
+ };
501
+ }
502
+ }), Object.keys(a).length && t(a, i);
503
+ }, n);
520
504
  }
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
- }
505
+ //#endregion
506
+ //#region src/components/project/groupSelector/folders/folders.vue?vue&type=script&setup=true&lang.ts
507
+ var Ve = ["innerHTML"], He = /* @__PURE__ */ k({
508
+ __name: "folders",
509
+ props: /* @__PURE__ */ A({
510
+ folderId: {},
511
+ folder: {},
512
+ folders: {},
513
+ projectId: {},
514
+ canSelectAll: { type: Boolean },
515
+ addChanger: { type: Boolean },
516
+ addIcon: {
517
+ type: Boolean,
518
+ default: !0
519
+ },
520
+ client: {},
521
+ service: {}
522
+ }, {
523
+ folderId: { required: !0 },
524
+ folderIdModifiers: {},
525
+ folder: { default: H },
526
+ folderModifiers: {}
527
+ }),
528
+ emits: ["update:folderId", "update:folder"],
529
+ setup(e) {
530
+ let t = e, n = L(e, "folderId"), r = L(e, "folder"), i = t.client && !t.folders ? ze(t.client, t.service) : void 0, a = N(null);
531
+ R(() => t.projectId, () => {
532
+ i?.changeParams({ project_id: t.projectId }), i?.setOptions({ checkFingerprint: "TopGroupSelectorFolders:" + t.projectId }), a.value?.resetCache();
533
+ }, { immediate: !0 });
534
+ let o = S(() => Re(t.folders ?? { root: [H] }, t.canSelectAll));
535
+ return Be({
536
+ modelFolder: r,
537
+ modelFolderId: n
538
+ }, async (e) => {
539
+ if (n.value === r.value.id) return;
540
+ if (e.modelFolder && !e.modelFolderId) {
541
+ n.value = r.value.id;
542
+ return;
543
+ }
544
+ let i = o.value.get(t.folderId);
545
+ i ||= H, r.value = i, n.value = i.id;
546
+ }, { immediate: !0 }), (t, n) => (M(), C(y, {
547
+ class: "top-groupSelector_folder",
548
+ modelValue: r.value,
549
+ "onUpdate:modelValue": n[0] ||= (e) => r.value = e,
550
+ items: e.folders ? [...o.value.values()] : void 0,
551
+ "search-type": "inline",
552
+ icon: e.addIcon ? "" : void 0,
553
+ api: e.folders ? void 0 : I(i),
554
+ apiSetSearchParams: (...e) => I(b)(...e, "name"),
555
+ addChanger: e.addChanger,
556
+ useCache: ""
557
+ }, {
558
+ item: z(({ item: e }) => [E("div", { innerHTML: e.name.replaceAll(/</g, "< ") }, null, 8, Ve)]),
559
+ _: 1
560
+ }, 8, [
561
+ "modelValue",
562
+ "items",
563
+ "icon",
564
+ "api",
565
+ "apiSetSearchParams",
566
+ "addChanger"
567
+ ]));
568
+ }
569
+ }), U = {
570
+ id: -1,
571
+ name: "--",
572
+ folder_id: H.id,
573
+ folder_path: H.path
574
+ }, W = {
575
+ id: 0,
576
+ name: "All groups",
577
+ folder_id: H.id,
578
+ folder_path: H.path
579
+ }, G = () => (W.name = e()?.Common.All_groups, W), Ue = () => (W.name = e()?.Keywords.Choose_group, W), 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) => e.gen(`/get/${t}/groups/`, [
580
+ "id",
581
+ "name",
582
+ "folder_id",
583
+ "folder_path"
584
+ ]).changeParams({
585
+ folder_id_depth: !0,
586
+ limit: 100
587
+ }), Ke = (e, t) => e.gen(`/add/${t}/groups/`), qe = { class: "top-groupSelector_groupItem" }, Je = {
588
+ key: 0,
589
+ class: "top-comment"
590
+ }, Ye = ["innerHTML"], Xe = ["innerHTML"], Ze = /* @__PURE__ */ k({
591
+ __name: "groups",
592
+ props: /* @__PURE__ */ A({
593
+ groupId: {},
594
+ group: {},
595
+ projectId: {},
596
+ folder: {},
597
+ groups: {},
598
+ on: {
599
+ type: Boolean,
600
+ default: void 0
601
+ },
602
+ canAdd: { type: [String, Boolean] },
603
+ canSelectAll: { type: [Boolean, String] },
604
+ autoselect: { default: "first" },
605
+ addChanger: {
606
+ type: Boolean,
607
+ default: !0
608
+ },
609
+ showPath: { type: Boolean },
610
+ addIcon: {
611
+ type: Boolean,
612
+ default: !0
613
+ },
614
+ client: {},
615
+ service: {}
616
+ }, {
617
+ groupId: { required: !0 },
618
+ groupIdModifiers: {},
619
+ group: { required: !0 },
620
+ groupModifiers: {}
621
+ }),
622
+ emits: /* @__PURE__ */ A(["addGroup"], ["update:groupId", "update:group"]),
623
+ setup(e, { emit: t }) {
624
+ let n = e, r = t, i = L(e, "groupId"), a = L(e, "group"), s = n.client && !n.groups ? Ge(n.client, n.service) : void 0, c = n.client ? Ke(n.client, n.service) : void 0, l = N(null), u = N(void 0), d = o("folder_id", "EQUALS", [n.folder?.id ?? 0]);
625
+ s?.changeParams({
626
+ project_id: n.projectId,
627
+ folder_id_depth: !0,
628
+ filters: [d]
629
+ }), n.on !== void 0 && s?.params.filters?.push(o("on", "EQUALS", [Number(n.on)]));
630
+ let f = (e) => {
631
+ a.value = e, i.value = e.id;
632
+ };
633
+ Be({
634
+ projectId: () => n.projectId,
635
+ folderId: () => n.folder?.id,
636
+ canSelectAll: () => n.canSelectAll
637
+ }, (e) => {
638
+ 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) {
639
+ let e;
640
+ n.autoselect === "first" && (e = u.value?.[0], n.canSelectAll && (e = oe(G()))), (n.autoselect === "placeholder" || !e) && (e = Ue()), f(e);
641
+ }
642
+ }, { immediate: !0 }), Be({
643
+ modelGroup: a,
644
+ modelGroupId: i
645
+ }, async (e) => {
646
+ if (i.value !== a.value.id) {
647
+ if (e.modelGroup && !e.modelGroupId) {
648
+ i.value = a.value.id;
649
+ return;
650
+ }
651
+ if (!(n.canAdd && i.value === null)) {
652
+ if (n.groups) {
653
+ let e = u.value?.find((e) => e.id === i.value);
654
+ if (!e && n.canSelectAll && (e = G()), e) f(e);
655
+ else {
656
+ let e = u.value?.[0];
657
+ e && !i.value ? f(e) : f(U);
658
+ }
659
+ }
660
+ if (n.client && !n.groups && (i.value || i.value === 0 && !n.canSelectAll)) {
661
+ let e = Ge(n.client, n.service).changeParams({
662
+ project_id: n.projectId,
663
+ id: i.value,
664
+ filters: [d]
665
+ });
666
+ e?.setOptions({ checkFingerprint: "TopGroupSelectorFindGroup:" + n.projectId });
667
+ let t = await e.call();
668
+ if (!t.errors?.length && !t.result) return;
669
+ !t.errors && t.result[0] ? f(t.result[0]) : f(U);
670
+ }
671
+ }
672
+ }
673
+ }, { immediate: !0 });
674
+ let p = async (e) => {
675
+ if (n.canAdd !== "api" || !c) return;
676
+ let t = a.value, i = await c.changeParams({
677
+ project_id: n.projectId,
678
+ names: [e.name],
679
+ to_id: n.folder?.id ?? H.id,
680
+ to_type: "in_folder_last"
681
+ }).call();
682
+ if (i.result) {
683
+ let e = i.result[0];
684
+ f(e), r("addGroup", e);
685
+ } else f(t);
686
+ l.value?.resetCache(!0);
687
+ };
688
+ return (t, n) => (M(), C(y, {
689
+ ref_key: "refSelector",
690
+ ref: l,
691
+ class: "top-groupSelector_group",
692
+ modelValue: a.value,
693
+ "onUpdate:modelValue": n[0] ||= (e) => a.value = e,
694
+ items: u.value ?? e.groups,
695
+ searchType: "inline",
696
+ icon: e.addIcon ? "" : void 0,
697
+ api: e.groups ? void 0 : I(s),
698
+ apiSetSearchParams: (...e) => I(b)(...e, "name"),
699
+ appendSearchToResult: !!e.canAdd,
700
+ useAllItem: e.canSelectAll ? I(G)().name : !1,
701
+ addChanger: e.addChanger,
702
+ useCache: "",
703
+ onAppendItem: p
704
+ }, {
705
+ item: z(({ item: n }) => [E("div", qe, [
706
+ n.id === I(null) ? (M(), T("div", Je, F(t.$i18n.Common.Add) + ": ", 1)) : w("", !0),
707
+ E("span", { innerHTML: n.name }, null, 8, Ye),
708
+ n.folder_path && e.showPath ? (M(), T("span", {
709
+ key: 1,
710
+ class: "top-groupSelector_groupItemFolderPath",
711
+ innerHTML: n.folder_path
712
+ }, null, 8, Xe)) : w("", !0)
713
+ ])]),
714
+ _: 1
715
+ }, 8, [
716
+ "modelValue",
717
+ "items",
718
+ "icon",
719
+ "api",
720
+ "apiSetSearchParams",
721
+ "appendSearchToResult",
722
+ "useAllItem",
723
+ "addChanger"
724
+ ]));
725
+ }
726
+ }), Qe = { class: "top-groupSelector" }, $e = /* @__PURE__ */ k({
727
+ __name: "groupSelector",
728
+ props: /* @__PURE__ */ A({
729
+ folderId: {},
730
+ folder: {},
731
+ groupId: {},
732
+ group: {},
733
+ projectId: {},
734
+ folders: {},
735
+ groups: {},
736
+ on: {
737
+ type: Boolean,
738
+ default: void 0
739
+ },
740
+ canSelectAllGroups: { type: Boolean },
741
+ canAddGroup: { type: [String, Boolean] },
742
+ autoselect: { default: "first" },
743
+ addChanger: {
744
+ type: Boolean,
745
+ default: !0
746
+ },
747
+ showFolders: {
748
+ type: Boolean,
749
+ default: !0
750
+ },
751
+ showGroups: {
752
+ type: Boolean,
753
+ default: !0
754
+ },
755
+ addIcon: {
756
+ type: Boolean,
757
+ default: !0
758
+ },
759
+ client: {},
760
+ service: { default: "keywords_2" }
761
+ }, {
762
+ folderId: { required: !0 },
763
+ folderIdModifiers: {},
764
+ folder: {},
765
+ folderModifiers: {},
766
+ groupId: { required: !0 },
767
+ groupIdModifiers: {},
768
+ group: { default: U },
769
+ groupModifiers: {}
770
+ }),
771
+ emits: /* @__PURE__ */ A(["update:groups"], [
772
+ "update:folderId",
773
+ "update:folder",
774
+ "update:groupId",
775
+ "update:group"
776
+ ]),
777
+ setup(e, { emit: t }) {
778
+ let n = e, r = L(e, "folderId"), i = L(e, "folder"), a = L(e, "groupId"), o = L(e, "group"), s = t;
779
+ i.value = Re(n.folders ?? { root: [H] }, n.canSelectAllGroups).get(r.value);
780
+ let c = n.groups?.find((e) => e.id === a.value);
781
+ a.value || (c = n.groups?.[0]), n.canSelectAllGroups && !c && (c = G()), n.canSelectAllGroups && !c && (c = G()), (n.autoselect === "placeholder" || !c) && (c = Ue()), c ??= U, o.value = c;
782
+ let l = (e) => {
783
+ let t;
784
+ n.groups && e && (t = [...n.groups, e]), s("update:groups", t);
785
+ };
786
+ return (t, n) => (M(), T("div", Qe, [e.showFolders ? (M(), C(He, {
787
+ key: 0,
788
+ folderId: r.value,
789
+ "onUpdate:folderId": n[0] ||= (e) => r.value = e,
790
+ folder: i.value,
791
+ "onUpdate:folder": n[1] ||= (e) => i.value = e,
792
+ projectId: e.projectId,
793
+ folders: e.folders,
794
+ canSelectAll: e.canSelectAllGroups,
795
+ addChanger: e.addChanger,
796
+ addIcon: e.addIcon,
797
+ client: e.client,
798
+ service: e.service
799
+ }, null, 8, [
800
+ "folderId",
801
+ "folder",
802
+ "projectId",
803
+ "folders",
804
+ "canSelectAll",
805
+ "addChanger",
806
+ "addIcon",
807
+ "client",
808
+ "service"
809
+ ])) : w("", !0), e.showGroups ? (M(), C(Ze, {
810
+ key: 1,
811
+ groupId: a.value,
812
+ "onUpdate:groupId": n[2] ||= (e) => a.value = e,
813
+ group: o.value,
814
+ "onUpdate:group": n[3] ||= (e) => o.value = e,
815
+ projectId: e.projectId,
816
+ folder: i.value,
817
+ groups: e.groups,
818
+ on: e.on,
819
+ canAdd: e.canAddGroup,
820
+ canSelectAll: e.canSelectAllGroups,
821
+ autoselect: e.autoselect,
822
+ addChanger: e.addChanger,
823
+ showPath: e.showFolders && !!e.folders?.[0],
824
+ addIcon: e.addIcon,
825
+ client: e.client,
826
+ service: e.service,
827
+ onAddGroup: l
828
+ }, null, 8, [
829
+ "groupId",
830
+ "group",
831
+ "projectId",
832
+ "folder",
833
+ "groups",
834
+ "on",
835
+ "canAdd",
836
+ "canSelectAll",
837
+ "autoselect",
838
+ "addChanger",
839
+ "showPath",
840
+ "addIcon",
841
+ "client",
842
+ "service"
843
+ ])) : w("", !0)]));
844
+ }
845
+ }), et = (e) => ({
846
+ id: null,
847
+ name: e,
848
+ listItemProps: { type: "title" }
849
+ }), tt = {
850
+ scheduledUpdate: !1,
851
+ manualUpdate: !1,
852
+ guestProjects: !1
853
+ }, nt = (t, n) => {
854
+ let r = [], i = {
855
+ scheduledUpdate: et(e().Projects.Scheduled_update),
856
+ manualUpdate: et(e().Projects.Manual_update),
857
+ guestProjects: et(e().Projects.Guest_projects)
858
+ }, a = n ? {
859
+ scheduledUpdate: !1,
860
+ manualUpdate: !1,
861
+ guestProjects: !1
862
+ } : tt;
863
+ 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);
864
+ return r;
865
+ }, rt = (e) => e.map((e) => ({
866
+ ...e,
867
+ listItemProps: { attrs: { title: e.name } }
868
+ })), it = (e, t, n) => !e || e.length === 0 ? [] : (t && Object.keys(tt).forEach((e) => tt[e] = !1), nt(rt(e), n)), at = (e) => {
869
+ e = e.replace(/#.*/, "");
870
+ let t = location.hash;
871
+ 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;
872
+ }, ot = (e, t) => {
873
+ t && t.target instanceof HTMLElement && c.close(t.target.closest(".top-popup-wrapper"));
874
+ let n = at(e);
875
+ location.href = n;
876
+ }, st = (e) => {
877
+ let t = ct(), n = location.pathname.split("/"), r = "project/dynamics/", i = "";
878
+ return n[1] == "project" && (r = n[1] + "/" + n[2] + "/"), n[2] == "settings" && (i = location.hash), [
879
+ "watcher",
880
+ "indexing",
881
+ "sitemap",
882
+ "audit",
883
+ "direct",
884
+ "adwords"
885
+ ].includes(n[4]) && (i = n[4] + "/"), "https://" + t + "/" + r + e + "/" + i;
886
+ }, ct = () => window.page?.subdomain ? window.location.host.replace(window.page?.subdomain + ".", "") : window.location.host, lt = (e) => {
887
+ let t = e.startsWith("http") ? e : "http://" + e;
888
+ return t = t.replace(/"/g, "%22"), t;
889
+ }, ut = (e, t) => {
890
+ let n = e.params.filters ?? [];
891
+ n = n.filter((e) => e.name !== "GEN_SEARCH_STRING()");
892
+ let r = h(t), i = t.replace(/([[^$.|?*+()])/g, "\\$1"), a = r.replace(/([[^$.|?*+()])/g, "\\$1");
893
+ t && n.push(o("GEN_SEARCH_STRING()", "REGEXP", [`(${i}|${a})`])), e.changeParams({ filters: n });
894
+ }, dt = (e, t, n) => {
895
+ let r = e.gen("/get/projects_2/projects/", [
896
+ "id",
897
+ "user_id",
898
+ "name",
899
+ "url",
900
+ "on",
901
+ "right"
902
+ ]);
903
+ return r.params = {
904
+ ...n,
905
+ filters: [o("on", "GREATER_THAN_EQUALS", [0])],
906
+ orders: [
907
+ a("user_id", "DESC", [t]),
908
+ a("on", "DESC"),
909
+ a("favorite", "DESC"),
910
+ a("id", "DESC")
911
+ ]
912
+ }, r.options.onApiLoaded = (e, t, n) => {
913
+ 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;
914
+ e.result = it(e.result, r, i), n?.(e, t);
915
+ }, r;
916
+ }, ft = (e) => e.gen("/add/projects_2/projects/"), pt = { class: "top-projectSelectorSubmenu_item" }, mt = [
917
+ "href",
918
+ "title",
919
+ "data-top-icon",
920
+ "data-right"
921
+ ], ht = { class: "top-projectSelectorSubmenu_item" }, gt = ["href"], _t = /* @__PURE__ */ k({
922
+ __name: "submenu",
923
+ props: {
924
+ id: {},
925
+ right: {},
926
+ url: {}
927
+ },
928
+ setup(t) {
929
+ let n = t, r = e(), i = ct(), a = [
930
+ {
931
+ href: `https://${i}/project/keywords/${n.id}/`,
932
+ title: r.Common.Menu_phrases,
933
+ icon: "",
934
+ right: "2"
935
+ },
936
+ {
937
+ href: `https://${i}/project/dynamics/${n.id}/`,
938
+ title: r.Common.Menu_dynamics,
939
+ icon: "",
940
+ right: "1"
941
+ },
942
+ {
943
+ href: `https://${i}/project/snapshots/${n.id}/`,
944
+ title: r.Common.Menu_snapshots,
945
+ icon: "",
946
+ right: "1"
947
+ },
948
+ {
949
+ href: `https://${i}/project/competitors/${n.id}/`,
950
+ title: r.Common.Menu_competitors,
951
+ icon: "",
952
+ right: "1"
953
+ },
954
+ {
955
+ href: `https://${i}/project/analytics/${n.id}/`,
956
+ title: r.Common.Menu_analytics,
957
+ icon: "",
958
+ right: "5"
959
+ },
960
+ {
961
+ href: `https://${i}/project/broker/${n.id}/`,
962
+ title: r.Common.Menu_broker,
963
+ icon: "",
964
+ right: "6"
965
+ },
966
+ {
967
+ href: `https://${i}/project/audit/${n.id}/sitemap/`,
968
+ title: r.Audit.Sitemap_gen,
969
+ icon: "",
970
+ right: "8"
971
+ },
972
+ {
973
+ href: `https://${i}/project/audit/${n.id}/audit/`,
974
+ title: r.Common.Menu_audit,
975
+ icon: "",
976
+ right: "8"
977
+ },
978
+ {
979
+ href: `https://${i}/project/audit/${n.id}/indexing/`,
980
+ title: r.Audit.Indexing,
981
+ icon: "",
982
+ right: "8"
983
+ },
984
+ {
985
+ href: `https://${i}/project/audit/${n.id}/watcher/`,
986
+ title: r.Audit.Watcher,
987
+ icon: "",
988
+ right: "9"
989
+ },
990
+ {
991
+ href: `https://${i}/project/settings/${n.id}/`,
992
+ title: r.Common.Menu_settings,
993
+ icon: "",
994
+ right: "2"
995
+ }
996
+ ], o = S(() => n.right.includes("0") ? a.filter((e) => n.right[e.right] === "1") : a);
997
+ return (e, n) => {
998
+ let r = ce("TopButton");
999
+ return M(), C(I(_), {
1000
+ class: "top-projectSelectorSubmenu",
1001
+ notch: !1,
1002
+ pos: "2"
1003
+ }, {
1004
+ opener: z(() => [O(r, {
1005
+ class: "top-projectSelectorSubmenu_opener",
1006
+ "data-top-icon": "",
1007
+ color: "theme"
1008
+ })]),
1009
+ contentList: z(() => [(M(!0), T(x, null, P(o.value, (e) => (M(), T("li", pt, [E("a", {
1010
+ href: e.href,
1011
+ title: e.title,
1012
+ "data-top-icon": e.icon,
1013
+ "data-right": e.right
1014
+ }, null, 8, mt)]))), 256)), E("li", ht, [E("a", {
1015
+ href: t.url,
1016
+ "data-top-icon": "",
1017
+ target: "_blank"
1018
+ }, null, 8, gt)])]),
1019
+ _: 1
1020
+ });
1021
+ };
1022
+ }
1023
+ }), K = "ui_project_selector_total:", vt = 1440 * 60 * 1e3, q = de(), yt = N(0), J = N(null), bt = (e, t) => {
1024
+ localStorage.setItem(K + e, JSON.stringify({
1025
+ projectsTotal: t,
1026
+ expiresAt: Date.now() + vt
1027
+ }));
1028
+ }, xt = (e) => {
1029
+ let t = localStorage.getItem(K + e);
1030
+ if (!t) return;
1031
+ let { projectsTotal: n, expiresAt: r } = JSON.parse(t);
1032
+ if (Date.now() > r) {
1033
+ localStorage.removeItem(K + e);
1034
+ return;
1035
+ }
1036
+ return n;
1037
+ }, St = (e, t = !0) => {
1038
+ q.value = void 0, localStorage.removeItem(K + e), t && yt.value++;
1039
+ }, Ct = { class: "top-projectSelector_item" }, wt = { class: "top-projectSelector_itemText" }, Tt = { class: "top-comment" }, Et = {
1040
+ key: 0,
1041
+ class: "top-comment"
1042
+ }, Dt = ["href", "onClick"], Ot = 1e3, kt = /* @__PURE__ */ k({
1043
+ __name: "projectSelector",
1044
+ props: /* @__PURE__ */ A({
1045
+ modelValue: {},
1046
+ client: {},
1047
+ addLinksToProjects: {
1048
+ type: Boolean,
1049
+ default: !0
1050
+ },
1051
+ excludeProjectId: {},
1052
+ modificator: {},
1053
+ placeholder: {},
1054
+ buttonProps: {},
1055
+ openerShortcut: {}
1056
+ }, {
1057
+ modelValue: { default: {
1058
+ id: null,
1059
+ name: ""
1060
+ } },
1061
+ modelModifiers: {}
1062
+ }),
1063
+ emits: ["update:modelValue"],
1064
+ setup(t) {
1065
+ let n = e();
1066
+ if (!window.mo?.user?.id) throw Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
1067
+ let r = window.mo.user.id, i = t, a = L(t, "modelValue"), o = dt(i.client, r), s = ft(i.client), c = N(xt(r)), d = N(null), f = S(() => i.placeholder ?? n.Projects.Select_project), p = S(() => !q.value || !i.excludeProjectId ? q.value : q.value.filter((e) => e.id !== i.excludeProjectId)), m = S(() => {
1068
+ if (!(!c.value && c.value !== 0)) return c.value < Ot ? "static" : "api";
1069
+ });
1070
+ R(yt, () => {
1071
+ _();
1072
+ }), R(a, () => {
1073
+ !a.value.id || !i.addLinksToProjects || ot(st(a.value.id));
1074
+ });
1075
+ let h = async () => {
1076
+ J.value ||= dt(i.client, r, { limit: Ot }).call();
1077
+ let e = await J.value;
1078
+ if (e.errors) {
1079
+ J.value = null;
1080
+ return;
1081
+ }
1082
+ return J.value = null, e;
1083
+ }, ee = async () => {
1084
+ if (c.value) return;
1085
+ let e = await h();
1086
+ e && (c.value = e.total, m.value === "static" && !q.value && (q.value = e.result), c.value && bt(r, c.value));
1087
+ }, g = async (e) => {
1088
+ let t = await s.changeParams({
1089
+ url: e.name,
1090
+ name: e.name
1091
+ }).call();
1092
+ if (!t.errors) {
1093
+ if (q.value && m.value === "static") {
1094
+ let n = {
1095
+ id: Number(t.result),
1096
+ user_id: r,
1097
+ name: e.name,
1098
+ url: e.name,
1099
+ on: 0,
1100
+ right: "11111111111111111111",
1101
+ listItemProps: { attrs: { title: e.name } }
1102
+ }, i = q.value.findIndex((e) => e.on === 0);
1103
+ q.value = [
1104
+ ...q.value.slice(0, i),
1105
+ n,
1106
+ ...q.value.slice(i)
1107
+ ], c.value && (c.value += 1, bt(r, c.value));
1108
+ }
1109
+ m.value === "api" && St(r);
1110
+ }
1111
+ }, _ = () => {
1112
+ m.value === "api" && d.value?.resetCache(!0);
1113
+ }, v = async () => {
1114
+ if (q.value || m.value !== "static") return;
1115
+ let e = await h();
1116
+ e && (q.value = e.result);
1117
+ };
1118
+ return ae(async () => {
1119
+ await ee();
1120
+ }), (e, n) => {
1121
+ let r = ce("TopButton");
1122
+ return M(), C(y, {
1123
+ ref_key: "refSelector",
1124
+ ref: d,
1125
+ class: "top-projectSelector",
1126
+ modelValue: a.value,
1127
+ "onUpdate:modelValue": n[1] ||= (e) => a.value = e,
1128
+ items: p.value,
1129
+ title: e.$i18n.Projects.Search_projects,
1130
+ modificator: t.modificator,
1131
+ searchFields: [
1132
+ "id",
1133
+ "name",
1134
+ "url"
1135
+ ],
1136
+ placeholder: f.value,
1137
+ hasCloserBtn: "",
1138
+ api: m.value === "api" ? I(o) : void 0,
1139
+ apiSetSearchParams: m.value === "api" ? (...e) => I(ut)(...e) : void 0,
1140
+ useCache: "",
1141
+ appendSearchToResult: "",
1142
+ appendSearchAllowDuplicate: "",
1143
+ appendSearchToResultCond: I(l),
1144
+ appendWithoutSelect: "",
1145
+ buttonProps: t.buttonProps,
1146
+ openerShortcut: t.openerShortcut,
1147
+ onAppendItem: g,
1148
+ onOpen: v
1149
+ }, {
1150
+ item: z(({ item: i }) => [E("div", Ct, [E("div", wt, [i.id ? (M(), T(x, { key: 0 }, [D(F(I(u)(i.name, 20)) + " ", 1), E("span", Tt, " id " + F(i.id), 1)], 64)) : (M(), T(x, { key: 1 }, [i.listItemProps?.type ? w("", !0) : (M(), T("div", Et, F(e.$i18n.Projects.Add_project) + ": ", 1)), D(" " + F(i.name), 1)], 64))]), i.id ? (M(), T(x, { key: 0 }, [
1151
+ t.addLinksToProjects ? (M(), T("a", {
1152
+ key: 0,
1153
+ class: "top-projectSelector_itemLink",
1154
+ href: I(st)(i.id),
1155
+ onClick: B((e) => I(ot)(I(st)(i.id), e), ["prevent", "stop"])
1156
+ }, null, 8, Dt)) : w("", !0),
1157
+ e.$core.state.isMobile ? w("", !0) : (M(), C(r, {
1158
+ key: 1,
1159
+ class: "top-projectSelector_itemExtLink",
1160
+ href: I(lt)(i.url),
1161
+ "data-top-icon": "",
1162
+ color: "theme",
1163
+ target: "_blank",
1164
+ onClick: n[0] ||= B(() => {}, ["stop"])
1165
+ }, null, 8, ["href"])),
1166
+ O(_t, {
1167
+ id: i.id,
1168
+ right: i.right ?? void 0,
1169
+ url: I(lt)(i.url)
1170
+ }, null, 8, [
1171
+ "id",
1172
+ "right",
1173
+ "url"
1174
+ ])
1175
+ ], 64)) : w("", !0)])]),
1176
+ _: 1
1177
+ }, 8, [
1178
+ "modelValue",
1179
+ "items",
1180
+ "title",
1181
+ "modificator",
1182
+ "placeholder",
1183
+ "api",
1184
+ "apiSetSearchParams",
1185
+ "appendSearchToResultCond",
1186
+ "buttonProps",
1187
+ "openerShortcut"
1188
+ ]);
1189
+ };
1190
+ }
1191
+ }), At = (e) => "-" + e, Y = (e) => e[0] === "-" ? e.substring(1) : e, X = (e, t) => {
1192
+ e = Y(e);
1193
+ let n = t.find((t) => t.id === e);
1194
+ if (n) return n;
1195
+ }, jt = (e, t, n) => {
1196
+ t ||= { id: e.id }, t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
1197
+ let r = c.genElPopupOpener("div", t);
1198
+ 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) => {
1199
+ t.preventDefault(), t.stopPropagation(), r.onclick = null;
1200
+ let i = N(e.modelValue);
1201
+ s(r, "topTagSelectorTarget", {
1202
+ model: i,
1203
+ mode: e.mode,
1204
+ targetId: e.targetId,
1205
+ filters: e.filters,
1206
+ payload: e.payload
1207
+ }), delete r.dataset.topPopupDisabled, ne(e.modelValue) || R(i, () => {
1208
+ e.modelValue = i.value, Z(r, e, n);
1209
+ }), r.click();
1210
+ }, ne(e.modelValue) ? R(e.modelValue, () => Z(r, e, n)) : s(r, "topTagSelectorRender", (t) => {
1211
+ e.modelValue = t;
1212
+ let i = s(r, "topTagSelectorTarget");
1213
+ i && (i.model.value = t), Z(r, e, n);
1214
+ }), Z(r, e, n), r;
1215
+ }, Mt = (e, t) => {
1216
+ s(e, "topTagSelectorRender")?.(t);
1217
+ }, Z = (t, n, r) => {
1218
+ let i = I(n.modelValue);
1219
+ 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) {
1220
+ t.innerHTML = `<div>${r}</div>`;
1221
+ return;
1222
+ }
1223
+ if (t.innerHTML = "", !i.length && n.mode === "filter") {
1224
+ let n = Nt({
1225
+ id: "all",
1226
+ colorId: "",
1227
+ name: e().Common?.All_tags ?? "",
1228
+ state: ""
1229
+ });
1230
+ t.append(n);
1231
+ }
1232
+ i.forEach((e) => {
1233
+ let r = Nt({
1234
+ id: Y(e),
1235
+ colorId: X(e, n.tags)?.color_id ?? "",
1236
+ name: X(e, n.tags)?.name ?? "",
1237
+ state: Y(e) === e ? "selected" : "excluded"
1238
+ });
1239
+ t.append(r);
1240
+ });
1241
+ }, Nt = (e) => {
1242
+ let t = document.createElement("div");
1243
+ 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;
1244
+ }, Pt = [
1245
+ {
1246
+ id: "1",
1247
+ name: "Without Tag",
1248
+ color_id: "1"
1249
+ },
1250
+ {
1251
+ id: "2",
1252
+ name: "Red",
1253
+ color_id: "2"
1254
+ },
1255
+ {
1256
+ id: "3",
1257
+ name: "Orange",
1258
+ color_id: "3"
1259
+ },
1260
+ {
1261
+ id: "4",
1262
+ name: "Yellow",
1263
+ color_id: "4"
1264
+ },
1265
+ {
1266
+ id: "5",
1267
+ name: "Blue",
1268
+ color_id: "5"
1269
+ },
1270
+ {
1271
+ id: "6",
1272
+ name: "Purple",
1273
+ color_id: "6"
1274
+ },
1275
+ {
1276
+ id: "7",
1277
+ name: "Green",
1278
+ color_id: "7"
1279
+ },
1280
+ {
1281
+ id: "8",
1282
+ name: "Magenta",
1283
+ color_id: "8"
1284
+ },
1285
+ {
1286
+ id: "9",
1287
+ name: "Dark blue",
1288
+ color_id: "9"
1289
+ },
1290
+ {
1291
+ id: "10",
1292
+ name: "Turquoise",
1293
+ color_id: "10"
1294
+ }
1295
+ ], Ft = [
1296
+ "data-tag_id",
1297
+ "data-tag_color_id",
1298
+ "title"
1299
+ ], Q = /* @__PURE__ */ k({
1300
+ __name: "tagIcon",
1301
+ props: {
1302
+ id: {},
1303
+ colorId: {},
1304
+ name: {},
1305
+ state: {}
1306
+ },
1307
+ setup(e) {
1308
+ return (t, n) => (M(), T("div", {
1309
+ class: j({
1310
+ "top-tagSelector_tagIcon": !0,
1311
+ "top-tagSelector-active": !!e.state,
1312
+ "top-tagSelector-excluded": e.state === "excluded"
1313
+ }),
1314
+ "data-tag_id": e.id,
1315
+ "data-tag_color_id": e.colorId,
1316
+ title: e.name
1317
+ }, null, 10, Ft));
1318
+ }
1319
+ }), It = ["contenteditable", "onKeydown"], Lt = /* @__PURE__ */ k({
1320
+ __name: "tagPopupListItem",
1321
+ props: /* @__PURE__ */ A({
1322
+ editable: { type: Boolean },
1323
+ disabled: { type: Boolean },
1324
+ canExclude: { type: Boolean },
1325
+ id: {},
1326
+ colorId: {},
1327
+ name: {},
1328
+ state: {}
1329
+ }, {
1330
+ name: { required: !0 },
1331
+ nameModifiers: {}
1332
+ }),
1333
+ emits: /* @__PURE__ */ A([
1334
+ "update:name",
1335
+ "unselect",
1336
+ "exclude",
1337
+ "select"
1338
+ ], ["update:name"]),
1339
+ setup(e, { emit: t }) {
1340
+ let n = e, r = t, i = L(e, "name"), a = N(null), o = S(() => navigator.userAgent.indexOf("Firefox") == -1 ? {} : {
1341
+ contenteditable: s.value,
1342
+ onpaste: (e) => e.preventDefault()
1343
+ }), s = N(!1), c = async () => {
1344
+ s.value = !0, await ie(), a.value?.focus();
1345
+ }, l = () => {
1346
+ let e = a.value?.innerText;
1347
+ if (!e) return u();
1348
+ a.value && (a.value.innerText = e), s.value = !1, r("update:name", e);
1349
+ }, u = async () => {
1350
+ a.value && (a.value.innerText = n.name), s.value = !1;
1351
+ }, d = (e) => {
1352
+ if (s.value || n.disabled) return;
1353
+ let t = "selected";
1354
+ n.canExclude && (e.ctrlKey || e.metaKey) && (t = "excluded"), n.state == t && (t = ""), t === "" && r("unselect"), t === "selected" && r("select"), t === "excluded" && r("exclude");
1355
+ };
1356
+ return (t, n) => (M(), C(g, {
1357
+ class: j({
1358
+ "top-tagSelector_tagListItem": !0,
1359
+ "top-tagSelector_tagListItem-inEdit": s.value,
1360
+ "top-tagSelector_tagListItem-disabled": e.disabled,
1361
+ "top-tagSelector_tagListItem-canExclude": e.canExclude,
1362
+ "top-tagSelector-active": !!e.state,
1363
+ "top-tagSelector-excluded": e.state === "excluded"
1364
+ }),
1365
+ onClick: B(d, ["stop"])
1366
+ }, {
1367
+ default: z(() => [
1368
+ O(Q, {
1369
+ id: e.id,
1370
+ name: i.value,
1371
+ colorId: e.colorId,
1372
+ state: e.state
1373
+ }, null, 8, [
1374
+ "id",
1375
+ "name",
1376
+ "colorId",
1377
+ "state"
1378
+ ]),
1379
+ E("span", re({
1380
+ ref_key: "elName",
1381
+ ref: a,
1382
+ class: "top-tagSelector_tagListItemName",
1383
+ contenteditable: s.value ? "plaintext-only" : !1
1384
+ }, o.value, { onKeydown: [me(B(l, ["stop"]), ["enter"]), me(B(u, ["stop"]), ["esc"])] }), F(i.value), 17, It),
1385
+ e.editable ? (M(), T(x, { key: 0 }, [s.value ? (M(), T("span", {
1386
+ key: 1,
1387
+ "data-top-icon": "",
1388
+ class: "top-tagSelector_edit",
1389
+ onClick: B(l, ["stop"])
1390
+ })) : (M(), T("span", {
1391
+ key: 0,
1392
+ "data-top-icon": "",
1393
+ class: "top-tagSelector_edit",
1394
+ onClick: c
1395
+ }))], 64)) : w("", !0)
1396
+ ]),
1397
+ _: 1
1398
+ }, 8, ["class"]));
1399
+ }
1400
+ }), Rt = { key: 1 }, zt = /* @__PURE__ */ k({
1401
+ inheritAttrs: !1,
1402
+ __name: "popupOpener",
1403
+ props: /* @__PURE__ */ A({
1404
+ modelValue: {},
1405
+ id: {},
1406
+ tags: {},
1407
+ mode: {},
1408
+ targetId: {},
1409
+ filters: {},
1410
+ useTopButton: { type: Boolean },
1411
+ payload: {},
1412
+ styling: {}
1413
+ }, {
1414
+ modelValue: { required: !0 },
1415
+ modelModifiers: {}
1416
+ }),
1417
+ emits: ["update:modelValue"],
1418
+ setup(e) {
1419
+ let t = e, n = L(e, "modelValue"), i = t.useTopButton ? r : "div", a = t.useTopButton ? "html" : "default", o = {
1420
+ model: n,
1421
+ mode: t.mode,
1422
+ targetId: t.targetId,
1423
+ filters: t.filters,
1424
+ payload: t.payload
1425
+ };
1426
+ return (r, s) => {
1427
+ let c = le("top-data");
1428
+ return M(), C(ee, { id: e.id }, {
1429
+ default: z(() => [pe((M(), C(ue(I(i)), re({
1430
+ class: {
1431
+ "top-tagSelector": !0,
1432
+ "top-tagSelector-useTopButton": t.useTopButton,
1433
+ "top-tagSelector-custom": !t.useTopButton,
1434
+ "top-as-selector": t.useTopButton,
1435
+ "top-tagSelector-filter": t.mode === "filter",
1436
+ "top-tagSelector-setter_single": t.mode === "setter" && !e.filters,
1437
+ "top-tagSelector-setter_several": t.mode === "setter" && e.filters,
1438
+ "top-tagSelector-selectedOne": !n.value.length || n.value.length === 1,
1439
+ "top-tagSelector-toTwoLine": n.value.length > 5
1440
+ },
1441
+ color: "theme",
1442
+ styling: e.styling
1443
+ }, r.$attrs), {
1444
+ [I(a)]: z(() => [!n.value.length && e.mode === "filter" ? (M(), C(Q, {
1445
+ key: 0,
1446
+ id: "all",
1447
+ colorId: "",
1448
+ name: r.$i18n.Common.All_tags ?? "",
1449
+ state: ""
1450
+ }, null, 8, ["name"])) : w("", !0), e.mode === "setter" && e.filters ? (M(), T("div", Rt, [se(r.$slots, "default")])) : (M(!0), T(x, { key: 2 }, P(n.value, (t) => (M(), C(Q, {
1451
+ id: I(Y)(t),
1452
+ colorId: I(X)(t, e.tags)?.color_id ?? "",
1453
+ name: I(X)(t, e.tags)?.name ?? "",
1454
+ state: I(Y)(t) === t ? "selected" : "excluded"
1455
+ }, null, 8, [
1456
+ "id",
1457
+ "colorId",
1458
+ "name",
1459
+ "state"
1460
+ ]))), 256))]),
1461
+ _: 2
1462
+ }, 1040, ["class", "styling"])), [[
1463
+ c,
1464
+ o,
1465
+ "topTagSelectorTarget"
1466
+ ]])]),
1467
+ _: 3
1468
+ }, 8, ["id"]);
1469
+ };
1470
+ }
1471
+ }), Bt = /* @__PURE__ */ k({
1472
+ __name: "tagSelector",
1473
+ props: /* @__PURE__ */ A({
1474
+ modelValue: {},
1475
+ tags: {},
1476
+ tagsEditable: { type: Boolean },
1477
+ tagsMax: { default: 10 },
1478
+ id: {},
1479
+ singleMode: { type: Boolean },
1480
+ requiredForSetter: {
1481
+ type: Boolean,
1482
+ default: !0
1483
+ },
1484
+ maxTagsForSetter: {},
1485
+ emitDelay: { default: 500 },
1486
+ useTopButton: {
1487
+ type: Boolean,
1488
+ default: !0
1489
+ },
1490
+ styling: {}
1491
+ }, {
1492
+ modelValue: { required: !0 },
1493
+ modelModifiers: {},
1494
+ tags: { default: oe(Pt) },
1495
+ tagsModifiers: {}
1496
+ }),
1497
+ emits: /* @__PURE__ */ A([
1498
+ "selector",
1499
+ "setter",
1500
+ "tagsChanged"
1501
+ ], ["update:modelValue", "update:tags"]),
1502
+ setup(a, { emit: o }) {
1503
+ let c = e(), l = a, u = L(a, "modelValue"), d = L(a, "tags"), f = o, p = n((e, t) => {
1504
+ f(e, t);
1505
+ }, l.emitDelay);
1506
+ l.singleMode && !u.value.length && (u.value = [d.value[0].id]);
1507
+ let m = l.id ?? "top-popup-id-" + Math.random(), h = N("add"), ee = () => {
1508
+ let e = " " + c.Common.Tags?.toLowerCase(), t = /* @__PURE__ */ new Map();
1509
+ return t.set("add", {
1510
+ value: "add",
1511
+ title: c.Common.Add + e
1512
+ }), t.set("replace", {
1513
+ value: "replace",
1514
+ title: c.Common.Replace + e
1515
+ }), t.set("delete", {
1516
+ value: "delete",
1517
+ title: c.Common.Delete + e
1518
+ }), t;
1519
+ }, v = de({
1520
+ model: u,
1521
+ mode: "filter",
1522
+ targetId: void 0,
1523
+ filters: void 0,
1524
+ payload: void 0
1525
+ });
1526
+ R(u, () => {
1527
+ p("selector", u.value);
1528
+ });
1529
+ let y = S(() => {
1530
+ if (v.value.mode === "setter" && l.maxTagsForSetter && !v.value.filters) return v.value.model.value.length >= l.maxTagsForSetter;
1531
+ }), b = (e) => {
1532
+ if (e !== "all") {
1533
+ if (v.value.model.value.includes(e)) return "selected";
1534
+ if (v.value.model.value.includes(At(e))) return "excluded";
1535
+ }
1536
+ return e === "all" && !v.value.model.value.length ? "selected" : "";
1537
+ }, E = (e, t) => {
1538
+ let n = At(e), r = v.value.model.value.filter((t) => t !== e && t !== n);
1539
+ 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", {
1540
+ tagsIds: r,
1541
+ targetId: v.value.targetId,
1542
+ payload: v.value.payload
1543
+ });
1544
+ }, k = S(() => {
1545
+ let e = "top-tagSelector_popup";
1546
+ return v.value.mode === "filter" && (e += " top-tagSelector_popup-filter"), v.value.mode === "setter" && (e += " top-tagSelector_popup-setter"), e;
1547
+ }), ne = () => {
1548
+ let e = prompt("", "New tag");
1549
+ if (!e || e === "New tag") return;
1550
+ let t = d.value.length + 1;
1551
+ d.value.push({
1552
+ id: String(t),
1553
+ name: e,
1554
+ color_id: String((t - 1) % 10 + 1)
1555
+ }), f("tagsChanged", d.value);
1556
+ }, A = (e) => {
1557
+ if (v.value = s(e.elPopupOpener, "topTagSelectorTarget"), !v.value) throw Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1558
+ if (v.value.filters && (h.value = "add", v.value.model.value = []), !t.$?.ui.sortable) {
1559
+ console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
1560
+ return;
1561
+ }
1562
+ !t.state.isMobile && !t.state.isMobileUA && d.value && $(e.elPopup).sortable({
1563
+ items: "li:has([data-tag_id]:not([data-tag_id=\"all\"]))",
1564
+ cancel: "[contenteditable=\"plaintext-only\"], [contenteditable=\"true\"]",
1565
+ distance: 10,
1566
+ stop: function(e, t) {
1567
+ if (!d.value) return;
1568
+ let n = $(t.item).parent().find("[data-tag_id]"), r = [];
1569
+ n.each((e, t) => {
1570
+ if (!d.value) return;
1571
+ let n = $(t).attr("data-tag_id");
1572
+ r.push(n);
1573
+ }), d.value.sort((e, t) => r.findIndex((t) => t === e.id) - r.findIndex((e) => e === t.id)), p("tagsChanged", d.value);
1574
+ }
1575
+ });
1576
+ }, re = (e) => {
1577
+ t.$?.ui.sortable && $(e.elPopup).data("ui-sortable") && $(e.elPopup).sortable("destroy");
1578
+ };
1579
+ return (e, t) => (M(), T(x, null, [O(zt, {
1580
+ modelValue: u.value,
1581
+ "onUpdate:modelValue": t[0] ||= (e) => u.value = e,
1582
+ id: I(m),
1583
+ tags: d.value,
1584
+ styling: a.styling,
1585
+ mode: "filter",
1586
+ useTopButton: a.useTopButton
1587
+ }, null, 8, [
1588
+ "modelValue",
1589
+ "id",
1590
+ "tags",
1591
+ "styling",
1592
+ "useTopButton"
1593
+ ]), O(_, {
1594
+ id: I(m),
1595
+ class: j(k.value),
1596
+ onOpen: t[4] ||= (e) => A(e),
1597
+ onClose: t[5] ||= (e) => re(e),
1598
+ "transition-duration": 50
1599
+ }, te({
1600
+ contentList: z(() => [
1601
+ I(v).mode === "filter" && !a.singleMode ? (M(), C(Lt, {
1602
+ key: 0,
1603
+ id: "all",
1604
+ colorId: "",
1605
+ name: e.$i18n.Common.All_tags ?? "",
1606
+ state: I(v).model.value.length ? "" : "selected",
1607
+ onSelect: t[3] ||= (e) => I(v).model.value = []
1608
+ }, null, 8, ["name", "state"])) : w("", !0),
1609
+ (M(!0), T(x, null, P(d.value, (e) => (M(), C(Lt, {
1610
+ key: e.id,
1611
+ id: e.id,
1612
+ colorId: e.color_id,
1613
+ name: e.name,
1614
+ state: b(e.id),
1615
+ canExclude: I(v).mode === "filter" && !a.singleMode,
1616
+ editable: a.tagsEditable,
1617
+ disabled: y.value && b(e.id) === "",
1618
+ onUnselect: (t) => E(e.id, "unselect"),
1619
+ onSelect: (t) => E(e.id, "select"),
1620
+ onExclude: (t) => E(e.id, "exclude"),
1621
+ "onUpdate:name": (t) => {
1622
+ e.name = t, I(p)("tagsChanged", d.value);
1623
+ }
1624
+ }, null, 8, [
1625
+ "id",
1626
+ "colorId",
1627
+ "name",
1628
+ "state",
1629
+ "canExclude",
1630
+ "editable",
1631
+ "disabled",
1632
+ "onUnselect",
1633
+ "onSelect",
1634
+ "onExclude",
1635
+ "onUpdate:name"
1636
+ ]))), 128)),
1637
+ a.tagsEditable && d.value.length < a.tagsMax && d.value.length < 20 ? (M(), C(g, {
1638
+ key: 1,
1639
+ "data-top-icon": "",
1640
+ onClick: B(ne, ["stop"])
1641
+ }, {
1642
+ default: z(() => [D(F(e.$i18n.Common.Add), 1)]),
1643
+ _: 1
1644
+ })) : w("", !0)
1645
+ ]),
1646
+ _: 2
1647
+ }, [I(v).mode === "setter" && I(v).filters ? {
1648
+ name: "header",
1649
+ fn: z(() => [O(i, {
1650
+ modelValue: h.value,
1651
+ "onUpdate:modelValue": t[1] ||= (e) => h.value = e,
1652
+ options: ee()
1653
+ }, null, 8, ["modelValue", "options"])]),
1654
+ key: "0"
1655
+ } : void 0, I(v).mode === "setter" && I(v).filters ? {
1656
+ name: "footer",
1657
+ fn: z(() => [O(r, { color: "theme" }, {
1658
+ default: z(() => [D(F(e.$i18n.Common.Cancel), 1)]),
1659
+ _: 1
1660
+ }), O(r, { onClick: t[2] ||= (e) => I(p)("setter", {
1661
+ tagsIds: I(v).model.value,
1662
+ filters: I(v).filters,
1663
+ filtersAction: h.value,
1664
+ payload: I(v).payload
1665
+ }) }, {
1666
+ 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)]),
1667
+ _: 1
1668
+ })]),
1669
+ key: "1"
1670
+ } : void 0]), 1032, ["id", "class"])], 64));
1671
+ }
1636
1672
  });
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
1673
+ //#endregion
1674
+ export { _e as TopCompetitorSelector, $e as TopGroupSelector, kt as TopProjectSelector, Ie as TopRegionSelector, Bt as TopTagSelector, zt as TopTagSelectorPopupOpener, Q as TopTagSelectorTagIcon, St as clearCache, je as dialogRegionSelector, Ae as findRegion, jt as genElTopTagSelectorPopupOpener, De as genSearcherByKey, Mt as renderElTopTagSelectorPopupOpener, ve as useItemsFromCompetitors };
1675
+
1676
+ //# sourceMappingURL=project.js.map