@topvisor/ui 1.3.5-popupFromInput.0 → 1.4.0-TopGroupSelector.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/.chunks/core-B9TwJi3h.amd.js +2 -0
  2. package/.chunks/core-B9TwJi3h.amd.js.map +1 -0
  3. package/.chunks/core-DVQVVUiP.es.js +196 -0
  4. package/.chunks/core-DVQVVUiP.es.js.map +1 -0
  5. package/.chunks/{datepicker-CGGp0VnN.es.js → datepicker-CrASsJeF.es.js} +14 -17
  6. package/.chunks/{datepicker-CGGp0VnN.es.js.map → datepicker-CrASsJeF.es.js.map} +1 -1
  7. package/.chunks/{datepicker-Bq_z2paN.amd.js → datepicker-bidhcksv.amd.js} +2 -2
  8. package/.chunks/{datepicker-Bq_z2paN.amd.js.map → datepicker-bidhcksv.amd.js.map} +1 -1
  9. package/.chunks/dialog_regionSelectorRegions-DJu5Y1WK.es.js +180 -0
  10. package/.chunks/dialog_regionSelectorRegions-DJu5Y1WK.es.js.map +1 -0
  11. package/.chunks/dialog_regionSelectorRegions-Dc-YGZ0l.amd.js +2 -0
  12. package/.chunks/dialog_regionSelectorRegions-Dc-YGZ0l.amd.js.map +1 -0
  13. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang--Xstly2G.amd.js +2 -0
  14. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-Bf0wXalT.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang--Xstly2G.amd.js.map} +1 -1
  15. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DCVIoEeY.es.js → dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js} +111 -112
  16. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DCVIoEeY.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js.map} +1 -1
  17. package/.chunks/forms--2-YQeWM.amd.js +3 -0
  18. package/.chunks/{forms-CNcrvkYD.amd.js.map → forms--2-YQeWM.amd.js.map} +1 -1
  19. package/.chunks/forms-Cwv0JCi5.es.js +2035 -0
  20. package/.chunks/{forms-BhbgRJ5I.es.js.map → forms-Cwv0JCi5.es.js.map} +1 -1
  21. package/.chunks/index-DLUtoTUg.amd.js +2 -0
  22. package/.chunks/index-DLUtoTUg.amd.js.map +1 -0
  23. package/.chunks/index-DkQWJkMc.es.js +54 -0
  24. package/.chunks/index-DkQWJkMc.es.js.map +1 -0
  25. package/.chunks/notice-BCHrf2v6.es.js +191 -0
  26. package/.chunks/{notice-CpPhDTUb.es.js.map → notice-BCHrf2v6.es.js.map} +1 -1
  27. package/.chunks/notice-D1KO_E3H.amd.js +4 -0
  28. package/.chunks/{notice-BpLsm6Zh.amd.js.map → notice-D1KO_E3H.amd.js.map} +1 -1
  29. package/.chunks/page.vue_vue_type_script_setup_true_lang-DNs0udwC.amd.js +2 -0
  30. package/.chunks/{page.vue_vue_type_script_setup_true_lang-B-1LEQAz.amd.js.map → page.vue_vue_type_script_setup_true_lang-DNs0udwC.amd.js.map} +1 -1
  31. package/.chunks/page.vue_vue_type_script_setup_true_lang-D_ocBGzt.es.js +139 -0
  32. package/.chunks/{page.vue_vue_type_script_setup_true_lang-9abPBMpd.es.js.map → page.vue_vue_type_script_setup_true_lang-D_ocBGzt.es.js.map} +1 -1
  33. package/.chunks/policy.vue_vue_type_style_index_0_lang-B61ZEDWr.es.js +494 -0
  34. package/.chunks/policy.vue_vue_type_style_index_0_lang-B61ZEDWr.es.js.map +1 -0
  35. package/.chunks/policy.vue_vue_type_style_index_0_lang-BUIBGweg.amd.js +2 -0
  36. package/.chunks/policy.vue_vue_type_style_index_0_lang-BUIBGweg.amd.js.map +1 -0
  37. package/.chunks/popup-DJMBWRtl.es.js +468 -0
  38. package/.chunks/popup-DJMBWRtl.es.js.map +1 -0
  39. package/.chunks/popup-c8qgGOCv.amd.js +2 -0
  40. package/.chunks/popup-c8qgGOCv.amd.js.map +1 -0
  41. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js +209 -0
  42. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js.map +1 -0
  43. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-D42xEF-j.amd.js +2 -0
  44. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-D42xEF-j.amd.js.map +1 -0
  45. package/.chunks/{utils-D58EUoHa.es.js → utils-Bu-TI6uw.es.js} +192 -208
  46. package/.chunks/{utils-D58EUoHa.es.js.map → utils-Bu-TI6uw.es.js.map} +1 -1
  47. package/.chunks/utils-C6nWu0aQ.amd.js +2 -0
  48. package/.chunks/{utils-5uxIj2CI.amd.js.map → utils-C6nWu0aQ.amd.js.map} +1 -1
  49. package/.chunks/utils-DHyy_M2n.amd.js +2 -0
  50. package/.chunks/{utils-Bg_su8b-.amd.js.map → utils-DHyy_M2n.amd.js.map} +1 -1
  51. package/.chunks/{utils-UBgfsQ8v.es.js → utils-cls72V1c.es.js} +23 -24
  52. package/.chunks/{utils-UBgfsQ8v.es.js.map → utils-cls72V1c.es.js.map} +1 -1
  53. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-D6SVtg2Q.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-B3soLr2U.amd.js} +2 -2
  54. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-D6SVtg2Q.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-B3soLr2U.amd.js.map} +1 -1
  55. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-CSD2uMSW.es.js → widgetInput.vue_vue_type_script_setup_true_lang-HbtV9agA.es.js} +2 -2
  56. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-CSD2uMSW.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-HbtV9agA.es.js.map} +1 -1
  57. package/api/index.amd.js +1 -1
  58. package/api/index.amd.js.map +1 -1
  59. package/api/index.js +137 -134
  60. package/api/index.js.map +1 -1
  61. package/assets/dialog_regionSelectorRegions.css +1 -0
  62. package/assets/forms.css +1 -1
  63. package/assets/policy.css +1 -0
  64. package/assets/popupHint.css +1 -1
  65. package/assets/project.css +1 -1
  66. package/charts/charts.amd.js +1 -1
  67. package/charts/charts.amd.js.map +1 -1
  68. package/charts/charts.js +80 -80
  69. package/charts/charts.js.map +1 -1
  70. package/core/app.amd.js +1 -1
  71. package/core/app.amd.js.map +1 -1
  72. package/core/app.js +93 -96
  73. package/core/app.js.map +1 -1
  74. package/dialog/dialog.amd.js +1 -1
  75. package/dialog/dialog.amd.js.map +1 -1
  76. package/dialog/dialog.js +13 -13
  77. package/dialog/dialog.js.map +1 -1
  78. package/extra/extra.amd.js +1 -1
  79. package/extra/extra.amd.js.map +1 -1
  80. package/extra/extra.js +20 -23
  81. package/extra/extra.js.map +1 -1
  82. package/forms/forms.amd.js +1 -1
  83. package/forms/forms.js +5 -5
  84. package/formsExt/formsExt.amd.js +1 -1
  85. package/formsExt/formsExt.amd.js.map +1 -1
  86. package/formsExt/formsExt.js +185 -534
  87. package/formsExt/formsExt.js.map +1 -1
  88. package/layout/layout.amd.js +1 -1
  89. package/layout/layout.js +6 -6
  90. package/package.json +2 -2
  91. package/popup/popup.amd.js +1 -1
  92. package/popup/popup.amd.js.map +1 -1
  93. package/popup/popup.js +43 -46
  94. package/popup/popup.js.map +1 -1
  95. package/popup/worker.amd.js +1 -1
  96. package/popup/worker.amd.js.map +1 -1
  97. package/popup/worker.js +9 -9
  98. package/popup/worker.js.map +1 -1
  99. package/project/project.amd.js +1 -1
  100. package/project/project.amd.js.map +1 -1
  101. package/project/project.js +869 -607
  102. package/project/project.js.map +1 -1
  103. package/src/api/api/client/client.d.ts +5 -0
  104. package/src/api/api/mocker/index.d.ts +3 -3
  105. package/src/api/api/types/client/request.d.ts +6 -0
  106. package/src/api/api/types/ext.d.ts +2 -2
  107. package/src/api/api/types/mocker.d.ts +2 -2
  108. package/src/components/forms/button/types.d.ts +6 -0
  109. package/src/components/formsExt/formsExt.d.ts +1 -0
  110. package/src/components/formsExt/libs/optionGroup/types.d.ts +1 -1
  111. package/src/components/formsExt/selector2/cache.d.ts +12 -0
  112. package/src/components/formsExt/selector2/composables/useAPI.d.ts +2036 -2
  113. package/src/components/formsExt/selector2/composables/useMenu.d.ts +2045 -5
  114. package/src/components/formsExt/selector2/itemMulti.vue.d.ts +3 -3
  115. package/src/components/formsExt/selector2/selector2.vue.d.ts +11 -3
  116. package/src/components/formsExt/selector2/types.d.ts +39 -5
  117. package/src/components/formsExt/selector2/utils.d.ts +17 -0
  118. package/src/components/popup/lib/popup.d.ts +0 -1
  119. package/src/components/popup/popup/opener/types.d.ts +6 -2
  120. package/src/components/popup/popup/types.d.ts +3 -2
  121. package/src/components/popup/popup.d.ts +1 -1
  122. package/src/components/project/groupSelector/folders/folders.vue.d.ts +18 -0
  123. package/src/components/project/groupSelector/folders/types.d.ts +63 -0
  124. package/src/components/project/groupSelector/folders/utils.d.ts +63 -0
  125. package/src/components/project/groupSelector/groupSelector.vue.d.ts +28 -0
  126. package/src/components/project/groupSelector/groups/groups.vue.d.ts +125 -0
  127. package/src/components/project/groupSelector/groups/types.d.ts +57 -0
  128. package/src/components/project/groupSelector/groups/utils.d.ts +92 -0
  129. package/src/components/project/groupSelector/stories/mocks/folders.d.ts +4 -0
  130. package/src/components/project/groupSelector/stories/mocks/groups.d.ts +2 -0
  131. package/src/components/project/groupSelector/stories/mocks/index.d.ts +7 -0
  132. package/src/components/project/groupSelector/types.d.ts +129 -0
  133. package/src/components/project/project.d.ts +15 -4
  134. package/src/components/project/{selectorRegion → regionSelector}/utils/utils.d.ts +3 -3
  135. package/src/core/utils/composables/useWatch.d.ts +32 -0
  136. package/tabs/tabs.amd.js +1 -1
  137. package/tabs/tabs.amd.js.map +1 -1
  138. package/tabs/tabs.js +24 -24
  139. package/tabs/tabs.js.map +1 -1
  140. package/tabsView/tabsView.amd.js +1 -1
  141. package/tabsView/tabsView.amd.js.map +1 -1
  142. package/tabsView/tabsView.js +131 -133
  143. package/tabsView/tabsView.js.map +1 -1
  144. package/utils/clipboard.amd.js +1 -1
  145. package/utils/clipboard.js +1 -1
  146. package/utils/date.amd.js +1 -1
  147. package/utils/date.js +1 -1
  148. package/utils/device.amd.js +1 -1
  149. package/utils/device.js +1 -1
  150. package/utils/lodash.amd.js +1 -1
  151. package/utils/lodash.js +1 -1
  152. package/utils/price.amd.js +1 -1
  153. package/utils/price.js +1 -1
  154. package/utils/scroll.amd.js +1 -1
  155. package/utils/scroll.amd.js.map +1 -1
  156. package/utils/scroll.js +14 -14
  157. package/utils/scroll.js.map +1 -1
  158. package/utils/searchers.amd.js +1 -1
  159. package/utils/searchers.js +3 -3
  160. package/utils/string.amd.js +1 -1
  161. package/utils/string.amd.js.map +1 -1
  162. package/utils/string.js +3 -7
  163. package/utils/string.js.map +1 -1
  164. package/.chunks/core-DcLw0dEO.amd.js +0 -2
  165. package/.chunks/core-DcLw0dEO.amd.js.map +0 -1
  166. package/.chunks/core-DpTLGhiK.es.js +0 -197
  167. package/.chunks/core-DpTLGhiK.es.js.map +0 -1
  168. package/.chunks/dialog_selectorRegions-BtAADQHf.es.js +0 -190
  169. package/.chunks/dialog_selectorRegions-BtAADQHf.es.js.map +0 -1
  170. package/.chunks/dialog_selectorRegions-DCrHvHDs.amd.js +0 -2
  171. package/.chunks/dialog_selectorRegions-DCrHvHDs.amd.js.map +0 -1
  172. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-Bf0wXalT.amd.js +0 -2
  173. package/.chunks/forms-BhbgRJ5I.es.js +0 -2045
  174. package/.chunks/forms-CNcrvkYD.amd.js +0 -3
  175. package/.chunks/index-BEI7XZmU.amd.js +0 -2
  176. package/.chunks/index-BEI7XZmU.amd.js.map +0 -1
  177. package/.chunks/index-igPkes8X.es.js +0 -48
  178. package/.chunks/index-igPkes8X.es.js.map +0 -1
  179. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-QvP1d9jN.amd.js +0 -2
  180. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-QvP1d9jN.amd.js.map +0 -1
  181. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-xvzbyqai.es.js +0 -196
  182. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-xvzbyqai.es.js.map +0 -1
  183. package/.chunks/menu.vue_vue_type_style_index_0_lang-C3Rr6ZyL.amd.js +0 -2
  184. package/.chunks/menu.vue_vue_type_style_index_0_lang-C3Rr6ZyL.amd.js.map +0 -1
  185. package/.chunks/menu.vue_vue_type_style_index_0_lang-dOeZ7an1.es.js +0 -112
  186. package/.chunks/menu.vue_vue_type_style_index_0_lang-dOeZ7an1.es.js.map +0 -1
  187. package/.chunks/notice-BpLsm6Zh.amd.js +0 -4
  188. package/.chunks/notice-CpPhDTUb.es.js +0 -194
  189. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js +0 -36
  190. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js.map +0 -1
  191. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js +0 -2
  192. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js.map +0 -1
  193. package/.chunks/page.vue_vue_type_script_setup_true_lang-9abPBMpd.es.js +0 -143
  194. package/.chunks/page.vue_vue_type_script_setup_true_lang-B-1LEQAz.amd.js +0 -2
  195. package/.chunks/popup-BJj9BJP5.es.js +0 -485
  196. package/.chunks/popup-BJj9BJP5.es.js.map +0 -1
  197. package/.chunks/popup-CfXISjhC.amd.js +0 -2
  198. package/.chunks/popup-CfXISjhC.amd.js.map +0 -1
  199. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js +0 -2
  200. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js.map +0 -1
  201. package/.chunks/utils-5uxIj2CI.amd.js +0 -2
  202. package/.chunks/utils-Bg_su8b-.amd.js +0 -2
  203. package/assets/dialog_selectorRegions.css +0 -1
  204. package/assets/formsExt.css +0 -1
  205. package/assets/listItem.css +0 -1
  206. package/assets/menu.css +0 -1
  207. package/src/components/popup/popup/opener.vue.d.ts +0 -16
  208. /package/src/components/project/{selectorCompetitors/selectorCompetitors.vue.d.ts → competitorSelector/competitorSelector.vue.d.ts} +0 -0
  209. /package/src/components/project/{selectorCompetitors → competitorSelector}/composables.d.ts +0 -0
  210. /package/src/components/project/{selectorCompetitors → competitorSelector}/types.d.ts +0 -0
  211. /package/src/components/project/{selectorRegion → regionSelector}/composables/compare.d.ts +0 -0
  212. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectRegion.d.ts +0 -0
  213. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectSearcher.d.ts +0 -0
  214. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectorRegion.d.ts +0 -0
  215. /package/src/components/project/{selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue.d.ts → regionSelector/dialog_regionSelectorRegions/dialog_regionSelectorRegions.vue.d.ts} +0 -0
  216. /package/src/components/project/{selectorRegion/dialog_selectorRegions → regionSelector/dialog_regionSelectorRegions}/types.d.ts +0 -0
  217. /package/src/components/project/{selectorRegion/selectorRegion.vue.d.ts → regionSelector/regionSelector.vue.d.ts} +0 -0
  218. /package/src/components/project/{selectorRegion → regionSelector}/types.d.ts +0 -0
  219. /package/src/components/project/{selectorRegion → regionSelector}/utils/consts.d.ts +0 -0
@@ -3,18 +3,20 @@
3
3
  const fileNames = ['../assets/project.css'].map(fileName => import.meta.resolve(fileName));
4
4
  _autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
5
5
 
6
- import { defineComponent as U, mergeModels as N, useModel as D, computed as E, createElementBlock as b, openBlock as k, createBlock as _, unref as y, withCtx as B, Fragment as Y, renderList as se, normalizeClass as X, createElementVNode as he, toDisplayString as K, createVNode as A, createTextVNode as G, toValue as de, ref as F, watch as w, createCommentVNode as q, isRef as ce, withModifiers as J, mergeProps as Se, withKeys as ge, nextTick as Be, resolveDirective as _e, withDirectives as be, resolveDynamicComponent as Ve, renderSlot as Ee, shallowRef as Me, createSlots as Ke, reactive as $e } from "vue";
7
- import { u as R, C as j, c as H, o as re, d as we } from "../.chunks/forms-BhbgRJ5I.es.js";
8
- import { _ as Ie, a as ue } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-xvzbyqai.es.js";
9
- import { _ as Le } from "../.chunks/menu.vue_vue_type_style_index_0_lang-dOeZ7an1.es.js";
10
- import { u as Ae } from "../.chunks/utils-UBgfsQ8v.es.js";
11
- import { getSearcherGIcon as Re, getLangLabel as Oe, getDeviceGIcon as Ne } from "../utils/searchers.js";
12
- import { storage as W } from "../utils/dom.js";
13
- import { TopPopupWorker as De } from "../popup/worker.js";
14
- import { _ as Fe } from "../.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js";
15
- const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }, ft = /* @__PURE__ */ U({
16
- __name: "selectorCompetitors",
17
- props: /* @__PURE__ */ N({
6
+ import { defineComponent as j, mergeModels as M, useModel as A, computed as E, createElementBlock as b, openBlock as h, createBlock as C, unref as v, withCtx as T, Fragment as Y, renderList as fe, normalizeClass as X, createElementVNode as oe, toDisplayString as V, createVNode as L, createTextVNode as z, toValue as ve, ref as G, watch as B, createCommentVNode as O, reactive as Be, isRef as pe, withModifiers as F, mergeProps as Ae, withKeys as ye, nextTick as Le, resolveDirective as Ne, withDirectives as Pe, resolveDynamicComponent as De, renderSlot as qe, shallowRef as Ue, createSlots as Fe } from "vue";
7
+ import { u as w, C as _, e as H, p as se, d as _e } from "../.chunks/forms-Cwv0JCi5.es.js";
8
+ import { _ as be, b as me, a as ze } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js";
9
+ import { a as Je, _ as Ve, b as Me, c as we, I as de } from "../.chunks/policy.vue_vue_type_style_index_0_lang-B61ZEDWr.es.js";
10
+ import { u as We } from "../.chunks/utils-cls72V1c.es.js";
11
+ import { getSearcherGIcon as Ye, getLangLabel as He, getDeviceGIcon as Qe } from "../utils/searchers.js";
12
+ import "../.chunks/core-DVQVVUiP.es.js";
13
+ import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js";
14
+ import { g as Xe } from "../.chunks/field-CyyFzM-Y.es.js";
15
+ import { storage as J } from "../utils/dom.js";
16
+ import { TopPopupWorker as Ze } from "../popup/worker.js";
17
+ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" }, Nt = /* @__PURE__ */ j({
18
+ __name: "competitorSelector",
19
+ props: /* @__PURE__ */ M({
18
20
  modelValue: {},
19
21
  items: {},
20
22
  showSelectAllItem: { type: Boolean, default: !0 }
@@ -23,74 +25,65 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
23
25
  modelModifiers: {}
24
26
  }),
25
27
  emits: ["update:modelValue"],
26
- setup(t) {
27
- const l = t, n = D(t, "modelValue"), e = E(() => {
28
- if (l.showSelectAllItem)
28
+ setup(e) {
29
+ const a = e, o = A(e, "modelValue"), t = E(() => {
30
+ if (a.showSelectAllItem)
29
31
  return {
30
32
  icon: "",
31
- title: R().Common.Select_all,
33
+ title: w().Common.Select_all,
32
34
  value: "all",
33
35
  content: ""
34
36
  };
35
37
  });
36
- return (i, a) => (k(), b("div", qe, [
37
- y(j).state.isMobile ? (k(), _(Ie, { key: 0 }, {
38
- opener: B(() => [
39
- A(H, {
40
- class: "top-selectorCompetitors_opener",
38
+ return (r, l) => (h(), b("div", et, [
39
+ v(_).state.isMobile ? (h(), C(be, { key: 0 }, {
40
+ opener: T(() => [
41
+ L(H, {
42
+ class: "top-competitorSelector_opener",
41
43
  color: "theme",
42
44
  icon: "",
43
45
  icon2: ""
44
46
  }, {
45
- default: B(() => {
46
- var o;
47
- return [
48
- G(K((o = i.items.find((u) => {
49
- var f;
50
- return u.value === ((f = n.value) == null ? void 0 : f[0]);
51
- })) == null ? void 0 : o.content), 1)
52
- ];
53
- }),
47
+ default: T(() => [
48
+ z(V(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
49
+ ]),
54
50
  _: 1
55
51
  })
56
52
  ]),
57
- contentList: B(() => [
58
- (k(!0), b(Y, null, se(i.items, (o) => {
59
- var u;
60
- return k(), _(ue, {
61
- class: X({
62
- "top-active": (u = n.value) == null ? void 0 : u.includes(o.value)
63
- }),
64
- "data-top-icon": o.icon,
65
- title: o.title,
66
- onClick: () => n.value = [o.value]
67
- }, {
68
- default: B(() => [
69
- he("span", Ue, K(o.content), 1)
70
- ]),
71
- _: 2
72
- }, 1032, ["class", "data-top-icon", "title", "onClick"]);
73
- }), 256))
53
+ contentList: T(() => [
54
+ (h(!0), b(Y, null, fe(e.items, (n) => (h(), C(me, {
55
+ class: X({
56
+ "top-active": o.value?.includes(n.value)
57
+ }),
58
+ "data-top-icon": n.icon,
59
+ title: n.title,
60
+ onClick: () => o.value = [n.value]
61
+ }, {
62
+ default: T(() => [
63
+ oe("span", tt, V(n.content), 1)
64
+ ]),
65
+ _: 2
66
+ }, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
74
67
  ]),
75
68
  _: 1
76
- })) : (k(), _(Le, {
69
+ })) : (h(), C(Je, {
77
70
  key: 1,
78
- modelValue: n.value,
79
- "onUpdate:modelValue": a[0] || (a[0] = (o) => n.value = o),
80
- items: i.items,
71
+ modelValue: o.value,
72
+ "onUpdate:modelValue": l[0] || (l[0] = (n) => o.value = n),
73
+ items: e.items,
81
74
  isMultiple: !0,
82
75
  styling: "bar",
83
76
  canBeEmptyMultiple: !1,
84
- selectAllItem: e.value
77
+ selectAllItem: t.value
85
78
  }, null, 8, ["modelValue", "items", "selectAllItem"]))
86
79
  ]));
87
80
  }
88
- }), vt = (t, l) => E(() => de(t).filter((i) => i.on >= 0 || i.id === l).map((i) => ({
89
- value: i.id,
90
- title: i.url + ` [${i.id}]`,
91
- icon: i.id === de(l) ? "" : "",
92
- content: i.name
93
- }))), M = -1, p = -2, te = -1, Pe = {
81
+ }), Pt = (e, a) => E(() => ve(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
82
+ value: r.id,
83
+ title: r.url + ` [${r.id}]`,
84
+ icon: r.id === ve(a) ? "" : "",
85
+ content: r.name
86
+ }))), R = -1, y = -2, le = -1, ot = {
94
87
  0: "Yandex",
95
88
  1: "Google",
96
89
  4: "YouTube",
@@ -100,247 +93,241 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
100
93
  9: "GoogleStore",
101
94
  20: "Yandex.com",
102
95
  21: "Yandex.com.tr"
103
- }, me = {
104
- key: p,
96
+ }, he = {
97
+ key: y,
105
98
  name: "--",
106
- index: p
107
- }, xe = {
108
- key: p,
99
+ index: y
100
+ }, $e = {
101
+ key: y,
109
102
  name: "--",
110
- regions: [me],
111
- regionByIndex: /* @__PURE__ */ new Map([[p, me]])
112
- }, le = {
113
- key: p,
103
+ regions: [he],
104
+ regionByIndex: /* @__PURE__ */ new Map([[y, he]])
105
+ }, ae = {
106
+ key: y,
114
107
  name: "Autoselect",
115
- index: p
116
- }, ne = {
117
- key: p,
108
+ index: y
109
+ }, ue = {
110
+ key: y,
118
111
  name: "Autoselect",
119
- regions: [le],
120
- regionByIndex: /* @__PURE__ */ new Map([[p, le]])
121
- }, fe = {
112
+ regions: [ae],
113
+ regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
114
+ }, Ie = {
122
115
  countryCode: "00",
123
116
  depth: 1,
124
117
  device: 0,
125
- key: te,
126
- index: te,
118
+ key: le,
119
+ index: le,
127
120
  lang: "ru",
128
121
  name: "Without region"
129
- }, ze = () => (le.name = R().Common.Autoselect, le), Je = () => (ze(), ne.name = R().Common.Autoselect, console.log(ne), ne), je = () => (fe.name = R().Keywords.Without_region, fe), ke = (t = !1, l = !1, n = []) => {
130
- let e;
131
- return t ? e = Ge(n) : e = Te(n), l && e.set(p, Je()), e.size || e.set(p, xe), e;
132
- }, Te = (t, l = !0, n = [], e = !1) => {
133
- const i = /* @__PURE__ */ new Map();
134
- return t.forEach((a) => {
135
- if (!a.enabled || e && typeof a.key == "number" && a.key > 1) return;
136
- const o = { ...a };
137
- o.regionByIndex = /* @__PURE__ */ new Map(), a.regions && a.regions.forEach((u) => {
138
- if (l && !u.enabled) return;
139
- const f = { ...u };
140
- o.regionByIndex.set(f.index, f);
141
- }), !o.regionByIndex.size && n.length, // режим вывода ПС без регионов
142
- (!a.regions || // есть включенные регионы
143
- o.regionByIndex.size || // запрошен вывод конкретных ПС
144
- n.length) && typeof o.key == "number" && i.set(o.key, o);
145
- }), n.forEach((a) => {
146
- if (i.has(a)) return;
147
- const o = {
148
- key: a,
149
- name: Pe[a],
122
+ }, lt = () => (ae.name = w().Common.Autoselect, ae), at = () => (lt(), ue.name = w().Common.Autoselect, console.log(ue), ue), nt = () => (Ie.name = w().Keywords.Without_region, Ie), Ee = (e = !1, a = !1, o = []) => {
123
+ let t;
124
+ return e ? t = rt(o) : t = Ge(o), a && t.set(y, at()), t.size || t.set(y, $e), t;
125
+ }, Ge = (e, a = !0, o = [], t = !1) => {
126
+ const r = /* @__PURE__ */ new Map();
127
+ return e.forEach((l) => {
128
+ if (!l.enabled || t && typeof l.key == "number" && l.key > 1) return;
129
+ const n = { ...l };
130
+ n.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((d) => {
131
+ if (a && !d.enabled) return;
132
+ const c = { ...d };
133
+ n.regionByIndex.set(c.index, c);
134
+ }), !n.regionByIndex.size && o.length, // режим вывода ПС без регионов
135
+ (!l.regions || // есть включенные регионы
136
+ n.regionByIndex.size || // запрошен вывод конкретных ПС
137
+ o.length) && typeof n.key == "number" && r.set(n.key, n);
138
+ }), o.forEach((l) => {
139
+ if (r.has(l)) return;
140
+ const n = {
141
+ key: l,
142
+ name: ot[l],
150
143
  regions: [],
151
144
  regionByIndex: /* @__PURE__ */ new Map()
152
145
  };
153
- i.set(o.key, o);
154
- }), i;
155
- }, Ge = (t) => {
156
- const l = Te(t, !1, [0, 1], !0);
157
- if (l.has(2)) {
158
- const n = l.get(2);
159
- n && (n.regionByIndex = /* @__PURE__ */ new Map());
146
+ r.set(n.key, n);
147
+ }), r;
148
+ }, rt = (e) => {
149
+ const a = Ge(e, !1, [0, 1], !0);
150
+ if (a.has(2)) {
151
+ const o = a.get(2);
152
+ o && (o.regionByIndex = /* @__PURE__ */ new Map());
160
153
  }
161
- return l.forEach((n) => {
162
- if (!n.regionByIndex) return;
163
- const e = { ...je() };
164
- n.regionByIndex.set(e.index, e);
165
- }), l;
166
- }, We = (t, l, n = []) => {
167
- const e = ke(t, !1, n);
168
- let i;
169
- return e.forEach((a) => {
170
- if (!(l.searcher_key !== void 0 && l.searcher_key != a.key) && a.regions && (a.regions.forEach((o) => {
171
- if (!i && !(l.key !== void 0 && l.key != o.key) && !(l.index !== void 0 && l.index != o.index) && !(!t && (l.lang !== void 0 && l.lang != o.lang || l.device !== void 0 && l.device != o.device)))
172
- return o.searcher_key = a.key, i = o, !1;
173
- }), i))
154
+ return a.forEach((o) => {
155
+ if (!o.regionByIndex) return;
156
+ const t = { ...nt() };
157
+ o.regionByIndex.set(t.index, t);
158
+ }), a;
159
+ }, it = (e, a, o = []) => {
160
+ const t = Ee(e, !1, o);
161
+ let r;
162
+ return t.forEach((l) => {
163
+ if (!(a.searcher_key !== void 0 && a.searcher_key != l.key) && l.regions && (l.regions.forEach((n) => {
164
+ if (!r && !(a.key !== void 0 && a.key != n.key) && !(a.index !== void 0 && a.index != n.index) && !(!e && (a.lang !== void 0 && a.lang != n.lang || a.device !== void 0 && a.device != n.device)))
165
+ return n.searcher_key = l.key, r = n, !1;
166
+ }), r))
174
167
  return !1;
175
- }), i;
176
- }, Ye = Ae(() => import("../.chunks/dialog_selectorRegions-BtAADQHf.es.js")), He = (t, l) => {
177
- const n = R(), e = F(l.value.keys().next().value ?? p), i = E(() => {
178
- const a = /* @__PURE__ */ new Map();
179
- if (l.value.forEach((o) => {
180
- let u = {
181
- value: o.key,
182
- title: o.name
168
+ }), r;
169
+ }, dt = We(() => import("../.chunks/dialog_regionSelectorRegions-DJu5Y1WK.es.js")), ut = (e, a) => {
170
+ const o = w(), t = G(a.value.keys().next().value ?? y), r = E(() => {
171
+ const l = /* @__PURE__ */ new Map();
172
+ if (a.value.forEach((n) => {
173
+ let d = {
174
+ value: n.key,
175
+ title: n.name
183
176
  };
184
- t.addSearcherIcon && (u.icon = Re(o.key)), a.set(o.key, u);
185
- }), t.addCompare && !a.has(p)) {
186
- const o = {
177
+ e.addSearcherIcon && (d.icon = Ye(n.key)), l.set(n.key, d);
178
+ }), e.addCompare && !l.has(y)) {
179
+ const n = {
187
180
  value: "",
188
181
  title: "--------------------",
189
182
  disabled: !0
190
183
  };
191
- a.set(o.value, o);
192
- const u = {
193
- value: M,
194
- title: n.Common.Compare
184
+ l.set(n.value, n);
185
+ const d = {
186
+ value: R,
187
+ title: o.Common.Compare
195
188
  };
196
- a.set(u.value, u);
189
+ l.set(d.value, d);
197
190
  }
198
- return a;
191
+ return l;
199
192
  });
200
193
  return {
201
- searcherKey: e,
202
- optionBySearcherKey: i
194
+ searcherKey: t,
195
+ optionBySearcherKey: r
203
196
  };
204
- }, Qe = (t, l) => {
205
- var a, o, u;
206
- const n = R(), e = F(p);
207
- t.modelValue.length === 1 && (e.value = t.modelValue[0]), e.value === p && (t.forFrequency ? e.value = ((o = (a = l.value) == null ? void 0 : a.regionByIndex.values().next().value) == null ? void 0 : o.key) ?? p : e.value = ((u = l.value) == null ? void 0 : u.regionByIndex.keys().next().value) ?? p);
208
- const i = E(() => {
209
- var h;
210
- const f = /* @__PURE__ */ new Map();
211
- return (h = l.value.regionByIndex) == null || h.forEach((S) => {
212
- let r = S.name;
213
- if (t.forFrequency) {
214
- const x = {
215
- value: S.key,
216
- title: r
197
+ }, st = (e, a) => {
198
+ const o = w(), t = G(y);
199
+ e.modelValue.length === 1 && (t.value = e.modelValue[0]), t.value === y && (e.forFrequency ? t.value = a.value?.regionByIndex.values().next().value?.key ?? y : t.value = a.value?.regionByIndex.keys().next().value ?? y);
200
+ const r = E(() => {
201
+ const l = /* @__PURE__ */ new Map();
202
+ return a.value.regionByIndex?.forEach((n) => {
203
+ let d = n.name;
204
+ if (e.forFrequency) {
205
+ const I = {
206
+ value: n.key,
207
+ title: d
217
208
  };
218
- f.has(S.key) || f.set(S.key, x);
209
+ l.has(n.key) || l.set(n.key, I);
219
210
  return;
220
211
  }
221
- S.device && (r += " (" + n.Common["Device_" + S.device] + ")");
222
- const g = Oe(l.value.key || 0, S.lang ?? "");
223
- g && (r += " / " + g);
224
- const d = {
225
- value: S.index,
226
- title: r,
227
- icon: S.device ? Ne(S.device) : void 0
212
+ n.device && (d += " (" + o.Common["Device_" + n.device] + ")");
213
+ const c = He(a.value.key || 0, n.lang ?? "");
214
+ c && (d += " / " + c);
215
+ const f = {
216
+ value: n.index,
217
+ title: d,
218
+ icon: n.device ? Qe(n.device) : void 0
228
219
  };
229
- f.set(S.index, d);
230
- }), f;
220
+ l.set(n.index, f);
221
+ }), l;
231
222
  });
232
- return w(i, (f, h) => {
233
- var d;
234
- if (t.onlySearcher || e.value !== void 0 && f.get(e.value))
223
+ return B(r, (l, n) => {
224
+ if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
235
225
  return;
236
- let S = f.keys().next().value;
237
- if (e.value === p || S === p) {
238
- e.value = S;
226
+ let d = l.keys().next().value;
227
+ if (t.value === y || d === y) {
228
+ t.value = d;
239
229
  return;
240
230
  }
241
- let r = ((d = h == null ? void 0 : h.get(e.value)) == null ? void 0 : d.title) || "", g = -1;
242
- for (const [x, C] of f.entries()) {
243
- const T = C.title;
244
- if (typeof T != "string" || typeof x == "string")
231
+ let c = n?.get(t.value)?.title || "", f = -1;
232
+ for (const [I, i] of l.entries()) {
233
+ const m = i.title;
234
+ if (typeof m != "string" || typeof I == "string")
245
235
  break;
246
- if (T === r) {
247
- S = x;
236
+ if (m === c) {
237
+ d = I;
248
238
  break;
249
239
  }
250
- const V = new RegExp(` \\((${n.Common.Device_1}|${n.Common.Device_2})\\)`);
251
- let m = r, s = 3;
252
- T.indexOf(m) === -1 && (m = r.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), T.indexOf(m) === -1 && (m = r.replace(/ \/.*/, ""), s--), T.indexOf(m) === -1 && (m = r.replace(/ \/.*/, ""), m = m.replace(/^[^a-zа-я]/i, "").replace(V, ""), s--), T.indexOf(m) !== -1 && (s <= g || (g = s, S = x));
240
+ const u = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
241
+ let s = c, g = 3;
242
+ m.indexOf(s) === -1 && (s = c.replace(/^[^a-zа-я]/i, "").replace(u, ""), g--), m.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), g--), m.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(u, ""), g--), m.indexOf(s) !== -1 && (g <= f || (f = g, d = I));
253
243
  }
254
- e.value = S;
244
+ t.value = d;
255
245
  }), {
256
- regionIndex: e,
257
- optionByRegionIndex: i
246
+ regionIndex: t,
247
+ optionByRegionIndex: r
258
248
  };
259
- }, Xe = (t, l, n) => {
260
- const e = F([]), i = () => {
261
- if (t.onlySearcher && l.value) {
262
- e.value = Array.from(l.value.keys());
249
+ }, ct = (e, a, o) => {
250
+ const t = G([]), r = () => {
251
+ if (e.onlySearcher && a.value) {
252
+ t.value = Array.from(a.value.keys());
263
253
  return;
264
254
  }
265
- let o = [];
266
- if (t.modelValue.length > 1)
267
- o = [...t.modelValue];
255
+ let n = [];
256
+ if (e.modelValue.length > 1)
257
+ n = [...e.modelValue];
268
258
  else
269
259
  try {
270
- o = JSON.parse(
271
- localStorage.getItem("ui:project:regionSelector" + t.projectId + ":regionsIndexes")
260
+ n = JSON.parse(
261
+ localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
272
262
  ) ?? [];
273
263
  } catch {
274
264
  }
275
- o.length && (o = o.filter((u) => n.value.has(u))), o.length || (o = Array.from(n.value)), e.value = [...o];
276
- }, a = () => {
277
- e.value.length ? localStorage.setItem("ui:project:regionSelector:" + t.projectId + ":regionsIndexes", JSON.stringify(e.value)) : localStorage.removeItem("ui:project:regionSelector:" + t.projectId + ":regionsIndexes");
265
+ n.length && (n = n.filter((d) => o.value.has(d))), n.length || (n = Array.from(o.value)), t.value = [...n];
266
+ }, l = () => {
267
+ t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
278
268
  };
279
- return w(e, () => {
280
- a();
281
- }), t.addCompare && i(), {
282
- regionsIndexes: e
269
+ return B(t, () => {
270
+ l();
271
+ }), e.addCompare && r(), {
272
+ regionsIndexes: t
283
273
  };
284
- }, Ze = (t) => {
285
- const l = E(() => ke(t.forFrequency, t.autoRegion, t.searchers)), n = E(() => l.value.get(i.searcherKey.value) || xe), e = E(() => {
286
- const r = /* @__PURE__ */ new Set();
287
- return l.value.forEach((g) => {
288
- g.regionByIndex.forEach((d) => {
289
- d.index !== te && d.index !== p && r.add(d.index);
274
+ }, gt = (e) => {
275
+ const a = E(() => Ee(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => a.value.get(r.searcherKey.value) || $e), t = E(() => {
276
+ const i = /* @__PURE__ */ new Set();
277
+ return a.value.forEach((m) => {
278
+ m.regionByIndex.forEach((u) => {
279
+ u.index !== le && u.index !== y && i.add(u.index);
290
280
  });
291
- }), r;
292
- }), i = He(t, l), a = Qe(t, n), o = Xe(t, l, e);
293
- w(l, () => {
294
- var g, d, x, C;
295
- if (t.onlySearcher ? o.regionsIndexes.value = Array.from(l.value.keys()) : o.regionsIndexes.value = o.regionsIndexes.value.filter((T) => e.value.has(T)), i.searcherKey.value === M) return;
296
- let r = l.value.keys().next().value;
297
- l.value.forEach((T) => {
298
- var V, m, s;
299
- if (t.onlySearcher && T.key === i.searcherKey.value) {
300
- r = i.searcherKey.value;
281
+ }), i;
282
+ }), r = ut(e, a), l = st(e, o), n = ct(e, a, t);
283
+ B(a, () => {
284
+ if (e.onlySearcher ? n.regionsIndexes.value = Array.from(a.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((m) => t.value.has(m)), r.searcherKey.value === R) return;
285
+ let i = a.value.keys().next().value;
286
+ a.value.forEach((m) => {
287
+ if (e.onlySearcher && m.key === r.searcherKey.value) {
288
+ i = r.searcherKey.value;
301
289
  return;
302
290
  }
303
- if (a.regionIndex.value && ((V = T.regionByIndex) != null && V.has(a.regionIndex.value)) && (r = T.key), !t.onlySearcher) {
304
- let c;
305
- r !== void 0 && (c = (m = l.value.get(r)) == null ? void 0 : m.regionByIndex);
306
- const v = (s = l.value.get(T.key)) == null ? void 0 : s.regionByIndex;
307
- c != null && c.has(p) && !(v != null && v.has(p)) && (r = T.key);
291
+ if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (i = m.key), !e.onlySearcher) {
292
+ let u;
293
+ i !== void 0 && (u = a.value.get(i)?.regionByIndex);
294
+ const s = a.value.get(m.key)?.regionByIndex;
295
+ u?.has(y) && !s?.has(y) && (i = m.key);
308
296
  }
309
- }), r !== void 0 && (i.searcherKey.value = r), a.regionIndex.value !== void 0 && !((d = (g = n.value) == null ? void 0 : g.regionByIndex) != null && d.has(a.regionIndex.value)) && (a.regionIndex.value = (C = (x = n.value) == null ? void 0 : x.regions) == null ? void 0 : C.keys().next().value);
297
+ }), i !== void 0 && (r.searcherKey.value = i), l.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = o.value?.regions?.keys().next().value);
310
298
  }, { immediate: !0 });
311
- const u = () => {
312
- if (!(i.searcherKey.value === M || i.searcherKey.value === p))
313
- return i.searcherKey.value;
314
- }, f = () => {
315
- if (t.onlySearcher || a.regionIndex.value === p) return;
316
- let r = a.regionIndex.value;
317
- if (t.forFrequency) {
318
- const g = a.regionIndex.value, d = We(t.forFrequency, { searcher_key: u(), key: g }, t.searchers);
319
- r = d == null ? void 0 : d.index;
299
+ const d = () => {
300
+ if (!(r.searcherKey.value === R || r.searcherKey.value === y))
301
+ return r.searcherKey.value;
302
+ }, c = () => {
303
+ if (e.onlySearcher || l.regionIndex.value === y) return;
304
+ let i = l.regionIndex.value;
305
+ if (e.forFrequency) {
306
+ const m = l.regionIndex.value;
307
+ i = it(e.forFrequency, { searcher_key: d(), key: m }, e.searchers)?.index;
320
308
  }
321
- return r;
322
- }, h = () => {
323
- const r = u();
324
- if (r !== void 0)
325
- return l.value.get(r);
309
+ return i;
310
+ }, f = () => {
311
+ const i = d();
312
+ if (i !== void 0)
313
+ return a.value.get(i);
326
314
  };
327
315
  return {
328
- selectSearcher: i,
329
- selectRegion: a,
330
- compare: o,
331
- searcherByKey: l,
332
- allRegionsIndexes: e,
333
- getSearcher: h,
316
+ selectSearcher: r,
317
+ selectRegion: l,
318
+ compare: n,
319
+ searcherByKey: a,
320
+ allRegionsIndexes: t,
321
+ getSearcher: f,
334
322
  getRegion: () => {
335
- var g, d;
336
- const r = f();
337
- if (r !== void 0)
338
- return (d = (g = h()) == null ? void 0 : g.regionByIndex) == null ? void 0 : d.get(r);
323
+ const i = c();
324
+ if (i !== void 0)
325
+ return f()?.regionByIndex?.get(i);
339
326
  }
340
327
  };
341
- }, yt = /* @__PURE__ */ U({
342
- __name: "selectorRegion",
343
- props: /* @__PURE__ */ N({
328
+ }, Dt = /* @__PURE__ */ j({
329
+ __name: "regionSelector",
330
+ props: /* @__PURE__ */ M({
344
331
  projectId: {},
345
332
  searchers: { default: () => [] },
346
333
  modelValue: {},
@@ -359,191 +346,471 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
359
346
  modelValueSingleModifiers: {}
360
347
  }),
361
348
  emits: ["update:modelValue", "update:modelValueSingle"],
362
- setup(t, { expose: l }) {
363
- const n = t, e = D(t, "modelValue"), i = D(t, "modelValueSingle"), {
364
- selectSearcher: a,
365
- selectRegion: o,
366
- compare: u,
367
- searcherByKey: f,
368
- allRegionsIndexes: h,
369
- getSearcher: S,
370
- getRegion: r
371
- } = Ze(n), g = () => {
372
- const d = [];
373
- f.value.forEach((x) => {
374
- x.enabled && x.regions.forEach((C) => {
375
- C.enabled && d.push(C);
349
+ setup(e, { expose: a }) {
350
+ const o = e, t = A(e, "modelValue"), r = A(e, "modelValueSingle"), {
351
+ selectSearcher: l,
352
+ selectRegion: n,
353
+ compare: d,
354
+ searcherByKey: c,
355
+ allRegionsIndexes: f,
356
+ getSearcher: I,
357
+ getRegion: i
358
+ } = gt(o), m = () => {
359
+ const u = [];
360
+ c.value.forEach((s) => {
361
+ s.enabled && s.regions.forEach((g) => {
362
+ g.enabled && u.push(g);
376
363
  });
377
- }), Ye.open("selectorRegions", {
378
- regions: d,
379
- regionsIndexes: u.regionsIndexes.value,
380
- "@update:regionsIndexes": (x) => u.regionsIndexes.value = x
364
+ }), dt.open("regions", {
365
+ regions: u,
366
+ regionsIndexes: d.regionsIndexes.value,
367
+ "@update:regionsIndexes": (s) => d.regionsIndexes.value = s
381
368
  });
382
369
  };
383
- return w([o.regionIndex, a.searcherKey, u.regionsIndexes], () => {
384
- if (a.searcherKey.value === M && u.regionsIndexes.value.length) {
385
- if (JSON.stringify(e.value) === JSON.stringify(u.regionsIndexes.value))
370
+ return B([n.regionIndex, l.searcherKey, d.regionsIndexes], () => {
371
+ if (l.searcherKey.value === R && d.regionsIndexes.value.length) {
372
+ if (JSON.stringify(t.value) === JSON.stringify(d.regionsIndexes.value))
386
373
  return;
387
- e.value = [...u.regionsIndexes.value];
374
+ t.value = [...d.regionsIndexes.value];
388
375
  } else
389
- n.onlySearcher ? (e.value = [a.searcherKey.value], a.searcherKey.value === p && !n.autoRegion && (e.value.length = 0)) : (e.value = [o.regionIndex.value], o.regionIndex.value === p && !n.autoRegion && (e.value.length = 0));
390
- !n.onlySearcher && !h.value.size && (a.searcherKey.value = p);
391
- }), i.value && w(i, () => {
392
- i.value && (e.value = [i.value]);
393
- }, { immediate: !0 }), w(e, () => {
394
- var d, x, C, T, V;
395
- if (e.value[0] && (i.value = e.value[0]), n.onlySearcher) {
396
- if (!e.value.length || e.value.length === 1 && !f.value.has(e.value[0]) || e.value.length === 1 && e.value[0] === p && !n.autoRegion) {
397
- let m = f.value.keys().next().value;
398
- m === p && !n.autoRegion && (m = void 0, i.value = p), m !== void 0 ? e.value = [m] : e.value.length = 0;
376
+ o.onlySearcher ? (t.value = [l.searcherKey.value], l.searcherKey.value === y && !o.autoRegion && (t.value.length = 0)) : (t.value = [n.regionIndex.value], n.regionIndex.value === y && !o.autoRegion && (t.value.length = 0));
377
+ !o.onlySearcher && !f.value.size && (l.searcherKey.value = y);
378
+ }), r.value && B(r, () => {
379
+ r.value && (t.value = [r.value]);
380
+ }, { immediate: !0 }), B(t, () => {
381
+ if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
382
+ if (!t.value.length || t.value.length === 1 && !c.value.has(t.value[0]) || t.value.length === 1 && t.value[0] === y && !o.autoRegion) {
383
+ let u = c.value.keys().next().value;
384
+ u === y && !o.autoRegion && (u = void 0, r.value = y), u !== void 0 ? t.value = [u] : t.value.length = 0;
399
385
  return;
400
386
  }
401
- if (e.value.length > 1 && JSON.stringify(e.value) !== JSON.stringify(u.regionsIndexes.value)) {
402
- e.value = [...u.regionsIndexes.value];
387
+ if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(d.regionsIndexes.value)) {
388
+ t.value = [...d.regionsIndexes.value];
403
389
  return;
404
390
  }
405
391
  } else {
406
- let m = [...new Set(e.value)], s = (x = (d = f.value.values().next().value) == null ? void 0 : d.regionByIndex) == null ? void 0 : x.keys().next().value;
407
- if (n.forFrequency && (s = (V = (T = (C = f.value.values().next().value) == null ? void 0 : C.regionByIndex) == null ? void 0 : T.values().next().value) == null ? void 0 : V.key), s === p && !n.autoRegion && (s = void 0, i.value = p), !m.length)
408
- s !== void 0 && m.push(s);
409
- else if (m.length === 1) {
410
- let c = h.value;
411
- n.forFrequency && (c = /* @__PURE__ */ new Set(), f.value.forEach((v) => {
412
- v.regionByIndex.forEach((I) => {
413
- I.index !== te && I.index !== p && c.add(I.key);
392
+ let u = [...new Set(t.value)], s = c.value.values().next().value?.regionByIndex?.keys().next().value;
393
+ if (o.forFrequency && (s = c.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, r.value = y), !u.length)
394
+ s !== void 0 && u.push(s);
395
+ else if (u.length === 1) {
396
+ let g = f.value;
397
+ o.forFrequency && (g = /* @__PURE__ */ new Set(), c.value.forEach((Z) => {
398
+ Z.regionByIndex.forEach((P) => {
399
+ P.index !== le && P.index !== y && g.add(P.key);
414
400
  });
415
- })), c.has(m[0]) || (m = [], s !== void 0 && m.push(s));
401
+ })), g.has(u[0]) || (u = [], s !== void 0 && u.push(s));
416
402
  } else
417
- m = m.filter((c) => h.value.has(c)), !m.length && s !== void 0 && m.push(s);
418
- if (JSON.stringify(e.value) !== JSON.stringify(m)) {
419
- e.value = m;
403
+ u = u.filter((g) => f.value.has(g)), !u.length && s !== void 0 && u.push(s);
404
+ if (JSON.stringify(t.value) !== JSON.stringify(u)) {
405
+ t.value = u;
420
406
  return;
421
407
  }
422
408
  }
423
- if (!(e.value.length === 1 && e.value[0] === (n.onlySearcher ? a.searcherKey.value : o.regionIndex.value)))
424
- if (n.onlySearcher) {
425
- if (e.value.length === 1) {
426
- a.searcherKey.value = e.value[0];
409
+ if (!(t.value.length === 1 && t.value[0] === (o.onlySearcher ? l.searcherKey.value : n.regionIndex.value)))
410
+ if (o.onlySearcher) {
411
+ if (t.value.length === 1) {
412
+ l.searcherKey.value = t.value[0];
427
413
  return;
428
414
  }
429
- a.searcherKey.value = M;
415
+ l.searcherKey.value = R;
430
416
  return;
431
417
  } else {
432
- if (!e.value.length)
418
+ if (!t.value.length)
433
419
  return;
434
- if (e.value.length === 1 && a.searcherKey.value !== M) {
435
- o.regionIndex.value = e.value[0];
436
- let m;
437
- for (const s of f.value.values()) {
438
- for (const c of s.regionByIndex.values())
439
- if ((n.forFrequency ? c.key : c.index) === o.regionIndex.value) {
440
- m = s.key;
420
+ if (t.value.length === 1 && l.searcherKey.value !== R) {
421
+ n.regionIndex.value = t.value[0];
422
+ let u;
423
+ for (const s of c.value.values()) {
424
+ for (const g of s.regionByIndex.values())
425
+ if ((o.forFrequency ? g.key : g.index) === n.regionIndex.value) {
426
+ u = s.key;
441
427
  break;
442
428
  }
443
- if (m !== void 0)
429
+ if (u !== void 0)
444
430
  break;
445
431
  }
446
- m !== void 0 && (a.searcherKey.value = m);
432
+ u !== void 0 && (l.searcherKey.value = u);
447
433
  } else
448
- a.searcherKey.value = M, u.regionsIndexes.value = [...e.value];
434
+ l.searcherKey.value = R, d.regionsIndexes.value = [...t.value];
449
435
  }
450
- }, { immediate: !0 }), l({
451
- getSearcher: S,
452
- getRegion: r
453
- }), (d, x) => (k(), b("div", {
436
+ }, { immediate: !0 }), a({
437
+ getSearcher: I,
438
+ getRegion: i
439
+ }), (u, s) => (h(), b("div", {
454
440
  class: X({
455
441
  "top-selectorRegion": !0,
456
- "top-selectorRegion-onlySearcher": d.onlySearcher
442
+ "top-selectorRegion-onlySearcher": e.onlySearcher
457
443
  })
458
444
  }, [
459
- A(re, {
460
- options: y(a).optionBySearcherKey.value,
461
- modelValue: y(a).searcherKey.value,
462
- "onUpdate:modelValue": x[0] || (x[0] = (C) => y(a).searcherKey.value = C),
445
+ L(se, {
446
+ options: v(l).optionBySearcherKey.value,
447
+ modelValue: v(l).searcherKey.value,
448
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => v(l).searcherKey.value = g),
463
449
  name: "searcher_key",
464
- addChanger: d.addChanger
450
+ addChanger: e.addChanger
465
451
  }, null, 8, ["options", "modelValue", "addChanger"]),
466
- !d.onlySearcher && y(a).searcherKey.value !== y(M) ? (k(), _(re, {
452
+ !e.onlySearcher && v(l).searcherKey.value !== v(R) ? (h(), C(se, {
467
453
  key: 0,
468
454
  class: "top-select-region",
469
- options: y(o).optionByRegionIndex.value,
470
- modelValue: y(o).regionIndex.value,
471
- "onUpdate:modelValue": x[1] || (x[1] = (C) => y(o).regionIndex.value = C),
472
- name: d.forFrequency ? "region_key" : "region_index",
473
- addChanger: d.addChanger,
474
- "data-top-icon": d.addRegionIcon ? "" : void 0
475
- }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : q("", !0),
476
- d.addCompare && !d.onlySearcher && y(a).searcherKey.value === y(M) ? (k(), _(H, {
455
+ options: v(n).optionByRegionIndex.value,
456
+ modelValue: v(n).regionIndex.value,
457
+ "onUpdate:modelValue": s[1] || (s[1] = (g) => v(n).regionIndex.value = g),
458
+ name: e.forFrequency ? "region_key" : "region_index",
459
+ addChanger: e.addChanger,
460
+ "data-top-icon": e.addRegionIcon ? "" : void 0
461
+ }, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : O("", !0),
462
+ e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(R) ? (h(), C(H, {
477
463
  key: 1,
478
464
  name: "compare",
479
- onClick: g,
480
- "data-count-compare-regions-indexes": y(u).regionsIndexes.value.length
465
+ onClick: m,
466
+ "data-count-compare-regions-indexes": v(d).regionsIndexes.value.length
481
467
  }, {
482
- default: B(() => [
483
- G(K(d.$i18n.Common.Selected_regions), 1)
468
+ default: T(() => [
469
+ z(V(u.$i18n.Common.Selected_regions), 1)
484
470
  ]),
485
471
  _: 1
486
- }, 8, ["data-count-compare-regions-indexes"])) : q("", !0)
472
+ }, 8, ["data-count-compare-regions-indexes"])) : O("", !0)
487
473
  ], 2));
488
474
  }
489
- }), ve = (t) => "-" + t, Q = (t) => t[0] === "-" ? t.substring(1) : t, ae = (t, l) => {
490
- t = Q(t);
491
- const n = l.find((e) => e.id === t);
492
- if (n)
493
- return n;
494
- }, pt = (t, l, n) => {
495
- l || (l = { id: t.id }), l.id = t.id, l.pos ??= "3", l.notch ??= !0, l.posBy ??= "fixed";
496
- const e = De.genElPopupOpener("div", l);
497
- return e.classList.add("top-tagSelector"), t.useTopButton && e.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), t.useTopButton || e.classList.add("top-tagSelector-custom"), t.mode === "filter" && e.classList.add("top-tagSelector-filter"), t.mode === "setter" && !t.filters && e.classList.add("top-tagSelector-setter_single"), t.mode === "setter" && t.filters && e.classList.add("top-tagSelector-setter_several"), e.onclick = (i) => {
498
- i.preventDefault(), i.stopPropagation(), e.onclick = null;
499
- const a = F(t.modelValue), o = {
500
- model: a,
501
- mode: t.mode,
502
- targetId: t.targetId,
503
- filters: t.filters,
504
- payload: t.payload
475
+ }), N = {
476
+ id: 0,
477
+ name: "/",
478
+ path: "/"
479
+ }, ft = (e, a) => {
480
+ let o = e?.root[0] ?? N;
481
+ return o = { ...o }, o.name = Ke(a), o;
482
+ };
483
+ function Ke(e) {
484
+ return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
485
+ }
486
+ const Oe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (t.childsIds = [], t.id && (t.countAllGroupsActive = t.count_groups_active), e[t.id] && e[t.id].forEach((l) => {
487
+ l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = Ke(a));
488
+ const n = r > 1 ? "-".repeat(r - 1) + " " : "";
489
+ n && !l.name.startsWith(n) && (l.name = n + l.name), o.set(l.id, l), Oe(e, a, o, l, r + 1), t.childsIds = t.childsIds.concat(l.childsIds), t.id && l.count_groups_active && (t.countAllGroupsActive += l.count_groups_active);
490
+ }), o), mt = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 }), vt = /* @__PURE__ */ j({
491
+ __name: "folders",
492
+ props: /* @__PURE__ */ M({
493
+ folderId: {},
494
+ folder: {},
495
+ folders: {},
496
+ projectId: {},
497
+ canSelectAll: { type: Boolean },
498
+ addChanger: { type: Boolean },
499
+ addIcon: { type: Boolean, default: !0 },
500
+ client: {}
501
+ }, {
502
+ folderId: { required: !0 },
503
+ folderIdModifiers: {},
504
+ folder: { default: N },
505
+ folderModifiers: {}
506
+ }),
507
+ emits: ["update:folderId", "update:folder"],
508
+ setup(e) {
509
+ const a = e, o = A(e, "folderId"), t = A(e, "folder"), r = a.client && !a.folders ? mt(a.client) : void 0, l = G(null);
510
+ B(() => a.projectId, () => {
511
+ r?.changeParams({
512
+ project_id: a.projectId
513
+ }), r?.setOptions({
514
+ checkFingerprint: "TopGroupSelectorFolders:" + a.projectId
515
+ }), l.value?.resetCache();
516
+ }, { immediate: !0 });
517
+ const n = E(() => Oe(a.folders ?? { root: [N] }, a.canSelectAll));
518
+ return B(o, () => {
519
+ a.folders && (n.value.get(a.folderId) || (o.value = 0));
520
+ }, { immediate: !0 }), B(o, () => {
521
+ const d = n.value.get(a.folderId);
522
+ d && (t.value = d);
523
+ }), B(t, () => {
524
+ o.value = t.value.id;
525
+ }), (d, c) => (h(), C(Ve, {
526
+ class: "top-groupSelector_folder",
527
+ modelValue: t.value,
528
+ "onUpdate:modelValue": c[0] || (c[0] = (f) => t.value = f),
529
+ items: e.folders ? [...n.value.values()] : void 0,
530
+ "search-type": "inline",
531
+ icon: e.addIcon ? "" : void 0,
532
+ api: e.folders ? void 0 : v(r),
533
+ apiSetSearchParams: (...f) => v(Me)(...f, "name"),
534
+ addChanger: e.addChanger,
535
+ useCache: ""
536
+ }, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
537
+ }
538
+ });
539
+ function Se(e, a, o) {
540
+ const t = Object.keys(e), r = t.map((l) => e[l]);
541
+ return B(r, (l, n, d) => {
542
+ const c = {};
543
+ l.forEach((f, I) => {
544
+ if (!Object.is(f, n[I])) {
545
+ const i = t[I];
546
+ c[i] = {
547
+ old: n[I],
548
+ new: f
549
+ };
550
+ }
551
+ }), Object.keys(c).length && a(c, d);
552
+ }, o);
553
+ }
554
+ const ce = {
555
+ id: -1,
556
+ name: "--",
557
+ folder_id: N.id,
558
+ folder_path: N.path
559
+ }, ne = {
560
+ id: we,
561
+ name: "All groups",
562
+ folder_id: N.id,
563
+ folder_path: N.path
564
+ }, W = () => (ne.name = w()?.Common.All_groups, ne), Re = () => (ne.name = w()?.Keywords.Choose_group, ne), pt = (e, a) => (e = [...e], a && a.id && a.childsIds && (e = e.filter((o) => o.folder_id === a.id || a.childsIds.includes(o.folder_id))), e), xe = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), yt = (e) => e.gen("/add/keywords_2/groups/"), ht = { class: "top-groupSelector_groupItem" }, It = {
565
+ key: 0,
566
+ class: "top-comment"
567
+ }, St = {
568
+ key: 1,
569
+ class: "top-groupSelector_groupItemFolderPath"
570
+ }, xt = /* @__PURE__ */ j({
571
+ __name: "groups",
572
+ props: /* @__PURE__ */ M({
573
+ groupId: {},
574
+ group: {},
575
+ projectId: {},
576
+ folder: {},
577
+ groups: {},
578
+ canAdd: { type: [String, Boolean] },
579
+ canSelectAll: { type: [Boolean, String] },
580
+ autoselect: { default: "first" },
581
+ addChanger: { type: Boolean, default: !0 },
582
+ addIcon: { type: Boolean, default: !0 },
583
+ client: {}
584
+ }, {
585
+ groupId: { required: !0 },
586
+ groupIdModifiers: {},
587
+ group: { required: !0 },
588
+ groupModifiers: {}
589
+ }),
590
+ emits: /* @__PURE__ */ M(["addGroup"], ["update:groupId", "update:group"]),
591
+ setup(e, { emit: a }) {
592
+ const o = e, t = a, r = A(e, "groupId"), l = A(e, "group"), n = o.client && !o.groups ? xe(o.client) : void 0, d = o.client ? yt(o.client) : void 0, c = G(null), f = G(void 0), I = Xe("folder_id", "EQUALS", [o.folder?.id ?? 0]);
593
+ n?.changeParams({
594
+ project_id: o.projectId,
595
+ filters: [
596
+ I
597
+ ]
598
+ });
599
+ const i = (u) => {
600
+ l.value = u, r.value = u.id;
601
+ };
602
+ Se({
603
+ projectId: () => o.projectId,
604
+ folderId: () => o.folder?.id,
605
+ canSelectAll: () => o.canSelectAll
606
+ }, (u) => {
607
+ if (u.projectId && (n?.changeParams({
608
+ project_id: o.projectId
609
+ }), n?.setOptions({
610
+ checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
611
+ })), u.folderId && (I.values = [
612
+ o.folder?.id ?? 0
613
+ ], o.groups && (f.value = pt(o.groups, o.folder))), c.value?.resetCache(), (u.folderId?.old !== void 0 || u.canSelectAll?.old !== void 0) && r.value !== de) {
614
+ let s;
615
+ o.autoselect === "first" && (s = f.value?.[0], o.canSelectAll && (s = Be(W()))), (o.autoselect === "placeholder" || !s) && (s = Re()), i(s);
616
+ }
617
+ }, { immediate: !0 }), Se({
618
+ modelGroup: l,
619
+ modelGroupId: r
620
+ }, async (u) => {
621
+ if (r.value !== l.value.id) {
622
+ if (u.modelGroup && !u.modelGroupId) {
623
+ r.value = l.value.id;
624
+ return;
625
+ }
626
+ if (!(o.canAdd && r.value === de)) {
627
+ if (o.groups) {
628
+ let s = f.value?.find((g) => g.id === r.value);
629
+ if (!s && o.canSelectAll && (s = W()), s)
630
+ i(s);
631
+ else {
632
+ const g = f.value?.[0];
633
+ g && !r.value ? i(g) : i(ce);
634
+ }
635
+ }
636
+ if (o.client && !o.groups && (r.value || r.value === we && !o.canSelectAll)) {
637
+ const s = xe(o.client).changeParams({
638
+ project_id: o.projectId,
639
+ id: r.value,
640
+ filters: [
641
+ I
642
+ ]
643
+ });
644
+ s?.setOptions({
645
+ checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
646
+ });
647
+ const g = await s.call();
648
+ if (!g.errors?.length && !g.result) return;
649
+ !g.errors && g.result[0] ? i(g.result[0]) : i(ce);
650
+ }
651
+ }
652
+ }
653
+ }, { immediate: !0 });
654
+ const m = async (u) => {
655
+ if (o.canAdd !== "api" || !d) return;
656
+ const s = l.value, g = await d.changeParams({
657
+ project_id: o.projectId,
658
+ names: [u.name],
659
+ to_id: o.folder?.id ?? N.id,
660
+ to_type: "in_folder_last"
661
+ }).call();
662
+ g.result ? (i(g.result), t("addGroup", g.result)) : i(s), c.value?.resetCache(!0);
663
+ };
664
+ return (u, s) => (h(), C(Ve, {
665
+ ref_key: "refSelector",
666
+ ref: c,
667
+ class: "top-groupSelector_group",
668
+ modelValue: l.value,
669
+ "onUpdate:modelValue": s[0] || (s[0] = (g) => l.value = g),
670
+ items: f.value ?? e.groups,
671
+ searchType: "inline",
672
+ icon: e.addIcon ? "" : void 0,
673
+ api: e.groups ? void 0 : v(n),
674
+ apiSetSearchParams: (...g) => v(Me)(...g, "name"),
675
+ appendSearchToResult: !!e.canAdd,
676
+ useAllItem: e.canSelectAll ? v(W)().name : !1,
677
+ addChanger: e.addChanger,
678
+ useCache: "",
679
+ onAppendItem: m
680
+ }, {
681
+ item: T(({ item: g }) => [
682
+ oe("div", ht, [
683
+ g.id === v(de) ? (h(), b("div", It, V(u.$i18n.Common.Add) + ": ", 1)) : O("", !0),
684
+ oe("span", null, V(g.name), 1),
685
+ g.folder_path ? (h(), b("span", St, V(g.folder_path), 1)) : O("", !0)
686
+ ])
687
+ ]),
688
+ _: 1
689
+ }, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
690
+ }
691
+ }), kt = { class: "top-groupSelector" }, qt = /* @__PURE__ */ j({
692
+ __name: "groupSelector",
693
+ props: /* @__PURE__ */ M({
694
+ folderId: {},
695
+ groupId: {},
696
+ group: {},
697
+ projectId: {},
698
+ folders: {},
699
+ groups: {},
700
+ onlyOnGroups: { type: Boolean },
701
+ canSelectAllGroups: { type: Boolean },
702
+ canAddGroup: {},
703
+ autoselect: { default: "first" },
704
+ addChanger: { type: Boolean, default: !0 },
705
+ showFolders: { type: Boolean, default: !0 },
706
+ showGroups: { type: Boolean, default: !0 },
707
+ addIcon: { type: Boolean, default: !0 },
708
+ client: {}
709
+ }, {
710
+ folderId: { required: !0 },
711
+ folderIdModifiers: {},
712
+ groupId: { required: !0 },
713
+ groupIdModifiers: {},
714
+ group: {},
715
+ groupModifiers: {}
716
+ }),
717
+ emits: /* @__PURE__ */ M(["update:groups"], ["update:folderId", "update:groupId", "update:group"]),
718
+ setup(e, { emit: a }) {
719
+ const o = e, t = A(e, "folderId"), r = A(e, "groupId"), l = A(e, "group"), n = a, d = G(ft(o.folders, o.canSelectAllGroups));
720
+ let c = o.groups?.find((I) => I.id === r.value);
721
+ r.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = W()), o.canSelectAllGroups && !c && (c = W()), (o.autoselect === "placeholder" || !c) && (c = Re()), c ??= ce, l.value ??= c;
722
+ const f = (I) => {
723
+ let i;
724
+ o.groups && I && (i = [...o.groups, I]), n("update:groups", i);
725
+ };
726
+ return (I, i) => (h(), b("div", kt, [
727
+ e.showFolders ? (h(), C(vt, {
728
+ key: 0,
729
+ folderId: t.value,
730
+ "onUpdate:folderId": i[0] || (i[0] = (m) => t.value = m),
731
+ folder: d.value,
732
+ "onUpdate:folder": i[1] || (i[1] = (m) => d.value = m),
733
+ projectId: e.projectId,
734
+ folders: e.folders,
735
+ canSelectAll: e.canSelectAllGroups,
736
+ addChanger: e.addChanger,
737
+ addIcon: e.addIcon,
738
+ client: e.client
739
+ }, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : O("", !0),
740
+ e.showGroups ? (h(), C(xt, {
741
+ key: 1,
742
+ groupId: r.value,
743
+ "onUpdate:groupId": i[2] || (i[2] = (m) => r.value = m),
744
+ group: l.value,
745
+ "onUpdate:group": i[3] || (i[3] = (m) => l.value = m),
746
+ projectId: e.projectId,
747
+ folder: d.value,
748
+ groups: e.groups,
749
+ canAdd: e.canAddGroup,
750
+ canSelectAll: e.canSelectAllGroups,
751
+ autoselect: e.autoselect,
752
+ addChanger: e.addChanger,
753
+ addIcon: e.addIcon,
754
+ client: e.client,
755
+ onAddGroup: f
756
+ }, null, 8, ["groupId", "group", "projectId", "folder", "groups", "canAdd", "canSelectAll", "autoselect", "addChanger", "addIcon", "client"])) : O("", !0)
757
+ ]));
758
+ }
759
+ }), ke = (e) => "-" + e, Q = (e) => e[0] === "-" ? e.substring(1) : e, re = (e, a) => {
760
+ e = Q(e);
761
+ const o = a.find((t) => t.id === e);
762
+ if (o)
763
+ return o;
764
+ }, Ut = (e, a, o) => {
765
+ a || (a = { id: e.id }), a.id = e.id, a.pos ??= "3", a.notch ??= !0, a.posBy ??= "fixed";
766
+ const t = Ze.genElPopupOpener("div", a);
767
+ return t.classList.add("top-tagSelector"), e.useTopButton && t.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || t.classList.add("top-tagSelector-custom"), e.mode === "filter" && t.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && t.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && t.classList.add("top-tagSelector-setter_several"), t.onclick = (r) => {
768
+ r.preventDefault(), r.stopPropagation(), t.onclick = null;
769
+ const l = G(e.modelValue), n = {
770
+ model: l,
771
+ mode: e.mode,
772
+ targetId: e.targetId,
773
+ filters: e.filters,
774
+ payload: e.payload
505
775
  };
506
- W(e, "topTagSelectorTarget", o), delete e.dataset.topPopupDisabled, ce(t.modelValue) || w(a, () => {
507
- t.modelValue = a.value, ee(e, t, n);
508
- }), e.click();
509
- }, ce(t.modelValue) ? w(t.modelValue, () => ee(e, t, n)) : W(e, "topTagSelectorRender", (i) => {
510
- t.modelValue = i;
511
- const a = W(e, "topTagSelectorTarget");
512
- a && (a.model.value = i), ee(e, t, n);
513
- }), ee(e, t, n), e;
514
- }, ht = (t, l) => {
515
- var n;
516
- (n = W(t, "topTagSelectorRender")) == null || n(l);
517
- }, ee = (t, l, n) => {
518
- var i;
519
- const e = y(l.modelValue);
520
- if (t.classList.toggle("top-tagSelector-selectedOne", !e.length || e.length === 1), t.classList.toggle("top-tagSelector-toTwoLine", e.length > 5), l.mode === "setter" && l.filters) {
521
- t.innerHTML = `<div>${n}</div>`;
776
+ J(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, pe(e.modelValue) || B(l, () => {
777
+ e.modelValue = l.value, te(t, e, o);
778
+ }), t.click();
779
+ }, pe(e.modelValue) ? B(e.modelValue, () => te(t, e, o)) : J(t, "topTagSelectorRender", (r) => {
780
+ e.modelValue = r;
781
+ const l = J(t, "topTagSelectorTarget");
782
+ l && (l.model.value = r), te(t, e, o);
783
+ }), te(t, e, o), t;
784
+ }, Ft = (e, a) => {
785
+ J(e, "topTagSelectorRender")?.(a);
786
+ }, te = (e, a, o) => {
787
+ const t = v(a.modelValue);
788
+ if (e.classList.toggle("top-tagSelector-selectedOne", !t.length || t.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", t.length > 5), a.mode === "setter" && a.filters) {
789
+ e.innerHTML = `<div>${o}</div>`;
522
790
  return;
523
791
  }
524
- if (t.innerHTML = "", !e.length && l.mode === "filter") {
525
- const a = ye({
792
+ if (e.innerHTML = "", !t.length && a.mode === "filter") {
793
+ const r = Ce({
526
794
  id: "all",
527
795
  colorId: "",
528
- name: ((i = R().Common) == null ? void 0 : i.All_tags) ?? "",
796
+ name: w().Common?.All_tags ?? "",
529
797
  state: ""
530
798
  });
531
- t.append(a);
799
+ e.append(r);
532
800
  }
533
- e.forEach((a) => {
534
- var u, f;
535
- const o = ye({
536
- id: Q(a),
537
- colorId: ((u = ae(a, l.tags)) == null ? void 0 : u.color_id) ?? "",
538
- name: ((f = ae(a, l.tags)) == null ? void 0 : f.name) ?? "",
539
- state: Q(a) === a ? "selected" : "excluded"
801
+ t.forEach((r) => {
802
+ const l = Ce({
803
+ id: Q(r),
804
+ colorId: re(r, a.tags)?.color_id ?? "",
805
+ name: re(r, a.tags)?.name ?? "",
806
+ state: Q(r) === r ? "selected" : "excluded"
540
807
  });
541
- t.append(o);
808
+ e.append(l);
542
809
  });
543
- }, ye = (t) => {
544
- const l = document.createElement("div");
545
- return l.classList.add("top-tagSelector_tagIcon"), l.classList.toggle("top-tagSelector-active", !!t.state), l.classList.toggle("top-tagSelector-excluded", t.state === "excluded"), l.dataset.tag_id = t.id, l.dataset.tag_color_id = t.colorId, l.title = t.name, l;
546
- }, et = [
810
+ }, Ce = (e) => {
811
+ const a = document.createElement("div");
812
+ return a.classList.add("top-tagSelector_tagIcon"), a.classList.toggle("top-tagSelector-active", !!e.state), a.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), a.dataset.tag_id = e.id, a.dataset.tag_color_id = e.colorId, a.title = e.name, a;
813
+ }, Ct = [
547
814
  {
548
815
  id: "1",
549
816
  name: "Without Tag",
@@ -594,7 +861,7 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
594
861
  name: "Turquoise",
595
862
  color_id: "10"
596
863
  }
597
- ], tt = ["data-tag_id", "data-tag_color_id", "title"], ie = /* @__PURE__ */ U({
864
+ ], Tt = ["data-tag_id", "data-tag_color_id", "title"], ge = /* @__PURE__ */ j({
598
865
  __name: "tagIcon",
599
866
  props: {
600
867
  id: {},
@@ -602,21 +869,21 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
602
869
  name: {},
603
870
  state: {}
604
871
  },
605
- setup(t) {
606
- return (l, n) => (k(), b("div", {
872
+ setup(e) {
873
+ return (a, o) => (h(), b("div", {
607
874
  class: X({
608
875
  "top-tagSelector_tagIcon": !0,
609
- "top-tagSelector-active": !!l.state,
610
- "top-tagSelector-excluded": l.state === "excluded"
876
+ "top-tagSelector-active": !!e.state,
877
+ "top-tagSelector-excluded": e.state === "excluded"
611
878
  }),
612
- "data-tag_id": l.id,
613
- "data-tag_color_id": l.colorId,
614
- title: l.name
615
- }, null, 10, tt));
879
+ "data-tag_id": e.id,
880
+ "data-tag_color_id": e.colorId,
881
+ title: e.name
882
+ }, null, 10, Tt));
616
883
  }
617
- }), lt = ["contenteditable", "onKeydown"], pe = /* @__PURE__ */ U({
884
+ }), Bt = ["contenteditable", "onKeydown"], Te = /* @__PURE__ */ j({
618
885
  __name: "tagPopupListItem",
619
- props: /* @__PURE__ */ N({
886
+ props: /* @__PURE__ */ M({
620
887
  editable: { type: Boolean },
621
888
  disabled: { type: Boolean },
622
889
  canExclude: { type: Boolean },
@@ -630,76 +897,74 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
630
897
  },
631
898
  nameModifiers: {}
632
899
  }),
633
- emits: /* @__PURE__ */ N(["update:name", "unselect", "exclude", "select"], ["update:name"]),
634
- setup(t, { emit: l }) {
635
- const n = t, e = l, i = D(t, "name"), a = F(null), o = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
636
- contenteditable: u.value,
637
- onpaste: (g) => g.preventDefault()
638
- } : {}), u = F(!1), f = async () => {
639
- var g;
640
- u.value = !0, await Be(), (g = a.value) == null || g.focus();
641
- }, h = () => {
642
- var d;
643
- const g = (d = a.value) == null ? void 0 : d.innerText;
644
- if (!g) return S();
645
- a.value && (a.value.innerText = g), u.value = !1, e("update:name", g);
646
- }, S = async () => {
647
- a.value && (a.value.innerText = n.name), u.value = !1;
648
- }, r = (g) => {
649
- if (u.value || n.disabled) return;
650
- let d = "selected";
651
- n.canExclude && (g.ctrlKey || g.metaKey) && (d = "excluded"), n.state == d && (d = ""), d === "" && e("unselect"), d === "selected" && e("select"), d === "excluded" && e("exclude");
900
+ emits: /* @__PURE__ */ M(["update:name", "unselect", "exclude", "select"], ["update:name"]),
901
+ setup(e, { emit: a }) {
902
+ const o = e, t = a, r = A(e, "name"), l = G(null), n = E(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
903
+ contenteditable: d.value,
904
+ onpaste: (m) => m.preventDefault()
905
+ } : {}), d = G(!1), c = async () => {
906
+ d.value = !0, await Le(), l.value?.focus();
907
+ }, f = () => {
908
+ const m = l.value?.innerText;
909
+ if (!m) return I();
910
+ l.value && (l.value.innerText = m), d.value = !1, t("update:name", m);
911
+ }, I = async () => {
912
+ l.value && (l.value.innerText = o.name), d.value = !1;
913
+ }, i = (m) => {
914
+ if (d.value || o.disabled) return;
915
+ let u = "selected";
916
+ o.canExclude && (m.ctrlKey || m.metaKey) && (u = "excluded"), o.state == u && (u = ""), u === "" && t("unselect"), u === "selected" && t("select"), u === "excluded" && t("exclude");
652
917
  };
653
- return (g, d) => (k(), _(ue, {
918
+ return (m, u) => (h(), C(me, {
654
919
  class: X({
655
920
  "top-tagSelector_tagListItem": !0,
656
- "top-tagSelector_tagListItem-inEdit": u.value,
657
- "top-tagSelector_tagListItem-disabled": g.disabled,
658
- "top-tagSelector_tagListItem-canExclude": g.canExclude,
659
- "top-tagSelector-active": !!g.state,
660
- "top-tagSelector-excluded": g.state === "excluded"
921
+ "top-tagSelector_tagListItem-inEdit": d.value,
922
+ "top-tagSelector_tagListItem-disabled": e.disabled,
923
+ "top-tagSelector_tagListItem-canExclude": e.canExclude,
924
+ "top-tagSelector-active": !!e.state,
925
+ "top-tagSelector-excluded": e.state === "excluded"
661
926
  }),
662
- onClick: J(r, ["stop"])
927
+ onClick: F(i, ["stop"])
663
928
  }, {
664
- default: B(() => [
665
- A(ie, {
666
- id: g.id,
667
- name: i.value,
668
- colorId: g.colorId,
669
- state: g.state
929
+ default: T(() => [
930
+ L(ge, {
931
+ id: e.id,
932
+ name: r.value,
933
+ colorId: e.colorId,
934
+ state: e.state
670
935
  }, null, 8, ["id", "name", "colorId", "state"]),
671
- he("span", Se({
936
+ oe("span", Ae({
672
937
  ref_key: "elName",
673
- ref: a,
938
+ ref: l,
674
939
  class: "top-tagSelector_tagListItemName",
675
- contenteditable: u.value ? "plaintext-only" : !1
676
- }, o.value, {
940
+ contenteditable: d.value ? "plaintext-only" : !1
941
+ }, n.value, {
677
942
  onKeydown: [
678
- ge(J(h, ["stop"]), ["enter"]),
679
- ge(J(S, ["stop"]), ["esc"])
943
+ ye(F(f, ["stop"]), ["enter"]),
944
+ ye(F(I, ["stop"]), ["esc"])
680
945
  ]
681
- }), K(i.value), 17, lt),
682
- g.editable ? (k(), b(Y, { key: 0 }, [
683
- u.value ? (k(), b("span", {
946
+ }), V(r.value), 17, Bt),
947
+ e.editable ? (h(), b(Y, { key: 0 }, [
948
+ d.value ? (h(), b("span", {
684
949
  key: 1,
685
950
  "data-top-icon": "",
686
951
  class: "top-tagSelector_edit",
687
- onClick: J(h, ["stop"])
688
- })) : (k(), b("span", {
952
+ onClick: F(f, ["stop"])
953
+ })) : (h(), b("span", {
689
954
  key: 0,
690
955
  "data-top-icon": "",
691
956
  class: "top-tagSelector_edit",
692
- onClick: f
957
+ onClick: c
693
958
  }))
694
- ], 64)) : q("", !0)
959
+ ], 64)) : O("", !0)
695
960
  ]),
696
961
  _: 1
697
962
  }, 8, ["class"]));
698
963
  }
699
- }), at = { key: 1 }, ot = /* @__PURE__ */ U({
964
+ }), At = { key: 1 }, bt = /* @__PURE__ */ j({
700
965
  inheritAttrs: !1,
701
966
  __name: "popupOpener",
702
- props: /* @__PURE__ */ N({
967
+ props: /* @__PURE__ */ M({
703
968
  modelValue: {},
704
969
  id: {},
705
970
  tags: {},
@@ -716,65 +981,62 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
716
981
  modelModifiers: {}
717
982
  }),
718
983
  emits: ["update:modelValue"],
719
- setup(t) {
720
- const l = t, n = D(t, "modelValue"), e = l.useTopButton ? H : "div", i = l.useTopButton ? "html" : "default", a = {
721
- model: n,
722
- mode: l.mode,
723
- targetId: l.targetId,
724
- filters: l.filters,
725
- payload: l.payload
984
+ setup(e) {
985
+ const a = e, o = A(e, "modelValue"), t = a.useTopButton ? H : "div", r = a.useTopButton ? "html" : "default", l = {
986
+ model: o,
987
+ mode: a.mode,
988
+ targetId: a.targetId,
989
+ filters: a.filters,
990
+ payload: a.payload
726
991
  };
727
- return (o, u) => {
728
- const f = _e("top-data");
729
- return k(), _(Fe, { id: o.id }, {
730
- default: B(() => [
731
- be((k(), _(Ve(y(e)), Se({
992
+ return (n, d) => {
993
+ const c = Ne("top-data");
994
+ return h(), C(ze, { id: e.id }, {
995
+ default: T(() => [
996
+ Pe((h(), C(De(v(t)), Ae({
732
997
  class: {
733
998
  "top-tagSelector": !0,
734
- "top-tagSelector-useTopButton": l.useTopButton,
735
- "top-tagSelector-custom": !l.useTopButton,
736
- "top-as-selector": l.useTopButton,
737
- "top-tagSelector-filter": l.mode === "filter",
738
- "top-tagSelector-setter_single": l.mode === "setter" && !o.filters,
739
- "top-tagSelector-setter_several": l.mode === "setter" && o.filters,
740
- "top-tagSelector-selectedOne": !n.value.length || n.value.length === 1,
741
- "top-tagSelector-toTwoLine": n.value.length > 5
999
+ "top-tagSelector-useTopButton": a.useTopButton,
1000
+ "top-tagSelector-custom": !a.useTopButton,
1001
+ "top-as-selector": a.useTopButton,
1002
+ "top-tagSelector-filter": a.mode === "filter",
1003
+ "top-tagSelector-setter_single": a.mode === "setter" && !e.filters,
1004
+ "top-tagSelector-setter_several": a.mode === "setter" && e.filters,
1005
+ "top-tagSelector-selectedOne": !o.value.length || o.value.length === 1,
1006
+ "top-tagSelector-toTwoLine": o.value.length > 5
742
1007
  },
743
1008
  color: "theme",
744
- styling: o.styling
745
- }, o.$attrs), {
746
- [y(i)]: B(() => [
747
- !n.value.length && o.mode === "filter" ? (k(), _(ie, {
1009
+ styling: e.styling
1010
+ }, n.$attrs), {
1011
+ [v(r)]: T(() => [
1012
+ !o.value.length && e.mode === "filter" ? (h(), C(ge, {
748
1013
  key: 0,
749
1014
  id: "all",
750
1015
  colorId: "",
751
- name: o.$i18n.Common.All_tags ?? "",
1016
+ name: n.$i18n.Common.All_tags ?? "",
752
1017
  state: ""
753
- }, null, 8, ["name"])) : q("", !0),
754
- o.mode === "setter" && o.filters ? (k(), b("div", at, [
755
- Ee(o.$slots, "default")
756
- ])) : (k(!0), b(Y, { key: 2 }, se(n.value, (h) => {
757
- var S, r;
758
- return k(), _(ie, {
759
- id: y(Q)(h),
760
- colorId: ((S = y(ae)(h, o.tags)) == null ? void 0 : S.color_id) ?? "",
761
- name: ((r = y(ae)(h, o.tags)) == null ? void 0 : r.name) ?? "",
762
- state: y(Q)(h) === h ? "selected" : "excluded"
763
- }, null, 8, ["id", "colorId", "name", "state"]);
764
- }), 256))
1018
+ }, null, 8, ["name"])) : O("", !0),
1019
+ e.mode === "setter" && e.filters ? (h(), b("div", At, [
1020
+ qe(n.$slots, "default")
1021
+ ])) : (h(!0), b(Y, { key: 2 }, fe(o.value, (f) => (h(), C(ge, {
1022
+ id: v(Q)(f),
1023
+ colorId: v(re)(f, e.tags)?.color_id ?? "",
1024
+ name: v(re)(f, e.tags)?.name ?? "",
1025
+ state: v(Q)(f) === f ? "selected" : "excluded"
1026
+ }, null, 8, ["id", "colorId", "name", "state"]))), 256))
765
1027
  ]),
766
1028
  _: 2
767
1029
  }, 1040, ["class", "styling"])), [
768
- [f, a, "topTagSelectorTarget"]
1030
+ [c, l, "topTagSelectorTarget"]
769
1031
  ])
770
1032
  ]),
771
1033
  _: 3
772
1034
  }, 8, ["id"]);
773
1035
  };
774
1036
  }
775
- }), St = /* @__PURE__ */ U({
1037
+ }), _t = /* @__PURE__ */ j({
776
1038
  __name: "tagSelector",
777
- props: /* @__PURE__ */ N({
1039
+ props: /* @__PURE__ */ M({
778
1040
  modelValue: {},
779
1041
  tags: {},
780
1042
  tagsEditable: { type: Boolean },
@@ -792,180 +1054,177 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
792
1054
  },
793
1055
  modelModifiers: {},
794
1056
  tags: {
795
- default: $e(et)
1057
+ default: Be(Ct)
796
1058
  },
797
1059
  tagsModifiers: {}
798
1060
  }),
799
- emits: /* @__PURE__ */ N(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
800
- setup(t, { emit: l }) {
801
- const n = R(), e = t, i = D(t, "modelValue"), a = D(t, "tags"), o = l, u = we((s, c) => {
802
- o(s, c);
803
- }, e.emitDelay);
804
- e.singleMode && !i.value.length && (i.value = [a.value[0].id]);
805
- const f = e.id ?? "top-popup-id-" + Math.random(), h = F("add"), S = () => {
806
- var v;
807
- const s = " " + ((v = n.Common.Tags) == null ? void 0 : v.toLowerCase()), c = /* @__PURE__ */ new Map();
808
- return c.set("add", { value: "add", title: n.Common.Add + s }), c.set("replace", { value: "replace", title: n.Common.Replace + s }), c.set("delete", { value: "delete", title: n.Common.Delete + s }), c;
1061
+ emits: /* @__PURE__ */ M(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
1062
+ setup(e, { emit: a }) {
1063
+ const o = w(), t = e, r = A(e, "modelValue"), l = A(e, "tags"), n = a, d = _e((p, S) => {
1064
+ n(p, S);
1065
+ }, t.emitDelay);
1066
+ t.singleMode && !r.value.length && (r.value = [l.value[0].id]);
1067
+ const c = t.id ?? "top-popup-id-" + Math.random(), f = G("add"), I = () => {
1068
+ const p = " " + o.Common.Tags?.toLowerCase(), S = /* @__PURE__ */ new Map();
1069
+ return S.set("add", { value: "add", title: o.Common.Add + p }), S.set("replace", { value: "replace", title: o.Common.Replace + p }), S.set("delete", { value: "delete", title: o.Common.Delete + p }), S;
809
1070
  };
810
- let r = Me({
811
- model: i,
1071
+ let i = Ue({
1072
+ model: r,
812
1073
  mode: "filter",
813
1074
  targetId: void 0,
814
1075
  filters: void 0,
815
1076
  payload: void 0
816
1077
  });
817
- w(i, () => {
818
- u("selector", i.value);
1078
+ B(r, () => {
1079
+ d("selector", r.value);
819
1080
  });
820
- const g = E(() => {
821
- if (r.value.mode === "setter" && e.maxTagsForSetter && !r.value.filters)
822
- return r.value.model.value.length >= e.maxTagsForSetter;
823
- }), d = (s) => {
824
- if (s !== "all") {
825
- if (r.value.model.value.includes(s)) return "selected";
826
- if (r.value.model.value.includes(ve(s))) return "excluded";
1081
+ const m = E(() => {
1082
+ if (i.value.mode === "setter" && t.maxTagsForSetter && !i.value.filters)
1083
+ return i.value.model.value.length >= t.maxTagsForSetter;
1084
+ }), u = (p) => {
1085
+ if (p !== "all") {
1086
+ if (i.value.model.value.includes(p)) return "selected";
1087
+ if (i.value.model.value.includes(ke(p))) return "excluded";
827
1088
  }
828
- return s === "all" && !r.value.model.value.length ? "selected" : "";
829
- }, x = (s, c) => {
830
- const v = ve(s);
831
- let I = r.value.model.value.filter((L) => L !== s && L !== v);
832
- c === "select" && I.push(s), c === "exclude" && I.push(v), r.value.mode === "setter" && r.value.targetId !== void 0 && e.requiredForSetter && (I.length || I.push("1"), I.length === 2 && r.value.model.value.length === 1 && r.value.model.value[0] === "1" && (I = I.filter((L) => L !== "1"))), e.singleMode && !r.value.filters && (I.length || (I = r.value.model.value), I.length > 1 && (I = [I[I.length - 1]])), I.sort((L, P) => {
833
- if (!e.tags) return 0;
834
- const Z = e.tags.findIndex((O) => O.id === L), z = e.tags.findIndex((O) => O.id === P);
835
- return Z - z;
836
- }), r.value.model.value = I, r.value.mode === "setter" && r.value.targetId !== void 0 && u("setter", {
837
- tagsIds: I,
838
- targetId: r.value.targetId,
839
- payload: r.value.payload
1089
+ return p === "all" && !i.value.model.value.length ? "selected" : "";
1090
+ }, s = (p, S) => {
1091
+ const x = ke(p);
1092
+ let k = i.value.model.value.filter((K) => K !== p && K !== x);
1093
+ S === "select" && k.push(p), S === "exclude" && k.push(x), i.value.mode === "setter" && i.value.targetId !== void 0 && t.requiredForSetter && (k.length || k.push("1"), k.length === 2 && i.value.model.value.length === 1 && i.value.model.value[0] === "1" && (k = k.filter((K) => K !== "1"))), t.singleMode && !i.value.filters && (k.length || (k = i.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, ee) => {
1094
+ if (!t.tags) return 0;
1095
+ const D = t.tags.findIndex((U) => U.id === K), q = t.tags.findIndex((U) => U.id === ee);
1096
+ return D - q;
1097
+ }), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && d("setter", {
1098
+ tagsIds: k,
1099
+ targetId: i.value.targetId,
1100
+ payload: i.value.payload
840
1101
  });
841
- }, C = E(() => {
842
- let s = "top-tagSelector_popup";
843
- return r.value.mode === "filter" && (s += " top-tagSelector_popup-filter"), r.value.mode === "setter" && (s += " top-tagSelector_popup-setter"), s;
844
- }), T = () => {
845
- const s = prompt("", "New tag");
846
- if (!s || s === "New tag") return;
847
- const c = a.value.length + 1;
848
- a.value.push({
849
- id: String(c),
850
- name: s,
851
- color_id: String((c - 1) % 10 + 1)
852
- }), o("tagsChanged", a.value);
853
- }, V = (s) => {
854
- var c;
855
- if (r.value = W(s.elPopupOpener, "topTagSelectorTarget"), !r.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
856
- if (r.value.filters && (h.value = "add", r.value.model.value = []), !((c = j.$) != null && c.ui.sortable)) {
1102
+ }, g = E(() => {
1103
+ let p = "top-tagSelector_popup";
1104
+ return i.value.mode === "filter" && (p += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (p += " top-tagSelector_popup-setter"), p;
1105
+ }), Z = () => {
1106
+ const p = prompt("", "New tag");
1107
+ if (!p || p === "New tag") return;
1108
+ const S = l.value.length + 1;
1109
+ l.value.push({
1110
+ id: String(S),
1111
+ name: p,
1112
+ color_id: String((S - 1) % 10 + 1)
1113
+ }), n("tagsChanged", l.value);
1114
+ }, P = (p) => {
1115
+ if (i.value = J(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
1116
+ if (i.value.filters && (f.value = "add", i.value.model.value = []), !_.$?.ui.sortable) {
857
1117
  console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
858
1118
  return;
859
1119
  }
860
- !j.state.isMobile && !j.state.isMobileUA && a.value && $(s.elPopup).sortable({
1120
+ !_.state.isMobile && !_.state.isMobileUA && l.value && $(p.elPopup).sortable({
861
1121
  items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
862
1122
  /**
863
1123
  * @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
864
1124
  */
865
1125
  cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
866
1126
  distance: 10,
867
- stop: function(v, I) {
868
- if (!a.value) return;
869
- const L = $(I.item).parent().find("[data-tag_id]"), P = [];
870
- L.each((Z, z) => {
871
- if (!a.value) return;
872
- const O = $(z).attr("data-tag_id");
873
- P.push(O);
874
- }), a.value.sort((Z, z) => {
875
- const O = P.findIndex((oe) => oe === Z.id), Ce = P.findIndex((oe) => oe === z.id);
876
- return O - Ce;
877
- }), u("tagsChanged", a.value);
1127
+ stop: function(S, x) {
1128
+ if (!l.value) return;
1129
+ const k = $(x.item).parent().find("[data-tag_id]"), K = [];
1130
+ k.each((ee, D) => {
1131
+ if (!l.value) return;
1132
+ const q = $(D).attr("data-tag_id");
1133
+ K.push(q);
1134
+ }), l.value.sort((ee, D) => {
1135
+ const q = K.findIndex((ie) => ie === ee.id), U = K.findIndex((ie) => ie === D.id);
1136
+ return q - U;
1137
+ }), d("tagsChanged", l.value);
878
1138
  }
879
1139
  });
880
- }, m = (s) => {
881
- var c;
882
- (c = j.$) != null && c.ui.sortable && $(s.elPopup).data("ui-sortable") && $(s.elPopup).sortable("destroy");
1140
+ }, je = (p) => {
1141
+ _.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
883
1142
  };
884
- return (s, c) => (k(), b(Y, null, [
885
- A(ot, {
886
- modelValue: i.value,
887
- "onUpdate:modelValue": c[0] || (c[0] = (v) => i.value = v),
888
- id: y(f),
889
- tags: a.value,
890
- styling: s.styling,
1143
+ return (p, S) => (h(), b(Y, null, [
1144
+ L(bt, {
1145
+ modelValue: r.value,
1146
+ "onUpdate:modelValue": S[0] || (S[0] = (x) => r.value = x),
1147
+ id: v(c),
1148
+ tags: l.value,
1149
+ styling: e.styling,
891
1150
  mode: "filter",
892
- useTopButton: s.useTopButton
1151
+ useTopButton: e.useTopButton
893
1152
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
894
- A(Ie, {
895
- id: y(f),
896
- class: X(C.value),
897
- onOpen: c[4] || (c[4] = (v) => V(v)),
898
- onClose: c[5] || (c[5] = (v) => m(v)),
1153
+ L(be, {
1154
+ id: v(c),
1155
+ class: X(g.value),
1156
+ onOpen: S[4] || (S[4] = (x) => P(x)),
1157
+ onClose: S[5] || (S[5] = (x) => je(x)),
899
1158
  "transition-duration": 50
900
- }, Ke({
901
- contentList: B(() => [
902
- y(r).mode === "filter" && !s.singleMode ? (k(), _(pe, {
1159
+ }, Fe({
1160
+ contentList: T(() => [
1161
+ v(i).mode === "filter" && !e.singleMode ? (h(), C(Te, {
903
1162
  key: 0,
904
1163
  id: "all",
905
1164
  colorId: "",
906
- name: s.$i18n.Common.All_tags ?? "",
907
- state: y(r).model.value.length ? "" : "selected",
908
- onSelect: c[3] || (c[3] = (v) => y(r).model.value = [])
909
- }, null, 8, ["name", "state"])) : q("", !0),
910
- (k(!0), b(Y, null, se(a.value, (v) => (k(), _(pe, {
911
- key: v.id,
912
- id: v.id,
913
- colorId: v.color_id,
914
- name: v.name,
915
- state: d(v.id),
916
- canExclude: y(r).mode === "filter" && !s.singleMode,
917
- editable: s.tagsEditable,
918
- disabled: g.value && d(v.id) === "",
919
- onUnselect: (I) => x(v.id, "unselect"),
920
- onSelect: (I) => x(v.id, "select"),
921
- onExclude: (I) => x(v.id, "exclude"),
922
- "onUpdate:name": (I) => {
923
- v.name = I, y(u)("tagsChanged", a.value);
1165
+ name: p.$i18n.Common.All_tags ?? "",
1166
+ state: v(i).model.value.length ? "" : "selected",
1167
+ onSelect: S[3] || (S[3] = (x) => v(i).model.value = [])
1168
+ }, null, 8, ["name", "state"])) : O("", !0),
1169
+ (h(!0), b(Y, null, fe(l.value, (x) => (h(), C(Te, {
1170
+ key: x.id,
1171
+ id: x.id,
1172
+ colorId: x.color_id,
1173
+ name: x.name,
1174
+ state: u(x.id),
1175
+ canExclude: v(i).mode === "filter" && !e.singleMode,
1176
+ editable: e.tagsEditable,
1177
+ disabled: m.value && u(x.id) === "",
1178
+ onUnselect: (k) => s(x.id, "unselect"),
1179
+ onSelect: (k) => s(x.id, "select"),
1180
+ onExclude: (k) => s(x.id, "exclude"),
1181
+ "onUpdate:name": (k) => {
1182
+ x.name = k, v(d)("tagsChanged", l.value);
924
1183
  }
925
1184
  }, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
926
- s.tagsEditable && a.value.length < s.tagsMax && a.value.length < 20 ? (k(), _(ue, {
1185
+ e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(me, {
927
1186
  key: 1,
928
1187
  "data-top-icon": "",
929
- onClick: J(T, ["stop"])
1188
+ onClick: F(Z, ["stop"])
930
1189
  }, {
931
- default: B(() => [
932
- G(K(s.$i18n.Common.Add), 1)
1190
+ default: T(() => [
1191
+ z(V(p.$i18n.Common.Add), 1)
933
1192
  ]),
934
1193
  _: 1
935
- })) : q("", !0)
1194
+ })) : O("", !0)
936
1195
  ]),
937
1196
  _: 2
938
1197
  }, [
939
- y(r).mode === "setter" && y(r).filters ? {
1198
+ v(i).mode === "setter" && v(i).filters ? {
940
1199
  name: "header",
941
- fn: B(() => [
942
- A(re, {
943
- modelValue: h.value,
944
- "onUpdate:modelValue": c[1] || (c[1] = (v) => h.value = v),
945
- options: S()
1200
+ fn: T(() => [
1201
+ L(se, {
1202
+ modelValue: f.value,
1203
+ "onUpdate:modelValue": S[1] || (S[1] = (x) => f.value = x),
1204
+ options: I()
946
1205
  }, null, 8, ["modelValue", "options"])
947
1206
  ]),
948
1207
  key: "0"
949
1208
  } : void 0,
950
- y(r).mode === "setter" && y(r).filters ? {
1209
+ v(i).mode === "setter" && v(i).filters ? {
951
1210
  name: "footer",
952
- fn: B(() => [
953
- A(H, { color: "theme" }, {
954
- default: B(() => [
955
- G(K(s.$i18n.Common.Cancel), 1)
1211
+ fn: T(() => [
1212
+ L(H, { color: "theme" }, {
1213
+ default: T(() => [
1214
+ z(V(p.$i18n.Common.Cancel), 1)
956
1215
  ]),
957
1216
  _: 1
958
1217
  }),
959
- A(H, {
960
- onClick: c[2] || (c[2] = (v) => y(u)("setter", {
961
- tagsIds: y(r).model.value,
962
- filters: y(r).filters,
963
- filtersAction: h.value,
964
- payload: y(r).payload
1218
+ L(H, {
1219
+ onClick: S[2] || (S[2] = (x) => v(d)("setter", {
1220
+ tagsIds: v(i).model.value,
1221
+ filters: v(i).filters,
1222
+ filtersAction: f.value,
1223
+ payload: v(i).payload
965
1224
  }))
966
1225
  }, {
967
- default: B(() => [
968
- G(K(h.value === "add" ? s.$i18n.Common.Add : "") + " " + K(h.value === "replace" ? s.$i18n.Common.Replace : "") + " " + K(h.value === "delete" ? s.$i18n.Common.Delete : ""), 1)
1226
+ default: T(() => [
1227
+ z(V(f.value === "add" ? p.$i18n.Common.Add : "") + " " + V(f.value === "replace" ? p.$i18n.Common.Replace : "") + " " + V(f.value === "delete" ? p.$i18n.Common.Delete : ""), 1)
969
1228
  ]),
970
1229
  _: 1
971
1230
  })
@@ -977,16 +1236,19 @@ const qe = { class: "top-selectorCompetitors" }, Ue = { class: "top-ellipsis1" }
977
1236
  }
978
1237
  });
979
1238
  export {
980
- ft as TopSelectorCompetitors,
981
- yt as TopSelectorRegion,
982
- St as TopTagSelector,
983
- ot as TopTagSelectorPopupOpener,
984
- ie as TopTagSelectorTagIcon,
985
- Ye as dialogSelectorRegions,
986
- We as findRegion,
987
- pt as genElTopTagSelectorPopupOpener,
988
- ke as genSearcherByKey,
989
- ht as renderElTopTagSelectorPopupOpener,
990
- vt as useItemsFromCompetitors
1239
+ Nt as TopCompetitorSelector,
1240
+ qt as TopGroupSelector,
1241
+ Dt as TopRegionSelector,
1242
+ Nt as TopSelectorCompetitors,
1243
+ Dt as TopSelectorRegion,
1244
+ _t as TopTagSelector,
1245
+ bt as TopTagSelectorPopupOpener,
1246
+ ge as TopTagSelectorTagIcon,
1247
+ dt as dialogRegionSelector,
1248
+ it as findRegion,
1249
+ Ut as genElTopTagSelectorPopupOpener,
1250
+ Ee as genSearcherByKey,
1251
+ Ft as renderElTopTagSelectorPopupOpener,
1252
+ Pt as useItemsFromCompetitors
991
1253
  };
992
1254
  //# sourceMappingURL=project.js.map